gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] 3.1.32: -Wshadow fixes in reading.c


From: bump
Subject: Re: [gnugo-devel] 3.1.32: -Wshadow fixes in reading.c
Date: Mon, 15 Apr 2002 16:48:57 -0700

Teun wrote:

> This patch fixes shadowing warnings in reading.c.
> The {ADD,REMOVE}_CANDIDATE_MOVE macros used k and l
> that are commonly used in the invoking functions as well.
> 
> These are not errors of cause, but I think readability
> of the code improves when a variable name has a unique
> meaning in a function.

This patch causes regression failures in reading.tst. The
patch fragment that is at fault is the one appended at the
end of this message. The variable liberties occurs later
in the loop beginning at line 1391 of reading.c and it needs
to be unshadowed there also.

After this patch, we get:

./regress.sh . reading.tst
27 unexpected FAIL: Correct '1 T15', got '0'
28 unexpected FAIL: Correct '1 T15', got '0'
92 unexpected FAIL: Correct '1 T15', got '0'
160 unexpected FAIL: Correct '0', got '1 D2'

Dan

Index: reading.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/reading.c,v
retrieving revision 1.57
diff -u -r1.57 reading.c
--- reading.c   4 Apr 2002 20:36:26 -0000       1.57
+++ reading.c   14 Apr 2002 21:09:33 -0000
@@ -1389,12 +1389,12 @@
    * super_string.
    */
   if (level >= 10 && stackp <= superstring_depth) {
-    int liberties;
-    int libs[MAX_LIBERTIES + 4];
+    int liberties_ss;
+    int libs_ss[MAX_LIBERTIES + 4];
 
-    find_superstring_liberties(str, &liberties, libs, 3);
-    for (k = 0; k < liberties; k++) {
-      int apos = libs[k];
+    find_superstring_liberties(str, &liberties_ss, libs_ss, 3);
+    for (k = 0; k < liberties_ss; k++) {
+      int apos = libs_ss[k];
       
       /* Skip if already tried */
       for (s = 0; s < num_moves; s++)




reply via email to

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