aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-13 18:12:17 +0000
committerJohannes Schickel2009-05-13 18:12:17 +0000
commitf0182121f79685063edb50c9647e4f6f40bd0ba6 (patch)
tree482cd6fbe9b6a8fae81a72b9c3fc03961a9eda45
parentb9ac179b2e601f761cc60d431a3e5428f3740935 (diff)
downloadscummvm-rg350-f0182121f79685063edb50c9647e4f6f40bd0ba6.tar.gz
scummvm-rg350-f0182121f79685063edb50c9647e4f6f40bd0ba6.tar.bz2
scummvm-rg350-f0182121f79685063edb50c9647e4f6f40bd0ba6.zip
Fix some variable may be used uninitialized warnings.
svn-id: r40528
-rw-r--r--engines/agi/predictive.cpp1
-rw-r--r--engines/cruise/dataLoader.cpp5
-rw-r--r--engines/sci/gfx/res_pic.cpp2
-rw-r--r--engines/sky/text.cpp1
-rw-r--r--engines/sword2/screen.cpp1
5 files changed, 8 insertions, 2 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index 09472235ad..59030494bd 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -141,6 +141,7 @@ bool AgiEngine::predictiveDialog(void) {
// 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));
diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp
index ef333be6c6..ac87d1305b 100644
--- a/engines/cruise/dataLoader.cpp
+++ b/engines/cruise/dataLoader.cpp
@@ -53,6 +53,9 @@ void decodeGfxUnified(dataFileEntry *pCurrentFileEntry, int16 format) {
case 5:
spriteSize = pCurrentFileEntry->height * pCurrentFileEntry->widthInColumn;
break;
+
+ default:
+ error("Unkown gfx format %d", format);
}
uint8 *buffer = (uint8 *)malloc(spriteSize);
@@ -66,7 +69,7 @@ void decodeGfxUnified(dataFileEntry *pCurrentFileEntry, int16 format) {
uint8 c;
uint16 p0;
// Format 4
- uint16 p1, p2, p3;
+ uint16 p1 = 0, p2 = 0, p3 = 0;
p0 = (dataPtr[0] << 8) | dataPtr[1];
diff --git a/engines/sci/gfx/res_pic.cpp b/engines/sci/gfx/res_pic.cpp
index 5cf2b8ec6d..1e028ca3dc 100644
--- a/engines/sci/gfx/res_pic.cpp
+++ b/engines/sci/gfx/res_pic.cpp
@@ -1155,7 +1155,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
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
diff --git a/engines/sky/text.cpp b/engines/sky/text.cpp
index 64a72a53aa..820f1827c2 100644
--- a/engines/sky/text.cpp
+++ b/engines/sky/text.cpp
@@ -339,6 +339,7 @@ DisplayedText Text::displayText(char *textPtr, uint8 *dest, bool centre, uint16
} while (textChar >= 10);
DisplayedText ret;
+ memset(&ret, 0, sizeof(ret));
ret.textData = dest;
ret.textWidth = dtLastWidth;
return ret;
diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp
index 3a174b2352..6782a0691c 100644
--- a/engines/sword2/screen.cpp
+++ b/engines/sword2/screen.cpp
@@ -285,6 +285,7 @@ void Screen::buildDisplay() {
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());