Skip to content

Commit fddfedc

Browse files
ramsay-jonesgitster
authored andcommitted
commit-slab.h: avoid -Wsign-compare warnings
Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 73560c7 commit fddfedc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

commit-slab.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static MAYBE_UNUSED void init_ ##slabname(struct slabname *s) \
7878
\
7979
static MAYBE_UNUSED void clear_ ##slabname(struct slabname *s) \
8080
{ \
81-
int i; \
81+
unsigned int i; \
8282
for (i = 0; i < s->slab_count; i++) \
8383
free(s->slab[i]); \
8484
s->slab_count = 0; \
@@ -89,13 +89,13 @@ static MAYBE_UNUSED elemtype *slabname## _at_peek(struct slabname *s, \
8989
const struct commit *c, \
9090
int add_if_missing) \
9191
{ \
92-
int nth_slab, nth_slot; \
92+
unsigned int nth_slab, nth_slot; \
9393
\
9494
nth_slab = c->index / s->slab_size; \
9595
nth_slot = c->index % s->slab_size; \
9696
\
9797
if (s->slab_count <= nth_slab) { \
98-
int i; \
98+
unsigned int i; \
9999
if (!add_if_missing) \
100100
return NULL; \
101101
REALLOC_ARRAY(s->slab, nth_slab + 1); \

0 commit comments

Comments
 (0)