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

Willem Jan Palenstijn wjp at usecode.org
Sun Feb 22 20:16:11 CET 2009


On Sun, Feb 22, 2009 at 06:42:19PM +0100, sunmax at libero.it wrote:
> > The way most other backends work is by keeping an eof flag that
> > is set when reading past the end of the file.
> 
> Yes, I have that too now. This is what I used for PS2 ferror()
> implementation. I tried to mirror EOF to it (eg. to return true,
> only after the flag was set after an attempt to read beyond the
> last byte) but this makes the loadConfig fail cause it relies
> on EOF to be reported already when we read the last byte, as
> 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.

For more detailed feedback, please send your current file, as it's hard
to talk about code without seeing it :-)

-Willem Jan




More information about the Scummvm-devel mailing list