summaryrefslogtreecommitdiffstats
path: root/meta/recipes-sato/puzzles/files
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-09-07 09:06:10 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-12 22:48:40 +0100
commit60a57c7f146cfa3456eb0f2c79dafcea548e2493 (patch)
treecb6b1d6f1afb86bac21af266813ed4d4f80e4197 /meta/recipes-sato/puzzles/files
parentdecbbac612d45f92e5675a9fecfd60a236032d51 (diff)
downloadpoky-60a57c7f146cfa3456eb0f2c79dafcea548e2493.tar.gz
puzzles: Fix build with clang
Clang uncovered an error where abs() is used on long types, we shoud be using labs() (From OE-Core rev: cb92ac5389ed3cecf13158a0150e211b5392aba7) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-sato/puzzles/files')
-rw-r--r--meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch b/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch
new file mode 100644
index 0000000000..f43d1df6cc
--- /dev/null
+++ b/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch
@@ -0,0 +1,46 @@
1From 9808dc09e08937c9bffd858d3ded428225a4312a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 7 Sep 2015 09:02:38 +0000
4Subject: [PATCH] Use labs instead of abs
5
6cluevals is array of longs so we have to use labs() instead of abs()
7since abs() returns int
8
9Fixes
10
11keen.c:1458:17: error: absolute value function 'abs' given an argument
12of type 'long' but has parameter of type 'int' which may cause
13truncation of value
14
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17Upstream-Status: Pending
18
19 keen.c | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
21
22diff --git a/keen.c b/keen.c
23index a6a7238..1631992 100644
24--- a/keen.c
25+++ b/keen.c
26@@ -1043,7 +1043,7 @@ done
27 cluevals[j] *= grid[i];
28 break;
29 case C_SUB:
30- cluevals[j] = abs(cluevals[j] - grid[i]);
31+ cluevals[j] = labs(cluevals[j] - grid[i]);
32 break;
33 case C_DIV:
34 {
35@@ -1455,7 +1455,7 @@ static int check_errors(const game_state *state, long *errors)
36 cluevals[j] *= state->grid[i];
37 break;
38 case C_SUB:
39- cluevals[j] = abs(cluevals[j] - state->grid[i]);
40+ cluevals[j] = labs(cluevals[j] - state->grid[i]);
41 break;
42 case C_DIV:
43 {
44--
452.5.1
46