Skip to content

Commit

Permalink
COMMON: Rename SafeSubReadStream to SafeSeekableSubReadStream.
Browse files Browse the repository at this point in the history
It actually inherits from SeekableSubReadStream, so it should be named
accordingly.
  • Loading branch information
Johannes Schickel committed Mar 10, 2012
1 parent 5e52b0a commit 48efab4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion common/stream.cpp
Expand Up @@ -240,7 +240,7 @@ bool SeekableSubReadStream::seek(int32 offset, int whence) {
return ret;
}

uint32 SafeSubReadStream::read(void *dataPtr, uint32 dataSize) {
uint32 SafeSeekableSubReadStream::read(void *dataPtr, uint32 dataSize) {
// Make sure the parent stream is at the right position
seek(0, SEEK_CUR);

Expand Down
8 changes: 4 additions & 4 deletions common/substream.h
Expand Up @@ -99,14 +99,14 @@ class SeekableSubReadStreamEndian : public SeekableSubReadStream, public ReadStr
* normal SeekableSubReadStream, at the cost of seek()ing the parent stream
* before each read().
*
* More than one SafeSubReadStream to the same parent stream can be used
* More than one SafeSeekableSubReadStream to the same parent stream can be used
* at the same time; they won't mess up each other. They will, however,
* reposition the parent stream, so don't depend on its position to be
* the same after a read() or seek() on one of its SafeSubReadStream.
* the same after a read() or seek() on one of its SafeSeekableSubReadStream.
*/
class SafeSubReadStream : public SeekableSubReadStream {
class SafeSeekableSubReadStream : public SeekableSubReadStream {
public:
SafeSubReadStream(SeekableReadStream *parentStream, uint32 begin, uint32 end, DisposeAfterUse::Flag disposeParentStream = DisposeAfterUse::NO)
SafeSeekableSubReadStream(SeekableReadStream *parentStream, uint32 begin, uint32 end, DisposeAfterUse::Flag disposeParentStream = DisposeAfterUse::NO)
: SeekableSubReadStream(parentStream, begin, end, disposeParentStream) {
}

Expand Down
2 changes: 1 addition & 1 deletion engines/gob/dataio.cpp
Expand Up @@ -414,7 +414,7 @@ Common::SeekableReadStream *DataIO::getFile(File &file) {
return 0;

Common::SeekableReadStream *rawData =
new Common::SafeSubReadStream(&file.archive->file, file.offset, file.offset + file.size);
new Common::SafeSeekableSubReadStream(&file.archive->file, file.offset, file.offset + file.size);

if (file.compression == 0)
return rawData;
Expand Down
6 changes: 3 additions & 3 deletions engines/sword2/music.cpp
Expand Up @@ -160,19 +160,19 @@ static Audio::AudioStream *getAudioStream(SoundFileHandle *fh, const char *base,
return makeCLUStream(&fh->file, enc_len);
#ifdef USE_MAD
case kMP3Mode: {
Common::SafeSubReadStream *tmp = new Common::SafeSubReadStream(&fh->file, pos, pos + enc_len);
Common::SafeSeekableSubReadStream *tmp = new Common::SafeSeekableSubReadStream(&fh->file, pos, pos + enc_len);
return Audio::makeMP3Stream(tmp, DisposeAfterUse::YES);
}
#endif
#ifdef USE_VORBIS
case kVorbisMode: {
Common::SafeSubReadStream *tmp = new Common::SafeSubReadStream(&fh->file, pos, pos + enc_len);
Common::SafeSeekableSubReadStream *tmp = new Common::SafeSeekableSubReadStream(&fh->file, pos, pos + enc_len);
return Audio::makeVorbisStream(tmp, DisposeAfterUse::YES);
}
#endif
#ifdef USE_FLAC
case kFLACMode: {
Common::SafeSubReadStream *tmp = new Common::SafeSubReadStream(&fh->file, pos, pos + enc_len);
Common::SafeSeekableSubReadStream *tmp = new Common::SafeSeekableSubReadStream(&fh->file, pos, pos + enc_len);
return Audio::makeFLACStream(tmp, DisposeAfterUse::YES);
}
#endif
Expand Down

0 comments on commit 48efab4

Please sign in to comment.