Re: t5505-remote fails on Windows
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 19, 2009, 23:15 UTC
- Message-ID
- <alpine.DEB.1.00.0903200014370.10279@pacific.mpi-cbg.de>
- In-Reply-To
- <20090319200308.GB17028@coredump.intra.peff.net>
Hi,
On Thu, 19 Mar 2009, Jeff King wrote:
Show 19 quoted lines
> On Thu, Mar 19, 2009 at 04:02:19AM -0700, Junio C Hamano wrote: > > > > 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. > > IIRC, that is actually not valid C according to the standard (that is, > even though a void* can be implicitly assigned to any other pointer, a > function taking a void* and a function taking another pointer do not > necessarily have the same function signature or calling conventions). > Which is why cmp_items in string-list.c already does the indirection.
AFAICT the idea was not to pass the function to qsort() directly, but I have to agree that I do not see how that should be possible with the current interface of qsort();
Ciao, Dscho