[Scummvm-cvs-logs] SF.net SVN: scummvm:[44776] scummvm/branches/branch-1-0-0/engines/gob/ dataio.cpp

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Thu Oct 8 10:52:20 CEST 2009


Revision: 44776
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44776&view=rev
Author:   strangerke
Date:     2009-10-08 08:52:20 +0000 (Thu, 08 Oct 2009)

Log Message:
-----------
backport of R44774 and R44467:gob - Fix a Valgrind warnings

Modified Paths:
--------------
    scummvm/branches/branch-1-0-0/engines/gob/dataio.cpp

Modified: scummvm/branches/branch-1-0-0/engines/gob/dataio.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/gob/dataio.cpp	2009-10-08 08:22:19 UTC (rev 44775)
+++ scummvm/branches/branch-1-0-0/engines/gob/dataio.cpp	2009-10-08 08:52:20 UTC (rev 44776)
@@ -361,6 +361,8 @@
 }
 
 int32 DataIO::getChunkSize(const char *chunkName, int32 &packSize) {
+	packSize = -1;
+
 	for (int16 file = 0; file < MAX_DATA_FILES; file++) {
 		if (_dataFiles[file] == 0)
 			return -1;
@@ -370,10 +372,8 @@
 			if (scumm_stricmp(chunkName, dataDesc->chunkName) != 0)
 				continue;
 
-			if (dataDesc->packed == 0) {
-				packSize = -1;
+			if (dataDesc->packed == 0)
 				return dataDesc->size;
-			}
 
 			for (int16 slot = 0; slot < MAX_SLOT_COUNT; slot++)
 				_isCurrentSlot[slot] = false;
@@ -460,7 +460,8 @@
 }
 
 byte *DataIO::getUnpackedData(const char *name) {
-	int32 realSize, packSize;
+	int32 realSize;
+	int32 packSize = -1;
 
 	realSize = getChunkSize(name, packSize);
 
@@ -552,11 +553,11 @@
 
 int32 DataIO::getDataSize(const char *name) {
 	char buf[128];
+	int32 chunkSize;
+	int32 packSize = -1;
 
 	strncpy0(buf, name, 127);
 
-	int32 chunkSize, packSize;
-
 	chunkSize = getChunkSize(buf, packSize);
 	if (chunkSize >= 0)
 		return chunkSize;


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