gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] 3.5.4: compilation warning and error


From: Gunnar Farneback
Subject: Re: [gnugo-devel] 3.5.4: compilation warning and error
Date: Sun, 08 Feb 2004 01:16:50 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

Teun wrote:
> The problem is that enum dragon_status is #defined in liberty.h and
> some prototypes in gnugo.h also require dragon_status. gnugo.h is
> #included in liberty.h so this can be fixed by moving the
> declaration of dragon_status to gnugo.h

I think it's better to move the one function in gnugo.h using the enum
to liberty.h.

> When num_moves == 0, distances[0] is not initialized and this leads
> to floating point exceptions on Tru64. Fixed by returning just
> before this if statement when num_moves ==0. This case is triggered
> early in owl.tst.

Agreed.

Revised patch below.

/Gunnar

Index: engine/gnugo.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/gnugo.h,v
retrieving revision 1.105
diff -u -r1.105 gnugo.h
--- engine/gnugo.h      24 Jan 2004 23:21:13 -0000      1.105
+++ engine/gnugo.h      8 Feb 2004 00:10:47 -0000
@@ -355,7 +355,6 @@
 
 /* Play through the aftermath. */
 float aftermath_compute_score(int color, float komi, SGFTree *tree);
-enum dragon_status aftermath_final_status(int color, int pos);
 
 /* Basic information gathering. */
 /* worm.c */
Index: engine/liberty.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v
retrieving revision 1.208
diff -u -r1.208 liberty.h
--- engine/liberty.h    24 Jan 2004 04:04:56 -0000      1.208
+++ engine/liberty.h    8 Feb 2004 00:10:47 -0000
@@ -460,6 +460,7 @@
 int aftermath_genmove(int *aftermath_move, int color,
                      int under_control[BOARDMAX],
                      int do_capture_dead_stones);
+enum dragon_status aftermath_final_status(int color, int pos);
 
 int owl_attack(int target, int *attack_point, int *certain, int *kworm);
 int owl_defend(int target, int *defense_point, int *certain, int *kworm);
Index: engine/readconnect.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/readconnect.c,v
retrieving revision 1.69
diff -u -r1.69 readconnect.c
--- engine/readconnect.c        5 Feb 2004 22:54:42 -0000       1.69
+++ engine/readconnect.c        8 Feb 2004 00:10:49 -0000
@@ -2608,6 +2608,8 @@
     sgftreeAddComment(sgf_dumptree, buf);
   }
 
+  if (num_moves == 0)
+    return num_moves;
 
   /* Filter out moves with distance at least 1.5 more than the best
    * move, or with distance higher than the cutoff specified.




reply via email to

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