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

From: Junio C Hamano <[email-masked]>
Date: Sat, 05 Jul 2008 17:57:15 -0700

Ramsay Jones <[email-masked]> writes:

> Junio C Hamano wrote:
> ...
>>> @@ -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.