Sun Feb 9 16:50:45 2014 UTC ()
Fix build on SunOS (u_int64_t usage and ambigous math)


(wiedi)
diff -r1.15 -r1.16 pkgsrc/games/exchess/Makefile
diff -r1.9 -r1.10 pkgsrc/games/exchess/distinfo
diff -r1.5 -r1.6 pkgsrc/games/exchess/patches/patch-ad

cvs diff -r1.15 -r1.16 pkgsrc/games/exchess/Makefile (expand / switch to unified diff)

--- pkgsrc/games/exchess/Makefile 2012/10/06 11:54:36 1.15
+++ pkgsrc/games/exchess/Makefile 2014/02/09 16:50:45 1.16
@@ -1,34 +1,36 @@ @@ -1,34 +1,36 @@
1# $NetBSD: Makefile,v 1.15 2012/10/06 11:54:36 asau Exp $ 1# $NetBSD: Makefile,v 1.16 2014/02/09 16:50:45 wiedi Exp $
2 2
3DISTNAME= EXCH314S 3DISTNAME= EXCH314S
4# 5.01beta available 4# 5.01beta available
5PKGNAME= exchess-3.14 5PKGNAME= exchess-3.14
6PKGREVISION= 1 6PKGREVISION= 1
7CATEGORIES= games 7CATEGORIES= games
8MASTER_SITES= ${MASTER_SITE_LOCAL} 8MASTER_SITES= ${MASTER_SITE_LOCAL}
9EXTRACT_SUFX= .zip 9EXTRACT_SUFX= .zip
10 10
11MAINTAINER= pkgsrc-users@NetBSD.org 11MAINTAINER= pkgsrc-users@NetBSD.org
12HOMEPAGE= http://personal.denison.edu/~homand/EXchess.htm 12HOMEPAGE= http://personal.denison.edu/~homand/EXchess.htm
13COMMENT= Experimental chess engine 13COMMENT= Experimental chess engine
14 14
15USE_LANGUAGES= c++ 15USE_LANGUAGES= c++
16NO_CONFIGURE= yes 16NO_CONFIGURE= yes
17 17
18WRKSRC= ${WRKDIR} 18WRKSRC= ${WRKDIR}
19LIBDIR= ${PREFIX}/lib/exchess 19LIBDIR= ${PREFIX}/lib/exchess
20DOCDIR= ${PREFIX}/share/doc/exchess 20DOCDIR= ${PREFIX}/share/doc/exchess
21 21
 22CFLAGS.SunOS+= -Du_int64_t=uint64_t
 23
22post-extract: 24post-extract:
23 cd ${WRKSRC} && ${MV} search.par search.par.in 25 cd ${WRKSRC} && ${MV} search.par search.par.in
24 ${CP} ${FILESDIR}/Makefile ${WRKSRC} 26 ${CP} ${FILESDIR}/Makefile ${WRKSRC}
25 27
26post-build: 28post-build:
27 ${SED} -e "s,@PREFIX@,${PREFIX},g" \ 29 ${SED} -e "s,@PREFIX@,${PREFIX},g" \
28 < ${WRKSRC}/search.par.in > ${WRKSRC}/search.par 30 < ${WRKSRC}/search.par.in > ${WRKSRC}/search.par
29 31
30INSTALLATION_DIRS+= bin lib/exchess ${DOCDIR} 32INSTALLATION_DIRS+= bin lib/exchess ${DOCDIR}
31 33
32do-install: 34do-install:
33 ${INSTALL_PROGRAM} ${WRKSRC}/exchess ${DESTDIR}${PREFIX}/bin 35 ${INSTALL_PROGRAM} ${WRKSRC}/exchess ${DESTDIR}${PREFIX}/bin
34 ${INSTALL_DATA} ${WRKSRC}/search.par ${DESTDIR}${PREFIX}/lib/exchess 36 ${INSTALL_DATA} ${WRKSRC}/search.par ${DESTDIR}${PREFIX}/lib/exchess

cvs diff -r1.9 -r1.10 pkgsrc/games/exchess/distinfo (expand / switch to unified diff)

