From d3c1c626f569e5aa58085425924cca45927b6199 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Sun, 4 Feb 2018 23:07:12 +0000 Subject: Deal with covered switches consistently (#4161) * Fixes a number of ": not all control paths return a value" warnings on MSVC. * Introduces the UNREACHABLE global macro and uses it instead of conditionally compiled switch defaults. * Move cNBTParseErrorCategory from FastNBT.h into FastNBT.cpp to prevent bad calls to message() --- src/Entities/Boat.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/Entities/Boat.cpp') diff --git a/src/Entities/Boat.cpp b/src/Entities/Boat.cpp index 4021f9ce8..20947dc44 100644 --- a/src/Entities/Boat.cpp +++ b/src/Entities/Boat.cpp @@ -207,10 +207,7 @@ AString cBoat::MaterialToString(eMaterial a_Material) case bmAcacia: return "acacia"; case bmDarkOak: return "dark_oak"; } - ASSERT(!"Unhandled boat material"); - #ifndef __clang__ - return "oak"; - #endif + UNREACHABLE("Unsupported boat material"); } @@ -264,9 +261,7 @@ cItem cBoat::MaterialToItem(eMaterial a_Material) case bmAcacia: return cItem(E_ITEM_ACACIA_BOAT); case bmDarkOak: return cItem(E_ITEM_DARK_OAK_BOAT); } - #ifndef __clang__ - return cItem(E_ITEM_BOAT); - #endif + UNREACHABLE("Unsupported boat material"); } -- cgit v1.2.3