diff options
Diffstat (limited to 'src/Blocks')
-rw-r--r-- | src/Blocks/BlockBed.h | 2 | ||||
-rw-r--r-- | src/Blocks/BlockDoor.h | 6 | ||||
-rw-r--r-- | src/Blocks/BlockSlab.h | 4 | ||||
-rw-r--r-- | src/Blocks/CMakeLists.txt | 4 |
4 files changed, 10 insertions, 6 deletions
diff --git a/src/Blocks/BlockBed.h b/src/Blocks/BlockBed.h index 46f361686..57ffebfca 100644 --- a/src/Blocks/BlockBed.h +++ b/src/Blocks/BlockBed.h @@ -53,7 +53,7 @@ public: a_Rotation = (a_Rotation / 360) * 4; - return ((char)a_Rotation + 2) % 4; + return (static_cast<NIBBLETYPE>(a_Rotation + 2)) % 4; } static Vector3i MetaDataToDirection(NIBBLETYPE a_MetaData) diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 445383e7c..9332e6728 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -245,10 +245,10 @@ public: if (a_BlockX > 0) { NIBBLETYPE DownMeta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY - 1, a_BlockZ); - return (NIBBLETYPE) ((DownMeta & 0x07) | 0x08 | (Meta << 4)); + return static_cast<NIBBLETYPE>((DownMeta & 0x07) | 0x08 | (Meta << 4)); } // This is the top part of the door at the bottommost layer of the world, there's no bottom: - return (NIBBLETYPE) (0x08 | (Meta << 4)); + return static_cast<NIBBLETYPE>(0x08 | (Meta << 4)); } else { @@ -256,7 +256,7 @@ public: if (a_BlockY < cChunkDef::Height - 1) { NIBBLETYPE UpMeta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY + 1, a_BlockZ); - return (NIBBLETYPE) (Meta | (UpMeta << 4)); + return static_cast<NIBBLETYPE>(Meta | (UpMeta << 4)); } // This is the bottom part of the door at the topmost layer of the world, there's no top: return Meta; diff --git a/src/Blocks/BlockSlab.h b/src/Blocks/BlockSlab.h index d762154df..9b3fad72e 100644 --- a/src/Blocks/BlockSlab.h +++ b/src/Blocks/BlockSlab.h @@ -41,7 +41,7 @@ public: ) override { a_BlockType = m_BlockType; - NIBBLETYPE Meta = (NIBBLETYPE) a_Player->GetEquippedItem().m_ItemDamage; + NIBBLETYPE Meta = static_cast<NIBBLETYPE>(a_Player->GetEquippedItem().m_ItemDamage); // Set the correct metadata based on player equipped item (i.e. a_BlockMeta not initialised yet) switch (a_BlockFace) @@ -104,7 +104,7 @@ public: virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override { - if ((a_BlockFace == BLOCK_FACE_NONE) || (a_Player->GetEquippedItem().m_ItemType != (short)m_BlockType)) + if ((a_BlockFace == BLOCK_FACE_NONE) || (a_Player->GetEquippedItem().m_ItemType != static_cast<short>(m_BlockType))) { return; } diff --git a/src/Blocks/CMakeLists.txt b/src/Blocks/CMakeLists.txt index d7ea6258f..d8affd9cf 100644 --- a/src/Blocks/CMakeLists.txt +++ b/src/Blocks/CMakeLists.txt @@ -95,6 +95,10 @@ SET (HDRS MetaRotator.h WorldInterface.h) +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set_source_files_properties(BlockHandler.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast") + set_source_files_properties(BlockPiston.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast") +endif() if(NOT MSVC) add_library(Blocks ${SRCS} ${HDRS}) |