shithub: puzzles

Download patch

ref: b95812963a8d187526145f5e1a9693f10eee2b65
parent: 8dfe5cec31e784e4ece2955ecc8cc35ee7e8fbb3
author: Khem Raj <raj.khem@gmail.com>
date: Mon Dec 5 20:22:00 EST 2016

Clarify conditions to avoid compiler errors

Fix errors pointed out by clang

error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses]
|         if (only_immutable && !copy->flags[i] & FLAG_IMMUTABLE) continue;
|                               ^

Signed-off-by: Khem Raj <raj.khem@gmail.com>

--- a/signpost.c
+++ b/signpost.c
@@ -284,7 +284,7 @@
     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]) {
--- a/tracks.c
+++ b/tracks.c
@@ -1072,7 +1072,7 @@
         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);
         }
     }