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

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Mon Jun 9 19:50:52 CEST 2008


Revision: 32637
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32637&view=rev
Author:   eriktorbjorn
Date:     2008-06-09 10:50:52 -0700 (Mon, 09 Jun 2008)

Log Message:
-----------
Fixed warnings. (Mainly, GCC 4.3 doesn't want you to use "char" as an array
index. Probably because it's undefined whether or not it's signed.)

Modified Paths:
--------------
    scummvm/trunk/engines/cine/gfx.cpp
    scummvm/trunk/engines/cine/texte.cpp
    scummvm/trunk/engines/m4/converse.cpp
    scummvm/trunk/engines/m4/converse.h
    scummvm/trunk/engines/m4/font.cpp
    scummvm/trunk/engines/parallaction/font.cpp

Modified: scummvm/trunk/engines/cine/gfx.cpp
===================================================================
--- scummvm/trunk/engines/cine/gfx.cpp	2008-06-09 14:45:45 UTC (rev 32636)
+++ scummvm/trunk/engines/cine/gfx.cpp	2008-06-09 17:50:52 UTC (rev 32637)
@@ -335,8 +335,8 @@
 
 	if (character == ' ') {
 		x += 5;
-	} else if ((width = fontParamTable[character].characterWidth)) {
-		idx = fontParamTable[character].characterIdx;
+	} else if ((width = fontParamTable[(unsigned char)character].characterWidth)) {
+		idx = fontParamTable[(unsigned char)character].characterIdx;
 		drawSpriteRaw(textTable[idx][0], textTable[idx][1], 16, 8, _backBuffer, x, y);
 		x += width + 1;
 	}
@@ -936,8 +936,8 @@
 
 	if (character == ' ') {
 		x += 5;
-	} else if ((width = fontParamTable[character].characterWidth)) {
-		idx = fontParamTable[character].characterIdx;
+	} else if ((width = fontParamTable[(unsigned char)character].characterWidth)) {
+		idx = fontParamTable[(unsigned char)character].characterIdx;
 		drawSpriteRaw2(textTable[idx][0], 0, 16, 8, _backBuffer, x, y);
 		x += width + 1;
 	}

Modified: scummvm/trunk/engines/cine/texte.cpp
===================================================================
--- scummvm/trunk/engines/cine/texte.cpp	2008-06-09 14:45:45 UTC (rev 32636)
+++ scummvm/trunk/engines/cine/texte.cpp	2008-06-09 17:50:52 UTC (rev 32637)
@@ -635,7 +635,7 @@
 			bkpWidth = width;
 			bkpLen = i + 1;
 		} else {
-			charWidth = fontParamTable[str[i]].characterWidth + 1;
+			charWidth = fontParamTable[(unsigned char)str[i]].characterWidth + 1;
 			width += charWidth;
 		}
 

Modified: scummvm/trunk/engines/m4/converse.cpp
===================================================================
--- scummvm/trunk/engines/m4/converse.cpp	2008-06-09 14:45:45 UTC (rev 32636)
+++ scummvm/trunk/engines/m4/converse.cpp	2008-06-09 17:50:52 UTC (rev 32637)
@@ -1110,7 +1110,7 @@
 	_variables[hashOffset] = value;
 }
 
-const int32 Converse::getValue(int32 offset) {
+int32 Converse::getValue(int32 offset) {
 	char hashOffset[10];
 	sprintf(hashOffset, "%i", offset);
 	ConvVarHashMap::const_iterator entry = _variables.find(hashOffset);

Modified: scummvm/trunk/engines/m4/converse.h
===================================================================
--- scummvm/trunk/engines/m4/converse.h	2008-06-09 14:45:45 UTC (rev 32636)
+++ scummvm/trunk/engines/m4/converse.h	2008-06-09 17:50:52 UTC (rev 32637)
@@ -171,7 +171,7 @@
 	ConvEntry *getNode(int32 index) { return _convNodes[index]; }
 
 	void setValue(int32 offset, int32 value);
-	const int32 getValue(int32 offset);
+	int32 getValue(int32 offset);
 	bool evaluateCondition(int32 leftVal, int32 op, int32 rightVal);
 	bool performAction(EntryAction *action);
 	/*

Modified: scummvm/trunk/engines/m4/font.cpp
===================================================================
--- scummvm/trunk/engines/m4/font.cpp	2008-06-09 14:45:45 UTC (rev 32636)
+++ scummvm/trunk/engines/m4/font.cpp	2008-06-09 17:50:52 UTC (rev 32637)
@@ -192,7 +192,7 @@
 
 	while (*text) {
 
-		char theChar = (*text++) & 0x7F;
+		unsigned char theChar = (*text++) & 0x7F;
 		int charWidth = _charWidths[theChar];
 		
 		if (charWidth > 0) {

Modified: scummvm/trunk/engines/parallaction/font.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/font.cpp	2008-06-09 14:45:45 UTC (rev 32636)
+++ scummvm/trunk/engines/parallaction/font.cpp	2008-06-09 17:50:52 UTC (rev 32637)
@@ -96,7 +96,7 @@
 		return (uint16)_height;
 	}
 
-	uint16 drawChar(char c) {
+	uint16 drawChar(unsigned char c) {
 		assert(c < _numGlyphs);
 
 		byte *src = _data + _offsets[c];


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