Ticket #191: cmake_7_12.1d.diff
| File cmake_7_12.1d.diff, 21.6 kB (added by gunnar, 5 months ago) |
|---|
-
(a) /dev/null vs. (b) b/CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..47cee59
a b 1 PROJECT(GNUGo) 2 3 INCLUDE(CheckIncludeFiles) 4 CHECK_INCLUDE_FILES(sys/times.h HAVE_SYS_TIMES_H) 5 CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H) 6 CHECK_INCLUDE_FILES("sys/time.h;time.h" TIME_WITH_SYS_TIME) 7 CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) 8 CHECK_INCLUDE_FILES(curses.h HAVE_CURSES_H) 9 CHECK_INCLUDE_FILES(glib.h HAVE_GLIB_H) 10 CHECK_INCLUDE_FILES(ncurses/curses.h HAVE_NCURSES_CURSES_H) 11 CHECK_INCLUDE_FILES(ncurses/term.h HAVE_NCURSES_TERM_H) 12 CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H) 13 CHECK_INCLUDE_FILES(term.h HAVE_TERM_H) 14 CHECK_INCLUDE_FILES(crtdbg.h HAVE_CRTDBG_H) 15 CHECK_INCLUDE_FILES("winsock.h;io.h" HAVE_WINSOCK_IO_H) 16 17 INCLUDE(CheckTypeSize) 18 CHECK_TYPE_SIZE(long SIZEOF_LONG) 19 20 INCLUDE(CheckFunctionExists) 21 CHECK_FUNCTION_EXISTS(times HAVE_TIMES) 22 CHECK_FUNCTION_EXISTS(usleep HAVE_USLEEP) 23 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) 24 CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF) 25 CHECK_FUNCTION_EXISTS(_vsnprintf HAVE__VSNPRINTF) 26 # FIXME: Probably necessary to add the glib library for this test to pass. 27 CHECK_FUNCTION_EXISTS(g_vsnprintf HAVE_G_VSNPRINTF) 28 29 SET(PRAGMAS "") 30 IF(WIN32) 31 SET(PRAGMAS "#pragma warning(disable: 4244 4305)") 32 ENDIF(WIN32) 33 34 IF(MSVC80) 35 ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) 36 ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE) 37 ENDIF(MSVC80) 38 39 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake 40 ${CMAKE_CURRENT_BINARY_DIR}/config.h) 41 42 # Make sure all files know about and can find config.h 43 ADD_DEFINITIONS(-DHAVE_CONFIG_H) 44 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 45 46 # Recurse into subdirectories. 47 ADD_SUBDIRECTORY(utils) 48 ADD_SUBDIRECTORY(sgf) 49 ADD_SUBDIRECTORY(engine) 50 ADD_SUBDIRECTORY(patterns) 51 ADD_SUBDIRECTORY(interface) -
(a) /dev/null vs. (b) b/config.h.cmake
diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 0000000..b3661bc
a b 1 /* Ruleset. Default Japanese */ 2 #define CHINESE_RULES 0 3 4 /* Allow resignation. Default enabled */ 5 #define RESIGNATION_ALLOWED 1 6 7 /* Default level (strength). Up to 10 supported */ 8 #define DEFAULT_LEVEL 10 9 10 /* Center oriented influence. Disabled by default. */ 11 #define COSMIC_GNUGO 0 12 13 /* Owl Node Limit. 1000 default. */ 14 #define OWL_NODE_LIMIT 1000 15 16 /* Semeai Variations. 500 default */ 17 #define SEMEAI_NODE_LIMIT 500 18 19 /* Default hash table size in megabytes */ 20 #define DEFAULT_MEMORY -1 21 22 /* Compile support for GTP communication over TCP/IP channel. */ 23 #undef ENABLE_SOCKET_SUPPORT 24 25 /* GAIN/LOSS codes. Disabled by default. */ 26 #define EXPERIMENTAL_OWL_EXT 0 27 28 /* Large Scale Captures. Disabled by default. */ 29 #define LARGE_SCALE 0 30 31 /* Oracle. Default not enabled. */ 32 #define ORACLE 0 33 34 /* Owl Threats. 0 standard. */ 35 #define OWL_THREATS 0 36 37 /* Break-in module. Enabled by default. */ 38 #define USE_BREAK_IN 1 39 40 /* Connection module. Default experimental. */ 41 #define EXPERIMENTAL_CONNECTIONS 1 42 43 /* Connection module. Default standard. */ 44 #define ALTERNATE_CONNECTIONS 1 45 46 /* Define as 1 to use the grid optimisation, or 2 to run it in self-test mode 47 */ 48 #define GRID_OPT 1 49 50 /* Define to use ansi escape sequences for color debugging */ 51 #undef ANSI_COLOR 52 53 /* Define to 1 if you have the <curses.h> header file. */ 54 #cmakedefine HAVE_CURSES_H 1 55 56 /* Define to 1 if you have the `gettimeofday' function. */ 57 #cmakedefine HAVE_GETTIMEOFDAY 1 58 59 /* Define to 1 if you have the <glib.h> header file. */ 60 #cmakedefine HAVE_GLIB_H 1 61 62 /* Define to 1 if you have the `g_vsnprintf' function. */ 63 #cmakedefine HAVE_G_VSNPRINTF 1 64 65 /* Define to 1 if you have the <ncurses/curses.h> header file. */ 66 #cmakedefine HAVE_NCURSES_CURSES_H 1 67 68 /* Define to 1 if you have the <ncurses/term.h> header file. */ 69 #cmakedefine HAVE_NCURSES_TERM_H 1 70 71 /* Define to 1 if you have the <sys/times.h> header file. */ 72 #cmakedefine HAVE_SYS_TIMES_H 1 73 74 /* Define to 1 if you have the <sys/time.h> header file. */ 75 #cmakedefine HAVE_SYS_TIME_H 1 76 77 /* Define to 1 if you have the <sys/types.h> header file. */ 78 #cmakedefine HAVE_SYS_TYPES_H 1 79 80 /* Define to 1 if you have the <term.h> header file. */ 81 #cmakedefine HAVE_TERM_H 1 82 83 /* Define to 1 if you have the <crtdbg.h> header file. */ 84 #cmakedefine HAVE_CRTDBG_H 1 85 86 /* Define to 1 if you have the <winsock.h> and <io.h> header files. */ 87 #cmakedefine HAVE_WINSOCK_IO_H 1 88 89 /* Define to 1 if you have the `times' function. */ 90 #cmakedefine HAVE_TIMES 1 91 92 /* Define if your compiler supports transparent unions */ 93 #undef HAVE_TRANSPARENT_UNIONS 94 95 /* Define to 1 if you have the <unistd.h> header file. */ 96 #cmakedefine HAVE_UNISTD_H 1 97 98 /* Define to 1 if you have the `usleep' function. */ 99 #cmakedefine HAVE_USLEEP 1 100 101 /* Define if #define can take a variable number of arguments */ 102 #undef HAVE_VARIADIC_DEFINE 103 104 /* Define to 1 if you have the `vsnprintf' function. */ 105 #cmakedefine HAVE_VSNPRINTF 1 106 107 /* Define to 1 if you have the `_vsnprintf' function. */ 108 #cmakedefine HAVE__VSNPRINTF 1 109 110 /* Enable GNU Readline support */ 111 #undef READLINE 112 113 /* The size of a `long', as computed by sizeof. */ 114 #cmakedefine SIZEOF_LONG ${SIZEOF_LONG} 115 116 /* Define to 1 if termcap/terminfo is available. */ 117 #undef TERMINFO 118 119 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ 120 #cmakedefine TIME_WITH_SYS_TIME 1 121 122 /* Define special valgrind macros. */ 123 #undef USE_VALGRIND 124 125 /* Version number of package */ 126 #define VERSION "3.7.11" 127 128 /* Define to empty if `const' does not conform to ANSI C. */ 129 #undef const 130 131 ${PRAGMAS} -
config.vc
diff --git a/config.vc b/config.vc index e8b3d7d..dd652c5 100644
a b 4 4 * defines. This file is autogenerated. Do not modify it. * 5 5 * See instead, the perl script makevcdist.pl */ 6 6 7 #define HAVE_VISUAL_C 1 7 #define HAVE_CRTDBG_H 1 8 #define HAVE_WINSOCK_IO_H 1 9 #define HAVE__VSNPRINTF_C 1 8 10 9 11 /* Connection module. Default standard. */ 10 12 #define ALTERNATE_CONNECTIONS 1 -
config.vcin
diff --git a/config.vcin b/config.vcin index 9b5c354..6abb75b 100644
a b 4 4 * defines. This file is autogenerated. Do not modify it. * 5 5 * See instead, the perl script makevcdist.pl */ 6 6 7 #define HAVE_VISUAL_C 1 7 #define HAVE_CRTDBG_H 1 8 #define HAVE_WINSOCK_IO_H 1 9 #define HAVE__VSNPRINTF 1 8 10 9 11 /* Connection module. Default standard. */ 10 12 #define ALTERNATE_CONNECTIONS 1 -
(a) /dev/null vs. (b) b/engine/CMakeLists.txt
diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt new file mode 100644 index 0000000..f8238d6
a b 1 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/patterns) 3 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/sgf) 4 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/utils) 5 6 7 ########### engine library ############### 8 9 SET(engine_STAT_SRCS 10 aftermath.c 11 board.c 12 boardlib.c 13 breakin.c 14 cache.c 15 clock.c 16 combination.c 17 dragon.c 18 endgame.c 19 filllib.c 20 fuseki.c 21 genmove.c 22 globals.c 23 handicap.c 24 hash.c 25 influence.c 26 interface.c 27 matchpat.c 28 montecarlo.c 29 move_reasons.c 30 movelist.c 31 optics.c 32 oracle.c 33 owl.c 34 persistent.c 35 printutils.c 36 readconnect.c 37 reading.c 38 semeai.c 39 sgfdecide.c 40 sgffile.c 41 shapes.c 42 showbord.c 43 surround.c 44 unconditional.c 45 utils.c 46 value_moves.c 47 worm.c 48 ) 49 50 ADD_LIBRARY(engine STATIC ${engine_STAT_SRCS}) 51 52 53 ########### board library ############### 54 55 SET(board_STAT_SRCS 56 board.c 57 boardlib.c 58 hash.c 59 printutils.c 60 ) 61 62 ADD_LIBRARY(board STATIC ${board_STAT_SRCS}) -
engine/gnugo.h
diff --git a/engine/gnugo.h b/engine/gnugo.h index 58f868c..081686a 100644
a b 38 38 #include <config.h> 39 39 #endif 40 40 41 #ifdef HAVE_ VISUAL_C42 # include <crtdbg.h>41 #ifdef HAVE_CRTDBG_H 42 #include <crtdbg.h> 43 43 #endif 44 44 45 45 #include "sgftree.h" -
engine/montecarlo.c
diff --git a/engine/montecarlo.c b/engine/montecarlo.c index eac9c6a..35ec120 100644
a b 1929 1929 struct uct_node *child_node = child_arc->node; 1930 1930 float winrate = (float) child_node->wins / child_node->games; 1931 1931 float uct_value; 1932 float log_games_ratio = log f(node->games) / child_node->games;1933 float x = winrate * (1.0 - winrate) + sqrt f(2.0 * log_games_ratio);1932 float log_games_ratio = log(node->games) / child_node->games; 1933 float x = winrate * (1.0 - winrate) + sqrt(2.0 * log_games_ratio); 1934 1934 if (x < 0.25) 1935 1935 x = 0.25; 1936 uct_value = winrate + sqrt f(2 * log_games_ratio * x / (1 + tree->game.depth));1936 uct_value = winrate + sqrt(2 * log_games_ratio * x / (1 + tree->game.depth)); 1937 1937 if (uct_value > best_uct_value) { 1938 1938 next_arc = child_arc; 1939 1939 best_uct_value = uct_value; … … 2209 2209 break; 2210 2210 2211 2211 mean = most_games_node->sum_scores / most_games_node->games; 2212 std = sqrt f((most_games_node->sum_scores2 - most_games_node->sum_scores * mean) / (most_games_node->games - 1));2212 std = sqrt((most_games_node->sum_scores2 - most_games_node->sum_scores * mean) / (most_games_node->games - 1)); 2213 2213 gprintf("%1m ", most_games_arc->move); 2214 2214 fprintf(stderr, "%6d %6d %5.3f %5.3f %5.3f %5.3f\n", 2215 2215 most_games_node->wins, most_games_node->games, -
(a) /dev/null vs. (b) b/interface/CMakeLists.txt
diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt new file mode 100644 index 0000000..f6c38f2
a b 1 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/engine) 2 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/sgf) 3 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/utils) 4 5 ########### gnugo executable ############### 6 7 SET(gnugo_SRCS 8 main.c 9 play_ascii.c 10 play_gmp.c 11 play_gtp.c 12 play_solo.c 13 play_test.c 14 gmp.c 15 gtp.c 16 ) 17 18 ADD_EXECUTABLE(gnugo ${gnugo_SRCS}) 19 20 IF(WIN32) 21 SET(PLATFORM_LIBRARIES wsock32) 22 ENDIF(WIN32) 23 24 IF(UNIX) 25 SET(PLATFORM_LIBRARIES m) 26 ENDIF(UNIX) 27 28 TARGET_LINK_LIBRARIES(gnugo sgf engine sgf utils patterns ${PLATFORM_LIBRARIES}) 29 30 INSTALL(TARGETS gnugo DESTINATION bin) -
interface/gmp.c
diff --git a/interface/gmp.c b/interface/gmp.c index adbfb3e..a2e30ee 100644
a b 55 55 #include <io.h> 56 56 #endif 57 57 58 #ifdef HAVE_ VISUAL_C58 #ifdef HAVE_WINSOCK_IO_H 59 59 #include <winsock.h> 60 60 #include <io.h> 61 61 #endif -
makevcdist.pl
diff --git a/makevcdist.pl b/makevcdist.pl index f031419..0bbb424 100755
a b 54 54 * defines. This file is autogenerated. Do not modify it. * 55 55 * See instead, the perl script makevcdist.pl */ 56 56 57 #define HAVE_VISUAL_C 1 57 #define HAVE_CRTDBG_H 1 58 #define HAVE_WINSOCK_IO_H 1 59 #define HAVE__VSNPRINTF 1 58 60 59 61 %; 60 62 -
(a) /dev/null vs. (b) b/patterns/CMakeLists.txt
diff --git a/patterns/CMakeLists.txt b/patterns/CMakeLists.txt new file mode 100644 index 0000000..5b4dcdf
a b 1 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/patterns) 2 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/engine) 3 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/sgf) 4 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/utils) 5 6 ########### mkpat program ############### 7 8 SET(mkpat_SRCS 9 mkpat.c 10 transform.c 11 dfa.c 12 ) 13 14 ADD_EXECUTABLE(mkpat ${mkpat_SRCS}) 15 16 TARGET_LINK_LIBRARIES(mkpat utils) 17 18 19 ########### joseki program ############### 20 21 SET(joseki_SRCS 22 joseki.c 23 ) 24 25 ADD_EXECUTABLE(joseki ${joseki_SRCS}) 26 27 TARGET_LINK_LIBRARIES(joseki board sgf utils) 28 29 30 ########### mkeyes program ############### 31 32 SET(mkeyes_SRCS 33 mkeyes.c 34 ) 35 36 ADD_EXECUTABLE(mkeyes ${mkeyes_SRCS}) 37 38 TARGET_LINK_LIBRARIES(mkeyes utils) 39 40 41 ########### mkmcpat program ############### 42 43 SET(mkmcpat_SRCS 44 mkmcpat.c 45 ) 46 47 ADD_EXECUTABLE(mkmcpat ${mkmcpat_SRCS}) 48 49 IF(UNIX) 50 SET(PLATFORM_LIBRARIES m) 51 ENDIF(UNIX) 52 53 TARGET_LINK_LIBRARIES(mkmcpat engine sgf utils ${PLATFORM_LIBRARIES}) 54 55 56 ########### uncompress_fuseki program ############### 57 58 SET(uncompress_fuseki_SRCS 59 uncompress_fuseki.c 60 ) 61 62 ADD_EXECUTABLE(uncompress_fuseki ${uncompress_fuseki_SRCS}) 63 64 TARGET_LINK_LIBRARIES(uncompress_fuseki utils board sgf) 65 66 67 ########### extract_fuseki program ############### 68 69 SET(extract_fuseki_SRCS 70 extract_fuseki.c 71 ) 72 73 ADD_EXECUTABLE(extract_fuseki ${extract_fuseki_SRCS}) 74 75 TARGET_LINK_LIBRARIES(extract_fuseki engine patterns 76 engine patterns sgf utils) 77 78 79 ########### next target ############### 80 81 SET(compress_fuseki_SRCS 82 compress_fuseki.c 83 ) 84 85 ADD_EXECUTABLE(compress_fuseki ${compress_fuseki_SRCS}) 86 87 TARGET_LINK_LIBRARIES(compress_fuseki) 88 89 90 ########### Generate files. ############## 91 92 GET_TARGET_PROPERTY(JOSEKI_EXE joseki LOCATION) 93 GET_TARGET_PROPERTY(MKPAT_EXE mkpat LOCATION) 94 GET_TARGET_PROPERTY(MKEYES_EXE mkeyes LOCATION) 95 GET_TARGET_PROPERTY(MKMCPAT_EXE mkmcpat LOCATION) 96 GET_TARGET_PROPERTY(UNCOMPRESS_FUSEKI_EXE uncompress_fuseki LOCATION) 97 98 SET(JOSEKI_INPUTS "") 99 SET(JOSEKI_NAMES "") 100 SET(GG_BUILT_SOURCES "") 101 MACRO(BUILD_JOSEKI NAME PREFIX) 102 ADD_CUSTOM_COMMAND( 103 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.db 104 COMMAND ${JOSEKI_EXE} ${PREFIX} 105 ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.sgf 106 > ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.db 107 DEPENDS joseki ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.sgf 108 ) 109 SET(JOSEKI_INPUTS ${JOSEKI_INPUTS} 110 "-i" ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.db) 111 SET(JOSEKI_NAMES ${JOSEKI_NAMES} 112 ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.db) 113 ENDMACRO(BUILD_JOSEKI) 114 115 BUILD_JOSEKI(gogo JG) 116 BUILD_JOSEKI(hoshi_keima JHK) 117 BUILD_JOSEKI(hoshi_other JHO) 118 BUILD_JOSEKI(komoku JK) 119 BUILD_JOSEKI(sansan JS) 120 BUILD_JOSEKI(mokuhazushi JM) 121 BUILD_JOSEKI(takamoku JT) 122 123 MACRO(RUN_MKPAT OPTIONS1 OPTIONS2 PATNAME DBNAME CNAME) 124 ADD_CUSTOM_COMMAND( 125 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CNAME} 126 COMMAND ${MKPAT_EXE} ${OPTIONS1} ${OPTIONS2} ${PATNAME} 127 -i ${CMAKE_CURRENT_SOURCE_DIR}/${DBNAME} 128 -o ${CMAKE_CURRENT_BINARY_DIR}/${CNAME} 129 DEPENDS mkpat ${CMAKE_CURRENT_SOURCE_DIR}/${DBNAME} 130 ) 131 SET(GG_BUILT_SOURCES ${GG_BUILT_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/${CNAME}) 132 ENDMACRO(RUN_MKPAT) 133 134 SET(DFAFLAGS -D -m) 135 136 MACRO(RUN_MKPAT_DFA OPTIONS PATNAME DTRNAME DBNAME CNAME) 137 ADD_CUSTOM_COMMAND( 138 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CNAME} 139 COMMAND ${MKPAT_EXE} ${DFAFLAGS} ${OPTIONS} 140 -t ${CMAKE_CURRENT_SOURCE_DIR}/${DTRNAME} ${PATNAME} 141 -i ${CMAKE_CURRENT_SOURCE_DIR}/${DBNAME} 142 -o ${CMAKE_CURRENT_BINARY_DIR}/${CNAME} 143 DEPENDS mkpat ${CMAKE_CURRENT_SOURCE_DIR}/${DBNAME} 144 ${CMAKE_CURRENT_SOURCE_DIR}/${DTRNAME} 145 ) 146 SET(GG_BUILT_SOURCES ${GG_BUILT_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/${CNAME}) 147 ENDMACRO(RUN_MKPAT_DFA) 148 149 MACRO(RUN_UNCOMPRESS_FUSEKI BOARDSIZE) 150 ADD_CUSTOM_COMMAND( 151 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fuseki${BOARDSIZE}.c 152 COMMAND ${UNCOMPRESS_FUSEKI_EXE} ${BOARDSIZE} 153 ${CMAKE_CURRENT_SOURCE_DIR}/fuseki${BOARDSIZE}.dbz 154 c > ${CMAKE_CURRENT_BINARY_DIR}/fuseki${BOARDSIZE}.c 155 DEPENDS uncompress_fuseki 156 ${CMAKE_CURRENT_SOURCE_DIR}/fuseki${BOARDSIZE}.dbz 157 ) 158 SET(GG_BUILT_SOURCES ${GG_BUILT_SOURCES} 159 ${CMAKE_CURRENT_BINARY_DIR}/fuseki${BOARDSIZE}.c) 160 ENDMACRO(RUN_UNCOMPRESS_FUSEKI) 161 162 # FIXME: It's very ugly that the RUN_MKPAT macro takes two separate 163 # option arguments, where one is in most cases eliminated by using "". 164 # The problem with just having one option argument is that specifying 165 # it as "-c -b" causes the space to be escaped into "-c\ -b". There is 166 # probably some trivial workaround for someone who actually knows cmake. 167 RUN_MKPAT(-X "" attpat attack.db apatterns.c) 168 RUN_MKPAT("" "" defpat defense.db dpatterns.c) 169 RUN_MKPAT(-b "" handipat handicap.db handipat.c) 170 RUN_MKPAT(-c "" influencepat influence.db influence.c) 171 RUN_MKPAT(-c -b barrierspat barriers.db barriers.c) 172 RUN_MKPAT(-b "" endpat endgame.db endgame.c) 173 RUN_MKPAT(-c "" conn conn.db conn.c) 174 RUN_MKPAT(-b "" fusekipat fuseki.db fusekipat.c) 175 RUN_MKPAT_DFA(-b aa_attackpat aa_attackpats.dtr aa_attackpats.db aa_attackpat.c) 176 RUN_MKPAT_DFA(-b owl_vital_apat owl_vital_apats.dtr owl_vital_apats.db owl_vital_apat.c) 177 RUN_MKPAT_DFA(-b owl_attackpat owl_attackpats.dtr owl_attackpats.db owl_attackpat.c) 178 RUN_MKPAT_DFA(-b owl_defendpat owl_defendpats.dtr owl_defendpats.db owl_defendpat.c) 179 RUN_UNCOMPRESS_FUSEKI(9) 180 RUN_UNCOMPRESS_FUSEKI(13) 181 RUN_UNCOMPRESS_FUSEKI(19) 182 183 ADD_CUSTOM_COMMAND( 184 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/josekidb.c 185 COMMAND ${MKPAT_EXE} -C joseki ${JOSEKI_INPUTS} 186 -o ${CMAKE_CURRENT_BINARY_DIR}/josekidb.c 187 DEPENDS mkpat ${JOSEKI_NAMES} 188 ) 189 SET(GG_BUILT_SOURCES ${GG_BUILT_SOURCES} 190 ${CMAKE_CURRENT_BINARY_DIR}/josekidb.c) 191 192 ADD_CUSTOM_COMMAND( 193 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/patterns.c 194 COMMAND ${MKPAT_EXE} -b pat -i ${CMAKE_CURRENT_SOURCE_DIR}/patterns.db 195 -i ${CMAKE_CURRENT_SOURCE_DIR}/patterns2.db 196 -o ${CMAKE_CURRENT_BINARY_DIR}/patterns.c 197 DEPENDS mkpat ${CMAKE_CURRENT_SOURCE_DIR}/patterns.db 198 ${CMAKE_CURRENT_SOURCE_DIR}/patterns2.db 199 ) 200 SET(GG_BUILT_SOURCES ${GG_BUILT_SOURCES} 201 ${CMAKE_CURRENT_BINARY_DIR}/patterns.c) 202 203 ADD_CUSTOM_COMMAND( 204 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/eyes.c 205 COMMAND ${MKEYES_EXE} < ${CMAKE_CURRENT_SOURCE_DIR}/eyes.db 206 > ${CMAKE_CURRENT_BINARY_DIR}/eyes.c 207 DEPENDS mkeyes ${CMAKE_CURRENT_SOURCE_DIR}/eyes.db 208 ) 209 SET(GG_BUILT_SOURCES ${GG_BUILT_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/eyes.c) 210 211 ADD_CUSTOM_COMMAND( 212 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mcpat.c 213 COMMAND ${MKMCPAT_EXE} ${CMAKE_CURRENT_SOURCE_DIR}/mc_montegnu_classic.db 214 ${CMAKE_CURRENT_SOURCE_DIR}/mc_mogo_classic.db 215 ${CMAKE_CURRENT_SOURCE_DIR}/mc_uniform.db 216 > ${CMAKE_CURRENT_BINARY_DIR}/mcpat.c 217 DEPENDS mkmcpat ${CMAKE_CURRENT_SOURCE_DIR}/mkmcpat.c 218 ${CMAKE_CURRENT_SOURCE_DIR}/mc_montegnu_classic.db 219 ${CMAKE_CURRENT_SOURCE_DIR}/mc_mogo_classic.db 220 ${CMAKE_CURRENT_SOURCE_DIR}/mc_uniform.db 221 ) 222 223 SET(GG_BUILT_SOURCES ${GG_BUILT_SOURCES} 224 ${CMAKE_CURRENT_BINARY_DIR}/mcpat.c) 225 226 227 228 ########### patterns library ############### 229 230 SET(patterns_STAT_SRCS 231 connections.c 232 helpers.c 233 transform.c 234 ${GG_BUILT_SOURCES} 235 ) 236 237 ADD_LIBRARY(patterns STATIC ${patterns_STAT_SRCS}) -
regression/regress.pike
diff --git a/regression/regress.pike b/regression/regress.pike index 248f621..eeb0925 100755
a b 108 108 werror("Finished waiting for writing to be finished.\n"); 109 109 110 110 while (1) { 111 string s = f->gets() ;111 string s = f->gets() - "\r"; 112 112 float current_time = time(timebase); 113 113 if (!s) 114 114 break; -
(a) /dev/null vs. (b) b/sgf/CMakeLists.txt
diff --git a/sgf/CMakeLists.txt b/sgf/CMakeLists.txt new file mode 100644 index 0000000..b49846c
a b 1 INCLUDE_DIRECTORIES(${GNUGo_SOURCE_DIR}/utils) 2 3 ########### sgfgen program ############### 4 5 SET(sgfgen_SRCS 6 sgfgen.c 7 ) 8 9 ADD_EXECUTABLE(sgfgen ${sgfgen_SRCS}) 10 11 TARGET_LINK_LIBRARIES(sgfgen) 12 13 14 ########### sgf library ############### 15 16 SET(sgf_STAT_SRCS 17 sgf_utils.c 18 sgfnode.c 19 sgftree.c 20 ) 21 22 ADD_LIBRARY(sgf STATIC ${sgf_STAT_SRCS}) -
sgf/sgfnode.c
diff --git a/sgf/sgfnode.c b/sgf/sgfnode.c index 5985d0c..f0d93ab 100644
a b 986 986 } 987 987 match(']'); 988 988 989 /* Remove trailing whitespace */ 989 /* Remove trailing whitespace. The double cast below is needed 990 * because "char" may be represented as a signed char, in which case 991 * characters between 128 and 255 would be negative and a direct 992 * cast to int would cause a negative value to be passed to isspace, 993 * possibly causing an assertion failure. 994 */ 990 995 --p; 991 while (p > buffer && isspace((int) *p))996 while (p > buffer && isspace((int) (unsigned char) *p)) 992 997 --p; 993 998 *++p = '\0'; 994 999 } -
(a) /dev/null vs. (b) b/utils/CMakeLists.txt
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt new file mode 100644 index 0000000..06fae36
a b 1 SET(utils_STAT_SRCS 2 getopt.c 3 getopt1.c 4 random.c 5 gg_utils.c 6 winsocket.c 7 ) 8 9 ADD_LIBRARY(utils STATIC ${utils_STAT_SRCS}) -
utils/gg_utils.c
diff --git a/utils/gg_utils.c b/utils/gg_utils.c index 8768e07..186dc1c 100644
a b 224 224 vsnprintf(dest, len, fmt, args); 225 225 #elif HAVE_G_VSNPRINTF 226 226 g_vsnprintf(dest, len, fmt, args); 227 #elif HAVE_ VISUAL_C227 #elif HAVE__VSNPRINTF 228 228 _vsnprintf(dest, len, fmt, args); 229 229 #else 230 230 UNUSED(len); … … 253 253 #ifdef HAVE_GETTIMEOFDAY 254 254 gettimeofday(&tv, NULL); 255 255 #else 256 tv ->tv_sec = time(NULL);257 tv ->tv_usec = 0;256 tv.tv_sec = time(NULL); 257 tv.tv_usec = 0; 258 258 #endif 259 259 return tv.tv_sec + 1.e-6 * tv.tv_usec; 260 260 } -
utils/gg_utils.h
diff --git a/utils/gg_utils.h b/utils/gg_utils.h index 7e4f256..9e7d110 100644
a b 47 47 #include <io.h> 48 48 #endif 49 49 50 #ifdef HAVE_ VISUAL_C50 #ifdef HAVE_WINSOCK_IO_H 51 51 #include <winsock.h> 52 52 #include <io.h> 53 53 #endif
