[Scummvm-cvs-logs] SF.net SVN: scummvm: [25918] scummvm/trunk/engines/sword2/resman.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Mar 1 18:15:26 CET 2007


Revision: 25918
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25918&view=rev
Author:   fingolfin
Date:     2007-03-01 09:15:26 -0800 (Thu, 01 Mar 2007)

Log Message:
-----------
Removed obsolete 'if' (resp. replaced it by an assert)

Modified Paths:
--------------
    scummvm/trunk/engines/sword2/resman.cpp

Modified: scummvm/trunk/engines/sword2/resman.cpp
===================================================================
--- scummvm/trunk/engines/sword2/resman.cpp	2007-03-01 17:13:23 UTC (rev 25917)
+++ scummvm/trunk/engines/sword2/resman.cpp	2007-03-01 17:15:26 UTC (rev 25918)
@@ -423,27 +423,27 @@
 }
 
 void ResourceManager::readCluIndex(uint16 fileNum, Common::File *file) {
-	if (_resFiles[fileNum].entryTab == NULL) {
-		// we didn't read from this file before, get its index table
-		assert(file);
+	// we didn't read from this file before, get its index table
+	assert(_resFiles[fileNum].entryTab == NULL);
+	assert(file);
 
-		// 1st DWORD of a cluster is an offset to the look-up table
-		uint32 table_offset = file->readUint32LE();
-		debug(6, "table offset = %d", table_offset);
-		uint32 tableSize = file->size() - table_offset; // the table is stored at the end of the file
-		file->seek(table_offset);
+	// 1st DWORD of a cluster is an offset to the look-up table
+	uint32 table_offset = file->readUint32LE();
+	debug(6, "table offset = %d", table_offset);
+	uint32 tableSize = file->size() - table_offset; // the table is stored at the end of the file
+	file->seek(table_offset);
 
-		assert((tableSize % 8) == 0);
-		_resFiles[fileNum].entryTab = (uint32*)malloc(tableSize);
-		_resFiles[fileNum].numEntries = tableSize / 8;
-		file->read(_resFiles[fileNum].entryTab, tableSize);
-		if (file->ioFailed())
-			error("unable to read index table from file %s\n", _resFiles[fileNum].fileName);
+	assert((tableSize % 8) == 0);
+	_resFiles[fileNum].entryTab = (uint32*)malloc(tableSize);
+	_resFiles[fileNum].numEntries = tableSize / 8;
+	file->read(_resFiles[fileNum].entryTab, tableSize);
+	if (file->ioFailed())
+		error("unable to read index table from file %s\n", _resFiles[fileNum].fileName);
+
 #ifdef SCUMM_BIG_ENDIAN
-		for (int tabCnt = 0; tabCnt < _resFiles[fileNum].numEntries * 2; tabCnt++)
-			_resFiles[fileNum].entryTab[tabCnt] = FROM_LE_32(_resFiles[fileNum].entryTab[tabCnt]);
+	for (int tabCnt = 0; tabCnt < _resFiles[fileNum].numEntries * 2; tabCnt++)
+	  _resFiles[fileNum].entryTab[tabCnt] = FROM_LE_32(_resFiles[fileNum].entryTab[tabCnt]);
 #endif
-	}
 }
 
 /**


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