aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2008-05-24 17:08:35 +0000
committerTorbjörn Andersson2008-05-24 17:08:35 +0000
commit398f7be356f74ed294ce9e5f823782289baed515 (patch)
tree2b6f25c93726b7f4a8055480c991fd5023075512 /engines
parent0efebd98761fc558f9c3082dbfa7239353520571 (diff)
downloadscummvm-rg350-398f7be356f74ed294ce9e5f823782289baed515.tar.gz
scummvm-rg350-398f7be356f74ed294ce9e5f823782289baed515.tar.bz2
scummvm-rg350-398f7be356f74ed294ce9e5f823782289baed515.zip
Fixed errors, a few of the warnings, and added a FIXME comment about possibly
undefined behaviour. svn-id: r32250
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/resource.cpp21
-rw-r--r--engines/kyra/resource.h9
2 files changed, 15 insertions, 15 deletions
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index a65093915a..4d60346fb0 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -822,7 +822,7 @@ bool FileExpander::process(const uint8 * dst, const uint8 * src, uint32 outsize,
postprocess = false;
needrefresh = true;
} else if (mode == 0){
- uint16 cnt = 144;
+ // uint16 cnt = 144;
uint8 *d2 = (uint8*) _tables[0];
memset(d2, 8, 144);
memset(d2 + 144, 9, 112);
@@ -1131,18 +1131,10 @@ bool ResLoaderInsHof::loadFile(const Common::String &filename, Common::SeekableR
Common::String fn_tmp;
char fn_ext[4];
- int i = filename.size() - 1;
while (fn_base.lastChar() != '.')
fn_base.deleteLastChar();
- struct InsHofArchive {
- Common::String filename;
- uint32 firstFile;
- uint32 startOffset;
- uint32 lastFile;
- uint32 endOffset;
- uint32 totalSize;
- } newArchive;
+ InsHofArchive newArchive;
Common::List<InsHofArchive> archives;
@@ -1150,9 +1142,8 @@ bool ResLoaderInsHof::loadFile(const Common::String &filename, Common::SeekableR
sprintf(fn_ext, "%03d", currentFile);
fn_tmp = fn_base + Common::String(fn_ext);
- Common::File tmpFile;
if (!tmpFile.open(fn_tmp)) {
- debug(3, "couldn't open file '%s'\n", fn_tmp);
+ debug(3, "couldn't open file '%s'\n", fn_tmp.c_str());
break;
}
@@ -1168,6 +1159,7 @@ bool ResLoaderInsHof::loadFile(const Common::String &filename, Common::SeekableR
pos += 6;
tmpFile.seek(6, SEEK_CUR);
} else {
+ // FIXME: GCC warns that this may be undefined!
size = ++size - pos;
}
newArchive.filename = fn_base;
@@ -1210,13 +1202,13 @@ bool ResLoaderInsHof::loadFile(const Common::String &filename, Common::SeekableR
const uint32 kHeaderSize2 = 46;
for (Common::List<InsHofArchive>::iterator a = archives.begin(); a != archives.end(); ++a) {
- bool startFile = true;
+ startFile = true;
for (uint32 i = a->firstFile; i != (a->lastFile + 1); i++) {
sprintf(fn_ext, "%03d", i);
fn_tmp = a->filename + Common::String(fn_ext);
if (!tmpFile.open(fn_tmp)) {
- debug(3, "couldn't open file '%s'\n", fn_tmp);
+ debug(3, "couldn't open file '%s'\n", fn_tmp.c_str());
break;
}
@@ -1313,7 +1305,6 @@ Common::SeekableReadStream *ResLoaderInsHof::loadFileFromArchive(const Common::S
archive = 0;
}
- bool resident = false;
uint8 * outbuffer = (uint8*) malloc(entry.size);
assert(outbuffer);
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index 69ed8515c1..43a41940a3 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -41,6 +41,15 @@
namespace Kyra {
+struct InsHofArchive {
+ Common::String filename;
+ uint32 firstFile;
+ uint32 startOffset;
+ uint32 lastFile;
+ uint32 endOffset;
+ uint32 totalSize;
+};
+
struct ResFileEntry {
Common::String parent;
uint32 size;