diff options
Diffstat (limited to 'meta/recipes-sato/puzzles/files')
-rw-r--r-- | meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch | 46 |
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 @@ | |||
1 | From 9808dc09e08937c9bffd858d3ded428225a4312a Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 7 Sep 2015 09:02:38 +0000 | ||
4 | Subject: [PATCH] Use labs instead of abs | ||
5 | |||
6 | cluevals is array of longs so we have to use labs() instead of abs() | ||
7 | since abs() returns int | ||
8 | |||
9 | Fixes | ||
10 | |||
11 | keen.c:1458:17: error: absolute value function 'abs' given an argument | ||
12 | of type 'long' but has parameter of type 'int' which may cause | ||
13 | truncation of value | ||
14 | |||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | --- | ||
17 | Upstream-Status: Pending | ||
18 | |||
19 | keen.c | 4 ++-- | ||
20 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
21 | |||
22 | diff --git a/keen.c b/keen.c | ||
23 | index 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 | -- | ||
45 | 2.5.1 | ||
46 | |||