summaryrefslogtreecommitdiffstats
path: root/src/Defines.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2018-02-05 00:07:12 +0100
committerGitHub <noreply@github.com>2018-02-05 00:07:12 +0100
commitd3c1c626f569e5aa58085425924cca45927b6199 (patch)
treec65dee850358467c9afebdd37fcd4f6fb95a475a /src/Defines.h
parentcChunk and cChunkData: Use vectors for block get and set functions (#4172) (diff)
downloadcuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar
cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar.gz
cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar.bz2
cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar.lz
cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar.xz
cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar.zst
cuberite-d3c1c626f569e5aa58085425924cca45927b6199.zip
Diffstat (limited to 'src/Defines.h')
-rw-r--r--src/Defines.h32
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");
}