gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] 2 valgrind warnings


From: Arend Bayer
Subject: [gnugo-devel] 2 valgrind warnings
Date: Wed, 23 Mar 2005 00:18:40 +0100 (CET)


This fixes two valgrind warning, the first one harmless, but the 2nd
problematic.

Arend

Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.229
diff -u -p -r1.229 owl.c
--- engine/owl.c        24 Feb 2005 18:04:11 -0000      1.229
+++ engine/owl.c        22 Mar 2005 23:14:32 -0000
@@ -4766,7 +4766,7 @@ owl_test_cuts(char goal[BOARDMAX], int c
     for (pos = BOARDMIN; pos < BOARDMAX; pos++) {
       int closest_dist = HUGE_CONNECTION_DISTANCE;
       int closest_component = -1;
-      if (!goal[pos] || board[pos] != color)
+      if (board[pos] != color || !goal[pos])
        continue;
       if (pos != find_origin(pos))
        continue;
@@ -6099,7 +6099,8 @@ estimate_lunch_half_eye_bonus(int lunch,
     int d;
     for (d = 4; d < 8; d++) {
       int pos = stone + delta[d];
-      if (is_halfeye(half_eye, pos) || is_false_eye(half_eye, pos))
+      if (ON_BOARD(pos)
+         && (is_halfeye(half_eye, pos) || is_false_eye(half_eye, pos)))
        half_eyes++;
     }
   }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]