[Scummvm-devel] ReadStream::ioFailed/EOF - StdioStream::read

Willem Jan Palenstijn wjp at usecode.org
Sun Feb 22 20:41:30 CET 2009


On Sun, Feb 22, 2009 at 08:35:05PM +0100, sunmax at libero.it wrote:
> Hi there,
> 
> > > you mentioned at the beginning POS > SIZE never succeeds.
> >
> > I don't understand what you mean. If you set a flag, you don't have
> > to check POS > SIZE anymore, but you can directly check that flag.
> 
> Yes, you still have: when you originally set the flag you need
> to check for a condition (either POS > SIZE or POS >= SIZE).
> 
> What I meant for "mirroring" is that instead of checking again,
> I just return the flag. Unluckily some bits and pieces of
> ScummVM don't try to read past the file and expect the EOF to
> be true.

If they do, they're broken and should be fixed. Please tell us if you
see any such cases.

Just to stress this again, all other ports currently only report EOF
when reading *PAST* the end of the file. And the engines expect this to
be the case. Our eos() and err() functions need to behave exactly like
the stdio feof() and ferror().

I'll read through your work-in-progress fileio.cpp in a bit. To be
continued :-)

-Willem Jan




More information about the Scummvm-devel mailing list