diff options
Diffstat (limited to 'src/Bindings')
-rw-r--r-- | src/Bindings/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/Bindings/LuaChunkStay.cpp | 6 | ||||
-rw-r--r-- | src/Bindings/LuaState.h | 2 |
3 files changed, 9 insertions, 4 deletions
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<size_t>(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<int>(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<int>(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<int>(a_FnRef)); } /** Pushes a function that is stored in a referenced table by name |