summaryrefslogtreecommitdiffstats
path: root/adventure
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-10 11:59:26 +0000
committerlukem <lukem@NetBSD.org>1997-10-10 11:59:26 +0000
commitccdde728ae3782113b7cc37dfd324b95fd647b80 (patch)
treefe3bf5c41a2a3f051023572550f5244503b00d5c /adventure
parent86e48c9a3b89780b5b63ae73636bda9f6c35206d (diff)
downloadbsdgames-darwin-ccdde728ae3782113b7cc37dfd324b95fd647b80.tar.gz
bsdgames-darwin-ccdde728ae3782113b7cc37dfd324b95fd647b80.tar.zst
bsdgames-darwin-ccdde728ae3782113b7cc37dfd324b95fd647b80.zip
deprecate register, fixup .Nm usage
Diffstat (limited to 'adventure')
-rw-r--r--adventure/Makefile3
-rw-r--r--adventure/adventure.64
-rw-r--r--adventure/crc.c15
-rw-r--r--adventure/done.c10
-rw-r--r--adventure/init.c6
-rw-r--r--adventure/io.c44
-rw-r--r--adventure/main.c6
-rw-r--r--adventure/subr.c30
-rw-r--r--adventure/vocab.c26
-rw-r--r--adventure/wizard.c6
10 files changed, 75 insertions, 75 deletions
diff --git a/adventure/Makefile b/adventure/Makefile
index b4b0b352..b72d695f 100644
--- a/adventure/Makefile
+++ b/adventure/Makefile
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.5 1997/08/11 14:06:10 christos Exp $
+# $NetBSD: Makefile,v 1.6 1997/10/10 11:59:26 lukem Exp $
# @(#)Makefile 8.1 (Berkeley) 6/12/93
-WARNS?= 1
PROG= adventure
SRCS= main.c init.c done.c save.c subr.c vocab.c wizard.c io.c data.c crc.c
MAN= adventure.6
diff --git a/adventure/adventure.6 b/adventure/adventure.6
index 90743efa..58a26498 100644
--- a/adventure/adventure.6
+++ b/adventure/adventure.6
@@ -1,4 +1,4 @@
-.\" $NetBSD: adventure.6,v 1.2 1995/03/21 12:04:57 cgd Exp $
+.\" $NetBSD: adventure.6,v 1.3 1997/10/10 11:59:33 lukem Exp $
.\"
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -45,7 +45,7 @@
.Nm adventure
.Nd an exploration game
.Sh SYNOPSIS
-.Nm adventure
+.Nm
.Op saved-file
.Sh DESCRIPTION
The object of the game is to locate and explore Colossal Cave, find the
diff --git a/adventure/crc.c b/adventure/crc.c
index 718907a8..e5e87370 100644
--- a/adventure/crc.c
+++ b/adventure/crc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: crc.c,v 1.3 1997/08/11 14:06:11 christos Exp $ */
+/* $NetBSD: crc.c,v 1.4 1997/10/10 11:59:36 lukem Exp $ */
/*-
* Copyright (c) 1993
@@ -42,7 +42,7 @@
static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 5/31/93";
static char ORIGINAL_sccsid[] = "@(#)crc.c 5.2 (Berkeley) 4/4/91";
#else
-__RCSID("$NetBSD: crc.c,v 1.3 1997/08/11 14:06:11 christos Exp $");
+__RCSID("$NetBSD: crc.c,v 1.4 1997/10/10 11:59:36 lukem Exp $");
#endif
#endif /* not lint */
@@ -120,12 +120,13 @@ crc_start()
crcval = step = 0;
}
-unsigned long crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */
-char *ptr;
-int nr;
+unsigned long
+crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */
+ char *ptr;
+ int nr;
{
- register int i;
- register char *p;
+ int i;
+ char *p;
while (nr > 0)
for (p = ptr; nr--; ++p)
diff --git a/adventure/done.c b/adventure/done.c
index 2340d2ee..2828db3c 100644
--- a/adventure/done.c
+++ b/adventure/done.c
@@ -1,4 +1,4 @@
-/* $NetBSD: done.c,v 1.3 1997/08/11 14:06:12 christos Exp $ */
+/* $NetBSD: done.c,v 1.4 1997/10/10 11:59:39 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)done.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: done.c,v 1.3 1997/08/11 14:06:12 christos Exp $");
+__RCSID("$NetBSD: done.c,v 1.4 1997/10/10 11:59:39 lukem Exp $");
#endif
#endif /* not lint */
@@ -55,7 +55,7 @@ __RCSID("$NetBSD: done.c,v 1.3 1997/08/11 14:06:12 christos Exp $");
int
score() /* sort of like 20000 */
-{ register int scor,i;
+{ int scor,i;
mxscor=scor=0;
for (i=50; i<=maxtrs; i++)
{ if (ptext[i].txtlen==0) continue;
@@ -93,7 +93,7 @@ score() /* sort of like 20000 */
void
done(entry) /* entry=1 means goto 13000 */ /* game is over */
int entry; /* entry=2 means goto 20000 */ /* 3=19000 */
-{ register int i,sc;
+{ int i,sc;
if (entry==1) mspeak(1);
if (entry==3) rspeak(136);
printf("\n\n\nYou scored %d out of a ",(sc=score()));
@@ -122,7 +122,7 @@ int entry; /* entry=2 means goto 20000 */ /* 3=19000 */
int
die(entry) /* label 90 */
int entry;
-{ register int i;
+{ int i;
if (entry != 99)
{ rspeak(23);
oldlc2=loc;
diff --git a/adventure/init.c b/adventure/init.c
index 11c3b0e7..5c9aa7c9 100644
--- a/adventure/init.c
+++ b/adventure/init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.5 1997/08/11 14:06:14 christos Exp $ */
+/* $NetBSD: init.c,v 1.6 1997/10/10 11:59:42 lukem Exp $ */
/*-
* Copyright (c) 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: init.c,v 1.5 1997/08/11 14:06:14 christos Exp $");
+__RCSID("$NetBSD: init.c,v 1.6 1997/10/10 11:59:42 lukem Exp $");
#endif
#endif /* not lint */
@@ -88,7 +88,7 @@ char a,b,c,d,e;
void
linkdata() /* secondary data manipulation */
-{ register int i,j;
+{ int i,j;
/* array linkages */
for (i=1; i<=LOCSIZ; i++)
diff --git a/adventure/io.c b/adventure/io.c
index 01d725c9..d76e35fb 100644
--- a/adventure/io.c
+++ b/adventure/io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.4 1997/08/11 14:06:15 christos Exp $ */
+/* $NetBSD: io.c,v 1.5 1997/10/10 11:59:45 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: io.c,v 1.4 1997/08/11 14:06:15 christos Exp $");
+__RCSID("$NetBSD: io.c,v 1.5 1997/10/10 11:59:45 lukem Exp $");
#endif
#endif /* not lint */
@@ -59,7 +59,7 @@ __RCSID("$NetBSD: io.c,v 1.4 1997/08/11 14:06:15 christos Exp $");
void
getin(wrd1,wrd2) /* get command from user */
char **wrd1,**wrd2; /* no prompt, usually */
-{ register char *s;
+{ char *s;
static char wd1buf[MAXSTR],wd2buf[MAXSTR];
int first, numch;
@@ -102,7 +102,7 @@ char **wrd1,**wrd2; /* no prompt, usually */
int
confirm(mesg) /* confirm irreversible action */
char *mesg;
-{ register int result;
+{ int result;
printf("%s",mesg); /* tell him what he did */
if (getchar()=='y') /* was his first letter a 'y'? */
result=1;
@@ -114,8 +114,8 @@ char *mesg;
int
yes(x,y,z) /* confirm with rspeak */
int x,y,z;
-{ register int result = TRUE; /* pacify gcc */
- register char ch;
+{ int result = TRUE; /* pacify gcc */
+ char ch;
for (;;)
{ rspeak(x); /* tell him what we want*/
if ((ch=getchar())=='y')
@@ -133,8 +133,8 @@ int x,y,z;
int
yesm(x,y,z) /* confirm with mspeak */
int x,y,z;
-{ register int result = TRUE; /* pacify gcc */
- register char ch;
+{ int result = TRUE; /* pacify gcc */
+ char ch;
for (;;)
{ mspeak(x); /* tell him what we want*/
if ((ch=getchar())=='y')
@@ -176,8 +176,8 @@ char breakch; /* tell which char ended rnum */
void
rdata() /* "read" data from virtual file*/
-{ register int sect;
- register char ch;
+{ int sect;
+ char ch;
inptr = data_file; /* Pointer to virtual data file */
srandom(SEED); /* which is lightly encrypted. */
@@ -247,7 +247,7 @@ char nbf[12];
int
rnum() /* read initial location num */
-{ register char *s;
+{ char *s;
tape = iotape; /* restart encryption tape */
for (s=nbf,*s=0;; s++)
if ((*s=next())==TAB || *s=='\n' || *s==LF)
@@ -263,7 +263,7 @@ char *seekhere;
void
rdesc(sect) /* read description-format msgs */
int sect;
-{ register int locc;
+{ int locc;
char *seekstart, *maystart;
seekhere = inptr; /* Where are we in virtual file?*/
@@ -328,9 +328,9 @@ int sect;
void
rtrav() /* read travel table */
-{ register int locc;
- register struct travlist *t = NULL;
- register char *s;
+{ int locc;
+ struct travlist *t = NULL;
+ char *s;
char buf[12];
int len,m,n,entries = 0;
@@ -377,7 +377,7 @@ rtrav() /* read travel table */
void
twrite(loq) /* travel options from this loc */
int loq;
-{ register struct travlist *t;
+{ struct travlist *t;
printf("If");
speak(&ltext[loq]);
printf("then\n");
@@ -397,8 +397,8 @@ int loq;
void
rvoc()
-{ register char *s; /* read the vocabulary */
- register int index;
+{ char *s; /* read the vocabulary */
+ int index;
char buf[6];
for (;;)
{ index=rnum();
@@ -437,7 +437,7 @@ rdflt() /* default verb messages */
void
rliq() /* liquid assets &c: cond bits */
-{ register int bitnum;
+{ int bitnum;
for (;;) /* read new bit list */
{ if ((bitnum=rnum())<0) break;
for (;;) /* read locs for bits */
@@ -449,7 +449,7 @@ rliq() /* liquid assets &c: cond bits */
void
rhints()
-{ register int hintnum,i;
+{ int hintnum,i;
hntmax=0;
for (;;)
{ if ((hintnum=rnum())<0) break;
@@ -478,7 +478,7 @@ void
speak(msg) /* read, decrypt, and print a message (not ptext) */
struct text *msg;/* msg is a pointer to seek address and length of mess */
{
- register char *s, nonfirst;
+ char *s, nonfirst;
s = msg->seekadr;
nonfirst=0;
@@ -504,7 +504,7 @@ pspeak(m,skip) /* read, decrypt an print a ptext message */
int m; /* msg is the number of all the p msgs for this place */
int skip; /* assumes object 1 doesn't have prop 1, obj 2 no prop 2 &c*/
{
- register char *s,nonfirst;
+ char *s,nonfirst;
char *numst, save;
struct text *msg;
char *tbuf;
diff --git a/adventure/main.c b/adventure/main.c
index e5d12126..a9e83b70 100644
--- a/adventure/main.c
+++ b/adventure/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.6 1997/08/11 14:06:16 christos Exp $ */
+/* $NetBSD: main.c,v 1.7 1997/10/10 11:59:49 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -48,7 +48,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: main.c,v 1.6 1997/08/11 14:06:16 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.7 1997/10/10 11:59:49 lukem Exp $");
#endif
#endif /* not lint */
@@ -66,7 +66,7 @@ main(argc,argv)
int argc;
char **argv;
{
- register int i;
+ int i;
int rval,ll;
struct text *kk;
diff --git a/adventure/subr.c b/adventure/subr.c
index 758527a8..64d60714 100644
--- a/adventure/subr.c
+++ b/adventure/subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: subr.c,v 1.3 1997/08/11 14:06:17 christos Exp $ */
+/* $NetBSD: subr.c,v 1.4 1997/10/10 11:59:53 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: subr.c,v 1.3 1997/08/11 14:06:17 christos Exp $");
+__RCSID("$NetBSD: subr.c,v 1.4 1997/10/10 11:59:53 lukem Exp $");
#endif
#endif /* not lint */
@@ -83,7 +83,7 @@ int pbotl;
int
liq(foo)
-{ register int i;
+{ int i;
i=prop[bottle];
if (i>-1-i) return(liq2(i));
else return(liq2(-1-i));
@@ -92,7 +92,7 @@ liq(foo)
int
liqloc(locc) /* may want to clean this one up a bit */
int locc;
-{ register int i,j,l;
+{ int i,j,l;
i=cond[locc]/2;
j=((i*2)%8)-5;
l=cond[locc]/4;
@@ -131,8 +131,8 @@ int n;
int
fdwarf() /* 71 */
-{ register int i,j;
- register struct travlist *kk;
+{ int i,j;
+ struct travlist *kk;
if (newloc!=loc&&!forced(loc)&&!bitset(loc,3))
{ for (i=1; i<=5; i++)
@@ -250,7 +250,7 @@ fdwarf() /* 71 */
int
march() /* label 8 */
-{ register int ll1,ll2;
+{ int ll1,ll2;
if ((tkk=travel[newloc=loc])==0) bug(26);
if (k==null) return(2);
@@ -316,8 +316,8 @@ l12: /* alternative to probability move */
int
mback() /* 20 */
-{ register struct travlist *tk2,*j;
- register int ll;
+{ struct travlist *tk2,*j;
+ int ll;
if (forced(k=oldloc)) k=oldlc2; /* k=location */
oldlc2=oldloc;
oldloc=loc;
@@ -420,7 +420,7 @@ int n;
int
checkhints() /* 2600 &c */
-{ register int hint;
+{ int hint;
for (hint=4; hint<=hntmax; hint++)
{ if (hinted[hint]) continue;
if (!bitset(loc,hint)) hintlc[hint]= -1;
@@ -460,7 +460,7 @@ checkhints() /* 2600 &c */
int
trsay() /* 9030 */
-{ register int i;
+{ int i;
if (*wd2!=0) copystr(wd2,wd1);
i=vocab(wd1,-1,0);
if (i==62||i==65||i==71||i==2025)
@@ -634,7 +634,7 @@ tropen() /* 9040 */
int
trkill() /* 9120 */
-{ register int i;
+{ int i;
for (i=1; i<=5; i++)
if (dloc[i]==loc&&dflag>=2) break;
if (i==6) i=0;
@@ -692,7 +692,7 @@ trkill() /* 9120 */
int
trtoss() /* 9170: throw */
-{ register int i;
+{ int i;
if (toting(rod2)&&obj==rod&&!toting(rod)) obj=rod2;
if (!toting(obj)) return(2011);
if (obj>=50&&obj<=maxtrs&&at(troll))
@@ -811,7 +811,7 @@ trfill() /* 9220 */
int
closing() /* 10000 */
-{ register int i;
+{ int i;
prop[grate]=prop[fissur]=0;
for (i=1; i<=6; i++)
@@ -837,7 +837,7 @@ closing() /* 10000 */
int
caveclose() /* 11000 */
-{ register int i;
+{ int i;
prop[bottle]=put(bottle,115,1);
prop[plant]=put(plant,115,0);
prop[oyster]=put(oyster,115,0);
diff --git a/adventure/vocab.c b/adventure/vocab.c
index 864a6f22..25487241 100644
--- a/adventure/vocab.c
+++ b/adventure/vocab.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vocab.c,v 1.3 1997/08/11 14:06:18 christos Exp $ */
+/* $NetBSD: vocab.c,v 1.4 1997/10/10 11:59:56 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)vocab.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: vocab.c,v 1.3 1997/08/11 14:06:18 christos Exp $");
+__RCSID("$NetBSD: vocab.c,v 1.4 1997/10/10 11:59:56 lukem Exp $");
#endif
#endif /* not lint */
@@ -63,7 +63,7 @@ int object;
void
juggle(object)
int object;
-{ register int i,j;
+{ int i,j;
i=place[object];
j=fixed[object];
@@ -75,7 +75,7 @@ int object;
void
move(object,where)
int object,where;
-{ register int from;
+{ int from;
if (object<=100)
from=place[object];
@@ -95,7 +95,7 @@ int object,where,pval;
void
carry(object,where)
int object,where;
-{ register int temp;
+{ int temp;
if (object<=100)
{ if (place[object]== -1) return;
@@ -129,8 +129,8 @@ vocab(word,type,value) /* look up or store a word */
char *word;
int type; /* -2 for store, -1 for user word, >=0 for canned lookup*/
int value; /* used for storing only */
-{ register int adr;
- register char *s,*t;
+{ int adr;
+ char *s,*t;
int hash, i;
struct hashtab *h;
@@ -186,7 +186,7 @@ int value; /* used for storing only */
void
copystr(w1,w2) /* copy one string to another */
char *w1,*w2;
-{ register char *s,*t;
+{ char *s,*t;
for (s=w1,t=w2; *s;)
*t++ = *s++;
*t=0;
@@ -195,8 +195,8 @@ char *w1,*w2;
int
weq(w1,w2) /* compare words */
char *w1,*w2; /* w1 is user, w2 is system */
-{ register char *s,*t;
- register int i;
+{ char *s,*t;
+ int i;
s=w1;
t=w2;
for (i=0; i<5; i++) /* compare at most 5 chars */
@@ -210,15 +210,15 @@ char *w1,*w2; /* w1 is user, w2 is system */
int
length(str) /* includes 0 at end */
char *str;
-{ register char *s;
- register int n;
+{ char *s;
+ int n;
for (n=0,s=str; *s++;) n++;
return(n+1);
}
void
prht() /* print hash table */
-{ register int i,j,l;
+{ int i,j,l;
char *c;
struct hashtab *h;
for (i=0; i<HTSIZE/10+1; i++)
diff --git a/adventure/wizard.c b/adventure/wizard.c
index 59460f3b..86d556fc 100644
--- a/adventure/wizard.c
+++ b/adventure/wizard.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wizard.c,v 1.4 1997/08/11 14:06:19 christos Exp $ */
+/* $NetBSD: wizard.c,v 1.5 1997/10/10 12:00:02 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)wizard.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: wizard.c,v 1.4 1997/08/11 14:06:19 christos Exp $");
+__RCSID("$NetBSD: wizard.c,v 1.5 1997/10/10 12:00:02 lukem Exp $");
#endif
#endif /* not lint */
@@ -125,7 +125,7 @@ wizard() /* not as complex as advent/10 (for now) */
void
ciao(cmdfile)
char *cmdfile;
-{ register char *c;
+{ char *c;
char fname[80];
printf("What would you like to call the saved version?\n");