From 339874f6c0934e16ac78c9b79a94b765668409af Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 9 Jun 2008 17:50:52 +0000 Subject: 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.) svn-id: r32637 --- engines/cine/gfx.cpp | 8 ++++---- engines/cine/texte.cpp | 2 +- engines/m4/converse.cpp | 2 +- engines/m4/converse.h | 2 +- engines/m4/font.cpp | 2 +- engines/parallaction/font.cpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index aa457fe4f9..47446f2410 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -335,8 +335,8 @@ int FWRenderer::drawChar(char character, int x, int y) { 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 @@ int OSRenderer::drawChar(char character, int x, int y) { 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; } diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp index 91a209074d..9b4b83f420 100644 --- a/engines/cine/texte.cpp +++ b/engines/cine/texte.cpp @@ -635,7 +635,7 @@ int fitLine(const char *str, int maxWidth, int &words, int &width) { bkpWidth = width; bkpLen = i + 1; } else { - charWidth = fontParamTable[str[i]].characterWidth + 1; + charWidth = fontParamTable[(unsigned char)str[i]].characterWidth + 1; width += charWidth; } diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp index 6480428661..729af6c40f 100644 --- a/engines/m4/converse.cpp +++ b/engines/m4/converse.cpp @@ -1110,7 +1110,7 @@ void Converse::setValue(int32 offset, int32 value) { _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); diff --git a/engines/m4/converse.h b/engines/m4/converse.h index bea90d9ddf..4bd4524029 100644 --- a/engines/m4/converse.h +++ b/engines/m4/converse.h @@ -171,7 +171,7 @@ public: 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); /* diff --git a/engines/m4/font.cpp b/engines/m4/font.cpp index c9b9a44f23..119e7297cf 100644 --- a/engines/m4/font.cpp +++ b/engines/m4/font.cpp @@ -192,7 +192,7 @@ int32 Font::write(M4Surface *surface, const char *text, int x, int y, int width, while (*text) { - char theChar = (*text++) & 0x7F; + unsigned char theChar = (*text++) & 0x7F; int charWidth = _charWidths[theChar]; if (charWidth > 0) { diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp index bc67acf644..91848b30a4 100644 --- a/engines/parallaction/font.cpp +++ b/engines/parallaction/font.cpp @@ -96,7 +96,7 @@ public: return (uint16)_height; } - uint16 drawChar(char c) { + uint16 drawChar(unsigned char c) { assert(c < _numGlyphs); byte *src = _data + _offsets[c]; -- cgit v1.2.3