Re: apr_off_t is of an ambiguous size.
From: Ben Reser <ben_at_reser.org>
Date: 2004-01-17 02:19:29 CET
On Fri, Jan 16, 2004 at 07:30:53PM -0500, Russell Yanofsky wrote:
err yeah.
> Yes. With the bugs fixed it should be equivalent to my first suggestion, but
And easier to understand if I wrote things right.
> Huh? How does endianness come into play here? Do you see me casting to a
You're right. And this does work even on 32-bit big endian archs
The following example code:
long long min, max;
min = (long long) (sizeof(long long) - 1) << (sizeof(long long)*8-1);
printf("min=%lld\nmax=%lld\n",min,max);
Produces the following output:
min=-9223372036854775808
This is true on the follow archs:
The min-1 and max+1 is there to prove that the 2s compliment is correct.
For whatever reason, everyone calls them right and left shifts. But
Anyway I'll fix the code to work that way. And to think I asked someone
-- Ben Reser <ben@reser.org> http://ben.reser.org "Conscience is the inner voice which warns us somebody may be looking." - H.L. Mencken --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org For additional commands, e-mail: dev-help@subversion.tigris.orgReceived on Sat Jan 17 02:19:56 2004 |
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.