[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: apr_off_t is of an ambiguous size.

From: Russell Yanofsky <rey4_at_columbia.edu>
Date: 2004-01-13 10:31:19 CET

Ben Reser wrote:
> Okay sounds like there's some consensus on the best way to fix this...
> I wasn't aware of the svn_filesize_t discussion until ghudson pointed
> it out to me.
>
>> I'd go with apr_uint64_t rather than svn_filesize_t. This is a line
>> number rather than an offset/size of a file. Yes, the two are
>> proportional to some degree, but I'd agree with ghudson about the
>> "mental judo" if we used svn_filesize_t for that param.
>
> So apr_uint64_t for blame's line_no, svn_filesize_t for the uses of
> svn_off_t in libsvn_diff, svn_filesize_t for the svn_io_file_seek with
> appropriate bounds checking for making sure we don't pass a 64-bit
> number to a 32-bit off_t.

I agree that svn_filesize_t should be used instead of apr_off_t in the diff
and blame apis.

I the functions that wrap around apr calls for error handling would be
better off using APR types. But if you're only going to change
svn_io_file_seek, then I guess it's not really a big deal. That's as a good
a place as any to do bounds checking on platforms where APR doesn't do 64
bit i/o.

- Russ

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jan 13 10:28:35 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.