Filesizes... an int ?
Stewart Brodie
stewart.brodie at pace.co.uk
Sat Nov 2 11:06:42 GMT 2002
Marco Baye 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 ?
>
> 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?
> 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... :)
Well, I found that lots of things failed when the monotonic timer on my
RiscPC went negative at the start of October (it was previously last booted
in January when we had a power failure at the office), so I doubt fixing
OSLib will help *that* much :-) For reference, the Filer had severe
trouble - it couldn't handle ADFS::4 (although ATAFS and RAMFS seemed OK).
It wouldn't show directory viewers, and wouldn't process double-clicks.
"Something" died with a no stack for trap handler error. Newsbase (0.61)
wasn't happy either, but I thought that since it worked on relative times,
it should be OK if I quitted it and restarted it - but it didn't help. In
the end, after 248 days uptime, I just had to reboot it.
Oh, and yes, os_t should probably be unsigned :-)
--Stewart
More information about the oslib-user
mailing list