Re: t5505-remote fails on Windows
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 19, 2009, 11:02 UTC
- Message-ID
- <7vhc1pai84.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.DEB.1.00.0903191135530.10279@pacific.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 15 quoted lines
> On Thu, 19 Mar 2009, Jeff King wrote:
>
>> @@ -163,9 +163,15 @@ static int cmp_items(const void *a, const void *b)
>> return strcmp(one->string, two->string);
>> }
>>
>> +void sort_string_list_with_fn(struct string_list *list,
>> + int (*fn)(const void *, const void *))
>> +{
>> + qsort(list->items, list->nr, sizeof(*list->items), fn);
>> +}
>> +
>
> Do we really want an API for that? Calling qsort() directly should be
> obvious enough, no?I think so. If it were done like this (notice the lack of double indirection in the cmp_fn signature):
typedef int string_list_item_cmp_fn(const struct string_list_item *, const struct string_list_item *);
void sort_string_list_with_fn(struct string_list *list, string_list_item_cmp_fn *);
it would have made more sense, though.