From 090d8305e4e3c3ee085a897b72f2b4708e183eb8 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 5 Oct 2020 13:09:42 +0100 Subject: Warnings improvements * Turn off global-constructors warning. These are needed to implement cRoot signal handler functionality * Add Clang flags based on version lookup instead of a compile test. The CMake config process is single threaded and slow enough already * Reduced GetStackValue verbosity + Clarify EnchantmentLevel, StayCount, AlwaysTicked, ViewDistance signedness + Give SettingsRepositoryInterface a move constructor to simplify main.cpp code - Remove do {} while (false) construction in redstone handler --- src/Bindings/LuaState.h | 5 ++--- src/Bindings/ManualBindings.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h index 2c45377c7..0bdecdfc7 100644 --- a/src/Bindings/LuaState.h +++ b/src/Bindings/LuaState.h @@ -665,10 +665,9 @@ public: bool GetStackValue(int a_StackPos, cUUID & a_Value); // template to catch all of the various c++ integral types without overload conflicts - template - bool GetStackValue(int a_StackPos, T & a_ReturnedVal, typename std::enable_if::value>::type * unused = nullptr) + template >> + bool GetStackValue(int a_StackPos, T & a_ReturnedVal) { - UNUSED(unused); if (!lua_isnumber(m_LuaState, a_StackPos)) // Also accepts strings representing a number: https://pgl.yoyo.org/luai/i/lua_isnumber { return false; diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index e62dab289..92f7dd92b 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -2760,7 +2760,7 @@ static int tolua_cItem_EnchantByXPLevels(lua_State * tolua_S) // Get the params: cItem * Self; - int NumXPLevels; + unsigned NumXPLevels; L.GetStackValue(1, Self); L.GetStackValue(2, NumXPLevels); -- cgit v1.2.3