--- pkgsrc/games/exchess/distinfo 2013/04/30 22:20:58 1.9
+++ pkgsrc/games/exchess/distinfo 2014/02/09 16:50:45 1.10
@@ -1,22 +1,22 @@ @@ -1,22 +1,22 @@
1$NetBSD: distinfo,v 1.9 2013/04/30 22:20:58 joerg Exp $ 1$NetBSD: distinfo,v 1.10 2014/02/09 16:50:45 wiedi Exp $
2 2
3SHA1 (EXCH314S.zip) = 7d8ffbd94dc86a97512826e611048a691c8c646d 3SHA1 (EXCH314S.zip) = 7d8ffbd94dc86a97512826e611048a691c8c646d
4RMD160 (EXCH314S.zip) = 0503200c210aaf7ddc69e1372392e8ea690505ea 4RMD160 (EXCH314S.zip) = 0503200c210aaf7ddc69e1372392e8ea690505ea
5Size (EXCH314S.zip) = 110676 bytes 5Size (EXCH314S.zip) = 110676 bytes
6SHA1 (patch-aa) = 6aa16f2ca4ecc52b77739b5d28ab650f8102e54c 6SHA1 (patch-aa) = 6aa16f2ca4ecc52b77739b5d28ab650f8102e54c
7SHA1 (patch-ab) = a38d6455675083e9ca291c844c85746a0ed897e5 7SHA1 (patch-ab) = a38d6455675083e9ca291c844c85746a0ed897e5
8SHA1 (patch-ac) = cfc1beff8ae3b2e4c9620e8d49852ce80d848ad6 8SHA1 (patch-ac) = cfc1beff8ae3b2e4c9620e8d49852ce80d848ad6
9SHA1 (patch-ad) = 6deeaae3dbaf84f7763306d06117e21aa3dcf885 9SHA1 (patch-ad) = f2d2de59f56a0a24e6408ace9ba15139f986de95
10SHA1 (patch-ae) = 9d374b888a6f431604f41c4421baa23d8ca775a1 10SHA1 (patch-ae) = 9d374b888a6f431604f41c4421baa23d8ca775a1
11SHA1 (patch-af) = f2379b8929775ff660f9af9fc96969eab1b25870 11SHA1 (patch-af) = f2379b8929775ff660f9af9fc96969eab1b25870
12SHA1 (patch-ag) = 7072e6b7ac08fcb901630c2705fe38065bc89bab 12SHA1 (patch-ag) = 7072e6b7ac08fcb901630c2705fe38065bc89bab
13SHA1 (patch-ah) = 872b0b7c62f95075f0ce7360464fa51215619ee3 13SHA1 (patch-ah) = 872b0b7c62f95075f0ce7360464fa51215619ee3
14SHA1 (patch-ai) = 7244cfeb214e08a5e10198de2488957a63e8fda9 14SHA1 (patch-ai) = 7244cfeb214e08a5e10198de2488957a63e8fda9
15SHA1 (patch-aj) = 064dd97be969d403f09cb9cab70705891b1355de 15SHA1 (patch-aj) = 064dd97be969d403f09cb9cab70705891b1355de
16SHA1 (patch-ak) = 659f1cf07efefe524be4d025446fea55eb5f3e9a 16SHA1 (patch-ak) = 659f1cf07efefe524be4d025446fea55eb5f3e9a
17SHA1 (patch-funct.h) = 8ff861d1cfaac5aac8722334b2142e9c63a231c6 17SHA1 (patch-funct.h) = 8ff861d1cfaac5aac8722334b2142e9c63a231c6
18SHA1 (patch-main.h) = f49c0c889469002281fd15c6ceac359f8c4e6f51 18SHA1 (patch-main.h) = f49c0c889469002281fd15c6ceac359f8c4e6f51
19SHA1 (patch-parse.cpp) = f000ea0d4e2adb893ec6ec09a5e0c3dc5c77970d 19SHA1 (patch-parse.cpp) = f000ea0d4e2adb893ec6ec09a5e0c3dc5c77970d
20SHA1 (patch-pmoves.cpp) = 66973c0baee54fa623a9f0b77c29d41e4c6924b8 20SHA1 (patch-pmoves.cpp) = 66973c0baee54fa623a9f0b77c29d41e4c6924b8
21SHA1 (patch-search.h) = 85b16b102087dd218d64c14cc294c5c6df6849bb 21SHA1 (patch-search.h) = 85b16b102087dd218d64c14cc294c5c6df6849bb
22SHA1 (patch-setup.cpp) = 16914d19bb6bc48341409dfa15d9f451e4f46733 22SHA1 (patch-setup.cpp) = 16914d19bb6bc48341409dfa15d9f451e4f46733

cvs diff -r1.5 -r1.6 pkgsrc/games/exchess/patches/Attic/patch-ad (expand / switch to unified diff)

