1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 12:35:46 +00:00

Disallow switch fallthrough

This commit is contained in:
Evil Eye 2021-10-03 21:58:10 +02:00
parent 686268b2f9
commit d680aa26e9
3 changed files with 7 additions and 0 deletions

View File

@ -543,6 +543,10 @@ if (BUILD_OPENCS)
add_subdirectory (extern/osgQt)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=implicit-fallthrough")
endif()
# Components
add_subdirectory (components)

View File

@ -1870,6 +1870,7 @@ namespace CSMWorld
content.mWander.mDuration = static_cast<short>(value.toInt());
else
return; // return without saving
break;
case 3:
if (content.mType == ESM::AI_Wander)
content.mWander.mTimeOfDay = static_cast<unsigned char>(value.toInt());

View File

@ -453,6 +453,7 @@ void applyMagicEffect(const MWWorld::Ptr& target, const MWWorld::Ptr& caster, co
}
addBoundItem(world->getStore().get<ESM::GameSetting>().find("sMagicBoundRightGauntletID")->mValue.getString(), target);
// left gauntlet added below
[[fallthrough]];
case ESM::MagicEffect::BoundDagger:
case ESM::MagicEffect::BoundLongsword:
case ESM::MagicEffect::BoundMace:
@ -920,6 +921,7 @@ void removeMagicEffect(const MWWorld::Ptr& target, ActiveSpells::ActiveSpellPara
break;
case ESM::MagicEffect::BoundGloves:
removeBoundItem(world->getStore().get<ESM::GameSetting>().find("sMagicBoundRightGauntletID")->mValue.getString(), target);
[[fallthrough]];
case ESM::MagicEffect::BoundDagger:
case ESM::MagicEffect::BoundLongsword:
case ESM::MagicEffect::BoundMace: