head 1.5; access; symbols pkgsrc-2022Q3:1.4.0.106 pkgsrc-2022Q3-base:1.4 pkgsrc-2022Q2:1.4.0.104 pkgsrc-2022Q2-base:1.4 pkgsrc-2022Q1:1.4.0.102 pkgsrc-2022Q1-base:1.4 pkgsrc-2021Q4:1.4.0.100 pkgsrc-2021Q4-base:1.4 pkgsrc-2021Q3:1.4.0.98 pkgsrc-2021Q3-base:1.4 pkgsrc-2021Q2:1.4.0.96 pkgsrc-2021Q2-base:1.4 pkgsrc-2021Q1:1.4.0.94 pkgsrc-2021Q1-base:1.4 pkgsrc-2020Q4:1.4.0.92 pkgsrc-2020Q4-base:1.4 pkgsrc-2020Q3:1.4.0.90 pkgsrc-2020Q3-base:1.4 pkgsrc-2020Q2:1.4.0.86 pkgsrc-2020Q2-base:1.4 pkgsrc-2020Q1:1.4.0.66 pkgsrc-2020Q1-base:1.4 pkgsrc-2019Q4:1.4.0.88 pkgsrc-2019Q4-base:1.4 pkgsrc-2019Q3:1.4.0.84 pkgsrc-2019Q3-base:1.4 pkgsrc-2019Q2:1.4.0.82 pkgsrc-2019Q2-base:1.4 pkgsrc-2019Q1:1.4.0.80 pkgsrc-2019Q1-base:1.4 pkgsrc-2018Q4:1.4.0.78 pkgsrc-2018Q4-base:1.4 pkgsrc-2018Q3:1.4.0.76 pkgsrc-2018Q3-base:1.4 pkgsrc-2018Q2:1.4.0.74 pkgsrc-2018Q2-base:1.4 pkgsrc-2018Q1:1.4.0.72 pkgsrc-2018Q1-base:1.4 pkgsrc-2017Q4:1.4.0.70 pkgsrc-2017Q4-base:1.4 pkgsrc-2017Q3:1.4.0.68 pkgsrc-2017Q3-base:1.4 pkgsrc-2017Q2:1.4.0.64 pkgsrc-2017Q2-base:1.4 pkgsrc-2017Q1:1.4.0.62 pkgsrc-2017Q1-base:1.4 pkgsrc-2016Q4:1.4.0.60 pkgsrc-2016Q4-base:1.4 pkgsrc-2016Q3:1.4.0.58 pkgsrc-2016Q3-base:1.4 pkgsrc-2016Q2:1.4.0.56 pkgsrc-2016Q2-base:1.4 pkgsrc-2016Q1:1.4.0.54 pkgsrc-2016Q1-base:1.4 pkgsrc-2015Q4:1.4.0.52 pkgsrc-2015Q4-base:1.4 pkgsrc-2015Q3:1.4.0.50 pkgsrc-2015Q3-base:1.4 pkgsrc-2015Q2:1.4.0.48 pkgsrc-2015Q2-base:1.4 pkgsrc-2015Q1:1.4.0.46 pkgsrc-2015Q1-base:1.4 pkgsrc-2014Q4:1.4.0.44 pkgsrc-2014Q4-base:1.4 pkgsrc-2014Q3:1.4.0.42 pkgsrc-2014Q3-base:1.4 pkgsrc-2014Q2:1.4.0.40 pkgsrc-2014Q2-base:1.4 pkgsrc-2014Q1:1.4.0.38 pkgsrc-2014Q1-base:1.4 pkgsrc-2013Q4:1.4.0.36 pkgsrc-2013Q4-base:1.4 pkgsrc-2013Q3:1.4.0.34 pkgsrc-2013Q3-base:1.4 pkgsrc-2013Q2:1.4.0.32 pkgsrc-2013Q2-base:1.4 pkgsrc-2013Q1:1.4.0.30 pkgsrc-2013Q1-base:1.4 pkgsrc-2012Q4:1.4.0.28 pkgsrc-2012Q4-base:1.4 pkgsrc-2012Q3:1.4.0.26 pkgsrc-2012Q3-base:1.4 pkgsrc-2012Q2:1.4.0.24 pkgsrc-2012Q2-base:1.4 pkgsrc-2012Q1:1.4.0.22 pkgsrc-2012Q1-base:1.4 pkgsrc-2011Q4:1.4.0.20 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q3:1.4.0.18 pkgsrc-2011Q3-base:1.4 pkgsrc-2011Q2:1.4.0.16 pkgsrc-2011Q2-base:1.4 pkgsrc-2011Q1:1.4.0.14 pkgsrc-2011Q1-base:1.4 pkgsrc-2010Q4:1.4.0.12 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.4.0.10 pkgsrc-2010Q3-base:1.4 pkgsrc-2010Q2:1.4.0.8 pkgsrc-2010Q2-base:1.4 pkgsrc-2010Q1:1.4.0.6 pkgsrc-2010Q1-base:1.4 pkgsrc-2009Q4:1.4.0.4 pkgsrc-2009Q4-base:1.4 pkgsrc-2009Q3:1.4.0.2 pkgsrc-2009Q3-base:1.4 pkgsrc-2009Q2:1.3.0.10 pkgsrc-2009Q2-base:1.3 pkgsrc-2009Q1:1.3.0.8 pkgsrc-2009Q1-base:1.3 pkgsrc-2008Q4:1.3.0.6 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.4 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.2 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.2.0.38 pkgsrc-2008Q2-base:1.2 pkgsrc-2008Q1:1.2.0.36 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.34 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.32 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.30 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.28 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.26 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.24 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.22 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.20 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.18 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.16 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.14 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.12 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.10 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.8 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.6 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.2.0.4 pkgsrc-2004Q1-base:1.2 pkgsrc-2003Q4:1.2.0.2 pkgsrc-2003Q4-base:1.2 buildlink2-base:1.2 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.5 date 2022.12.25.09.00.36; author wiz; state dead; branches; next 1.4; commitid YBK7GI8H1FFwYU6E; 1.4 date 2009.08.03.13.18.37; author joerg; state Exp; branches; next 1.3; 1.3 date 2008.08.17.21.00.20; author dholland; state Exp; branches; next 1.2; 1.2 date 2000.11.10.17.34.11; author jlam; state dead; branches; next 1.1; 1.1 date 2000.10.15.02.06.27; author jlam; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2000.10.15.02.06.27; author jlam; state Exp; branches; next ; desc @@ 1.5 log @crafty*: remove sources from 2008; homepage says 'Crafty has been retired for some time' It still built, but dumped core when building its books. @ text @$NetBSD: patch-ad,v 1.4 2009/08/03 13:18:37 joerg Exp $ --- utility.c.orig 2008-04-16 00:41:49.000000000 +0200 +++ utility.c @@@@ -388,8 +388,10 @@@@ void ClearHashTableScores(void) */ void CraftyExit(int exit_type) { - shared->abort_search = 1; - shared->quit = 1; + if (shared) { + shared->abort_search = 1; + shared->quit = 1; + } exit(exit_type); } @@@@ -1541,10 +1543,10 @@@@ void Print(int vb, char *fmt, ...) va_list ap; va_start(ap, fmt); - if (vb & shared->display_options) + if (shared == NULL || (vb & shared->display_options)) vprintf(fmt, ap); fflush(stdout); - if (shared->time_limit > 99 || shared->tc_time_remaining > 6000 || vb == 4095) { + if (vb == 4095 || shared->time_limit > 99 || shared->tc_time_remaining > 6000) { va_start(ap, fmt); if (log_file) vfprintf(log_file, fmt, ap); @@@@ -2788,6 +2790,15 @@@@ void *SharedMalloc(size_t size, int tid) #if defined(UNIX) int shmid; void *shared; + long pagesize; + + /* round to page boundary */ + pagesize = sysconf(_SC_PAGESIZE); + if (pagesize == -1) { + /* just in case, guess */ + pagesize = 4096; + } + size = size + pagesize - (size % pagesize); shmid = shmget(IPC_PRIVATE, size, (IPC_CREAT | 0600)); if (shmid < 0) { @ 1.4 log @Don't segfault on failing shmget because the print routine tries to access the shared memory segment. Bump revision. @ text @d1 1 a1 1 $NetBSD$ @ 1.3 log @Fix some 64-bit issues and a y2038 bug I noticed in passing. Also, round size of shmget() requests to be page-aligned; at least on amd64 -current this seems to be required to run at all. PKGREVISION++. @ text @d3 29 a31 3 --- utility.c.orig 2008-04-15 18:41:49.000000000 -0400 +++ utility.c 2008-08-17 16:41:20.000000000 -0400 @@@@ -2788,6 +2788,15 @@@@ @ 1.2 log @Update crafty to 17.14. The author kindly accepted all patches back into the main source tree, so no more pkgsrc patches. Changes from version 17.13: another endgame evaluation problem fixed. the outside passed pawn code worked well, up until the point the pawn had to be given up to decoy the other side's king away from the remainder of the pawns. Crafty now understands the king being closer to the pawns than the enemy king, and therefore transitions from outside passer to won king-pawn ending much cleaner. new command "selective" as requested by S. Lim, which allows the user to set the min/max null move R values (default=2/3). they can be set to 0 which disables null-move totally, or they can be set larger than the default for testing. minor changes to init.c sent by Eugene Nalimov to handle 64 bit pointer declarations for win64 executable compilation. NetBSD changes included along with a new Makefile that requires no editing to use for any known configuration ("make help" will explain how to use it). this was submitted by Johnny Lam. serious changes to the outside passed pawn code. the evaluator now understands that outside passers on _both_ sides of the board is basically winning. same goes for candidate passers. @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.1 2000/10/15 02:06:27 jlam Exp $ d3 18 a20 10 --- init.c.orig Mon Aug 14 14:00:03 2000 +++ init.c @@@@ -276,7 +276,6 @@@@ position_lrn_file=fopen(log_filename,"r"); if (!position_lrn_file) { position_lrn_file=fopen(log_filename,"a"); - fprintf(position_lrn_file,"position\n"); } else { fclose(position_lrn_file); @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ @ 1.1.1.1 log @crafty: chess engine -- plays a MUCH better game of chess than GNU Chess. @ text @@