diff options
author | dholland <dholland@pkgsrc.org> | 2008-08-17 21:00:20 +0000 |
---|---|---|
committer | dholland <dholland@pkgsrc.org> | 2008-08-17 21:00:20 +0000 |
commit | f3344d894c71a74fca3904bed3bcf7aab189817a (patch) | |
tree | ccfd840760acc40da974d72d88211a80952799eb /games | |
parent | 89fb84fa74256995dc88a4be23cad32c4811ef85 (diff) | |
download | pkgsrc-f3344d894c71a74fca3904bed3bcf7aab189817a.tar.gz |
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++.
Diffstat (limited to 'games')
-rw-r--r-- | games/crafty/Makefile | 3 | ||||
-rw-r--r-- | games/crafty/distinfo | 5 | ||||
-rw-r--r-- | games/crafty/patches/patch-ab | 66 | ||||
-rw-r--r-- | games/crafty/patches/patch-ac | 26 | ||||
-rw-r--r-- | games/crafty/patches/patch-ad | 20 |
5 files changed, 118 insertions, 2 deletions
diff --git a/games/crafty/Makefile b/games/crafty/Makefile index ede9711210a..a60429983c9 100644 --- a/games/crafty/Makefile +++ b/games/crafty/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.42 2008/05/25 15:55:27 joerg Exp $ +# $NetBSD: Makefile,v 1.43 2008/08/17 21:00:20 dholland Exp $ DISTNAME= crafty-22.1 +PKGREVISION= 1 CATEGORIES= games MASTER_SITES= ftp://ftp.cis.uab.edu/pub/hyatt/source/ \ http://www.craftychess.com/ diff --git a/games/crafty/distinfo b/games/crafty/distinfo index b2547f66abb..dec8a2614d1 100644 --- a/games/crafty/distinfo +++ b/games/crafty/distinfo @@ -1,6 +1,9 @@ -$NetBSD: distinfo,v 1.13 2008/05/25 15:55:27 joerg Exp $ +$NetBSD: distinfo,v 1.14 2008/08/17 21:00:20 dholland Exp $ SHA1 (crafty-22.1.zip) = 4ed19f5c676035b899d82cd254eee3d391cbabbf RMD160 (crafty-22.1.zip) = 963ec8110617b3d1273953d03ddb974019ec26a9 Size (crafty-22.1.zip) = 405169 bytes SHA1 (patch-aa) = 8efbb76aa23b3972c05dd41cde6b2c5ec8dc49b9 +SHA1 (patch-ab) = 2b926a2ebd8f9ecf125d9f62c6d5f751a52d41a7 +SHA1 (patch-ac) = 5ea68aa6ef3188ceeaf823be853e6f8c81e320df +SHA1 (patch-ad) = 8fff57e2a0df5c81b0c783f5e04b340dcd5b630a diff --git a/games/crafty/patches/patch-ab b/games/crafty/patches/patch-ab new file mode 100644 index 00000000000..5c294765359 --- /dev/null +++ b/games/crafty/patches/patch-ab @@ -0,0 +1,66 @@ +$NetBSD: patch-ab,v 1.6 2008/08/17 21:00:20 dholland Exp $ + +--- egtb.cpp~ 2008-04-15 18:41:49.000000000 -0400 ++++ egtb.cpp 2008-08-17 16:21:19.000000000 -0400 +@@ -332,7 +332,7 @@ static void* PvMalloc + pv = malloc (cb); + if (NULL == pv) + { +- printf ("*** Cannot allocate %d bytes of memory\n", cb); ++ printf ("*** Cannot allocate %zu bytes of memory\n", cb); + exit (1); + } + cbAllocated += cb; +@@ -1268,24 +1268,24 @@ static void VInitEnumerations (void) + if (fPrint) + { + for (pi1 = x_pieceNone; pi1 <= x_pieceQueen; pi1 = (piece) (pi1 + 1)) +- printf ("%c - %d enumerated positions\n", "pPNBRQ"[pi1], rgcSinglePawnPresent[pi1]); ++ printf ("%c - %ld enumerated positions\n", "pPNBRQ"[pi1], rgcSinglePawnPresent[pi1]); + for (pi1 = x_pieceNone; pi1 <= x_pieceQueen; pi1 = (piece) (pi1 + 1)) + { + if (0 != rgcSinglePawnless[pi1]) +- printf ("pawnless %c - %d enumerated positions\n", "pPNBRQ"[pi1], rgcSinglePawnless[pi1]); ++ printf ("pawnless %c - %ld enumerated positions\n", "pPNBRQ"[pi1], rgcSinglePawnless[pi1]); + } + for (pi1 = x_pieceNone; pi1 <= x_pieceQueen; pi1 = (piece) (pi1 + 1)) + for (pi2 = x_pieceNone; pi2 <= pi1; pi2 = (piece) (pi2 + 1)) + { + if (0 != rgcPairPawnPresent[pi1][pi2]) +- printf ("%c%c - %d enumerated positions\n", "pPNBRQ"[pi1], "pPNBRQ"[pi2], ++ printf ("%c%c - %ld enumerated positions\n", "pPNBRQ"[pi1], "pPNBRQ"[pi2], + rgcPairPawnPresent[pi1][pi2]); + } + for (pi1 = x_pieceNone; pi1 <= x_pieceQueen; pi1 = (piece) (pi1 + 1)) + for (pi2 = x_pieceNone; pi2 <= pi1; pi2 = (piece) (pi2 + 1)) + { + if (0 != rgcPairPawnless[pi1][pi2]) +- printf ("pawnless %c%c - %d enumerated positions\n", "pPNBRQ"[pi1], "pPNBRQ"[pi2], ++ printf ("pawnless %c%c - %ld enumerated positions\n", "pPNBRQ"[pi1], "pPNBRQ"[pi2], + rgcPairPawnless[pi1][pi2]); + } + #if defined (T41_INCLUDE) || defined (T42_INCLUDE) +@@ -1294,7 +1294,7 @@ static void VInitEnumerations (void) + for (pi3 = x_pieceNone; pi3 <= pi2; pi3 = (piece) (pi3 + 1)) + { + if (0 != rgcTriplePawnPresent[pi1][pi2][pi3]) +- printf ("%c%c%c - %d enumerated positions\n", ++ printf ("%c%c%c - %ld enumerated positions\n", + "pPNBRQ"[pi1], "pPNBRQ"[pi2], "pPNBRQ"[pi3], + rgcTriplePawnPresent[pi1][pi2][pi3]); + } +@@ -1303,12 +1303,12 @@ static void VInitEnumerations (void) + for (pi3 = x_pieceNone; pi3 <= pi2; pi3 = (piece) (pi3 + 1)) + { + if (0 != rgcTriplePawnless[pi1][pi2][pi3]) +- printf ("pawnless %c%c%c - %d enumerated positions\n", ++ printf ("pawnless %c%c%c - %ld enumerated positions\n", + "pPNBRQ"[pi1], "pPNBRQ"[pi2], "pPNBRQ"[pi3], + rgcTriplePawnless[pi1][pi2][pi3]); + } + #endif +- printf ("\nAllocated %dk\n\n", (cbAllocated + 1023)/1024); ++ printf ("\nAllocated %zuk\n\n", (cbAllocated + 1023)/1024); + } + } + diff --git a/games/crafty/patches/patch-ac b/games/crafty/patches/patch-ac new file mode 100644 index 00000000000..e0ca6674f80 --- /dev/null +++ b/games/crafty/patches/patch-ac @@ -0,0 +1,26 @@ +$NetBSD: patch-ac,v 1.6 2008/08/17 21:00:20 dholland Exp $ + +--- option.c~ 2008-04-15 18:41:49.000000000 -0400 ++++ option.c 2008-08-17 16:23:39.000000000 -0400 +@@ -3025,7 +3025,7 @@ int Option(TREE * RESTRICT tree) + + output_file = stdout; + secs = time(0); +- timestruct = localtime((time_t *) & secs); ++ timestruct = localtime(& secs); + if (nargs > 1) { + if (!(output_file = fopen(args[1], "w"))) { + printf("unable to open %s for write.\n", args[1]); +@@ -3548,10 +3548,10 @@ int Option(TREE * RESTRICT tree) + */ + else if (OptionMatch("tags", *args)) { + struct tm *timestruct; +- long secs; ++ time_t secs; + + secs = time(0); +- timestruct = localtime((time_t *) & secs); ++ timestruct = localtime(& secs); + printf("[Event \"%s\"]\n", pgn_event); + printf("[Site \"%s\"]\n", pgn_site); + printf("[Date \"%4d.%02d.%02d\"]\n", timestruct->tm_year + 1900, diff --git a/games/crafty/patches/patch-ad b/games/crafty/patches/patch-ad new file mode 100644 index 00000000000..30600a7e84f --- /dev/null +++ b/games/crafty/patches/patch-ad @@ -0,0 +1,20 @@ +$NetBSD: patch-ad,v 1.3 2008/08/17 21:00:20 dholland Exp $ + +--- 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 @@ + #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) { |