diff options
Diffstat (limited to 'games/assaultcube/patches/patch-source_src_tools.h')
-rw-r--r-- | games/assaultcube/patches/patch-source_src_tools.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/games/assaultcube/patches/patch-source_src_tools.h b/games/assaultcube/patches/patch-source_src_tools.h new file mode 100644 index 00000000000..1469709bc8f --- /dev/null +++ b/games/assaultcube/patches/patch-source_src_tools.h @@ -0,0 +1,23 @@ +$NetBSD: patch-source_src_tools.h,v 1.1 2019/07/05 08:01:31 nia Exp $ + +[PATCH] fix some errors and warnings for GCC 6 + +- do not use std::abs() because math.h includes one, that converts ints + to double. Use own iabs(), which directly uses labs() instead. +- don't use the word "gamma" as name for variables +- don't use a homebrew round() function + +https://github.com/assaultcube/AC/commit/752950989b4e286459ca9aee3d61a868d7b20fa4 + +--- source/src/tools.h.orig 2013-10-22 18:57:19.000000000 +0000 ++++ source/src/tools.h +@@ -54,8 +54,7 @@ static inline T min(T a, T b) + { + return a < b ? a : b; + } +- +-static inline float round(float x) { return floor(x + 0.5f); } ++inline int iabs(int n) { return labs(n); } + + #define clamp(a,b,c) (max(b, min(a, c))) + #define rnd(x) ((int)(randomMT()&0xFFFFFF)%(x)) |