Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15

Re: [PATCH/RFC] Fix some warnings (on cygwin) to allow -Werror

From: Ramsay Jones <hidden>
Date: 2016-06-15 22:44:55

Junio C Hamano wrote:
Ramsay Jones [off-list ref] writes:
quoted
Junio C Hamano wrote:
...
quoted
quoted
@@ -1718,7 +1720,8 @@ static int add_ref_tag(const char *path, const unsigned char *sha1, int flag, vo
 static void prepare_pack(int window, int depth)
 {
 	struct object_entry **delta_list;
-	uint32_t i, n, nr_deltas;
+	uint32_t i, nr_deltas;
+	unsigned n;
Hmm.  Is this change necessary?
Yes, otherwise:

builtin-pack-objects.c: In function `prepare_pack':
builtin-pack-objects.c:1760: warning: passing arg 2 of `find_deltas' from incompatible pointer type
make: *** [builtin-pack-objects.o] Error 1

Note that ll_find_deltas() is #defined to find_deltas() in the #else arm
of #ifdef THREADED_DELTA_SEARCH, and find_deltas() takes an "unsigned *"
Ah, I missed that.  So it is not just warning squelch but is a bugfix in
case unsigned and uint32_t are of different sizes.
Yes, but I didn't think about that when I "fixed" it ;-)

ATB,

Ramsay Jones
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help