[Scummvm-cvs-logs] scummvm master -> c6112f738312ff6243b3fca1373d4d44ef08ee32

lordhoto lordhoto at gmail.com
Tue Apr 19 18:13:20 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c6112f7383 COMMON: Do not call ReadStream::eos in SubReadStream::read.


Commit: c6112f738312ff6243b3fca1373d4d44ef08ee32
    https://github.com/scummvm/scummvm/commit/c6112f738312ff6243b3fca1373d4d44ef08ee32
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-04-19T09:08:47-07:00

Commit Message:
COMMON: Do not call ReadStream::eos in SubReadStream::read.

Instead I moved the call to ReadStream::eos into SubReadStream::eos.

fuzzie pointed out that in certain cases this resulted in a lot of eos calls
before. Those were rather needlessly, since checking the eos bit of the
decorated stream in read does not give any advantage over checking it when
the client code really wants to test the eos flag.

Changed paths:
    common/stream.cpp
    common/substream.h



diff --git a/common/stream.cpp b/common/stream.cpp
index c0783b2..1be3fbf 100644
--- a/common/stream.cpp
+++ b/common/stream.cpp
@@ -205,7 +205,6 @@ uint32 SubReadStream::read(void *dataPtr, uint32 dataSize) {
 	}
 
 	dataSize = _parentStream->read(dataPtr, dataSize);
-	_eos |= _parentStream->eos();
 	_pos += dataSize;
 
 	return dataSize;
diff --git a/common/substream.h b/common/substream.h
index dc49ce9..4d90ec5 100644
--- a/common/substream.h
+++ b/common/substream.h
@@ -59,7 +59,7 @@ public:
 			delete _parentStream;
 	}
 
-	virtual bool eos() const { return _eos; }
+	virtual bool eos() const { return _eos | _parentStream->eos(); }
 	virtual bool err() const { return _parentStream->err(); }
 	virtual void clearErr() { _eos = false; _parentStream->clearErr(); }
 	virtual uint32 read(void *dataPtr, uint32 dataSize);






More information about the Scummvm-git-logs mailing list