summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch72
-rw-r--r--meta/recipes-sato/puzzles/puzzles_git.bb1
2 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch b/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
new file mode 100644
index 0000000000..5351f8eb4e
--- /dev/null
+++ b/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
@@ -0,0 +1,72 @@
1From 6d8326275802a2e6e61d3e99460af6891ae8362f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 13 Jan 2016 23:10:19 -0800
4Subject: [puzzles][PATCH] palisade: Fix warnings with clang on arm
5
6ARM treats 'char' as unsigned char when 'char' is not qualified with
7'signed' or 'unsigned' explicitly.
8
9This results in warnings e.g.
10
11palisade.c:531:22: error: comparison of constant -1 with expression of
12type 'clue' (aka 'char') is always false
13[-Werror,-Wtautological-constant-out-of-range-compare]
14 if (clues[i] == EMPTY) continue;
15
16Therefore, typcast the contant to char in such places to be explicit
17
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20Upstream-Status: Submitted
21
22 palisade.c | 10 +++++-----
23 1 file changed, 5 insertions(+), 5 deletions(-)
24
25diff --git a/palisade.c b/palisade.c
26index 984e616..2b9c25c 100644
27--- a/palisade.c
28+++ b/palisade.c
29@@ -295,11 +295,11 @@ static void solver_connected_clues_versus_region_size(solver_ctx *ctx)
30 * If p = q = 3 then the region has size exactly 2. */
31
32 for (i = 0; i < wh; ++i) {
33- if (ctx->clues[i] == EMPTY) continue;
34+ if (ctx->clues[i] == (char)EMPTY) continue;
35 for (dir = 0; dir < 4; ++dir) {
36 int j = i + dx[dir] + w*dy[dir];
37 if (disconnected(ctx, i, j, dir)) continue;
38- if (ctx->clues[j] == EMPTY) continue;
39+ if (ctx->clues[j] == (char)EMPTY) continue;
40 if ((8 - ctx->clues[i] - ctx->clues[j] > ctx->params->k) ||
41 (ctx->clues[i] == 3 && ctx->clues[j] == 3 &&
42 ctx->params->k != 2))
43@@ -317,7 +317,7 @@ static int solver_number_exhausted(solver_ctx *ctx)
44 int changed = FALSE;
45
46 for (i = 0; i < wh; ++i) {
47- if (ctx->clues[i] == EMPTY) continue;
48+ if (ctx->clues[i] == (char)EMPTY) continue;
49
50 if (bitcount[(ctx->borders[i] & BORDER_MASK)] == ctx->clues[i]) {
51 for (dir = 0; dir < 4; ++dir) {
52@@ -528,7 +528,7 @@ static int is_solved(const game_params *params, clue *clues,
53 for (i = 0; i < wh; ++i) {
54 if (dsf[i] == UNVISITED) dfs_dsf(i, params->w, border, dsf, TRUE);
55 if (dsf_size(dsf, i) != k) goto error;
56- if (clues[i] == EMPTY) continue;
57+ if (clues[i] == (char)EMPTY) continue;
58 if (clues[i] != bitcount[border[i] & BORDER_MASK]) goto error;
59 }
60
61@@ -674,7 +674,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
62 p = numbers;
63 r = 0;
64 for (i = 0; i < wh; ++i) {
65- if (numbers[i] != EMPTY) {
66+ if (numbers[i] != (char)EMPTY) {
67 while (r) {
68 while (r > 26) {
69 *p++ = 'z';
70--
712.7.0
72
diff --git a/meta/recipes-sato/puzzles/puzzles_git.bb b/meta/recipes-sato/puzzles/puzzles_git.bb
index 9c8170cbdb..dab5440d8f 100644
--- a/meta/recipes-sato/puzzles/puzzles_git.bb
+++ b/meta/recipes-sato/puzzles/puzzles_git.bb
@@ -13,6 +13,7 @@ SRC_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 file://0001-Use-labs-instead-of-abs.patch \
15 file://0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch \ 15 file://0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch \
16 file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
16" 17"
17SRCREV = "346584bf6e38232be8773c24fd7dedcbd7b3d9ed" 18SRCREV = "346584bf6e38232be8773c24fd7dedcbd7b3d9ed"
18PE = "1" 19PE = "1"