diff options
author | Willem Jan Palenstijn | 2008-09-14 22:28:53 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2008-09-14 22:28:53 +0000 |
commit | c8eeae8d4dffa5849a23cf963884027a7789504b (patch) | |
tree | 1f2a0de23851cb7e7d1d77114c8379aa27f4fb85 /backends/fs | |
parent | fbfe30bf861af9b83325e0c7fecd4b0a68da5af9 (diff) | |
download | scummvm-rg350-c8eeae8d4dffa5849a23cf963884027a7789504b.tar.gz scummvm-rg350-c8eeae8d4dffa5849a23cf963884027a7789504b.tar.bz2 scummvm-rg350-c8eeae8d4dffa5849a23cf963884027a7789504b.zip |
Big patch changing semantics of ReadStream::eos():
eos() now only returns true _after_ trying to read past the end of the stream.
This has a large potential for regressions. Please test!
svn-id: r34549
Diffstat (limited to 'backends/fs')
-rw-r--r-- | backends/fs/stdiostream.cpp | 6 | ||||
-rw-r--r-- | backends/fs/stdiostream.h | 4 | ||||
-rw-r--r-- | backends/fs/symbian/symbianstream.cpp | 7 | ||||
-rw-r--r-- | backends/fs/symbian/symbianstream.h | 4 |
4 files changed, 11 insertions, 10 deletions
diff --git a/backends/fs/stdiostream.cpp b/backends/fs/stdiostream.cpp index fafcca989b..4f353ee7c2 100644 --- a/backends/fs/stdiostream.cpp +++ b/backends/fs/stdiostream.cpp @@ -114,11 +114,11 @@ StdioStream::~StdioStream() { fclose((FILE *)_handle); } -bool StdioStream::ioFailed() const { - return eos() || ferror((FILE *)_handle) != 0; +bool StdioStream::err() const { + return ferror((FILE *)_handle) != 0; } -void StdioStream::clearIOFailed() { +void StdioStream::clearErr() { clearerr((FILE *)_handle); } diff --git a/backends/fs/stdiostream.h b/backends/fs/stdiostream.h index f40ddd9867..3d44062d7f 100644 --- a/backends/fs/stdiostream.h +++ b/backends/fs/stdiostream.h @@ -46,8 +46,8 @@ public: StdioStream(void *handle); virtual ~StdioStream(); - bool ioFailed() const; - void clearIOFailed(); + bool err() const; + void clearErr(); bool eos() const; virtual uint32 write(const void *dataPtr, uint32 dataSize); diff --git a/backends/fs/symbian/symbianstream.cpp b/backends/fs/symbian/symbianstream.cpp index 4d2ec11ab3..5944cab892 100644 --- a/backends/fs/symbian/symbianstream.cpp +++ b/backends/fs/symbian/symbianstream.cpp @@ -177,12 +177,13 @@ SymbianStdioStream::~SymbianStdioStream() { delete (TSymbianFileEntry*)(_handle); } -bool SymbianStdioStream::ioFailed() const { - return eos() || ((TSymbianFileEntry*)(_handle))->_lastError != 0; +bool SymbianStdioStream::err() const { + return ((TSymbianFileEntry*)(_handle))->_lastError != 0; } -void SymbianStdioStream::clearIOFailed() { +void SymbianStdioStream::clearErr() { ((TSymbianFileEntry*)(_handle))->_lastError = 0; + ((TSymbianFileEntry*)(_handle))->_eofReached = 0; } bool SymbianStdioStream::eos() const { diff --git a/backends/fs/symbian/symbianstream.h b/backends/fs/symbian/symbianstream.h index 180e6bffcb..d783856687 100644 --- a/backends/fs/symbian/symbianstream.h +++ b/backends/fs/symbian/symbianstream.h @@ -46,8 +46,8 @@ public: SymbianStdioStream(void *handle); virtual ~SymbianStdioStream(); - bool ioFailed() const; - void clearIOFailed(); + bool err() const; + void clearErr(); bool eos() const; virtual uint32 write(const void *dataPtr, uint32 dataSize); |