WAGE: Fix Missing Default Switch Cases

These are flagged by GCC if -Wswitch-default is enabled.
This commit is contained in:
D G Turner 2019-10-23 03:31:46 +01:00
parent 56191eded6
commit fe3eae346e
3 changed files with 14 additions and 5 deletions

View File

@ -349,10 +349,11 @@ void WageEngine::performMagic(Chr *attacker, Chr *victim, Obj *magicalObject) {
case Obj::HEALS_SPIRITUAL_DAMAGE: case Obj::HEALS_SPIRITUAL_DAMAGE:
case Obj::HEALS_PHYSICAL_AND_SPIRITUAL_DAMAGE: case Obj::HEALS_PHYSICAL_AND_SPIRITUAL_DAMAGE:
performHealingMagic(attacker, magicalObject); performHealingMagic(attacker, magicalObject);
return; break;
default:
performAttack(attacker, victim, magicalObject);
break;
} }
performAttack(attacker, victim, magicalObject);
} }
void WageEngine::performHealingMagic(Chr *chr, Obj *magicalObject) { void WageEngine::performHealingMagic(Chr *chr, Obj *magicalObject) {
@ -873,6 +874,8 @@ bool WageEngine::handleAttack(Obj *weapon) {
case Obj::HEALS_SPIRITUAL_DAMAGE: case Obj::HEALS_SPIRITUAL_DAMAGE:
performMagic(player, enemy, weapon); performMagic(player, enemy, weapon);
return true; return true;
default:
break;
} }
} }
if (enemy != NULL) if (enemy != NULL)

View File

@ -621,8 +621,10 @@ void Script::skipBlock() {
case 0x8C: // SOUND case 0x8C: // SOUND
case 0x8E: // LET case 0x8E: // LET
case 0x95: // MENU case 0x95: // MENU
while (_data->readByte() != 0xFD) while (_data->readByte() != 0xFD);
; break;
default:
break;
} }
} }
} }
@ -801,6 +803,8 @@ bool Script::compare(Operand *o1, Operand *o2, int comparator) {
_world->move(o1->_value.chr, o2->_value.scene); _world->move(o1->_value.chr, o2->_value.scene);
_handled = true; // TODO: Is this correct? _handled = true; // TODO: Is this correct?
break; break;
default:
break;
} }
return false; return false;

View File

@ -84,6 +84,8 @@ const char *getIndefiniteArticle(const Common::String &word) {
case 'o': case 'O': case 'o': case 'O':
case 'u': case 'U': case 'u': case 'U':
return "an "; return "an ";
default:
break;
} }
return "a "; return "a ";
} }