diff options
author | Max Horn | 2009-05-14 23:09:04 +0000 |
---|---|---|
committer | Max Horn | 2009-05-14 23:09:04 +0000 |
commit | a3efc5611c94a6295d00488b0210e5e568c78c50 (patch) | |
tree | 1ae000fa45c41982ac536fe176f0e207bd0966a9 /engines | |
parent | 67ce8fee8545deae84bc7bc46a2c725e41c2e153 (diff) | |
download | scummvm-rg350-a3efc5611c94a6295d00488b0210e5e568c78c50.tar.gz scummvm-rg350-a3efc5611c94a6295d00488b0210e5e568c78c50.tar.bz2 scummvm-rg350-a3efc5611c94a6295d00488b0210e5e568c78c50.zip |
Fixed various GCC 4.2 warnings, among them an actual longstanding bug (3 years :) in the quicktime midi code
svn-id: r40577
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agos/script_pn.cpp | 4 | ||||
-rw-r--r-- | engines/agos/string.cpp | 9 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/kstring.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 4 | ||||
-rw-r--r-- | engines/tucker/resource.cpp | 4 |
6 files changed, 22 insertions, 11 deletions
diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp index aec69e84c4..2dbd4e52fb 100644 --- a/engines/agos/script_pn.cpp +++ b/engines/agos/script_pn.cpp @@ -891,7 +891,9 @@ nln: _linct = ((*_linebase) & 127) - 1; } carryon: - while((x = doaction()) && !shouldQuit()); + do { + x = doaction(); + } while (x && !shouldQuit()); skipln: _linebase += 127 & *_linebase; _linembr++; diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index 68860fe4f3..6f5fb391e5 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -916,7 +916,8 @@ uint32 AGOSEngine_PN::ftext(uint32 base, int n) { uint32 b = base; int ct = n; while (ct) { - while(_textBase[b++]); + while(_textBase[b++]) + ; ct--; } return b; @@ -927,7 +928,8 @@ char *AGOSEngine_PN::unctok(char *c, int n) { uint8 *tokbase; tokbase = _textBase + getlong(30); x = n; - while (x-=(*tokbase++ > 127)); + while (x-=(*tokbase++ > 127)) + ; while (*tokbase < 128) *c++=*tokbase++; *c++ = *tokbase & 127; @@ -1043,7 +1045,8 @@ void AGOSEngine_PN::patok(int n) { uint8 *tokbase; tokbase = _textBase + getlong(30); x = n; - while (x -= (*tokbase++ > 127)); + while (x -= (*tokbase++ > 127)) + ; while (*tokbase < 128) pcf(*tokbase++); pcf((uint8)(*tokbase & 127)); diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 660cc310ba..c589e0659e 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -1457,10 +1457,12 @@ reg_t kEditControl(EngineState *s, int funct_nr, int argc, reg_t *argv) { } else if (modifiers & SCI_EVM_ALT) { // Ctrl has precedence over Alt switch (key) { case 0x2100 /* A-f */: - while ((cursor < textlen) && (text[cursor++] != ' ')); + while ((cursor < textlen) && (text[cursor++] != ' ')) + ; break; case 0x3000 /* A-b */: - while ((cursor > 0) && (text[--cursor - 1] != ' ')); + while ((cursor > 0) && (text[--cursor - 1] != ' ')) + ; break; case 0x2000 /* A-d */: { while ((cursor < textlen) && (text[cursor] == ' ')) { diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index b1081ac8ff..e7149e51df 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -712,8 +712,10 @@ reg_t kGetFarText(EngineState *s, int funct_nr, int argc, reg_t *argv) { seeker = (char *) textres->data; - while (counter--) - while (*seeker++); + while (counter--) { + while (*seeker++) + ; + } /* The second parameter (counter) determines the number of the string inside the text ** resource. */ diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 8eddfd7d9e..b32d4c5ff8 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -788,7 +788,7 @@ void run_vm(EngineState *s, int restoring) { case 0x01: // add r_temp = POP32(); if (r_temp.segment || s->r_acc.segment) { - reg_t r_ptr; + reg_t r_ptr = NULL_REG; int offset; // Pointer arithmetics! if (s->r_acc.segment) { @@ -815,7 +815,7 @@ void run_vm(EngineState *s, int restoring) { case 0x02: // sub r_temp = POP32(); if (r_temp.segment || s->r_acc.segment) { - reg_t r_ptr; + reg_t r_ptr = NULL_REG; int offset; // Pointer arithmetics! if (s->r_acc.segment) { diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index e10f824265..3c6a9aaac2 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -1016,7 +1016,9 @@ void TuckerEngine::loadActionsTable() { } break; } - while ((table = executeTableInstruction()) == 0); + do { + table = executeTableInstruction(); + } while (table == 0); } while (table == 3); if (table == 2) { _nextAction = 0; |