gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] cleanup patch


From: Gunnar Farneback
Subject: [gnugo-devel] cleanup patch
Date: Thu, 21 Mar 2002 18:03:02 +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)

This patch does some mixed cleanup.

- --stack option and showstack global variable removed
- cache.o removed from libboard.a
- unneeded include of dfa.h removed from patterns.h

The --stack option is a remnant from debugging made in ancient times
and is hardly useful any more.

The removal of the cache code from libboard follows the philosophy
that libboard should be the smallest possible unit providing the board
logic. When I first created it the hash and cache codes were so
intertwined that I had to add the cache code as well.

/Gunnar

Index: doc/board.texi
===================================================================
RCS file: /cvsroot/gnugo/gnugo/doc/board.texi,v
retrieving revision 1.7
diff -u -r1.7 board.texi
--- doc/board.texi      20 Mar 2002 20:55:30 -0000      1.7
+++ doc/board.texi      21 Mar 2002 07:29:09 -0000
@@ -27,11 +27,6 @@
 Code for hashing go positions.
 @end quotation
 
address@hidden @file{cache.c}
address@hidden
-Code for caching go positions
address@hidden quotation
-
 @item @file{globals.c}
 @quotation
 Global variables needed in the rest of the files.  This file also
@@ -498,21 +493,3 @@
 It's the caller's responsibility to initialize the result parameters.
 @end quotation
 @end itemize
-
address@hidden Hashing of Board Positions
-
-Hashing of go positions in a hash table (sometimes also called a
-transposition table) is implemented in @code{libboard}, in @file{hash.c}
-and @file{cache.c} to be exact.  
-
-To use the hash function, you must include @file{hash.h} and to use the
-entire hash table, you must include @file{cache.h} in your program.  The
-details are described in @ref{Hashing}.
-
-
-
-
-
-
-
-
Index: doc/using.texi
===================================================================
RCS file: /cvsroot/gnugo/gnugo/doc/using.texi,v
retrieving revision 1.7
diff -u -r1.7 using.texi
--- doc/using.texi      20 Mar 2002 20:55:30 -0000      1.7
+++ doc/using.texi      21 Mar 2002 07:29:10 -0000
@@ -519,10 +519,6 @@
 @quotation
 benchmarking mode - can be used with @option{-l}.
 @end quotation
address@hidden @option{-s}, @option{--stack}
address@hidden
-stack trace (for debugging purposes).
address@hidden quotation
 @item @option{-S}, @option{--statistics}
 @quotation
 Print statistics (for debugging purposes).
Index: engine/Makefile.am
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/Makefile.am,v
retrieving revision 1.9
diff -u -r1.9 Makefile.am
--- engine/Makefile.am  13 Jan 2002 03:33:22 -0000      1.9
+++ engine/Makefile.am  21 Mar 2002 07:29:10 -0000
@@ -50,7 +50,6 @@
 
 libboard_a_SOURCES = \
       board.c \
-      cache.c \
       globals.c \
       hash.c \
       printutils.c \
Index: engine/Makefile.in
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/Makefile.in,v
retrieving revision 1.31
diff -u -r1.31 Makefile.in
--- engine/Makefile.in  13 Jan 2002 03:33:22 -0000      1.31
+++ engine/Makefile.in  21 Mar 2002 07:29:10 -0000
@@ -133,7 +133,6 @@
 
 libboard_a_SOURCES = \
       board.c \
-      cache.c \
       globals.c \
       hash.c \
       printutils.c \
Index: engine/board.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/board.c,v
retrieving revision 1.41
diff -u -r1.41 board.c
--- engine/board.c      19 Mar 2002 14:25:47 -0000      1.41
+++ engine/board.c      21 Mar 2002 07:29:10 -0000
@@ -721,8 +721,6 @@
   PUSH_VALUE(black_captured);
   PUSH_VALUE(white_captured);
 
-  if (showstack)
-    gprintf("        *** STACK before push: %d\n", stackp);
   ++stackp;
 
   if (verbose == 4)
