[Scummvm-cvs-logs] SF.net SVN: scummvm:[53471] scummvm/trunk/engines/tinsel

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Fri Oct 15 10:52:23 CEST 2010


Revision: 53471
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53471&view=rev
Author:   dreammaster
Date:     2010-10-15 08:52:22 +0000 (Fri, 15 Oct 2010)

Log Message:
-----------
TINSEL: Fix for #3087863 - Code analysis warnings

Modified Paths:
--------------
    scummvm/trunk/engines/tinsel/debugger.cpp
    scummvm/trunk/engines/tinsel/graphics.cpp
    scummvm/trunk/engines/tinsel/rince.cpp

Modified: scummvm/trunk/engines/tinsel/debugger.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/debugger.cpp	2010-10-15 08:49:20 UTC (rev 53470)
+++ scummvm/trunk/engines/tinsel/debugger.cpp	2010-10-15 08:52:22 UTC (rev 53471)
@@ -57,7 +57,8 @@
 
 	// Hexadecimal string
 	uint tmp;
-	sscanf(s, "%xh", &tmp);
+	if (!sscanf(s, "%xh", &tmp))
+		tmp = 0;
 	return (int)tmp;
 }
 

Modified: scummvm/trunk/engines/tinsel/graphics.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/graphics.cpp	2010-10-15 08:49:20 UTC (rev 53470)
+++ scummvm/trunk/engines/tinsel/graphics.cpp	2010-10-15 08:52:22 UTC (rev 53471)
@@ -66,8 +66,8 @@
 		return NULL;
 
 	// Calculate needed index numbers, align width and height not next multiple of four
-	imageWidth = imageWidth % 4 ? ((imageWidth / 4) + 1) * 4 : imageWidth;
-	imageHeight = imageHeight % 4 ? ((imageHeight / 4) + 1) * 4 : imageHeight;
+	imageWidth = (imageWidth % 4) ? ((imageWidth / 4) + 1) * 4 : imageWidth;
+	imageHeight = (imageHeight % 4) ? ((imageHeight / 4) + 1) * 4 : imageHeight;
 	destinationBuffer = (uint8*)malloc((imageWidth * imageHeight) / 8);
 	dstIdx = destinationBuffer;
 	remainingBlocks = (imageWidth * imageHeight) / 16;
@@ -297,7 +297,7 @@
 				} else {
 					for (int xp = boxBounds.left; xp <= boxBounds.right; ++xp) {
 						// Extract pixel value from byte
-						byte pixValue =  (*(p + (xp / 2)) & (xp % 2 ? 0xf0 : 0x0f)) >> (xp % 2 ? 4 : 0);
+						byte pixValue =  (*(p + (xp / 2)) & ((xp % 2) ? 0xf0 : 0x0f)) >> ((xp % 2) ? 4 : 0);
 						if (pixValue || !transparency)
 							*(tempDest + SCREEN_WIDTH * (yp - boxBounds.top) + (xp - boxBounds.left)) = psxMapperTable[pixValue];
 					}

Modified: scummvm/trunk/engines/tinsel/rince.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/rince.cpp	2010-10-15 08:49:20 UTC (rev 53470)
+++ scummvm/trunk/engines/tinsel/rince.cpp	2010-10-15 08:52:22 UTC (rev 53471)
@@ -361,8 +361,8 @@
 
 	pMover->Tline = 0;
 
-	if (pMover->direction != FORWARD || pMover->direction != AWAY
-	|| pMover->direction != LEFTREEL || pMover->direction != RIGHTREEL)
+	if (pMover->direction != FORWARD && pMover->direction != AWAY
+			&& pMover->direction != LEFTREEL && pMover->direction != RIGHTREEL)
 		pMover->direction = FORWARD;
 
 	if (pMover->scale < 0 || pMover->scale > TOTAL_SCALES)


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