diff options
author | D G Turner | 2019-12-01 15:11:36 +0000 |
---|---|---|
committer | D G Turner | 2019-12-01 15:11:36 +0000 |
commit | f26bb57ef85368ae392fef129cf96b723a1e1b3d (patch) | |
tree | 82ea8cf1a73671e2d35f0d4dfd227af41dcf8edb /engines/saga | |
parent | 7b275b454c1c143d97d238086ab3797f76576872 (diff) | |
download | scummvm-rg350-f26bb57ef85368ae392fef129cf96b723a1e1b3d.tar.gz scummvm-rg350-f26bb57ef85368ae392fef129cf96b723a1e1b3d.tar.bz2 scummvm-rg350-f26bb57ef85368ae392fef129cf96b723a1e1b3d.zip |
SAGA: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/actor.cpp | 7 | ||||
-rw-r--r-- | engines/saga/actor_walk.cpp | 5 | ||||
-rw-r--r-- | engines/saga/events.cpp | 4 | ||||
-rw-r--r-- | engines/saga/font.cpp | 2 | ||||
-rw-r--r-- | engines/saga/interface.cpp | 23 | ||||
-rw-r--r-- | engines/saga/introproc_ihnm.cpp | 3 | ||||
-rw-r--r-- | engines/saga/isomap.cpp | 6 | ||||
-rw-r--r-- | engines/saga/puzzle.cpp | 3 | ||||
-rw-r--r-- | engines/saga/saga.cpp | 4 | ||||
-rw-r--r-- | engines/saga/scene.cpp | 2 | ||||
-rw-r--r-- | engines/saga/script.cpp | 6 | ||||
-rw-r--r-- | engines/saga/shorten.cpp | 2 | ||||
-rw-r--r-- | engines/saga/sthread.cpp | 3 |
13 files changed, 70 insertions, 0 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index 8c45a2890e..3c6a10e853 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -644,6 +644,9 @@ int Actor::getFrameType(ActorFrameTypes frameType) { return kFrameITEPickUp; case kFrameLook: return kFrameITELook; + default: + error("Actor::getFrameType() unknown frame type %d", frameType); + return kFrameITEStand; // for compilers that don't support NORETURN } #ifdef ENABLE_IHNM } else if (_vm->getGameId() == GID_IHNM) { @@ -661,12 +664,14 @@ int Actor::getFrameType(ActorFrameTypes frameType) { case kFrameGive: case kFramePickUp: case kFrameLook: + default: error("Actor::getFrameType() unknown frame type %d", frameType); return kFrameIHNMStand; // for compilers that don't support NORETURN } #endif } error("Actor::getFrameType() unknown frame type %d", frameType); + return kFrameITEStand; // for compilers that don't support NORETURN } ActorFrameRange *Actor::getActorFrameRange(uint16 actorId, int frameType) { @@ -797,6 +802,8 @@ void Actor::handleSpeech(int msec) { case 0: _activeSpeech.playingTime = 0x7fffff; break; + default: + break; } } else { _activeSpeech.playingTime = sampleLength; diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp index 04741da2cd..c640bb854a 100644 --- a/engines/saga/actor_walk.cpp +++ b/engines/saga/actor_walk.cpp @@ -569,6 +569,7 @@ void Actor::handleActions(int msec, bool setup) { case kActionAccept: case kActionStoop: + default: break; case kActionCycleFrames: @@ -1199,6 +1200,8 @@ void Actor::moveDragon(ActorData *actor) { actor->_partialTarget.u() += 16; moveType = kDragonMoveUpRight; break; + default: + break; } switch (dir2) { @@ -1214,6 +1217,8 @@ void Actor::moveDragon(ActorData *actor) { case kDirUpRight: actor->_partialTarget.u() += 16; break; + default: + break; } actor->_walkStepIndex++; diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp index 912e62d492..fbe91bd826 100644 --- a/engines/saga/events.cpp +++ b/engines/saga/events.cpp @@ -489,6 +489,8 @@ int Events::handleOneShot(Event *event) { case kEventThreadWake: _vm->_script->wakeUpThreads(event->param); break; + default: + break; } break; case kCursorEvent: @@ -605,6 +607,8 @@ void Events::initializeEvent(Event &event) { break; case kEvTInterval: break; + default: + break; } } diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp index 66a4e1c530..b69f237106 100644 --- a/engines/saga/font.cpp +++ b/engines/saga/font.cpp @@ -656,6 +656,7 @@ Font::FontId Font::knownFont2FontIdx(KnownFont font) { if (_vm->getGameId() == GID_ITE || _vm->isIHNMDemo()) { switch (font) { case (kKnownFontSmall): + default: fontId = kSmallFont; break; case (kKnownFontMedium): @@ -679,6 +680,7 @@ Font::FontId Font::knownFont2FontIdx(KnownFont font) { } else if (_vm->getGameId() == GID_IHNM && !_vm->isIHNMDemo()) { switch (font) { case (kKnownFontSmall): + default: fontId = kSmallFont; break; case (kKnownFontMedium): diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 250d2914b7..0456f6f0af 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -477,6 +477,8 @@ void Interface::setMode(int mode) { // to flip through the pages of the help system } break; + default: + break; } draw(); @@ -655,6 +657,9 @@ bool Interface::processAscii(Common::KeyState keystate) { case '9': converseSetPos(ascii); break; + + default: + break; } break; case kPanelMap: @@ -708,6 +713,8 @@ bool Interface::processAscii(Common::KeyState keystate) { } #endif break; + default: + break; } return false; } @@ -1074,6 +1081,8 @@ void Interface::setQuit(PanelButton *panelButton) { #endif _vm->quitGame(); break; + default: + break; } } @@ -1147,6 +1156,8 @@ void Interface::setLoad(PanelButton *panelButton) { // IHNM only setMode(kPanelOption); break; + default: + break; } } @@ -1410,6 +1421,8 @@ void Interface::setSave(PanelButton *panelButton) { _textInput = false; setMode(kPanelOption); break; + default: + break; } } @@ -1563,6 +1576,9 @@ void Interface::handleChapterSelectionClick(const Point& mousePoint) { o = _vm->_actor->getObj(obj); script = o->_scriptEntrypointNumber; break; + + default: + break; } if (script > 0) { @@ -1673,6 +1689,8 @@ void Interface::setOption(PanelButton *panelButton) { ConfMan.setBool("subtitles", _vm->_subtitlesEnabled); ConfMan.setBool("voices", _vm->_voicesEnabled); break; + default: + break; } } @@ -1867,6 +1885,9 @@ void Interface::update(const Point& mousePoint, int updateFlag) { _vm->_scene->showIHNMDemoSpecialScreen(); #endif break; + + default: + break; } _lastMousePoint = mousePoint; @@ -2299,6 +2320,8 @@ void Interface::drawPanelButtonText(InterfacePanel *panel, PanelButton *panelBut else if (!_vm->_subtitlesEnabled && _vm->_voicesEnabled) textId = kTextAudio; break; + default: + break; } if (_vm->getGameId() == GID_ITE) { if (textId > kTextEnterProtectAnswer) diff --git a/engines/saga/introproc_ihnm.cpp b/engines/saga/introproc_ihnm.cpp index dc3f55e8c1..118c292a6e 100644 --- a/engines/saga/introproc_ihnm.cpp +++ b/engines/saga/introproc_ihnm.cpp @@ -263,6 +263,9 @@ bool Scene::playTitle(int title, int time, int mode) { case 9: // end done = true; break; + + default: + break; } _vm->_system->updateScreen(); diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp index ae2b458461..b820a7e1cb 100644 --- a/engines/saga/isomap.cpp +++ b/engines/saga/isomap.cpp @@ -447,6 +447,7 @@ void IsoMap::drawTiles(const Location *location) { case kEdgeTypeBlack: continue; case kEdgeTypeFill0: + default: break; case kEdgeTypeFill1: metaTileIndex = 1; @@ -491,6 +492,7 @@ void IsoMap::drawTiles(const Location *location) { case kEdgeTypeBlack: continue; case kEdgeTypeFill0: + default: break; case kEdgeTypeFill1: metaTileIndex = 1; @@ -744,6 +746,7 @@ void IsoMap::drawTile(uint16 tileIndex, const Point &point, const Location *loca case kMaskRuleNever: return; case kMaskRuleAlways: + default: break; case kMaskRuleUMIN: if (location->u() < THRESH0) { @@ -1009,6 +1012,7 @@ int16 IsoMap::getTileIndex(int16 u, int16 v, int16 z) { case kEdgeTypeBlack: return 0; case kEdgeTypeFill0: + default: break; case kEdgeTypeFill1: metaTileIndex = 1; @@ -1431,6 +1435,8 @@ void IsoMap::findDragonTilePath(ActorData* actor, const Location &start, const L pushDragonPoint(tilePoint->u + 1, tilePoint->v + 1, kDirUpRight); } break; + default: + break; } if (first && (_queueCount == _readCount)) { diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp index 77090860aa..be209370f3 100644 --- a/engines/saga/puzzle.cpp +++ b/engines/saga/puzzle.cpp @@ -517,6 +517,9 @@ void Puzzle::handleReply(int reply) { _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime * 2, this, "sagaPuzzleHint"); clearHint(); break; + + default: + break; } } diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index fb5c4a651e..e2fc38d8ef 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -237,6 +237,8 @@ Common::Error SagaEngine::run() { _resource = new Resource_HRS(this); break; #endif + default: + break; } // Detect game and open resource files @@ -484,6 +486,8 @@ const char *SagaEngine::getObjectName(uint16 objectId) const { return ""; return _scene->_sceneStrings.getString(hitZone->getNameIndex()); + default: + break; } warning("SagaEngine::getObjectName name not found for 0x%X", objectId); return NULL; diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index 5cb4b55899..496cdef18f 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -657,6 +657,8 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { _sceneNumber = loadSceneParams.sceneDescriptor; _sceneResourceId = getSceneResourceId(_sceneNumber); break; + default: + break; } debug(3, "Loading scene number %d:", _sceneNumber); diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 7a84944b17..df167d5744 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -140,6 +140,8 @@ SAGA1Script::SAGA1Script(SagaEngine *vm) : Script(vm) { setupIHNMScriptFuncList(); break; #endif + default: + break; } } @@ -1238,6 +1240,8 @@ int Script::getVerbType(VerbTypes verbType) { return kVerbITELookOnly; case kVerbOptions: return kVerbITEOptions; + default: + break; } #ifdef ENABLE_IHNM } else if (_vm->getGameId() == GID_IHNM) { @@ -1268,6 +1272,8 @@ int Script::getVerbType(VerbTypes verbType) { return kVerbIHNMLookOnly; case kVerbOptions: return kVerbIHNMOptions; + default: + break; } #endif } diff --git a/engines/saga/shorten.cpp b/engines/saga/shorten.cpp index e230476edd..8284e9ec7c 100644 --- a/engines/saga/shorten.cpp +++ b/engines/saga/shorten.cpp @@ -418,6 +418,8 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by buffer[curChannel][i] += channelOffset; break; + default: + break; } // Store mean value, if appropriate (duplicated code from above) diff --git a/engines/saga/sthread.cpp b/engines/saga/sthread.cpp index dde266bb0b..4115e5f677 100644 --- a/engines/saga/sthread.cpp +++ b/engines/saga/sthread.cpp @@ -149,6 +149,9 @@ void Script::executeThreads(uint msec) { if (thread._frameWait < _vm->_frameCount) thread._flags &= ~kTFlagWaiting; break; + + default: + break; } } |