Index: config.vc =================================================================== RCS file: /cvsroot/gnugo/gnugo/config.vc,v retrieving revision 1.87 diff -u -r1.87 config.vc --- config.vc 1 Oct 2003 14:36:37 -0000 1.87 +++ config.vc 13 Nov 2003 22:26:08 -0000 @@ -69,6 +69,6 @@ #define SIZEOF_LONG 4 /* Version number of package */ -#define VERSION "3.5.1" +#define VERSION "3.5.2" #pragma warning(disable: 4244 4305) Index: doc/api.texi =================================================================== RCS file: /cvsroot/gnugo/gnugo/doc/api.texi,v retrieving revision 1.11 diff -u -r1.11 api.texi --- doc/api.texi 6 Jul 2003 14:31:54 -0000 1.11 +++ doc/api.texi 13 Nov 2003 22:26:08 -0000 @@ -127,23 +127,9 @@ @end group @end example -In addition to these, the following values can be used in special -places, such as describing the borders of eyes: - -@example -@group - - color value - GRAY (GRAY_BORDER) 3 - WHITE_BORDER 4 - BLACK_BORDER 5 - -@end group -@end example - There is a macro, @code{OTHER_COLOR(color)} which can be used to get the other color than the parameter. This macro can only be used on @code{WHITE} -or @code{BLACK}, but not on @code{EMPTY} or one of the border colors. +or @code{BLACK}, but not on @code{EMPTY}. @findex OTHER_COLOR GNU Go uses two different representations of the board, for @@ -151,7 +137,7 @@ two dimensional one (@pxref{Libboard}). The one-dimensional board was introduced before GNU Go 3.2, while the two-dimensional board dates back to the ancestral program written by Man Lung Li -before 1995. The API still uses the one-dimensional board, so +before 1995. The API still uses the two-dimensional board, so the API functions have not changed much since GNU Go 3.0. @node The Board State Index: doc/dragon.texi =================================================================== RCS file: /cvsroot/gnugo/gnugo/doc/dragon.texi,v retrieving revision 1.15 diff -u -r1.15 dragon.texi --- doc/dragon.texi 11 Jul 2003 23:26:00 -0000 1.15 +++ doc/dragon.texi 13 Nov 2003 22:26:09 -0000 @@ -95,19 +95,7 @@ @itemize @bullet @item @code{color} @quotation -@cindex border color -If the worm is @code{BLACK} or @code{WHITE}, that is its color. -Cavities (empty worms) have an additional attribute which we call -@dfn{bordercolor}. This will be one of @code{BLACK_BORDER}, -@code{WHITE_BORDER} or @code{GRAY_BORDER}. Specifically, if all the worms -adjacent to a given empty worm have the same color (black or white) then we -define that to be the bordercolor. Otherwise the bordercolor is gray. - -Rather than define a new field, we keep this data in the -field color. Thus for every worm, the color field will -have one of the following values: @code{BLACK}, @code{WHITE}, -@code{GRAY_BORDER}, @code{BLACK_BORDER} or @code{WHITE_BORDER}. -The last three categories are empty worms classified by bordercolor. +The color of the worm. @end quotation @item @code{size} @quotation @@ -148,7 +136,7 @@ fourth order liberties, respectively. The definition of liberties of order >1 is adapted to the problem of detecting the shape of the surrounding -cavity. In particular we want to be able to see if a group +empty space. In particular we want to be able to see if a group is loosely surrounded. @dfn{a liberty of order n} is an empty vertex which may be connected to the string by placing n stones of the same color on the board, but no fewer. The @@ -281,16 +269,16 @@ @item unconditional_status @quotation Unconditional status is also set by the function -@code{unconditional_life}. This is set ALIVE for stones which are +@code{unconditional_life}. This is set @code{ALIVE} for stones which are invincible. Stones which can not be turned invincible even if the defender is allowed an arbitrary number of consecutive moves are given -an unconditional status of DEAD. Empty points where the opponent cannot -form an invincible worm are called unconditional territory. The -unconditional status is set to @code{WHITE_BORDER} or @code{BLACK_BORDER} -depending on who owns the territory. Finally, if a stone can be captured but -is adjacent to unconditional territory of its own color, it is also given the -unconditional status @code{ALIVE}. In all other cases the unconditional status is -@code{UNKNOWN}. +an unconditional status of @code{DEAD}. Empty points where the opponent +cannot form an invincible worm are called unconditional territory. The +unconditional status is set to @code{WHITE_TERRITORY} or +@code{BLACK_TERRITORY} depending on who owns the territory. Finally, if +a stone can be captured but is adjacent to unconditional territory of +its own color, it is also given the unconditional status @code{ALIVE}. +In all other cases the unconditional status is @code{UNKNOWN}. To make sense of these definitions it is important to notice that any stone which is alive in the ordinary sense (even if only in seki) can be @@ -612,9 +600,7 @@ @item @code{color} @quotation @cindex color (dragon) -For strings, this is @code{BLACK} or @code{WHITE}. -For caves, it is @code{BLACK_BORDER}, @code{WHITE_BORDER} or -@code{GRAY_BORDER}. The meaning of these concepts is the same as for worms. +The color of the dragon. @end quotation @item @code{id} @cindex dragon number Index: doc/eyes.texi =================================================================== RCS file: /cvsroot/gnugo/gnugo/doc/eyes.texi,v retrieving revision 1.7 diff -u -r1.7 eyes.texi --- doc/eyes.texi 6 Jul 2003 14:31:54 -0000 1.7 +++ doc/eyes.texi 13 Nov 2003 22:26:09 -0000 @@ -569,7 +569,7 @@ @end group @end example -A FALSE EYE is a cave which cannot become an eye. Here are +A FALSE EYE is an eye vertex which cannot become a proper eye. Here are two examples of false eyes for @code{O}: @example Index: doc/utils.texi =================================================================== RCS file: /cvsroot/gnugo/gnugo/doc/utils.texi,v retrieving revision 1.15 diff -u -r1.15 utils.texi --- doc/utils.texi 10 Aug 2003 17:56:50 -0000 1.15 +++ doc/utils.texi 13 Nov 2003 22:26:10 -0000 @@ -636,9 +636,9 @@ @item @code{int find_origin(int str)} @findex find_origin @quotation -Find the origin of a worm or a cavity, i.e. the point with the -smallest 1D board coordinate. The idea is to have a canonical -reference point for a string. +Find the origin of a string, i.e. the point with the smallest 1D board +coordinate. The idea is to have a canonical reference point for a +string. @end quotation @item @code{int is_self_atari(int pos, int color)} @findex is_self_atari Index: engine/aftermath.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/aftermath.c,v retrieving revision 1.45 diff -u -r1.45 aftermath.c --- engine/aftermath.c 7 Sep 2003 23:02:45 -0000 1.45 +++ engine/aftermath.c 13 Nov 2003 22:26:10 -0000 @@ -857,7 +857,7 @@ else TRACE("reduced_genmove() recommends %1m with value %f\n", *move, val); - return val; + return val; } /* Preliminary function for playing through the aftermath. */ Index: engine/board.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/board.c,v retrieving revision 1.88 diff -u -r1.88 board.c --- engine/board.c 11 Nov 2003 21:56:37 -0000 1.88 +++ engine/board.c 13 Nov 2003 22:26:12 -0000 @@ -126,7 +126,7 @@ /* Main array of string information. */ -static struct string_data string[MAX_STRINGS]; +static struct string_data string[MAX_STRINGS]; /* Stacks and stack pointers. */ static struct change_stack_entry change_stack[STACK_SIZE]; @@ -1475,7 +1475,7 @@ return -1; } else if (board[EAST(pos)] == color - && string_number[EAST(pos)] != ally1) + && string_number[EAST(pos)] != ally1) ally2 = string_number[EAST(pos)]; } else if (board[NORTH(pos)] == color) { Index: engine/board.h =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/board.h,v retrieving revision 1.5 diff -u -r1.5 board.h --- engine/board.h 11 Nov 2003 21:56:37 -0000 1.5 +++ engine/board.h 13 Nov 2003 22:26:12 -0000 @@ -97,7 +97,7 @@ "gray_black", \ "weak_ko" -const char* color_to_string(int color); +const char *color_to_string(int color); #define OTHER_COLOR(color) (WHITE+BLACK-(color)) #define IS_STONE(arg) ((arg) == WHITE || (arg) == BLACK) Index: engine/breakin.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/breakin.c,v retrieving revision 1.12 diff -u -r1.12 breakin.c --- engine/breakin.c 10 Nov 2003 21:54:55 -0000 1.12 +++ engine/breakin.c 13 Nov 2003 22:26:12 -0000 @@ -281,7 +281,7 @@ for (k = save_num; k < *num_non_territory; k++) { int j; - int pos = non_territory[k]; + int pos = non_territory[k]; if (goal[pos]) { affected_size++; goal[pos] = 0; Index: engine/cache.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/cache.c,v retrieving revision 1.32 diff -u -r1.32 cache.c --- engine/cache.c 1 Oct 2003 14:36:38 -0000 1.32 +++ engine/cache.c 13 Nov 2003 22:26:13 -0000 @@ -282,15 +282,15 @@ table->is_clean = 0; } -static const char* routine_names[] = { - ROUTINE_NAMES +static const char *routine_names[] = { + ROUTINE_NAMES }; /* Convert a routine as used in the cache table to a string. */ const char * routine_id_to_string(enum routine_id routine) { - return routine_names[(int) routine]; + return routine_names[(int) routine]; } Index: engine/cache.h =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/cache.h,v retrieving revision 1.36 diff -u -r1.36 cache.h --- engine/cache.h 15 Aug 2003 07:21:22 -0000 1.36 +++ engine/cache.h 13 Nov 2003 22:26:13 -0000 @@ -95,17 +95,17 @@ extern Transposition_table ttable; -extern void tt_init(Transposition_table *table, int memsize); -extern void tt_clear(Transposition_table *table); -extern void tt_free(Transposition_table *table); -extern int tt_get(Transposition_table *table, - int komaster, int kom_pos, enum routine_id routine, - int target, int remaining_depth, - int *result, int *move); -extern void tt_update(Transposition_table *table, - int komaster, int kom_pos, enum routine_id routine, - int target, int remaining_depth, - int result, int move); +void tt_init(Transposition_table *table, int memsize); +void tt_clear(Transposition_table *table); +void tt_free(Transposition_table *table); +int tt_get(Transposition_table *table, + int komaster, int kom_pos, enum routine_id routine, + int target, int remaining_depth, + int *result, int *move); +void tt_update(Transposition_table *table, + int komaster, int kom_pos, enum routine_id routine, + int target, int remaining_depth, + int result, int move); /* ================================================================ */ @@ -306,7 +306,7 @@ const char *message); /* Trace messages in decideconnection sgf file. */ void sgf_trace2(const char *func, int str1, int str2, int move, - const char* result, const char *message); + const char *result, const char *message); /* Trace messages in decidesemeai sgf file. */ void sgf_trace_semeai(const char *func, int str1, int str2, int move, int result1, int result2, const char *message); Index: engine/clock.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/clock.c,v retrieving revision 1.18 diff -u -r1.18 clock.c --- engine/clock.c 18 Jul 2003 18:59:21 -0000 1.18 +++ engine/clock.c 13 Nov 2003 22:26:14 -0000 @@ -149,7 +149,7 @@ clk.byoyomi_stones = byo_stones; clk.moveno = -1; - for (color = WHITE ; color <= BLACK ; color++) { + for (color = WHITE; color <= BLACK; color++) { clk.timer[color] = 0; clk.btimer[color] = 0; clk.byoyomi[color] = 0; @@ -492,7 +492,7 @@ gg_assert(COLOR(move) == OTHER_COLOR(color)); res = 0; - for (i = 0 ; i < 5 ; i++) + for (i = 0; i < 5; i++) res += coef[i] * (clk.date[move-9+i*2] - clk.date[move-10+i*2]); return res; @@ -608,8 +608,8 @@ * Time contract strategy: * try to respect the time of a standard game. */ - if (clk.moveno < CLOCK_MOVE_CONTRACT(board_size)) - respect_time_contract(color); + if (clk.moveno < CLOCK_MOVE_CONTRACT(board_size)) + respect_time_contract(color); /* * Keep ahead strategy: @@ -639,8 +639,3 @@ * c-basic-offset: 2 * End: */ - - - - - Index: engine/dragon.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/dragon.c,v retrieving revision 1.125 diff -u -r1.125 dragon.c --- engine/dragon.c 9 Nov 2003 23:34:21 -0000 1.125 +++ engine/dragon.c 13 Nov 2003 22:26:15 -0000 @@ -343,7 +343,7 @@ &DRAGON2(str).owl_defense_certain, &kworm); if (dcode != 0) { if (defense_point != NO_MOVE) { - DRAGON2(str).owl_status = acode==GAIN ? ALIVE : CRITICAL; + DRAGON2(str).owl_status = (acode == GAIN ? ALIVE : CRITICAL); DRAGON2(str).owl_defense_point = defense_point; DRAGON2(str).owl_defense_code = dcode; DRAGON2(str).owl_defense_kworm = kworm; @@ -357,7 +357,7 @@ * propose. Having the status right is important e.g. * for connection moves to be properly valued. */ - DRAGON2(str).owl_status = acode==GAIN ? ALIVE : CRITICAL; + DRAGON2(str).owl_status = (acode == GAIN ? ALIVE : CRITICAL); DEBUG(DEBUG_OWL_PERFORMANCE, "Inconsistent owl attack and defense results for %1m.\n", str); @@ -1148,7 +1148,7 @@ int ii; for (ii = BOARDMIN; ii < BOARDMAX; ii++) if (ON_BOARD(ii)) { - if (safe_stones[ii]) { + if (safe_stones[ii]) { ASSERT1(IS_STONE(board[ii]), ii); strength[ii] = DEFAULT_STRENGTH * (1.0 - 0.3 * DRAGON2(ii).weakness_pre_owl); @@ -1176,7 +1176,7 @@ && DRAGON2(ii).safety != TACTICALLY_DEAD && DRAGON2(ii).safety != CRITICAL) || (DRAGON2(ii).safety == CRITICAL - && board[ii] == color)))) ) + && board[ii] == color))))) safe_stones[ii] = INFLUENCE_SAFE_STONE; } Index: engine/fuseki.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/fuseki.c,v retrieving revision 1.20 diff -u -r1.20 fuseki.c --- engine/fuseki.c 18 Jul 2003 18:59:21 -0000 1.20 +++ engine/fuseki.c 13 Nov 2003 22:26:15 -0000 @@ -171,7 +171,7 @@ else table = large_board; - for (i = 0; i < 8 ;i++) + for (i = 0; i < 8; i++) sum_of_weights += table[i]; q = gg_rand() % sum_of_weights; Index: engine/genmove.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/genmove.c,v retrieving revision 1.83 diff -u -r1.83 genmove.c --- engine/genmove.c 7 Sep 2003 23:02:45 -0000 1.83 +++ engine/genmove.c 13 Nov 2003 22:26:15 -0000 @@ -850,7 +850,8 @@ search_mask[POS(m, n)] = 0; } limit_search = pos; - if (0) draw_search_area(); + if (0) + draw_search_area(); } /* unmarks the entire board */ @@ -881,7 +882,7 @@ for (n = 0; n < board_size; n++) { int col, c; - if (search_mask[POS(m,n)]) + if (search_mask[POS(m, n)]) col = GG_COLOR_RED; else col = GG_COLOR_BLACK; Index: engine/hash.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/hash.c,v retrieving revision 1.21 diff -u -r1.21 hash.c --- engine/hash.c 1 Oct 2003 14:36:38 -0000 1.21 +++ engine/hash.c 13 Nov 2003 22:26:16 -0000 @@ -278,7 +278,7 @@ char * hashdata_to_string(Hash_data *hashdata) { - static char buffer[17]; + static char buffer[17]; sprintf(buffer, "%lx", hashdata->hashval[0]); #if NUM_HASHVALUES == 2 Index: engine/hash.h =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/hash.h,v retrieving revision 1.19 diff -u -r1.19 hash.h --- engine/hash.h 1 Oct 2003 14:36:39 -0000 1.19 +++ engine/hash.h 13 Nov 2003 22:26:16 -0000 @@ -171,7 +171,7 @@ #endif -extern void hash_ng_init(void); +void hash_ng_init(void); #endif Index: engine/influence.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/influence.c,v retrieving revision 1.96 diff -u -r1.96 influence.c --- engine/influence.c 9 Nov 2003 23:34:21 -0000 1.96 +++ engine/influence.c 13 Nov 2003 22:26:20 -0000 @@ -681,7 +681,7 @@ * E - Enhance patterns, FIXME: document this one! * t - Non-territory patterns, marking vertices as not territory. * I - Invasion patterns, adding a low intensity influence source. -* e - Escape bonus. Used together with I to increase the value substantially + * e - Escape bonus. Used together with I to increase the value substantially * if escape influence is being computed. * * Classes A, D, and B are matched with color as O, and it is assumed @@ -919,7 +919,7 @@ } } - if (cosmic_gnugo) { + if (cosmic_gnugo) { float t = 0.15 + (1.0 - cosmic_importance); t = gg_min(1.0, t); t = gg_max(0.0, t); @@ -1254,13 +1254,13 @@ if (territory_color != EMPTY) return territory_color; - if (bi > moyo_data.influence_balance * wi && - bi > moyo_data.my_influence_minimum && - wi < moyo_data.opp_influence_maximum) + if (bi > moyo_data.influence_balance * wi + && bi > moyo_data.my_influence_minimum + && wi < moyo_data.opp_influence_maximum) return BLACK; - if (wi > moyo_data.influence_balance * bi && - wi > moyo_data.my_influence_minimum && - bi < moyo_data.opp_influence_maximum) + if (wi > moyo_data.influence_balance * bi + && wi > moyo_data.my_influence_minimum + && bi < moyo_data.opp_influence_maximum) return WHITE; return EMPTY; @@ -1292,13 +1292,13 @@ /* default */ if (territory_color != EMPTY) color = territory_color; - else if (bi > moyo_restricted_data.influence_balance * wi && - bi > moyo_restricted_data.my_influence_minimum && - wi < moyo_restricted_data.opp_influence_maximum) + else if (bi > moyo_restricted_data.influence_balance * wi + && bi > moyo_restricted_data.my_influence_minimum + && wi < moyo_restricted_data.opp_influence_maximum) color = BLACK; - else if (wi > moyo_restricted_data.influence_balance * bi && - wi > moyo_restricted_data.my_influence_minimum && - bi < moyo_restricted_data.opp_influence_maximum) + else if (wi > moyo_restricted_data.influence_balance * bi + && wi > moyo_restricted_data.my_influence_minimum + && bi < moyo_restricted_data.opp_influence_maximum) color = WHITE; else color = EMPTY; Index: engine/liberty.h =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v retrieving revision 1.203 diff -u -r1.203 liberty.h --- engine/liberty.h 9 Nov 2003 23:34:21 -0000 1.203 +++ engine/liberty.h 13 Nov 2003 22:26:20 -0000 @@ -91,13 +91,13 @@ "connect", \ "disconnect", \ "break_in", \ - "block_off" \ - "owl_threaten_attack" \ - "owl_threatend_defense" \ - "owl_does_defend" \ - "owl_does_attack" \ - "owl_connection_defends" \ - "owl_substantial" \ + "block_off", \ + "owl_threaten_attack", \ + "owl_threatend_defense", \ + "owl_does_defend", \ + "owl_does_attack", \ + "owl_connection_defends", \ + "owl_substantial", \ "owl_confirm_safety" const char *routine_id_to_string(enum routine_id routine); Index: engine/matchpat.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/matchpat.c,v retrieving revision 1.60 diff -u -r1.60 matchpat.c --- engine/matchpat.c 12 Oct 2003 03:07:50 -0000 1.60 +++ engine/matchpat.c 13 Nov 2003 22:26:20 -0000 @@ -622,8 +622,8 @@ for (i = 0; i != board_size; i++) for (j = 0; j != board_size; j++) - if (BOARD(i,j) == anchor - && (!anchor_in_goal || goal[POS(i,j)] != 0)) + if (BOARD(i, j) == anchor + && (!anchor_in_goal || goal[POS(i, j)] != 0)) tree_do_matchpat(i, j, callback, color, pdb, callback_data, goal, anchor_in_goal); @@ -656,13 +656,13 @@ struct tree_node *node = &(tnl->node); int x = m + node->x; int y = n + node->y; - if (ON_BOARD2(x,y)) { + if (ON_BOARD2(x, y)) { int att = node->att; - int point_color = BOARD(x,y); + int point_color = BOARD(x, y); if ((att == EMPTY && point_color == EMPTY) || (att == ATT_X && point_color == OTHER_COLOR(color)) || (att == ATT_O && point_color == color)) { - goal_found = goal_found || goal[POS(x,y)]; + goal_found = goal_found || goal[POS(x, y)]; if (node->matches) { struct match_node *match = node->matches->next; while (match) { @@ -876,7 +876,7 @@ { int i, j; - for (i = 0; i < dfa_board_size ; i++) { + for (i = 0; i < dfa_board_size; i++) { for (j = 0; j < dfa_board_size; j++) { if (i != m || j != n) fprintf(stderr, "%1d", dfa_p[DFA_POS(i, j)]); Index: engine/optics.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/optics.c,v retrieving revision 1.82 diff -u -r1.82 optics.c --- engine/optics.c 24 Aug 2003 03:04:11 -0000 1.82 +++ engine/optics.c 13 Nov 2003 22:26:21 -0000 @@ -2530,7 +2530,7 @@ int m, n; for (m = i - 3; m <= i + 3; m++) - for (n = j - 2 ; n <= j + 2; n++) + for (n = j - 2; n <= j + 2; n++) if (!ON_BOARD(POS(m, n)) || mx[POS(m, n)] != WHITE) return 0; @@ -2940,7 +2940,7 @@ popgo(); } } - set_eyevalue(result, a, 1,1, d); + set_eyevalue(result, a, 1, 1, d); } else if (defense_code != 0) { /* Critical with extra eye. Index: engine/owl.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v retrieving revision 1.182 diff -u -r1.182 owl.c --- engine/owl.c 11 Nov 2003 21:48:57 -0000 1.182 +++ engine/owl.c 13 Nov 2003 22:26:23 -0000 @@ -1473,7 +1473,7 @@ /* If reading goes to deep or we run out of nodes, we assume life. */ - if (reading_limit_reached(&live_reason, this_variation_number)) { + if (reading_limit_reached(&live_reason, this_variation_number)) { SGFTRACE(0, 0, live_reason); READ_RETURN(read_result, move, 0, 0); } @@ -1586,9 +1586,9 @@ sgf_dumptree = NULL; count_variations = 0; result = attack(str, &apos); - if (result == WIN || - (result != 0 && (min_eyes(&probable_eyes) >= 2 - || pass == 5))) { + if (result == WIN + || (result != 0 && (min_eyes(&probable_eyes) >= 2 + || pass == 5))) { set_single_owl_move(shape_moves, apos, "tactical attack"); moves = shape_moves; } @@ -2131,7 +2131,7 @@ } /* If reading goes to deep or we run out of nodes, we assume life. */ - if (reading_limit_reached(&live_reason, this_variation_number)) { + if (reading_limit_reached(&live_reason, this_variation_number)) { SGFTRACE(0, WIN, live_reason); READ_RETURN(read_result, move, 0, WIN); } @@ -3239,7 +3239,7 @@ if (!list->pattern_heap) pattern_list_build_heap(list); - for (i = 0 ; i < list->heap_num_patterns; i++) + for (i = 0; i < list->heap_num_patterns; i++) if (check_pattern_hard(list->pattern_heap[i]->move, color, list->pattern_heap[i]->pattern, list->pattern_heap[i]->ll)) { @@ -4054,7 +4054,7 @@ /* If we've reached this far, the attack is okay. */ if (DRAGON2(pos).owl_attack_code == GAIN) { - add_gain_move(move, pos, DRAGON2(pos).owl_attack_kworm ); + add_gain_move(move, pos, DRAGON2(pos).owl_attack_kworm); DEBUG(DEBUG_OWL, "owl: %1m attacks %1m with gain at move %d\n", move, pos, movenum+1); } @@ -4283,9 +4283,9 @@ if (search_persistent_owl_cache(OWL_ATTACK, origin, 0, 0, &result, defense_point, kworm, NULL)) { popgo(); - if (result==0) + if (result == 0) return WIN; - else if (result==GAIN) + else if (result == GAIN) return LOSS; else return 0; @@ -4296,7 +4296,7 @@ kworm, 0); acode = do_owl_attack(target, &defense, &wid, owl, EMPTY, NO_MOVE, 0); finish_goal_list(&goal_worms_computed, &wpos, owl_goal_worm, wid); - if (acode==0) + if (acode == 0) result = WIN; else if (acode == GAIN) result = LOSS; @@ -5669,7 +5669,7 @@ /* experimental: let's try to fill up the array with other neighboring * opponent worms */ - if (1 && (w > 0) && (w < MAX_GOAL_WORMS) ) { + if (1 && (w > 0) && (w < MAX_GOAL_WORMS)) { pos = goal_worm[0]; for (k = 0; k < DRAGON2(pos).neighbors && w < MAX_GOAL_WORMS; k++) { int ii; Index: engine/persistent.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/persistent.c,v retrieving revision 1.19 diff -u -r1.19 persistent.c --- engine/persistent.c 11 Nov 2003 21:56:37 -0000 1.19 +++ engine/persistent.c 13 Nov 2003 22:26:24 -0000 @@ -201,8 +201,8 @@ { int i, j, ii; int c = ' '; - int cw = apos==NO_MOVE ? 'O' : 'o'; - int cb = apos==NO_MOVE ? 'X' : 'x'; + int cw = (apos == NO_MOVE) ? 'O' : 'o'; + int cb = (apos == NO_MOVE) ? 'X' : 'x'; start_draw_board(); Index: engine/printutils.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/printutils.c,v retrieving revision 1.42 diff -u -r1.42 printutils.c --- engine/printutils.c 3 Sep 2003 16:59:58 -0000 1.42 +++ engine/printutils.c 13 Nov 2003 22:26:25 -0000 @@ -48,7 +48,7 @@ else if (stackp > 0) fprintf(outputfile, "%.*s", stackp*2, " "); - for (; *fmt ; ++fmt) { + for (; *fmt; ++fmt) { if (*fmt == '%') { switch (*++fmt) { case 'c': @@ -78,7 +78,7 @@ } case 's': { - char *s = va_arg(ap, char*); + char *s = va_arg(ap, char *); fputs(s, outputfile); break; } @@ -252,7 +252,7 @@ abort(); /* cause core dump */ } -static const char* color_names[] = { +static const char *color_names[] = { COLOR_NAMES }; @@ -396,7 +396,7 @@ if (board_size%2 == 0) return 0; - /* Less then 12 in board size only middle point. */ + /* Less than 12 in board size only middle point. */ if (board_size < 12) { if (m == middle && n == middle) return 1; Index: engine/reading.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/reading.c,v retrieving revision 1.124 diff -u -r1.124 reading.c --- engine/reading.c 9 Oct 2003 20:25:08 -0000 1.124 +++ engine/reading.c 13 Nov 2003 22:26:27 -0000 @@ -2919,7 +2919,7 @@ other_tactic = KO_A; if (other_tactic < best_other_tactic) { best_move = moves[k].pos; - best_other_tactic = other_tactic ; + best_other_tactic = other_tactic; } } else { @@ -3864,7 +3864,7 @@ int alib, blib; int numlibs; int libs[4]; - int i,j; + int i, j; int ai, aj; int bi, bj; @@ -5572,8 +5572,8 @@ /* If we have this position cached, use the previous value. */ if (stackp == 0 - && safe_move_cache_when[move][color==BLACK] == position_number) - return safe_move_cache[move][color==BLACK]; + && safe_move_cache_when[move][color == BLACK] == position_number) + return safe_move_cache[move][color == BLACK]; /* Otherwise calculate the value... */ if (trymove(move, color, "safe_move-A", 0, EMPTY, 0)) { @@ -5600,8 +5600,8 @@ if (0) gprintf("Safe move at %1m for %s cached when depth=%d, position number=%d\n", move, color_to_string(color), depth, position_number); - safe_move_cache_when[move][color==BLACK] = position_number; - safe_move_cache[move][color==BLACK] = safe; + safe_move_cache_when[move][color == BLACK] = position_number; + safe_move_cache[move][color == BLACK] = safe; } return safe; Index: engine/semeai.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/semeai.c,v retrieving revision 1.62 diff -u -r1.62 semeai.c --- engine/semeai.c 4 Sep 2003 15:27:41 -0000 1.62 +++ engine/semeai.c 13 Nov 2003 22:26:27 -0000 @@ -80,8 +80,8 @@ if (dragon[apos].color == dragon[bpos].color || (dragon[apos].status != DEAD && dragon[apos].status != CRITICAL) - ||(dragon[bpos].status != DEAD - && dragon[bpos].status != CRITICAL)) + || (dragon[bpos].status != DEAD + && dragon[bpos].status != CRITICAL)) continue; /* A dragon consisting of a single worm which is tactically dead or @@ -359,7 +359,7 @@ int pos; if (dragon[dr].status != new_status - && (dragon[dr].status != CRITICAL || new_status != DEAD)) { + && (dragon[dr].status != CRITICAL || new_status != DEAD)) { DEBUG(DEBUG_SEMEAI, "Changing status of %1m from %s to %s.\n", dr, status_to_string(dragon[dr].status), status_to_string(new_status)); Index: engine/sgfdecide.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/sgfdecide.c,v retrieving revision 1.52 diff -u -r1.52 sgfdecide.c --- engine/sgfdecide.c 10 Aug 2003 17:56:51 -0000 1.52 +++ engine/sgfdecide.c 13 Nov 2003 22:26:28 -0000 @@ -48,7 +48,7 @@ if (board[pos] == EMPTY) { fprintf(stderr, "gnugo: --decide-string called on an empty vertex\n"); - return ; + return; } if (*outfilename) @@ -205,7 +205,7 @@ if (board[pos] == EMPTY) { fprintf(stderr, "gnugo: --decide-dragon called on an empty vertex\n"); - return ; + return; } /* Prepare pattern matcher and reading code. */ @@ -295,7 +295,7 @@ { if (board[pos] == EMPTY) { fprintf(stderr, "gnugo: --decide-dragon-data called on an empty vertex\n"); - return ; + return; } reset_engine(); silent_examine_position(board[pos], FULL_EXAMINE_DRAGONS); Index: engine/shapes.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/shapes.c,v retrieving revision 1.48 diff -u -r1.48 shapes.c --- engine/shapes.c 6 Aug 2003 14:50:51 -0000 1.48 +++ engine/shapes.c 13 Nov 2003 22:26:28 -0000 @@ -89,8 +89,8 @@ /* For some classes of patterns we need to find all dragons present * in the pattern. */ - if ((class & (CLASS_B | CLASS_C | CLASS_c | CLASS_a | CLASS_d | CLASS_O | - CLASS_J | CLASS_j | CLASS_U | CLASS_T | CLASS_t)) != 0) { + if ((class & (CLASS_B | CLASS_C | CLASS_c | CLASS_a | CLASS_d | CLASS_O + | CLASS_J | CLASS_j | CLASS_U | CLASS_T | CLASS_t)) != 0) { /* Match each point. */ for (k = 0; k < pattern->patlen; ++k) { int pos; /* absolute (board) co-ord of (transformed) pattern element */ Index: engine/showbord.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/showbord.c,v retrieving revision 1.25 diff -u -r1.25 showbord.c --- engine/showbord.c 3 Sep 2003 16:59:58 -0000 1.25 +++ engine/showbord.c 13 Nov 2003 22:26:28 -0000 @@ -69,9 +69,9 @@ * avoided. */ static const int colors[3][5] = { - {0,0,0,0,0}, /*not used */ - {6,2,1,3,5}, /* WHITE : dead, alive, critical, unknown, unchecked */ - {6,2,1,3,5} /* BLACK : dead, alive, critical, unknown, unchecked */ + {0, 0, 0, 0, 0}, /*not used */ + {6, 2, 1, 3, 5}, /* WHITE : dead, alive, critical, unknown, unchecked */ + {6, 2, 1, 3, 5} /* BLACK : dead, alive, critical, unknown, unchecked */ }; static const int domain_colors[4] = {5, 1, 2, 3}; /* gray, black, white, both */ @@ -314,7 +314,7 @@ * in the engine code than here. */ -static const char* status_names [] = { +static const char *status_names[] = { DRAGON_STATUS_NAMES }; Index: engine/surround.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/surround.c,v retrieving revision 1.10 diff -u -r1.10 surround.c --- engine/surround.c 18 Jul 2003 18:59:21 -0000 1.10 +++ engine/surround.c 13 Nov 2003 22:26:29 -0000 @@ -606,17 +606,17 @@ for (n = 0; n < board_size; n++) { int col, c; - if (mf[POS(m,n)]) { - if (mn[POS(m,n)] ==1 ) + if (mf[POS(m, n)]) { + if (mn[POS(m, n)] == 1) col = GG_COLOR_RED; - else if (mn[POS(m,n)] == 2) + else if (mn[POS(m, n)] == 2) col = GG_COLOR_YELLOW; else col = GG_COLOR_GREEN; } - else if (mn[POS(m,n)] == 1) + else if (mn[POS(m, n)] == 1) col = GG_COLOR_BLUE; - else if (mn[POS(m,n)] == 2) + else if (mn[POS(m, n)] == 2) col = GG_COLOR_CYAN; else col = GG_COLOR_BLACK; Index: engine/utils.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/utils.c,v retrieving revision 1.82 diff -u -r1.82 utils.c --- engine/utils.c 6 Aug 2003 14:56:47 -0000 1.82 +++ engine/utils.c 13 Nov 2003 22:26:30 -0000 @@ -688,8 +688,9 @@ break_chain_depth = gg_max(2, BREAK_CHAIN_DEPTH + depth_level); if (level >= 8) owl_distrust_depth = gg_max(1, (2 * OWL_DISTRUST_DEPTH + depth_level) / 2); - else owl_distrust_depth = - gg_max(1, (2 * OWL_DISTRUST_DEPTH - 1 + depth_level) / 2); + else + owl_distrust_depth = gg_max(1, (2 * OWL_DISTRUST_DEPTH - 1 + + depth_level) / 2); owl_branch_depth = gg_max(2, (2 * OWL_BRANCH_DEPTH + depth_level) / 2); owl_reading_depth = gg_max(5, (2 * OWL_READING_DEPTH + depth_level) / 2); Index: engine/value_moves.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v retrieving revision 1.111 diff -u -r1.111 value_moves.c --- engine/value_moves.c 11 Nov 2003 21:48:58 -0000 1.111 +++ engine/value_moves.c 13 Nov 2003 22:26:31 -0000 @@ -3309,7 +3309,7 @@ if (game_status > 0.65 && our_score > 15.0) { - /* We seem to be winning, so we use conservative settings */ + /* We seem to be winning, so we use conservative settings. */ minimum_value_weight = 0.66; maximum_value_weight = 2.0; territorial_weight = 0.95; @@ -3322,7 +3322,7 @@ } else if (game_status > 0.16) { - /* We're not winning enough yet, try aggressive settings */ + /* We're not winning enough yet, try aggressive settings. */ minimum_value_weight = 0.66; maximum_value_weight = 2.0; territorial_weight = 1.4; @@ -3336,7 +3336,7 @@ invasion_malus_weight = 0.2; TRACE(" %s is not winning enough, using aggressive settings.\n", - color == WHITE ? "White" : "Black"); + color == WHITE ? "White" : "Black"); } } } Index: interface/gtp.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/interface/gtp.c,v retrieving revision 1.15 diff -u -r1.15 gtp.c --- interface/gtp.c 21 Jul 2003 16:33:19 -0000 1.15 +++ interface/gtp.c 13 Nov 2003 22:26:32 -0000 @@ -166,7 +166,7 @@ va_list ap; va_start(ap, fmt); - for (; *fmt ; ++fmt) { + for (; *fmt; ++fmt) { if (*fmt == '%') { switch (*++fmt) { case 'c': @@ -190,7 +190,7 @@ } case 's': { - char *s = va_arg(ap, char*); + char *s = va_arg(ap, char *); fputs(s, stdout); break; } Index: interface/main.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/interface/main.c,v retrieving revision 1.86 diff -u -r1.86 main.c --- interface/main.c 1 Oct 2003 14:36:39 -0000 1.86 +++ interface/main.c 13 Nov 2003 22:26:32 -0000 @@ -943,16 +943,16 @@ return EXIT_SUCCESS; break; - /* NOTE: getopt returns '?' if an illegal option is supplied. */ - case OPT_PRINT_LEVELS: { int lev; - for(lev = 10; lev > 0; lev--) + for (lev = 10; lev > 0; lev--) set_depth_values(lev, 1); } return EXIT_SUCCESS; break; + + /* NOTE: getopt returns '?' if an illegal option is supplied. */ case '?': default: Index: interface/play_ascii.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/interface/play_ascii.c,v retrieving revision 1.44 diff -u -r1.44 play_ascii.c --- interface/play_ascii.c 7 Sep 2003 23:02:45 -0000 1.44 +++ interface/play_ascii.c 13 Nov 2003 22:26:33 -0000 @@ -224,7 +224,7 @@ pos_is_move = 128; else pos_is_move = 0; - dead = (dragon_status(POS(i, j))==DEAD) && showdead; + dead = (dragon_status(POS(i, j)) == DEAD) && showdead; switch (BOARD(i, j) + pos_is_move + last_pos_was_move) { case EMPTY+128: case EMPTY: @@ -632,11 +632,11 @@ line_ptr = line; if (!fgets(line, 80, stdin)) { printf("\nThanks! for playing GNU Go.\n\n"); - return ; + return; } - while (state == 0 && - (command = strtok(line_ptr, ";"), line_ptr = 0, command)) { + while (state == 0 + && (command = strtok(line_ptr, ";"), line_ptr = 0, command)) { /* Get the command or move. */ switch (get_command(command)) { case RESIGN: @@ -1270,7 +1270,7 @@ break; } else if (string_to_location(board_size, line, &x, &y)) { - pos = POS(x,y); + pos = POS(x, y); if (board[pos] != EMPTY) printf("\nThere's already a stone there.\n"); else { Index: interface/play_gmp.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/interface/play_gmp.c,v retrieving revision 1.25 diff -u -r1.25 play_gmp.c --- interface/play_gmp.c 7 Sep 2003 23:02:45 -0000 1.25 +++ interface/play_gmp.c 13 Nov 2003 22:26:33 -0000 @@ -92,11 +92,11 @@ message = gmp_check(ge, 1, NULL, NULL, &error); } while (message == gmp_nothing || message == gmp_reset); - if (message == gmp_err) { + if (message == gmp_err) { fprintf(stderr, "gnugo-gmp: Error \"%s\" occurred.\n", error); exit(EXIT_FAILURE); } - else if (message != gmp_newGame) { + else if (message != gmp_newGame) { fprintf(stderr, "gnugo-gmp: Expecting a newGame, got %s\n", gmp_resultString(message)); exit(EXIT_FAILURE); Index: interface/play_gtp.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/interface/play_gtp.c,v retrieving revision 1.134 diff -u -r1.134 play_gtp.c --- interface/play_gtp.c 4 Nov 2003 22:16:35 -0000 1.134 +++ interface/play_gtp.c 13 Nov 2003 22:26:35 -0000 @@ -69,12 +69,17 @@ #define DECLARE(func) static int func(char *s) DECLARE(gtp_aa_confirm_safety); +DECLARE(gtp_accurate_approxlib); +DECLARE(gtp_accuratelib); DECLARE(gtp_all_legal); DECLARE(gtp_analyze_eyegraph); +DECLARE(gtp_analyze_semeai); +DECLARE(gtp_analyze_semeai_after_move); DECLARE(gtp_attack); DECLARE(gtp_attack_either); DECLARE(gtp_block_off); DECLARE(gtp_break_in); +DECLARE(gtp_captures); DECLARE(gtp_clear_board); DECLARE(gtp_clear_cache); DECLARE(gtp_combination_attack); @@ -86,30 +91,32 @@ DECLARE(gtp_defend); DECLARE(gtp_defend_both); DECLARE(gtp_disconnect); +DECLARE(gtp_does_surround); DECLARE(gtp_dragon_data); DECLARE(gtp_dragon_status); DECLARE(gtp_dragon_stones); +DECLARE(gtp_draw_search_area); DECLARE(gtp_dump_stack); DECLARE(gtp_echo); DECLARE(gtp_echo_err); +DECLARE(gtp_estimate_score); DECLARE(gtp_eval_eye); -DECLARE(gtp_accuratelib); -DECLARE(gtp_accurate_approxlib); +DECLARE(gtp_experimental_score); DECLARE(gtp_final_score); DECLARE(gtp_final_status); DECLARE(gtp_final_status_list); DECLARE(gtp_findlib); DECLARE(gtp_finish_sgftrace); DECLARE(gtp_fixed_handicap); -DECLARE(gtp_get_handicap); -DECLARE(gtp_get_random_seed); -DECLARE(gtp_set_random_seed); DECLARE(gtp_genmove); DECLARE(gtp_genmove_black); DECLARE(gtp_genmove_white); DECLARE(gtp_get_connection_node_counter); +DECLARE(gtp_get_handicap); +DECLARE(gtp_get_komi); DECLARE(gtp_get_life_node_counter); DECLARE(gtp_get_owl_node_counter); +DECLARE(gtp_get_random_seed); DECLARE(gtp_get_reading_node_counter); DECLARE(gtp_get_trymove_counter); DECLARE(gtp_gg_genmove); @@ -117,23 +124,15 @@ DECLARE(gtp_increase_depths); DECLARE(gtp_influence); DECLARE(gtp_is_legal); +DECLARE(gtp_is_surrounded); DECLARE(gtp_known_command); DECLARE(gtp_ladder_attack); DECLARE(gtp_last_move); -DECLARE(gtp_set_search_diamond); -DECLARE(gtp_reset_search_mask); DECLARE(gtp_limit_search); -DECLARE(gtp_set_search_limit); -DECLARE(gtp_draw_search_area); DECLARE(gtp_list_commands); DECLARE(gtp_list_stones); DECLARE(gtp_loadsgf); DECLARE(gtp_name); -DECLARE(gtp_estimate_score); -DECLARE(gtp_experimental_score); -DECLARE(gtp_analyze_semeai); -DECLARE(gtp_analyze_semeai_after_move); -DECLARE(gtp_tactical_analyze_semeai); DECLARE(gtp_owl_attack); DECLARE(gtp_owl_connection_defends); DECLARE(gtp_owl_defend); @@ -148,42 +147,43 @@ DECLARE(gtp_playwhite); DECLARE(gtp_popgo); DECLARE(gtp_printsgf); -DECLARE(gtp_captures); +DECLARE(gtp_program_version); DECLARE(gtp_protocol_version); DECLARE(gtp_query_boardsize); DECLARE(gtp_query_orientation); DECLARE(gtp_quit); -DECLARE(gtp_restricted_genmove); DECLARE(gtp_reg_genmove); DECLARE(gtp_report_uncertainty); DECLARE(gtp_reset_connection_node_counter); DECLARE(gtp_reset_life_node_counter); DECLARE(gtp_reset_owl_node_counter); DECLARE(gtp_reset_reading_node_counter); +DECLARE(gtp_reset_search_mask); DECLARE(gtp_reset_trymove_counter); +DECLARE(gtp_restricted_genmove); DECLARE(gtp_same_dragon); -DECLARE(gtp_is_surrounded); -DECLARE(gtp_does_surround); -DECLARE(gtp_surround_map); DECLARE(gtp_set_boardsize); DECLARE(gtp_set_free_handicap); -DECLARE(gtp_set_orientation); DECLARE(gtp_set_komi); -DECLARE(gtp_get_komi); DECLARE(gtp_set_level); +DECLARE(gtp_set_orientation); +DECLARE(gtp_set_random_seed); +DECLARE(gtp_set_search_diamond); +DECLARE(gtp_set_search_limit); DECLARE(gtp_showboard); DECLARE(gtp_start_sgftrace); +DECLARE(gtp_surround_map); +DECLARE(gtp_tactical_analyze_semeai); DECLARE(gtp_test_eyeshape); DECLARE(gtp_time_left); DECLARE(gtp_time_settings); DECLARE(gtp_top_moves); -DECLARE(gtp_top_moves_white); DECLARE(gtp_top_moves_black); -DECLARE(gtp_trymove); +DECLARE(gtp_top_moves_white); DECLARE(gtp_tryko); +DECLARE(gtp_trymove); DECLARE(gtp_tune_move_ordering); DECLARE(gtp_undo); -DECLARE(gtp_program_version); DECLARE(gtp_what_color); DECLARE(gtp_worm_cutstone); DECLARE(gtp_worm_data); @@ -192,14 +192,18 @@ /* List of known commands. */ static struct gtp_command commands[] = { {"aa_confirm_safety", gtp_aa_confirm_safety}, + {"accurate_approxlib", gtp_accurate_approxlib}, + {"accuratelib", gtp_accuratelib}, {"all_legal", gtp_all_legal}, {"analyze_eyegraph", gtp_analyze_eyegraph}, + {"analyze_semeai", gtp_analyze_semeai}, + {"analyze_semeai_after_move", gtp_analyze_semeai_after_move}, {"attack", gtp_attack}, {"attack_either", gtp_attack_either}, {"black", gtp_playblack}, {"block_off", gtp_block_off}, - {"break_in", gtp_break_in}, {"boardsize", gtp_set_boardsize}, + {"break_in", gtp_break_in}, {"captures", gtp_captures}, {"clear_board", gtp_clear_board}, {"clear_cache", gtp_clear_cache}, @@ -213,60 +217,54 @@ {"defend", gtp_defend}, {"defend_both", gtp_defend_both}, {"disconnect", gtp_disconnect}, + {"does_surround", gtp_does_surround}, {"dragon_data", gtp_dragon_data}, {"dragon_status", gtp_dragon_status}, {"dragon_stones", gtp_dragon_stones}, + {"draw_search_area", gtp_draw_search_area}, {"dump_stack", gtp_dump_stack}, {"echo" , gtp_echo}, {"echo_err" , gtp_echo_err}, {"estimate_score", gtp_estimate_score}, - {"accuratelib", gtp_accuratelib}, - {"accurate_approxlib", gtp_accurate_approxlib}, - {"experimental_score", gtp_experimental_score}, {"eval_eye", gtp_eval_eye}, + {"experimental_score", gtp_experimental_score}, {"final_score", gtp_final_score}, {"final_status", gtp_final_status}, {"final_status_list", gtp_final_status_list}, {"findlib", gtp_findlib}, {"finish_sgftrace", gtp_finish_sgftrace}, {"fixed_handicap", gtp_fixed_handicap}, - {"get_handicap", gtp_get_handicap}, - {"get_random_seed", gtp_get_random_seed}, - {"set_random_seed", gtp_set_random_seed}, {"genmove", gtp_genmove}, {"genmove_black", gtp_genmove_black}, {"genmove_white", gtp_genmove_white}, {"get_connection_node_counter", gtp_get_connection_node_counter}, + {"get_handicap", gtp_get_handicap}, + {"get_komi", gtp_get_komi}, {"get_life_node_counter", gtp_get_life_node_counter}, {"get_owl_node_counter", gtp_get_owl_node_counter}, + {"get_random_seed", gtp_get_random_seed}, {"get_reading_node_counter",gtp_get_reading_node_counter}, {"get_trymove_counter", gtp_get_trymove_counter}, - {"gg_genmove", gtp_gg_genmove}, {"gg-undo", gtp_gg_undo}, + {"gg_genmove", gtp_gg_genmove}, {"help", gtp_list_commands}, {"increase_depths", gtp_increase_depths}, {"influence", gtp_influence}, {"is_legal", gtp_is_legal}, + {"is_surrounded", gtp_is_surrounded}, {"known_command", gtp_known_command}, {"komi", gtp_set_komi}, - {"get_komi", gtp_get_komi}, {"ladder_attack", gtp_ladder_attack}, {"last_move", gtp_last_move}, {"level", gtp_set_level}, - {"set_search_diamond", gtp_set_search_diamond}, - {"reset_search_mask", gtp_reset_search_mask}, - {"limit_search", gtp_limit_search}, - {"set_search_limit", gtp_set_search_limit}, - {"draw_search_area", gtp_draw_search_area}, {"limit_search", gtp_limit_search}, + {"limit_search", gtp_limit_search}, {"list_commands", gtp_list_commands}, {"list_stones", gtp_list_stones}, {"loadsgf", gtp_loadsgf}, {"name", gtp_name}, {"new_score", gtp_estimate_score}, - {"analyze_semeai", gtp_analyze_semeai}, - {"analyze_semeai_after_move", gtp_analyze_semeai_after_move}, - {"tactical_analyze_semeai", gtp_tactical_analyze_semeai}, + {"orientation", gtp_set_orientation}, {"owl_attack", gtp_owl_attack}, {"owl_connection_defends", gtp_owl_connection_defends}, {"owl_defend", gtp_owl_defend}, @@ -275,38 +273,40 @@ {"owl_substantial", gtp_owl_substantial}, {"owl_threaten_attack", gtp_owl_threaten_attack}, {"owl_threaten_defense", gtp_owl_threaten_defense}, + {"place_free_handicap", gtp_place_free_handicap}, {"play", gtp_play}, {"popgo", gtp_popgo}, {"printsgf", gtp_printsgf}, - {"orientation", gtp_set_orientation}, - {"place_free_handicap", gtp_place_free_handicap}, {"protocol_version", gtp_protocol_version}, {"query_boardsize", gtp_query_boardsize}, {"query_orientation", gtp_query_orientation}, {"quit", gtp_quit}, - {"restricted_genmove", gtp_restricted_genmove}, {"reg_genmove", gtp_reg_genmove}, {"report_uncertainty", gtp_report_uncertainty}, {"reset_connection_node_counter", gtp_reset_connection_node_counter}, {"reset_life_node_counter", gtp_reset_life_node_counter}, {"reset_owl_node_counter", gtp_reset_owl_node_counter}, {"reset_reading_node_counter", gtp_reset_reading_node_counter}, + {"reset_search_mask", gtp_reset_search_mask}, {"reset_trymove_counter", gtp_reset_trymove_counter}, + {"restricted_genmove", gtp_restricted_genmove}, {"same_dragon", gtp_same_dragon}, {"set_free_handicap", gtp_set_free_handicap}, + {"set_random_seed", gtp_set_random_seed}, + {"set_search_diamond", gtp_set_search_diamond}, + {"set_search_limit", gtp_set_search_limit}, {"showboard", gtp_showboard}, - {"is_surrounded", gtp_is_surrounded}, - {"does_surround", gtp_does_surround}, - {"surround_map", gtp_surround_map}, {"start_sgftrace", gtp_start_sgftrace}, + {"surround_map", gtp_surround_map}, + {"tactical_analyze_semeai", gtp_tactical_analyze_semeai}, {"test_eyeshape", gtp_test_eyeshape}, {"time_left", gtp_time_left}, {"time_settings", gtp_time_settings}, {"top_moves", gtp_top_moves}, {"top_moves_black", gtp_top_moves_black}, {"top_moves_white", gtp_top_moves_white}, - {"trymove", gtp_trymove}, {"tryko", gtp_tryko}, + {"trymove", gtp_trymove}, {"tune_move_ordering", gtp_tune_move_ordering}, {"undo", gtp_undo}, {"version", gtp_program_version}, Index: patterns/defense.db =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/defense.db,v retrieving revision 1.12 diff -u -r1.12 defense.db --- patterns/defense.db 12 Aug 2003 21:38:27 -0000 1.12 +++ patterns/defense.db 13 Nov 2003 22:26:35 -0000 @@ -395,3 +395,4 @@ ----- :8,D + Index: patterns/extract_fuseki.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/extract_fuseki.c,v retrieving revision 1.18 diff -u -r1.18 extract_fuseki.c --- patterns/extract_fuseki.c 1 Sep 2003 19:30:11 -0000 1.18 +++ patterns/extract_fuseki.c 13 Nov 2003 22:26:35 -0000 @@ -572,7 +572,7 @@ winning_moves[k].pattern[m][n] = '*'; /* add ? in areas far away from the move */ if (half_board_patterns == 1 && move_number > 3 && board_size == 19) - region = find_region(m,n); + region = find_region(m, n); if (region != 8) { for (i = 0; i < board_size; i++) { for (j = 0; j < board_size; j++) { Index: patterns/fuseki.db =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/fuseki.db,v retrieving revision 1.34 diff -u -r1.34 fuseki.db --- patterns/fuseki.db 4 Nov 2003 13:00:54 -0000 1.34 +++ patterns/fuseki.db 13 Nov 2003 22:26:36 -0000 @@ -1788,7 +1788,7 @@ :8,Fj -|..xxx.........xxx..| wariuchi +|..xxx.........xxx..| |..xxx.........abc..| |..xxx.........def..| |..Xxx....*....ghi..| @@ -1811,7 +1811,7 @@ :8,Fj -|..xxx.........xxx..| wariuchi +|..xxx.........xxx..| |..xxx.........abc..| |..xxx.........def..| |..xXx....*....ghi..| @@ -1834,7 +1834,7 @@ :8,Fj -|..xxx.........xxx..| wariuchi +|..xxx.........xxx..| |..xxx.........abc..| |..xxx.........def..| |..xxX....*....ghi..| @@ -1845,7 +1845,6 @@ ; x_somewhere(a,b,c,d,e,f,g,h,i) - Pattern F815 |..xxx.........xxx..| wariuchi @@ -1869,7 +1868,6 @@ ; x_somewhere(a,b,c,d,e,f,g,h,i) - Pattern F816 |..xxx.........xxx..| wariuchi @@ -1891,7 +1889,6 @@ +-------------------+ ; x_somewhere(a,b,c,d,e,f,g,h,i) - ################ Index: patterns/helpers.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/helpers.c,v retrieving revision 1.56 diff -u -r1.56 helpers.c --- patterns/helpers.c 23 Aug 2003 14:04:25 -0000 1.56 +++ patterns/helpers.c 13 Nov 2003 22:26:36 -0000 @@ -25,7 +25,7 @@ #define TRYMOVE(pos, color) trymove(pos, color, "helper", NO_MOVE, EMPTY, NO_MOVE) -#define OFFSET_BY(x, y) AFFINE_TRANSFORM(OFFSET(x,y), trans, move) +#define OFFSET_BY(x, y) AFFINE_TRANSFORM(OFFSET(x, y), trans, move) #define ARGS struct pattern *pattern, int trans, int move, int color Index: patterns/mkpat.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/mkpat.c,v retrieving revision 1.125 diff -u -r1.125 mkpat.c --- patterns/mkpat.c 12 Oct 2003 03:07:51 -0000 1.125 +++ patterns/mkpat.c 13 Nov 2003 22:26:38 -0000 @@ -231,7 +231,7 @@ {"does_attack", 2, 0, 1.00, "does_attack(%s, %s)"}, {"attack", 1, 0, 1.00, "ATTACK_MACRO(%s)"}, {"defend", 1, 0, 1.00, "DEFEND_MACRO(%s)"}, - {"weak", 1, 0, 0.01, "DRAGON_WEAK(%s)"}, + {"weak", 1, 0, 0.01, "dragon_weak(%s)"}, {"safe_xmove", 1, 0, 1.00, "safe_move(%s, OTHER_COLOR(color))"}, {"safe_omove", 1, 0, 1.00, "safe_move(%s, color)"}, {"legal_xmove", 1, 0, 0.05, "is_legal(%s, OTHER_COLOR(color))"}, @@ -752,7 +752,7 @@ } /* count the number of -'s */ - for (width = 0; *p == '-' ; ++p, ++width) + for (width = 0; *p == '-'; ++p, ++width) ; if (width == 0) @@ -1646,7 +1646,9 @@ static int compare_elements(const void *a, const void *b) { - static char order[] = {7,2,3,5,6,0,4,1}; /* score for each attribute */ + /* score for each attribute */ + static char order[] = {7, 2, 3, 5, 6, 0, 4, 1}; + return order[((const struct patval_b *)a)->att] - order[((const struct patval_b *)b)->att]; } @@ -1669,9 +1671,9 @@ int bx = pb->x - ci; int ay = pa->y - cj; int by = pb->y - cj; - int metric = (ax*ax + ay*ay) - (bx*bx + by*by) ; + int metric = (ax*ax + ay*ay) - (bx*bx + by*by); if (metric == 0) - return -compare_elements(a,b); + return -compare_elements(a, b); else return metric; } @@ -2085,10 +2087,10 @@ if (gn->matches) { struct match_node *m = gn->matches->next; if (pass == PASS_FILL) { - tnl_dump[tnl_count].node.matches = (void*)mn_count; + tnl_dump[tnl_count].node.matches = (void *) mn_count; matches_dump[mn_count].patnum = -1; /*Unused*/ matches_dump[mn_count].orientation = 0; /*Unused*/ - matches_dump[mn_count].next = (void*)(mn_count + 1); + matches_dump[mn_count].next = (void *) (mn_count + 1); } if (as_text) @@ -2100,7 +2102,7 @@ matches_dump[mn_count].patnum = m->patnum; matches_dump[mn_count].orientation = m->orientation; if (m->next) - matches_dump[mn_count].next = (void*)(mn_count + 1); + matches_dump[mn_count].next = (void *) (mn_count + 1); else matches_dump[mn_count].next = 0; } @@ -2125,7 +2127,7 @@ if (gl) { int prev_tnl_count = tnl_count; if (pass == PASS_FILL) { - tnl_dump[tnl_count].node.next_list = (void*)(tnl_count+1); + tnl_dump[tnl_count].node.next_list = (void *) (tnl_count + 1); /*tnl_dump[tnl_count+1].node data is unused.*/ tnl_dump[tnl_count+1].node.matches = 0; /*Unused*/ tnl_dump[tnl_count+1].node.att = -1; /*Unused*/ @@ -2138,14 +2140,14 @@ tnl_count++; while (gl->next) { if (pass == PASS_FILL) - tnl_dump[prev_tnl_count+1].next = (void*)(tnl_count+1); + tnl_dump[prev_tnl_count+1].next = (void *) (tnl_count + 1); prev_tnl_count = tnl_count; - dump_tree_node(outfile, &gl->next->node, depth+1, pass); + dump_tree_node(outfile, &gl->next->node, depth + 1, pass); gl = gl->next; } if (pass == PASS_FILL) - tnl_dump[prev_tnl_count+1].next = 0; + tnl_dump[prev_tnl_count + 1].next = 0; } else { if (pass == PASS_FILL) { @@ -2180,13 +2182,13 @@ tnl_dump = malloc(sizeof(struct tree_node_list) * tnl_count); matches_dump = malloc(sizeof(struct match_node) * mn_count); - tnl_dump[0].next = (void*)1; /* X anchor node */ + tnl_dump[0].next = (void *) 1; /* X anchor node */ tnl_dump[0].node.att = -1; /* Not used */ tnl_dump[0].node.matches = 0; /* Not used */ tnl_dump[0].node.x = -99; /* Not used */ tnl_dump[0].node.y = -99; /* Not used */ tnl_dump[0].node.next_list = 0; /* Not used */ - tnl_dump[1].next = (void*) oanchor_index; + tnl_dump[1].next = (void *) oanchor_index; tnl_dump[oanchor_index].next = 0; mn_count = 1; @@ -2197,7 +2199,7 @@ fprintf(outfile, "struct tree_node_list tnl_%s[] =\n{\n", prefix); for (i = 0; i < tnl_count+1; i++) { fprintf(outfile, - " { {(void*)%d, %d, %d, %d, (void*)%d}, (void*)%d}, /*#%d*/\n", + " { {(void *)%d, %d, %d, %d, (void *)%d}, (void *)%d}, /*#%d*/\n", (int)tnl_dump[i].node.matches, tnl_dump[i].node.att, tnl_dump[i].node.x, @@ -2210,7 +2212,7 @@ fprintf(outfile, "struct match_node matches_%s[] = \n{\n", prefix); for (i = 0; i < mn_count; i++) { - fprintf(outfile, " {%d, %d, (void*)%d}, /*#%d*/\n", + fprintf(outfile, " {%d, %d, (void *)%d}, /*#%d*/\n", matches_dump[i].patnum, matches_dump[i].orientation, (int) matches_dump[i].next, Index: patterns/owl_attackpats.db =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/owl_attackpats.db,v retrieving revision 1.97 diff -u -r1.97 owl_attackpats.db --- patterns/owl_attackpats.db 11 Nov 2003 21:48:59 -0000 1.97 +++ patterns/owl_attackpats.db 13 Nov 2003 22:26:39 -0000 @@ -2079,7 +2079,6 @@ :8,-,value(5) - ######################################################### # # # Eye reducing moves on the first line # @@ -2426,22 +2425,19 @@ Pattern A621 # spl added 3.3.22 - ?XOo? threaten to make ko or nakade X..*. ----- :8,s,value(10) -?AOo? threaten to make ko or nakade +?AOo? X..*. ----- ;lib(A)<3 - - ######################################################### # # # Eye reducing moves in the center # @@ -2774,7 +2770,7 @@ ?c?? Ya.x -X*bx +X*Ox ?... ?OO? @@ -5406,7 +5402,7 @@ # See ld_owl:68. |XXX? try to kill without ko -|O.X? +|O.X? |X.YX |.*.O +---- @@ -5414,7 +5410,7 @@ :8,s,value(75) |AAA? -|O.A? +|O.A? |X.AA |.*.O +---- Index: patterns/owl_defendpats.db =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/owl_defendpats.db,v retrieving revision 1.106 diff -u -r1.106 owl_defendpats.db --- patterns/owl_defendpats.db 11 Nov 2003 21:48:59 -0000 1.106 +++ patterns/owl_defendpats.db 13 Nov 2003 22:26:41 -0000 @@ -2435,7 +2435,7 @@ :8,-,value(70) -BXA +BBA .*. --- Index: patterns/owl_vital_apats.db =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/owl_vital_apats.db,v retrieving revision 1.40 diff -u -r1.40 owl_vital_apats.db --- patterns/owl_vital_apats.db 18 Jul 2003 18:59:22 -0000 1.40 +++ patterns/owl_vital_apats.db 13 Nov 2003 22:26:41 -0000 @@ -904,7 +904,7 @@ # See ld_owl:68. |XXX nakade if X cannot squeeze -|O.X +|O.X |XOX |*OX +--- @@ -912,7 +912,7 @@ :8,s,value(75) |AAA -|O.A +|O.A |XOA |*OA +--- Index: patterns/patlib.h =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/patlib.h,v retrieving revision 1.7 diff -u -r1.7 patlib.h --- patterns/patlib.h 18 Jul 2003 18:59:22 -0000 1.7 +++ patterns/patlib.h 13 Nov 2003 22:26:41 -0000 @@ -72,16 +72,16 @@ char *comment6; } Textpattern; -extern void textpattern_clear(Textpattern *tp); -extern void textpattern_print(FILE *outfile, Textpattern *tp); -extern void parse_init(char *filename, FILE *file); -extern int parse_whitespace(int to_end_of_line_only); -extern char *get_whitespace(void); -extern int textpattern_parse(FILE *infile, - int parm_pattern_type, int parm_anchor_both, - int parm_fullboard, int parm_verbose, - Textpattern *tp); -extern void textpattern_transform(Textpattern *tp, int transform); +void textpattern_clear(Textpattern *tp); +void textpattern_print(FILE *outfile, Textpattern *tp); +void parse_init(char *filename, FILE *file); +int parse_whitespace(int to_end_of_line_only); +char *get_whitespace(void); +int textpattern_parse(FILE *infile, + int parm_pattern_type, int parm_anchor_both, + int parm_fullboard, int parm_verbose, + Textpattern *tp); +void textpattern_transform(Textpattern *tp, int transform); extern const int transformations[8][2][2]; Index: patterns/patterns.db =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.db,v retrieving revision 1.117 diff -u -r1.117 patterns.db --- patterns/patterns.db 11 Nov 2003 21:48:59 -0000 1.117 +++ patterns/patterns.db 13 Nov 2003 22:26:44 -0000 @@ -10813,12 +10813,12 @@ :8,dX -oo.b? -.*abD -..cDD +oo.O? +.*aOB +..OBB ----- -;!attack(D) && safe_xmove(a) +;!attack(B) && safe_xmove(a) Pattern ED95 @@ -14432,7 +14432,7 @@ |..? |*.O |b.O -|OcO +|O.O |aO? ;olib(a)==2 && !oplay_attack(a,b,b) Index: patterns/patterns.h =================================================================== RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.h,v retrieving revision 1.58 diff -u -r1.58 patterns.h --- patterns/patterns.h 6 Aug 2003 14:50:52 -0000 1.58 +++ patterns/patterns.h 13 Nov 2003 22:26:44 -0000 @@ -70,9 +70,8 @@ }; -#define ATTACK_MACRO(pos) ((stackp==0) ? (worm[pos].attack_codes[0]) : attack(pos, NULL)) -#define DEFEND_MACRO(pos) ((stackp==0) ? (worm[pos].defense_codes[0]) : find_defense(pos, NULL)) -#define DRAGON_WEAK(pos) dragon_weak(pos) +#define ATTACK_MACRO(pos) ((stackp == 0) ? (worm[pos].attack_codes[0]) : attack(pos, NULL)) +#define DEFEND_MACRO(pos) ((stackp == 0) ? (worm[pos].defense_codes[0]) : find_defense(pos, NULL)) struct pattern; /* forward reference to keep gcc happy */ Index: utils/gg_utils.c =================================================================== RCS file: /cvsroot/gnugo/gnugo/utils/gg_utils.c,v retrieving revision 1.32 diff -u -r1.32 gg_utils.c --- utils/gg_utils.c 18 Jul 2003 18:59:22 -0000 1.32 +++ utils/gg_utils.c 13 Nov 2003 22:26:46 -0000 @@ -428,7 +428,7 @@ float soft_cap(float a, float b) { - return ((a * b) / ( a + b)); + return ((a * b) / (a + b)); }