Silenced some harmless cppcheck warnings about unreachable code after a return.

In this case, it was always a break after a return in a switch case. There are
similar cases which cppcheck didn't detect, and a couple of cases where we have
a break after a continue in a switch case (where the continue refers to an
outer loop), but I didn't touch those. Not yet, at least.

svn-id: r48218
This commit is contained in:
Torbjörn Andersson 2010-03-10 06:39:23 +00:00
parent fc50408ce3
commit 65585f6433
12 changed files with 1 additions and 16 deletions

View file

@ -81,8 +81,6 @@ bool Troll::getMenuSel(const char *szMenu, int *iSel, int nSel) {
inventory(); inventory();
return false; return false;
break;
case Common::KEYCODE_DOWN: case Common::KEYCODE_DOWN:
case Common::KEYCODE_SPACE: case Common::KEYCODE_SPACE:
*iSel += 1; *iSel += 1;

View file

@ -769,7 +769,6 @@ int AGOSEngine_PN::varval() {
case 249: case 249:
b = readfromline(); b = readfromline();
return (int)(b + 256 * readfromline()); return (int)(b + 256 * readfromline());
break;
case 250: case 250:
return readfromline(); return readfromline();
case 251: case 251:

View file

@ -253,12 +253,9 @@ int loadFile(const char* name, int idx, int destIdx) {
return 0; // exit if limit is reached return 0; // exit if limit is reached
} }
return loadSetEntry(name, ptr, destIdx, idx); return loadSetEntry(name, ptr, destIdx, idx);
break;
} }
case type_FNT: { case type_FNT: {
return loadFNTSub(ptr, idx); return loadFNTSub(ptr, idx);
break;
} }
case type_SPL: { case type_SPL: {
// Sound file // Sound file

View file

@ -308,7 +308,6 @@ int playerMenu(int menuX, int menuY) {
break; break;
case 7: // exit case 7: // exit
return 1; return 1;
break;
} }
} }

View file

@ -508,7 +508,6 @@ bool GobEngine::initGameParts() {
default: default:
deinitGameParts(); deinitGameParts();
return false; return false;
break;
} }
_inter->setupOpcodes(); _inter->setupOpcodes();

View file

@ -604,11 +604,9 @@ uint8 KyraEngine_v1::getVolume(kVolumeEntry vol) {
switch (vol) { switch (vol) {
case kVolumeMusic: case kVolumeMusic:
return convertVolumeFromMixer(ConfMan.getInt("music_volume")); return convertVolumeFromMixer(ConfMan.getInt("music_volume"));
break;
case kVolumeSfx: case kVolumeSfx:
return convertVolumeFromMixer(ConfMan.getInt("sfx_volume")); return convertVolumeFromMixer(ConfMan.getInt("sfx_volume"));
break;
case kVolumeSpeech: case kVolumeSpeech:
if (speechEnabled()) if (speechEnabled())

View file

@ -773,7 +773,6 @@ int LoLEngine::getMonsterCurFrame(MonsterInPlay *m, uint16 dirFlags) {
break; break;
case 2: case 2:
return (m->fightCurTick >= 13) ? 13 : m->fightCurTick; return (m->fightCurTick >= 13) ? 13 : m->fightCurTick;
break;
case 3: case 3:
switch (m->mode) { switch (m->mode) {
case 5: case 5:

View file

@ -573,7 +573,7 @@ void DragonMainMenuView::handleAction(MadsGameAction action) {
case EXIT: case EXIT:
vm->_events->quitFlag = true; vm->_events->quitFlag = true;
return; return;
break;
default: default:
break; break;
} }

View file

@ -771,7 +771,6 @@ void Anim::decodeFrame(AnimationData *anim, size_t frameOffset, byte *buf, size_
break; break;
case SAGA_FRAME_END: // End of frame marker case SAGA_FRAME_END: // End of frame marker
return; return;
break;
default: default:
break; break;
} }

View file

@ -238,7 +238,6 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
if (g_sci->getResMan()->isAmiga32color()) if (g_sci->getResMan()->isAmiga32color())
return make_reg(0, 32); return make_reg(0, 32);
return make_reg(0, !g_sci->getResMan()->isVGA() ? 16 : 256); return make_reg(0, !g_sci->getResMan()->isVGA() ? 16 : 256);
break;
case K_GRAPH_DRAW_LINE: case K_GRAPH_DRAW_LINE:
priority = (argc > 6) ? argv[6].toSint16() : -1; priority = (argc > 6) ? argv[6].toSint16() : -1;

View file

@ -547,7 +547,6 @@ static reg_t pointer_add(EngineState *s, reg_t base, int offset) {
case SEG_TYPE_DYNMEM: case SEG_TYPE_DYNMEM:
base.offset += offset; base.offset += offset;
return base; return base;
break;
default: default:
// FIXME: Changed this to warning, because iceman does this during dancing with girl. // FIXME: Changed this to warning, because iceman does this during dancing with girl.

View file

@ -368,7 +368,6 @@ byte *ScummEngine::get2byteCharPtr(int idx) {
} }
return _2byteFontPtr + base; return _2byteFontPtr + base;
break;
} }
case Common::ZH_CNA: case Common::ZH_CNA:
idx = ((idx % 256) - 0xa1)* 94 + ((idx / 256) - 0xa1); idx = ((idx % 256) - 0xa1)* 94 + ((idx / 256) - 0xa1);