Filesizes... an int ?

David J. Ruck druck at druck.org.uk
Thu Oct 31 21:27:49 GMT 2002


On 31 Oct 2002 Marco Baye <Marco.Baye at tu-clausthal.de> wrote:
> John Tytgat <John.Tytgat at aaug.net> wrote:
> 
>> I'm using xosfile_read_no_path() and see that the file size returned is an
>> int.  Wouldn't an unsigned int not more appropriate ? Or even a proper
>> typedef for it ?

Agreed. Fileswitch supports up to 4GB files so needs an unsigned. Although
FileCore only supports up to 2GB files, so in practice you are never likely
to see such a large file.
 
> And while we're at that: os_read_monotonic_time() returns something called
> os_t, which is typedef'd to be int. Wouldn't "unsigned int" be more
> appropriate? 

Agreed.

> I mean, the monotonic timer starts at zero and (theoretically)
> wraps around after 497 days. If os_t is a signed int, things could go wrong
> after half the time... Okay, that's purely academic, as no RISC OS machine
> runs that long without crashing, but I just wanted to tell someone... :)

Incorrect. At previous company of mine we Acorn based engine testing
equipment which would run 100% reliabily for tests lasting tens of thousands
of hours (and costing hundreds of thousands of pounds), so we had to cope
with monotonic time both going negative and wrapping. And most of it was
written in BASIC, comming in at around 1.3MB.

Cheers
---Dave

-- 
____________________________________________________________________________

  David J. Ruck    Phone: +44- (0)7974 108301    Email: druck at druck.org.uk
____________________________________________________________________________



More information about the oslib-user mailing list