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

sunmax at libero.it sunmax at libero.it
Sun Feb 22 17:58:00 CET 2009


Hi Max,

> So, after reading the last byte, then the EOF flag should *not* be
> set. Only after trying to read *beyond* the last byte should it be 
> set.

I know.

Unluckily if I do this, changing the semantic in a way
that EOS/EOF means POS > SIZE instead of POS >= SIZE,
it fails everywhere else...

It cannot even read Scummvm.ini anymore :-(

Other backends (notably the DS) have a ">=" semantic:

 see std_feof in backends/fs/ds/ds-fs.cpp

  return handle->pos >= handle->size;

For me it's:

 a) EOF means "POS > SIZE" -> snafu

    (can't pass ConfigManager::loadFromStream)

 b) EOF means "POS >= SIZE" -> lose themes, cant's start Indy4, etc.

    (unless I disable the "eos" check part in ::ioFailed which is
    what I plan to do shortly [I already know it works] ;-)

If you have any suggestions they are welcome,

Thanks!
 -max





More information about the Scummvm-devel mailing list