summaryrefslogtreecommitdiffstats
path: root/meta/recipes-sato
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
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')
-rw-r--r--meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch46
-rw-r--r--meta/recipes-sato/puzzles/puzzles_git.bb1
2 files changed, 47 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
diff --git a/meta/recipes-sato/puzzles/puzzles_git.bb b/meta/recipes-sato/puzzles/puzzles_git.bb
index 11e922511c..95826c1b60 100644
--- a/meta/recipes-sato/puzzles/puzzles_git.bb
+++ b/meta/recipes-sato/puzzles/puzzles_git.bb
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=33bcd4bce8f3c197f2aefbdbd2d299bc"
11 11
12SRC_URI = "git://git.tartarus.org/simon/puzzles.git \ 12SRC_URI = "git://git.tartarus.org/simon/puzzles.git \
13 file://fix-compiling-failure-with-option-g-O.patch \ 13 file://fix-compiling-failure-with-option-g-O.patch \
14 file://0001-Use-labs-instead-of-abs.patch \
14" 15"
15SRCREV = "c296301a06ce49b87c954c9d15452521dfeddf1a" 16SRCREV = "c296301a06ce49b87c954c9d15452521dfeddf1a"
16PE = "1" 17PE = "1"