From dae9e5792a4f030ae9e748548a16a89790fbd311 Mon Sep 17 00:00:00 2001 From: tycho Date: Sun, 24 May 2015 12:56:56 +0100 Subject: Made -Weverything an error. --- src/UI/CMakeLists.txt | 5 +++-- src/UI/EnchantingWindow.cpp | 6 +++--- src/UI/EnderChestWindow.cpp | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) (limited to 'src/UI') diff --git a/src/UI/CMakeLists.txt b/src/UI/CMakeLists.txt index e01a09bb8..178498479 100644 --- a/src/UI/CMakeLists.txt +++ b/src/UI/CMakeLists.txt @@ -35,8 +35,9 @@ SET (HDRS WindowOwner.h) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set_source_files_properties(SlotArea.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=switch-enum -Wno-error=sign-conversion") - set_source_files_properties(Window.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=switch-enum -Wno-error=sign-conversion") + set_source_files_properties(SlotArea.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=switch-enum -Wno-error=sign-conversion -Wno-error=old-style-cast") + set_source_files_properties(Window.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=switch-enum -Wno-error=sign-conversion -Wno-error=old-style-cast") + set_source_files_properties(ChestWindow.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast") endif() if(NOT MSVC) diff --git a/src/UI/EnchantingWindow.cpp b/src/UI/EnchantingWindow.cpp index fe21ee83d..4c5bcbfd5 100644 --- a/src/UI/EnchantingWindow.cpp +++ b/src/UI/EnchantingWindow.cpp @@ -30,7 +30,7 @@ cEnchantingWindow::cEnchantingWindow(int a_BlockX, int a_BlockY, int a_BlockZ) : void cEnchantingWindow::SetProperty(short a_Property, short a_Value, cPlayer & a_Player) { - if ((a_Property < 0) || ((size_t)a_Property >= ARRAYCOUNT(m_PropertyValue))) + if ((a_Property < 0) || (static_cast(a_Property) >= ARRAYCOUNT(m_PropertyValue))) { ASSERT(!"a_Property is invalid"); return; @@ -47,7 +47,7 @@ void cEnchantingWindow::SetProperty(short a_Property, short a_Value, cPlayer & a void cEnchantingWindow::SetProperty(short a_Property, short a_Value) { - if ((a_Property < 0) || ((size_t)a_Property >= ARRAYCOUNT(m_PropertyValue))) + if ((a_Property < 0) || (static_cast(a_Property) >= ARRAYCOUNT(m_PropertyValue))) { ASSERT(!"a_Property is invalid"); return; @@ -63,7 +63,7 @@ void cEnchantingWindow::SetProperty(short a_Property, short a_Value) short cEnchantingWindow::GetPropertyValue(short a_Property) { - if ((a_Property < 0) || ((size_t)a_Property >= ARRAYCOUNT(m_PropertyValue))) + if ((a_Property < 0) || (static_cast(a_Property) >= ARRAYCOUNT(m_PropertyValue))) { ASSERT(!"a_Property is invalid"); return 0; diff --git a/src/UI/EnderChestWindow.cpp b/src/UI/EnderChestWindow.cpp index a5484468f..9a4918aa4 100644 --- a/src/UI/EnderChestWindow.cpp +++ b/src/UI/EnderChestWindow.cpp @@ -24,7 +24,12 @@ cEnderChestWindow::cEnderChestWindow(cEnderChestEntity * a_EnderChest) : m_SlotAreas.push_back(new cSlotAreaHotBar(*this)); // Play the opening sound: - m_World->BroadcastSoundEffect("random.chestopen", (double)m_BlockX, (double)m_BlockY, (double)m_BlockZ, 1, 1); + m_World->BroadcastSoundEffect( + "random.chestopen", + static_cast(m_BlockX), + static_cast(m_BlockY), + static_cast(m_BlockZ), + 1, 1); // Send out the chest-open packet: m_World->BroadcastBlockAction(m_BlockX, m_BlockY, m_BlockZ, 1, 1, E_BLOCK_ENDER_CHEST); @@ -40,7 +45,12 @@ cEnderChestWindow::~cEnderChestWindow() m_World->BroadcastBlockAction(m_BlockX, m_BlockY, m_BlockZ, 1, 0, E_BLOCK_ENDER_CHEST); // Play the closing sound - m_World->BroadcastSoundEffect("random.chestclosed", (double)m_BlockX, (double)m_BlockY, (double)m_BlockZ, 1, 1); + m_World->BroadcastSoundEffect( + "random.chestclosed", + static_cast(m_BlockX), + static_cast(m_BlockY), + static_cast(m_BlockZ), + 1, 1); } -- cgit v1.2.3