diff options
Diffstat (limited to 'src/Defines.h')
-rw-r--r-- | src/Defines.h | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/src/Defines.h b/src/Defines.h index 7a7f4c598..758c416e8 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -277,8 +277,7 @@ inline const char * ClickActionToString(int a_ClickAction) case caUnknown: return "caUnknown"; } - ASSERT(!"Unknown click action"); - return "caUnknown"; + UNREACHABLE("Unknown click action"); } @@ -299,12 +298,9 @@ inline eBlockFace MirrorBlockFaceY(eBlockFace a_BlockFace) case BLOCK_FACE_YP: { return a_BlockFace; - }; + } } - #if !defined(__clang__) - ASSERT(!"Unknown BLOCK_FACE"); - return a_BlockFace; - #endif + UNREACHABLE("Unsupported block face"); } @@ -327,10 +323,7 @@ inline eBlockFace RotateBlockFaceCCW(eBlockFace a_BlockFace) return a_BlockFace; } } - #if !defined(__clang__) - ASSERT(!"Unknown BLOCK_FACE"); - return a_BlockFace; - #endif + UNREACHABLE("Unsupported block face"); } @@ -350,12 +343,9 @@ inline eBlockFace RotateBlockFaceCW(eBlockFace a_BlockFace) case BLOCK_FACE_YP: { return a_BlockFace; - }; + } } - #if !defined(__clang__) - ASSERT(!"Unknown BLOCK_FACE"); - return a_BlockFace; - #endif + UNREACHABLE("Unsupported block face"); } @@ -374,10 +364,7 @@ inline eBlockFace ReverseBlockFace(eBlockFace a_BlockFace) case BLOCK_FACE_ZM: return BLOCK_FACE_ZP; case BLOCK_FACE_NONE: return a_BlockFace; } - #if !defined(__clang__) - ASSERT(!"Unknown BLOCK_FACE"); - return a_BlockFace; - #endif + UNREACHABLE("Unsupported block face"); } @@ -397,10 +384,7 @@ inline AString BlockFaceToString(eBlockFace a_BlockFace) case BLOCK_FACE_ZP: return "BLOCK_FACE_ZP"; case BLOCK_FACE_NONE: return "BLOCK_FACE_NONE"; } - // clang optimisises this line away then warns that it has done so. - #if !defined(__clang__) - return Printf("Unknown BLOCK_FACE: %d", a_BlockFace); - #endif + UNREACHABLE("Unsupported block face"); } |