summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2011-05-28 22:41:43 +0000
committerdholland <dholland@pkgsrc.org>2011-05-28 22:41:43 +0000
commit7aabba526f18bce90c1fe7e177cc443a708f586d (patch)
tree5e045df3909e24bec48a8d254763d35ff8cfc498 /games
parent437def0e1ef440c811fdd693f2963b14b6e921f8 (diff)
downloadpkgsrc-7aabba526f18bce90c1fe7e177cc443a708f586d.tar.gz
Minor rototill and respin patches; add patch comments, etc. I was taking
a shot at making it work on LP64, but there seem to be deeper problems than the usual sorts of things. Add a comment in the makefile documenting a case that fails on LP64 but not ILP32. PKGREVISION++.
Diffstat (limited to 'games')
-rw-r--r--games/velena/Makefile7
-rw-r--r--games/velena/distinfo15
-rw-r--r--games/velena/patches/patch-aa34
-rw-r--r--games/velena/patches/patch-ad14
-rw-r--r--games/velena/patches/patch-ae14
-rw-r--r--games/velena/patches/patch-buildob_c15
-rw-r--r--games/velena/patches/patch-cmdline_c (renamed from games/velena/patches/patch-ab)20
-rw-r--r--games/velena/patches/patch-connect4_c (renamed from games/velena/patches/patch-ac)4
-rw-r--r--games/velena/patches/patch-database_c26
-rw-r--r--games/velena/patches/patch-dummy_c24
-rw-r--r--games/velena/patches/patch-evaluate_c34
-rw-r--r--games/velena/patches/patch-pnsearch_c71
-rw-r--r--games/velena/patches/patch-proto_h33
13 files changed, 236 insertions, 75 deletions
diff --git a/games/velena/Makefile b/games/velena/Makefile
index 42c406996ec..850d86819df 100644
--- a/games/velena/Makefile
+++ b/games/velena/Makefile
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.11 2009/05/19 08:59:15 wiz Exp $
+# $NetBSD: Makefile,v 1.12 2011/05/28 22:41:43 dholland Exp $
#
DISTNAME= veleng10
PKGNAME= velena-1.0
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= games
MASTER_SITES= http://www.ce.unipr.it/~gbe/
EXTRACT_SUFX= .zip
@@ -41,6 +41,9 @@ SUBST_SED.cflags= -e s,^CFLAGS.*,,
# Velena isn't 64bit-safe, which results in a "fatal error" for some
# board positions.
+#
+# Try for example "c170", which works with -m32 and fails without.
+#
.include "../../mk/bsd.prefs.mk"
.if ${MACHINE_ARCH:M*64} != ""
. if ${PKGSRC_COMPILER:Mgcc} != ""
diff --git a/games/velena/distinfo b/games/velena/distinfo
index 0435460d13b..3737bdf3652 100644
--- a/games/velena/distinfo
+++ b/games/velena/distinfo
@@ -1,10 +1,13 @@
-$NetBSD: distinfo,v 1.2 2008/02/02 17:05:00 rillig Exp $
+$NetBSD: distinfo,v 1.3 2011/05/28 22:41:43 dholland Exp $
SHA1 (veleng10.zip) = f9af1cc6f809347151bee4763a62073fe56ef9b4
RMD160 (veleng10.zip) = a8cc6933196140b5ac941f4369e9bb422a885851
Size (veleng10.zip) = 243352 bytes
-SHA1 (patch-aa) = 810ca44164b273710fccf8237b1b5343d3354e9d
-SHA1 (patch-ab) = 5d4fabb5fb6b4b7d51123c19eb398fb0c54c78ed
-SHA1 (patch-ac) = dd01e7c0231c715421ef56a230e44b2e075b6f67
-SHA1 (patch-ad) = 11e71c97346be1ecd1cef65a1fe2a27805ca0bee
-SHA1 (patch-ae) = d08ca8a02db09bd1013e3823308a445796ca3897
+SHA1 (patch-buildob_c) = be8cca61cc4a604f72b150dbd58da3efeccb0b4f
+SHA1 (patch-cmdline_c) = 52a7290d6d6be956d7ee547e99a5df281869991a
+SHA1 (patch-connect4_c) = a06c00c119068c2cec6063ec897f7fe4cc7b0ebc
+SHA1 (patch-database_c) = 17d409d8e0d34dbca96dc3607a86f1d457e5428e
+SHA1 (patch-dummy_c) = 374bbb8d89194ce5be37758c8d1d07001898917a
+SHA1 (patch-evaluate_c) = f2dea8394a78e6cd9705a42e6ee81f2f6d623a3e
+SHA1 (patch-pnsearch_c) = 067a51579ad21221ff9b2555a954068657005c52
+SHA1 (patch-proto_h) = 710a33eebee805605724d331636f8a1cf6833b9c
diff --git a/games/velena/patches/patch-aa b/games/velena/patches/patch-aa
deleted file mode 100644
index aec0b6abe62..00000000000
--- a/games/velena/patches/patch-aa
+++ /dev/null
@@ -1,34 +0,0 @@
-$NetBSD: patch-aa,v 1.1.1.1 2007/07/25 00:11:10 rillig Exp $
-
-Make the program work on OpenBSD. ;)
-
---- pnsearch.c.orig 1997-07-27 17:44:30.000000000 +0200
-+++ pnsearch.c 2007-07-25 01:57:10.000000000 +0200
-@@ -113,7 +113,7 @@ void show_pinfo()
- if(parameters.pr>0 && parameters.ds>0)
- {
- sprintf(st," Nodes: %5ld/%-5ld P=%-3d D=%-3d Time: %2d:%02d:%02d SEQ=%s %s",
-- parameters.nodes,parameters.maxnodes,parameters.pr,parameters.ds,hh,mm,ss,
-+ parameters.nodes,parameters.maxnodes,(int)parameters.pr,(int)parameters.ds,hh,mm,ss,
- seqs,adv[a]);
- }
- else if(parameters.pr==0)
-@@ -157,7 +157,7 @@ void change_max_nodes_numb(void)
-
- void change_sequence()
- {
-- short seq[BOARDX],done[BOARDX],x,valid=YES;
-+ int seq[BOARDX],done[BOARDX],x,valid=YES;
-
- for(x=0;x<BOARDX;x++)
- done[x]=NO;
-@@ -999,7 +999,8 @@ void build_associated_file()
- unsigned short key;
-
- printf("Input file to parse : ");
-- gets(filein);
-+ if (fgets(filein, sizeof(filein), stdin) == NULL)
-+ exit(0);
-
- printf("Start from sequence #1 ? (Y/N)\n");
- do
diff --git a/games/velena/patches/patch-ad b/games/velena/patches/patch-ad
deleted file mode 100644
index c07e133c234..00000000000
--- a/games/velena/patches/patch-ad
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-ad,v 1.1.1.1 2007/07/25 00:11:10 rillig Exp $
-
---- database.c.orig 1997-07-27 17:44:50.000000000 +0200
-+++ database.c 2007-07-25 01:52:55.000000000 +0200
-@@ -698,7 +698,8 @@ void merge()
- char filename[255];
-
- printf("Enter name of file to merge: ");
-- gets(filename);
-+ if (fgets(filename, sizeof(filename), stdin) == NULL)
-+ exit(0);
-
- printf("\n");
- printf("Sure you want to merge '%s' ? (Y/N)\n\n",filename);
diff --git a/games/velena/patches/patch-ae b/games/velena/patches/patch-ae
deleted file mode 100644
index 3acc62c7474..00000000000
--- a/games/velena/patches/patch-ae
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-ae,v 1.1.1.1 2007/07/25 00:11:10 rillig Exp $
-
---- evaluate.c.orig 1997-07-27 17:15:12.000000000 +0200
-+++ evaluate.c 2007-07-25 02:01:38.000000000 +0200
-@@ -73,7 +73,8 @@ void show_square_used(struct board *boar
-
- void test_conditions(char **matrix,struct board *board)
- {
-- short x,y,z,n1,n2,x1,y1;
-+ int x,y;
-+ short z,n1,n2,x1,y1;
-
- printf("Enter rule 1 number : ");
- scanf("%d %d",&x,&y);
diff --git a/games/velena/patches/patch-buildob_c b/games/velena/patches/patch-buildob_c
new file mode 100644
index 00000000000..e05f2b06756
--- /dev/null
+++ b/games/velena/patches/patch-buildob_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-buildob_c,v 1.1 2011/05/28 22:41:43 dholland Exp $
+
+- Fix LP64 issues by including proper standard headers.
+
+--- buildob.c.orig 1997-07-27 20:49:42.000000000 +0000
++++ buildob.c
+@@ -14,6 +14,8 @@
+
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+
+
+ #include "connect4.h"
diff --git a/games/velena/patches/patch-ab b/games/velena/patches/patch-cmdline_c
index 24b17101b92..fe3f0c80068 100644
--- a/games/velena/patches/patch-ab
+++ b/games/velena/patches/patch-cmdline_c
@@ -1,8 +1,20 @@
-$NetBSD: patch-ab,v 1.2 2008/02/02 17:05:00 rillig Exp $
+$NetBSD: patch-cmdline_c,v 1.1 2011/05/28 22:41:43 dholland Exp $
---- cmdline.c.orig 1997-07-27 17:14:18.000000000 +0200
-+++ cmdline.c 2008-02-02 18:02:11.000000000 +0100
-@@ -42,16 +42,19 @@ void command_line_input(struct board *bo
+- declare external functions
+- improve input prompting
+- don't use gets
+
+--- cmdline.c.orig 1997-07-27 21:14:18.000000000 +0000
++++ cmdline.c
+@@ -16,6 +16,7 @@
+ #include <stdio.h>
+
+ #include "connect4.h"
++#include "proto.h"
+
+ // Here's the interface for sending positions to velena engine
+ // positions are passed in a C string in the form of: x+y+'0'
+@@ -42,16 +43,19 @@ void command_line_input(struct board *bo
int flag = 1,answer;
char st[80];
diff --git a/games/velena/patches/patch-ac b/games/velena/patches/patch-connect4_c
index 73b809a7e5c..b93822c559f 100644
--- a/games/velena/patches/patch-ac
+++ b/games/velena/patches/patch-connect4_c
@@ -1,4 +1,6 @@
-$NetBSD: patch-ac,v 1.1.1.1 2007/07/25 00:11:10 rillig Exp $
+$NetBSD: patch-connect4_c,v 1.1 2011/05/28 22:41:43 dholland Exp $
+
+- void main
--- connect4.c.orig 1997-07-27 17:29:38.000000000 +0200
+++ connect4.c 2007-07-25 01:52:05.000000000 +0200
diff --git a/games/velena/patches/patch-database_c b/games/velena/patches/patch-database_c
new file mode 100644
index 00000000000..e3e165b66e0
--- /dev/null
+++ b/games/velena/patches/patch-database_c
@@ -0,0 +1,26 @@
+$NetBSD: patch-database_c,v 1.1 2011/05/28 22:41:43 dholland Exp $
+
+- needs unistd.h
+- don't use gets
+
+--- database.c.orig 1997-07-27 21:44:50.000000000 +0000
++++ database.c
+@@ -16,7 +16,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+-#include <malloc.h>
++#include <unistd.h>
+
+ #include "connect4.h"
+ #include "con4vals.h"
+@@ -698,7 +698,8 @@ void merge()
+ char filename[255];
+
+ printf("Enter name of file to merge: ");
+- gets(filename);
++ if (fgets(filename, sizeof(filename), stdin) == NULL)
++ exit(0);
+
+ printf("\n");
+ printf("Sure you want to merge '%s' ? (Y/N)\n\n",filename);
diff --git a/games/velena/patches/patch-dummy_c b/games/velena/patches/patch-dummy_c
new file mode 100644
index 00000000000..44f33d0e84e
--- /dev/null
+++ b/games/velena/patches/patch-dummy_c
@@ -0,0 +1,24 @@
+$NetBSD: patch-dummy_c,v 1.1 2011/05/28 22:41:43 dholland Exp $
+
+- Declare external functions.
+- Make functions match their declarations.
+
+--- dummy.c.orig 1997-07-27 21:31:48.000000000 +0000
++++ dummy.c
+@@ -14,6 +14,7 @@
+
+
+ #include <stdio.h>
++#include "proto.h"
+
+ // This code is used under Linux to define dummy functions which are
+ // referenced somewhere in the deadcode.
+@@ -21,7 +22,7 @@
+ // Since this is a porting of the core engine I didn't bother to delete
+ // the functions which are not used... :-)))
+
+-int readkey()
++long readkey()
+ {
+ return 0;
+ }
diff --git a/games/velena/patches/patch-evaluate_c b/games/velena/patches/patch-evaluate_c
new file mode 100644
index 00000000000..86710898f6c
--- /dev/null
+++ b/games/velena/patches/patch-evaluate_c
@@ -0,0 +1,34 @@
+$NetBSD: patch-evaluate_c,v 1.1 2011/05/28 22:41:43 dholland Exp $
+
+- Use matching argument types with printf and scanf.
+
+--- evaluate.c.orig 1997-07-27 21:15:12.000000000 +0000
++++ evaluate.c
+@@ -73,7 +73,8 @@ void show_square_used(struct board *boar
+
+ void test_conditions(char **matrix,struct board *board)
+ {
+- short x,y,z,n1,n2,x1,y1;
++ int x,y;
++ short z,n1,n2,x1,y1;
+
+ printf("Enter rule 1 number : ");
+ scanf("%d %d",&x,&y);
+@@ -137,7 +138,7 @@ void test_conditions(char **matrix,struc
+ }
+ else
+ {
+- printf("Rules %d,%d don't exist!\n\r\n\r");
++ printf("Rules %d,%d don't exist!\n\r\n\r", x, y);
+ }
+
+ }
+@@ -1655,7 +1656,7 @@ void debug_white(struct board *board)
+ }
+ else
+ {
+- printf("Pentas found.\n\r",pentas);
++ printf("Pentas found.\n\r");
+ }
+
+
diff --git a/games/velena/patches/patch-pnsearch_c b/games/velena/patches/patch-pnsearch_c
new file mode 100644
index 00000000000..20af60b8a87
--- /dev/null
+++ b/games/velena/patches/patch-pnsearch_c
@@ -0,0 +1,71 @@
+$NetBSD: patch-pnsearch_c,v 1.1 2011/05/28 22:41:43 dholland Exp $
+
+- needs unistd.h
+- use matching types with printf and scanf
+- don't use gets
+- fix bug caught by gcc -Wuninitialized
+
+--- pnsearch.c.orig 1997-07-27 21:44:30.000000000 +0000
++++ pnsearch.c
+@@ -16,8 +16,8 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+-#include <malloc.h>
+ #include <time.h>
++#include <unistd.h>
+
+ #include "connect4.h"
+ #include "con4vals.h"
+@@ -112,7 +112,7 @@ void show_pinfo()
+
+ if(parameters.pr>0 && parameters.ds>0)
+ {
+- sprintf(st," Nodes: %5ld/%-5ld P=%-3d D=%-3d Time: %2d:%02d:%02d SEQ=%s %s",
++ sprintf(st," Nodes: %5ld/%-5ld P=%-3ld D=%-3ld Time: %2d:%02d:%02d SEQ=%s %s",
+ parameters.nodes,parameters.maxnodes,parameters.pr,parameters.ds,hh,mm,ss,
+ seqs,adv[a]);
+ }
+@@ -157,7 +157,7 @@ void change_max_nodes_numb(void)
+
+ void change_sequence()
+ {
+- short seq[BOARDX],done[BOARDX],x,valid=YES;
++ int seq[BOARDX],done[BOARDX],x,valid=YES;
+
+ for(x=0;x<BOARDX;x++)
+ done[x]=NO;
+@@ -789,7 +789,7 @@ short start_pn_search(struct board *boar
+
+ printf("\n\nConnect Four Search Engine %s. ",SEARCH_ENGINE_VERSION);
+ printf("Last revision %s\n",__DATE__);
+- printf("Now building nodes... (each node takes %d bytes of memory)\n",
++ printf("Now building nodes... (each node takes %zu bytes of memory)\n",
+ sizeof(struct node));
+
+ printf("Max nodes numb = %ld (%ld bytes) ",
+@@ -994,12 +994,13 @@ void build_associated_file()
+ {
+ FILE *h1,*h2;
+ char filein[255],seq[50];
+- short seqlen,state=0,byte;
++ short seqlen=0,state=0,byte;
+ short seqnumb=1,seqthreshold=0;
+ unsigned short key;
+
+ printf("Input file to parse : ");
+- gets(filein);
++ if (fgets(filein, sizeof(filein), stdin) == NULL)
++ exit(0);
+
+ printf("Start from sequence #1 ? (Y/N)\n");
+ do
+@@ -1011,7 +1012,7 @@ void build_associated_file()
+ if(key=='n')
+ {
+ printf("\nEnter sequence number to start from : ");
+- scanf("%d",&seqthreshold);
++ scanf("%hu",&seqthreshold);
+ }
+
+ h1=fopen(filein,"rb");
diff --git a/games/velena/patches/patch-proto_h b/games/velena/patches/patch-proto_h
new file mode 100644
index 00000000000..9b8c9f7577f
--- /dev/null
+++ b/games/velena/patches/patch-proto_h
@@ -0,0 +1,33 @@
+$NetBSD: patch-proto_h,v 1.1 2011/05/28 22:41:43 dholland Exp $
+
+Declare external functions.
+
+--- proto.h.orig 1997-07-27 21:32:02.000000000 +0000
++++ proto.h
+@@ -1,4 +1,9 @@
+
++struct bintree;
++struct board;
++struct dbtree;
++struct node;
++
+ #ifndef max
+ #define max(a,b) ((a)>(b) ? (a) : (b))
+ #endif
+@@ -59,3 +64,16 @@ unsigned long pseudo32(unsigned long *);
+
+ long fileln(FILE *);
+
++void initboard(struct board *board);
++void fight(char);
++void command_line_input(struct board *board);
++void randomize(void);
++void collapse_position(unsigned char *mypos, unsigned char *blk);
++void clrscr(void);
++void erase_temp_file(void);
++void expand_block(unsigned char *blk, unsigned char *pss);
++short get_lower(short *bb, unsigned char *tp);
++void collapse_position(unsigned char *mypos, unsigned char *blk);
++short fast_try_to_win(struct board *board);
++void fast_free_bin_tree(struct bintree *tree);
++short playgame(char *input_str, struct board *board);