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/Bindings/CMakeLists.txt | 5 +++++ src/Bindings/LuaChunkStay.cpp | 6 +++--- src/Bindings/LuaState.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt index e1ded8446..b14576ea0 100644 --- a/src/Bindings/CMakeLists.txt +++ b/src/Bindings/CMakeLists.txt @@ -146,7 +146,12 @@ set_source_files_properties(${BINDING_OUTPUTS} PROPERTIES GENERATED TRUE) set_source_files_properties(${CMAKE_SOURCE_DIR}/src/Bindings/Bindings.cpp PROPERTIES COMPILE_FLAGS -Wno-error) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set_source_files_properties(DeprecatedBindings.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast") + set_source_files_properties(LuaState.cpp COMPILE_FLAGS "-Wno-error=old-style-cast") set_source_files_properties(LuaWindow.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum") + set_source_files_properties(ManualBindings.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast") + set_source_files_properties(ManualBindings_World.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast") + set_source_files_properties(PluginLua.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast") endif() if(NOT MSVC) diff --git a/src/Bindings/LuaChunkStay.cpp b/src/Bindings/LuaChunkStay.cpp index e50ffb75b..1afd09d11 100644 --- a/src/Bindings/LuaChunkStay.cpp +++ b/src/Bindings/LuaChunkStay.cpp @@ -41,7 +41,7 @@ bool cLuaChunkStay::AddChunks(int a_ChunkCoordTableStackPos) // Add each set of coords: int NumChunks = luaL_getn(L, a_ChunkCoordTableStackPos); - m_Chunks.reserve((size_t)NumChunks); + m_Chunks.reserve(static_cast(NumChunks)); for (int idx = 1; idx <= NumChunks; idx++) { // Push the idx-th element of the array onto stack top, check that it's a table: @@ -133,7 +133,7 @@ void cLuaChunkStay::OnChunkAvailable(int a_ChunkX, int a_ChunkZ) if (m_OnChunkAvailable.IsValid()) { cPluginLua::cOperation Op(m_Plugin); - Op().Call((int)m_OnChunkAvailable, a_ChunkX, a_ChunkZ); + Op().Call(static_cast(m_OnChunkAvailable), a_ChunkX, a_ChunkZ); } } @@ -147,7 +147,7 @@ bool cLuaChunkStay::OnAllChunksAvailable(void) { // Call the callback: cPluginLua::cOperation Op(m_Plugin); - Op().Call((int)m_OnAllChunksAvailable); + Op().Call(static_cast(m_OnAllChunksAvailable)); // Remove the callback references - they won't be needed anymore m_OnChunkAvailable.UnRef(); diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h index bbd0294ef..8a3411d30 100644 --- a/src/Bindings/LuaState.h +++ b/src/Bindings/LuaState.h @@ -393,7 +393,7 @@ protected: */ bool PushFunction(const cRef & a_FnRef) { - return PushFunction((int)a_FnRef); + return PushFunction(static_cast(a_FnRef)); } /** Pushes a function that is stored in a referenced table by name -- cgit v1.2.3