aboutsummaryrefslogtreecommitdiff
path: root/games/edge
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2016-04-18 05:28:35 +0000
committerKurt Jaeger <pi@FreeBSD.org>2016-04-18 05:28:35 +0000
commit61d69ef66b69bd41c82f3a2acb027017cecb909f (patch)
treeeb45cc0623ce567e35d7bf14d00d92102fc188ad /games/edge
parentfc089a0213b781ea024a7350b9ce7d265e93b834 (diff)
downloadports-61d69ef66b69bd41c82f3a2acb027017cecb909f.tar.gz
ports-61d69ef66b69bd41c82f3a2acb027017cecb909f.zip
games/edge: Fix build with libc++ 3.8.0
- Replace abs() on unsigned arguments in games/edge PR: 208757 Submitted by: dim
Notes
Notes: svn path=/head/; revision=413549
Diffstat (limited to 'games/edge')
-rw-r--r--games/edge/files/patch-epi__image_hq2x.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/games/edge/files/patch-epi__image_hq2x.cc b/games/edge/files/patch-epi__image_hq2x.cc
new file mode 100644
index 000000000000..3c1fda02dda5
--- /dev/null
+++ b/games/edge/files/patch-epi__image_hq2x.cc
@@ -0,0 +1,26 @@
+--- epi/image_hq2x.cc.orig 2009-10-18 12:33:23.000000000 +0200
++++ epi/image_hq2x.cc 2016-04-12 22:06:00.628879000 +0200
+@@ -169,15 +169,20 @@ void Interp10(u8_t * dest, u32_t c1, u32
+ #define PIXEL11_90 Interp9(dest+BpL+4, c[5], c[6], c[8]);
+ #define PIXEL11_100 Interp10(dest+BpL+4, c[5], c[6], c[8]);
+
++static inline u32_t UDiff(u32_t u1, u32_t u2)
++{
++ return (u1 >= u2) ? u1 - u2 : u2 - u1;
++}
++
+ inline bool Diff(const u8_t p1, const u8_t p2)
+ {
+ u32_t YUV1 = PixelYUV[p1];
+ u32_t YUV2 = PixelYUV[p2];
+
+ return (YUV1 & Amask) != (YUV2 & Amask) ||
+- (u32_t)abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ||
+- (u32_t)abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ||
+- (u32_t)abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV;
++ UDiff((YUV1 & Ymask), (YUV2 & Ymask)) > trY ||
++ UDiff((YUV1 & Umask), (YUV2 & Umask)) > trU ||
++ UDiff((YUV1 & Vmask), (YUV2 & Vmask)) > trV;
+ }
+
+ void Setup(const u8_t *palette, int trans_pixel)