From 0e8bd97367a450b5f25e82b8fcb0e188d0b607c7 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 15 Mar 2009 14:48:08 +0000 Subject: Fix for loading Kyra1 Amiga PAK files. svn-id: r39420 --- engines/kyra/resource_intern.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp index 0c2cda893c..5bcf0d9a87 100644 --- a/engines/kyra/resource_intern.cpp +++ b/engines/kyra/resource_intern.cpp @@ -143,8 +143,8 @@ bool ResLoaderPak::checkFilename(Common::String filename) const { } bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const { - int32 filesize = stream.size(); - int32 offset = 0; + uint32 filesize = stream.size(); + uint32 offset = 0; bool switchEndian = false; bool firstFile = true; @@ -157,7 +157,7 @@ bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableRe Common::String file; while (!stream.eos()) { // The start offset of a file should never be in the filelist - if (offset < stream.pos() || offset > filesize) + if (offset < (uint32)stream.pos() || offset > filesize) return false; byte c = 0; @@ -212,9 +212,9 @@ struct PlainArchiveListSearch { } // end of anonymous namespace Common::Archive *ResLoaderPak::load(Common::SharedPtr memberFile, Common::SeekableReadStream &stream) const { - int32 filesize = stream.size(); + uint32 filesize = stream.size(); - int32 startoffset = 0, endoffset = 0; + uint32 startoffset = 0, endoffset = 0; bool switchEndian = false; bool firstFile = true; @@ -229,7 +229,7 @@ Common::Archive *ResLoaderPak::load(Common::SharedPtr mem Common::String file; while (!stream.eos()) { // The start offset of a file should never be in the filelist - if (startoffset < stream.pos() || startoffset > filesize) { + if (startoffset < (uint32)stream.pos() || startoffset > filesize) { warning("PAK file '%s' is corrupted", memberFile->getDisplayName().c_str()); return false; } -- cgit v1.2.3