[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] suggest
From: |
Paul Pogonyshev |
Subject: |
Re: [gnugo-devel] suggest |
Date: |
Fri, 25 Feb 2005 18:43:39 +0200 |
User-agent: |
KMail/1.4.3 |
pcibusgood wrote:
> bugs report:
>
> [...]
>
> 1.fatal errors:
>
> In the 1378 line of main.c file, "sgfFreeNode(gameinfo.game_record.root);"
> This sentence will course When the two commands that are "load a.sgf" and
> "exit". are run.(a.sgf is any sgf of file).
Fixed. Our code is messy here, but I didn't try to make a stab at
restructuring.
>
>
> 2.I think we should increase two lines sentence in somewhere(),in order to
> for free "ap".
Done.
> 3.In the line 291 of gg_utils.c file, GetProcessTime() of gg_cputime() is
> not provided function in win98, And it will return a wrong result.I think
> We should use GetVersionEx() in order to judge windows version or give
> prompt.
Maybe someone with Windows skills can do this?
> 4.In the line 1014 of sgfnode.c file,
>
> "while (p > buffer && isspace((int) *p))". This sentence may cause wrong of
> read overflow memory. isspace() can`t process Chinese and Japnese.
GNU Go doesn't have proper support for international characters anyway,
so I don't see the need to fix it in one place only.
> 5.In the line 91 of global.c "int josekidb = 1; /* use fuseki
> database */"
It's the comment that is wrong. Fixed.
Paul
Index: engine/globals.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/globals.c,v
retrieving revision 1.71
diff -u -p -r1.71 globals.c
--- engine/globals.c 6 Jan 2005 19:50:27 -0000 1.71
+++ engine/globals.c 25 Feb 2005 16:24:57 -0000
@@ -87,7 +87,7 @@ int printmoyo = 0; /* print moy
int printboard = 0; /* print board each move */
int fusekidb = 1; /* use fuseki database */
int disable_fuseki = 0; /* do not generate fuseki moves */
-int josekidb = 1; /* use fuseki database */
+int josekidb = 1; /* use joseki database */
int showtime = 0; /* print time to find move */
int showscore = 0; /* print estimated score */
int level = DEFAULT_LEVEL; /* strength; up to 10 supported */
Index: engine/utils.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/utils.c,v
retrieving revision 1.104
diff -u -p -r1.104 utils.c
--- engine/utils.c 6 Jan 2005 19:50:27 -0000 1.104
+++ engine/utils.c 25 Feb 2005 16:25:01 -0000
@@ -194,10 +194,13 @@ somewhere(int color, int check_alive, in
pos = va_arg(ap, int);
if (board[pos] == color
- && (!check_alive || dragon[pos].status != DEAD))
+ && (!check_alive || dragon[pos].status != DEAD)) {
+ va_end(ap);
return 1;
+ }
}
+ va_end(ap);
return 0;
}
Index: interface/main.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/main.c,v
retrieving revision 1.110
diff -u -p -r1.110 main.c
--- interface/main.c 6 Jan 2005 13:09:39 -0000 1.110
+++ interface/main.c 25 Feb 2005 16:25:13 -0000
@@ -1441,7 +1441,7 @@ main(int argc, char *argv[])
report_pattern_profiling();
clock_report_autolevel(NULL, gameinfo.computer_player);
- sgfFreeNode(gameinfo.game_record.root);
+ sgfFreeNode(sgftree.root);
return 0;
} /* end main */
Index: interface/play_ascii.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_ascii.c,v
retrieving revision 1.53
diff -u -p -r1.53 play_ascii.c
--- interface/play_ascii.c 24 Feb 2005 18:08:35 -0000 1.53
+++ interface/play_ascii.c 25 Feb 2005 16:25:13 -0000
@@ -59,6 +59,7 @@ static int resignation_allowed;
/* Keep track of the score estimated before the last computer move. */
static int current_score_estimate = NO_SCORE;
+static void do_play_ascii(Gameinfo *gameinfo);
static int ascii_endgame(Gameinfo *gameinfo, int reason);
static void ascii_count(Gameinfo *gameinfo);
static void showcapture(char *line);
@@ -574,16 +575,7 @@ do_pass(Gameinfo *gameinfo, int *passes,
void
play_ascii(SGFTree *tree, Gameinfo *gameinfo, char *filename, char *until)
{
- int m, num;
int sz;
- float fnum;
- int passes = 0; /* two passes and its over */
- int tmp;
- char line[80];
- char *line_ptr = line;
- char *command;
- char *tmpstring;
- int state = 1;
setvbuf(stdout, (char *)NULL, _IONBF, 0); /* No buffering. */
@@ -606,6 +598,28 @@ play_ascii(SGFTree *tree, Gameinfo *game
sgf_initialized = 0;
}
+ do_play_ascii(gameinfo);
+ printf("\nThanks! for playing GNU Go.\n\n");
+
+ /* main() frees the tree and we might have changed it. */
+ *tree = sgftree;
+}
+
+
+void
+do_play_ascii(Gameinfo *gameinfo)
+{
+ int m, num;
+ int sz;
+ float fnum;
+ int passes = 0; /* two passes and its over */
+ int tmp;
+ char line[80];
+ char *line_ptr = line;
+ char *command;
+ char *tmpstring;
+ int state = 1;
+
while (state == 1) {
state = 0;
@@ -636,17 +650,14 @@ play_ascii(SGFTree *tree, Gameinfo *game
/* Read a line of input. */
line_ptr = line;
- if (!fgets(line, 80, stdin)) {
- printf("\nThanks! for playing GNU Go.\n\n");
+ if (!fgets(line, 80, stdin))
return;
- }
#else
snprintf(line,79,"%s(%d): ",
color_to_string(gameinfo->to_move), movenum+1);
- if (!(line_ptr = readline(line))) {
- printf("\nThanks! for playing GNU go.\n\n");
+ if (!(line_ptr = readline(line)))
return;
- }
+
add_history(line_ptr);
#endif
@@ -661,7 +672,6 @@ play_ascii(SGFTree *tree, Gameinfo *game
case END:
case EXIT:
case QUIT:
- printf("\nThanks! for playing GNU Go.\n\n");
return;
case HELP:
@@ -1007,8 +1017,6 @@ play_ascii(SGFTree *tree, Gameinfo *game
gameinfo_clear(gameinfo, board_size, komi);
}
-
- printf("\nThanks! for playing GNU Go.\n\n");
}