[Scummvm-cvs-logs] SF.net SVN: scummvm:[53482] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Oct 15 14:40:25 CEST 2010


Revision: 53482
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53482&view=rev
Author:   thebluegr
Date:     2010-10-15 12:40:24 +0000 (Fri, 15 Oct 2010)

Log Message:
-----------
SCI: Fixed code bugs from bug #3087872 - "SCI: Code analysis warnings"

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kpathing.cpp
    scummvm/trunk/engines/sci/graphics/font.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-10-15 12:28:56 UTC (rev 53481)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-10-15 12:40:24 UTC (rev 53482)
@@ -351,7 +351,8 @@
 	dest[0] = dest[1] = NULL_REG;
 
 	if (text.empty() || !dest) { // Empty text
-		dest[2] = dest[3] = make_reg(0, 0);
+		if (dest)
+			dest[2] = dest[3] = make_reg(0, 0);
 		debugC(2, kDebugLevelStrings, "GetTextSize: Empty string");
 		return s->r_acc;
 	}

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-10-15 12:28:56 UTC (rev 53481)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-10-15 12:40:24 UTC (rev 53482)
@@ -1312,7 +1312,7 @@
 		}
 
 		// Check if we are done
-		if (vertex_min == s->vertex_end)
+		if (vertex_min == s->vertex_end || !vertex_min)
 			break;
 
 		// Move vertex from set open to set closed

Modified: scummvm/trunk/engines/sci/graphics/font.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/font.cpp	2010-10-15 12:28:56 UTC (rev 53481)
+++ scummvm/trunk/engines/sci/graphics/font.cpp	2010-10-15 12:40:24 UTC (rev 53482)
@@ -88,7 +88,7 @@
 	byte *pIn = getCharData(chr);
 	for (int i = 0; i < charHeight; i++, y++) {
 		if (greyedOutput)
-			mask = greyedTop++ % 2 ? 0xAA : 0x55;
+			mask = ((greyedTop++) % 2) ? 0xAA : 0x55;
 		for (int done = 0; done < charWidth; done++) {
 			if ((done & 7) == 0) // fetching next data byte
 				b = *(pIn++) & mask;


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