diff options
author | jperkin <jperkin@pkgsrc.org> | 2014-09-11 16:59:16 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2014-09-11 16:59:16 +0000 |
commit | af550b861dbaad788163c09247ea6f2d570e5bb7 (patch) | |
tree | 7202ee81763be1d70a907e55fc5d35233c3f2c3c /games/exchess | |
parent | ddfad88f5fc59a601c32798f0589dc9490b9cfc7 (diff) | |
download | pkgsrc-af550b861dbaad788163c09247ea6f2d570e5bb7.tar.gz |
Update games/exchess to v7.31beta, this package's first update in 14 years.
The primary motivator for the upgrade is to improve the book generation
time, which is now several times faster (builds were failing with CPU ulimit
of 1 hour on 3GHz Xeon E5's with the previous version). This new version
even supports multiple cores, though that isn't enabled at this time.
There appear to have been many other updates, but there is no ChangeLog
and there aren't even any intermediate versions for download (hence using
the current beta version). Upstream unfortunately makes it as difficult
as possible to see the history of this package.
Diffstat (limited to 'games/exchess')
31 files changed, 399 insertions, 919 deletions
diff --git a/games/exchess/Makefile b/games/exchess/Makefile index 04dc184b816..7617e75fce0 100644 --- a/games/exchess/Makefile +++ b/games/exchess/Makefile @@ -1,9 +1,7 @@ -# $NetBSD: Makefile,v 1.16 2014/02/09 16:50:45 wiedi Exp $ +# $NetBSD: Makefile,v 1.17 2014/09/11 16:59:16 jperkin Exp $ -DISTNAME= EXCH314S -# 5.01beta available -PKGNAME= exchess-3.14 -PKGREVISION= 1 +DISTNAME= EXchess_v7.31beta +PKGNAME= exchess-7.31beta CATEGORIES= games MASTER_SITES= ${MASTER_SITE_LOCAL} EXTRACT_SUFX= .zip @@ -11,19 +9,25 @@ EXTRACT_SUFX= .zip MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://personal.denison.edu/~homand/EXchess.htm COMMENT= Experimental chess engine +LICENSE= gnu-gpl-v3 USE_LANGUAGES= c++ NO_CONFIGURE= yes -WRKSRC= ${WRKDIR} +WRKSRC= ${WRKDIR}/${DISTNAME:C/beta//} LIBDIR= ${PREFIX}/lib/exchess DOCDIR= ${PREFIX}/share/doc/exchess -CFLAGS.SunOS+= -Du_int64_t=uint64_t +CFLAGS+= -DEXCHESS_DIR=${LIBDIR:Q} +LDFLAGS+= ${PTHREAD_LDFLAGS} +LIBS+= ${PTHREAD_LIBS} post-extract: cd ${WRKSRC} && ${MV} search.par search.par.in - ${CP} ${FILESDIR}/Makefile ${WRKSRC} + +do-build: + cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} \ + ${CXX} ${CFLAGS} src/EXchess.cc -o exchess ${LDFLAGS} ${LIBS} post-build: ${SED} -e "s,@PREFIX@,${PREFIX},g" \ @@ -36,4 +40,5 @@ do-install: ${INSTALL_DATA} ${WRKSRC}/search.par ${DESTDIR}${PREFIX}/lib/exchess ${INSTALL_DATA} ${WRKSRC}/readme.txt ${DESTDIR}${DOCDIR} +.include "../../mk/pthread.buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/games/exchess/distinfo b/games/exchess/distinfo index d726607853c..fe3eb825d31 100644 --- a/games/exchess/distinfo +++ b/games/exchess/distinfo @@ -1,22 +1,16 @@ -$NetBSD: distinfo,v 1.10 2014/02/09 16:50:45 wiedi Exp $ +$NetBSD: distinfo,v 1.11 2014/09/11 16:59:16 jperkin Exp $ -SHA1 (EXCH314S.zip) = 7d8ffbd94dc86a97512826e611048a691c8c646d -RMD160 (EXCH314S.zip) = 0503200c210aaf7ddc69e1372392e8ea690505ea -Size (EXCH314S.zip) = 110676 bytes -SHA1 (patch-aa) = 6aa16f2ca4ecc52b77739b5d28ab650f8102e54c -SHA1 (patch-ab) = a38d6455675083e9ca291c844c85746a0ed897e5 -SHA1 (patch-ac) = cfc1beff8ae3b2e4c9620e8d49852ce80d848ad6 -SHA1 (patch-ad) = f2d2de59f56a0a24e6408ace9ba15139f986de95 -SHA1 (patch-ae) = 9d374b888a6f431604f41c4421baa23d8ca775a1 -SHA1 (patch-af) = f2379b8929775ff660f9af9fc96969eab1b25870 -SHA1 (patch-ag) = 7072e6b7ac08fcb901630c2705fe38065bc89bab -SHA1 (patch-ah) = 872b0b7c62f95075f0ce7360464fa51215619ee3 -SHA1 (patch-ai) = 7244cfeb214e08a5e10198de2488957a63e8fda9 -SHA1 (patch-aj) = 064dd97be969d403f09cb9cab70705891b1355de -SHA1 (patch-ak) = 659f1cf07efefe524be4d025446fea55eb5f3e9a -SHA1 (patch-funct.h) = 8ff861d1cfaac5aac8722334b2142e9c63a231c6 -SHA1 (patch-main.h) = f49c0c889469002281fd15c6ceac359f8c4e6f51 -SHA1 (patch-parse.cpp) = f000ea0d4e2adb893ec6ec09a5e0c3dc5c77970d -SHA1 (patch-pmoves.cpp) = 66973c0baee54fa623a9f0b77c29d41e4c6924b8 -SHA1 (patch-search.h) = 85b16b102087dd218d64c14cc294c5c6df6849bb -SHA1 (patch-setup.cpp) = 16914d19bb6bc48341409dfa15d9f451e4f46733 +SHA1 (EXchess_v7.31beta.zip) = 09fa6d133172e34c1908df148f56489c47ee8cc2 +RMD160 (EXchess_v7.31beta.zip) = 38a3a6b3a3a53ff62321642954ff4d29ebfe9705 +Size (EXchess_v7.31beta.zip) = 3421179 bytes +SHA1 (patch-search.par.in) = 664781d6f9a204f9a071825dc3ebee19da4e3f8b +SHA1 (patch-src_book.cpp) = ab12445c7ebd769a2a90166fba4ef256f293709d +SHA1 (patch-src_chess.h) = 569c3f79a51a6be9cec83e98ef6c38f7e8d30660 +SHA1 (patch-src_exmove.cpp) = e4cff58e89501f5b73d78984ab8bf76a50d12677 +SHA1 (patch-src_funct.h) = d3ecab4fad483ac41f76993ecfb6af38c243115a +SHA1 (patch-src_hash.cpp) = 3556b37f386d867d092075edcd1cc279bb4c0223 +SHA1 (patch-src_hash.h) = 5af2f9bad4484cc07ff8cb452b7b7759c3ab9d4e +SHA1 (patch-src_main.cpp) = e68ef0a3a9ef4aaaeab59c8da0e3badd198e49f1 +SHA1 (patch-src_score.cpp) = f74c09b8bed649bbf6d00d0e3401de4dc16dd353 +SHA1 (patch-src_search.cpp) = eae69d8e31ca42b27db64df19e58b02b030b0a6a +SHA1 (patch-src_support.cpp) = 4329f3863e2f4ebb18f2c427043cfbdff6879c4c diff --git a/games/exchess/files/Makefile b/games/exchess/files/Makefile deleted file mode 100644 index 3db776cb520..00000000000 --- a/games/exchess/files/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# $NetBSD: Makefile,v 1.2 2010/01/29 20:29:26 joerg Exp $ - -LIBDIR= ${PREFIX}/lib/exchess - -CPPFLAGS= -DEXCHESS_DIR=\"${LIBDIR}/\" - -OBJS= attacks.o book.o check.o exmove.o hash.o main.o movelist.o -OBJS+= parse.o pcapts.o pmoves.o probe.o score.o search.o setup.o -OBJS+= sort.o swap.o util.o - -all: exchess - -exchess: ${OBJS} - ${CXX} -o ${.TARGET} ${OBJS} -lm - -.SUFFIXES: .cpp - -.cpp.o: - ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c ${.IMPSRC} diff --git a/games/exchess/patches/patch-aa b/games/exchess/patches/patch-aa deleted file mode 100644 index 4262bf8555e..00000000000 --- a/games/exchess/patches/patch-aa +++ /dev/null @@ -1,81 +0,0 @@ -$NetBSD: patch-aa,v 1.3 2013/04/30 22:20:58 joerg Exp $ - ---- book.cpp.orig 2000-04-30 09:56:26.000000000 +0000 -+++ book.cpp -@@ -12,12 +12,14 @@ - #include "const.h" - #include <stdio.h> - #include <string.h> --#include <iostream.h> --#include <iomanip.h> --#include <fstream.h> -+#include <iostream> -+#include <iomanip> -+#include <fstream> - #include <math.h> - #include <time.h> - -+using namespace std; -+ - /* variables for book learning */ - book_rec learn_book[100]; // book learning array - int learn_count = 0; // number of book moves played -@@ -51,8 +53,8 @@ void build_book(position ipos) - char instring[100], line[100]; // strings from input files - char outbook[100]; - position temp_pos; // temporary position -- move bmove; // book move under consideration -- unsigned __int64 pcode; // hash code for position -+ my_move bmove; // book move under consideration -+ u_int64_t pcode; // hash code for position - int i = -1, j = 0, k = 0, p; // loop variables - int count = 0, thresh, LINE_DEPTH; // control variables - -@@ -241,11 +243,11 @@ book_rec book_record; // working reco - position temporary_pos; // working position - - /* Function to find a position in the book */ --int find_record(position p, move m, int file_size) -+int find_record(position p, my_move m, int file_size) - { - file_pos = 0; - int jump = int(file_size/2); -- unsigned __int64 pcode = ZERO; -+ u_int64_t pcode = ZERO; - - temporary_pos = p; - if(!exec_move(&temporary_pos, m, 1)) return 0; -@@ -299,13 +301,13 @@ int find_record(position p, move m, int - // position is in the book. If so, the move in question - // becomes a candidate move. Information is stored to - // facilitate easy learning during the game. --move opening_book(h_code hash_code, position p) -+my_move opening_book(h_code hash_code, position p) - { - int file_size, mflag = 0, j; - int candidates = 0, total_score = 0; - int logger = 0, poster = 0; - move_list list; -- move nomove; nomove.t = 0; -+ my_move nomove; nomove.t = 0; - char book_file[100]; // file name for the book - - // generate legal moves -@@ -398,7 +400,7 @@ int edit_book(h_code hash_code, position - int file_size, mflag = 0, j, outflag = 0; - int search_time = 0, total_score = 0; - move_list list; -- move nomove; nomove.t = 0; -+ my_move nomove; nomove.t = 0; - char resp[2]; - char book_file[100]; // file name for the book - -@@ -462,7 +464,7 @@ int edit_book(h_code hash_code, position - if(outflag == 1) cout << "\n"; - - /* Edit mode for individual moves */ -- move edit_move; -+ my_move edit_move; - while(1) { - cout << "\nEnter a move to be edited/investigated (0 = quit): "; - cin >> mstring; if(mstring[0] == '0') break; diff --git a/games/exchess/patches/patch-ab b/games/exchess/patches/patch-ab deleted file mode 100644 index 67096709c21..00000000000 --- a/games/exchess/patches/patch-ab +++ /dev/null @@ -1,48 +0,0 @@ -$NetBSD: patch-ab,v 1.3 2013/04/30 22:20:58 joerg Exp $ - ---- chess.h.orig 2000-02-19 11:28:46.000000000 +0000 -+++ chess.h -@@ -3,6 +3,8 @@ - #ifndef CHESS_H - #define CHESS_H - -+#include <sys/types.h> -+ - // move structure to encapsulate several important move parameters - // note: The char used below is treated like an integer. - -@@ -30,7 +32,7 @@ struct move_t { - // union of move_t and an integer to make comparison of - // moves easier. (as suggested in Tom Kerrigans simple chess program) - --union move { -+union my_move { - move_t b; - int t; // assuming a 32 bit integer - }; -@@ -38,7 +40,7 @@ union move { - // Add a score for sorting purposes to the move record - - struct move_rec { -- move m; -+ my_move m; - int score; - }; - -@@ -79,14 +81,14 @@ struct position { - // side to move - int extend; // extension flag - char plist[2][7][10]; // piece lists -- move last; // last move made -+ my_move last; // last move made - h_code hcode; // hash code - }; - - // Structure for position in the opening book - - struct book_rec { -- unsigned __int64 pos_code; // position hash code -+ u_int64_t pos_code; // position hash code - int score; // score for position - int gambit; // flag for gambit play - }; diff --git a/games/exchess/patches/patch-ac b/games/exchess/patches/patch-ac deleted file mode 100644 index aaa1ef6f38e..00000000000 --- a/games/exchess/patches/patch-ac +++ /dev/null @@ -1,35 +0,0 @@ -$NetBSD: patch-ac,v 1.1.1.1 2000/10/25 08:40:00 jlam Exp $ - ---- define.h.orig Sun Apr 30 10:02:28 2000 -+++ define.h -@@ -4,25 +4,26 @@ - #ifndef DEFINE_H - #define DEFINE_H - -+#include <inttypes.h> -+ - #define VERS 3.14 // program version number - #define MAXD 60 // max search depth - #define MATE 10000000 // mate score - - // Compiler flags for different systems --#define BORLAND 1 // Selects a win95/NT compiler if set to 1 -+#define BORLAND 0 // Selects a win95/NT compiler if set to 1 - // this should work with MSVC and others as - // well - #define DEC 0 // Set to 1 for certain DEC Unix systems, not - // all will need it - some other unixes may - // need this if there are errors in "book.cpp" --#define UNIX 0 // Set to 1 for all Unix systems -+#define UNIX 1 // Set to 1 for all Unix systems - #define DOS 0 // Set to 1 for Auto232 DOS mode - #define DEBUG 0 // Set to 1 to debug mode... quite slow - - // define 64 bit integers - #if !BORLAND -- #define __int64 long long -- #define ZERO 0ULL -+ #define ZERO 0 - #else - #define ZERO 0ui64 - #endif diff --git a/games/exchess/patches/patch-ad b/games/exchess/patches/patch-ad deleted file mode 100644 index 446ff3a1baf..00000000000 --- a/games/exchess/patches/patch-ad +++ /dev/null @@ -1,170 +0,0 @@ -$NetBSD: patch-ad,v 1.6 2014/02/09 16:50:45 wiedi Exp $ - ---- main.cpp.orig 2000-04-01 07:46:20.000000000 +0000 -+++ main.cpp -@@ -3,20 +3,23 @@ - - /* Main functions controlling program */ - --#include <iostream.h> --#include <iomanip.h> -+#include <iostream> -+#include <iomanip> - #include <stdlib.h> - #include <string.h> - #include <math.h> - #include <stdio.h> - #include <signal.h> --#include <fstream.h> -+#include <fstream> - - #include "define.h" - -+using namespace std; -+ - #if UNIX - #include <sys/types.h> - #include <sys/time.h> -+ #include <unistd.h> - #else - #include <windows.h> - #include <time.h> -@@ -42,21 +45,21 @@ int omttc = 0, mttc = 0, inc = 0; float - int display_board = 0; - int analysis_mode = 0; - extern int fail; // flag for fail high/fail low from search --extern move ponder_move; -+extern my_move ponder_move; - extern int logging; - - ofstream logfile; - int MAX_LOGS = 100; - - // xboard flag --int xboard, post, ics, ALLEG = 0, hintflag = 0, count = 1; -+int xboard, post, ics, ALLEG = 0, hintflag = 0, my_count = 1; - int ponder_flag = 1, learn_bk, shout_book; - int no_book = 0; // count of moves without a book move - position reset_pos; - extern int ponder, last_ponder, learn_count, learned; - extern unsigned long TAB_SIZE, PAWN_SIZE; - --// executable directory -+// exchess opening book and search parameters directory - char exec_path[100]; - - // performance function -@@ -88,21 +91,12 @@ ofstream printer; - int main(int argc, char *argv[]) - { - char mstring[10]; -- move hint; -+ my_move hint; - xboard = 0; ponder = 0; ics = 0; - learn_count = 0; learned = 0; learn_bk = 1; shout_book = 0; - - -- strcpy(exec_path, argv[0]); -- // parsing exec path -- int last_slash = 0; -- for(int j = 0; j < 100; j++) { -- if(exec_path[j] == '\0') break; -- if(exec_path[j] == '\\') last_slash = j; -- if(exec_path[j] == '/') last_slash = j; -- } -- -- exec_path[last_slash+1] = '\0'; -+ strcpy(exec_path, EXCHESS_DIR); - - /* initializing hash tables, check tables, scoring parameters, - and the random number seed and tablebases */ -@@ -117,7 +111,7 @@ int main(int argc, char *argv[]) - if(li < 10) sprintf(lfile, "run_log.00%i", li); - else if(li < 100) sprintf(lfile, "run_log.0%i", li); - else sprintf(lfile, "run_log.%i", li); -- logfile.open(lfile, ios::noreplace | ios::out); -+ logfile.open(lfile, ios::out); - if(logfile) break; - } - if(!logfile) { -@@ -164,7 +158,7 @@ int main(int argc, char *argv[]) - - /* main loop */ - -- while (count > 0) -+ while (my_count > 0) - { - - // find a hint move, check book first then look in pv -@@ -204,14 +198,14 @@ int main(int argc, char *argv[]) - if(!game_pos.wtm) // if it is black's turn - { - if(both) p_side = 0; -- if(!xboard) cout << "Black-To-Move[" << ceil(T/2) << "]: "; -- if(logging) logfile << "Black-To-Move[" << ceil(T/2) << "]: "; -+ if(!xboard) cout << "Black-To-Move[" << ceil((double)(T/2)) << "]: "; -+ if(logging) logfile << "Black-To-Move[" << ceil((double)(T/2)) << "]: "; - } - else // or if it is white's - { - if(both) p_side = 1; -- if(!xboard) cout << "White-To-Move[" << (ceil(T/2) + 1) << "]: "; -- if(logging) logfile << "White-To-Move[" << (ceil(T/2) + 1) << "]: "; -+ if(!xboard) cout << "White-To-Move[" << (ceil((double)(T/2)) + 1) << "]: "; -+ if(logging) logfile << "White-To-Move[" << (ceil((double)(T/2)) + 1) << "]: "; - } - - cout.flush(); -@@ -322,12 +316,12 @@ void make_move() - if(p_side != game_pos.wtm) - { - if(game_pos.wtm) { -- cout << (ceil(T/2) + 1) << ". "; -+ cout << (ceil((double)(T/2)) + 1) << ". "; - if(xboard) cout << "... "; -- if(logging) logfile << (ceil(T/2) + 1) << ". "; -+ if(logging) logfile << (ceil((double)(T/2)) + 1) << ". "; - } else { -- cout << ceil(T/2) << ". ... "; -- if(logging) logfile << ceil(T/2) << ". ... "; -+ cout << ceil((double)(T/2)) << ". ... "; -+ if(logging) logfile << ceil((double)(T/2)) << ". ... "; - } - print_move(game_pos, best, mstring); - cout << mstring << "\n"; -@@ -558,7 +552,7 @@ void drawboard() - print_move(last_pos, game_pos.last, mstring); - cout << mstring; - } -- if(j==3) cout << " fifty: " << ceil(game_pos.fifty/2); -+ if(j==3) cout << " fifty: " << ceil((double)(game_pos.fifty/2)); - if(j==2) cout << " Computer time: " << int(timeleft/100) << " seconds"; - } - cout << "\n +---+---+---+---+---+---+---+---+"; -@@ -745,7 +739,7 @@ void parse_command() - else if(!strcmp(response, "nopost")) { post = 0; } - else if(!strcmp(response, "probe")) { cout << probe_tb(&game_pos,0) << "\n"; } - else if(!strcmp(response, "save") || !strcmp(response, "SR")) { save_game(); } -- else if(!strcmp(response, "quit")) { game_over = 1; count = 0; } -+ else if(!strcmp(response, "quit")) { game_over = 1; my_count = 0; } - else if(!strcmp(response, "performance")) { performance(); } - else if(!strcmp(response, "setboard")) - { cin >> inboard >> ms >> castle >> ep; mttc = omttc; game_over = 0; -@@ -795,7 +789,7 @@ void performance() - // when the best move was first found and held on to. - - float soltime; --int bmcount, tsuite = 0; move bmoves[10]; -+int bmcount, tsuite = 0; my_move bmoves[10]; - int best_depth, best_score; - extern int stage; - unsigned long nodes, nodes1, test_time, test_time1; -@@ -1063,7 +1057,7 @@ void save_game() - for(int i = 1; i < TURN; i++) - { - print_move(game_pos, game_history[i-1], mstring); -- if (game_pos.wtm) outfile << (ceil(i/2) + 1) << ". " << mstring; -+ if (game_pos.wtm) outfile << (ceil((double)(i/2)) + 1) << ". " << mstring; - else outfile << mstring; - outfile << " "; - if(!(T%8)) outfile << "\n"; diff --git a/games/exchess/patches/patch-ae b/games/exchess/patches/patch-ae deleted file mode 100644 index 25b4ab71e2f..00000000000 --- a/games/exchess/patches/patch-ae +++ /dev/null @@ -1,22 +0,0 @@ -$NetBSD: patch-ae,v 1.1.1.1 2000/10/25 08:40:00 jlam Exp $ - ---- search.par.in.orig Sun Apr 30 09:59:16 2000 -+++ search.par.in -@@ -20,7 +20,7 @@ - - # Endgame Tablebases - if you have them installed - --EGTB_PATH c:\projects\exchess\tb -+EGTB_PATH @PREFIX@/share/egtb - EGTB_CACHE_SIZE 2.0 # Tablebase cache size in megabytes - - # Log File -@@ -32,7 +32,7 @@ - - GAMBIT_SCORE 80 # Maximum gambit allowed - BOOK_FILE open_bk.dat # Name of the opening book file --BOOK_LEARNING 1 # Set to 0 for no book learning -+BOOK_LEARNING 0 # Set to 0 for no book learning - - # Search Extensions - # diff --git a/games/exchess/patches/patch-af b/games/exchess/patches/patch-af deleted file mode 100644 index 22aa8261130..00000000000 --- a/games/exchess/patches/patch-af +++ /dev/null @@ -1,32 +0,0 @@ -$NetBSD: patch-af,v 1.2 2013/04/30 22:20:58 joerg Exp $ - ---- hash.h.orig 2000-02-25 18:31:36.000000000 +0000 -+++ hash.h -@@ -17,7 +17,7 @@ struct hash_rec - short score; - char flag; - unsigned char depth; -- move hmove; -+ my_move hmove; - unsigned char id; - unsigned char mate_ext; - }; -@@ -46,14 +46,14 @@ struct pawn_rec - void open_hash(); - void close_hash(); - void set_hash_size(int Mbytes); --void put_hash(h_code h_key, int score, int alpha, int beta, int depth, move hmove, int mate_ext); --int get_hash(h_code h_key, int alpha, int beta, int depth, int *mate_ext, int *null_hash, move *gmove); -+void put_hash(h_code h_key, int score, int alpha, int beta, int depth, my_move hmove, int mate_ext); -+int get_hash(h_code h_key, int alpha, int beta, int depth, int *mate_ext, int *null_hash, my_move *gmove); - int get_move(h_code h_key); - h_code gen_code(position *p); - void start_code(); - float ran(long *idum); - - /* Macro for or'ing two hash codes */ --#define or(A, B) A.address ^= B.address; A.key ^= B.key -+#define hash_or(A, B) A.address ^= B.address; A.key ^= B.key - --#endif HASH_H -+#endif // HASH_H diff --git a/games/exchess/patches/patch-ag b/games/exchess/patches/patch-ag deleted file mode 100644 index 505c0ed7e5e..00000000000 --- a/games/exchess/patches/patch-ag +++ /dev/null @@ -1,47 +0,0 @@ -$NetBSD: patch-ag,v 1.2 2013/04/30 22:20:58 joerg Exp $ - ---- hash.cpp.orig 2000-04-01 07:46:34.000000000 +0000 -+++ hash.cpp -@@ -67,7 +67,7 @@ void close_hash() - - /* function to stuff a hash entry into the hash table */ - void put_hash(h_code h_key, int score, int alpha, int beta, -- int depth, move hmove, int mate_ext) -+ int depth, my_move hmove, int mate_ext) - { - hash_rec *h, *r; int flag; - -@@ -127,7 +127,7 @@ void put_hash(h_code h_key, int score, i - } - - /* function to find and return a hash entry */ --int get_hash(h_code h_key, int alpha, int beta, int depth, int *mate_ext, int *null_hash, move *gmove) -+int get_hash(h_code h_key, int alpha, int beta, int depth, int *mate_ext, int *null_hash, my_move *gmove) - { - hash_rec *h; int hscore; - -@@ -210,7 +210,7 @@ h_code gen_code(position *p) - } - - for(i = 0; i < 64; i++) { -- or(temp_rec, hval[ID(p->sq[i])][i]); -+ hash_or(temp_rec, hval[ID(p->sq[i])][i]); - if(p->sq[i].side == p->wtm) p->material += value[p->sq[i].type]; - else p->material -= value[p->sq[i].type]; - if(p->sq[i].type > PAWN) p->pieces[p->sq[i].side]++; -@@ -220,11 +220,11 @@ h_code gen_code(position *p) - } - } - -- if(p->wtm) { or(temp_rec, wtm); } -- else { or(temp_rec, btm); } -+ if(p->wtm) { hash_or(temp_rec, wtm); } -+ else { hash_or(temp_rec, btm); } - -- or(temp_rec, castle_code[p->castle]); -- or(temp_rec, ep_code[p->ep]); -+ hash_or(temp_rec, castle_code[p->castle]); -+ hash_or(temp_rec, ep_code[p->ep]); - - return temp_rec; - } diff --git a/games/exchess/patches/patch-ah b/games/exchess/patches/patch-ah deleted file mode 100644 index 7ef7cdcd375..00000000000 --- a/games/exchess/patches/patch-ah +++ /dev/null @@ -1,16 +0,0 @@ -$NetBSD: patch-ah,v 1.1 2004/02/14 04:31:56 kristerw Exp $ - ---- score.cpp.orig Sat Feb 14 04:22:38 2004 -+++ score.cpp Sat Feb 14 04:30:18 2004 -@@ -99,9 +99,9 @@ - +++++++++++++++++++++++++++++++++*/ - pcode = stage_code[stage]; - for(i=1;i<=p->plist[WHITE][PAWN][0];i++) -- or(pcode, hval[WPAWN][p->plist[WHITE][PAWN][i]]); -+ hash_or(pcode, hval[WPAWN][p->plist[WHITE][PAWN][i]]); - for(i=1;i<=p->plist[BLACK][PAWN][0];i++) -- or(pcode, hval[BPAWN][p->plist[BLACK][PAWN][i]]); -+ hash_or(pcode, hval[BPAWN][p->plist[BLACK][PAWN][i]]); - - /*+++++++++++++++++++++++++++++++ - | diff --git a/games/exchess/patches/patch-ai b/games/exchess/patches/patch-ai deleted file mode 100644 index 62c045e25b7..00000000000 --- a/games/exchess/patches/patch-ai +++ /dev/null @@ -1,157 +0,0 @@ -$NetBSD: patch-ai,v 1.3 2013/04/30 22:20:58 joerg Exp $ - ---- exmove.cpp.orig 2000-04-01 07:46:42.000000000 +0000 -+++ exmove.cpp -@@ -8,7 +8,7 @@ - #include "const.h" - #include "funct.h" - #include "hash.h" --#include "iostream.h" -+#include <iostream> - - /* Hash code variables */ - extern hash_rec *hash_table; // pointer to hash_table -@@ -37,7 +37,7 @@ inline int simple_check(position *p, int - // If the move is legal, the function returns a 1, otherwise 0. - // Note that the move is made, regardless - so proper precautions - // need to be taken, if the move might need to be undone --int exec_move(position *p, move emove, int ply) -+int exec_move(position *p, my_move emove, int ply) - { - register int pi; - // if this is a castle, check that it is legal then -@@ -52,8 +52,8 @@ int exec_move(position *p, move emove, i - { return 0; } - p->sq[5] = p->sq[7]; - p->sq[7] = empty; -- or(p->hcode, hval[WROOK][5]); -- or(p->hcode, hval[WROOK][7]); -+ hash_or(p->hcode, hval[WROOK][5]); -+ hash_or(p->hcode, hval[WROOK][7]); - p->has_castled[1] = 1; - /* update piece list */ - for(pi=1;pi<=p->plist[p->wtm][ROOK][0];pi++) -@@ -69,8 +69,8 @@ int exec_move(position *p, move emove, i - { return 0; } - p->sq[3] = p->sq[0]; - p->sq[0] = empty; -- or(p->hcode, hval[WROOK][3]); -- or(p->hcode, hval[WROOK][0]); -+ hash_or(p->hcode, hval[WROOK][3]); -+ hash_or(p->hcode, hval[WROOK][0]); - p->has_castled[1] = 1; - /* update piece list */ - for(pi=1;pi<=p->plist[p->wtm][ROOK][0];pi++) -@@ -86,8 +86,8 @@ int exec_move(position *p, move emove, i - { return 0; } - p->sq[61] = p->sq[63]; - p->sq[63] = empty; -- or(p->hcode, hval[BROOK][61]); -- or(p->hcode, hval[BROOK][63]); -+ hash_or(p->hcode, hval[BROOK][61]); -+ hash_or(p->hcode, hval[BROOK][63]); - p->has_castled[0] = 1; - /* update piece list */ - for(pi=1;pi<=p->plist[p->wtm][ROOK][0];pi++) -@@ -103,8 +103,8 @@ int exec_move(position *p, move emove, i - { return 0; } - p->sq[59] = p->sq[56]; - p->sq[56] = empty; -- or(p->hcode, hval[BROOK][59]); -- or(p->hcode, hval[BROOK][56]); -+ hash_or(p->hcode, hval[BROOK][59]); -+ hash_or(p->hcode, hval[BROOK][56]); - p->has_castled[0] = 1; - /* update piece list */ - for(pi=1;pi<=p->plist[p->wtm][ROOK][0];pi++) -@@ -125,7 +125,7 @@ int exec_move(position *p, move emove, i - - if(p->sq[emove.b.to].type) { - // Remove hashcode for the target square -- or(p->hcode, hval[ID(p->sq[emove.b.to])][emove.b.to]); -+ hash_or(p->hcode, hval[ID(p->sq[emove.b.to])][emove.b.to]); - // Remove piece from piece list - for(pi=1;pi<=p->plist[p->wtm^1][p->sq[emove.b.to].type][0];pi++) - if(p->plist[p->wtm^1][p->sq[emove.b.to].type][pi] == emove.b.to) { -@@ -143,8 +143,8 @@ int exec_move(position *p, move emove, i - // Move the new piece to the target square - p->sq[emove.b.to] = p->sq[emove.b.from]; - // Update the hash code to reflect the move -- or(p->hcode, hval[ID(p->sq[emove.b.from])][emove.b.from]); -- or(p->hcode, hval[ID(p->sq[emove.b.from])][emove.b.to]); -+ hash_or(p->hcode, hval[ID(p->sq[emove.b.from])][emove.b.from]); -+ hash_or(p->hcode, hval[ID(p->sq[emove.b.from])][emove.b.to]); - // Original square is now empty - p->sq[emove.b.from] = empty; - -@@ -152,7 +152,7 @@ int exec_move(position *p, move emove, i - if(emove.b.type&EP) { - if(p->wtm) { - p->sq[emove.b.to-8] = empty; -- or(p->hcode, hval[BPAWN][emove.b.to-8]); -+ hash_or(p->hcode, hval[BPAWN][emove.b.to-8]); - // Update piece lists - for(pi=1;pi<=p->plist[p->wtm^1][PAWN][0];pi++) - if(p->plist[BLACK][PAWN][pi] == emove.b.to-8) { -@@ -163,7 +163,7 @@ int exec_move(position *p, move emove, i - } - } else { - p->sq[emove.b.to+8] = empty; -- or(p->hcode, hval[WPAWN][emove.b.to+8]); -+ hash_or(p->hcode, hval[WPAWN][emove.b.to+8]); - // Update piece lists - for(pi=1;pi<=p->plist[p->wtm^1][PAWN][0];pi++) - if(p->plist[WHITE][PAWN][pi] == emove.b.to+8) { -@@ -189,7 +189,7 @@ int exec_move(position *p, move emove, i - // if the move is a promotion, promote it - if(emove.b.type&PROMOTE) { - // Remove the pawn from the hash code -- or(p->hcode, hval[ID(p->sq[emove.b.to])][emove.b.to]); -+ hash_or(p->hcode, hval[ID(p->sq[emove.b.to])][emove.b.to]); - // Change the piece type to the promoted piece - p->sq[emove.b.to].type = emove.b.promote; - // Add the new piece to the piece lists -@@ -206,7 +206,7 @@ int exec_move(position *p, move emove, i - // adjust material score - p->material += value[emove.b.promote] - value[PAWN]; - // add piece to hash code -- or(p->hcode, hval[ID(p->sq[emove.b.to])][emove.b.to]); -+ hash_or(p->hcode, hval[ID(p->sq[emove.b.to])][emove.b.to]); - // adjust total piece count - p->pieces[p->wtm]++; - } -@@ -214,11 +214,11 @@ int exec_move(position *p, move emove, i - // update position characteristics - p->wtm = p->wtm^1; - p->material = -p->material; -- or(p->hcode, btm); or(p->hcode, wtm); -+ hash_or(p->hcode, btm); hash_or(p->hcode, wtm); - - // undo hash code for en-passant and castling status -- or(p->hcode, ep_code[p->ep]); -- or(p->hcode, castle_code[p->castle]); -+ hash_or(p->hcode, ep_code[p->ep]); -+ hash_or(p->hcode, castle_code[p->castle]); - - // if move is a pawn push 2 spaces, set en passant flag - if((emove.b.type&PAWN_PUSH2) && -@@ -235,8 +235,8 @@ int exec_move(position *p, move emove, i - p->last = emove; - - // update hash code for en-passant and castling status -- or(p->hcode, ep_code[p->ep]); -- or(p->hcode, castle_code[p->castle]); -+ hash_or(p->hcode, ep_code[p->ep]); -+ hash_or(p->hcode, castle_code[p->castle]); - - // check whether other side is placed in check - int ptype = p->sq[emove.b.to].type; -@@ -270,7 +270,7 @@ int exec_move(position *p, move emove, i - - // Function to make the move in the q-search - // - much simpler --int qexec_move(position *p, move emove, int ply) -+int qexec_move(position *p, my_move emove, int ply) - { - register int pi; - diff --git a/games/exchess/patches/patch-aj b/games/exchess/patches/patch-aj deleted file mode 100644 index d2863f04c22..00000000000 --- a/games/exchess/patches/patch-aj +++ /dev/null @@ -1,90 +0,0 @@ -$NetBSD: patch-aj,v 1.3 2013/04/30 22:20:58 joerg Exp $ - ---- search.cpp.orig 2000-04-30 09:56:56.000000000 +0000 -+++ search.cpp -@@ -4,7 +4,7 @@ - /* Search Functions */ - #define TIME_FLAG 123456 - --#include <iostream.h> -+#include <iostream> - #include <stdio.h> - - #if DEBUG -@@ -12,7 +12,10 @@ - #include <stdlib.h> - #endif - --#include <fstream.h> -+#include <fstream> -+ -+using namespace std; -+ - #include "define.h" - #include "chess.h" - #include "const.h" -@@ -24,7 +27,7 @@ - /*----------------------- Search function ---------------------*/ - // Driver for the search process. 1st initialize important data - // structures, the do iterative deeping until time runs out. --move search(position p, int time_limit, int T) -+my_move search(position p, int time_limit, int T) - { - char outstring[60], mstring[10]; - int g, done, pvi; -@@ -181,7 +184,7 @@ move search(position p, int time_limit, - last_depth = 1; - - // adjusting hash code for game stage -- or(p.hcode, stage_code[stage]); -+ hash_or(p.hcode, stage_code[stage]); - - // initialize history table - for(int i = 0; i < 64; i++) -@@ -261,7 +264,7 @@ move search(position p, int time_limit, - } - - // adjusting hash code for game stage -- or(p.hcode, stage_code[stage]); -+ hash_or(p.hcode, stage_code[stage]); - - if(!xboard && !ALLEG && post) { - cout << "\nnode_count = " << node_count -@@ -351,7 +354,7 @@ move search(position p, int time_limit, - // It is updated by doing a mem-copy of the principle continuation - // found at deeper depths to this depth + the move at this depth - // is stuffed in first. --inline void pc_update(move pcmove, int ply) -+inline void pc_update(my_move pcmove, int ply) - { - int pci; - pc[ply][ply].t = pcmove.t; -@@ -395,7 +398,7 @@ int pvs(int alpha, int beta, int depth, - int score, old_depth = depth, mate_ext = 0; - int mcount = 0, first = 1, razor = 0; - int razor_margin, total_pieces; -- move smove, gmove, bmove = nomove; -+ my_move smove, gmove, bmove = nomove; - - #if DEBUG - // Debug archiving of search to a file -@@ -423,7 +426,7 @@ outfile << space_string << "->Ply: " << - if(ply) { - // add hash code for this position to position list - p_list[turn+ply-1] = sp[ply].hcode; -- or(p_list[turn+ply-1], stage_code[stage]); -+ hash_or(p_list[turn+ply-1], stage_code[stage]); - - // fifty move rule - if(sp[ply].fifty >= 100) return(0); -@@ -470,8 +473,8 @@ outfile << space_string << "->Ply: " << - { - node_count++; - sp[ply+1] = sp[ply]; sp[ply+1].wtm ^= 1; -- or(sp[ply+1].hcode,wtm); -- or(sp[ply+1].hcode,btm); -+ hash_or(sp[ply+1].hcode,wtm); -+ hash_or(sp[ply+1].hcode,btm); - sp[ply+1].last.t = NOMOVE; sp[ply+1].ep = 0; - sp[ply+1].material = -sp[ply+1].material; - sp[ply+1].fifty = 0; diff --git a/games/exchess/patches/patch-ak b/games/exchess/patches/patch-ak deleted file mode 100644 index 15cca7f1f8d..00000000000 --- a/games/exchess/patches/patch-ak +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-ak,v 1.1 2005/04/17 05:48:34 minskim Exp $ - ---- util.cpp.orig 2000-04-01 07:39:12.000000000 -0600 -+++ util.cpp -@@ -11,6 +11,7 @@ - #else - #include <sys/time.h> - #endif -+#include <time.h> - - // Function return the time since an arbitrary reference in - // 100ths of a second diff --git a/games/exchess/patches/patch-funct.h b/games/exchess/patches/patch-funct.h deleted file mode 100644 index 23b0ad55803..00000000000 --- a/games/exchess/patches/patch-funct.h +++ /dev/null @@ -1,36 +0,0 @@ -$NetBSD: patch-funct.h,v 1.1 2013/04/30 22:20:58 joerg Exp $ - ---- funct.h.orig 2013-04-30 20:06:16.000000000 +0000 -+++ funct.h -@@ -22,23 +22,23 @@ void log_search(int score, long start_ti - void setboard(char inboard[60], char ms, char castle[4], char ep[2]); // setup the board - - /* parse.cpp */ --void print_move(position p, move pmove, char mstring[10]); // print a given move --move parse_move(position p, char mstring[10]); -+void print_move(position p, my_move pmove, char mstring[10]); // print a given move -+my_move parse_move(position p, char mstring[10]); - - /* open.cpp */ --move opening_book(h_code hash_code, position p); -+my_move opening_book(h_code hash_code, position p); - - /* search.cpp */ --move search(position p, int time_limit, int T); --void pc_update(move pcmove, int ply); -+my_move search(position p, int time_limit, int T); -+void pc_update(my_move pcmove, int ply); - int pvs(int alpha, int beta, int depth, int ply); - int qsearch(int ply, int alpha, int beta); - - /* emove.cpp */ --int exec_move(position *p, move emove, int ply); --int qexec_move(position *p, move emove, int ply); -+int exec_move(position *p, my_move emove, int ply); -+int qexec_move(position *p, my_move emove, int ply); - void gen_check_table(); --// int undo_move(position *p, move emove, int ply); -+// int undo_move(position *p, my_move emove, int ply); - - /* movelist.cpp */ - void legalmoves(position *p, move_list *list); diff --git a/games/exchess/patches/patch-main.h b/games/exchess/patches/patch-main.h deleted file mode 100644 index 272f0f92343..00000000000 --- a/games/exchess/patches/patch-main.h +++ /dev/null @@ -1,25 +0,0 @@ -$NetBSD: patch-main.h,v 1.1 2013/04/30 22:20:58 joerg Exp $ - ---- main.h.orig 2013-04-30 20:07:34.000000000 +0000 -+++ main.h -@@ -16,7 +16,7 @@ position last_pos; - - - --move game_history[600]; // game move history -+my_move game_history[600]; // game move history - - h_code p_list[600]; // game position list - -@@ -36,9 +36,9 @@ int both = 0; - - - --move best; // best move - will be made -+my_move best; // best move - will be made - --extern move pc[MAXD+1][MAXD+1]; // principle continuation -+extern my_move pc[MAXD+1][MAXD+1]; // principle continuation - - - diff --git a/games/exchess/patches/patch-parse.cpp b/games/exchess/patches/patch-parse.cpp deleted file mode 100644 index 9067011afa3..00000000000 --- a/games/exchess/patches/patch-parse.cpp +++ /dev/null @@ -1,35 +0,0 @@ -$NetBSD: patch-parse.cpp,v 1.2 2013/04/30 22:20:58 joerg Exp $ - ---- parse.cpp.orig 2000-04-01 07:46:06.000000000 +0000 -+++ parse.cpp -@@ -7,18 +7,18 @@ - #include "chess.h" - #include "funct.h" - #include "const.h" --#include <iostream.h> -+#include <iostream> - #include <stdio.h> - #include <string.h> - - extern int ics; - // Function to parse a move from the human player - // This move is checked then checked to see if it is legal --move parse_move(position p, char mstring[10]) -+my_move parse_move(position p, char mstring[10]) - { - int legal = 0, piece, to_sq = -1, from_sq = -1, promote = QUEEN; - int from_file = -1, from_row = -1, match_count = 0; -- move play, mplay[4], nomove; nomove.t = 0; -+ my_move play, mplay[4], nomove; nomove.t = 0; - mplay[0].t = 0; mplay[1].t = 0; mplay[2].t = 0; mplay[3].t = 0; - position t_pos; - move_list list; -@@ -175,7 +175,7 @@ move parse_move(position p, char mstring - // to a string in long algebraic format - // This function works by simply adding the appropriate - // characters to the move string; --void print_move(position p, move pmove, char mstring[10]) -+void print_move(position p, my_move pmove, char mstring[10]) - { - char dummy[10]; // dummy character string - int ptype, pfrom, pto, ppiece; diff --git a/games/exchess/patches/patch-pmoves.cpp b/games/exchess/patches/patch-pmoves.cpp deleted file mode 100644 index 5949dcee6eb..00000000000 --- a/games/exchess/patches/patch-pmoves.cpp +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-pmoves.cpp,v 1.1 2013/04/30 22:20:58 joerg Exp $ - ---- pmoves.cpp.orig 2013-04-30 20:06:41.000000000 +0000 -+++ pmoves.cpp -@@ -10,7 +10,7 @@ - - extern unsigned int history[64][64]; // history table - extern int killer1[2], killer2[2], killer3[2]; --extern move hmove; // hash move -+extern my_move hmove; // hash move - extern int taxi_cab[64][64]; - extern int stage; - extern int check_table[64][64], knight_check_table[64][64]; diff --git a/games/exchess/patches/patch-search.h b/games/exchess/patches/patch-search.h deleted file mode 100644 index 4c5bb6bbf56..00000000000 --- a/games/exchess/patches/patch-search.h +++ /dev/null @@ -1,28 +0,0 @@ -$NetBSD: patch-search.h,v 1.1 2013/04/30 22:20:58 joerg Exp $ - ---- search.h.orig 2013-04-30 20:07:06.000000000 +0000 -+++ search.h -@@ -25,7 +25,7 @@ int RAZOR_DEPTH = 192; - position sp[MAXD]; // array of search positions - - move_list slist[MAXD+1]; // array of search lists --move pc[MAXD+1][MAXD+1]; // triangular array for search -+my_move pc[MAXD+1][MAXD+1]; // triangular array for search - // principle continuation - - int max_ply; // max ply of current search -@@ -51,10 +51,10 @@ int g_last; // l - - int killer1[2], killer2[2], killer3[2]; // killer moves - --move nomove; // move for initization purposes --move hmove; // move from hash table --move bookm; // move from opening book --move ponder_move; // move we are pondering -+my_move nomove; // move for initization purposes -+my_move hmove; // move from hash table -+my_move bookm; // move from opening book -+my_move ponder_move; // move we are pondering - - unsigned int history[64][64]; // table for history scores - diff --git a/games/exchess/patches/patch-search.par.in b/games/exchess/patches/patch-search.par.in new file mode 100644 index 00000000000..7465070a7b9 --- /dev/null +++ b/games/exchess/patches/patch-search.par.in @@ -0,0 +1,15 @@ +$NetBSD: patch-search.par.in,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Replace hardcoded path. + +--- search.par.in.orig 2014-08-17 11:03:10.000000000 +0000 ++++ search.par.in +@@ -40,7 +40,7 @@ LIMIT_THREADS 4 # Maximum num + + # Endgame Tablebases - if you have them installed + +-EGTB_PATH /Users/homand/EXchess/TB ++EGTB_PATH @PREFIX@/share/egtb + EGTB_CACHE_SIZE 8.0 # Tablebase cache size in megabytes + + # Log File diff --git a/games/exchess/patches/patch-setup.cpp b/games/exchess/patches/patch-setup.cpp deleted file mode 100644 index f6b2826aa23..00000000000 --- a/games/exchess/patches/patch-setup.cpp +++ /dev/null @@ -1,24 +0,0 @@ -$NetBSD: patch-setup.cpp,v 1.1 2011/11/25 21:52:33 joerg Exp $ - ---- setup.cpp.orig 2011-11-25 17:25:49.000000000 +0000 -+++ setup.cpp -@@ -7,8 +7,8 @@ - // routines are run when EXchess first starts up. - // - --#include <iostream.h> --#include <fstream.h> -+#include <iostream> -+#include <fstream> - #include <stdlib.h> - #include <string.h> - -@@ -18,6 +18,8 @@ - #include "funct.h" - #include "hash.h" - -+using namespace std; -+ - /* Simple tables for quick in_check? tests */ - int check_table[64][64]; - int rook_check_table[64][64]; diff --git a/games/exchess/patches/patch-src_book.cpp b/games/exchess/patches/patch-src_book.cpp new file mode 100644 index 00000000000..beca4fe2da2 --- /dev/null +++ b/games/exchess/patches/patch-src_book.cpp @@ -0,0 +1,48 @@ +$NetBSD: patch-src_book.cpp,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Avoid 'move' conflict. + +--- src/book.cpp.orig 2014-08-17 11:03:08.000000000 +0000 ++++ src/book.cpp +@@ -44,7 +44,7 @@ void build_book(position ipos) + char instring[100], line[100]; // strings from input files + char outbook[100], resp; + position temp_pos; // temporary position +- move bmove; // book move under consideration ++ my_move bmove; // book move under consideration + unsigned __int64 pcode; // hash code for position + int i = -1, j = 0, p,q; // loop variables + int r, s; +@@ -314,7 +314,7 @@ void build_book(position ipos) + //-------------------------------------------------------- + // Function to find a position in the book + //-------------------------------------------------------- +-int find_record(position p, move m, int file_size, book_rec *book_record, fstream *book_f, int file_pos) ++int find_record(position p, my_move m, int file_size, book_rec *book_record, fstream *book_f, int file_pos) + { + int jump = int(file_size/2); + unsigned __int64 pcode = ZERO; +@@ -384,12 +384,12 @@ int find_record(position p, move m, int + // becomes a candidate move. Information is stored to + // facilitate easy learning during the game. + //-------------------------------------------------------- +-move opening_book(h_code hash_code, position p, game_rec *gr) ++my_move opening_book(h_code hash_code, position p, game_rec *gr) + { + int file_size, mflag = 0, j; + int candidates = 0, total_score = 0; + move_list list; +- move nomove; nomove.t = 0; ++ my_move nomove; nomove.t = 0; + char book_file[100]; // file name for the book + book_rec book_record; // record of move considered + int file_pos; // file position of record +@@ -680,7 +680,7 @@ int edit_book(h_code hash_code, position + if(outflag == 1) cout << "\n"; + + /* Edit mode for individual moves */ +- move edit_move; ++ my_move edit_move; + while(1) { + cout << "\nEnter a move to be edited/investigated (0 = quit): "; + cin >> mstring; if(mstring[0] == '0') break; diff --git a/games/exchess/patches/patch-src_chess.h b/games/exchess/patches/patch-src_chess.h new file mode 100644 index 00000000000..d24cebb44c2 --- /dev/null +++ b/games/exchess/patches/patch-src_chess.h @@ -0,0 +1,138 @@ +$NetBSD: patch-src_chess.h,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Avoid 'move' conflict. + +--- src/chess.h.orig 2014-08-17 11:03:08.000000000 +0000 ++++ src/chess.h +@@ -30,7 +30,7 @@ struct move_t { + // union of move_t and an integer to make comparison of + // moves easier. (as suggested in Tom Kerrigans simple chess program) + +-union move { ++union my_move { + move_t b; + int32_t t; // assuming a 32 bit integer + }; +@@ -38,7 +38,7 @@ union move { + // Add a score for sorting purposes to the move record + + struct move_rec { +- move m; ++ my_move m; + int score; + }; + +@@ -82,10 +82,10 @@ struct position { + + unsigned char threat_square; + +- move hmove; // expected best move +- move rmove; // reply move +- move cmove; // combination move +- move pmove; // pawn hash move ++ my_move hmove; // expected best move ++ my_move rmove; // reply move ++ my_move cmove; // combination move ++ my_move pmove; // pawn hash move + + int8_t gstage; // game stage, range 0-16 -- depends only + // upon pawn structure --> important for pawn hashing! +@@ -93,7 +93,7 @@ struct position { + // -- should check this for all subtractions! unsigned ints + // may be converted incorrectly if they are negated. + int8_t plist[2][7][10]; // piece lists +- move last; // last move made ++ my_move last; // last move made + h_code hcode; // hash code + h_code pcode; // pawn hash code + +@@ -130,7 +130,7 @@ struct position { + void rook_cc(move_list *list, int sqr, int ds); + + /* exmove.cpp */ +- int exec_move(move emove, int ply); ++ int exec_move(my_move emove, int ply); + + /* attacks.cpp */ + int simple_check(int move_sq); +@@ -159,8 +159,8 @@ struct position { + + /* support.cpp */ + void write_fen(); +- void print_move(move pmove, char mstring[10], ts_thread_data *temps); +- move parse_move(char mstring[10], ts_thread_data *temps); ++ void print_move(my_move pmove, char mstring[10], ts_thread_data *temps); ++ my_move parse_move(char mstring[10], ts_thread_data *temps); + + }; + +@@ -187,7 +187,7 @@ struct search_node { + cmove_rec *cmove; + pawn_rec *phash; // for getting a pawn hash move + +- move smove; // current move we are searching ++ my_move smove; // current move we are searching + + int ply; + int mate_ext; // did a mate extension occur? +@@ -227,7 +227,7 @@ struct ts_thread_data { + int quit_thread; // flag to tell thread to quit + + search_node n[MAXD+1]; // array of search positions +- move pc[MAXD+1][MAXD+1]; // triangular array for search ++ my_move pc[MAXD+1][MAXD+1]; // triangular array for search + // principle continuation + h_code plist[MAX_GAME_PLY]; // hash codes of positions visited + +@@ -269,7 +269,7 @@ struct ts_thread_data { + } + + /* search.cpp */ +- inline void pc_update(move pcmove, int ply); ++ inline void pc_update(my_move pcmove, int ply); + + }; + +@@ -296,9 +296,9 @@ struct tree_search { + int max_search_depth; // search depth limit set by xboard + int max_search_time; // search time limit set by xboard + +- move bookm; // move from opening book +- move ponder_move; // move we are pondering +- move last_displayed_move; // best move from previous search display ++ my_move bookm; // move from opening book ++ my_move ponder_move; // move we are pondering ++ my_move last_displayed_move; // best move from previous search display + + int tsuite, analysis_mode; // flags to determine whether we are in + // analysis mode or a test suite +@@ -307,7 +307,7 @@ struct tree_search { + + // variables to support testsuite mode + float soltime; +- unsigned int bmcount; move bmoves[256]; ++ unsigned int bmcount; my_move bmoves[256]; + int best_score; + char bmtype[3]; // "am" avoid move or "bm" best move string + +@@ -315,7 +315,7 @@ struct tree_search { + int no_book; // counter for positions with no book moves + + /* search.cpp */ +- move search(position p, int time_limit, int T, game_rec *gr); ++ my_move search(position p, int time_limit, int T, game_rec *gr); + int search_threads(int alpha, int beta, int depth, int threads); + void sort_root_moves(); + +@@ -352,9 +352,9 @@ struct game_rec { + position reset; // reset position for takebacks + /* available moves */ + move_list movelist; // list of pseudo-legal moves for current pos +- move best; // best move for current position ++ my_move best; // best move for current position + /* game history info */ +- move game_history[MAX_GAME_PLY]; // list of move played ++ my_move game_history[MAX_GAME_PLY]; // list of move played + + /* game control flags and counters */ + int T; // turn number diff --git a/games/exchess/patches/patch-src_exmove.cpp b/games/exchess/patches/patch-src_exmove.cpp new file mode 100644 index 00000000000..9b966f560d5 --- /dev/null +++ b/games/exchess/patches/patch-src_exmove.cpp @@ -0,0 +1,15 @@ +$NetBSD: patch-src_exmove.cpp,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Avoid 'move' conflict. + +--- src/exmove.cpp.orig 2014-08-17 11:03:08.000000000 +0000 ++++ src/exmove.cpp +@@ -15,7 +15,7 @@ + // If the move is legal, the function returns a 1, otherwise 0. + // Note that the move is made, regardless - so proper precautions + // need to be taken, if the move might need to be undone +-int position::exec_move(move emove, int ply) ++int position::exec_move(my_move emove, int ply) + { + move_t mv = emove.b; + register int pi; diff --git a/games/exchess/patches/patch-src_funct.h b/games/exchess/patches/patch-src_funct.h new file mode 100644 index 00000000000..8ff03ce73d0 --- /dev/null +++ b/games/exchess/patches/patch-src_funct.h @@ -0,0 +1,24 @@ +$NetBSD: patch-src_funct.h,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Avoid 'move' conflict. + +--- src/funct.h.orig 2014-08-17 11:03:08.000000000 +0000 ++++ src/funct.h +@@ -22,7 +22,7 @@ void write_out(const char *); // write + void performance(); // performance test function + + /* search.cpp */ +-void pc_update(move pcmove, int ply); ++void pc_update(my_move pcmove, int ply); + + /* setup.cpp */ + void set_search_param(); +@@ -37,7 +37,7 @@ void QuickSortMove(move_rec *Lb, move_re + void build_book(position ipos); + void book_learn(int flag, game_rec *gr); + int edit_book(h_code hash_code, position *p); +-move opening_book(h_code hash_code, position p, game_rec *gr); ++my_move opening_book(h_code hash_code, position p, game_rec *gr); + + /* util.cpp */ + int GetTime(); diff --git a/games/exchess/patches/patch-src_hash.cpp b/games/exchess/patches/patch-src_hash.cpp new file mode 100644 index 00000000000..08ed213f9f1 --- /dev/null +++ b/games/exchess/patches/patch-src_hash.cpp @@ -0,0 +1,15 @@ +$NetBSD: patch-src_hash.cpp,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Avoid 'move' conflict. + +--- src/hash.cpp.orig 2014-08-17 11:03:08.000000000 +0000 ++++ src/hash.cpp +@@ -211,7 +211,7 @@ void put_hash(h_code (*h_key), int score + //-------------------------------------------- + // function to find and return a hash entry + //-------------------------------------------- +-int get_hash(h_code (*h_key), int *hflag, int *hdepth, int *mate_ext, move *gmove, int ply) ++int get_hash(h_code (*h_key), int *hflag, int *hdepth, int *mate_ext, my_move *gmove, int ply) + { + hash_bucket *h; int best_depth_rec = -1; + diff --git a/games/exchess/patches/patch-src_hash.h b/games/exchess/patches/patch-src_hash.h new file mode 100644 index 00000000000..185d3926a10 --- /dev/null +++ b/games/exchess/patches/patch-src_hash.h @@ -0,0 +1,24 @@ +$NetBSD: patch-src_hash.h,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Avoid 'move' conflict. + +--- src/hash.h.orig 2014-08-17 11:03:08.000000000 +0000 ++++ src/hash.h +@@ -26,7 +26,7 @@ + struct hash_rec + { + h_code hr_key; +- move hr_hmove; ++ my_move hr_hmove; + int16_t hr_score; + char hr_depth; // note that stored depths cannot be larger than 127 + unsigned char hr_data; // first 5 bits = id, next 2 = flag, next 1 = mate_ext +@@ -132,7 +132,7 @@ void open_hash(); + void close_hash(); + void set_hash_size(unsigned int Mbytes); + void put_hash(h_code *h_key, int score, int alpha, int beta, int depth, int hmove, int mate_ext, int h_id, int ply); +-int get_hash(h_code *h_key, int *hflag, int *hdepth, int *mate_ext, move *gmove, int ply); ++int get_hash(h_code *h_key, int *hflag, int *hdepth, int *mate_ext, my_move *gmove, int ply); + int get_move(h_code *h_key); + int put_move(h_code h_key, int putmove, int h_id); + diff --git a/games/exchess/patches/patch-src_main.cpp b/games/exchess/patches/patch-src_main.cpp new file mode 100644 index 00000000000..ff7d5a1311b --- /dev/null +++ b/games/exchess/patches/patch-src_main.cpp @@ -0,0 +1,15 @@ +$NetBSD: patch-src_main.cpp,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Avoid 'move' conflict. + +--- src/main.cpp.orig 2014-08-17 11:03:08.000000000 +0000 ++++ src/main.cpp +@@ -104,7 +104,7 @@ char exec_path[FILENAME_MAX]; + int main(int argc, char *argv[]) + { + char mstring[10]; +- move hint; ++ my_move hint; + + #ifdef TEST_ASSERT + assert(0); // testing that asserts are off diff --git a/games/exchess/patches/patch-src_score.cpp b/games/exchess/patches/patch-src_score.cpp new file mode 100644 index 00000000000..3c62a6aa84c --- /dev/null +++ b/games/exchess/patches/patch-src_score.cpp @@ -0,0 +1,15 @@ +$NetBSD: patch-src_score.cpp,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Avoid overloaded function ambiguity. + +--- src/score.cpp.orig 2014-08-17 11:03:08.000000000 +0000 ++++ src/score.cpp +@@ -67,7 +67,7 @@ int position::score_pos(game_rec *gr, ts + int TRADES = AVERAGE_SCORE(TRADES_EARLY, TRADES_LATE); + // bonus scales current material score by the ratio of the pawn count + // to the total piece count +- score += (TRADES*score*(pawn_count-piece_count))/(500*sqrt(pawn_count+piece_count)); ++ score += (TRADES*score*(pawn_count-piece_count))/(500*sqrt((float)pawn_count+piece_count)); + } + + /*+++++++++++++++++++++++++++++++ diff --git a/games/exchess/patches/patch-src_search.cpp b/games/exchess/patches/patch-src_search.cpp new file mode 100644 index 00000000000..1c790a12e1b --- /dev/null +++ b/games/exchess/patches/patch-src_search.cpp @@ -0,0 +1,33 @@ +$NetBSD: patch-src_search.cpp,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Avoid 'move' conflict. + +--- src/search.cpp.orig 2014-08-17 11:03:08.000000000 +0000 ++++ src/search.cpp +@@ -39,7 +39,7 @@ unsigned __int64 attempts=0, successes=0 + /*----------------------- Search function ---------------------*/ + // Driver for the search process. 1st initialize important data + // structures, then do iterative deeping until time runs out. +-move tree_search::search(position p, int time_limit, int T, game_rec *gr) ++my_move tree_search::search(position p, int time_limit, int T, game_rec *gr) + { + char outstring[400], mstring[10]; + int g, done, pvi; +@@ -47,7 +47,7 @@ move tree_search::search(position p, int + int last_mate_score = 0, mate_iteration_count = 0; + int limit_search_depth = max_search_depth; + position pv_pos; +- move nomove; nomove.t = NOMOVE; ++ my_move nomove; nomove.t = NOMOVE; + + #if DEBUG_SEARCH + search_outfile.open("search_debug.log"); +@@ -527,7 +527,7 @@ move tree_search::search(position p, int + // It is updated by doing a mem-copy of the principle continuation + // found at deeper depths to this depth + the move at this depth + // is stuffed in first. +-inline void ts_thread_data::pc_update(move pcmove, int ply) ++inline void ts_thread_data::pc_update(my_move pcmove, int ply) + { + int pci; + pc[ply][ply].t = pcmove.t; diff --git a/games/exchess/patches/patch-src_support.cpp b/games/exchess/patches/patch-src_support.cpp new file mode 100644 index 00000000000..bfbe11d1633 --- /dev/null +++ b/games/exchess/patches/patch-src_support.cpp @@ -0,0 +1,29 @@ +$NetBSD: patch-src_support.cpp,v 1.1 2014/09/11 16:59:16 jperkin Exp $ + +Avoid 'move' conflict. + +--- src/support.cpp.orig 2014-08-17 11:03:08.000000000 +0000 ++++ src/support.cpp +@@ -24,11 +24,11 @@ + // Function to parse a move from the human player + // This move is checked then checked to see if it is legal + //---------------------------------------------------------- +-move position::parse_move(char mstring[10], ts_thread_data *temps) ++my_move position::parse_move(char mstring[10], ts_thread_data *temps) + { + int legal = 0, piece, to_sq = -1, from_sq = -1, promote = QUEEN; + int from_file = -1, from_row = -1, match_count = 0; +- move play, mplay[4], nomove; ++ my_move play, mplay[4], nomove; + play.t = 0; nomove.t = 0; + mplay[0].t = 0; mplay[1].t = 0; mplay[2].t = 0; mplay[3].t = 0; + position t_pos; +@@ -200,7 +200,7 @@ move position::parse_move(char mstring[1 + // long algebraic format. This function works by simply + // adding the appropriate characters to the move string + //---------------------------------------------------------- +-void position::print_move(move pmove, char mstring[10], ts_thread_data *temps) ++void position::print_move(my_move pmove, char mstring[10], ts_thread_data *temps) + { + char dummy[10]; // dummy character string + int ptype, pfrom, pto, ppiece; |