]> code.ossystems Code Review - openembedded-core.git/commitdiff
puzzles: Fix warnings seen with clang 6.0
authorKhem Raj <raj.khem@gmail.com>
Thu, 8 Feb 2018 16:55:14 +0000 (08:55 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Feb 2018 17:56:34 +0000 (17:56 +0000)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-sato/puzzles/files/0001-signpost-Add-paranthesis-to-remove-doubt-about-prece.patch [new file with mode: 0644]
meta/recipes-sato/puzzles/puzzles_git.bb

diff --git a/meta/recipes-sato/puzzles/files/0001-signpost-Add-paranthesis-to-remove-doubt-about-prece.patch b/meta/recipes-sato/puzzles/files/0001-signpost-Add-paranthesis-to-remove-doubt-about-prece.patch
new file mode 100644 (file)
index 0000000..19abdd5
--- /dev/null
@@ -0,0 +1,47 @@
+From 7b2949c48a178861f6568a18c8f45e841e36f89e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 7 Feb 2018 23:57:12 -0800
+Subject: [PATCH] signpost: Add paranthesis to remove doubt about precendence
+
+Clang complains e.g.
+
+error: logical not is only applied to the left hand side of
+      this bitwise operator [-Werror,-Wlogical-not-parentheses]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ signpost.c | 2 +-
+ tracks.c   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/signpost.c b/signpost.c
+index aa2e13a..2e2dff2 100644
+--- a/signpost.c
++++ b/signpost.c
+@@ -284,7 +284,7 @@ static int check_nums(game_state *orig, game_state *copy, int only_immutable)
+     int i, ret = 1;
+     assert(copy->n == orig->n);
+     for (i = 0; i < copy->n; i++) {
+-        if (only_immutable && !copy->flags[i] & FLAG_IMMUTABLE) continue;
++        if (only_immutable && !(copy->flags[i] & FLAG_IMMUTABLE)) continue;
+         assert(copy->nums[i] >= 0);
+         assert(copy->nums[i] <= copy->n);
+         if (copy->nums[i] != orig->nums[i]) {
+diff --git a/tracks.c b/tracks.c
+index 5b27350..ca44ce1 100644
+--- a/tracks.c
++++ b/tracks.c
+@@ -1072,7 +1072,7 @@ static int solve_check_single_sub(game_state *state, int si, int id, int n,
+         x = i%w;
+         y = i/w;
+         if (abs(ox-x) > 1 || abs(oy-y) > 1) {
+-            if (!state->sflags[i] & S_TRACK)
++            if (!(state->sflags[i] & S_TRACK))
+                 did += solve_set_sflag(state, x, y, S_NOTRACK, what);
+         }
+     }
+-- 
+2.16.1
+
index 6574e1dba4b331c5710f45d004c3cab8da6185a0..4fe6298cbab0b237363dae1a23abf9323b32e8b4 100644 (file)
@@ -14,6 +14,7 @@ SRC_URI = "git://git.tartarus.org/simon/puzzles.git \
            file://0001-Use-labs-instead-of-abs.patch \
            file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
            file://0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch \
+           file://0001-signpost-Add-paranthesis-to-remove-doubt-about-prece.patch \
            "
 UPSTREAM_CHECK_COMMITS = "1"
 SRCREV = "8dfe5cec31e784e4ece2955ecc8cc35ee7e8fbb3"