gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] sgf traces broken


From: Gunnar Farneback
Subject: [gnugo-devel] sgf traces broken
Date: Thu, 07 Aug 2003 17:26:24 +0200
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)

Current CVS crashes in a segmentation violation when sgf traces are
used. In a maze of twisty typedefs I found the reason to be that new
style hashvalues are currently printed with %lx, which is not
appropriate as these have turned into being structs. (Incidentally I
don't think %lx was appropriate during the time they were uint64_t
either.)

This patch reverts these traces to use the old style hashvalues for
printing.

/Gunnar

Index: engine/board.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/board.c,v
retrieving revision 1.83
diff -u -r1.83 board.c
--- engine/board.c      6 Aug 2003 14:44:32 -0000       1.83
+++ engine/board.c      7 Aug 2003 08:50:42 -0000
@@ -501,23 +501,23 @@
     if (str == NO_MOVE) {
       if (komaster != EMPTY)
        gg_snprintf(buf, 100, "%s (variation %d, hash %lx, komaster %s:%s)", 
-                   message, count_variations, hashval_ng,
+                   message, count_variations, hashdata.hashval[0],
                    komaster_to_string(komaster), location_to_string(kom_pos));
       else
        gg_snprintf(buf, 100, "%s (variation %d, hash %lx)", 
-                   message, count_variations, hashval_ng);
+                   message, count_variations, hashdata.hashval[0]);
     }
     else {
       if (komaster != EMPTY)
        gg_snprintf(buf, 100, 
                    "%s at %s (variation %d, hash %lx, komaster %s:%s)", 
                    message, location_to_string(str), count_variations,
-                   hashval_ng, komaster_to_string(komaster),
+                   hashdata.hashval[0], komaster_to_string(komaster),
                    location_to_string(kom_pos));
       else
        gg_snprintf(buf, 100, "%s at %s (variation %d, hash %lx)", 
                    message, location_to_string(str), count_variations,
-                   hashval_ng);
+                   hashdata.hashval[0]);
     }
     sgftreeAddPlayLast(sgf_dumptree, color, I(pos), J(pos));
     sgftreeAddComment(sgf_dumptree, buf);
@@ -555,11 +555,11 @@
       message = "UNKNOWN";
     if (komaster != EMPTY)
       gg_snprintf(buf, 100, "tryko: %s (variation %d, %lx, komaster %s:%s)", 
-                 message, count_variations, hashval_ng,
+                 message, count_variations, hashdata.hashval[0],
                  komaster_to_string(komaster), location_to_string(kom_pos));
     else
       gg_snprintf(buf, 100, "tryko: %s (variation %d, %lx)", 
-                 message, count_variations, hashval_ng);
+                 message, count_variations, hashdata.hashval[0]);
 
     /* Add two pass moves to the SGF output to simulate the ko threat
      * and the answer.
@@ -767,7 +767,7 @@
   if (count_variations)
     gprintf("%o (variation %d)", count_variations-1);
 #else
-  gprintf("%o (%d)", hashval_ng);
+  gprintf("%o (%lx)", hashdata.hashval[0]);
 #endif
 
   gprintf("%o\n");




reply via email to

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