diff options
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/resource.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/resource_intern.cpp | 26 | ||||
-rw-r--r-- | engines/kyra/script.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/vqa.cpp | 4 |
4 files changed, 20 insertions, 20 deletions
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 531f875cc3..0f0a643017 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -262,7 +262,7 @@ bool Resource::loadFileToBuf(const char *file, void *buf, uint32 maxSize) { return false; memset(buf, 0, maxSize); - stream->read(buf, (maxSize <= stream->size()) ? maxSize : stream->size()); + stream->read(buf, ((int32)maxSize <= stream->size()) ? maxSize : stream->size()); delete stream; return true; } diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp index e6b3b14c8a..f97319a43a 100644 --- a/engines/kyra/resource_intern.cpp +++ b/engines/kyra/resource_intern.cpp @@ -127,8 +127,8 @@ bool ResLoaderPak::checkFilename(Common::String filename) const { } bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const { - uint32 filesize = stream.size(); - uint32 offset = 0; + int32 filesize = stream.size(); + int32 offset = 0; bool switchEndian = false; bool firstFile = true; @@ -138,7 +138,7 @@ bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableRe offset = SWAP_BYTES_32(offset); } - Common::String file = ""; + Common::String file; while (!stream.eos()) { // The start offset of a file should never be in the filelist if (offset < stream.pos() || offset > filesize) @@ -146,7 +146,7 @@ bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableRe byte c = 0; - file = ""; + file.clear(); while (!stream.eos() && (c = stream.readByte()) != 0) file += c; @@ -196,9 +196,9 @@ struct PlainArchiveListSearch { } // end of anonymous namespace Common::Archive *ResLoaderPak::load(Resource *owner, const Common::String &filename, Common::SeekableReadStream &stream) const { - uint32 filesize = stream.size(); + int32 filesize = stream.size(); - uint32 startoffset = 0, endoffset = 0; + int32 startoffset = 0, endoffset = 0; bool switchEndian = false; bool firstFile = true; @@ -210,7 +210,7 @@ Common::Archive *ResLoaderPak::load(Resource *owner, const Common::String &filen PlainArchive::FileInputList files; - Common::String file = ""; + Common::String file; while (!stream.eos()) { // The start offset of a file should never be in the filelist if (startoffset < stream.pos() || startoffset > filesize) { @@ -218,7 +218,7 @@ Common::Archive *ResLoaderPak::load(Resource *owner, const Common::String &filen return false; } - file = ""; + file.clear(); byte c = 0; while (!stream.eos() && (c = stream.readByte()) != 0) @@ -301,7 +301,7 @@ bool ResLoaderInsMalcolm::checkFilename(Common::String filename) const { bool ResLoaderInsMalcolm::isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const { stream.seek(3, SEEK_SET); - uint32 size = stream.readUint32LE(); + int32 size = stream.readUint32LE(); if (size+7 > stream.size()) return false; @@ -322,13 +322,13 @@ Common::Archive *ResLoaderInsMalcolm::load(Resource *owner, const Common::String // first file is the index table uint32 size = stream.readUint32LE(); - Common::String temp = ""; + Common::String temp; for (uint32 i = 0; i < size; ++i) { byte c = stream.readByte(); if (c == '\\') { - temp = ""; + temp.clear(); } else if (c == 0x0D) { // line endings are CRLF c = stream.readByte(); @@ -363,12 +363,12 @@ bool ResLoaderTlk::checkFilename(Common::String filename) const { bool ResLoaderTlk::isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const { uint16 entries = stream.readUint16LE(); - uint32 entryTableSize = (entries * 8); + int32 entryTableSize = (entries * 8); if (entryTableSize + 2 > stream.size()) return false; - uint32 offset = 0; + int32 offset = 0; for (uint i = 0; i < entries; ++i) { stream.readUint32LE(); diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index df933c3ed8..dba09f08ef 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -255,13 +255,13 @@ uint32 ScriptFileParser::getIFFBlockSize(const uint32 chunkName) { _stream->seek(_startOffset + 0x0C); - while (_stream->pos() < _endOffset) { + while ((uint)_stream->pos() < _endOffset) { uint32 chunk = _stream->readUint32LE(); uint32 size_temp = _stream->readUint32BE(); if (chunk != chunkName) { _stream->seek((size_temp + 1) & (~1), SEEK_CUR); - assert(_stream->pos() <= _endOffset); + assert((uint)_stream->pos() <= _endOffset); } else { size = size_temp; break; @@ -274,13 +274,13 @@ uint32 ScriptFileParser::getIFFBlockSize(const uint32 chunkName) { bool ScriptFileParser::loadIFFBlock(const uint32 chunkName, void *loadTo, uint32 ptrSize) { _stream->seek(_startOffset + 0x0C); - while (_stream->pos() < _endOffset) { + while ((uint)_stream->pos() < _endOffset) { uint32 chunk = _stream->readUint32LE(); uint32 chunkSize = _stream->readUint32BE(); if (chunk != chunkName) { _stream->seek((chunkSize + 1) & (~1), SEEK_CUR); - assert(_stream->pos() <= _endOffset); + assert((uint)_stream->pos() <= _endOffset); } else { uint32 loadSize = 0; diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 9a9941e20e..0f6440fd47 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -406,7 +406,7 @@ void VQAMovie::displayFrame(uint frameNum) { byte *inbuf, *outbuf; uint32 insize, outsize; - uint32 end; + int32 end; switch (tag) { case MKID_BE('SND0'): // Uncompressed sound @@ -594,7 +594,7 @@ void VQAMovie::play() { uint32 insize, outsize; if (_stream) { - while (_file->pos() < (_frameInfo[0] & 0x7FFFFFFF)) { + while ((uint)_file->pos() < (_frameInfo[0] & 0x7FFFFFFF)) { uint32 tag = readTag(); uint32 size = _file->readUint32BE(); |