aboutsummaryrefslogtreecommitdiff
path: root/games/xmille
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2007-06-20 14:11:09 +0000
committerMartin Wilke <miwi@FreeBSD.org>2007-06-20 14:11:09 +0000
commit300d2b52671d225223dfc26ec0272cd2126d952e (patch)
treec1c89a6debb1e8801744b94daa4ad4ffaa57cf8f /games/xmille
parent323e81735ab755d3ec05bcb35e38fe48378b2e4d (diff)
downloadports-300d2b52671d225223dfc26ec0272cd2126d952e.tar.gz
ports-300d2b52671d225223dfc26ec0272cd2126d952e.zip
Notes
Diffstat (limited to 'games/xmille')
-rw-r--r--games/xmille/files/patch-Imakefile (renamed from games/xmille/files/patch-ab)0
-rw-r--r--games/xmille/files/patch-ac12
-rw-r--r--games/xmille/files/patch-ad17
-rw-r--r--games/xmille/files/patch-ae11
-rw-r--r--games/xmille/files/patch-af11
-rw-r--r--games/xmille/files/patch-ah11
-rw-r--r--games/xmille/files/patch-animate.c13
-rw-r--r--games/xmille/files/patch-control__affirm.c20
-rw-r--r--games/xmille/files/patch-control__button.c32
-rw-r--r--games/xmille/files/patch-control__dispatch.c33
-rw-r--r--games/xmille/files/patch-control__prompted.c49
-rw-r--r--games/xmille/files/patch-drawcard.c44
-rw-r--r--games/xmille/files/patch-extern.c11
-rw-r--r--games/xmille/files/patch-mille.c44
-rw-r--r--games/xmille/files/patch-misc.c11
-rw-r--r--games/xmille/files/patch-move.c72
-rw-r--r--games/xmille/files/patch-roll.c (renamed from games/xmille/files/patch-ag)0
-rw-r--r--games/xmille/files/patch-save.c82
-rw-r--r--games/xmille/files/patch-ui.c33
-rw-r--r--games/xmille/files/patch-varpush.c32
20 files changed, 476 insertions, 62 deletions
diff --git a/games/xmille/files/patch-ab b/games/xmille/files/patch-Imakefile
index cb5a8ddb2635..cb5a8ddb2635 100644
--- a/games/xmille/files/patch-ab
+++ b/games/xmille/files/patch-Imakefile
diff --git a/games/xmille/files/patch-ac b/games/xmille/files/patch-ac
deleted file mode 100644
index c8338cd71e64..000000000000
--- a/games/xmille/files/patch-ac
+++ /dev/null
@@ -1,12 +0,0 @@
---- save.c.orig Thu Apr 2 05:56:45 1992
-+++ save.c Wed Jan 31 23:04:29 2001
-@@ -22,7 +22,9 @@
- * This routine saves the current game for use at a later date
- */
- extern int errno;
-+#ifndef __FreeBSD__
- extern char *sys_errlist[];
-+#endif
-
- save() {
-
diff --git a/games/xmille/files/patch-ad b/games/xmille/files/patch-ad
deleted file mode 100644
index 16ef005244ac..000000000000
--- a/games/xmille/files/patch-ad
+++ /dev/null
@@ -1,17 +0,0 @@
---- drawcard.c.orig Thu Apr 2 05:55:06 1992
-+++ drawcard.c Wed Jan 31 23:04:23 2001
-@@ -183,12 +183,12 @@
- WIDTH, HEIGHT);
-
- XSetForeground(dpy, cheap_gc, bits_p);
-- XSetStipple(dpy, cheap_gc, bits);
-+ XSetStipple(dpy, cheap_gc, mask);
- XFillRectangle (dpy, cards[i].bits, cheap_gc, 0, 0,
- WIDTH, HEIGHT);
-
- XSetForeground(dpy, cheap_gc, mask_p);
-- XSetStipple(dpy, cheap_gc, mask);
-+ XSetStipple(dpy, cheap_gc, bits);
- XFillRectangle (dpy, cards[i].bits, cheap_gc, 0, 0,
- WIDTH, HEIGHT);
-
diff --git a/games/xmille/files/patch-ae b/games/xmille/files/patch-ae
deleted file mode 100644
index b53110ee65b8..000000000000
--- a/games/xmille/files/patch-ae
+++ /dev/null
@@ -1,11 +0,0 @@
---- mille.c.orig Thu Mar 28 14:29:31 1996
-+++ mille.c Thu Feb 1 00:23:54 2001
-@@ -10,7 +10,7 @@
-
- int rub();
-
--/*char _sobuf[BUFSIZ];*/
-+char _sobuf[BUFSIZ];
-
- main(ac, av)
- reg int ac;
diff --git a/games/xmille/files/patch-af b/games/xmille/files/patch-af
deleted file mode 100644
index 7bc6bf5eebe2..000000000000
--- a/games/xmille/files/patch-af
+++ /dev/null
@@ -1,11 +0,0 @@
---- move.c.orig Thu Mar 28 15:13:44 1996
-+++ move.c Thu Feb 1 00:33:58 2001
-@@ -9,8 +9,6 @@
- #endif
- #define CTRL(c) (c - 'A' + 1)
-
--#define ANIMATE 1
--
- /*extern FILE *outf;*/
-
- char *Movenames[] = {
diff --git a/games/xmille/files/patch-ah b/games/xmille/files/patch-ah
deleted file mode 100644
index 5fe504f73e2b..000000000000
--- a/games/xmille/files/patch-ah
+++ /dev/null
@@ -1,11 +0,0 @@
---- varpush.c.orig Wed Jul 8 11:33:36 1987
-+++ varpush.c Thu Feb 1 00:27:53 2001
-@@ -36,7 +36,7 @@
- char buf[80];
- over:
- printf("Debug file:");
-- gets(buf);
-+ fgets(buf, sizeof(buf), stdin);
- if ((outf = fopen(buf, "w")) == NULL) {
- perror(buf);
- goto over;
diff --git a/games/xmille/files/patch-animate.c b/games/xmille/files/patch-animate.c
new file mode 100644
index 000000000000..80b70bd1d72b
--- /dev/null
+++ b/games/xmille/files/patch-animate.c
@@ -0,0 +1,13 @@
+--- animate.c.orig Thu Mar 28 15:16:53 1996
++++ animate.c Fri Jun 15 02:11:35 2007
+@@ -9,6 +9,10 @@
+
+ extern int iscolor;
+
++static do_animate();
++static draw_square();
++static compute_position();
++
+ animate_move (player, orig_type, orig_arg, dest_type, dest_arg)
+ {
+ #if 1
diff --git a/games/xmille/files/patch-control__affirm.c b/games/xmille/files/patch-control__affirm.c
new file mode 100644
index 000000000000..fbd419d08581
--- /dev/null
+++ b/games/xmille/files/patch-control__affirm.c
@@ -0,0 +1,20 @@
+--- control/affirm.c.orig Tue Jul 12 02:55:50 1988
++++ control/affirm.c Fri Jun 15 02:05:02 2007
+@@ -9,6 +9,7 @@
+ # include "co_class.h"
+ # include <sys/time.h>
+ # include <assert.h>
++# include <string.h>
+
+ /*
+ * affirm window on screen
+@@ -33,6 +34,9 @@
+ static Window affirm, ok, cancel;
+ extern GC co_fore_gc;
+ static int OKstate, CANCELstate;
++
++static int redisplayLabel();
++
+
+ int
+ co_affirm(title, parent)
diff --git a/games/xmille/files/patch-control__button.c b/games/xmille/files/patch-control__button.c
new file mode 100644
index 000000000000..d6d4a9546b51
--- /dev/null
+++ b/games/xmille/files/patch-control__button.c
@@ -0,0 +1,32 @@
+--- control/button.c.orig Thu Apr 2 23:06:52 1992
++++ control/button.c Fri Jun 15 02:05:02 2007
+@@ -5,6 +5,8 @@
+ # include <X11/Xlib.h>
+ # include <X11/Xutil.h>
+ # include "control.h"
++# include <string.h>
++# include <stdlib.h>
+
+ extern Display *dpy;
+
+@@ -31,6 +33,12 @@
+ static XContext perwindowContext;
+ static int nextButton;
+
++static int buttonOn();
++static int buttonOff();
++static int buttonText();
++
++
++
+ Button
+ CcreateButton (text, width, gc, font, backcolor, borderwidth)
+ char *text;
+@@ -40,7 +48,6 @@
+ long backcolor;
+ int borderwidth;
+ {
+- char *malloc ();
+ struct button *b;
+ int round, off;
+ int hround;
diff --git a/games/xmille/files/patch-control__dispatch.c b/games/xmille/files/patch-control__dispatch.c
new file mode 100644
index 000000000000..5bbf51e79adf
--- /dev/null
+++ b/games/xmille/files/patch-control__dispatch.c
@@ -0,0 +1,33 @@
+--- control/dispatch.c.orig Tue Jul 12 02:11:32 1988
++++ control/dispatch.c Fri Jun 15 02:05:02 2007
+@@ -5,6 +5,7 @@
+ */
+
+ # include <X11/Xlib.h>
++# include <stdlib.h>
+
+ struct eventGroup {
+ struct eventGroup *prev;
+@@ -54,9 +55,12 @@
+ };
+
+
+-struct eventGroup *eventStack, *allocGroup();
++struct eventGroup *eventStack;
+ extern Display *dpy;
+
++static struct eventGroup* allocGroup();
++
++
+ bindEvent (window, eventMask, func)
+ Window window;
+ unsigned long eventMask;
+@@ -135,8 +139,6 @@
+ static struct eventGroup *
+ allocGroup ()
+ {
+- char *malloc ();
+-
+ return (struct eventGroup *) malloc (sizeof (struct eventGroup));
+ }
+
diff --git a/games/xmille/files/patch-control__prompted.c b/games/xmille/files/patch-control__prompted.c
new file mode 100644
index 000000000000..7770a594ad1d
--- /dev/null
+++ b/games/xmille/files/patch-control__prompted.c
@@ -0,0 +1,49 @@
+--- control/prompted.c.orig Tue Jul 12 03:01:02 1988
++++ control/prompted.c Fri Jun 15 02:05:02 2007
+@@ -9,6 +9,7 @@
+ # include "co_class.h"
+ # include <sys/time.h>
+ # include <assert.h>
++# include <string.h>
+
+ /*
+ * prompted window on screen
+@@ -38,6 +39,17 @@
+
+ static int prompted_done;
+
++static int co_promptedEvent();
++static int co_OKstate();
++static int redisplayLabel();
++static int textbox_event();
++static int handle_char();
++static int compute_width();
++static int draw_char();
++static int draw_string();
++static int redisplayText();
++
++
+ char *
+ co_prompted(title, parent)
+ char *title;
+@@ -157,7 +169,7 @@
+ prompted_done = 1;
+ break;
+ case '\b':
+- case '\0177':
++ case 127:
+ if (retpointer > returnbuffer) {
+ c = *--retpointer;
+ *retpointer = '\0';
+@@ -190,9 +202,10 @@
+ draw_char (pos, ch, on)
+ {
+ GC my;
++ char buf = ch;
+
+ my = on ? co_fore_gc : co_back_gc;
+- XDrawImageString (dpy, textbox, my, pos, TEXTBOX_VP, &ch, 1);
++ XDrawImageString (dpy, textbox, my, pos, TEXTBOX_VP, &buf, 1);
+ }
+
+ static
diff --git a/games/xmille/files/patch-drawcard.c b/games/xmille/files/patch-drawcard.c
new file mode 100644
index 000000000000..b5cad07b6f8d
--- /dev/null
+++ b/games/xmille/files/patch-drawcard.c
@@ -0,0 +1,44 @@
+--- drawcard.c.orig Thu Apr 2 05:55:06 1992
++++ drawcard.c Fri Jun 15 02:09:15 2007
+@@ -8,6 +8,8 @@
+ # include "ui.h"
+ # include "card.h"
+ # include "background.h"
++# include <stdlib.h>
++
+
+ struct card_init {
+ char *bits;
+@@ -64,6 +66,9 @@
+ struct card backside;
+ struct card eraseCard;
+
++static drawIm();
++static redisplaybelow();
++
+
+ bw_init_cards()
+ {
+@@ -183,12 +188,12 @@
+ WIDTH, HEIGHT);
+
+ XSetForeground(dpy, cheap_gc, bits_p);
+- XSetStipple(dpy, cheap_gc, bits);
++ XSetStipple(dpy, cheap_gc, mask);
+ XFillRectangle (dpy, cards[i].bits, cheap_gc, 0, 0,
+ WIDTH, HEIGHT);
+
+ XSetForeground(dpy, cheap_gc, mask_p);
+- XSetStipple(dpy, cheap_gc, mask);
++ XSetStipple(dpy, cheap_gc, bits);
+ XFillRectangle (dpy, cards[i].bits, cheap_gc, 0, 0,
+ WIDTH, HEIGHT);
+
+@@ -262,7 +267,6 @@
+ struct card *c;
+ {
+ struct displayed *d, *p;
+- char *malloc ();
+
+ p = 0;
+ for (d = onscreen; d; d = d->next) {
diff --git a/games/xmille/files/patch-extern.c b/games/xmille/files/patch-extern.c
new file mode 100644
index 000000000000..2baaeef281b7
--- /dev/null
+++ b/games/xmille/files/patch-extern.c
@@ -0,0 +1,11 @@
+--- extern.c.orig Wed Jul 8 11:32:47 1987
++++ extern.c Fri Jun 15 02:20:34 2007
+@@ -45,7 +45,7 @@
+ 1, /* C_DRIVE_SAFE */
+ 1, /* C_RIGHT_WAY */
+ 0 /* C_INIT */
+- };
++ },
+ Numneed[NUM_CARDS] = { /* number of cards needed per hand */
+ 0, /* C_25 */
+ 0, /* C_50 */
diff --git a/games/xmille/files/patch-mille.c b/games/xmille/files/patch-mille.c
new file mode 100644
index 000000000000..e9c179f5a941
--- /dev/null
+++ b/games/xmille/files/patch-mille.c
@@ -0,0 +1,44 @@
+--- mille.c.orig Thu Mar 28 14:29:31 1996
++++ mille.c Fri Jun 15 02:27:49 2007
+@@ -1,16 +1,17 @@
+ # include "mille.h"
+ # include <signal.h>
++# include <stdlib.h>
+ # ifdef attron
+ # include <term.h>
+-# endif attron
++# endif
+
+ /*
+ * @(#)mille.c 1.3 (Berkeley) 5/10/83
+ */
+
+-int rub();
++void rub( int );
+
+-/*char _sobuf[BUFSIZ];*/
++char _sobuf[BUFSIZ];
+
+ main(ac, av)
+ reg int ac;
+@@ -123,9 +124,9 @@
+ * Routine to trap rubouts, and make sure they really want to
+ * quit.
+ */
+-rub() {
++void rub( int signum ) {
+
+- signal(SIGINT, 1);
++ signal(SIGINT, SIG_IGN);
+ if (getyn("Really? "))
+ die();
+ signal(SIGINT, rub);
+@@ -136,7 +137,7 @@
+ */
+ die() {
+
+- signal(SIGINT, 1);
++ signal(SIGINT, SIG_IGN);
+ if (outf)
+ fflush(outf);
+ finish_ui ();
diff --git a/games/xmille/files/patch-misc.c b/games/xmille/files/patch-misc.c
new file mode 100644
index 000000000000..ecb7e054d7dc
--- /dev/null
+++ b/games/xmille/files/patch-misc.c
@@ -0,0 +1,11 @@
+--- misc.c.orig Wed Jul 8 11:33:04 1987
++++ misc.c Fri Jun 15 02:20:34 2007
+@@ -2,7 +2,7 @@
+ # ifdef attron
+ # include <term.h>
+ # define _tty cur_term->Nttyb
+-# endif attron
++# endif
+
+ /*
+ * @(#)misc.c 1.3 (Berkeley) 7/2/83
diff --git a/games/xmille/files/patch-move.c b/games/xmille/files/patch-move.c
new file mode 100644
index 000000000000..9abf4dac2cde
--- /dev/null
+++ b/games/xmille/files/patch-move.c
@@ -0,0 +1,72 @@
+--- move.c.orig Thu Mar 28 15:13:44 1996
++++ move.c Fri Jun 15 02:33:02 2007
+@@ -9,15 +9,16 @@
+ #endif
+ #define CTRL(c) (c - 'A' + 1)
+
+-#define ANIMATE 1
+-
+ /*extern FILE *outf;*/
+
+ char *Movenames[] = {
+ "M_DISCARD", "M_DRAW", "M_PLAY", "M_ORDER"
+ };
+
+-char *playcard (), *sprint ();
++char *playcard (),
++ *sprintDecimal( char* format, int arg ),
++ *sprintString( char* format, char* arg );
++
+
+ domove()
+ {
+@@ -203,7 +204,7 @@
+ return ("limit of 50");
+ case C_50:
+ if (pp->mileage + Value[card] > End)
+- return sprint ("puts you over %d", End);
++ return sprintDecimal ("puts you over %d", End);
+ case C_25:
+ if (!pp->can_go)
+ return ("cannot move now");
+@@ -220,7 +221,7 @@
+
+ case C_GAS: case C_SPARE: case C_REPAIRS:
+ if (pp->battle != opposite(card))
+- return sprint ("can't play \"%s\"", C_name[card]);
++ return sprintString ("can't play \"%s\"", C_name[card]);
+ #ifdef ANIMATE
+ animate_move (Play, ANIMATE_HAND, Card_no, ANIMATE_BATTLE, card);
+ #endif
+@@ -232,7 +233,7 @@
+ case C_GO:
+ if (pp->battle != C_INIT && pp->battle != C_STOP
+ && !isrepair(pp->battle))
+- return sprint ("cannot play \"Go\"on a \"%s\"",
++ return sprintString ("cannot play \"Go\"on a \"%s\"",
+ C_name[pp->battle]);
+ #ifdef ANIMATE
+ animate_move (Play, ANIMATE_HAND, Card_no, ANIMATE_BATTLE, card);
+@@ -339,12 +340,19 @@
+ return 0;
+ }
+
+-char *
+-sprint (string, arg)
++char* sprintDecimal( char* format, int arg )
++{
++ static char buf[512];
++
++ sprintf (buf, format, arg);
++ return buf;
++}
++
++char* sprintString( char* format, char* arg )
+ {
+ static char buf[512];
+
+- sprintf (buf, string, arg);
++ sprintf (buf, format, arg);
+ return buf;
+ }
+
diff --git a/games/xmille/files/patch-ag b/games/xmille/files/patch-roll.c
index 0ee99c117ee9..0ee99c117ee9 100644
--- a/games/xmille/files/patch-ag
+++ b/games/xmille/files/patch-roll.c
diff --git a/games/xmille/files/patch-save.c b/games/xmille/files/patch-save.c
new file mode 100644
index 000000000000..a4549e87e554
--- /dev/null
+++ b/games/xmille/files/patch-save.c
@@ -0,0 +1,82 @@
+--- save.c.orig Thu Apr 2 05:56:45 1992
++++ save.c Fri Jun 15 02:20:34 2007
+@@ -1,43 +1,46 @@
+ #include "mille.h"
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <sys/time.h>
++#include <time.h>
++#include <errno.h>
++#include <string.h>
++#include <stdlib.h>
+ # ifdef attron
+ # include <term.h>
+ # define _tty cur_term->Nttyb
+-# endif attron
++# endif
+
+ /*
+ * @(#)save.c 1.4 (Berkeley) 7/3/83
+ */
+
+ typedef struct stat Stat;
+-typedef struct tm Time;
+
+ char *ctime();
+
+ int read(), write();
++char* GetpromptedInput( char* );
+
+ /*
+ * This routine saves the current game for use at a later date
+ */
+ extern int errno;
+-extern char *sys_errlist[];
++/* extern char *sys_errlist[]; */
+
+ save() {
+
+ reg char *sp;
+ reg int outf;
+- reg Time *tp;
++ reg time_t *tp;
+ char buf[80];
+- Time tme;
++ time_t tme;
+ Stat junk;
+
+ tp = &tme;
+ if (Fromfile && getyn("Same file? "))
+- strcpy(buf, Fromfile);
++ strncpy(buf, Fromfile,sizeof(buf));
+ else {
+- strcpy (buf, GetpromptedInput ("file: "));
++ strncpy (buf, GetpromptedInput ("file: "), sizeof(buf));
+ sp = buf + strlen (buf);
+ }
+
+@@ -50,12 +53,13 @@
+ return FALSE;
+
+ if ((outf = creat(buf, 0644)) < 0) {
+- error(sys_errlist[errno]);
++ /* error(sys_errlist[errno]); */
++ strerror(errno);
+ return FALSE;
+ }
+ Error (buf);
+ time(tp); /* get current time */
+- strcpy(buf, ctime(tp));
++ strncpy(buf, ctime(tp), sizeof(buf));
+ for (sp = buf; *sp != '\n'; sp++)
+ continue;
+ *sp = '\0';
+@@ -87,7 +91,7 @@
+ }
+ varpush(inf, read);
+ close(inf);
+- strcpy(buf, ctime(&sbuf.st_mtime));
++ strncpy(buf, ctime(&sbuf.st_mtime),sizeof(buf));
+ for (sp = buf; *sp != '\n'; sp++)
+ continue;
+ *sp = '\0';
diff --git a/games/xmille/files/patch-ui.c b/games/xmille/files/patch-ui.c
new file mode 100644
index 000000000000..2950757b2667
--- /dev/null
+++ b/games/xmille/files/patch-ui.c
@@ -0,0 +1,33 @@
+--- ui.c.orig Tue Apr 2 12:55:55 1996
++++ ui.c Fri Jun 15 02:20:34 2007
+@@ -7,6 +7,8 @@
+ # include "mille.h"
+ # include "ui.h"
+ # include <X11/Xutil.h>
++# include <string.h>
++# include <stdlib.h>
+
+ #ifdef CTRL
+ # undef CTRL
+@@ -84,7 +86,9 @@
+ return(orig);
+ if (XTextWidth (font, orig, len) < max)
+ return orig;
+- strcpy (buf, orig);
++ if (len > sizeof(buf))
++ len = sizeof(buf);
++ strncpy (buf, orig, len);
+ do {
+ buf[--len] = '\0';
+ } while (len > 0 && XTextWidth (font, buf, len) >= max);
+@@ -409,6 +413,10 @@
+ Colormap def_cm;
+
+ dpy = XOpenDisplay ((char *) 0);
++ if (!dpy) {
++ printf("Error: Can't open X Display\n");
++ exit(1);
++ }
+ screen = DefaultScreen(dpy);
+ def_cm = DefaultColormap(dpy, screen);
+
diff --git a/games/xmille/files/patch-varpush.c b/games/xmille/files/patch-varpush.c
new file mode 100644
index 000000000000..3834a5911575
--- /dev/null
+++ b/games/xmille/files/patch-varpush.c
@@ -0,0 +1,32 @@
+--- varpush.c.orig Wed Jul 8 11:33:36 1987
++++ varpush.c Fri Jun 15 02:20:34 2007
+@@ -1,3 +1,5 @@
++#include <stdio.h>
++#include <string.h>
+ # include "mille.h"
+
+ /*
+@@ -6,6 +8,13 @@
+
+ int read(), write();
+
++static void remove_terminating_newline( char* buf )
++{
++ int len = strlen(buf);
++ if ( buf[len-1] == '\n' )
++ buf[len-1] = 0;
++}
++
+ /*
+ * push variables around via the routine func() on the file
+ * channel file. func() is either read or write.
+@@ -36,7 +45,8 @@
+ char buf[80];
+ over:
+ printf("Debug file:");
+- gets(buf);
++ fgets(buf,80,stdin);
++ remove_terminating_newline(buf);
+ if ((outf = fopen(buf, "w")) == NULL) {
+ perror(buf);
+ goto over;