[Scummvm-devel] incorrect use of stream functions
Johannes Schickel
lordhoto at scummvm.org
Sat Aug 15 17:40:28 CEST 2009
Norbert Lange wrote:
> So there are 3 ways to deal with that:
> *) update the comments and make sure streams behave the defined way.
>
Actually that sounds wrong. It makes IMHO no sense to change the defined
behavior of certain code, just because some code violates the currently
defined behavior.
> *) the code that depends on Stream::readXX returning 0 for eos is surely
> reading character-streams, so keep the Stream::readXX returnin undefined
> values on eos, and define a function analog to C`s getchar() which returns
> -1 in case of error. And make the illbehaving code use that instead.
>
That sounds fine, but of course we could just change the XMLParser code
to use Stream::err and Stream::eos instead of checking the return value.
// Johannes
More information about the Scummvm-devel
mailing list