Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-03-30 17:03:20 +0300
committerJunio C Hamano <gitster@pobox.com>2020-03-30 20:59:08 +0300
commiteccce5253b9bfb17238f7d94c9ccf1cfd935eeb2 (patch)
tree1246e979d2523a258c5062327b96fe6f44dc51b5 /sha1-array.c
parent600bee4e70a1672bf1e8d50c3afd02090f1f32ae (diff)
oid_array: use size_t for iteration
The previous commit started using size_t for our allocations. There are some iterations that use int or unsigned, though. These aren't dangerous with respect to memory, but they could produce incorrect results. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1-array.c')
-rw-r--r--sha1-array.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sha1-array.c b/sha1-array.c
index 3eeadfede9..bada0c4353 100644
--- a/sha1-array.c
+++ b/sha1-array.c
@@ -46,7 +46,7 @@ int oid_array_for_each(struct oid_array *array,
for_each_oid_fn fn,
void *data)
{
- int i;
+ size_t i;
/* No oid_array_sort() here! See sha1-array.h */
@@ -62,7 +62,7 @@ int oid_array_for_each_unique(struct oid_array *array,
for_each_oid_fn fn,
void *data)
{
- int i;
+ size_t i;
if (!array->sorted)
oid_array_sort(array);
@@ -82,7 +82,7 @@ void oid_array_filter(struct oid_array *array,
for_each_oid_fn want,
void *cb_data)
{
- unsigned nr = array->nr, src, dst;
+ size_t nr = array->nr, src, dst;
struct object_id *oids = array->oid;
for (src = dst = 0; src < nr; src++) {