deprecate register, fixup .Nm usage
This commit is contained in:
parent
3e66e4150c
commit
434abd72aa
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
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)
|
||||
|
@ -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;
|
||||
|
@ -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++)
|
||||
|
@ -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(<ext[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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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++)
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user