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/Items/CMakeLists.txt | 2 +- src/Items/ItemBow.h | 11 +++++++++-- src/Items/ItemBucket.h | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src/Items') diff --git a/src/Items/CMakeLists.txt b/src/Items/CMakeLists.txt index 46ff3b4a0..71f2d9ceb 100644 --- a/src/Items/CMakeLists.txt +++ b/src/Items/CMakeLists.txt @@ -57,7 +57,7 @@ SET (HDRS ) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set_source_files_properties(ItemHandler.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=conversion -Wno-error=switch-enum") + set_source_files_properties(ItemHandler.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=conversion -Wno-error=old-style-cast -Wno-error=switch-enum") endif() if(NOT MSVC) diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index 5164ddf59..8bbaa3d8c 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -53,7 +53,7 @@ public: ASSERT(a_Player != nullptr); int BowCharge = a_Player->FinishChargingBow(); - double Force = (double)BowCharge / 20.0; + double Force = static_cast(BowCharge) / 20.0; Force = (Force * Force + 2.0 * Force) / 3.0; // This formula is used by the 1.6.2 client if (Force < 0.1) { @@ -80,7 +80,14 @@ public: Arrow = nullptr; return; } - a_Player->GetWorld()->BroadcastSoundEffect("random.bow", a_Player->GetPosX(), a_Player->GetPosY(), a_Player->GetPosZ(), 0.5, (float)Force); + a_Player->GetWorld()->BroadcastSoundEffect( + "random.bow", + a_Player->GetPosX(), + a_Player->GetPosY(), + a_Player->GetPosZ(), + 0.5, + static_cast(Force) + ); if (!a_Player->IsGameModeCreative()) { if (a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchInfinity) == 0) diff --git a/src/Items/ItemBucket.h b/src/Items/ItemBucket.h index 015720415..1dbdfd7bc 100644 --- a/src/Items/ItemBucket.h +++ b/src/Items/ItemBucket.h @@ -236,7 +236,7 @@ public: m_EntryFace = static_cast(a_CBEntryFace); if (!cFluidSimulator::CanWashAway(a_CBBlockType) && !IsBlockLiquid(a_CBBlockType)) { - AddFaceDirection(a_CBBlockX, a_CBBlockY, a_CBBlockZ, (eBlockFace)a_CBEntryFace); // Was an unwashawayable block, can't overwrite it! + AddFaceDirection(a_CBBlockX, a_CBBlockY, a_CBBlockZ, static_cast(a_CBEntryFace)); // Was an unwashawayable block, can't overwrite it! } m_Pos.Set(a_CBBlockX, a_CBBlockY, a_CBBlockZ); // (Block could be washed away, replace it) return true; // Abort tracing -- cgit v1.2.3