From 446bfd706349c3e1f19916a16558a2f4f7dc8e54 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 9 Jun 2011 10:00:57 +0200 Subject: [PATCH] version 1.4.38b --- ChangeLog | 2 ++ book_make.c | 6 +++--- config.h | 6 +++--- configure | 20 ++++++++++---------- configure.ac | 2 +- engine.c | 2 +- line.c | 2 +- main.c | 2 +- mainloop.c | 2 +- makefile.ms | 7 ++++--- option.c | 4 ++-- parse.c | 2 +- pipex_win32.c | 9 +++++---- polyglot.spec | 2 +- search.c | 2 +- uci.c | 4 ++-- util.c | 2 ++ util.h | 4 ++++ 18 files changed, 45 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3902c16..9cfd240 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +=========1.4.38b================ +- MSVC++ portability fixes (E.M.) =========1.4.37b================ - Two new options: BookDepth and BookTreshold. BookDepth limits the number of moves the book is used and BookTreshold sets the minimum weight a book move should have. =========1.4.36b================ diff --git a/book_make.c b/book_make.c index ac9a66c..c3d5a28 100644 --- a/book_make.c +++ b/book_make.c @@ -20,8 +20,8 @@ // constants -static const int COUNT_MAX = 16384; -static const int StringSize = 4096; +#define COUNT_MAX ((int)16384) +#define StringSize ((int)4096) static const int NIL = -1; @@ -695,8 +695,8 @@ static void book_load(const char filename[]){ static int gen_book_moves(list_t * list, const board_t * board){ int first_pos, pos, index; entry_t entry[1]; - list_clear(list); bool found; + list_clear(list); found=FALSE; for (index = board->key & (uint64) Book->mask; (first_pos=Book->hash[index]) != NIL; index = (index+1) & Book->mask) { ASSERT(first_pos>=0&&first_possize); diff --git a/config.h b/config.h index dc4b29b..58f6c01 100644 --- a/config.h +++ b/config.h @@ -115,13 +115,13 @@ #define PACKAGE_NAME "polyglot" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "polyglot 1.4.37b" +#define PACKAGE_STRING "polyglot 1.4.38b" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "polyglot" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.4.37b" +#define PACKAGE_VERSION "1.4.38b" /* Define to 1 if the C compiler supports function prototypes. */ #define PROTOTYPES 1 @@ -150,7 +150,7 @@ #define TIME_WITH_SYS_TIME 1 /* Version number of package */ -#define VERSION "1.4.37b" +#define VERSION "1.4.38b" /* Define like PROTOTYPES; this can be used by system headers. */ #define __PROTOTYPES 1 diff --git a/configure b/configure index d403a8d..316744b 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for polyglot 1.4.37b. +# Generated by GNU Autoconf 2.61 for polyglot 1.4.38b. # # Report bugs to . # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='polyglot' PACKAGE_TARNAME='polyglot' -PACKAGE_VERSION='1.4.37b' -PACKAGE_STRING='polyglot 1.4.37b' +PACKAGE_VERSION='1.4.38b' +PACKAGE_STRING='polyglot 1.4.38b' PACKAGE_BUGREPORT='michel.vandenbergh@uhasselt.be' ac_unique_file="mainloop.c" @@ -1207,7 +1207,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures polyglot 1.4.37b to adapt to many kinds of systems. +\`configure' configures polyglot 1.4.38b to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1273,7 +1273,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of polyglot 1.4.37b:";; + short | recursive ) echo "Configuration of polyglot 1.4.38b:";; esac cat <<\_ACEOF @@ -1357,7 +1357,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -polyglot configure 1.4.37b +polyglot configure 1.4.38b generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1371,7 +1371,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by polyglot $as_me 1.4.37b, which was +It was created by polyglot $as_me 1.4.38b, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2061,7 +2061,7 @@ fi # Define the identity of the package. PACKAGE='polyglot' - VERSION='1.4.37b' + VERSION='1.4.38b' cat >>confdefs.h <<_ACEOF @@ -6848,7 +6848,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by polyglot $as_me 1.4.37b, which was +This file was extended by polyglot $as_me 1.4.38b, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6901,7 +6901,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -polyglot config.status 1.4.37b +polyglot config.status 1.4.38b configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 862bac4..21e553f 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([polyglot], [1.4.37b], [michel.vandenbergh@uhasselt.be]) +AC_INIT([polyglot], [1.4.38b], [michel.vandenbergh@uhasselt.be]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([mainloop.c]) AC_CONFIG_HEADER([config.h]) diff --git a/engine.c b/engine.c index a42c36e..5cfea07 100644 --- a/engine.c +++ b/engine.c @@ -15,7 +15,7 @@ // variables engine_t Engine[1]; -static const int StringSize=4096; +#define StringSize ((int)4096) // functions diff --git a/line.c b/line.c index de8c5bb..0e71079 100644 --- a/line.c +++ b/line.c @@ -18,7 +18,7 @@ static const bool Strict = FALSE; // FALSE static const bool UseDebug = FALSE; // FALSE -static const int StringSize = 1024; +#define StringSize ((int)1024) // functions diff --git a/main.c b/main.c index efd6539..406e5d8 100644 --- a/main.c +++ b/main.c @@ -35,7 +35,7 @@ // constants -static const char * const Version = "1.4.37b"; +static const char * const Version = "1.4.38b"; static const char * const HelpMessage = "\ SYNTAX\n\ * polyglot [configfile]\n\ diff --git a/mainloop.c b/mainloop.c index 1fc4c1b..0d94a5c 100644 --- a/mainloop.c +++ b/mainloop.c @@ -2,7 +2,7 @@ // constants -static const int StringSize = 4096; +#define StringSize ((int)4096) // includes diff --git a/makefile.ms b/makefile.ms index 1b3385b..d3bb245 100644 --- a/makefile.ms +++ b/makefile.ms @@ -4,8 +4,9 @@ EXE = $(PROJ).exe OBJS = attack.obj board.obj book.obj book_make.obj book_merge.obj colour.obj\ engine.obj epd.obj fen.obj game.obj gui.obj hash.obj io.obj line.obj list.obj\ main.obj mainloop.obj move.obj move_do.obj move_gen.obj move_legal.obj\ - option.obj parse.obj pgn.obj piece.obj pipe.obj posix.obj random.obj san.obj\ - search.obj square.obj uci.obj uci2uci.obj util.obj xboard2uci.obj + option.obj parse.obj pgn.obj piece.obj pipex_win32.obj pipex_posix.obj\ + random.obj san.obj search.obj square.obj uci.obj uci2uci.obj util.obj\ + xboard2uci.obj LIBS = oldnames.lib @@ -53,5 +54,5 @@ clean: $(EXE): $(OBJS) $(LINK) $(LFLAGS) $(OBJS) $(LIBS) -out:$(EXE) -.cpp.obj: +.c.obj: $(CC) $(CFLAGS) -c $< diff --git a/option.c b/option.c index 1bccec3..96ff50e 100644 --- a/option.c +++ b/option.c @@ -123,16 +123,16 @@ void option_init(option_list_t *option){ // option_insert() void option_insert(option_list_t *option, option_t *new_option){ + int i; + option_t *opt; ASSERT(option!=NULL); ASSERT(new_option!=NULL); ASSERT(new_option->name!=NULL); - option_t *opt; opt=option_find(option,new_option->name); if(!opt){ opt=&option->options[option->option_nb]; option->option_nb++; } - int i; if(option->option_nb>=OptionNb){ my_fatal("option_insert(): option list overflow\n"); } diff --git a/parse.c b/parse.c index aaacae1..b13b563 100644 --- a/parse.c +++ b/parse.c @@ -10,7 +10,7 @@ // constants -static const int StringSize = 256; +#define StringSize ((int)256) // variables diff --git a/pipex_win32.c b/pipex_win32.c index 24199b7..a07df7d 100644 --- a/pipex_win32.c +++ b/pipex_win32.c @@ -92,7 +92,7 @@ void pipex_open(pipex_t *pipex, si.hStdInput = hStdinRead; si.hStdOutput = hStdoutWrite; si.hStdError = hStdoutWrite; - if((szCurrentDir = _getcwd( NULL, 0 )) == NULL ) + if((szCurrentDir = (char*)_getcwd( NULL, 0 )) == NULL ) my_fatal("pipex_open(): no current directory: %s\n", strerror(errno)); if(_chdir(szWorkingDir)){ @@ -191,9 +191,9 @@ void pipex_send_eof(pipex_t *pipex) { // pipex_exit() void pipex_exit(pipex_t *pipex) { + DWORD lpexit; CloseHandle(pipex->hInput); CloseHandle(pipex->hOutput); - DWORD lpexit; if(GetExitCodeProcess(pipex->hProcess,&lpexit)){ if(lpexit==STILL_ACTIVE) @@ -429,12 +429,13 @@ void pipex_set_priority(pipex_t *pipex, int value){ // pipex_set_affinit() +typedef void (WINAPI *SPAM)(HANDLE, int); void pipex_set_affinity(pipex_t *pipex, int value){ + SPAM pSPAM; + if(pipex->hProcess) return; if(value==-1) return; - typedef void (WINAPI *SPAM)(HANDLE, int); - SPAM pSPAM; pSPAM = (SPAM) GetProcAddress( GetModuleHandle(TEXT("kernel32.dll")), "SetProcessAffinityMask"); diff --git a/polyglot.spec b/polyglot.spec index c157bc7..43691cf 100644 --- a/polyglot.spec +++ b/polyglot.spec @@ -1,6 +1,6 @@ Summary: A Winboard protocol to UCI protocol adapter Name: polyglot -Version: 1.4.37b +Version: 1.4.38b Release: 1 License: GPL Group: Amusement/Games diff --git a/search.c b/search.c index 524a874..a67fbbc 100644 --- a/search.c +++ b/search.c @@ -26,7 +26,7 @@ // constants -static const int StringSize = 4096; +#define StringSize ((int)4096) // variables diff --git a/uci.c b/uci.c index e44fa34..03c6647 100644 --- a/uci.c +++ b/uci.c @@ -22,7 +22,7 @@ static const bool UseDebug = FALSE; -static const int StringSize = 4096; +#define StringSize ((int)4096) // variables @@ -61,8 +61,8 @@ static int mate_score (int dist); // uci_set_threads() void uci_set_threads(uci_t * uci, int n) { - ASSERT(n>=1); const char *thread_option=uci_thread_option(uci); + ASSERT(n>=1); if(thread_option){ uci_send_option(uci,thread_option,"%d",n); } diff --git a/util.c b/util.c index 5e6e4f3..873ed2f 100644 --- a/util.c +++ b/util.c @@ -18,7 +18,9 @@ #include #include #include +#ifndef _MSC_VER #include +#endif #include "main.h" #include "util.h" diff --git a/util.h b/util.h index 99fa6ac..dd3ed59 100644 --- a/util.h +++ b/util.h @@ -67,6 +67,10 @@ #define FormatBufferSize 4096 +#ifdef _MSC_VER +#define vsnprintf _vsnprintf +#endif + #define CONSTRUCT_ARG_STRING(format,buf) \ { \ va_list arg_list; \ -- 1.7.0.4