From 307e7aaff5c454b703db4d536c40d5715d96032b Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Thu, 14 Sep 2017 09:48:57 +0100 Subject: Fix switch warnings (#4013) * Fix switch warnings * Fix a variety of -Wswitch and -Wswitch-enum warnings * Remove unneeded -Wno-error flags * Reorganise some eMonsterType switches * Alpha sort eMonsterType cases in WriteMobMetadata and in cNBTChunkSerializer::AddMonsterEntity * List all mob types in protocol 1.12 and NBTChunkSerializer * cStructGenTrees::GetNumTrees: remove switch default * cWSSAnvil::LoadOldMinecartFromNBT: Log unhandled minecart type --- src/UI/CMakeLists.txt | 5 ----- src/UI/SlotArea.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/UI') diff --git a/src/UI/CMakeLists.txt b/src/UI/CMakeLists.txt index d71e08ade..54236a929 100644 --- a/src/UI/CMakeLists.txt +++ b/src/UI/CMakeLists.txt @@ -34,11 +34,6 @@ SET (HDRS MinecartWithChestWindow.h WindowOwner.h) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set_source_files_properties(SlotArea.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum ") - set_source_files_properties(Window.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum ") -endif() - if(NOT MSVC) add_library(UI ${SRCS} ${HDRS}) endif() diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index 94fd958d5..865e9cb44 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -1235,8 +1235,11 @@ bool cSlotAreaBeacon::IsPlaceableItem(short a_ItemType) { return true; } + default: + { + return false; + } } - return false; } @@ -2406,8 +2409,8 @@ bool cSlotAreaArmor::CanPlaceArmorInSlot(int a_SlotNum, const cItem & a_Item) case 1: return ItemCategory::IsChestPlate(a_Item.m_ItemType); case 2: return ItemCategory::IsLeggings(a_Item.m_ItemType); case 3: return ItemCategory::IsBoots(a_Item.m_ItemType); + default: return false; } - return false; } -- cgit v1.2.3