diff options
author | D G Turner | 2019-12-12 17:31:01 +0000 |
---|---|---|
committer | D G Turner | 2019-12-12 17:31:01 +0000 |
commit | 799a088b6edb7772c01d60ebc3e6160bb26ce8fc (patch) | |
tree | c3586556fd1efe38db42629427c718af16ca41d7 /engines/gob | |
parent | f62dc99600da83128b7ee1c08bfb09ebc6539173 (diff) | |
download | scummvm-rg350-799a088b6edb7772c01d60ebc3e6160bb26ce8fc.tar.gz scummvm-rg350-799a088b6edb7772c01d60ebc3e6160bb26ce8fc.tar.bz2 scummvm-rg350-799a088b6edb7772c01d60ebc3e6160bb26ce8fc.zip |
GOB: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
Diffstat (limited to 'engines/gob')
26 files changed, 158 insertions, 0 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp index 3ee6d64bec..88076764de 100644 --- a/engines/gob/draw.cpp +++ b/engines/gob/draw.cpp @@ -381,6 +381,9 @@ void Draw::adjustCoords(char adjust, int16 *coord1, int16 *coord2) { if (coord1) *coord1 = *coord1 * 2 + 1; break; + + default: + break; } } diff --git a/engines/gob/draw_fascin.cpp b/engines/gob/draw_fascin.cpp index 60b173de6c..fbf97d55af 100644 --- a/engines/gob/draw_fascin.cpp +++ b/engines/gob/draw_fascin.cpp @@ -299,6 +299,9 @@ void Draw_Fascination::spriteOperation(int16 operation) { dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, _spriteRight, _spriteBottom); break; + + default: + break; } _spriteLeft = spriteLeft; diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp index d17aad5cad..daf28fceaa 100644 --- a/engines/gob/draw_v1.cpp +++ b/engines/gob/draw_v1.cpp @@ -213,6 +213,8 @@ void Draw_v1::printTotText(int16 id) { _backColor = cmd & 0xF; spriteOperation(DRAW_FILLRECTABS); break; + default: + break; } } ptr += 2; @@ -485,6 +487,9 @@ void Draw_v1::spriteOperation(int16 operation) { _destSpriteX, _destSpriteY, (_transparency == 0) ? -1 : 0); break; + + default: + break; } if (_renderFlags & RENDERFLAG_USEDELTAS) { diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp index 8d487f815a..bac5e19957 100644 --- a/engines/gob/draw_v2.cpp +++ b/engines/gob/draw_v2.cpp @@ -329,6 +329,8 @@ void Draw_v2::printTotText(int16 id) { _backColor = cmd & 0xF; spriteOperation(DRAW_FILLRECTABS); break; + default: + break; } } ptr += 2; @@ -916,6 +918,9 @@ void Draw_v2::spriteOperation(int16 operation) { dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, _spriteRight, _spriteBottom); break; + + default: + break; } _spriteLeft = spriteLeft; diff --git a/engines/gob/expression.cpp b/engines/gob/expression.cpp index c108e1d82d..7cd5ab0446 100644 --- a/engines/gob/expression.cpp +++ b/engines/gob/expression.cpp @@ -174,6 +174,10 @@ void Expression::skipExpr(char stopToken) { case OP_FUNC: _vm->_game->_script->skip(1); skipExpr(OP_END_EXPR); + break; + + default: + break; } continue; } // if ((operation >= OP_ARRAY_INT8) && (operation <= OP_FUNC)) @@ -309,6 +313,9 @@ void Expression::printExpr_internal(char stopToken) { debugN(5, "id("); printExpr_internal(OP_END_EXPR); break; + + default: + break; } continue; } // if ((operation >= OP_ARRAY_INT8) && (operation <= OP_FUNC)) @@ -783,11 +790,17 @@ void Expression::loadValue(byte operation, uint32 varBase, const StackFrame &sta _resultInt = _vm->_util->getRandom(_resultInt); break; + + default: + break; } *stackFrame.opers = OP_LOAD_IMM_INT16; *stackFrame.values = _resultInt; break; + + default: + break; } } @@ -823,6 +836,9 @@ void Expression::simpleArithmetic1(StackFrame &stackFrame) { stackFrame.values[-2] &= stackFrame.values[0]; stackFrame.pop(2); break; + + default: + break; } } @@ -859,6 +875,9 @@ void Expression::simpleArithmetic2(StackFrame &stackFrame) { stackFrame.values[-3] &= stackFrame.values[-1]; stackFrame.pop(2); break; + + default: + break; } } diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp index 058e73b514..cd2f983011 100644 --- a/engines/gob/goblin.cpp +++ b/engines/gob/goblin.cpp @@ -721,6 +721,9 @@ void Goblin::adjustDest(int16 posX, int16 posY) { case 3: _pressedMapY -= resDelta; break; + + default: + break; } } @@ -1748,6 +1751,9 @@ void Goblin::animate(Mult::Mult_Object *obj) { if (animData->frame >= framesCount) animData->isPaused = 1; break; + + default: + break; } if ((animData->newState == -1) && (animData->frame >= framesCount)) { @@ -1873,6 +1879,9 @@ void Goblin::updateLayer1(Mult::Mult_AnimData *animData) { case 23: animData->layer = 21; break; + + default: + break; } } @@ -1905,6 +1914,9 @@ void Goblin::updateLayer2(Mult::Mult_AnimData *animData) { case 23: animData->layer = 24; break; + + default: + break; } } diff --git a/engines/gob/goblin_v1.cpp b/engines/gob/goblin_v1.cpp index 760e5e65a9..01c287778b 100644 --- a/engines/gob/goblin_v1.cpp +++ b/engines/gob/goblin_v1.cpp @@ -396,6 +396,9 @@ void Goblin_v1::movePathFind(Mult::Mult_Object *obj, gobDesc->curLookDir = 4; _destItemId = -1; break; + + default: + break; } break; @@ -417,6 +420,9 @@ void Goblin_v1::movePathFind(Mult::Mult_Object *obj, case 0: gobDesc->nextState = 19; break; + + default: + break; } break; } @@ -484,6 +490,9 @@ void Goblin_v1::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc, case 24: gobDesc->curLookDir = 6; break; + + default: + break; } } @@ -589,6 +598,9 @@ void Goblin_v1::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc, case 38: _gobPositions[_currentGoblin].y++; break; + + default: + break; } if (_currentGoblin == 1) { @@ -673,6 +685,9 @@ void Goblin_v1::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc, case 38: _gobPositions[_currentGoblin].y++; break; + + default: + break; } if (_currentGoblin == 1) { diff --git a/engines/gob/goblin_v2.cpp b/engines/gob/goblin_v2.cpp index 4dadf33883..9ce757df90 100644 --- a/engines/gob/goblin_v2.cpp +++ b/engines/gob/goblin_v2.cpp @@ -354,6 +354,9 @@ void Goblin_v2::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc, if (animData->frame >= framesCount) animData->isPaused = 1; break; + + default: + break; } switch (animData->state) { @@ -404,6 +407,9 @@ void Goblin_v2::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc, if (animData->pathExistence == 4) animData->pathExistence = 5; break; + + default: + break; } if ((animData->newState != -1) && (animData->frame == framesCount) && @@ -699,6 +705,9 @@ void Goblin_v2::advMovement(Mult::Mult_Object *obj, int8 state) { obj->goblinX--; obj->goblinY++; break; + + default: + break; } } diff --git a/engines/gob/goblin_v3.cpp b/engines/gob/goblin_v3.cpp index 7a64ba7671..b84f53c6f8 100644 --- a/engines/gob/goblin_v3.cpp +++ b/engines/gob/goblin_v3.cpp @@ -103,6 +103,9 @@ void Goblin_v3::advMovement(Mult::Mult_Object *obj, int8 state) { obj->goblinX++; obj->goblinY += 2; break; + + default: + break; } } diff --git a/engines/gob/goblin_v4.cpp b/engines/gob/goblin_v4.cpp index 908b4ef616..46dd024436 100644 --- a/engines/gob/goblin_v4.cpp +++ b/engines/gob/goblin_v4.cpp @@ -264,6 +264,9 @@ void Goblin_v4::movePathFind(Mult::Mult_Object *obj, Gob_Object *gobDesc, int16 case 41: animData->nextState = 31; break; + + default: + break; } break; } @@ -373,6 +376,8 @@ void Goblin_v4::movePathFind(Mult::Mult_Object *obj, Gob_Object *gobDesc, int16 case 7: animData->nextState = 31; break; + default: + break; } break; } @@ -416,6 +421,9 @@ void Goblin_v4::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc, if (animData->frame >= framesCount) animData->isPaused = 1; break; + + default: + break; } switch (animData->state) { @@ -470,6 +478,9 @@ void Goblin_v4::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc, if (animData->pathExistence == 4) animData->pathExistence = 5; break; + + default: + break; } if ((animData->newState != -1) && (animData->frame == framesCount) && @@ -595,6 +606,9 @@ int16 Goblin_v4::turnState(int16 state, uint16 dir) { case 29: dx = 2; break; + + default: + break; } switch (dir) { @@ -629,6 +643,9 @@ int16 Goblin_v4::turnState(int16 state, uint16 dir) { case kDirSE: cx = 5; break; + + default: + break; } return newStates[dx][cx]; diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp index 0b47f43774..b314484fdf 100644 --- a/engines/gob/hotspots.cpp +++ b/engines/gob/hotspots.cpp @@ -1228,6 +1228,9 @@ uint16 Hotspots::handleInputs(int16 time, uint16 inputCount, uint16 &curInput, if (curInput > 0) curInput--; break; + + default: + break; } } } @@ -1451,6 +1454,9 @@ void Hotspots::evaluateNew(uint16 i, uint16 *ids, InputDesc *inputs, flags = ((uint16) kTypeClick) + (windowNum << 8) + (flags << 4); break; + + default: + break; } // Add the new hotspot diff --git a/engines/gob/inter_fascin.cpp b/engines/gob/inter_fascin.cpp index c67143346b..0df30ccd68 100644 --- a/engines/gob/inter_fascin.cpp +++ b/engines/gob/inter_fascin.cpp @@ -189,6 +189,9 @@ void Inter_Fascination::oFascin_assign(OpFuncParams ¶ms) { else WRITE_VARO_STR(dest, _vm->_game->_script->getResultStr()); break; + + default: + break; } } } diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp index 58c671e481..ac85d3a074 100644 --- a/engines/gob/inter_playtoons.cpp +++ b/engines/gob/inter_playtoons.cpp @@ -155,6 +155,9 @@ void Inter_Playtoons::oPlaytoons_printText(OpFuncParams ¶ms) { sprintf(buf + i, "%s", GET_VARO_STR(_vm->_game->_script->readVarIndex())); break; + + default: + break; } _vm->_game->_script->skip(1); } else diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 676564a9fb..f77b970e93 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -901,6 +901,8 @@ void Inter_v1::o1_assign(OpFuncParams ¶ms) { WRITE_VARO_STR(dest, _vm->_game->_script->getResultStr()); break; + default: + break; } } @@ -969,6 +971,9 @@ void Inter_v1::o1_printText(OpFuncParams ¶ms) { sprintf(buf + i, "%s", GET_VARO_STR(_vm->_game->_script->readVarIndex())); break; + + default: + break; } _vm->_game->_script->skip(1); } else @@ -1059,6 +1064,9 @@ void Inter_v1::o1_palLoad(OpFuncParams ¶ms) { return; } break; + + default: + break; } if ((cmd & 0x7F) == 0x30) { @@ -1164,6 +1172,9 @@ void Inter_v1::o1_palLoad(OpFuncParams ¶ms) { return; } break; + + default: + break; } if (!_vm->_draw->_applyPal) { diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index d61b1c94d1..a036cd2f69 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -757,6 +757,9 @@ void Inter_v2::o2_setGoblinState() { (_vm->_scenery->_animBottom - _vm->_scenery->_animTop); *(obj.pPosX) = obj.goblinX * _vm->_map->getTilesWidth(); break; + + default: + break; } } @@ -1054,6 +1057,9 @@ void Inter_v2::o2_assign(OpFuncParams ¶ms) { else WRITE_VARO_STR(dest, _vm->_game->_script->getResultStr()); break; + + default: + break; } } } @@ -1114,6 +1120,9 @@ void Inter_v2::o2_printText(OpFuncParams ¶ms) { sprintf(buf + i, "%s", GET_VARO_STR(_vm->_game->_script->readVarIndex())); break; + + default: + break; } _vm->_game->_script->skip(1); } else @@ -1283,6 +1292,9 @@ void Inter_v2::o2_getTotTextItemPart(OpFuncParams ¶ms) { case 4: totData += 2; break; + + default: + break; } } diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp index 66eade60f7..8ba7e8f19f 100644 --- a/engines/gob/inter_v6.cpp +++ b/engines/gob/inter_v6.cpp @@ -329,6 +329,9 @@ void Inter_v6::o6_assign(OpFuncParams ¶ms) { else WRITE_VARO_STR(dest, _vm->_game->_script->getResultStr()); break; + + default: + break; } } } diff --git a/engines/gob/minigames/geisha/evilfish.cpp b/engines/gob/minigames/geisha/evilfish.cpp index cd47e689b1..7b3a4c9787 100644 --- a/engines/gob/minigames/geisha/evilfish.cpp +++ b/engines/gob/minigames/geisha/evilfish.cpp @@ -92,6 +92,7 @@ void EvilFish::advance() { switch (_state) { case kStateNone: + default: break; case kStateSwimLeft: diff --git a/engines/gob/minigames/geisha/penetration.cpp b/engines/gob/minigames/geisha/penetration.cpp index 0ebcd2c55b..a69d998ffd 100644 --- a/engines/gob/minigames/geisha/penetration.cpp +++ b/engines/gob/minigames/geisha/penetration.cpp @@ -715,6 +715,9 @@ void Penetration::createMap() { _sub->sub = new Submarine(*_objects); _sub->sub->setPosition(kPlayAreaX + kPlayAreaBorderWidth, kPlayAreaY + kPlayAreaBorderHeight); break; + + default: + break; } } } diff --git a/engines/gob/mult_v1.cpp b/engines/gob/mult_v1.cpp index d1a417b520..78c18a082d 100644 --- a/engines/gob/mult_v1.cpp +++ b/engines/gob/mult_v1.cpp @@ -182,6 +182,9 @@ void Mult_v1::loadMult(int16 resId) { case 5: _vm->_game->_script->skip(_multData->sndKeys[i].freq * 2); break; + + default: + break; } } @@ -438,6 +441,9 @@ void Mult_v1::newCycleAnim(Mult_Object &animObj) { animData.frame--; animData.isPaused = 1; break; + + default: + break; } animData.newCycle = 1; } diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp index 51471b55bb..5f838321f9 100644 --- a/engines/gob/mult_v2.cpp +++ b/engines/gob/mult_v2.cpp @@ -798,6 +798,9 @@ void Mult_v2::newCycleAnim(Mult_Object &animObj) { case 10: warning("Woodruff Stub: AnimType 10"); break; + + default: + break; } animData.newCycle = 1; diff --git a/engines/gob/pregob/onceupon/chargenchild.cpp b/engines/gob/pregob/onceupon/chargenchild.cpp index c04fa732ac..a6eedd918a 100644 --- a/engines/gob/pregob/onceupon/chargenchild.cpp +++ b/engines/gob/pregob/onceupon/chargenchild.cpp @@ -96,6 +96,9 @@ void CharGenChild::advance() { setPosition(x, y + 14); } break; + + default: + break; } } diff --git a/engines/gob/pregob/onceupon/parents.cpp b/engines/gob/pregob/onceupon/parents.cpp index a773d4c869..ab08b94181 100644 --- a/engines/gob/pregob/onceupon/parents.cpp +++ b/engines/gob/pregob/onceupon/parents.cpp @@ -168,6 +168,9 @@ void Parents::handleFrameEvent() { case 340: playSound(kSoundCackle); break; + + default: + break; } } diff --git a/engines/gob/script.cpp b/engines/gob/script.cpp index 9298f159a4..ce077f723a 100644 --- a/engines/gob/script.cpp +++ b/engines/gob/script.cpp @@ -300,6 +300,9 @@ char Script::evalExpr(int16 *pRes) { case GOB_TRUE: *pRes = 1; break; + + default: + break; } return type; diff --git a/engines/gob/sound/bgatmosphere.cpp b/engines/gob/sound/bgatmosphere.cpp index c7be1be96a..dffc0f75b1 100644 --- a/engines/gob/sound/bgatmosphere.cpp +++ b/engines/gob/sound/bgatmosphere.cpp @@ -102,6 +102,7 @@ void BackgroundAtmosphere::getNextQueuePos() { switch (_playMode) { case Sound::kPlayModeLinear: + default: _queuePos = (_queuePos + 1) % _queue.size(); break; diff --git a/engines/gob/sound/sounddesc.cpp b/engines/gob/sound/sounddesc.cpp index d56387078a..5997c994b9 100644 --- a/engines/gob/sound/sounddesc.cpp +++ b/engines/gob/sound/sounddesc.cpp @@ -96,6 +96,8 @@ bool SoundDesc::load(SoundType type, byte *data, uint32 dSize) { return loadSND(data, dSize); case SOUND_WAV: return loadWAV(data, dSize); + default: + break; } return false; diff --git a/engines/gob/variables.cpp b/engines/gob/variables.cpp index 2ef7be2f90..ee9c109193 100644 --- a/engines/gob/variables.cpp +++ b/engines/gob/variables.cpp @@ -272,6 +272,8 @@ VariableReference &VariableReference::operator=(uint32 value) { case Variables::kVariableType32: _vars->writeOff32(_offset, value); break; + default: + break; } } return *this; @@ -286,6 +288,8 @@ VariableReference::operator uint32() { return (uint32) _vars->readOff16(_offset); case Variables::kVariableType32: return _vars->readOff32(_offset); + default: + break; } } |