Subject: Re: Making more LP64 friendly.
To: None <>
From: Christos Zoulas <>
List: tech-kern
Date: 11/23/2003 19:35:48
In article <>,
Matt Thomas <> wrote:
>I like to commit the following changes to <sys/tree.h>.  The primary
>changes is to add a bit of const poisoning and to make the comparision
>routine return long instead of int.  On a LP64 platform, the current
>use of int makes doing (note the additional const poisoning)
>cmp(const struct type *a, const struct type *b)
>   return b->f - a->f;
>impossible if f is wider than an int.  That's an unneeded complication.

Traditionally comparison functions have the signature:

int cmp(const void *, const void *)

I guess here the user does not specify the comparison function, so you
are right that we don't need the extra complication to convert the result
from a long to an int.