On Sat, Oct 24, 2015 at 7:04 PM, wm4 wrote:
> On Sat, 24 Oct 2015 18:02:36 -0400
> Ganesh Ajjanagadde wrote:
>
>> For generality, qsort uses a comparator whose elements are void *. This
>> makes the comparator have such a form, and thus makes the void * cast of
>> the comparator pointer useless.
On Sat, Oct 24, 2015 at 7:07 PM, Henrik Gramner wrote:
> On Sun, Oct 25, 2015 at 12:02 AM, Ganesh Ajjanagadde
> wrote:
>> -static int cmp(const double *a, const double *b)
>> +static int cmp(const void *a, const void *b)
>> {
>> -return *a < *b ? -1 : ( *a > *b ? 1 : 0 );
>> +double va =
On Sun, Oct 25, 2015 at 12:02 AM, Ganesh Ajjanagadde
wrote:
> -static int cmp(const double *a, const double *b)
> +static int cmp(const void *a, const void *b)
> {
> -return *a < *b ? -1 : ( *a > *b ? 1 : 0 );
> +double va = *(double *)a, vb = *(double *)b;
> +return va < vb ? -1 : (
On Sat, 24 Oct 2015 18:02:36 -0400
Ganesh Ajjanagadde wrote:
> For generality, qsort uses a comparator whose elements are void *. This
> makes the comparator have such a form, and thus makes the void * cast of
> the comparator pointer useless. Furthermore, this makes the code more
> consistent wi
For generality, qsort uses a comparator whose elements are void *. This
makes the comparator have such a form, and thus makes the void * cast of
the comparator pointer useless. Furthermore, this makes the code more
consistent with other usages of qsort across the codebase.
Signed-off-by: Ganesh Aj