Subject: Re: Making more LP64 friendly.
To: None <firstname.lastname@example.org>
From: Matt Thomas <email@example.com>
Date: 11/23/2003 15:17:40
At 11:35 AM 11/23/2003, Christos Zoulas wrote:
>In article <8AD6422A-1DDA-11D8-9362-000A957020BC@3am-software.com>,
>Matt Thomas <firstname.lastname@example.org> 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 *)
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: email@example.com
3am Software Foundry www: http://3am-software.com/bio/matt/
Cupertino, CA disclaimer: I avow all knowledge of this message.