Merge branch 'maint'
authorYann Dirson <ydirson@free.fr>
Sun, 12 Jan 2014 14:30:26 +0000 (15:30 +0100)
committerYann Dirson <ydirson@free.fr>
Sun, 12 Jan 2014 14:30:26 +0000 (15:30 +0100)
1  2 
configure.ac
gnushogi/Makefile.in
gnushogi/makepattern.c

diff --combined configure.ac
@@@ -5,7 -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-rc1+],[https://savannah.gnu.org/bugs/?group=gnushogi])
  AC_CONFIG_SRCDIR([gnushogi/gnushogi.h])
  AC_CONFIG_HEADER(config.h)
  
@@@ -57,10 -57,8 +57,8 @@@ AC_CHECK_LIB([termcap], [tgoto]
  
  if [[ $ac_cv_c_compiler_gnu = yes ]]
  then
 -WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes -ansi -pedantic"
 +WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes -ansi"
  CEXTRAFLAGS="-fsigned-char -funroll-loops"
- # For profiling targets:
- CEXTRAFLAGS2="-fsigned-char -pg -fprofile-arcs -ftest-coverage"
  else
  # Who knows what warnings your compiler uses?
  WARNINGS=
@@@ -69,7 -67,6 +67,6 @@@ f
  
  AC_SUBST(WARNINGS)
  AC_SUBST(CEXTRAFLAGS)
- AC_SUBST(CEXTRAFLAGS2)
  
  ##########
  AC_MSG_NOTICE([header files])
@@@ -184,7 -181,7 +181,7 @@@ AC_SUBST(XSHOGICLEAN
  ##########
  AC_CONFIG_FILES([Makefile
                   gnushogi/Makefile
-                gnushogi/Makefile.profile
+                  win32/config.h
                   doc/Makefile
                   xshogi/Makefile])
  AC_OUTPUT
diff --combined gnushogi/Makefile.in
@@@ -72,7 -72,7 +72,7 @@@ LCURSES = @LIBCURSES
  CC          = @CC@
  CWARNINGS   = @WARNINGS@
  CEXTRAFLAGS = @CEXTRAFLAGS@
- CFLAGS      = @CFLAGS@ $(HASH) $(CEXTRAFLAGS) $(CWARNINGS) -I$(ROOT) -I@top_builddir@ -I.
+ CFLAGS      = @CFLAGS@ $(HASH) $(CEXTRAFLAGS) $(CWARNINGS) -I. -I@top_builddir@ -I$(ROOT)
  LDFLAGS     = @LDFLAGS@
  
  # The hashfile is a record of positions seen. It is used by
@@@ -115,6 -115,7 +115,6 @@@ NOTCOMMONFILES = 
                  book.o         \
                  commondsp.o    \
                  @CURSESDSP@    \
 -                dspwrappers.o  \
                  eval.o         \
                  genmove.o      \
                  init.o         \
@@@ -164,6 -165,9 +164,6 @@@ commondsp.o: commondsp.
  cursesdsp.o: cursesdsp.c
        $(CC) $(CFLAGS) -c $<
  
 -dspwrappers.o: dspwrappers.c
 -      $(CC) $(CFLAGS) -c $<
 -
  genmove.o: genmove.c
        $(CC) $(CFLAGS) -c $<
  
@@@ -210,7 -214,7 +210,7 @@@ util.o: util.
  # Files specific to particular targets.
  
  pat2inc.o: pat2inc.c
-       $(CC) $(CFLAGS) $(BINBOOK) $(PATTERN) -c $<
+       $(CC) $(CFLAGS) -c $<
  
  sizetest.o: sizetest.c
        $(CC) $(CFLAGS) -c $<
@@@ -270,11 -274,11 +270,11 @@@ attacks.o:     attacks.c gnushogi.
  book.o:        book.c gnushogi.h
  commondsp.o:   commondsp.c gnushogi.h
  cursesdsp.o:   cursesdsp.c gnushogi.h
 -dspwrappers.o: dspwrappers.c gnushogi.h
  genmove.o:     genmove.c gnushogi.h
  globals.o:     globals.c gnushogi.h
  eval.o:        eval.c eval.h gnushogi.h $(SRCDIR)/pattern.h
  init.o:        init.c gnushogi.h $(SRCDIR)/pattern.h
 +init-common.o: init-common.c gnushogi.h
  main.o:        main.c gnushogi.h
  makepattern.o: pattern.c gnushogi.h $(SRCDIR)/pattern.h
  pattern.o:     pattern.c gnushogi.h $(SRCDIR)/pattern.h pattern.inc
diff --combined gnushogi/makepattern.c
  #define MAX_OPENING_SEQUENCE 20
  #define MAX_PATTERN          200
  
- char *patternfile = PATTERNFILE;
+ static char *patternfile = PATTERNFILE;
  small_short pattern_data[MAX_PATTERN_DATA];
  
  /* minimal ShowMessage to avoid dependency on extraneous display code */
 -void
 -ShowMessage(char *s)
 +static void
 +Dummy_ShowMessage(char *s)
  {
      printf("%s\n", s);
  }
 +static struct display dummydsp = {
 +  .ShowMessage = Dummy_ShowMessage,
 +};
 +struct display *dsp = &dummydsp;
  
  #define is_digit(c) (((c) >= '0') && ((c) <= '9'))
  #define is_alpha(c) ((((c) >= 'a') && ((c) <= 'z')) \
@@@ -192,7 -188,6 +192,6 @@@ ScanPattern (char *s, short *pindex
  
  void
  ReadOpeningSequences (short *pindex)
  {
      FILE *fd;
      char s[256];
              {
                  if (ScanPattern(s, pindex))
                  {
 -                    ShowMessage("error in pattern sequence...");
 +                    dsp->ShowMessage("error in pattern sequence...");
                      exit(1);
                  }
                  else
          sprintf(s,
                  "Pattern: %d bytes for %d sequences with %d patterns.\n",
                  *pindex, max_opening_sequence, max_pattern);
 -        ShowMessage(s);
 +        dsp->ShowMessage(s);
  
          fclose(fd);
      } else {
          sprintf(s, "no pattern file '%s'", patternfile);
 -        ShowMessage(s);
 +        dsp->ShowMessage(s);
      }
  }