diff options
author | D G Turner | 2019-12-01 05:06:31 +0000 |
---|---|---|
committer | D G Turner | 2019-12-01 05:06:31 +0000 |
commit | d11c61db1466d79ef6253814a86b04950b499ec3 (patch) | |
tree | 2987143903d00c9e6b0b8a8490aade67fe052b68 /engines/sci/engine | |
parent | f0c02796f44f7302719b0b107d0f0af6b00ffc50 (diff) | |
download | scummvm-rg350-d11c61db1466d79ef6253814a86b04950b499ec3.tar.gz scummvm-rg350-d11c61db1466d79ef6253814a86b04950b499ec3.tar.bz2 scummvm-rg350-d11c61db1466d79ef6253814a86b04950b499ec3.zip |
SCI: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/guest_additions.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/kernel.cpp | 3 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/kmisc.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/kmovement.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/ksound.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/kstring.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 8 | ||||
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 3 | ||||
-rw-r--r-- | engines/sci/engine/segment.h | 3 | ||||
-rw-r--r-- | engines/sci/engine/state.cpp | 4 |
11 files changed, 41 insertions, 0 deletions
diff --git a/engines/sci/engine/guest_additions.cpp b/engines/sci/engine/guest_additions.cpp index 5ed3776415..dd0448f4a0 100644 --- a/engines/sci/engine/guest_additions.cpp +++ b/engines/sci/engine/guest_additions.cpp @@ -842,6 +842,7 @@ void GuestAdditions::syncMessageTypeFromScummVM() const { break; #endif case kMessageTypeSyncStrategyNone: + default: break; } } @@ -940,6 +941,7 @@ void GuestAdditions::syncMessageTypeToScummVM(const int index, const reg_t value // LSL6hires synchronisation happens via send_selector #endif case kMessageTypeSyncStrategyNone: + default: break; } } @@ -1326,6 +1328,8 @@ void GuestAdditions::syncAudioVolumeGlobalsToScummVM(const int index, const reg_ case kGlobalVarTorinSpeechVolume: ConfMan.setInt("speech_volume", volume); break; + default: + break; } } break; diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 3cf5fd5b79..8477b93a24 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -300,6 +300,9 @@ static uint16 *parseKernelSignature(const char *kernelName, const char *writtenS writePos++; signature = 0; } + break; + default: + break; } } switch (curChar) { diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index e6644b54bd..5562e2c45d 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -860,6 +860,8 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { case SCI_CONTROLS_TYPE_TEXT: splitText = g_sci->strSplitLanguage(text.c_str(), &languageSplitter); break; + default: + break; } switch (type) { diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 43487939e5..0b5756c337 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -369,6 +369,8 @@ reg_t kMemory(EngineState *s, int argc, reg_t *argv) { } break; } + default: + break; } return s->r_acc; @@ -757,6 +759,8 @@ reg_t kKawaHacks(EngineState *s, int argc, reg_t *argv) { case 3: // IsDebug // Return 1 if running with an internal debugger, 2 if we have AddMenu support, 3 if both. return make_reg(0, 3); + default: + break; } return NULL_REG; } diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp index 9b83dbc52d..7422980df8 100644 --- a/engines/sci/engine/kmovement.cpp +++ b/engines/sci/engine/kmovement.cpp @@ -476,6 +476,9 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { case 270: case 315: newX -= clientXstep; + break; + default: + break; } switch (newHeading) { @@ -488,6 +491,9 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { case 180: case 225: newY += clientYstep; + break; + default: + break; } writeSelectorValue(segMan, client, SELECTOR(x), newX); writeSelectorValue(segMan, client, SELECTOR(y), newY); diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 1a34e82c5e..321e83d947 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -92,6 +92,8 @@ reg_t kDoSoundPhantasmagoriaMac(EngineState *s, int argc, reg_t *argv) { return g_sci->_soundCmd->kDoSoundSetLoop(s, argc - 1, argv + 1); case 10: return g_sci->_soundCmd->kDoSoundUpdateCues(s, argc - 1, argv + 1); + default: + break; } error("Unknown kDoSound Phantasmagoria Mac subop %d", argv[0].toUint16()); diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index cbe481d343..4cf12360a1 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -544,6 +544,8 @@ reg_t kMessage(EngineState *s, int argc, reg_t *argv) { return make_reg(0, t.verb); case K_MESSAGE_REFNOUN: return make_reg(0, t.noun); + default: + break; } } diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 753b25636b..7641a32528 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -17305,6 +17305,9 @@ void ScriptPatcher::applyPatch(const SciScriptPatcherEntry *patchEntry, SciSpan< case PATCH_CODE_BYTE: scriptData[offset] = patchValue & PATCH_BYTEMASK; offset++; + break; + default: + break; } patchData++; patchWord = *patchData; @@ -17383,6 +17386,9 @@ bool ScriptPatcher::verifySignature(uint32 byteOffset, const uint16 *signatureDa } else { sigWord = SIG_MISMATCH; // out of bounds } + break; + default: + break; } if (sigWord == SIG_MISMATCH) @@ -17493,6 +17499,8 @@ void ScriptPatcher::calculateMagicDWordAndVerify(const char *signatureDescriptio } break; } + default: + break; } magicOffset -= 2; if (magicDWordLeft) { diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index c579239b09..7a1fe66d35 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -1111,6 +1111,9 @@ void logBacktrace() { con->debugPrintf(" %x:[%x] vs%s %s::%s (", i, call.debugOrigin, (call.argc) ? "write" : "read", objname, g_sci->getKernel()->getSelectorName(call.debugSelector).c_str()); break; + + default: + break; } totalparamc = call.argc; diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h index 8df3653434..5bc655a4bf 100644 --- a/engines/sci/engine/segment.h +++ b/engines/sci/engine/segment.h @@ -752,8 +752,11 @@ public: } break; } + case kArrayTypeInvalid: + default: error("Attempted write to uninitialized SciArray"); + break; } } diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 65d5562ab9..5bb1343839 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -264,7 +264,11 @@ Common::String SciEngine::getSciLanguageString(const Common::String &str, kLangu fullWidth += 0x0D; // CR textPtr += 2; continue; + default: + break; } + default: + break; } textPtr++; |