@@ -742,8 +740,6 @@
 popgo()
 {
   stackp--;
-  if (showstack)
-    gprintf("<=    *** STACK  after pop: %d\n", stackp);
   
   undo_trymove();
   
Index: engine/globals.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/globals.c,v
retrieving revision 1.22
diff -u -r1.22 globals.c
--- engine/globals.c    7 Mar 2002 05:35:28 -0000       1.22
+++ engine/globals.c    21 Mar 2002 07:29:10 -0000
@@ -93,7 +93,6 @@
 
 /* Miscellaneous. */
 int quiet            = 0;  /* minimal output */
-int showstack        = 0;  /* debug stack pointer */
 int showstatistics   = 0;  /* print statistics */
 int profile_patterns = 0;  /* print statistics of pattern usage */
 int allpats          = 0;  /* generate all patterns, even small ones */
Index: engine/gnugo.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/gnugo.h,v
retrieving revision 1.47
diff -u -r1.47 gnugo.h
--- engine/gnugo.h      7 Mar 2002 05:35:28 -0000       1.47
+++ engine/gnugo.h      21 Mar 2002 07:29:10 -0000
@@ -192,7 +192,6 @@
 extern int printmoyo;          /* print moyo board each move */
 extern int printdragons;       /* print full data on each dragon */
 extern int printboard;         /* print board each move */
-extern int showstack;          /* debug stack pointer */
 extern int showstatistics;     /* print statistics */
 extern int profile_patterns;   /* print statistics of pattern usage */
 
Index: engine/hash.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/hash.c,v
retrieving revision 1.10
diff -u -r1.10 hash.c
--- engine/hash.c       4 Mar 2002 06:49:08 -0000       1.10
+++ engine/hash.c       21 Mar 2002 07:29:10 -0000
@@ -27,7 +27,6 @@
 
 #include "liberty.h"
 #include "hash.h"
-#include "cache.h"
 #include "random.h"
 
 
Index: interface/main.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/main.c,v
retrieving revision 1.33
diff -u -r1.33 main.c
--- interface/main.c    7 Mar 2002 17:04:28 -0000       1.33
+++ interface/main.c    21 Mar 2002 07:29:11 -0000
@@ -222,7 +222,6 @@
   {"worms",          no_argument,       0, 'w'},
   {"moyo",           required_argument, 0, 'm'},
   {"benchmark",      required_argument, 0, 'b'},
-  {"stack",          no_argument,       0, 's'},
   {"statistics",     no_argument,       0, 'S'},
   {"trace",          no_argument,       0, 't'},
   {"seed",           required_argument, 0, 'r'},
@@ -358,7 +357,6 @@
        
       case 'b': benchmark = atoi(gg_optarg); playmode = MODE_SOLO; break;
       case 'r': seed = atoi(gg_optarg); break;
-      case 's': showstack = 1; break;
       case 'S': showstatistics = 1; break;
       case 'w': printworms = 1; break;
       case 'm': printmoyo = strtol(gg_optarg, NULL, 0);  /* allows 0x... */ 
break;
@@ -1298,7 +1296,6 @@
    -w, --worms                   print worm and dragon data and move reasons\n\
    -m, --moyo <level>            moyo debugging, show moyo board\n\
    -b, --benchmark num           benchmarking mode - can be used with -l\n\
-   -s, --stack                   stack trace (for debugging purposes)\n\n\
    -S, --statistics              print statistics (for debugging purposes)\n\n\
    -t, --trace                   verbose tracing\n\
    --showtime                    print timing diagnostic\n\
Index: patterns/patterns.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.h,v
retrieving revision 1.27
diff -u -r1.27 patterns.h
--- patterns/patterns.h 10 Mar 2002 06:25:28 -0000      1.27
+++ patterns/patterns.h 21 Mar 2002 07:29:12 -0000
@@ -28,10 +28,6 @@
 #ifndef __PATTERN_H__
 #define __PATTERN_H__
 
-#ifndef _DFA_H_
-#include "dfa.h"
-#endif
-
 /* local versions of absolute value, min and max */
 
 #define gg_abs(x) ((x) < 0 ? -(x) : (x))



reply via email to

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