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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Wed May 13 20:12:17 CEST 2009


Revision: 40528
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40528&view=rev
Author:   lordhoto
Date:     2009-05-13 18:12:17 +0000 (Wed, 13 May 2009)

Log Message:
-----------
Fix some variable may be used uninitialized warnings.

Modified Paths:
--------------
    scummvm/trunk/engines/agi/predictive.cpp
    scummvm/trunk/engines/cruise/dataLoader.cpp
    scummvm/trunk/engines/sci/gfx/res_pic.cpp
    scummvm/trunk/engines/sky/text.cpp
    scummvm/trunk/engines/sword2/screen.cpp

Modified: scummvm/trunk/engines/agi/predictive.cpp
===================================================================
--- scummvm/trunk/engines/agi/predictive.cpp	2009-05-13 17:33:58 UTC (rev 40527)
+++ scummvm/trunk/engines/agi/predictive.cpp	2009-05-13 18:12:17 UTC (rev 40528)
@@ -141,6 +141,7 @@
 
 	// show the predictive dialog.
 	// if another window is already in display, save its state into tmpwindow
+	memset(&tmpwindow, 0, sizeof(tmpwindow));
 	tmpwindow.active = false;
 	if (_game.window.active)
 		memcpy(&tmpwindow, &(_game.window), sizeof(AgiBlock));

Modified: scummvm/trunk/engines/cruise/dataLoader.cpp
===================================================================
--- scummvm/trunk/engines/cruise/dataLoader.cpp	2009-05-13 17:33:58 UTC (rev 40527)
+++ scummvm/trunk/engines/cruise/dataLoader.cpp	2009-05-13 18:12:17 UTC (rev 40528)
@@ -53,6 +53,9 @@
 	case 5:
 		spriteSize = pCurrentFileEntry->height * pCurrentFileEntry->widthInColumn;
 		break;
+
+	default:
+		error("Unkown gfx format %d", format);
 	}
 
 	uint8 *buffer = (uint8 *)malloc(spriteSize);
@@ -66,7 +69,7 @@
 			uint8 c;
 			uint16 p0;
 			// Format 4
-			uint16 p1, p2, p3;
+			uint16 p1 = 0, p2 = 0, p3 = 0;
 
 			p0 = (dataPtr[0] << 8) | dataPtr[1];
 

Modified: scummvm/trunk/engines/sci/gfx/res_pic.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/res_pic.cpp	2009-05-13 17:33:58 UTC (rev 40527)
+++ scummvm/trunk/engines/sci/gfx/res_pic.cpp	2009-05-13 18:12:17 UTC (rev 40528)
@@ -1155,7 +1155,7 @@
 	int pos = 0;
 	int x, y;
 	int oldx, oldy;
-	int pal, index;
+	int pal = 0, index = 0;
 	int temp;
 	int line_mode = style->line_mode;
 	// NOTE: here, it is assumed that the titlebar size is always 10. This may differ depending on

Modified: scummvm/trunk/engines/sky/text.cpp
===================================================================
--- scummvm/trunk/engines/sky/text.cpp	2009-05-13 17:33:58 UTC (rev 40527)
+++ scummvm/trunk/engines/sky/text.cpp	2009-05-13 18:12:17 UTC (rev 40528)
@@ -339,6 +339,7 @@
 	} while (textChar >= 10);
 
 	DisplayedText ret;
+	memset(&ret, 0, sizeof(ret));
 	ret.textData = dest;
 	ret.textWidth = dtLastWidth;
 	return ret;

Modified: scummvm/trunk/engines/sword2/screen.cpp
===================================================================
--- scummvm/trunk/engines/sword2/screen.cpp	2009-05-13 17:33:58 UTC (rev 40527)
+++ scummvm/trunk/engines/sword2/screen.cpp	2009-05-13 18:12:17 UTC (rev 40528)
@@ -285,6 +285,7 @@
 	byte *file = _vm->_resman->openResource(_thisScreen.background_layer_id);
 
 	MultiScreenHeader screenLayerTable;
+	memset(&screenLayerTable, 0, sizeof(screenLayerTable));
 
 	if (!Sword2Engine::isPsx()) // On PSX version, there would be nothing to read here
 		screenLayerTable.read(file + ResHeader::size());


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