commit-slab.h: avoid -Wsign-compare warnings

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramsay Jones committed Sep 21, 2017 at 17:47 UTC fddfedc361b56195503d885874ed1162f66c773c
1 file changed +3 -3
commit-slab.h
+3 -3
@@ -78,7 +78,7 @@ static MAYBE_UNUSED void init_ ##slabname(struct slabname *s) \
78 \
79 static MAYBE_UNUSED void clear_ ##slabname(struct slabname *s) \
80 { \
81 - int i; \
81 + unsigned int i; \
82 for (i = 0; i < s->slab_count; i++) \
83 free(s->slab[i]); \
84 s->slab_count = 0; \
@@ -89,13 +89,13 @@ static MAYBE_UNUSED elemtype *slabname## _at_peek(struct slabname *s, \
89 const struct commit *c, \
90 int add_if_missing) \
91 { \
92 - int nth_slab, nth_slot; \
92 + unsigned int nth_slab, nth_slot; \
93 \
94 nth_slab = c->index / s->slab_size; \
95 nth_slot = c->index % s->slab_size; \
96 \
97 if (s->slab_count <= nth_slab) { \
98 - int i; \
98 + unsigned int i; \
99 if (!add_if_missing) \
100 return NULL; \
101 REALLOC_ARRAY(s->slab, nth_slab + 1); \