blob: f43d1df6cc8ed66d60d289fb554c3916c81ae7f8 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From 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