From d1f1621c8443845c91766670c500d5203f7b8bd5 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 7 Nov 2013 22:08:14 +0100 Subject: [PATCH 01/16] Update TODO: there are plans for v1.5, and things have been done. --- TODO | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 39b8aa5..921fa4c 100644 --- a/TODO +++ b/TODO @@ -1,11 +1,17 @@ +Target for v1.5: + +- refactor dspwrappers into a driver-like structure +- integrate H.G.Muller's work on the xboard protocol on top of that +- deprecate xshogi in favor of xboard +- make minishogi a run-time option rather than a compile-time one, + using the "variant" mechanism of the xboard protocol + Generic cleanups - switch cli parsing to getopt - hunt for extern's and prototypes spread all over the source - merge old Makefile.profile.in back into Makefile.in if meaningful at all - use automake -- drop gnushogi.lng, merge strings back into code -- use version from configure.ac, get rid of version.h, drop patchlevel - hunt for more hardcoded variant-specific constants - position of captured pieces in curses mode - compile with bound-checker @@ -17,7 +23,6 @@ Generic cleanups Minishogi-related stuff -- make minishogi a run-time option rather than a compile-time one - minishogi patterns - tune difficulty levels - other tunings to investigate -- 1.7.0.4 From 5acbe6e52b68194097b9d5127a412cbd1c28e509 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 7 Nov 2013 22:23:27 +0100 Subject: [PATCH 02/16] Update manual for maintainer, project communication, and plans. --- doc/gnushogi.texinfo | 40 ++++++++++++++++++++++------------------ 1 files changed, 22 insertions(+), 18 deletions(-) diff --git a/doc/gnushogi.texinfo b/doc/gnushogi.texinfo index 2b18bc7..ddf6033 100644 --- a/doc/gnushogi.texinfo +++ b/doc/gnushogi.texinfo @@ -33,6 +33,7 @@ This file describes how to use GNU shogi, a program which plays Shogi (Japanese chess). +Copyright (C) 2013 Yann Dirson and the Free Software Foundation, Inc. Copyright (C) 1999 Michael C. Vanier and the Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of @@ -76,6 +77,7 @@ by the Free Software Foundation. @c The following two commands start the copyright page. @page @vskip 0pt plus 1filll +Copyright @copyright{} 2013 Yann Dirson and the Free Software Foundation Copyright @copyright{} 1999 Michael C. Vanier and the Free Software Foundation @end titlepage @@ -127,22 +129,23 @@ GNU shogi is a program that plays shogi, the Japanese version of chess, against a human (or computer) opponent. This file describes how to use GNU shogi and also gives background information about the game of shogi. -This file describes GNU shogi version 1.3.2. It was written by me, Mike -Vanier, the current maintainer of GNU shogi. My email address is -@email{mvanier@@cs.caltech.edu}. +This file describes GNU Shogi version 1.3.2. It was written by Mike +Vanier @email{mvanier@@cs.caltech.edu}, maintainer of GNU shogi at +that time. +GNU Shogi is currently maintained by Yann Dirson +@email{ydirson@@free.fr}. -GNU Shogi is actually two programs: -@table @samp - -@item gnushogi -is the text-based program which also contains the game-playing engine. +GNU Shogi is actually one program, 'gnushogi', the text-based program +which also contains the game-playing engine. -@item xshogi -is the X-windows graphical interface to gnushogi. - -@end table +The GNU Shogi distribution also contains the 'xshogi' program, an +X-Window graphical interface to gnushogi. XShogi was forked off GNU +XBoard years ago, is far from today's UI standards, and has barely +been maintained recently, while XBoard has grown much and is able to +play Shogi. In future versions, GNU Shogi will be able to use XBoard +as a GUI and XShogi will be retired. Since xshogi invokes gnushogi, most players will just type ``xshogi'' and start playing. @@ -2143,12 +2146,13 @@ program. @node Bugs, Index, Acknowledgements, Top @chapter Bugs -The motto of GNU shogi is ``100% bug-free or you don't pay!'' :-) In the -extremely unlikely case (*ahem*) that you do find a bug, please send me -(Mike Vanier) an email at @email{mvanier@@cs.caltech.edu}. Also, feel -free to send me comments, complaints, out-and-out raves, suggestions, -plane tickets to Hawaii, and/or large suitcases filled with unmarked, -untraceable hundred-dollar bills. +The motto of GNU shogi is ``100% bug-free or you don't pay!'' :-) In +the extremely unlikely case (*ahem*) that you do find a bug, please +report it to the bug tracker at +@uref{https://savannah.gnu.org/projects/gnushogi/}. Also, feel free +to post comments, complaints, out-and-out raves, suggestions and such +to one of the mailing lists at +@uref{https://savannah.gnu.org/mail/?group=gnushogi}. @c ============ -- 1.7.0.4 From 4d9929fd417def4018cd25287ecd994ef5374d09 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 7 Nov 2013 22:24:01 +0100 Subject: [PATCH 03/16] Prepare v1.4.1rc0. --- NEWS | 4 ++-- README | 27 +++++++++++++++------------ configure.ac | 2 +- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/NEWS b/NEWS index 43dac7c..ffdc61b 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,6 @@ GNU shogi news -------------- -This file starts with GNU Shogi 1.3 (07/01/1999). - Changes in version 1.4.1 (unpublished): * Initial support for the MiniShogi variant, for now as a separate @@ -57,3 +55,5 @@ Changes in version 1.3 (07/1999): The man page is included in the texinfo file. The (separate) man pages have been updated to deal with the new command-line options for gnushogi. + +This file starts with GNU Shogi 1.3 (07/01/1999). diff --git a/README b/README index e1c96e3..79a0198 100644 --- a/README +++ b/README @@ -1,15 +1,19 @@ -GNU Shogi, release 1.4.0 +GNU Shogi, release 1.4.1 (rc0) ------------------------ -This is release 1.4.0 of GNU shogi, a program which plays shogi (Japanese -chess), as well as xshogi, the graphical interface to GNU shogi. GNU shogi -and xshogi were originally written by Matthias Mutz (mutz@fmi.uni-passau.de), -have been maintained by Mike Vanier (mvanier@bbb.caltech.edu) and are now maintained -by Luis Felipe Strano Moraes (luis.strano@gmail.com). GNU shogi was in turn based on -GNU Chess 4.0, i.e. the first version of GNU Shogi was obtained by "simply" modifying -the chess-specific parts of GNU Chess 4.0. -We would like to thank the authors of GNU Chess 4.0 for making the sources of -that program available. +This is release 1.4.1 of GNU shogi, a program which plays shogi +(Japanese chess), as well as xshogi, the graphical interface to GNU +shogi. + +GNU shogi and xshogi were originally written by Matthias Mutz +, have been maintained by Mike Vanier + in the 1.3.x era, by Luis Felipe Strano +Moraes until 1.4.0, and are now maintained by +Yann Dirson . GNU shogi was in turn based on GNU +Chess 4.0, i.e. the first version of GNU Shogi was obtained by +"simply" modifying the chess-specific parts of GNU Chess 4.0. We +would like to thank the authors of GNU Chess 4.0 for making the +sources of that program available. See the file NEWS for the new features of this release. @@ -19,5 +23,4 @@ on shogi please look at the files in the doc directory or read the info file. Please email bugs, comments, suggestions, and wish lists regarding GNU shogi to me. And enjoy the program :-) -Luis Felipe Strano Moraes (luis.strano@gmail.com) - +Yann Dirson diff --git a/configure.ac b/configure.ac index 42f3f8c..ce314d9 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT([gnushogi],[1.4.0+],[https://savannah.gnu.org/bugs/?group=gnushogi]) +AC_INIT([gnushogi],[1.4.1-rc0],[https://savannah.gnu.org/bugs/?group=gnushogi]) AC_CONFIG_SRCDIR([gnushogi/gnushogi.h]) AC_CONFIG_HEADER(config.h) -- 1.7.0.4 From 467b6aec32e3fa0b2e9f09fa90a7a76f78d61eea Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 5 Dec 2013 21:19:06 +0100 Subject: [PATCH 04/16] Generate HTML doc using makeinfo, instead of obsolecent texi2html --- doc/Makefile.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/doc/Makefile.in b/doc/Makefile.in index 7fd7993..03fbc90 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -18,7 +18,7 @@ pdf: # texi2html. html: - texi2html -split_node $(SRCDIR)/gnushogi.texinfo + makeinfo --html --split=section $(SRCDIR)/gnushogi.texinfo ps: dvi dvips -t letter gnushogi.dvi -o gnushogi.ps -- 1.7.0.4 From c1fb4a980af4b0828653d09fb16641f93b64eced Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 5 Dec 2013 23:03:01 +0100 Subject: [PATCH 05/16] Bump version to "1.4.1-rc0+". --- configure.ac | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index ce314d9..c01d0cf 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT([gnushogi],[1.4.1-rc0],[https://savannah.gnu.org/bugs/?group=gnushogi]) +AC_INIT([gnushogi],[1.4.1-rc0+],[https://savannah.gnu.org/bugs/?group=gnushogi]) AC_CONFIG_SRCDIR([gnushogi/gnushogi.h]) AC_CONFIG_HEADER(config.h) -- 1.7.0.4 From a20e51b7c79f22d3e30aa2a6a7abc73d8c5d85eb Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 5 Dec 2013 23:10:37 +0100 Subject: [PATCH 06/16] Fully quote autoconf macro arguments, as they should. --- configure.ac | 36 ++++++++++++++++++------------------ 1 files changed, 18 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index c01d0cf..bae9d3d 100644 --- a/configure.ac +++ b/configure.ac @@ -47,8 +47,8 @@ AS_IF([test "x$with_curses" != xno], [-ltermcap])]) # other libraries. -AC_CHECK_LIB(m, pow) -AC_CHECK_LIB(termcap, tgoto) +AC_CHECK_LIB([m], [pow]) +AC_CHECK_LIB([termcap], [tgoto]) @@ -107,15 +107,15 @@ AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL AC_CHECK_FUNCS([dup2 gethostname gettimeofday memset pow strcasecmp]) AC_CHECK_FUNCS([strchr strerror strrchr strstr strtol]) -AC_CHECK_FUNCS(memcpy bcopy) -AC_CHECK_FUNCS(setlinebuf setvbuf) +AC_CHECK_FUNCS([memcpy bcopy]) +AC_CHECK_FUNCS([setlinebuf setvbuf]) # # Set various user-definable options. # -AC_ARG_ENABLE(minishogi, +AC_ARG_ENABLE([minishogi], [ --enable-minishogi Build gnuminishogi instead of gnushogi (default: no)], [AC_DEFINE([MINISHOGI], [], [Define to build gnuminishogi instead of gnushogi]) @@ -130,36 +130,36 @@ SECOND_SHOGI_PROGRAM=gnushogi FIRST_HOST=localhost SECOND_HOST=localhost -AC_ARG_ENABLE(xshogi, +AC_ARG_ENABLE([xshogi], AS_HELP_STRING([--enable-xshogi], [compile the xshogi graphical interface to GNU shogi (default: no)]), -enable_xshogi=$enableval, -enable_xshogi=no) +[enable_xshogi=$enableval], +[enable_xshogi=no]) -AC_ARG_WITH(top-part-bitmaps, +AC_ARG_WITH([top-part-bitmaps], AS_HELP_STRING([--with-top-part-bitmaps], [use top part of Kanji bitmaps only in xshogi]), -OPT=-DTOP_PART_BITMAPS) +[OPT=-DTOP_PART_BITMAPS]) -AC_ARG_WITH(first-shogi-program, +AC_ARG_WITH([first-shogi-program], AS_HELP_STRING([--with-first-shogi-program=PROGNAME], [use PROGNAME as the first shogi program in xshogi (default: gnushogi)]), -FIRST_SHOGI_PROGRAM=$withval) +[FIRST_SHOGI_PROGRAM=$withval]) -AC_ARG_WITH(second-shogi-program, +AC_ARG_WITH([second-shogi-program], AS_HELP_STRING([--with-second-shogi-program=PROGNAME], [use PROGNAME as the second shogi program in xshogi (default: gnushogi)]), -SECOND_SHOGI_PROGRAM=$withval) +[SECOND_SHOGI_PROGRAM=$withval]) -AC_ARG_WITH(first-host, +AC_ARG_WITH([first-host], AS_HELP_STRING([--with-first-host=HOSTNAME], [use HOSTNAME as the machine on which the first shogi program runs in xshogi (default: localhost)]), -FIRST_HOST=$withval) +[FIRST_HOST=$withval]) -AC_ARG_WITH(second-host, +AC_ARG_WITH([second-host], AS_HELP_STRING([--with-second-host=HOSTNAME], [use HOSTNAME as the machine on which the second shogi program runs in xshogi (default: localhost)]), -SECOND_HOST=$withval) +[SECOND_HOST=$withval]) AC_SUBST(OPT) AC_SUBST(FIRST_SHOGI_PROGRAM) -- 1.7.0.4 From d5dcedec28a48ae3b1eb8151eb4f8070ff92b3e4 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 5 Dec 2013 23:13:44 +0100 Subject: [PATCH 07/16] Use POSIX setvbuf in preference to BSD setlinebuf. This avoids implicit declaration of setlinebuf with GNU libc, which would have required to define _BSD_SOURCE just to get rid of, and is not an innocuous setting. Drop call to no-op AC_FUNC_SETVBUF_REVERSED at the same time. --- configure.ac | 3 +-- gnushogi/rawdsp.c | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index bae9d3d..923ec35 100644 --- a/configure.ac +++ b/configure.ac @@ -103,12 +103,11 @@ AC_MSG_NOTICE([library functions]) AC_FUNC_FORK AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC -AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL AC_CHECK_FUNCS([dup2 gethostname gettimeofday memset pow strcasecmp]) AC_CHECK_FUNCS([strchr strerror strrchr strstr strtol]) AC_CHECK_FUNCS([memcpy bcopy]) -AC_CHECK_FUNCS([setlinebuf setvbuf]) +AC_CHECK_FUNCS([setvbuf setlinebuf]) # diff --git a/gnushogi/rawdsp.c b/gnushogi/rawdsp.c index 5c4d45d..8337d41 100644 --- a/gnushogi/rawdsp.c +++ b/gnushogi/rawdsp.c @@ -223,13 +223,13 @@ Raw_Initialize(void) /* needed because of inconsistency between MSVC run-time system and gcc includes */ setbuf(stdout, NULL); #else -#ifdef HAVE_SETLINEBUF - setlinebuf(stdout); -#else -# ifdef HAVE_SETVBUF +#ifdef HAVE_SETVBUF setvbuf(stdout, NULL, _IOLBF, BUFSIZ); +#else +# ifdef HAVE_SETLINEBUF + setlinebuf(stdout); # else -# error "Need setlinebuf() or setvbuf() to compile gnushogi!" +# error "Need setvbuf() or setlinebuf() to compile gnushogi!" # endif #endif #endif -- 1.7.0.4 From 4f565f2015c84ab0d9432ce077de82283ffbd35b Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 5 Dec 2013 23:18:31 +0100 Subject: [PATCH 08/16] #define _POSIX_C_SOURCE to get proper access to snprintf and vsnprintf. --- gnushogi/commondsp.c | 4 ++++ gnushogi/cursesdsp.c | 2 ++ gnushogi/dspwrappers.c | 3 +++ 3 files changed, 9 insertions(+), 0 deletions(-) diff --git a/gnushogi/commondsp.c b/gnushogi/commondsp.c index 8750fcd..4cbfb81 100644 --- a/gnushogi/commondsp.c +++ b/gnushogi/commondsp.c @@ -31,6 +31,10 @@ * */ +/* request *snprintf prototypes */ +#define _POSIX_C_SOURCE 200112L +#include + #if defined HAVE_GETTIMEOFDAY #include #endif diff --git a/gnushogi/cursesdsp.c b/gnushogi/cursesdsp.c index 906e44d..4d00015 100644 --- a/gnushogi/cursesdsp.c +++ b/gnushogi/cursesdsp.c @@ -30,6 +30,8 @@ * ---------------------------------------------------------------------- */ +/* request *snprintf prototypes*/ +#define _POSIX_C_SOURCE 200112L #include #include diff --git a/gnushogi/dspwrappers.c b/gnushogi/dspwrappers.c index 3cdfbce..ee5274d 100644 --- a/gnushogi/dspwrappers.c +++ b/gnushogi/dspwrappers.c @@ -32,6 +32,9 @@ * */ +/* request *snprintf prototypes*/ +#define _POSIX_C_SOURCE 200112L + #include "gnushogi.h" #include "dspwrappers.h" #include "rawdsp.h" -- 1.7.0.4 From f0f49ca1e9c2988e14ed7ea56e4d9a7666089691 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 5 Dec 2013 23:23:19 +0100 Subject: [PATCH 09/16] Update .gitignore for doc/ dir. --- .gitignore | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/.gitignore b/.gitignore index 046ccbc..eddd488 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ /Makefile /gnushogi/Makefile /gnushogi/Makefile.profile +/doc/Makefile /xshogi/Makefile *.o @@ -23,7 +24,7 @@ /xshogi/xshogi /doc/gnushogi*.info -/doc/gnushogi*.html +/doc/gnushogi/ /doc/*.ps /doc/*.pdf /doc/*.aux -- 1.7.0.4 From f92bdd9f1749d7d6d0b37c1f3870e58a98d1e142 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sun, 15 Dec 2013 12:45:02 +0100 Subject: [PATCH 10/16] Move into opts.h the "mostly for hacking" remark from INSTALL file. --- gnushogi/opts.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/gnushogi/opts.h b/gnushogi/opts.h index a477137..6e87d12 100644 --- a/gnushogi/opts.h +++ b/gnushogi/opts.h @@ -34,7 +34,8 @@ /* * This file is for options that control the behavior of GNU shogi, - * and also for debugging #defines. They were previously placed on the + * probably only be of interest to people who are hacking the source codes. + * They were previously placed on the * command line as -D