[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] sgf cleaning
From: |
Gunnar Farneback |
Subject: |
[gnugo-devel] sgf cleaning |
Date: |
Tue, 10 Sep 2002 21:57:41 +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) |
My turn to do a little cleaning in the sgf swamp. I've put up a patch
at http://www.lysator.liu.se/~gunnar/gnugo/patches/gunnar_3_9.3
Primarily this patch changes the call convention of the sgftree*
functions. Currently they look like
SGFNode *sgftreeAddComment(SGFTree *tree, SGFNode *node, const char *comment);
However, in all existing calls the node parameter is NULL and the
return value is almost always discarded. Furthermore in the case with
node != NULL there is essentially no use for the tree parameter so the
corresponding sgf* function can be called instead. Also the return
value can always be found by other means and is not needed. To
conclude I have changed the return type to void and removed the node
parameter from the sgftree* functions.
Other changes include
* sgffile_debuginfo() has been renamed to sgffile_add_debuginfo().
* sgffile_output() takes an SGFTree* instead of an SGFNode* since we
always want write a tree to file. This function also needs a better
name.
* sgftreeCreateHeaderNode() also sets the lastnode field to point to
the root node.
* --color effective for --score finish and --score aftermath.
* Code in play_solo.c and play_gmp.c make use of the sgftree struct
and corresponding functions. As an automatic bonus the sgf files
created by --score aftermath are no longer broken.
The last change should also be made in play_ascii.c but I haven't
started with that.
- new call convention for sgftree* functions
- sgftreeCreateHeaderNode() revised
- sgffile_debuginfo() renamed to sgffile_add_debuginfo()
- new call convention for sgffile_output()
- --color option effective in scoring mode
- sgftree struct and functions consistently used in play_gmp(),
play_solo(), load_and_analyze_sgf_file(), and load_and_score_sgf_file()
/Gunnar
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnugo-devel] sgf cleaning,
Gunnar Farneback <=