[LiSA-Devel] Comments on 4069be7

Andreea-Cristina Hodea andreea.cristina.hodea at gmail.com
Wed Mar 6 20:29:11 EET 2013


On Wed, Mar 6, 2013 at 11:04 AM, Radu Rendec <radu.rendec at mindbit.ro> wrote:
> Since you're not doing anything to the arguments (except for casting)
> and to the return value, I guess you can do something like this:
>
> typedef int(*qsort_compare)(const void *, const void *);
>
> And then cast the strcmp symbol to this type before passing it to
> qsort() - something like this:
>
> qsort( ... , (qsort_compare)strcmp)
>
> I haven't tested this, though :)

I have tried this way on a simple example with array of strings and
the array is not sorted properly at the end.

The updated sorting is already pushed. The argument with small stack
was enough and I went with malloc instead.

Andreea


More information about the LiSA-Devel mailing list