[Scummvm-cvs-logs] SF.net SVN: scummvm:[53488] scummvm/trunk/engines/sword1

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Oct 15 15:07:32 CEST 2010


Revision: 53488
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53488&view=rev
Author:   thebluegr
Date:     2010-10-15 13:07:31 +0000 (Fri, 15 Oct 2010)

Log Message:
-----------
SWORD1: Fixed bug #3087855 - "SWORD1: Code analysis warnings"

Modified Paths:
--------------
    scummvm/trunk/engines/sword1/resman.cpp
    scummvm/trunk/engines/sword1/screen.cpp

Modified: scummvm/trunk/engines/sword1/resman.cpp
===================================================================
--- scummvm/trunk/engines/sword1/resman.cpp	2010-10-15 13:00:19 UTC (rev 53487)
+++ scummvm/trunk/engines/sword1/resman.cpp	2010-10-15 13:07:31 UTC (rev 53488)
@@ -332,10 +332,13 @@
 			Clu *closeClu = _openCluStart;
 			_openCluStart = _openCluStart->nextOpen;
 
-			closeClu->file->close();
-			delete closeClu->file;
-			closeClu->file = NULL;
-			closeClu->nextOpen = NULL;
+			if (closeClu) {
+				if (closeClu->file)
+					closeClu->file->close();
+				delete closeClu->file;
+				closeClu->file = NULL;
+				closeClu->nextOpen = NULL;
+			}
 			_openClus--;
 		}
 	}

Modified: scummvm/trunk/engines/sword1/screen.cpp
===================================================================
--- scummvm/trunk/engines/sword1/screen.cpp	2010-10-15 13:00:19 UTC (rev 53487)
+++ scummvm/trunk/engines/sword1/screen.cpp	2010-10-15 13:07:31 UTC (rev 53488)
@@ -886,8 +886,8 @@
 
 // needed because some psx backgrounds are half width and half height
 uint8* Screen::psxShrinkedBackgroundToIndexed(uint8 *psxBackground, uint32 bakXres, uint32 bakYres) {
-	uint32 xresInTiles = (bakXres / 2) % 16 ? (bakXres / 32) + 1 : (bakXres / 32);
-	uint32 yresInTiles =  (bakYres / 2) % 16 ? (bakYres / 32) + 1 : (bakYres / 32);
+	uint32 xresInTiles = ((bakXres / 2) % 16) ? (bakXres / 32) + 1 : (bakXres / 32);
+	uint32 yresInTiles = ((bakYres / 2) % 16) ? (bakYres / 32) + 1 : (bakYres / 32);
 	uint32 totTiles = xresInTiles * yresInTiles;
 	uint32 tileYpos = 0; //tile position in a virtual xresInTiles * yresInTiles grid
 	uint32 tileXpos = 0;


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