diff options
author | dholland <dholland> | 2011-05-28 22:41:43 +0000 |
---|---|---|
committer | dholland <dholland> | 2011-05-28 22:41:43 +0000 |
commit | c7c156681b45ee43683c34bf4ee48c6563c89b88 (patch) | |
tree | 5e045df3909e24bec48a8d254763d35ff8cfc498 /games/velena/patches | |
parent | b197ce09990fb0b88c5660214ec4f60650c9d6b6 (diff) | |
download | pkgsrc-c7c156681b45ee43683c34bf4ee48c6563c89b88.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/velena/patches')
-rw-r--r-- | games/velena/patches/patch-aa | 34 | ||||
-rw-r--r-- | games/velena/patches/patch-ad | 14 | ||||
-rw-r--r-- | games/velena/patches/patch-ae | 14 | ||||
-rw-r--r-- | games/velena/patches/patch-buildob_c | 15 | ||||
-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_c | 26 | ||||
-rw-r--r-- | games/velena/patches/patch-dummy_c | 24 | ||||
-rw-r--r-- | games/velena/patches/patch-evaluate_c | 34 | ||||
-rw-r--r-- | games/velena/patches/patch-pnsearch_c | 71 | ||||
-rw-r--r-- | games/velena/patches/patch-proto_h | 33 |
11 files changed, 222 insertions, 67 deletions
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); |