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/Defines.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/Defines.h') diff --git a/src/Defines.h b/src/Defines.h index 2f46e079c..fd0d595ae 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -489,7 +489,8 @@ inline void VectorToEuler(double a_X, double a_Y, double a_Z, double & a_Pan, do -template inline T Diff(T a_Val1, T a_Val2) +template >> +inline T Diff(T a_Val1, T a_Val2) { return std::abs(a_Val1 - a_Val2); } @@ -498,6 +499,16 @@ template inline T Diff(T a_Val1, T a_Val2) +template >> +inline auto Diff(T a_Val1, T a_Val2) +{ + return static_cast>(std::abs(a_Val1 - a_Val2)); +} + + + + + // tolua_begin /** Normalizes an angle in degrees to the [-180, +180) range: */ -- cgit v1.2.3