From 48c153bf53d5606e351bd180e2fd9345034f60aa Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 2 Jun 2015 12:51:43 +0200 Subject: Fixed warnings in MSVC. It complained about undefined return values or using uninitialized variables. --- src/Defines.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/Defines.h') diff --git a/src/Defines.h b/src/Defines.h index bbc69f79c..4005c84dd 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -245,6 +245,10 @@ inline eBlockFace MirrorBlockFaceY(eBlockFace a_BlockFace) return a_BlockFace; }; } + #if !defined(__clang__) + ASSERT(!"Unknown BLOCK_FACE"); + return a_BlockFace; + #endif } @@ -267,6 +271,10 @@ inline eBlockFace RotateBlockFaceCCW(eBlockFace a_BlockFace) return a_BlockFace; } } + #if !defined(__clang__) + ASSERT(!"Unknown BLOCK_FACE"); + return a_BlockFace; + #endif } @@ -288,8 +296,16 @@ inline eBlockFace RotateBlockFaceCW(eBlockFace a_BlockFace) return a_BlockFace; }; } + #if !defined(__clang__) + ASSERT(!"Unknown BLOCK_FACE"); + return a_BlockFace; + #endif } + + + + inline eBlockFace ReverseBlockFace(eBlockFace a_BlockFace) { switch (a_BlockFace) @@ -302,9 +318,16 @@ 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 } + + + /** Returns the textual representation of the BlockFace constant. */ inline AString BlockFaceToString(eBlockFace a_BlockFace) { @@ -320,7 +343,7 @@ inline AString BlockFaceToString(eBlockFace a_BlockFace) } // clang optimisises this line away then warns that it has done so. #if !defined(__clang__) - return Printf("Unknown BLOCK_FACE: %d", a_BlockFace); + return Printf("Unknown BLOCK_FACE: %d", a_BlockFace); #endif } -- cgit v1.2.3