[hatari-devel] Wotanoid problem : final fix before commit ?
Eero Tamminen
eerot at users.berlios.de
Sun Jan 24 12:42:02 CET 2010
Hi,
On Sunday 24 January 2010, Laurent Sallafranque wrote:
> > George Nakos a écrit :
> >>> I've looked at the compendium.
> >>> I haven't found anything about this -1 length call.
> >>
> >> My memory is a bit hazy, but I think this just tells gemdos to read
> >> $ffffffff bytes from the file. Of course gemdos will read as much as
> >> the file size and then return an error in d0.l. It's the lazy man's
> >> approach to doing things the Right Way(tm) (i.e. getting the file
> >> length -or knowing it beforehand- and calling fread() with the proper
> >> amount of bytes)
George, have you actually used this on actual HW so that it has worked?
With which TOS version(s) it works like that?
(Original GEMDOS/EmuTOS treats it as signed and -1 is of course invalid
read count.)
> I've changed the Size type from Sint32 to Uint32.
>
> If you're OK with this, I can commit tonight.
On all documentation I have it's signed, but I guess it's possible that it's
been changed in newer TOS versions to unsigned (e.g. ANSI-C fread uses
size_t which is unsigned).
Next question is then what other functions that have been documented
to receive "long" actually expect Uint32? Fwrite?
> RQ : compendium says that if Size ==0, it generates a system crach on
> GEMDOS version lower than 0.15.
> Should this be emulated ?
No. I don't see how some program could be depending on that behaviour.
- Eero
More information about the hatari-devel
mailing list