aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorsvn2git <svn2git@FreeBSD.org>1994-05-01 00:00:00 -0800
committersvn2git <svn2git@FreeBSD.org>1994-05-01 00:00:00 -0800
commita16f65c7d117419bd266c28a1901ef129a337569 (patch)
tree2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /games
parent8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff)
downloadsrc-a16f65c7d117419bd266c28a1901ef129a337569.tar.gz
src-a16f65c7d117419bd266c28a1901ef129a337569.zip
Release FreeBSD 1.1release/1.1.0_cvs
This commit was manufactured to restore the state of the 1.1-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'games')
-rw-r--r--games/arithmetic/arithmetic.c2
-rw-r--r--games/backgammon/backgammon/move.c2
-rw-r--r--games/battlestar/init.c1
-rw-r--r--games/bcd/bcd.c4
-rw-r--r--games/canfield/canfield/canfield.c6
-rw-r--r--games/cribbage/crib.c4
-rw-r--r--games/dm/dm.c3
-rw-r--r--games/fortune/datfiles/Makefile19
l---------games/fortune/datfiles/fortunes-o1
-rw-r--r--games/fortune/fortune/fortune.c2
-rw-r--r--games/hack/Makefile4
-rw-r--r--games/hack/hack.62
-rw-r--r--games/hack/hack.apply.c2
-rw-r--r--games/hack/hack.invent.c2
-rw-r--r--games/hack/hack.mkshop.c6
-rw-r--r--games/hack/hack.version.c2
-rw-r--r--games/ppt/ppt.c2
-rw-r--r--games/rain/rain.c2
-rw-r--r--games/robots/move.c6
-rw-r--r--games/robots/robots.h2
-rw-r--r--games/rogue/score.c3
-rw-r--r--games/sail/pl_main.c2
-rw-r--r--games/snake/snake/snake.c2
-rw-r--r--games/worm/worm.c2
-rw-r--r--games/worms/worms.c4
25 files changed, 53 insertions, 34 deletions
diff --git a/games/arithmetic/arithmetic.c b/games/arithmetic/arithmetic.c
index 4fd8bf96446a..aa342de1f8ed 100644
--- a/games/arithmetic/arithmetic.c
+++ b/games/arithmetic/arithmetic.c
@@ -77,6 +77,7 @@ static char sccsid[] = "@(#)arithmetic.c 5.5 (Berkeley) 2/27/91";
#include <ctype.h>
#include <stdio.h>
#include <string.h>
+#include <time.h>
char keylist[] = "+-x/";
char defaultkeys[] = "+-";
@@ -102,7 +103,6 @@ main(argc, argv)
extern char *optarg;
extern int optind;
int ch, cnt;
- time_t time();
void intr();
while ((ch = getopt(argc, argv, "r:o:")) != EOF)
diff --git a/games/backgammon/backgammon/move.c b/games/backgammon/backgammon/move.c
index 17a5dfde94be..debe184596a7 100644
--- a/games/backgammon/backgammon/move.c
+++ b/games/backgammon/backgammon/move.c
@@ -354,6 +354,8 @@ nextfree () {
new = freeq;
freeq = freeq->b_next;
+ new->b_next = 0;
+ return (new);
}
pickmove () {
diff --git a/games/battlestar/init.c b/games/battlestar/init.c
index 47806cc9dc58..ffc71c83c9af 100644
--- a/games/battlestar/init.c
+++ b/games/battlestar/init.c
@@ -120,6 +120,7 @@ checkout(uname)
CUMBER = 3;
WEIGHT = 9; /* that'll get him! */
clock = 10;
+ location = dayfile;
setbit(location[7].objects, WOODSMAN); /* viper room */
setbit(location[20].objects, WOODSMAN); /* laser " */
setbit(location[13].objects, DARK); /* amulet " */
diff --git a/games/bcd/bcd.c b/games/bcd/bcd.c
index 8fbee8caa79f..7135ecb71408 100644
--- a/games/bcd/bcd.c
+++ b/games/bcd/bcd.c
@@ -77,7 +77,7 @@ u_short holes[256] = {
0x002, 0x001, 0x012, 0x40a, 0x80a, 0x212, 0x00a, 0x006,
0x022, 0x900, 0x880, 0x840, 0x820, 0x810, 0x808, 0x804,
0x802, 0x801, 0x500, 0x480, 0x440, 0x420, 0x410, 0x408,
- 0x404, 0x402, 0x402, 0x280, 0x240, 0x220, 0x210, 0x208,
+ 0x404, 0x402, 0x401, 0x280, 0x240, 0x220, 0x210, 0x208,
0x204, 0x202, 0x201, 0x082, 0x822, 0x600, 0x282, 0x30f,
0x900, 0x880, 0x840, 0x820, 0x810, 0x808, 0x804, 0x802,
0x801, 0x500, 0x480, 0x440, 0x420, 0x410, 0x408, 0x404,
@@ -93,7 +93,7 @@ u_short holes[256] = {
0x001, 0x012, 0x40a, 0x80a, 0x212, 0x00a, 0x006, 0x022,
0x900, 0x880, 0x840, 0x820, 0x810, 0x808, 0x804, 0x802,
0x801, 0x500, 0x480, 0x440, 0x420, 0x410, 0x408, 0x404,
- 0x402, 0x402, 0x280, 0x240, 0x220, 0x210, 0x208, 0x204,
+ 0x402, 0x401, 0x280, 0x240, 0x220, 0x210, 0x208, 0x204,
0x202, 0x201, 0x082, 0x806, 0x822, 0x600, 0x282, 0x30f,
0x900, 0x880, 0x840, 0x820, 0x810, 0x808, 0x804, 0x802,
0x801, 0x500, 0x480, 0x440, 0x420, 0x410, 0x408, 0x404,
diff --git a/games/canfield/canfield/canfield.c b/games/canfield/canfield/canfield.c
index e598fe86f7e9..7e0038970df8 100644
--- a/games/canfield/canfield/canfield.c
+++ b/games/canfield/canfield/canfield.c
@@ -1279,14 +1279,14 @@ getcmd(row, col, cp)
if (ch == '\f') {
wrefresh(curscr);
refresh();
- } else if (i >= 2 && ch != _tty.sg_erase && ch != _tty.sg_kill) {
+ } else if (i >= 2 && ch != erasechar() && ch != killchar()) {
if (ch != '\n' && ch != '\r' && ch != ' ')
write(1, "\007", 1);
- } else if (ch == _tty.sg_erase && i > 0) {
+ } else if (ch == erasechar() && i > 0) {
printw("\b \b");
refresh();
i--;
- } else if (ch == _tty.sg_kill && i > 0) {
+ } else if (ch == killchar() && i > 0) {
while (i > 0) {
printw("\b \b");
i--;
diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c
index d1d8bc747478..9aeacd160522 100644
--- a/games/cribbage/crib.c
+++ b/games/cribbage/crib.c
@@ -48,6 +48,8 @@ static char sccsid[] = "@(#)crib.c 5.6 (Berkeley) 2/28/91";
# include "cribcur.h"
# include "pathnames.h"
+extern char *getline();
+
main(argc, argv)
int argc;
char *argv[];
@@ -60,7 +62,7 @@ char *argv[];
char *s; /* for reading arguments */
FILE *f;
FILE *fopen();
- char *getline(), *getlogin();
+ char *getlogin();
void rint();
while ((ch = getopt(argc, argv, "eqr")) != EOF)
diff --git a/games/dm/dm.c b/games/dm/dm.c
index bf820688376c..bbd0c447ee61 100644
--- a/games/dm/dm.c
+++ b/games/dm/dm.c
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)dm.c 5.16 (Berkeley) 2/28/91";
#include <nlist.h>
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#include "pathnames.h"
extern int errno;
@@ -89,7 +90,7 @@ main(argc, argv)
play(args)
char **args;
{
- char pbuf[MAXPATHLEN], *strcpy(), *strerror();
+ char pbuf[MAXPATHLEN];
(void)strcpy(pbuf, _PATH_HIDE);
(void)strcpy(pbuf + sizeof(_PATH_HIDE) - 1, game);
diff --git a/games/fortune/datfiles/Makefile b/games/fortune/datfiles/Makefile
index 3e17087d64ac..896a55842a42 100644
--- a/games/fortune/datfiles/Makefile
+++ b/games/fortune/datfiles/Makefile
@@ -7,18 +7,27 @@ SOBJ=obj
SOBJ=.
.endif
-DATFILES=fortunes.dat startrek.dat zippy.dat fortunes-o.dat
+# Get around symlink problem - CVS doesn't like symlinks, replace
+# that problem with a settable option.
+FOSRC?=fortunes-o.real.rot13
+FOOBJ=fortunes-o
+
+DATFILES=fortunes.dat startrek.dat zippy.dat
CLEANFILES+=${DATFILES}
-install: ${DATFILES}
+install: ${DATFILES} ${FOOBJ}.dat
(cd ${.CURDIR} && install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${DATFILES:R} ${DESTDIR}/usr/share/games/fortune)
+ ${DATFILES:R} ${DESTDIR}/usr/share/games/fortune \
+ && install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${FOSRC} ${DESTDIR}/usr/share/games/fortune/${FOOBJ})
install -o ${BINOWN} -g ${BINGRP} -m 444 ${DATFILES} \
${DESTDIR}/usr/share/games/fortune
+ install -o ${BINOWN} -g ${BINGRP} -m 444 ${FOOBJ}.dat \
+ ${DESTDIR}/usr/share/games/fortune
-fortunes-o.dat: ${.TARGET:R}
+fortunes-o.dat: ${FOSRC}
${.CURDIR}/../strfile/${SOBJ}/strfile -rsx \
- ${.CURDIR}/${.TARGET:R} ${.TARGET}
+ ${.CURDIR}/${FOSRC} ${.TARGET}
fortunes.dat startrek.dat zippy.dat: ${.TARGET:R}
${.CURDIR}/../strfile/${SOBJ}/strfile -rs \
diff --git a/games/fortune/datfiles/fortunes-o b/games/fortune/datfiles/fortunes-o
deleted file mode 120000
index c07109590b66..000000000000
--- a/games/fortune/datfiles/fortunes-o
+++ /dev/null
@@ -1 +0,0 @@
-fortunes-o.real.rot13 \ No newline at end of file
diff --git a/games/fortune/fortune/fortune.c b/games/fortune/fortune/fortune.c
index 747c06cb8b5b..79e9e1cde71e 100644
--- a/games/fortune/fortune/fortune.c
+++ b/games/fortune/fortune/fortune.c
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)fortune.c 5.13 (Berkeley) 4/8/91";
# include <sys/dir.h>
# include <stdio.h>
# include <assert.h>
+# include <stdlib.h>
# include "strfile.h"
# include "pathnames.h"
@@ -920,7 +921,6 @@ get_fort()
{
register FILEDESC *fp;
register int choice;
- long random();
if (File_list->next == NULL || File_list->percent == NO_PROB)
fp = File_list;
diff --git a/games/hack/Makefile b/games/hack/Makefile
index 0432786c3a1a..cc1af7a77784 100644
--- a/games/hack/Makefile
+++ b/games/hack/Makefile
@@ -12,7 +12,7 @@ SRCS= alloc.c hack.Decl.c hack.apply.c hack.bones.c hack.c hack.cmd.c \
hack.timeout.c hack.topl.c hack.track.c hack.trap.c hack.tty.c \
hack.u_init.c hack.unix.c hack.vault.c hack.version.c hack.wield.c \
hack.wizard.c hack.worm.c hack.worn.c hack.zap.c rnd.c
-CFLAGS+= -I.
+CFLAGS+= -I. -fwritable-strings
MAN6= hack.6
DPSRCS= hack.onames.h
DPADD= ${LIBTERM}
@@ -35,4 +35,6 @@ beforeinstall:
${.CURDIR}/hh ${.CURDIR}/data ${DESTDIR}/var/games/hackdir
rm -f ${DESTDIR}/var/games/hackdir/bones*
+.depend alloc.o: hack.onames.h
+
.include <bsd.prog.mk>
diff --git a/games/hack/hack.6 b/games/hack/hack.6
index c4c46c30c2e0..5210c2630bcd 100644
--- a/games/hack/hack.6
+++ b/games/hack/hack.6
@@ -52,7 +52,7 @@ When the game ends, either by your death, when you quit, or if you escape
from the caves,
.I hack
will give you (a fragment of) the list of top scorers. The scoring
-is based on many aspects of your behaviour but a rough estimate is
+is based on many aspects of your behavior but a rough estimate is
obtained by taking the amount of gold you've found in the cave plus four
times your (real) experience. Precious stones may be worth a lot of gold
when brought to the exit.
diff --git a/games/hack/hack.apply.c b/games/hack/hack.apply.c
index ebdf82adce54..18da738dfe9c 100644
--- a/games/hack/hack.apply.c
+++ b/games/hack/hack.apply.c
@@ -4,7 +4,7 @@
#include "hack.h"
#include "def.edog.h"
#include "def.mkroom.h"
-extern struct monst *bchit();
+static struct monst *bchit();
extern struct obj *addinv();
extern struct trap *maketrap();
extern int (*occupation)();
diff --git a/games/hack/hack.invent.c b/games/hack/hack.invent.c
index c4620ca129cb..66949b87afe1 100644
--- a/games/hack/hack.invent.c
+++ b/games/hack/hack.invent.c
@@ -7,7 +7,7 @@ extern struct obj *splitobj();
extern struct obj zeroobj;
extern char morc;
extern char quitchars[];
-char *xprname();
+static char *xprname();
#ifndef NOWORM
#include "def.wseg.h"
diff --git a/games/hack/hack.mkshop.c b/games/hack/hack.mkshop.c
index 9d99a22d2cb2..7a8fdfbfaaa6 100644
--- a/games/hack/hack.mkshop.c
+++ b/games/hack/hack.mkshop.c
@@ -19,10 +19,10 @@ register char let;
int roomno;
register struct monst *shk;
#ifdef WIZARD
+extern char *getenv();
+register char *ep = getenv("SHOPTYPE");
/* first determine shoptype */
if(wizard){
- extern char *getenv();
- register char *ep = getenv("SHOPTYPE");
if(ep){
if(*ep == 'z' || *ep == 'Z'){
mkzoo(ZOO);
@@ -58,7 +58,7 @@ gottype:
continue;
if(
#ifdef WIZARD
- (wizard && getenv("SHOPTYPE") && sroom->doorct != 0) ||
+ (wizard && ep != NULL && sroom->doorct != 0) ||
#endif WIZARD
sroom->doorct <= 2 && sroom->doorct > 0) break;
}
diff --git a/games/hack/hack.version.c b/games/hack/hack.version.c
index 4c89fe739b90..ae0a12d3535e 100644
--- a/games/hack/hack.version.c
+++ b/games/hack/hack.version.c
@@ -1,6 +1,6 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.version.c - version 1.0.3 */
-/* $Header: /a/cvs/386BSD/src/games/hack/hack.version.c,v 1.1.1.1 1993/06/12 14:40:26 rgrimes Exp $ */
+/* $Header: /home/cvs/386BSD/src/games/hack/hack.version.c,v 1.1.1.1 1993/06/12 14:40:26 rgrimes Exp $ */
#include "date.h"
diff --git a/games/ppt/ppt.c b/games/ppt/ppt.c
index 41b8e8e009a7..77086333d536 100644
--- a/games/ppt/ppt.c
+++ b/games/ppt/ppt.c
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)ppt.c 5.4 (Berkeley) 6/1/90";
#include <stdio.h>
-void putppt();
+static void putppt();
main(argc, argv)
int argc;
diff --git a/games/rain/rain.c b/games/rain/rain.c
index 1b12697532f8..828ac749a365 100644
--- a/games/rain/rain.c
+++ b/games/rain/rain.c
@@ -63,7 +63,7 @@ static struct termio sg, old_tty;
static struct sgttyb sg, old_tty;
#endif
-int fputchar();
+static int fputchar();
char *LL, *TE, *tgoto();
main(argc, argv)
diff --git a/games/robots/move.c b/games/robots/move.c
index 793644407442..8da28376873f 100644
--- a/games/robots/move.c
+++ b/games/robots/move.c
@@ -169,13 +169,13 @@ teleport:
refresh();
flush_in();
goto ret;
- case CTRL(L):
+ case CTRL('L'):
wrefresh(curscr);
break;
case EOF:
break;
default:
- putchar(CTRL(G));
+ putchar(CTRL('G'));
reset_count();
fflush(stdout);
break;
@@ -240,7 +240,7 @@ int dy, dx;
refresh();
}
else {
- putchar(CTRL(G));
+ putchar(CTRL('G'));
reset_count();
}
return FALSE;
diff --git a/games/robots/robots.h b/games/robots/robots.h
index cafea70379ee..7f692b7d3d1f 100644
--- a/games/robots/robots.h
+++ b/games/robots/robots.h
@@ -69,7 +69,7 @@
*/
# undef CTRL
-# define CTRL(X) ('X' - 'A' + 1)
+# define CTRL(X) ((X) - 'A' + 1)
/*
* type definitions
diff --git a/games/rogue/score.c b/games/rogue/score.c
index f4fd5d4edb2e..275cf423cd50 100644
--- a/games/rogue/score.c
+++ b/games/rogue/score.c
@@ -206,7 +206,8 @@ short other;
md_lock(1);
- if ((fp = fopen(_PATH_SCOREFILE, "r+")) == NULL) {
+ if ( (fp = fopen(_PATH_SCOREFILE, "r+")) == NULL
+ && (fp = fopen(_PATH_SCOREFILE, "w+")) == NULL) {
message("cannot read/write/create score file", 0);
sf_error();
}
diff --git a/games/sail/pl_main.c b/games/sail/pl_main.c
index d4d87826a602..81f75615a97d 100644
--- a/games/sail/pl_main.c
+++ b/games/sail/pl_main.c
@@ -198,7 +198,7 @@ reprint:
else {
(void) printf("Your name, Captain? ");
(void) fflush(stdout);
- (void) gets(captain);
+ (void) fgets(captain, sizeof captain, stdin);
if (!*captain)
(void) strcpy(captain, "no name");
}
diff --git a/games/snake/snake/snake.c b/games/snake/snake/snake.c
index 686465e7ba63..0c4da64542e1 100644
--- a/games/snake/snake/snake.c
+++ b/games/snake/snake/snake.c
@@ -56,6 +56,7 @@ static char sccsid[] = "@(#)snake.c 5.10 (Berkeley) 2/28/91";
#include <fcntl.h>
#include <pwd.h>
#include <errno.h>
+#include <time.h>
#include "snake.h"
#include "pathnames.h"
@@ -97,7 +98,6 @@ char **argv;
extern char *optarg;
extern int optind;
int ch, i, j, k;
- time_t time();
long atol();
void stop();
diff --git a/games/worm/worm.c b/games/worm/worm.c
index 65a7423b14e8..b5d310daffab 100644
--- a/games/worm/worm.c
+++ b/games/worm/worm.c
@@ -210,7 +210,7 @@ char ch;
y = head->y;
switch(ch)
{
- when 'h': x--;
+ case 'h': x--;
when 'j': y++;
when 'k': y--;
when 'l': x++;
diff --git a/games/worms/worms.c b/games/worms/worms.c
index 0e7803613971..f3b88940d618 100644
--- a/games/worms/worms.c
+++ b/games/worms/worms.c
@@ -67,6 +67,8 @@ static char sccsid[] = "@(#)worms.c 5.9 (Berkeley) 2/28/91";
#endif
#include <signal.h>
+extern char *malloc(), *getenv(), *tgetstr(), *tgoto();
+
static struct options {
int nopts;
int opts[3];
@@ -195,7 +197,7 @@ main(argc, argv)
void onsig();
short **ref;
char *AL, *BC, *CM, *EI, *HO, *IC, *IM, *IP, *SR;
- char *field, tcb[100], *mp, *malloc(), *getenv(), *tgetstr(), *tgoto();
+ char *field, tcb[100], *mp;
long random();
#ifdef USG
struct termio sg;