--- pkgsrc/games/exchess/patches/Attic/patch-ad 2013/04/30 22:20:58 1.5
+++ pkgsrc/games/exchess/patches/Attic/patch-ad 2014/02/09 16:50:45 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: patch-ad,v 1.5 2013/04/30 22:20:58 joerg Exp $ 1$NetBSD: patch-ad,v 1.6 2014/02/09 16:50:45 wiedi Exp $
2 2
3--- main.cpp.orig 2000-04-01 07:46:20.000000000 +0000 3--- main.cpp.orig 2000-04-01 07:46:20.000000000 +0000
4+++ main.cpp 4+++ main.cpp
5@@ -3,20 +3,23 @@ 5@@ -3,20 +3,23 @@
6  6
7 /* Main functions controlling program */ 7 /* Main functions controlling program */
8  8
9-#include <iostream.h> 9-#include <iostream.h>
10-#include <iomanip.h> 10-#include <iomanip.h>
11+#include <iostream> 11+#include <iostream>
12+#include <iomanip> 12+#include <iomanip>
13 #include <stdlib.h> 13 #include <stdlib.h>
14 #include <string.h> 14 #include <string.h>
@@ -19,27 +19,27 @@ $NetBSD: patch-ad,v 1.5 2013/04/30 22:20 @@ -19,27 +19,27 @@ $NetBSD: patch-ad,v 1.5 2013/04/30 22:20
19+#include <fstream> 19+#include <fstream>
20  20
21 #include "define.h" 21 #include "define.h"
22  22
23+using namespace std; 23+using namespace std;
24+ 24+
25 #if UNIX 25 #if UNIX
26 #include <sys/types.h> 26 #include <sys/types.h>
27 #include <sys/time.h> 27 #include <sys/time.h>
28+ #include <unistd.h> 28+ #include <unistd.h>
29 #else 29 #else
30 #include <windows.h> 30 #include <windows.h>
31 #include <time.h> 31 #include <time.h>
32@@ -42,21 +45,21 @@ int omttc = 0, mttc = 0, inc = 0; float  32@@ -42,21 +45,21 @@ int omttc = 0, mttc = 0, inc = 0; float
33 int display_board = 0; 33 int display_board = 0;
34 int analysis_mode = 0; 34 int analysis_mode = 0;
35 extern int fail; // flag for fail high/fail low from search 35 extern int fail; // flag for fail high/fail low from search
36-extern move ponder_move; 36-extern move ponder_move;
37+extern my_move ponder_move; 37+extern my_move ponder_move;
38 extern int logging; 38 extern int logging;
39  39
40 ofstream logfile; 40 ofstream logfile;
41 int MAX_LOGS = 100; 41 int MAX_LOGS = 100;
42  42
43 // xboard flag 43 // xboard flag
44-int xboard, post, ics, ALLEG = 0, hintflag = 0, count = 1; 44-int xboard, post, ics, ALLEG = 0, hintflag = 0, count = 1;
45+int xboard, post, ics, ALLEG = 0, hintflag = 0, my_count = 1; 45+int xboard, post, ics, ALLEG = 0, hintflag = 0, my_count = 1;
@@ -86,31 +86,85 @@ $NetBSD: patch-ad,v 1.5 2013/04/30 22:20 @@ -86,31 +86,85 @@ $NetBSD: patch-ad,v 1.5 2013/04/30 22:20
86+ logfile.open(lfile, ios::out); 86+ logfile.open(lfile, ios::out);
87 if(logfile) break; 87 if(logfile) break;
88 } 88 }
89 if(!logfile) { 89 if(!logfile) {
90@@ -164,7 +158,7 @@ int main(int argc, char *argv[]) 90@@ -164,7 +158,7 @@ int main(int argc, char *argv[])
91  91
92 /* main loop */  92 /* main loop */
93  93
94- while (count > 0) 94- while (count > 0)
95+ while (my_count > 0) 95+ while (my_count > 0)
96 { 96 {
97  97
98 // find a hint move, check book first then look in pv 98 // find a hint move, check book first then look in pv
 99@@ -204,14 +198,14 @@ int main(int argc, char *argv[])
 100 if(!game_pos.wtm) // if it is black's turn
 101 {
 102 if(both) p_side = 0;
 103- if(!xboard) cout << "Black-To-Move[" << ceil(T/2) << "]: ";
 104- if(logging) logfile << "Black-To-Move[" << ceil(T/2) << "]: ";
 105+ if(!xboard) cout << "Black-To-Move[" << ceil((double)(T/2)) << "]: ";
 106+ if(logging) logfile << "Black-To-Move[" << ceil((double)(T/2)) << "]: ";
 107 }
 108 else // or if it is white's
 109 {
 110 if(both) p_side = 1;
 111- if(!xboard) cout << "White-To-Move[" << (ceil(T/2) + 1) << "]: ";
 112- if(logging) logfile << "White-To-Move[" << (ceil(T/2) + 1) << "]: ";
 113+ if(!xboard) cout << "White-To-Move[" << (ceil((double)(T/2)) + 1) << "]: ";
 114+ if(logging) logfile << "White-To-Move[" << (ceil((double)(T/2)) + 1) << "]: ";
 115 }
 116
 117 cout.flush();
 118@@ -322,12 +316,12 @@ void make_move()
 119 if(p_side != game_pos.wtm)
 120 {
 121 if(game_pos.wtm) {
 122- cout << (ceil(T/2) + 1) << ". ";
 123+ cout << (ceil((double)(T/2)) + 1) << ". ";
 124 if(xboard) cout << "... ";
 125- if(logging) logfile << (ceil(T/2) + 1) << ". ";
 126+ if(logging) logfile << (ceil((double)(T/2)) + 1) << ". ";
 127 } else {
 128- cout << ceil(T/2) << ". ... ";
 129- if(logging) logfile << ceil(T/2) << ". ... ";
 130+ cout << ceil((double)(T/2)) << ". ... ";
 131+ if(logging) logfile << ceil((double)(T/2)) << ". ... ";
 132 }
 133 print_move(game_pos, best, mstring);
 134 cout << mstring << "\n";
 135@@ -558,7 +552,7 @@ void drawboard()
 136 print_move(last_pos, game_pos.last, mstring);
 137 cout << mstring;
 138 }
 139- if(j==3) cout << " fifty: " << ceil(game_pos.fifty/2);
 140+ if(j==3) cout << " fifty: " << ceil((double)(game_pos.fifty/2));
 141 if(j==2) cout << " Computer time: " << int(timeleft/100) << " seconds";
 142 }
 143 cout << "\n +---+---+---+---+---+---+---+---+";
99@@ -745,7 +739,7 @@ void parse_command() 144@@ -745,7 +739,7 @@ void parse_command()
100 else if(!strcmp(response, "nopost")) { post = 0; } 145 else if(!strcmp(response, "nopost")) { post = 0; }
101 else if(!strcmp(response, "probe")) { cout << probe_tb(&game_pos,0) << "\n"; } 146 else if(!strcmp(response, "probe")) { cout << probe_tb(&game_pos,0) << "\n"; }
102 else if(!strcmp(response, "save") || !strcmp(response, "SR")) { save_game(); } 147 else if(!strcmp(response, "save") || !strcmp(response, "SR")) { save_game(); }
103- else if(!strcmp(response, "quit")) { game_over = 1; count = 0; } 148- else if(!strcmp(response, "quit")) { game_over = 1; count = 0; }
104+ else if(!strcmp(response, "quit")) { game_over = 1; my_count = 0; } 149+ else if(!strcmp(response, "quit")) { game_over = 1; my_count = 0; }
105 else if(!strcmp(response, "performance")) { performance(); } 150 else if(!strcmp(response, "performance")) { performance(); }
106 else if(!strcmp(response, "setboard")) 151 else if(!strcmp(response, "setboard"))
107 { cin >> inboard >> ms >> castle >> ep; mttc = omttc; game_over = 0; 152 { cin >> inboard >> ms >> castle >> ep; mttc = omttc; game_over = 0;
108@@ -795,7 +789,7 @@ void performance() 153@@ -795,7 +789,7 @@ void performance()
109 // when the best move was first found and held on to. 154 // when the best move was first found and held on to.
110  155
111 float soltime; 156 float soltime;
112-int bmcount, tsuite = 0; move bmoves[10]; 157-int bmcount, tsuite = 0; move bmoves[10];
113+int bmcount, tsuite = 0; my_move bmoves[10]; 158+int bmcount, tsuite = 0; my_move bmoves[10];
114 int best_depth, best_score; 159 int best_depth, best_score;
115 extern int stage; 160 extern int stage;
116 unsigned long nodes, nodes1, test_time, test_time1; 161 unsigned long nodes, nodes1, test_time, test_time1;
 162@@ -1063,7 +1057,7 @@ void save_game()
 163 for(int i = 1; i < TURN; i++)
 164 {
 165 print_move(game_pos, game_history[i-1], mstring);
 166- if (game_pos.wtm) outfile << (ceil(i/2) + 1) << ". " << mstring;
 167+ if (game_pos.wtm) outfile << (ceil((double)(i/2)) + 1) << ". " << mstring;
 168 else outfile << mstring;
 169 outfile << " ";
 170 if(!(T%8)) outfile << "\n";