From 44fac3a89d25ca434f91c4f961a363ea590faae8 Mon Sep 17 00:00:00 2001 From: billf Date: Tue, 16 Nov 1999 02:58:06 +0000 Subject: Sync our register usage with NetBSD's (non-)usage. --- games/adventure/crc.c | 4 ++-- games/adventure/done.c | 6 +++--- games/adventure/init.c | 2 +- games/adventure/io.c | 36 ++++++++++++++++++------------------ games/adventure/main.c | 2 +- games/adventure/subr.c | 28 ++++++++++++++-------------- games/adventure/vocab.c | 12 ++++++------ games/adventure/wizard.c | 6 +++--- 8 files changed, 48 insertions(+), 48 deletions(-) (limited to 'games/adventure') diff --git a/games/adventure/crc.c b/games/adventure/crc.c index 19b0f90..952d102 100644 --- a/games/adventure/crc.c +++ b/games/adventure/crc.c @@ -118,8 +118,8 @@ u_long crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */ const char *ptr; int nr; { - register int i; - register const char *p; + int i; + const char *p; while (nr > 0) for (p = ptr; nr--; ++p) diff --git a/games/adventure/done.c b/games/adventure/done.c index 79b91c3..9cb25bf 100644 --- a/games/adventure/done.c +++ b/games/adventure/done.c @@ -48,7 +48,7 @@ static char sccsid[] = "@(#)done.c 8.1 (Berkeley) 5/31/93"; #include "hdr.h" 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; @@ -85,7 +85,7 @@ score() /* sort of like 20000 */ 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())); @@ -114,7 +114,7 @@ int entry; /* entry=2 means goto 20000 */ /* 3=19000 */ void die(entry) /* label 90 */ int entry; -{ register int i; +{ int i; if (entry != 99) { rspeak(23); oldlc2=loc; diff --git a/games/adventure/init.c b/games/adventure/init.c index f1a790d..893e303 100644 --- a/games/adventure/init.c +++ b/games/adventure/init.c @@ -78,7 +78,7 @@ char a,b,c,d,e; } linkdata() /* secondary data manipulation */ -{ register int i,j; +{ int i,j; /* array linkages */ for (i=1; i<=LOCSIZ; i++) diff --git a/games/adventure/io.c b/games/adventure/io.c index 4b53659..7b929f6 100644 --- a/games/adventure/io.c +++ b/games/adventure/io.c @@ -53,7 +53,7 @@ static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93"; 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; @@ -98,7 +98,7 @@ char **wrd1,**wrd2; /* no prompt, usually */ yes(x,y,z) /* confirm with rspeak */ int x,y,z; -{ register int result; +{ int result; int ch; for (;;) { rspeak(x); /* tell him what we want*/ @@ -120,7 +120,7 @@ int x,y,z; yesm(x,y,z) /* confirm with mspeak */ int x,y,z; -{ register int result; +{ int result; int ch; for (;;) { mspeak(x); /* tell him what we want*/ @@ -165,8 +165,8 @@ next() /* next virtual char, bump adr */ char breakch; /* tell which char ended rnum */ 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. */ @@ -235,7 +235,7 @@ char nbf[12]; 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) @@ -250,8 +250,8 @@ char *seekhere; rdesc(sect) /* read description-format msgs */ int sect; -{ register char *s,*t; - register int locc; +{ char *s,*t; + int locc; char *seekstart, *maystart, *adrstart; char *entry; @@ -314,9 +314,9 @@ int sect; rtrav() /* read travel table */ -{ register int locc; - register struct travlist *t; - register char *s; +{ int locc; + struct travlist *t; + char *s; char buf[12]; int len,m,n,entries; for (oldloc= -1;;) /* get another line */ @@ -367,7 +367,7 @@ rtrav() /* read travel table */ twrite(loq) /* travel options from this loc */ int loq; -{ register struct travlist *t; +{ struct travlist *t; printf("If"); speak(<ext[loq]); printf("then\n"); @@ -386,8 +386,8 @@ int loq; #endif DEBUG rvoc() -{ register char *s; /* read the vocabulary */ - register int index; +{ char *s; /* read the vocabulary */ + int index; char buf[6]; for (;;) { index=rnum(); @@ -423,7 +423,7 @@ rdflt() /* default verb messages */ } 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 */ @@ -434,7 +434,7 @@ rliq() /* liquid assets &c: cond bits */ } rhints() -{ register int hintnum,i; +{ int hintnum,i; hntmax=0; for (;;) { if ((hintnum=rnum())<0) break; @@ -460,7 +460,7 @@ int msg; speak(msg) /* read, decrypt, and print a message (not ptext) */ const 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; @@ -485,7 +485,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/games/adventure/main.c b/games/adventure/main.c index 6bd549e..39a90c4 100644 --- a/games/adventure/main.c +++ b/games/adventure/main.c @@ -62,7 +62,7 @@ int argc; char **argv; { extern int errno; - register int i; + int i; int rval,ll; struct text *kk; extern trapdel(); diff --git a/games/adventure/subr.c b/games/adventure/subr.c index 24c4352..ffac61a 100644 --- a/games/adventure/subr.c +++ b/games/adventure/subr.c @@ -73,7 +73,7 @@ int pbotl; } liq() -{ register int i; +{ int i; i=prop[bottle]; if (i>-1-i) return(liq2(i)); else return(liq2(-1-i)); @@ -81,7 +81,7 @@ liq() 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; @@ -115,8 +115,8 @@ int n; 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++) @@ -233,7 +233,7 @@ fdwarf() /* 71 */ march() /* label 8 */ -{ register int ll1,ll2; +{ int ll1,ll2; if ((tkk=travel[newloc=loc])==0) bug(26); if (k==null) return(2); @@ -298,8 +298,8 @@ l12: /* alternative to probability move */ 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; @@ -399,7 +399,7 @@ int n; void 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; @@ -437,7 +437,7 @@ checkhints() /* 2600 &c */ trsay() /* 9030 */ -{ register int i; +{ int i; if (*wd2!=0) strcpy(wd1,wd2); i=vocab(wd1,-1); if (i==62||i==65||i==71||i==2025) @@ -451,7 +451,7 @@ trsay() /* 9030 */ trtake() /* 9010 */ -{ register int i; +{ int i; if (toting(obj)) return(2011); /* 9010 */ spk=25; if (obj==plant&&prop[plant]<=0) spk=115; @@ -607,7 +607,7 @@ tropen() /* 9040 */ 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; @@ -664,7 +664,7 @@ trkill() /* 9120 */ 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)) @@ -781,7 +781,7 @@ trfill() /* 9220 */ void closing() /* 10000 */ -{ register int i; +{ int i; prop[grate]=prop[fissur]=0; for (i=1; i<=6; i++) @@ -806,7 +806,7 @@ closing() /* 10000 */ void 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/games/adventure/vocab.c b/games/adventure/vocab.c index 70eefa4..84d558b 100644 --- a/games/adventure/vocab.c +++ b/games/adventure/vocab.c @@ -56,7 +56,7 @@ int object; juggle(object) int object; -{ register int i,j; +{ int i,j; i=place[object]; j=fixed[object]; @@ -67,7 +67,7 @@ int object; move(object,where) int object,where; -{ register int from; +{ int from; if (object<=100) from=place[object]; @@ -86,7 +86,7 @@ int object,where,pval; carry(object,where) int object,where; -{ register int temp; +{ int temp; if (object<=100) { if (place[object]== -1) return; @@ -119,9 +119,9 @@ vocab(word,type,value) /* look up or store a word */ const char *word; int type; /* -2 for store, -1 for user word, >=0 for canned lookup*/ int value; /* used for storing only */ -{ register int adr; +{ int adr; const char *s; - register char *t; + char *t; int hash, i; struct hashtab *h; @@ -175,7 +175,7 @@ int value; /* used for storing only */ } prht() /* print hash table */ -{ register int i,j,l; +{ int i,j,l; char *c; struct hashtab *h; for (i=0; i