Subject: Re: Making more LP64 friendly.
To: None <>
From: Matt Thomas <>
List: tech-kern
Date: 11/23/2003 15:17:40
At 11:35 AM 11/23/2003, Christos Zoulas wrote:
>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)
> >int
> >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 *)

Except that most of these were defined when everything was ILP32 and so
the return type didn't matter.

>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.

So are agreeing with me or disagreeing? :)

Matt Thomas                     email:
3am Software Foundry              www:
Cupertino, CA              disclaimer: I avow all knowledge of this message.