diff options
author | Russell Belfer <rb@github.com> | 2012-11-21 23:03:07 +0400 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-11-28 01:18:29 +0400 |
commit | 16248ee2d1d67bd386277bca67f04049afef875e (patch) | |
tree | 2ae7078fbe8aa91dd0d094afc0a38c33a4cb6732 /src/iterator.c | |
parent | f45d51ff8e04c6849413c13aedcf5abacc3c69bd (diff) |
Fix up some missing consts in tree & index
This fixes some missed places where we can apply const-ness to
various public APIs.
There are still some index and tree APIs that cannot take const
pointers because we sort our `git_vectors` lazily and so we can't
reliably bsearch the index and tree content without applying a
`git_vector_sort()` first.
This also fixes some missed places where size_t can be used and
where const can be applied to a couple internal functions.
Diffstat (limited to 'src/iterator.c')
-rw-r--r-- | src/iterator.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/iterator.c b/src/iterator.c index 469913d3b..a68a0050b 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -434,7 +434,7 @@ typedef struct workdir_iterator_frame workdir_iterator_frame; struct workdir_iterator_frame { workdir_iterator_frame *next; git_vector entries; - unsigned int index; + size_t index; char *start; }; @@ -761,7 +761,8 @@ static int spoolandsort_iterator__current( spoolandsort_iterator *si = (spoolandsort_iterator *)self; if (si->position < si->entries.length) - *entry = (const git_index_entry *)git_vector_get_const(&si->entries, si->position); + *entry = (const git_index_entry *)git_vector_get( + &si->entries, si->position); else *entry = NULL; @@ -781,7 +782,8 @@ static int spoolandsort_iterator__advance( spoolandsort_iterator *si = (spoolandsort_iterator *)self; if (si->position < si->entries.length) - *entry = (const git_index_entry *)git_vector_get_const(&si->entries, ++si->position); + *entry = (const git_index_entry *)git_vector_get( + &si->entries, ++si->position); else *entry = NULL; |