[Scummvm-cvs-logs] SF.net SVN: scummvm: [32250] scummvm/trunk/engines/kyra
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Sat May 24 19:08:35 CEST 2008
Revision: 32250
http://scummvm.svn.sourceforge.net/scummvm/?rev=32250&view=rev
Author: eriktorbjorn
Date: 2008-05-24 10:08:35 -0700 (Sat, 24 May 2008)
Log Message:
-----------
Fixed errors, a few of the warnings, and added a FIXME comment about possibly
undefined behaviour.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/resource.cpp
scummvm/trunk/engines/kyra/resource.h
Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp 2008-05-24 16:30:18 UTC (rev 32249)
+++ scummvm/trunk/engines/kyra/resource.cpp 2008-05-24 17:08:35 UTC (rev 32250)
@@ -822,7 +822,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
archive = 0;
}
- bool resident = false;
uint8 * outbuffer = (uint8*) malloc(entry.size);
assert(outbuffer);
Modified: scummvm/trunk/engines/kyra/resource.h
===================================================================
--- scummvm/trunk/engines/kyra/resource.h 2008-05-24 16:30:18 UTC (rev 32249)
+++ scummvm/trunk/engines/kyra/resource.h 2008-05-24 17:08:35 UTC (rev 32250)
@@ -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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list