Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
commit-slab.h: avoid -Wsign-compare warnings
author
Ramsay Jones
<ramsay@ramsayjones.plus.com>
Thu, 21 Sep 2017 16:47:36 +0000
(17:47 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 22 Sep 2017 04:00:36 +0000
(13:00 +0900)
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-slab.h
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
73560c7
)
diff --git
a/commit-slab.h
b/commit-slab.h
index 333d81e370b188aae2110860df9eaff7b9d9582f..dcaab8ca0437b3adefb523cad531ac1f4b9264e0 100644
(file)
--- a/
commit-slab.h
+++ b/
commit-slab.h
@@
-78,7
+78,7
@@
static MAYBE_UNUSED void init_ ##slabname(struct slabname *s) \
\
static MAYBE_UNUSED void clear_ ##slabname(struct slabname *s) \
{ \
\
static MAYBE_UNUSED void clear_ ##slabname(struct slabname *s) \
{ \
-
int i;
\
+
unsigned int i;
\
for (i = 0; i < s->slab_count; i++) \
free(s->slab[i]); \
s->slab_count = 0; \
for (i = 0; i < s->slab_count; i++) \
free(s->slab[i]); \
s->slab_count = 0; \
@@
-89,13
+89,13
@@
static MAYBE_UNUSED elemtype *slabname## _at_peek(struct slabname *s, \
const struct commit *c, \
int add_if_missing) \
{ \
const struct commit *c, \
int add_if_missing) \
{ \
-
int nth_slab, nth_slot;
\
+
unsigned int nth_slab, nth_slot;
\
\
nth_slab = c->index / s->slab_size; \
nth_slot = c->index % s->slab_size; \
\
if (s->slab_count <= nth_slab) { \
\
nth_slab = c->index / s->slab_size; \
nth_slot = c->index % s->slab_size; \
\
if (s->slab_count <= nth_slab) { \
-
int i;
\
+
unsigned int i;
\
if (!add_if_missing) \
return NULL; \
REALLOC_ARRAY(s->slab, nth_slab + 1); \
if (!add_if_missing) \
return NULL; \
REALLOC_ARRAY(s->slab, nth_slab + 1); \