diff options
author | billf <billf@FreeBSD.org> | 1999-11-16 02:58:06 +0000 |
---|---|---|
committer | billf <billf@FreeBSD.org> | 1999-11-16 02:58:06 +0000 |
commit | 44fac3a89d25ca434f91c4f961a363ea590faae8 (patch) | |
tree | a0cca4d47c73890ff2acd4b0d9331509ac360eb2 | |
parent | ecc8d489403ddff78c214db39def15049d5dae6a (diff) | |
download | FreeBSD-src-44fac3a89d25ca434f91c4f961a363ea590faae8.zip FreeBSD-src-44fac3a89d25ca434f91c4f961a363ea590faae8.tar.gz |
Sync our register usage with NetBSD's (non-)usage.
242 files changed, 2006 insertions, 2011 deletions
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<HTSIZE/10+1; i++) diff --git a/games/adventure/wizard.c b/games/adventure/wizard.c index eff6d5f..b02c900 100644 --- a/games/adventure/wizard.c +++ b/games/adventure/wizard.c @@ -103,7 +103,7 @@ Start() } wizard() /* not as complex as advent/10 (for now) */ -{ register int wiz; +{ int wiz; char *word,*x; if (!yesm(16,0,7)) return(FALSE); mspeak(17); @@ -117,8 +117,8 @@ wizard() /* not as complex as advent/10 (for now) */ } ciao() -{ register char *c; - register int outfd, size; +{ char *c; + int outfd, size; char fname[80], buf[512]; extern unsigned filesize; diff --git a/games/arithmetic/arithmetic.c b/games/arithmetic/arithmetic.c index d7d8b95..4e8efef 100644 --- a/games/arithmetic/arithmetic.c +++ b/games/arithmetic/arithmetic.c @@ -113,7 +113,7 @@ main(argc, argv) while ((ch = getopt(argc, argv, "r:o:")) != -1) switch(ch) { case 'o': { - register const char *p; + const char *p; for (p = keys = optarg; *p; ++p) if (!index(keylist, *p)) { @@ -184,7 +184,7 @@ showstats() */ problem() { - register char *p; + char *p; time_t start, finish; int left, op, right, result; char line[80]; @@ -317,7 +317,7 @@ getrandom(maxval, op, operand) int maxval, op, operand; { int value; - register struct penalty **pp, *p; + struct penalty **pp, *p; op = opnum(op); value = random() % (maxval + penalty[op][operand]); diff --git a/games/atc/graphics.c b/games/atc/graphics.c index 36ee49f..91aa975 100644 --- a/games/atc/graphics.c +++ b/games/atc/graphics.c @@ -126,7 +126,7 @@ init_gr() setup_screen(scp) const C_SCREEN *scp; { - register int i, j; + int i, j; char str[3]; const char *airstr; diff --git a/games/backgammon/backgammon/extra.c b/games/backgammon/backgammon/extra.c index acefad5..86170ee 100644 --- a/games/backgammon/backgammon/extra.c +++ b/games/backgammon/backgammon/extra.c @@ -50,7 +50,7 @@ FILE *trace; */ dble () { - register int resp; /* response to y/n */ + int resp; /* response to y/n */ for (;;) { writel (" doubles."); /* indicate double */ @@ -115,12 +115,12 @@ dble () { */ dblgood () { - register int n; /* accumulated judgment */ - register int OFFC = *offptr; /* no. of computer's men off */ - register int OFFO = *offopp; /* no. of player's men off */ + int n; /* accumulated judgment */ + int OFFC = *offptr; /* no. of computer's men off */ + int OFFO = *offopp; /* no. of player's men off */ #ifdef DEBUG - register int i; + int i; if (trace == NULL) trace = fopen ("bgtrace","w"); #endif @@ -193,7 +193,7 @@ freemen (b) int b; { - register int i, inc, lim; + int i, inc, lim; odds(0,0,0); if (board[b] == 0) @@ -212,7 +212,7 @@ trapped (n,inc) int n, inc; { - register int i, j, k; + int i, j, k; int c, l, ct; ct = 0; @@ -237,7 +237,7 @@ int n, inc; eval () { - register int i, j; + int i, j; for (j = i = 0; i < 26; i++) j += (board[i] >= 0 ? i*board[i] : (25-i)*board[i]); diff --git a/games/backgammon/backgammon/main.c b/games/backgammon/backgammon/main.c index 972f0ee..c6abfab 100644 --- a/games/backgammon/backgammon/main.c +++ b/games/backgammon/backgammon/main.c @@ -96,9 +96,9 @@ int argc; char **argv; { - register int i; /* non-descript index */ - register int l; /* non-descript index */ - register char c; /* non-descript character storage */ + int i; /* non-descript index */ + int l; /* non-descript index */ + char c; /* non-descript character storage */ /* revoke privs */ setgid(getgid()); diff --git a/games/backgammon/backgammon/move.c b/games/backgammon/backgammon/move.c index 8b3286f..bf8ab86 100644 --- a/games/backgammon/backgammon/move.c +++ b/games/backgammon/backgammon/move.c @@ -89,8 +89,8 @@ static int race; /* game reduced to a race */ move (okay) int okay; /* zero if first move */ { - register int i; /* index */ - register int l; /* last man */ + int i; /* index */ + int l; /* last man */ if (okay) { /* see if comp should double */ @@ -177,12 +177,12 @@ int okay; /* zero if first move */ } trymove (mvnum,swapped) -register int mvnum; /* number of move (rel zero) */ +int mvnum; /* number of move (rel zero) */ int swapped; /* see if swapped also tested */ { - register int pos; /* position on board */ - register int rval; /* value of roll */ + int pos; /* position on board */ + int rval; /* value of roll */ /* if recursed through all dice * values, compare move */ @@ -233,7 +233,7 @@ int swapped; /* see if swapped also tested */ struct BOARD * bsave () { - register int i; /* index */ + int i; /* index */ struct BOARD *now; /* current position */ now = nextfree (); /* get free BOARD */ @@ -255,8 +255,8 @@ bsave () { binsert (new) struct BOARD *new; /* item to insert */ { - register struct BOARD *p = checkq; /* queue pointer */ - register int result; /* comparison result */ + struct BOARD *p = checkq; /* queue pointer */ + int result; /* comparison result */ if (p == 0) { /* check if queue empty */ checkq = p = new; @@ -299,9 +299,9 @@ bcomp (a,b) struct BOARD *a; struct BOARD *b; { - register int *aloc = a->b_board; /* pointer to board a */ - register int *bloc = b->b_board; /* pointer to board b */ - register int i; /* index */ + int *aloc = a->b_board; /* pointer to board a */ + int *bloc = b->b_board; /* pointer to board b */ + int i; /* index */ int result; /* comparison result */ for (i = 0; i < 26; i++) { /* compare boards */ @@ -313,11 +313,11 @@ struct BOARD *b; } mvcheck (incumbent,candidate) -register struct BOARD *incumbent; -register struct BOARD *candidate; +struct BOARD *incumbent; +struct BOARD *candidate; { - register int i; - register int result; + int i; + int result; for (i = 0; i < mvlim; i++) { result = cturn*(candidate->b_st[i]-incumbent->b_st[i]); @@ -361,8 +361,8 @@ nextfree () { pickmove () { /* current game position */ - register struct BOARD *now = bsave(); - register struct BOARD *next; /* next move */ + struct BOARD *now = bsave(); + struct BOARD *next; /* next move */ #ifdef DEBUG if (trace == NULL) @@ -382,9 +382,9 @@ pickmove () { } boardcopy (s) -register struct BOARD *s; /* game situation */ +struct BOARD *s; /* game situation */ { - register int i; /* index */ + int i; /* index */ for (i = 0; i < 26; i++) board[i] = s->b_board[i]; @@ -399,8 +399,8 @@ register struct BOARD *s; /* game situation */ } movcmp () { - register int i; - register int c; + int i; + int c; #ifdef DEBUG if (trace == NULL) @@ -472,7 +472,7 @@ movcmp () { } movegood () { - register int n; + int n; if (*offptr == 15) return (1); diff --git a/games/backgammon/backgammon/text.c b/games/backgammon/backgammon/text.c index 00a5946..3ec45f1 100644 --- a/games/backgammon/backgammon/text.c +++ b/games/backgammon/backgammon/text.c @@ -111,7 +111,7 @@ text (t) const char *const *t; { - register int i; + int i; const char *s, *a; fixtty (noech); diff --git a/games/backgammon/common_source/allow.c b/games/backgammon/common_source/allow.c index 620ce05..d2848b1d 100644 --- a/games/backgammon/common_source/allow.c +++ b/games/backgammon/common_source/allow.c @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)allow.c 8.1 (Berkeley) 5/31/93"; movallow () { - register int i, m, iold; + int i, m, iold; int r; if (d0) diff --git a/games/backgammon/common_source/board.c b/games/backgammon/common_source/board.c index 1446248..b7c365c 100644 --- a/games/backgammon/common_source/board.c +++ b/games/backgammon/common_source/board.c @@ -44,7 +44,7 @@ static int i, j, k; static char ln[60]; wrboard () { - register int l; + int l; static const char bl[] = "| | | |\n"; static const char sv[] = @@ -160,8 +160,8 @@ lastline: } wrbsub () { - register int m; - register char d; + int m; + char d; if (board[k] > 0) { m = board[k]; diff --git a/games/backgammon/common_source/check.c b/games/backgammon/common_source/check.c index c545e39..78433b7 100644 --- a/games/backgammon/common_source/check.c +++ b/games/backgammon/common_source/check.c @@ -40,7 +40,7 @@ static char sccsid[] = "@(#)check.c 8.1 (Berkeley) 5/31/93"; #include "back.h" getmove () { - register int i, c; + int i, c; c = 0; for (;;) { @@ -103,10 +103,10 @@ getmove () { } movokay (mv) -register int mv; +int mv; { - register int i, m; + int i, m; if (d0) swap; diff --git a/games/backgammon/common_source/fancy.c b/games/backgammon/common_source/fancy.c index 8a4ddc4..6ddb464 100644 --- a/games/backgammon/common_source/fancy.c +++ b/games/backgammon/common_source/fancy.c @@ -86,7 +86,7 @@ int realc; int addbuf __P((int)); fboard () { - register int i, j, l; + int i, j, l; curmove (0,0); /* do top line */ for (i = 0; i < 53; i++) @@ -200,9 +200,9 @@ int cpos; /* column of position */ int cnext; /* direction of position */ { - register int j; /* index */ - register int n; /* number of men on position */ - register int bct; /* counter */ + int j; /* index */ + int n; /* number of men on position */ + int bct; /* counter */ int k; /* index */ char pc; /* color of men on position */ @@ -254,7 +254,7 @@ int cnext; /* direction of position */ } refresh() { - register int i, r, c; + int i, r, c; r = curr; /* save current position */ c = curc; @@ -314,7 +314,7 @@ fixpos (old,new,r,c,inc) int old, new, r, c, inc; { - register int o, n, nv; + int o, n, nv; int ov, nc; char col; @@ -381,11 +381,10 @@ int old, new, r, c, inc; } fixcol (r,c,l,ch,inc) -register int l, ch; -int r, c, inc; +int l, ch, r, c, inc; { - register int i; + int i; curmove (r,c); fancyc (ch); @@ -396,7 +395,7 @@ int r, c, inc; } curmove (r,c) -register int r, c; +int r, c; { if (curr == r && curc == c) @@ -410,9 +409,9 @@ register int r, c; } newpos () { - register int r; /* destination row */ - register int c; /* destination column */ - register int mode = -1; /* mode of movement */ + int r; /* destination row */ + int c; /* destination column */ + int mode = -1; /* mode of movement */ int count = 1000; /* character count */ int i; /* index */ @@ -577,7 +576,7 @@ newpos () { } clear () { - register int i; + int i; /* double space if can't clear */ if (CL == 0) { @@ -595,9 +594,9 @@ clear () { fancyc (c) -register char c; /* character to output */ +char c; /* character to output */ { - register int sp; /* counts spaces in a tab */ + int sp; /* counts spaces in a tab */ if (c == '\007') { /* bells go in blindly */ addbuf (c); @@ -651,8 +650,8 @@ register char c; /* character to output */ } clend() { - register int i; - register char *s; + int i; + char *s; if (CD) { @@ -673,9 +672,9 @@ clend() { } cline () { - register int i; - register int c; - register char *s; + int i; + int c; + char *s; if (curc > linect[curr]) return; @@ -707,8 +706,8 @@ getcaps (s) const char *s; { - register char *code; /* two letter code */ - register char ***cap; /* pointer to cap string */ + char *code; /* two letter code */ + char ***cap; /* pointer to cap string */ char *bufp; /* pointer to cap buffer */ char tentry[1024]; /* temporary uncoded caps buffer */ diff --git a/games/backgammon/common_source/odds.c b/games/backgammon/common_source/odds.c index a989d65..d3e21e4 100644 --- a/games/backgammon/common_source/odds.c +++ b/games/backgammon/common_source/odds.c @@ -40,10 +40,10 @@ static char sccsid[] = "@(#)odds.c 8.1 (Berkeley) 5/31/93"; #include "back.h" odds (r1,r2,val) -register int r1; +int r1; int r2, val; { - register int i, j; + int i, j; if (r1 == 0) { for (i = 0; i < 6; i++) @@ -65,9 +65,9 @@ int r2, val; } count () { - register int i; - register int j; - register int total; + int i; + int j; + int total; total = 0; for (i = 0; i < 6; i++) @@ -80,7 +80,7 @@ canhit (i,c) int i, c; { - register int j, k, b; + int j, k, b; int a, d, diff, place, addon, menstuck; if (c == 0) diff --git a/games/backgammon/common_source/one.c b/games/backgammon/common_source/one.c index a8dda64..e62a59f 100644 --- a/games/backgammon/common_source/one.c +++ b/games/backgammon/common_source/one.c @@ -40,10 +40,10 @@ static char sccsid[] = "@(#)one.c 8.1 (Berkeley) 5/31/93"; #include "back.h" makmove (i) -register int i; +int i; { - register int n, d; + int n, d; int max; d = d0; @@ -94,10 +94,10 @@ register int i; } moverr (i) -register int i; +int i; { - register int j; + int j; if (tflag) curmove (20,0); @@ -117,7 +117,7 @@ register int i; checkd (d) -register int d; +int d; { if (d0 != d) @@ -126,7 +126,7 @@ register int d; } last () { - register int i; + int i; for (i = home-6*cturn; i != home; i += cturn) if (board[i]*cturn > 0) @@ -134,17 +134,17 @@ last () { } movback (i) -register int i; +int i; { - register int j; + int j; for (j = i-1; j >= 0; j--) backone(j); } backone (i) -register int i; +int i; { board[p[i]] += cturn; diff --git a/games/backgammon/common_source/save.c b/games/backgammon/common_source/save.c index a82939b..674c192 100644 --- a/games/backgammon/common_source/save.c +++ b/games/backgammon/common_source/save.c @@ -53,11 +53,11 @@ static const char rec[] = "\" to recover your game.\n\n"; static const char cantrec[] = "Can't recover file: "; save (n) -register int n; +int n; { - register int fdesc; - register char *fs; + int fdesc; + char *fs; char fname[50]; if (n) { @@ -148,7 +148,7 @@ recover (s) const char *s; { - register int i; + int i; int fdesc; if ((fdesc = open (s,O_RDONLY)) == -1) diff --git a/games/backgammon/common_source/subs.c b/games/backgammon/common_source/subs.c index a54ee4b..d60bf4a 100644 --- a/games/backgammon/common_source/subs.c +++ b/games/backgammon/common_source/subs.c @@ -63,7 +63,7 @@ const char *const descr[] = { }; errexit (s) -register char *s; +char *s; { write (2,"\n",1); perror (s); @@ -71,7 +71,7 @@ register char *s; } int addbuf (c) -register int c; +int c; { buffnum++; @@ -169,7 +169,7 @@ proll () { wrint (n) int n; { - register int i, j, t; + int i, j, t; for (i = 4; i > 0; i--) { t = 1; @@ -182,7 +182,7 @@ int n; } gwrite() { - register int r, c; + int r, c; if (tflag) { r = curr; @@ -224,7 +224,7 @@ gwrite() { } quit () { - register int i; + int i; if (tflag) { curmove (20,0); @@ -245,10 +245,10 @@ quit () { } yorn (special) -register char special; /* special response */ +char special; /* special response */ { - register char c; - register int i; + char c; + int i; i = 1; while ( (c = readc()) != 'Y' && c != 'N') { @@ -275,7 +275,7 @@ register char special; /* special response */ } wrhit (i) -register int i; +int i; { writel ("Blot hit on "); wrint (i); @@ -284,7 +284,7 @@ register int i; } nexturn () { - register int c; + int c; cturn = -cturn; c = cturn/abs(cturn); @@ -299,11 +299,11 @@ nexturn () { } getarg (argc, argv) -register int argc; -register char **argv; +int argc; +char **argv; { - register char ch; + char ch; extern int optind; extern char *optarg; int i; @@ -384,7 +384,7 @@ register char **argv; } init () { - register int i; + int i; for (i = 0; i < 26;) board[i++] = 0; board[1] = 2; @@ -435,9 +435,9 @@ getout () { exit(0); } roll () { - register char c; - register int row; - register int col; + char c; + int row; + int col; if (iroll) { if (tflag) { diff --git a/games/backgammon/common_source/table.c b/games/backgammon/common_source/table.c index d8f074d..b64f09b 100644 --- a/games/backgammon/common_source/table.c +++ b/games/backgammon/common_source/table.c @@ -81,8 +81,8 @@ checkmove (ist) int ist; { - register int j, n; - register char c; + int j, n; + char c; char a; domove: @@ -202,10 +202,10 @@ dochar: dotable (c,i) char c; -register int i; +int i; { - register int a, j; + int a, j; int test; test = (c == 'R'); @@ -298,7 +298,7 @@ register int i; } rsetbrd () { - register int i, j, n; + int i, j, n; n = 0; mvl = 0; diff --git a/games/backgammon/teachgammon/teach.c b/games/backgammon/teachgammon/teach.c index 2aa1409..64e7aa7 100644 --- a/games/backgammon/teachgammon/teach.c +++ b/games/backgammon/teachgammon/teach.c @@ -82,7 +82,7 @@ int argc; char **argv; { - register int i; + int i; /* revoke privs */ setgid(getgid()); @@ -160,7 +160,7 @@ char **argv; } leave() { - register int i; + int i; if (tflag) clear(); else diff --git a/games/backgammon/teachgammon/tutor.c b/games/backgammon/teachgammon/tutor.c index 4409ba9..4b3370b 100644 --- a/games/backgammon/teachgammon/tutor.c +++ b/games/backgammon/teachgammon/tutor.c @@ -49,7 +49,7 @@ static const char better[] = "That is a legal move, but there is a better one.\n void tutor () { - register int i, j; + int i, j; i = 0; begscr = 18; @@ -133,7 +133,7 @@ tutor () { } clrest () { - register int r, c, j; + int r, c, j; r = curr; c = curc; diff --git a/games/battlestar/com1.c b/games/battlestar/com1.c index 643f037..6dd600a 100644 --- a/games/battlestar/com1.c +++ b/games/battlestar/com1.c @@ -66,7 +66,7 @@ convert(tothis) /* Converts day to night and vice versa. */ int tothis; /* Day objects are permanent. Night objects are added*/ { /* at dusk, and subtracted at dawn. */ const struct objs *p; - register i, j; + int i, j; if (tothis == TONIGHT) { for (i = 1; i <= NUMOFROOMS; i++) @@ -87,7 +87,7 @@ int tothis; /* Day objects are permanent. Night objects are added*/ news() { - register int n; + int n; int hurt; if (gtime > 30 && position < 32){ diff --git a/games/battlestar/com2.c b/games/battlestar/com2.c index 45a91318..4f2dc1d 100644 --- a/games/battlestar/com2.c +++ b/games/battlestar/com2.c @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)com2.c 8.1 (Berkeley) 5/31/93"; wearit() /* synonyms = {sheathe, sheath} */ { - register int n; + int n; int firstnumber, value; firstnumber = wordnumber; @@ -160,7 +160,7 @@ use() murder() { - register int n; + int n; for (n=0; !((n == SWORD || n == KNIFE || n == TWO_HANDED || n == MACE || n == CLEAVER || n == BROAD || n == CHAIN || n == SHOVEL || n == HALBERD) && testbit(inven,n)) && n < NUMOFOBJECTS; n++); if (n == NUMOFOBJECTS) diff --git a/games/battlestar/com3.c b/games/battlestar/com3.c index bd9dd74..e0184d2 100644 --- a/games/battlestar/com3.c +++ b/games/battlestar/com3.c @@ -65,7 +65,7 @@ dig() jump() { - register int n; + int n; switch(position){ default: @@ -167,7 +167,7 @@ bury() drink() { - register int n; + int n; if (testbit(inven,POTION)){ puts("The cool liquid runs down your throat but turns to fire and you choke."); @@ -188,7 +188,7 @@ drink() shoot() { int firstnumber, value; - register int n; + int n; firstnumber = wordnumber; if (!testbit(inven,LASER)) diff --git a/games/battlestar/com4.c b/games/battlestar/com4.c index 9af086b..ab610fd 100644 --- a/games/battlestar/com4.c +++ b/games/battlestar/com4.c @@ -44,7 +44,7 @@ take(from) unsigned int from[]; { int firstnumber, heavy, bulky, value; - register int n; + int n; firstnumber = wordnumber; if (wordnumber < wordcount && wordvalue[wordnumber+1] == OFF){ diff --git a/games/battlestar/com5.c b/games/battlestar/com5.c index d3b18fb..f3cb6a8 100644 --- a/games/battlestar/com5.c +++ b/games/battlestar/com5.c @@ -80,7 +80,7 @@ kiss() love() { - register int n; + int n; while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount); if (wordtype[wordnumber] == NOUNS && testbit(location[position].objects,wordvalue[wordnumber])){ @@ -126,7 +126,7 @@ love() zzz() { int oldtime; - register int n; + int n; oldtime = gtime; if ((snooze - gtime) < (0.75 * CYCLE)){ diff --git a/games/battlestar/cypher.c b/games/battlestar/cypher.c index af65af4..f15d816 100644 --- a/games/battlestar/cypher.c +++ b/games/battlestar/cypher.c @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)cypher.c 8.1 (Berkeley) 5/31/93"; cypher() { - register int n; + int n; int junk; int lflag = -1; char buffer[10]; diff --git a/games/battlestar/fly.c b/games/battlestar/fly.c index 9d229be..80f23b7 100644 --- a/games/battlestar/fly.c +++ b/games/battlestar/fly.c @@ -178,7 +178,7 @@ visual() screen() { - register int r,c,n; + int r,c,n; int i; clear(); @@ -194,7 +194,7 @@ screen() target() { - register int n; + int n; move(MIDR,MIDC-10); addstr("------- + -------"); @@ -206,7 +206,7 @@ target() notarget() { - register int n; + int n; move(MIDR,MIDC-10); addstr(" "); @@ -218,7 +218,7 @@ notarget() blast() { - register int n; + int n; alarm(0); move(LINES-1, 24); diff --git a/games/battlestar/getcom.c b/games/battlestar/getcom.c index 7d3a37e..f2772bf 100644 --- a/games/battlestar/getcom.c +++ b/games/battlestar/getcom.c @@ -69,8 +69,8 @@ getcom(buf, size, prompt, error) */ char * getword(buf1, buf2, flag) - register char *buf1, *buf2; - register flag; + char *buf1, *buf2; + int flag; { while (isspace(*buf1)) buf1++; diff --git a/games/battlestar/misc.c b/games/battlestar/misc.c index 1581671..45e9ec2 100644 --- a/games/battlestar/misc.c +++ b/games/battlestar/misc.c @@ -45,7 +45,7 @@ card(array, size) /* for beenthere, injuries */ int size; { const char *end = array + size; - register int i = 0; + int i = 0; while (array < end) if (*array++) @@ -57,7 +57,7 @@ int ucard(array) const unsigned int *array; { - register int j = 0, n; + int j = 0, n; for (n = 0; n < NUMOFOBJECTS; n++) if (testbit(array, n)) diff --git a/games/battlestar/parse.c b/games/battlestar/parse.c index 7eb72ee..abab858 100644 --- a/games/battlestar/parse.c +++ b/games/battlestar/parse.c @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 5/31/93"; wordinit() { - register struct wlist *w; + struct wlist *w; for (w = wlist; w->string; w++) install(w); @@ -51,7 +51,7 @@ int hash(s) const char *s; { - register hashval = 0; + int hashval = 0; while (*s) { hashval += *s++; @@ -65,7 +65,7 @@ struct wlist * lookup(s) const char *s; { - register struct wlist *wp; + struct wlist *wp; for (wp = hashtab[hash(s)]; wp != NULL; wp = wp->next) if (*s == *wp->string && strcmp(s, wp->string) == 0) @@ -74,7 +74,7 @@ lookup(s) } install(wp) - register struct wlist *wp; + struct wlist *wp; { int hashval; @@ -88,8 +88,8 @@ install(wp) parse() { - register struct wlist *wp; - register n; + struct wlist *wp; + int n; wordnumber = 0; /* for cypher */ for (n = 0; n <= wordcount; n++) { diff --git a/games/battlestar/room.c b/games/battlestar/room.c index 8992919..d78cc00 100644 --- a/games/battlestar/room.c +++ b/games/battlestar/room.c @@ -43,7 +43,7 @@ writedes() { int compass; const char *p; - register c; + int c; printf("\n\t%s\n", location[position].name); if (beenthere[position] < 3) { @@ -61,8 +61,8 @@ writedes() printobjs() { - register int *p = location[position].objects; - register n; + int *p = location[position].objects; + int n; printf("\n"); for (n = 0; n < NUMOFOBJECTS; n++) diff --git a/games/battlestar/save.c b/games/battlestar/save.c index c91070a0..627f821 100644 --- a/games/battlestar/save.c +++ b/games/battlestar/save.c @@ -50,9 +50,9 @@ restore() { char *home; char home1[MAXPATHLEN]; - register int n; + int n; int tmp; - register FILE *fp; + FILE *fp; if ( (home = getenv("HOME")) != NULL) sprintf(home1, "%.*s/Bstar", MAXPATHLEN - 7, home); @@ -108,7 +108,7 @@ save() struct stat sbuf; char *home; char home1[MAXPATHLEN]; - register int n; + int n; int tmp, fd; FILE *fp; diff --git a/games/bcd/bcd.c b/games/bcd/bcd.c index f3542b6..3e05953 100644 --- a/games/bcd/bcd.c +++ b/games/bcd/bcd.c @@ -149,11 +149,11 @@ main(argc, argv) #define COLUMNS 48 printcard(str) - register char *str; + char *str; { static char rowchars[] = " 123456789"; - register int i, row; - register char *p; + int i, row; + char *p; char *index(); /* ruthlessly remove newlines and truncate at 48 characters. */ diff --git a/games/bs/bs.c b/games/bs/bs.c index 216bc0c..7613306 100644 --- a/games/bs/bs.c +++ b/games/bs/bs.c @@ -306,8 +306,8 @@ static void randomplace(b, ss) int b; ship_t *ss; { - register int bwidth = BWIDTH - ss->length; - register int bdepth = BDEPTH - ss->length; + int bwidth = BWIDTH - ss->length; + int bdepth = BDEPTH - ss->length; do { ss->y = rnd(bdepth); @@ -702,7 +702,7 @@ static int awinna() } static ship_t *hitship(x, y) -/* register a hit on the targeted ship */ +/* a hit on the targeted ship */ int x, y; { ship_t *sb, *ss; @@ -1113,7 +1113,7 @@ static void do_options(c,op) int c; char *op[]; { - register int i; + int i; if (c > 1) { @@ -1167,8 +1167,8 @@ char *op[]; static int scount(who) int who; { - register int i, shots; - register ship_t *sp; + int i, shots; + ship_t *sp; if (who) sp = cpuship; /* count cpu shots */ @@ -1210,7 +1210,7 @@ char *argv[]; } else { - register int i; + int i; i = scount(turn); while (i--) diff --git a/games/caesar/caesar.c b/games/caesar/caesar.c index e04fc62..bc3af27 100644 --- a/games/caesar/caesar.c +++ b/games/caesar/caesar.c @@ -87,8 +87,8 @@ main(argc, argv) int argc; char **argv; { - register int ch, dot, i, nread, winnerdot = 0; - register char *inbuf; + int ch, dot, i, nread, winnerdot = 0; + char *inbuf; int obs[26], try, winner; /* revoke setgid privileges */ @@ -159,7 +159,7 @@ main(argc, argv) void printit(arg) char *arg; { - register int ch, rot; + int ch, rot; if ((rot = atoi(arg)) < 0) { (void)fprintf(stderr, "caesar: bad rotation value.\n"); diff --git a/games/canfield/canfield/canfield.c b/games/canfield/canfield/canfield.c index 8a95e5f..b8a938e 100644 --- a/games/canfield/canfield/canfield.c +++ b/games/canfield/canfield/canfield.c @@ -632,7 +632,7 @@ fndbase(cp, column, row) */ initgame() { - register i; + int i; for (i=0; i<18; i++) { deck[i]->visible = TRUE; @@ -677,7 +677,7 @@ initgame() */ startgame() { - register int j; + int j; shuffle(deck); initgame(); @@ -907,7 +907,7 @@ movetotalon() showstat() { int row, col; - register struct cardtype *ptr; + struct cardtype *ptr; if (!Cflag) return; @@ -1003,7 +1003,7 @@ usedstock() */ showcards() { - register struct cardtype *ptr; + struct cardtype *ptr; int row; if (!Cflag || cardsoff == 52) @@ -1053,7 +1053,7 @@ updatebettinginfo() long thiscosts, gamecosts, totalcosts; double thisreturn, gamereturn, totalreturn; time_t now; - register long dollars; + long dollars; time(&now); dollars = (now - acctstart) / secondsperdollar; @@ -1163,7 +1163,7 @@ tabprint(sour, des) * procedure to move from the tableau to the tableau */ tabtotab(sour, des) - register int sour, des; + int sour, des; { struct cardtype *temp; @@ -1536,7 +1536,7 @@ char *bettinginstructions[] = { */ instruct() { - register char **cp; + char **cp; move(originrow, origincol); printw("This is the game of solitaire called Canfield. Do\n"); diff --git a/games/canfield/cfscores/cfscores.c b/games/canfield/cfscores/cfscores.c index cc2d44b..1883696 100644 --- a/games/canfield/cfscores/cfscores.c +++ b/games/canfield/cfscores/cfscores.c @@ -66,7 +66,7 @@ main(argc, argv) int argc; char *argv[]; { - register struct passwd *pw; + struct passwd *pw; int uid; if (argc > 2) { @@ -108,7 +108,7 @@ main(argc, argv) * print out info for specified password entry */ printuser(pw, printfail) - register struct passwd *pw; + struct passwd *pw; int printfail; { struct betinfo total; diff --git a/games/cribbage/cards.c b/games/cribbage/cards.c index 93c5ebf..9b678d4 100644 --- a/games/cribbage/cards.c +++ b/games/cribbage/cards.c @@ -53,7 +53,7 @@ void makedeck(d) CARD d[]; { - register int i, j, k; + int i, j, k; srandomdev(); k = 0; @@ -72,7 +72,7 @@ void shuffle(d) CARD d[]; { - register int j, k; + int j, k; CARD c; for (j = CARDS; j > 0; --j) { @@ -101,7 +101,7 @@ isone(a, b, n) CARD a, b[]; int n; { - register int i; + int i; for (i = 0; i < n; i++) if (eq(a, b[i])) @@ -117,7 +117,7 @@ cremove(a, d, n) CARD a, d[]; int n; { - register int i, j; + int i, j; for (i = j = 0; i < n; i++) if (!eq(a, d[i])) @@ -132,10 +132,10 @@ cremove(a, d, n) */ void sorthand(h, n) - register CARD h[]; + CARD h[]; int n; { - register CARD *cp, *endp; + CARD *cp, *endp; CARD c; for (endp = &h[n]; h < endp - 1; h++) diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c index df8e2be..6206510 100644 --- a/games/cribbage/crib.c +++ b/games/cribbage/crib.c @@ -195,7 +195,7 @@ gamescore() void game() { - register int i, j; + int i, j; BOOLEAN flag; BOOLEAN compcrib; @@ -286,7 +286,7 @@ int playhand(mycrib) BOOLEAN mycrib; { - register int deckpos; + int deckpos; werase(Compwin); @@ -315,7 +315,7 @@ int deal(mycrib) BOOLEAN mycrib; { - register int i, j; + int i, j; for (i = j = 0; i < FULLHAND; i++) { if (mycrib) { @@ -338,7 +338,7 @@ void discard(mycrib) BOOLEAN mycrib; { - register char *prompt; + char *prompt; CARD crd; prcrib(mycrib, TRUE); @@ -369,7 +369,7 @@ cut(mycrib, pos) BOOLEAN mycrib; int pos; { - register int i; + int i; BOOLEAN win; win = FALSE; @@ -412,7 +412,7 @@ void prcrib(mycrib, blank) BOOLEAN mycrib, blank; { - register int y, cardx; + int y, cardx; if (mycrib) cardx = CRIB_X; @@ -443,10 +443,10 @@ peg(mycrib) BOOLEAN mycrib; { static CARD ch[CINHAND], ph[CINHAND]; - register int i, j, k; - register int l; - register int cnum, pnum, sum; - register BOOLEAN myturn, mego, ugo, last, played; + int i, j, k; + int l; + int cnum, pnum, sum; + BOOLEAN myturn, mego, ugo, last, played; CARD crd; cnum = pnum = CINHAND; diff --git a/games/cribbage/io.c b/games/cribbage/io.c index 32a2436..96b92db 100644 --- a/games/cribbage/io.c +++ b/games/cribbage/io.c @@ -169,7 +169,7 @@ prhand(h, n, win, blank) WINDOW *win; BOOLEAN blank; { - register int i; + int i; werase(win); for (i = 0; i < n; i++) @@ -188,7 +188,7 @@ infrom(hand, n, prompt) int n; char *prompt; { - register int i, j; + int i, j; CARD crd; if (n < 1) { @@ -242,7 +242,7 @@ int incard(crd) CARD *crd; { - register int i; + int i; int rnk, sut; char *line, *p, *p1; BOOLEAN retval; @@ -326,7 +326,7 @@ gotit: int getuchar() { - register int c; + int c; c = readchar(); if (islower(c)) @@ -345,8 +345,8 @@ number(lo, hi, prompt) int lo, hi; char *prompt; { - register char *p; - register int sum; + char *p; + int sum; for (sum = 0;;) { msg(prompt); @@ -441,8 +441,8 @@ void endmsg() { static int lastline = 0; - register int len; - register char *mp, *omp; + int len; + char *mp, *omp; /* All messages should start with uppercase */ mvaddch(lastline + Y_MSG_START, SCORE_X, ' '); @@ -510,9 +510,9 @@ do_wait() */ void wait_for(ch) - register int ch; + int ch; { - register char c; + char c; if (ch == '\n') while ((c = readchar()) != '\n') @@ -529,7 +529,7 @@ wait_for(ch) int readchar() { - register int cnt; + int cnt; char c; over: @@ -557,9 +557,9 @@ over: char * getline() { - register char *sp; - register int c, oy, ox; - register WINDOW *oscr; + char *sp; + int c, oy, ox; + WINDOW *oscr; oscr = stdscr; stdscr = Msgwin; @@ -572,7 +572,7 @@ getline() else if (c == erasechar()) { /* process erase character */ if (sp > linebuf) { - register int i; + int i; sp--; for (i = strlen(unctrl(*sp)); i; i--) diff --git a/games/cribbage/score.c b/games/cribbage/score.c index 7a5d1aa..d81ebce 100644 --- a/games/cribbage/score.c +++ b/games/cribbage/score.c @@ -105,15 +105,15 @@ static int pairpoints, runpoints; /* Globals from pairuns. */ */ int scorehand(hand, starter, n, crb, do_explain) - register CARD hand[]; + CARD hand[]; CARD starter; int n; BOOLEAN crb; /* true if scoring crib */ BOOLEAN do_explain; /* true if must explain this hand */ { - register int i, k; - register int score; - register BOOLEAN flag; + int i, k; + int score; + BOOLEAN flag; CARD h[(CINHAND + 1)]; char buf[32]; @@ -180,12 +180,12 @@ scorehand(hand, starter, n, crb, do_explain) */ int fifteens(hand, n) - register CARD hand[]; + CARD hand[]; int n; { - register int *sp, *np; - register int i; - register CARD *endp; + int *sp, *np; + int i; + CARD *endp; static int sums[15], nsums[15]; np = nsums; @@ -226,7 +226,7 @@ pairuns(h, n) CARD h[]; int n; { - register int i; + int i; int runlength, runmult, lastmult, curmult; int mult1, mult2, pair1, pair2; BOOLEAN run; @@ -296,7 +296,7 @@ pegscore(crd, tbl, n, sum) int n, sum; { BOOLEAN got[RANKS]; - register int i, j, scr; + int i, j, scr; int k, lo, hi; sum += VAL(crd.rank); diff --git a/games/cribbage/support.c b/games/cribbage/support.c index f4ee2a9..60d9f5b 100644 --- a/games/cribbage/support.c +++ b/games/cribbage/support.c @@ -58,7 +58,7 @@ cchose(h, n, s) CARD h[]; int n, s; { - register int i, j, l; + int i, j, l; if (n <= 1) return (0); @@ -128,8 +128,8 @@ plyrhand(hand, s) char *s; { static char prompt[BUFSIZ]; - register int i, j; - register BOOLEAN win; + int i, j; + BOOLEAN win; prhand(hand, CINHAND, Playwin, FALSE); (void) sprintf(prompt, "Your %s scores ", s); @@ -163,7 +163,7 @@ comphand(h, s) CARD h[]; char *s; { - register int j; + int j; j = scorehand(h, turnover, CINHAND, strcmp(s, "crib") == 0, FALSE); prhand(h, CINHAND, Compwin, FALSE); @@ -202,11 +202,11 @@ chkscr(scr, inc) */ void prpeg(score, peg, myturn) - register int score; + int score; int peg; BOOLEAN myturn; { - register int y, x; + int y, x; if (!myturn) y = SCORE_Y + 2; @@ -244,7 +244,7 @@ cdiscard(mycrib) BOOLEAN mycrib; { CARD d[CARDS], h[FULLHAND], cb[2]; - register int i, j, k; + int i, j, k; int nc, ns; long sums[15]; static int undo1[15] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4}; @@ -297,7 +297,7 @@ anymove(hand, n, sum) CARD hand[]; int n, sum; { - register int i, j; + int i, j; if (n < 1) return (FALSE); @@ -318,7 +318,7 @@ anysumto(hand, n, s, t) CARD hand[]; int n, s, t; { - register int i; + int i; for (i = 0; i < n; i++) { if (s + VAL(hand[i].rank) == t) @@ -335,7 +335,7 @@ numofval(h, n, v) CARD h[]; int n, v; { - register int i, j; + int i, j; j = 0; for (i = 0; i < n; i++) { @@ -353,7 +353,7 @@ makeknown(h, n) CARD h[]; int n; { - register int i; + int i; for (i = 0; i < n; i++) known[knownum++] = h[i]; diff --git a/games/dm/dm.c b/games/dm/dm.c index 0e63a73..d20de60 100644 --- a/games/dm/dm.c +++ b/games/dm/dm.c @@ -252,7 +252,7 @@ load() users() { - register int nusers, utmp; + int nusers, utmp; struct utmp buf; if ((utmp = open(_PATH_UTMP, O_RDONLY, 0)) < 0) { @@ -268,7 +268,7 @@ users() nogamefile() { - register int fd, n; + int fd, n; char buf[BUFSIZ]; if ((fd = open(_PATH_NOGAMES, O_RDONLY, 0)) >= 0) { diff --git a/games/fish/fish.c b/games/fish/fish.c index 2cea112..a447c0f 100644 --- a/games/fish/fish.c +++ b/games/fish/fish.c @@ -125,8 +125,8 @@ istart: for (;;) { usermove() { - register int n; - register char **p; + int n; + char **p; char buf[256]; (void)printf("\nYour hand is:"); @@ -196,7 +196,7 @@ compmove() promove() { - register int i, max; + int i, max; for (i = 0; i < RANKS; ++i) if (userasked[i] && @@ -295,9 +295,9 @@ goodmove(player, move, hand, opphand) chkwinner(player, hand) int player; - register int *hand; + int *hand; { - register int cb, i, ub; + int cb, i, ub; for (i = 0; i < RANKS; ++i) if (hand[i] > 0 && hand[i] < CARDS) @@ -338,7 +338,7 @@ printplayer(player) printhand(hand) int *hand; { - register int book, i, j; + int book, i, j; for (book = i = 0; i < RANKS; i++) if (hand[i] < CARDS) @@ -356,9 +356,9 @@ printhand(hand) } countcards(hand) - register int *hand; + int *hand; { - register int i, count; + int i, count; for (count = i = 0; i < RANKS; i++) count += *hand++; @@ -383,7 +383,7 @@ countbooks(hand) init() { - register int i, rank; + int i, rank; for (i = 0; i < RANKS; ++i) deck[i] = CARDS; diff --git a/games/fortune/fortune/fortune.c b/games/fortune/fortune/fortune.c index dae1d27..ea10c03 100644 --- a/games/fortune/fortune/fortune.c +++ b/games/fortune/fortune/fortune.c @@ -241,8 +241,8 @@ void display(fp) FILEDESC *fp; { - register char *p; - register unsigned char ch; + char *p; + unsigned char ch; char line[BUFSIZ]; open_fp(fp); @@ -274,7 +274,7 @@ FILEDESC *fp; int fortlen() { - register int nchar; + int nchar; char line[BUFSIZ]; if (!(Fortfile->tbl.str_flags & (STR_RANDOM | STR_ORDERED))) @@ -296,12 +296,12 @@ fortlen() */ void getargs(argc, argv) -register int argc; -register char **argv; +int argc; +char **argv; { - register int ignore_case; + int ignore_case; # ifndef NO_REGEX - register char *pat; + char *pat; # endif /* NO_REGEX */ extern char *optarg; extern int optind; @@ -400,11 +400,11 @@ register char **argv; */ int form_file_list(files, file_cnt) -register char **files; -register int file_cnt; +char **files; +int file_cnt; { - register int i, percent; - register char *sp; + int i, percent; + char *sp; if (file_cnt == 0) { if (Find_files) { @@ -465,16 +465,16 @@ register int file_cnt; int add_file(percent, file, dir, head, tail, parent) int percent; -register char *file; +char *file; char *dir; FILEDESC **head, **tail; FILEDESC *parent; { - register FILEDESC *fp; - register int fd; - register char *path, *offensive; - register bool was_malloc; - register bool isdir; + FILEDESC *fp; + int fd; + char *path, *offensive; + bool was_malloc; + bool isdir; if (dir == NULL) { path = file; @@ -595,7 +595,7 @@ over: FILEDESC * new_fp() { - register FILEDESC *fp; + FILEDESC *fp; fp = (FILEDESC *) do_malloc(sizeof *fp); fp->datfd = -1; @@ -648,12 +648,12 @@ char *file; */ void all_forts(fp, offensive) -register FILEDESC *fp; +FILEDESC *fp; char *offensive; { - register char *sp; - register FILEDESC *scene, *obscene; - register int fd; + char *sp; + FILEDESC *scene, *obscene; + int fd; auto char *datfile, *posfile; if (fp->child != NULL) /* this is a directory, not a file */ @@ -698,10 +698,10 @@ char *offensive; */ int add_dir(fp) -register FILEDESC *fp; +FILEDESC *fp; { - register DIR *dir; - register struct dirent *dirent; + DIR *dir; + struct dirent *dirent; auto FILEDESC *tailp; auto char *name; @@ -759,9 +759,9 @@ is_fortfile(file, datp, posp, check_for_offend) char *file, **datp, **posp; int check_for_offend; { - register int i; - register char *sp; - register char *datfile; + int i; + char *sp; + char *datfile; static char *suflist[] = { /* list of "illegal" suffixes" */ "dat", "pos", "c", "h", "p", "i", "f", "pas", "ftn", "ins.c", "ins,pas", @@ -886,8 +886,8 @@ void *ptr; void init_prob() { - register FILEDESC *fp, *last = NULL; - register int percent, num_noprob, frac; + FILEDESC *fp, *last = NULL; + int percent, num_noprob, frac; /* * Distribute the residual probability (if any) across all @@ -958,8 +958,8 @@ init_prob() void get_fort() { - register FILEDESC *fp; - register int choice; + FILEDESC *fp; + int choice; if (File_list->next == NULL || File_list->percent == NO_PROB) fp = File_list; @@ -1022,8 +1022,8 @@ FILEDESC * pick_child(parent) FILEDESC *parent; { - register FILEDESC *fp; - register int choice; + FILEDESC *fp; + int choice; if (Equal_probs) { choice = random() % parent->num_children; @@ -1057,7 +1057,7 @@ FILEDESC *parent; */ void sum_noprobs(fp) -register FILEDESC *fp; +FILEDESC *fp; { static bool did_noprobs = FALSE; @@ -1074,7 +1074,7 @@ register FILEDESC *fp; int max(i, j) -register int i, j; +int i, j; { return (i >= j ? i : j); } @@ -1148,7 +1148,7 @@ get_tbl(fp) FILEDESC *fp; { auto int fd; - register FILEDESC *child; + FILEDESC *child; if (fp->read_tbl) return; @@ -1185,7 +1185,7 @@ FILEDESC *fp; */ void zero_tbl(tp) -register STRFILE *tp; +STRFILE *tp; { tp->str_numstr = 0; tp->str_longlen = 0; @@ -1198,7 +1198,7 @@ register STRFILE *tp; */ void sum_tbl(t1, t2) -register STRFILE *t1, *t2; +STRFILE *t1, *t2; { t1->str_numstr += t2->str_numstr; if (t1->str_longlen < t2->str_longlen) @@ -1225,7 +1225,7 @@ print_file_list() */ void print_list(list, lev) -register FILEDESC *list; +FILEDESC *list; int lev; { while (list != NULL) { @@ -1251,11 +1251,11 @@ int lev; */ char * conv_pat(orig) -register char *orig; +char *orig; { - register char *sp; - register unsigned int cnt; - register char *new; + char *sp; + unsigned int cnt; + char *new; cnt = 1; /* allow for '\0' */ for (sp = orig; *sp != '\0'; sp++) @@ -1314,8 +1314,8 @@ int maxlen_in_list(list) FILEDESC *list; { - register FILEDESC *fp; - register int len, maxlen; + FILEDESC *fp; + int len, maxlen; maxlen = 0; for (fp = list; fp != NULL; fp = fp->next) { @@ -1340,8 +1340,8 @@ void matches_in_list(list) FILEDESC *list; { - register char *sp, *p; - register FILEDESC *fp; + char *sp, *p; + FILEDESC *fp; int in_file; unsigned char ch; diff --git a/games/fortune/strfile/strfile.c b/games/fortune/strfile/strfile.c index cf1babd..28a0e25 100644 --- a/games/fortune/strfile/strfile.c +++ b/games/fortune/strfile/strfile.c @@ -147,12 +147,12 @@ int main(ac, av) int ac; char **av; { - register char *sp, dc; - register FILE *inf, *outf; - register long last_off, length, pos, *p; - register int first, cnt; - register char *nsp; - register STR *fp; + char *sp, dc; + FILE *inf, *outf; + long last_off, length, pos, *p; + int first, cnt; + char *nsp; + STR *fp; static char string[257]; (void) setlocale(LC_ALL, ""); @@ -349,9 +349,9 @@ long off; */ void do_order() { - register int i; - register long *lp; - register STR *fp; + int i; + long *lp; + STR *fp; Sort_1 = fopen(Infile, "r"); Sort_2 = fopen(Infile, "r"); @@ -390,8 +390,8 @@ static int collate_range_cmp (c1, c2) int cmp_str(p1, p2) STR *p1, *p2; { - register int c1, c2; - register int n1, n2; + int c1, c2; + int n1, n2; int r; # define SET_N(nf,ch) (nf = (ch == '\n')) @@ -441,9 +441,9 @@ STR *p1, *p2; */ void randomize() { - register int cnt, i; - register long tmp; - register long *sp; + int cnt, i; + long tmp; + long *sp; srandomdev(); diff --git a/games/fortune/unstr/unstr.c b/games/fortune/unstr/unstr.c index 3cca1a0..9bd2298 100644 --- a/games/fortune/unstr/unstr.c +++ b/games/fortune/unstr/unstr.c @@ -112,7 +112,7 @@ char **av; } void getargs(av) -register char *av[]; +char *av[]; { if (!*++av) { (void) fprintf(stderr, "usage: unstr datafile\n"); @@ -124,10 +124,10 @@ register char *av[]; } void order_unstr(tbl) -register STRFILE *tbl; +STRFILE *tbl; { - register int i; - register char *sp; + int i; + char *sp; long pos; char buf[BUFSIZ]; diff --git a/games/hack/alloc.c b/games/hack/alloc.c index 30a6a96..9451265 100644 --- a/games/hack/alloc.c +++ b/games/hack/alloc.c @@ -24,9 +24,9 @@ long dummy = ftell(stderr); long * alloc(lth) -register unsigned lth; +unsigned lth; { - register char *ptr; + char *ptr; if(!(ptr = malloc(lth))) panic("Cannot get %d bytes", lth); @@ -35,10 +35,10 @@ register unsigned lth; long * enlarge(ptr,lth) -register char *ptr; -register unsigned lth; +char *ptr; +unsigned lth; { - register char *nptr; + char *nptr; if(!(nptr = realloc(ptr,lth))) panic("Cannot reallocate %d bytes", lth); diff --git a/games/hack/hack.apply.c b/games/hack/hack.apply.c index 2a29e79..12fb470 100644 --- a/games/hack/hack.apply.c +++ b/games/hack/hack.apply.c @@ -17,8 +17,8 @@ static void use_camera(), use_ice_box(), use_whistle(), use_magic_whistle(); static int use_pick_axe(); doapply() { - register struct obj *obj; - register int res = 1; + struct obj *obj; + int res = 1; obj = getobj("(", "use or apply"); if(!obj) return(0); @@ -65,8 +65,8 @@ doapply() { /* ARGSUSED */ static void -use_camera(obj) /* register */ struct obj *obj; { -register struct monst *mtmp; +use_camera(obj) /* */ struct obj *obj; { +struct monst *mtmp; if(!getdir(1)){ /* ask: in what direction? */ flags.move = multi = 0; return; @@ -87,8 +87,8 @@ register struct monst *mtmp; } else if(mtmp->data->mlet != 'y') if(mtmp->mcansee || mtmp->mblinded){ - register int tmp = dist(mtmp->mx,mtmp->my); - register int tmp2; + int tmp = dist(mtmp->mx,mtmp->my); + int tmp2; if(cansee(mtmp->mx,mtmp->my)) pline("%s is blinded by the flash!", Monnam(mtmp)); setmangry(mtmp); @@ -112,7 +112,7 @@ static struct obj *current_ice_box; /* a local variable of use_ice_box, to be used by its local procedures in/ck_ice_box */ static -in_ice_box(obj) register struct obj *obj; { +in_ice_box(obj) struct obj *obj; { if(obj == current_ice_box || (Punished && (obj == uball || obj == uchain))){ pline("You must be kidding."); @@ -143,13 +143,13 @@ in_ice_box(obj) register struct obj *obj; { } static -ck_ice_box(obj) register struct obj *obj; { +ck_ice_box(obj) struct obj *obj; { return(obj->o_cnt_id == current_ice_box->o_id); } static -out_ice_box(obj) register struct obj *obj; { -register struct obj *otmp; +out_ice_box(obj) struct obj *obj; { +struct obj *otmp; if(obj == fcobj) fcobj = fcobj->nobj; else { for(otmp = fcobj; otmp->nobj != obj; otmp = otmp->nobj) @@ -162,9 +162,9 @@ register struct obj *otmp; } static void -use_ice_box(obj) register struct obj *obj; { -register int cnt = 0; -register struct obj *otmp; +use_ice_box(obj) struct obj *obj; { +int cnt = 0; +struct obj *otmp; current_ice_box = obj; /* for use by in/out_ice_box */ for(otmp = fcobj; otmp; otmp = otmp->nobj) if(otmp->o_cnt_id == obj->o_id) @@ -186,9 +186,9 @@ register struct obj *otmp; static struct monst * -bchit(ddx,ddy,range,sym) register int ddx,ddy,range; char sym; { - register struct monst *mtmp = (struct monst *) 0; - register int bchx = u.ux, bchy = u.uy; +bchit(ddx,ddy,range,sym) int ddx,ddy,range; char sym; { + struct monst *mtmp = (struct monst *) 0; + int bchx = u.ux, bchy = u.uy; if(sym) Tmp_at(-1, sym); /* open call */ while(range--) { @@ -210,7 +210,7 @@ bchit(ddx,ddy,range,sym) register int ddx,ddy,range; char sym; { /* ARGSUSED */ static void use_whistle(obj) struct obj *obj; { -register struct monst *mtmp = fmon; +struct monst *mtmp = fmon; pline("You produce a high whistling sound."); while(mtmp) { if(dist(mtmp->mx,mtmp->my) < u.ulevel*20) { @@ -226,7 +226,7 @@ register struct monst *mtmp = fmon; /* ARGSUSED */ static void use_magic_whistle(obj) struct obj *obj; { -register struct monst *mtmp = fmon; +struct monst *mtmp = fmon; pline("You produce a strange whistling sound."); while(mtmp) { if(mtmp->mtame) mnexto(mtmp); @@ -241,8 +241,8 @@ static boolean dig_down; static dig() { - register struct rm *lev; - register dpx = dig_pos.x, dpy = dig_pos.y; + struct rm *lev; + dpx = dig_pos.x, dpy = dig_pos.y; /* perhaps a nymph stole his pick-axe while he was busy digging */ /* or perhaps he teleported away */ @@ -263,7 +263,7 @@ dig() { return(0); /* done with digging */ } if(dig_effort > 50) { - register struct trap *ttmp = t_at(dpx,dpy); + struct trap *ttmp = t_at(dpx,dpy); if(!ttmp) { ttmp = maketrap(dpx,dpy,PIT); @@ -276,8 +276,8 @@ dig() { } } else if(dig_effort > 100) { - register char *digtxt; - register struct obj *obj; + char *digtxt; + struct obj *obj; lev = &levl[dpx][dpy]; if(obj = sobj_at(ENORMOUS_ROCK, dpx, dpy)) { @@ -298,7 +298,7 @@ dig() { return(0); } else { if(IS_WALL(levl[dpx][dpy].typ)) { - register int rno = inroom(dpx,dpy); + int rno = inroom(dpx,dpy); if(rno >= 0 && rooms[rno].rtype >= 8) { pline("This wall seems too hard to dig into."); @@ -317,7 +317,7 @@ holetime() { dighole() { - register struct trap *ttmp = t_at(u.ux, u.uy); + struct trap *ttmp = t_at(u.ux, u.uy); if(!xdnstair) { pline("The floor here seems too hard to dig in."); @@ -347,10 +347,10 @@ struct obj *obj; { char dirsyms[12]; extern char sdir[]; - register char *dsp = dirsyms, *sdp = sdir; - register struct monst *mtmp; - register struct rm *lev; - register int rx, ry, res = 0; + char *dsp = dirsyms, *sdp = sdir; + struct monst *mtmp; + struct rm *lev; + int rx, ry, res = 0; if(obj != uwep) { if(uwep && uwep->cursed) { diff --git a/games/hack/hack.bones.c b/games/hack/hack.bones.c index 69eb2a8..960e44b 100644 --- a/games/hack/hack.bones.c +++ b/games/hack/hack.bones.c @@ -12,10 +12,10 @@ char bones[] = "bones_xx"; /* save bones and possessions of a deceased adventurer */ savebones(){ -register fd; -register struct obj *otmp; -register struct trap *ttmp; -register struct monst *mtmp; +fd; +struct obj *otmp; +struct trap *ttmp; +struct monst *mtmp; if(dlevel <= 0 || dlevel > MAXLEVEL) return; if(!rn2(1 + dlevel/2)) return; /* not so many ghosts on low levels */ bones[6] = '0' + (dlevel/10); @@ -74,7 +74,7 @@ register struct monst *mtmp; } getbones(){ -register fd,x,y,ok; +fd,x,y,ok; if(rn2(3)) return(0); /* only once in three times do we find bones */ bones[6] = '0' + dlevel/10; bones[7] = '0' + dlevel%10; diff --git a/games/hack/hack.c b/games/hack/hack.c index 6863b60..8cb99bd 100644 --- a/games/hack/hack.c +++ b/games/hack/hack.c @@ -17,8 +17,8 @@ extern boolean hmon(); 3. when walking out of a lit room */ unsee() { - register x,y; - register struct rm *lev; + x,y; + struct rm *lev; /* if(u.udispl){ @@ -53,8 +53,8 @@ unsee() { */ seeoff(mode) /* 1 to redo @, 0 to leave them */ { /* 1 means misc movement, 0 means blindness */ - register x,y; - register struct rm *lev; + x,y; + struct rm *lev; if(u.udispl && mode){ u.udispl = 0; @@ -79,10 +79,10 @@ seeoff(mode) /* 1 to redo @, 0 to leave them */ domove() { xchar oldx,oldy; - register struct monst *mtmp; - register struct rm *tmpr,*ust; + struct monst *mtmp; + struct rm *tmpr,*ust; struct trap *trap; - register struct obj *otmp; + struct obj *otmp; u_wipe_engr(rnd(5)); @@ -156,8 +156,8 @@ domove() return; } while(otmp = sobj_at(ENORMOUS_ROCK, u.ux+u.dx, u.uy+u.dy)) { - register xchar rx = u.ux+2*u.dx, ry = u.uy+2*u.dy; - register struct trap *ttmp; + xchar rx = u.ux+2*u.dx, ry = u.uy+2*u.dy; + struct trap *ttmp; nomul(0); if(isok(rx,ry) && !IS_ROCK(levl[rx][ry].typ) && (levl[rx][ry].typ != DOOR || !(u.dx && u.dy)) && @@ -308,8 +308,8 @@ domove() } movobj(obj, ox, oy) -register struct obj *obj; -register int ox, oy; +struct obj *obj; +int ox, oy; { /* Some dirty programming to get display right */ freeobj(obj); @@ -335,9 +335,9 @@ dopickup(){ pickup(all) { - register struct gold *gold; - register struct obj *obj, *obj2; - register int wt; + struct gold *gold; + struct obj *obj, *obj2; + int wt; if(Levitation) return; while(gold = g_at(u.ux,u.uy)) { @@ -351,7 +351,7 @@ pickup(all) /* check for more than one object */ if(!all) { - register int ct = 0; + int ct = 0; for(obj = fobj; obj; obj = obj->nobj) if(obj->ox == u.ux && obj->oy == u.uy) @@ -466,9 +466,9 @@ pickup(all) /* turn around a corner if that is the only way we can proceed */ /* do not turn left or right twice */ lookaround(){ -register x,y,i,x0,y0,m0,i0 = 9; -register int corrct = 0, noturn = 0; -register struct monst *mtmp; +x,y,i,x0,y0,m0,i0 = 9; +int corrct = 0, noturn = 0; +struct monst *mtmp; #ifdef lint /* suppress "used before set" message */ x0 = y0 = 0; @@ -561,8 +561,8 @@ register struct monst *mtmp; /* something like lookaround, but we are not running */ /* react only to monsters that might hit us */ monster_nearby() { -register int x,y; -register struct monst *mtmp; +int x,y; +struct monst *mtmp; if(!Blind) for(x = u.ux-1; x <= u.ux+1; x++) for(y = u.uy-1; y <= u.uy+1; y++){ if(x == u.ux && y == u.uy) continue; @@ -577,7 +577,7 @@ register struct monst *mtmp; #ifdef QUEST cansee(x,y) xchar x,y; { -register int dx,dy,adx,ady,sdx,sdy,dmax,d; +int dx,dy,adx,ady,sdx,sdy,dmax,d; if(Blind) return(0); if(!isok(x,y)) return(0); d = dist(x,y); @@ -610,7 +610,7 @@ register int dx,dy,adx,ady,sdx,sdy,dmax,d; } } -rroom(x,y) register int x,y; { +rroom(x,y) int x,y; { return(IS_ROOM(levl[u.ux+x][u.uy+y].typ)); } @@ -625,14 +625,14 @@ cansee(x,y) xchar x,y; { } #endif QUEST -sgn(a) register int a; { +sgn(a) int a; { return((a > 0) ? 1 : (a == 0) ? 0 : -1); } #ifdef QUEST setsee() { - register x,y; + x,y; if(Blind) { pru(); @@ -649,7 +649,7 @@ setsee() setsee() { - register x,y; + x,y; if(Blind) { pru(); @@ -681,7 +681,7 @@ setsee() #endif QUEST nomul(nval) -register nval; +nval; { if(multi < 0) return; multi = nval; @@ -712,7 +712,7 @@ dbon() } losestr(num) /* may kill you; cause may be poison or monster like 'A' */ -register num; +num; { u.ustr -= num; while(u.ustr < 3) { @@ -724,8 +724,8 @@ register num; } losehp(n,knam) -register n; -register char *knam; +n; +char *knam; { u.uhp -= n; if(u.uhp > u.uhpmax) @@ -738,8 +738,8 @@ register char *knam; } losehp_m(n,mtmp) -register n; -register struct monst *mtmp; +n; +struct monst *mtmp; { u.uhp -= n; flags.botl = 1; @@ -749,7 +749,7 @@ register struct monst *mtmp; losexp() /* hit by V or W */ { - register num; + num; extern long newuexp(); if(u.ulevel > 1) @@ -764,9 +764,9 @@ losexp() /* hit by V or W */ } inv_weight(){ -register struct obj *otmp = invent; -register int wt = (u.ugold + 500)/1000; -register int carrcap; +struct obj *otmp = invent; +int wt = (u.ugold + 500)/1000; +int carrcap; if(Levitation) /* pugh@cornell */ carrcap = MAX_CARR_CAP; else { @@ -783,8 +783,8 @@ register int carrcap; } inv_cnt(){ -register struct obj *otmp = invent; -register int ct = 0; +struct obj *otmp = invent; +int ct = 0; while(otmp){ ct++; otmp = otmp->nobj; diff --git a/games/hack/hack.cmd.c b/games/hack/hack.cmd.c index 5eedbf5..ba2f428 100644 --- a/games/hack/hack.cmd.c +++ b/games/hack/hack.cmd.c @@ -91,11 +91,11 @@ struct ext_func_tab extcmdlist[] = { extern char *parse(), lowc(), unctrl(), quitchars[]; rhack(cmd) -register char *cmd; +char *cmd; { - register struct func_tab *tlist = cmdlist; + struct func_tab *tlist = cmdlist; boolean firsttime = FALSE; - register res; + res; if(!cmd) { firsttime = TRUE; @@ -170,7 +170,7 @@ register char *cmd; tlist++; } { char expcmd[10]; - register char *cp = expcmd; + char *cp = expcmd; while(*cmd && cp-expcmd < sizeof(expcmd)-2) { if(*cmd >= 040 && *cmd < 0177) *cp++ = *cmd++; @@ -188,7 +188,7 @@ register char *cmd; doextcmd() /* here after # - now read a full-word command */ { char buf[BUFSZ]; - register struct ext_func_tab *efp = extcmdlist; + struct ext_func_tab *efp = extcmdlist; pline("# "); getlin(buf); @@ -227,7 +227,7 @@ schar zdir[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 1,-1 }; movecmd(sym) /* also sets u.dz, but returns false for <> */ char sym; { - register char *dp; + char *dp; u.dz = 0; if(!(dp = index(sdir, sym))) return(0); @@ -256,14 +256,14 @@ boolean s; confdir() { - register x = rn2(8); + x = rn2(8); u.dx = xdir[x]; u.dy = ydir[x]; } #ifdef QUEST finddir(){ -register int i, ui = u.di; +int i, ui = u.di; for(i = 0; i <= 8; i++){ if(flags.run & 1) ui++; else ui += 7; ui %= 8; @@ -291,13 +291,13 @@ register int i, ui = u.di; u.dy = ydir[ui]; } -isroom(x,y) register x,y; { /* what about POOL? */ +isroom(x,y) x,y; { /* what about POOL? */ return(isok(x,y) && (levl[x][y].typ == ROOM || (levl[x][y].typ >= LDOOR && flags.run >= 6))); } #endif QUEST -isok(x,y) register x,y; { +isok(x,y) x,y; { /* x corresponds to curx, so x==1 is the first column. Ach. %% */ return(x >= 1 && x <= COLNO-1 && y >= 0 && y <= ROWNO-1); } diff --git a/games/hack/hack.do.c b/games/hack/hack.do.c index b8dd66f..8e7a52f 100644 --- a/games/hack/hack.do.c +++ b/games/hack/hack.do.c @@ -20,10 +20,10 @@ dodrop() { } static int -drop(obj) register struct obj *obj; { +drop(obj) struct obj *obj; { if(!obj) return(0); if(obj->olet == '$') { /* pseudo object */ - register long amount = OGOLD(obj); + long amount = OGOLD(obj); if(amount == 0) pline("You didn't drop any gold pieces."); @@ -54,14 +54,14 @@ drop(obj) register struct obj *obj; { /* Called in several places - should not produce texts */ dropx(obj) -register struct obj *obj; +struct obj *obj; { freeinv(obj); dropy(obj); } dropy(obj) -register struct obj *obj; +struct obj *obj; { if(obj->otyp == CRYSKNIFE) obj->otyp = WORM_TOOTH; @@ -118,11 +118,11 @@ doup() } goto_level(newlevel, at_stairs) -register int newlevel; -register boolean at_stairs; +int newlevel; +boolean at_stairs; { - register fd; - register boolean up = (newlevel < dlevel); + fd; + boolean up = (newlevel < dlevel); if(newlevel <= 0) done("escaped"); /* in fact < 0 is impossible */ if(newlevel > MAXLEVEL) newlevel = MAXLEVEL; /* strange ... */ @@ -204,7 +204,7 @@ register boolean at_stairs; selftouch("Falling, you"); } } - { register struct monst *mtmp = m_at(u.ux, u.uy); + { struct monst *mtmp = m_at(u.ux, u.uy); if(mtmp) mnexto(mtmp); } @@ -227,7 +227,7 @@ register boolean at_stairs; initrack(); losedogs(); - { register struct monst *mtmp; + { struct monst *mtmp; if(mtmp = m_at(u.ux, u.uy)) mnexto(mtmp); /* riv05!a3 */ } flags.nscrinh = 0; @@ -251,9 +251,9 @@ dopray() { struct monst *bhit(), *boomhit(); dothrow() { - register struct obj *obj; - register struct monst *mon; - register tmp; + struct obj *obj; + struct monst *mon; + tmp; obj = getobj("#)", "throw"); /* it is also possible to throw food */ /* (or jewels, or iron balls ... ) */ @@ -415,7 +415,7 @@ dothrow() if(u.utraptype == TT_PIT) pline("The ball pulls you out of the pit!"); else { - register long side = + long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE; pline("The ball pulls you out of the bear trap."); pline("Your %s leg is severely damaged.", @@ -440,8 +440,8 @@ dothrow() /* split obj so that it gets size num */ /* remainder is put in the object structure delivered by this call */ struct obj * -splitobj(obj, num) register struct obj *obj; register int num; { -register struct obj *otmp; +splitobj(obj, num) struct obj *obj; int num; { +struct obj *otmp; otmp = newobj(0); *otmp = *obj; /* copies whole structure */ otmp->o_id = flags.ident++; @@ -456,7 +456,7 @@ register struct obj *otmp; } more_experienced(exp,rexp) -register int exp, rexp; +int exp, rexp; { extern char pl_character[]; @@ -468,8 +468,8 @@ register int exp, rexp; } set_wounded_legs(side, timex) -register long side; -register int timex; +long side; +int timex; { if(!Wounded_legs || (Wounded_legs & TIMEOUT)) Wounded_legs |= side + timex; diff --git a/games/hack/hack.do_name.c b/games/hack/hack.do_name.c index 538bd7f..ab33c42 100644 --- a/games/hack/hack.do_name.c +++ b/games/hack/hack.do_name.c @@ -8,7 +8,7 @@ extern char plname[]; coord getpos(force,goal) int force; char *goal; { -register cx,cy,i,c; +cx,cy,i,c; extern char sdir[]; /* defined in hack.c */ extern schar xdir[], ydir[]; /* idem */ extern char *visctrl(); /* see below */ @@ -48,8 +48,8 @@ coord cc; do_mname(){ char buf[BUFSZ]; coord cc; -register int cx,cy,lth,i; -register struct monst *mtmp, *mtmp2; +int cx,cy,lth,i; +struct monst *mtmp, *mtmp2; extern char *lmonnam(); cc = getpos(0, "the monster you want to name"); cx = cc.x; @@ -97,9 +97,9 @@ extern char *lmonnam(); * when there might be pointers around in unknown places. For now: only * when obj is in the inventory. */ -do_oname(obj) register struct obj *obj; { -register struct obj *otmp, *otmp2; -register lth; +do_oname(obj) struct obj *obj; { +struct obj *otmp, *otmp2; +lth; char buf[BUFSZ]; pline("What do you want to name %s? ", doname(obj)); getlin(buf); @@ -136,7 +136,7 @@ char buf[BUFSZ]; ddocall() { - register struct obj *obj; + struct obj *obj; pline("Do you want to name an individual object? [ny] "); switch(readchar()) { @@ -154,13 +154,13 @@ ddocall() } docall(obj) -register struct obj *obj; +struct obj *obj; { char buf[BUFSZ]; struct obj otemp; - register char **str1; + char **str1; extern char *xname(); - register char *str; + char *str; otemp = *obj; otemp.quan = 1; @@ -186,7 +186,7 @@ char *ghostnames[] = { /* these names should have length < PL_NSIZ */ }; char * -xmonnam(mtmp, vb) register struct monst *mtmp; int vb; { +xmonnam(mtmp, vb) struct monst *mtmp; int vb; { static char buf[BUFSZ]; /* %% */ extern char *shkname(); if(mtmp->mnamelth && !vb) { @@ -195,7 +195,7 @@ extern char *shkname(); } switch(mtmp->data->mlet) { case ' ': - { register char *gn = (char *) mtmp->mextra; + { char *gn = (char *) mtmp->mextra; if(!*gn) { /* might also look in scorefile */ gn = ghostnames[rn2(SIZE(ghostnames))]; if(!rn2(2)) (void) @@ -223,28 +223,28 @@ extern char *shkname(); } char * -lmonnam(mtmp) register struct monst *mtmp; { +lmonnam(mtmp) struct monst *mtmp; { return(xmonnam(mtmp, 1)); } char * -monnam(mtmp) register struct monst *mtmp; { +monnam(mtmp) struct monst *mtmp; { return(xmonnam(mtmp, 0)); } char * -Monnam(mtmp) register struct monst *mtmp; { -register char *bp = monnam(mtmp); +Monnam(mtmp) struct monst *mtmp; { +char *bp = monnam(mtmp); if('a' <= *bp && *bp <= 'z') *bp += ('A' - 'a'); return(bp); } char * amonnam(mtmp,adj) -register struct monst *mtmp; -register char *adj; +struct monst *mtmp; +char *adj; { - register char *bp = monnam(mtmp); + char *bp = monnam(mtmp); static char buf[BUFSZ]; /* %% */ if(!strncmp(bp, "the ", 4)) bp += 4; @@ -254,18 +254,18 @@ register char *adj; char * Amonnam(mtmp, adj) -register struct monst *mtmp; -register char *adj; +struct monst *mtmp; +char *adj; { - register char *bp = amonnam(mtmp,adj); + char *bp = amonnam(mtmp,adj); *bp = 'T'; return(bp); } char * -Xmonnam(mtmp) register struct monst *mtmp; { -register char *bp = Monnam(mtmp); +Xmonnam(mtmp) struct monst *mtmp; { +char *bp = Monnam(mtmp); if(!strncmp(bp, "The ", 4)) { bp += 2; *bp = 'A'; diff --git a/games/hack/hack.do_wear.c b/games/hack/hack.do_wear.c index 14f74e4..46e7013 100644 --- a/games/hack/hack.do_wear.c +++ b/games/hack/hack.do_wear.c @@ -8,12 +8,12 @@ extern char *nomovemsg; extern char quitchars[]; extern char *Doname(); -off_msg(otmp) register struct obj *otmp; { +off_msg(otmp) struct obj *otmp; { pline("You were wearing %s.", doname(otmp)); } doremarm() { - register struct obj *otmp; + struct obj *otmp; if(!uarm && !uarmh && !uarms && !uarmg) { pline("Not wearing any armor."); return(0); @@ -69,14 +69,14 @@ doremring() { #endif lint } -dorr(otmp) register struct obj *otmp; { +dorr(otmp) struct obj *otmp; { if(cursed(otmp)) return(0); ringoff(otmp); off_msg(otmp); return(1); } -cursed(otmp) register struct obj *otmp; { +cursed(otmp) struct obj *otmp; { if(otmp->cursed){ pline("You can't. It appears to be cursed."); return(1); @@ -84,8 +84,8 @@ cursed(otmp) register struct obj *otmp; { return(0); } -armoroff(otmp) register struct obj *otmp; { -register int delay = -objects[otmp->otyp].oc_delay; +armoroff(otmp) struct obj *otmp; { +int delay = -objects[otmp->otyp].oc_delay; if(cursed(otmp)) return(0); setworn((struct obj *) 0, otmp->owornmask & W_ARMOR); if(delay) { @@ -107,9 +107,9 @@ register int delay = -objects[otmp->otyp].oc_delay; } doweararm() { - register struct obj *otmp; - register int delay; - register int err = 0; + struct obj *otmp; + int delay; + int err = 0; long mask = 0; otmp = getobj("[", "wear"); @@ -166,7 +166,7 @@ doweararm() { } dowearring() { - register struct obj *otmp; + struct obj *otmp; long mask = 0; long oldprop; @@ -235,9 +235,9 @@ dowearring() { } ringoff(obj) -register struct obj *obj; +struct obj *obj; { -register long mask; +long mask; mask = obj->owornmask & W_RING; setworn((struct obj *) 0, obj->owornmask); if(!(u.uprops[PROP(obj->otyp)].p_flgs & mask)) @@ -271,7 +271,7 @@ register long mask; } find_ac(){ -register int uac = 10; +int uac = 10; if(uarm) uac -= ARM_BONUS(uarm); if(uarm2) uac -= ARM_BONUS(uarm2); if(uarmh) uac -= ARM_BONUS(uarmh); @@ -286,7 +286,7 @@ register int uac = 10; } glibr(){ -register struct obj *otmp; +struct obj *otmp; int xfl = 0; if(!uarmg) if(uleft || uright) { /* Note: at present also cursed rings fall off */ @@ -313,7 +313,7 @@ int xfl = 0; struct obj * some_armor(){ -register struct obj *otmph = uarm; +struct obj *otmph = uarm; if(uarmh && (!otmph || !rn2(4))) otmph = uarmh; if(uarmg && (!otmph || !rn2(4))) otmph = uarmg; if(uarms && (!otmph || !rn2(4))) otmph = uarms; @@ -321,7 +321,7 @@ register struct obj *otmph = uarm; } corrode_armor(){ -register struct obj *otmph = some_armor(); +struct obj *otmph = some_armor(); if(otmph){ if(otmph->rustfree || otmph->otyp == ELVEN_CLOAK || diff --git a/games/hack/hack.dog.c b/games/hack/hack.dog.c index c47a353..9e518e1 100644 --- a/games/hack/hack.dog.c +++ b/games/hack/hack.dog.c @@ -17,12 +17,12 @@ struct permonst la_dog = makedog(){ -register struct monst *mtmp = makemon(&li_dog,u.ux,u.uy); +struct monst *mtmp = makemon(&li_dog,u.ux,u.uy); if(!mtmp) return; /* dogs were genocided */ initedog(mtmp); } -initedog(mtmp) register struct monst *mtmp; { +initedog(mtmp) struct monst *mtmp; { mtmp->mtame = mtmp->mpeaceful = 1; EDOG(mtmp)->hungrytime = 1000 + moves; EDOG(mtmp)->eattime = 0; @@ -38,7 +38,7 @@ struct monst *fallen_down = 0; /* monsters that fell through a trapdoor */ /* they will appear on the next level @ goes to, even if he goes up! */ losedogs(){ -register struct monst *mtmp; +struct monst *mtmp; while(mtmp = mydogs){ mydogs = mtmp->nmon; mtmp->nmon = fmon; @@ -54,7 +54,7 @@ register struct monst *mtmp; } keepdogs(){ -register struct monst *mtmp; +struct monst *mtmp; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) if(dist(mtmp->mx,mtmp->my) < 3 && follower(mtmp) && !mtmp->msleep && !mtmp->mfroz) { @@ -67,7 +67,7 @@ register struct monst *mtmp; } } -fall_down(mtmp) register struct monst *mtmp; { +fall_down(mtmp) struct monst *mtmp; { relmon(mtmp); mtmp->nmon = fallen_down; fallen_down = mtmp; @@ -83,7 +83,7 @@ fall_down(mtmp) register struct monst *mtmp; { #define APPORT 4 #define POISON 5 #define UNDEF 6 -dogfood(obj) register struct obj *obj; { +dogfood(obj) struct obj *obj; { switch(obj->olet) { case FOOD_SYM: return( @@ -105,12 +105,12 @@ dogfood(obj) register struct obj *obj; { } /* return 0 (no move), 1 (move) or 2 (dead) */ -dog_move(mtmp, after) register struct monst *mtmp; { -register int nx,ny,omx,omy,appr,nearer,j; +dog_move(mtmp, after) struct monst *mtmp; { +int nx,ny,omx,omy,appr,nearer,j; int udist,chi,i,whappr; -register struct monst *mtmp2; -register struct permonst *mdat = mtmp->data; -register struct edog *edog = EDOG(mtmp); +struct monst *mtmp2; +struct permonst *mdat = mtmp->data; +struct edog *edog = EDOG(mtmp); struct obj *obj; struct trap *trap; xchar cnt,chcnt,nix,niy; @@ -255,7 +255,7 @@ int info[9]; if(gx == u.ux && gy == u.uy && (dogroom != uroom || dogroom < 0)){ extern coord *gettrack(); - register coord *cp; + coord *cp; cp = gettrack(omx,omy); if(cp){ gx = cp->x; @@ -367,7 +367,7 @@ newdogpos: /* return roomnumber or -1 */ inroom(x,y) xchar x,y; { #ifndef QUEST - register struct mkroom *croom = &rooms[0]; + struct mkroom *croom = &rooms[0]; while(croom->hx >= 0){ if(croom->hx >= x-1 && croom->lx <= x+1 && croom->hy >= y-1 && croom->ly <= y+1) @@ -379,10 +379,10 @@ inroom(x,y) xchar x,y; { } tamedog(mtmp, obj) -register struct monst *mtmp; -register struct obj *obj; +struct monst *mtmp; +struct obj *obj; { - register struct monst *mtmp2; + struct monst *mtmp2; if(flags.moonphase == FULL_MOON && night() && rn2(6)) return(0); diff --git a/games/hack/hack.eat.c b/games/hack/hack.eat.c index 9c0a64c..a490be8 100644 --- a/games/hack/hack.eat.c +++ b/games/hack/hack.eat.c @@ -50,7 +50,7 @@ static struct { } tin; opentin(){ - register int r; + int r; if(!carried(tin.tin)) /* perhaps it was stolen? */ return(0); /* %% probably we should use tinoid */ @@ -88,9 +88,9 @@ Meatdone(){ } doeat(){ - register struct obj *otmp; - register struct objclass *ftmp; - register tmp; + struct obj *otmp; + struct objclass *ftmp; + tmp; /* Is there some food (probably a heavy corpse) here on the ground? */ if(!Levitation) @@ -139,7 +139,7 @@ gotit: if(Glib) { pline("The tin slips out of your hands."); if(otmp->quan > 1) { - register struct obj *obj; + struct obj *obj; extern struct obj *splitobj(); obj = splitobj(otmp, 1); @@ -277,13 +277,13 @@ gethungry(){ } /* called after vomiting and after performing feats of magic */ -morehungry(num) register num; { +morehungry(num) num; { u.uhunger -= num; newuhs(TRUE); } /* called after eating something (and after drinking fruit juice) */ -lesshungry(num) register num; { +lesshungry(num) num; { u.uhunger += num; newuhs(FALSE); } @@ -294,7 +294,7 @@ unfaint(){ } newuhs(incr) boolean incr; { - register int newhs, h = u.uhunger; + int newhs, h = u.uhunger; newhs = (h > 1000) ? SATIATED : (h > 150) ? NOT_HUNGRY : @@ -354,15 +354,15 @@ newuhs(incr) boolean incr; { ? 'a' + (otyp - DEAD_ACID_BLOB)\ : '@' + (otyp - DEAD_HUMAN)) poisonous(otmp) -register struct obj *otmp; +struct obj *otmp; { return(index(POISONOUS, CORPSE_I_TO_C(otmp->otyp)) != 0); } /* returns 1 if some text was printed */ -eatcorpse(otmp) register struct obj *otmp; { -register char let = CORPSE_I_TO_C(otmp->otyp); -register tp = 0; +eatcorpse(otmp) struct obj *otmp; { +char let = CORPSE_I_TO_C(otmp->otyp); +tp = 0; if(let != 'a' && moves > otmp->age + 50 + rn2(100)) { tp++; pline("Ulch -- that meat was tainted!"); diff --git a/games/hack/hack.end.c b/games/hack/hack.end.c index c089b44..a49d758 100644 --- a/games/hack/hack.end.c +++ b/games/hack/hack.end.c @@ -44,7 +44,7 @@ done_hangup(){ done_intr(); } -done_in_by(mtmp) register struct monst *mtmp; { +done_in_by(mtmp) struct monst *mtmp; { static char buf[BUFSZ]; pline("You die ..."); if(mtmp->data->mlet == ' '){ @@ -65,7 +65,7 @@ static char buf[BUFSZ]; "burned", "starved" or "tricked" */ /* Be careful not to call panic from here! */ done(st1) -register char *st1; +char *st1; { #ifdef WIZARD @@ -120,10 +120,10 @@ register char *st1; } if(*st1 == 'e') { extern struct monst *mydogs; - register struct monst *mtmp; - register struct obj *otmp; - register int i; - register unsigned worthlessct = 0; + struct monst *mtmp; + struct obj *otmp; + int i; + unsigned worthlessct = 0; boolean has_amulet = FALSE; killer = st1; @@ -219,12 +219,12 @@ topten(){ int uid = getuid(); int rank, rank0 = -1, rank1 = 0; int occ_cnt = PERSMAX; - register struct toptenentry *t0, *t1, *tprev; + struct toptenentry *t0, *t1, *tprev; char *recfile = RECORD; char *reclock = "record_lock"; int sleepct = 300; FILE *rfile; - register flg = 0; + flg = 0; extern char *getdate(); #define HUP if(!done_hup) while(link(recfile, reclock) == -1) { @@ -374,7 +374,7 @@ unlock: outheader() { char linebuf[BUFSZ]; -register char *bp; +char *bp; (void) strcpy(linebuf, "Number Points Name"); bp = eos(linebuf); while(bp < linebuf + COLNO - 9) *bp++ = ' '; @@ -384,7 +384,7 @@ register char *bp; /* so>0: standout line; so=0: ordinary line; so<0: no output, return lth */ int -outentry(rank,t1,so) register struct toptenentry *t1; { +outentry(rank,t1,so) struct toptenentry *t1; { boolean quit = FALSE, killed = FALSE, starv = FALSE; char linebuf[BUFSZ]; linebuf[0] = 0; @@ -426,7 +426,7 @@ char linebuf[BUFSZ]; t1->death); Sprintf(eos(linebuf), "."); if(t1->maxhp) { - register char *bp = eos(linebuf); + char *bp = eos(linebuf); char hpbuf[10]; int hppos; Sprintf(hpbuf, (t1->hp > 0) ? itoa(t1->hp) : "-"); @@ -439,7 +439,7 @@ char linebuf[BUFSZ]; } if(so == 0) puts(linebuf); else if(so > 0) { - register char *bp = eos(linebuf); + char *bp = eos(linebuf); if(so >= COLNO) so = COLNO-1; while(bp < linebuf + so) *bp++ = ' '; *bp = 0; @@ -460,13 +460,13 @@ static char buf[12]; char * ordin(n) int n; { -register int d = n%10; +int d = n%10; return((d==0 || d>3 || n/10==1) ? "th" : (d==1) ? "st" : (d==2) ? "nd" : "rd"); } clearlocks(){ -register x; +x; (void) signal(SIGHUP,SIG_IGN); for(x = maxdlevel; x >= 0; x--) { glo(x); @@ -485,14 +485,14 @@ hangup() char * eos(s) -register char *s; +char *s; { while(*s) s++; return(s); } /* it is the callers responsibility to check that there is room for c */ -charcat(s,c) register char *s, c; { +charcat(s,c) char *s, c; { while(*s) s++; *s++ = c; *s = 0; @@ -508,11 +508,11 @@ prscore(argc,argv) int argc; char **argv; { char **players; int playerct; int rank; - register struct toptenentry *t1, *t2; + struct toptenentry *t1, *t2; char *recfile = RECORD; FILE *rfile; - register flg = 0; - register int i; + flg = 0; + int i; #ifdef nonsense long total_score = 0L; char totchars[10]; diff --git a/games/hack/hack.engrave.c b/games/hack/hack.engrave.c index d3bf27f..bc9ed84 100644 --- a/games/hack/hack.engrave.c +++ b/games/hack/hack.engrave.c @@ -20,8 +20,8 @@ struct engr { } *head_engr; struct engr * -engr_at(x,y) register xchar x,y; { -register struct engr *ep = head_engr; +engr_at(x,y) xchar x,y; { +struct engr *ep = head_engr; while(ep) { if(x == ep->engr_x && y == ep->engr_y) return(ep); @@ -30,10 +30,10 @@ register struct engr *ep = head_engr; return((struct engr *) 0); } -sengr_at(s,x,y) register char *s; register xchar x,y; { -register struct engr *ep = engr_at(x,y); -register char *t; -register int n; +sengr_at(s,x,y) char *s; xchar x,y; { +struct engr *ep = engr_at(x,y); +char *t; +int n; if(ep && ep->engr_time <= moves) { t = ep->engr_txt; /* @@ -49,15 +49,15 @@ register int n; } u_wipe_engr(cnt) -register int cnt; +int cnt; { if(!u.uswallow && !Levitation) wipe_engr_at(u.ux, u.uy, cnt); } -wipe_engr_at(x,y,cnt) register xchar x,y,cnt; { -register struct engr *ep = engr_at(x,y); -register int lth,pos; +wipe_engr_at(x,y,cnt) xchar x,y,cnt; { +struct engr *ep = engr_at(x,y); +int lth,pos; char ch; if(ep){ if((ep->engr_type != DUST) || Levitation) { @@ -80,8 +80,8 @@ char ch; } } -read_engr_at(x,y) register int x,y; { -register struct engr *ep = engr_at(x,y); +read_engr_at(x,y) int x,y; { +struct engr *ep = engr_at(x,y); if(ep && ep->engr_txt[0]) { switch(ep->engr_type) { case DUST: @@ -101,10 +101,10 @@ register struct engr *ep = engr_at(x,y); } make_engr_at(x,y,s) -register int x,y; -register char *s; +int x,y; +char *s; { - register struct engr *ep; + struct engr *ep; if(ep = engr_at(x,y)) del_engr(ep); @@ -122,13 +122,13 @@ register char *s; } doengrave(){ -register int len; -register char *sp; -register struct engr *ep, *oep = engr_at(u.ux,u.uy); +int len; +char *sp; +struct engr *ep, *oep = engr_at(u.ux,u.uy); char buf[BUFSZ]; xchar type; int spct; /* number of leading spaces */ -register struct obj *otmp; +struct obj *otmp; multi = 0; if(u.uswallow) { @@ -259,7 +259,7 @@ register struct obj *otmp; } save_engravings(fd) int fd; { -register struct engr *ep = head_engr; +struct engr *ep = head_engr; while(ep) { if(!ep->engr_lth || !ep->engr_txt[0]){ ep = ep->nxt_engr; @@ -274,7 +274,7 @@ register struct engr *ep = head_engr; } rest_engravings(fd) int fd; { -register struct engr *ep; +struct engr *ep; unsigned lth; head_engr = 0; while(1) { @@ -288,8 +288,8 @@ unsigned lth; } } -del_engr(ep) register struct engr *ep; { -register struct engr *ept; +del_engr(ep) struct engr *ep; { +struct engr *ept; if(ep == head_engr) head_engr = ep->nxt_engr; else { diff --git a/games/hack/hack.fight.c b/games/hack/hack.fight.c index f8e2ea9..2a39474 100644 --- a/games/hack/hack.fight.c +++ b/games/hack/hack.fight.c @@ -11,8 +11,8 @@ static boolean far_noise; static long noisetime; /* hitmm returns 0 (miss), 1 (hit), or 2 (kill) */ -hitmm(magr,mdef) register struct monst *magr,*mdef; { -register struct permonst *pa = magr->data, *pd = mdef->data; +hitmm(magr,mdef) struct monst *magr,*mdef; { +struct permonst *pa = magr->data, *pd = mdef->data; int hit; schar tmp; boolean vis; @@ -68,8 +68,8 @@ boolean vis; } /* drop (perhaps) a cadaver and remove monster */ -mondied(mdef) register struct monst *mdef; { -register struct permonst *pd = mdef->data; +mondied(mdef) struct monst *mdef; { +struct permonst *pd = mdef->data; if(letter(pd->mlet) && rn2(3)){ (void) mkobj_at(pd->mlet,mdef->mx,mdef->my); if(cansee(mdef->mx,mdef->my)){ @@ -82,7 +82,7 @@ register struct permonst *pd = mdef->data; } /* drop a rock and remove monster */ -monstone(mdef) register struct monst *mdef; { +monstone(mdef) struct monst *mdef; { extern char mlarge[]; if(index(mlarge, mdef->data->mlet)) mksobj_at(ENORMOUS_ROCK, mdef->mx, mdef->my); @@ -96,8 +96,8 @@ monstone(mdef) register struct monst *mdef; { } -fightm(mtmp) register struct monst *mtmp; { -register struct monst *mon; +fightm(mtmp) struct monst *mtmp; { +struct monst *mon; for(mon = fmon; mon; mon = mon->nmon) if(mon != mtmp) { if(DIST(mon->mx,mon->my,mtmp->mx,mtmp->my) < 3) if(rn2(4)) @@ -108,8 +108,8 @@ register struct monst *mon; /* u is hit by sth, but not a monster */ thitu(tlev,dam,name) -register tlev,dam; -register char *name; +tlev,dam; +char *name; { char buf[BUFSZ]; setan(name,buf); @@ -129,11 +129,11 @@ char mlarge[] = "bCDdegIlmnoPSsTUwY',&"; boolean hmon(mon,obj,thrown) /* return TRUE if mon still alive */ -register struct monst *mon; -register struct obj *obj; -register thrown; +struct monst *mon; +struct obj *obj; +thrown; { - register tmp; + tmp; boolean hittxt = FALSE; if(!obj){ @@ -249,11 +249,11 @@ register thrown; /* try to attack; return FALSE if monster evaded */ /* u.dx and u.dy must be set */ attack(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { schar tmp; boolean malive = TRUE; - register struct permonst *mdat; + struct permonst *mdat; mdat = mtmp->data; u_wipe_engr(3); /* andrew@orca: prevent unlimited pick-axe attacks */ @@ -283,7 +283,7 @@ register struct monst *mtmp; wakeup(mtmp); if(mtmp->mhide && mtmp->mundetected){ - register struct obj *obj; + struct obj *obj; mtmp->mundetected = 0; if((obj = o_at(mtmp->mx,mtmp->my)) && !Blind) diff --git a/games/hack/hack.invent.c b/games/hack/hack.invent.c index d5af843..819bcff 100644 --- a/games/hack/hack.invent.c +++ b/games/hack/hack.invent.c @@ -20,11 +20,11 @@ extern struct wseg *wsegs[32]; static int lastinvnr = 51; /* 0 ... 51 */ static assigninvlet(otmp) -register struct obj *otmp; +struct obj *otmp; { boolean inuse[52]; - register int i; - register struct obj *obj; + int i; + struct obj *obj; for(i = 0; i < 52; i++) inuse[i] = FALSE; for(obj = invent; obj; obj = obj->nobj) if(obj != otmp) { @@ -47,9 +47,9 @@ register struct obj *otmp; struct obj * addinv(obj) -register struct obj *obj; +struct obj *obj; { - register struct obj *otmp; + struct obj *otmp; /* merge or attach to end of chain */ if(!invent) { @@ -94,7 +94,7 @@ register struct obj *obj; } useup(obj) -register struct obj *obj; +struct obj *obj; { if(obj->quan > 1){ obj->quan--; @@ -107,9 +107,9 @@ register struct obj *obj; } freeinv(obj) -register struct obj *obj; +struct obj *obj; { - register struct obj *otmp; + struct obj *otmp; if(obj == invent) invent = invent->nobj; @@ -121,15 +121,15 @@ register struct obj *obj; } /* destroy object in fobj chain (if unpaid, it remains on the bill) */ -delobj(obj) register struct obj *obj; { +delobj(obj) struct obj *obj; { freeobj(obj); unpobj(obj); obfree(obj, (struct obj *) 0); } /* unlink obj from chain starting with fobj */ -freeobj(obj) register struct obj *obj; { - register struct obj *otmp; +freeobj(obj) struct obj *obj; { + struct obj *otmp; if(obj == fobj) fobj = fobj->nobj; else { @@ -140,8 +140,8 @@ freeobj(obj) register struct obj *obj; { } /* Note: freegold throws away its argument! */ -freegold(gold) register struct gold *gold; { - register struct gold *gtmp; +freegold(gold) struct gold *gold; { + struct gold *gtmp; if(gold == fgold) fgold = gold->ngold; else { @@ -153,9 +153,9 @@ freegold(gold) register struct gold *gold; { } deltrap(trap) -register struct trap *trap; +struct trap *trap; { - register struct trap *ttmp; + struct trap *ttmp; if(trap == ftrap) ftrap = ftrap->ntrap; @@ -170,11 +170,11 @@ struct wseg *m_atseg; struct monst * m_at(x,y) -register x,y; +x,y; { - register struct monst *mtmp; + struct monst *mtmp; #ifndef NOWORM - register struct wseg *wtmp; + struct wseg *wtmp; #endif NOWORM m_atseg = 0; @@ -196,9 +196,9 @@ register x,y; struct obj * o_at(x,y) -register x,y; +x,y; { - register struct obj *otmp; + struct obj *otmp; for(otmp = fobj; otmp; otmp = otmp->nobj) if(otmp->ox == x && otmp->oy == y) return(otmp); @@ -207,9 +207,9 @@ register x,y; struct obj * sobj_at(n,x,y) -register n,x,y; +n,x,y; { - register struct obj *otmp; + struct obj *otmp; for(otmp = fobj; otmp; otmp = otmp->nobj) if(otmp->ox == x && otmp->oy == y && otmp->otyp == n) @@ -217,17 +217,17 @@ register n,x,y; return(0); } -carried(obj) register struct obj *obj; { -register struct obj *otmp; +carried(obj) struct obj *obj; { +struct obj *otmp; for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp == obj) return(1); return(0); } carrying(type) -register int type; +int type; { - register struct obj *otmp; + struct obj *otmp; for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp->otyp == type) @@ -236,7 +236,7 @@ register int type; } struct obj * -o_on(id, objchn) unsigned int id; register struct obj *objchn; { +o_on(id, objchn) unsigned int id; struct obj *objchn; { while(objchn) { if(objchn->o_id == id) return(objchn); objchn = objchn->nobj; @@ -246,9 +246,9 @@ o_on(id, objchn) unsigned int id; register struct obj *objchn; { struct trap * t_at(x,y) -register x,y; +x,y; { - register struct trap *trap = ftrap; + struct trap *trap = ftrap; while(trap) { if(trap->tx == x && trap->ty == y) return(trap); trap = trap->ntrap; @@ -258,9 +258,9 @@ register x,y; struct gold * g_at(x,y) -register x,y; +x,y; { - register struct gold *gold = fgold; + struct gold *gold = fgold; while(gold) { if(gold->gx == x && gold->gy == y) return(gold); gold = gold->ngold; @@ -271,9 +271,9 @@ register x,y; /* make dummy object structure containing gold - for temporary use only */ struct obj * mkgoldobj(q) -register long q; +long q; { - register struct obj *otmp; + struct obj *otmp; otmp = newobj(0); /* should set o_id etc. but otmp will be freed soon */ @@ -292,14 +292,14 @@ register long q; */ struct obj * getobj(let,word) -register char *let,*word; +char *let,*word; { - register struct obj *otmp; - register char ilet,ilet1,ilet2; + struct obj *otmp; + char ilet,ilet1,ilet2; char buf[BUFSZ]; char lets[BUFSZ]; - register int foo = 0, foo2; - register char *bp = buf; + int foo = 0, foo2; + char *bp = buf; xchar allowcnt = 0; /* 0, 1 or 2 */ boolean allowgold = FALSE; boolean allowall = FALSE; @@ -429,7 +429,7 @@ register char *let,*word; if(allowcnt == 2) { /* cnt given */ if(cnt == 0) return(0); if(cnt != otmp->quan) { - register struct obj *obj; + struct obj *obj; obj = splitobj(otmp, (int) cnt); if(otmp == uwep) setuwep(obj); } @@ -437,7 +437,7 @@ register char *let,*word; return(otmp); } -ckunpaid(otmp) register struct obj *otmp; { +ckunpaid(otmp) struct obj *otmp; { return( otmp->unpaid ); } @@ -448,10 +448,10 @@ char *word; int (*fn)(), max; { char buf[BUFSZ]; -register char *ip; -register char sym; -register int oletct = 0, iletct = 0; -register boolean allflag = FALSE; +char *ip; +char sym; +int oletct = 0, iletct = 0; +boolean allflag = FALSE; char olets[20], ilets[20]; int (*ckfn)() = (int (*)()) 0; xchar allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0; /* BAH */ @@ -459,8 +459,8 @@ xchar allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0; /* BAH */ pline("You have nothing to %s.", word); return(0); } else { - register struct obj *otmp = invent; - register int uflg = 0; + struct obj *otmp = invent; + int uflg = 0; if(allowgold) ilets[iletct++] = '$'; ilets[iletct] = 0; @@ -520,14 +520,14 @@ xchar allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0; /* BAH */ */ askchain(objchn, olets, allflag, fn, ckfn, max) struct obj *objchn; -register char *olets; +char *olets; int allflag; int (*fn)(), (*ckfn)(); int max; { -register struct obj *otmp, *otmp2; -register char sym, ilet; -register int cnt = 0; +struct obj *otmp, *otmp2; +char sym, ilet; +int cnt = 0; ilet = 'a'-1; for(otmp = objchn; otmp; otmp = otmp2){ if(ilet == 'z') ilet = 'A'; else ilet++; @@ -560,10 +560,10 @@ ret: } obj_to_let(obj) /* should of course only be called for things in invent */ -register struct obj *obj; +struct obj *obj; { - register struct obj *otmp; - register char ilet; + struct obj *otmp; + char ilet; if(flags.invlet_constant) return(obj->invlet); @@ -574,15 +574,15 @@ register struct obj *obj; } prinv(obj) -register struct obj *obj; +struct obj *obj; { pline(xprname(obj, obj_to_let(obj))); } static char * xprname(obj,let) -register struct obj *obj; -register char let; +struct obj *obj; +char let; { static char li[BUFSZ]; @@ -601,10 +601,10 @@ ddoinv() /* called with 0 or "": all objects in inventory */ /* otherwise: all objects with (serial) letter in lets */ doinv(lets) -register char *lets; +char *lets; { - register struct obj *otmp; - register char ilet; + struct obj *otmp; + char ilet; int ct = 0; char any[BUFSZ]; @@ -634,8 +634,8 @@ dotypeinv () /* free after Robert Viduya */ { char c, ilet; char stuff[BUFSZ]; - register int stct; - register struct obj *otmp; + int stct; + struct obj *otmp; boolean billx = inshop() && doinvbill(0); boolean unpd = FALSE; @@ -702,8 +702,8 @@ dotypeinv () /* free after Robert Viduya */ /* look at what is here */ dolook() { - register struct obj *otmp, *otmp0; - register struct gold *gold; + struct obj *otmp, *otmp0; + struct gold *gold; char *verb = Blind ? "feel" : "see"; int ct = 0; @@ -758,8 +758,8 @@ dolook() { return(!!Blind); } -stackobj(obj) register struct obj *obj; { -register struct obj *otmp = fobj; +stackobj(obj) struct obj *obj; { +struct obj *otmp = fobj; for(otmp = fobj; otmp; otmp = otmp->nobj) if(otmp != obj) if(otmp->ox == obj->ox && otmp->oy == obj->oy && merged(obj,otmp,1)) @@ -767,7 +767,7 @@ register struct obj *otmp = fobj; } /* merge obj with otmp and delete obj if types agree */ -merged(otmp,obj,lose) register struct obj *otmp, *obj; { +merged(otmp,obj,lose) struct obj *otmp, *obj; { if(obj->otyp == otmp->otyp && obj->unpaid == otmp->unpaid && obj->spe == otmp->spe && @@ -831,7 +831,7 @@ doprarm(){ pline("You are not wearing any armor."); else { char lets[6]; - register int ct = 0; + int ct = 0; if(uarm) lets[ct++] = obj_to_let(uarm); if(uarm2) lets[ct++] = obj_to_let(uarm2); @@ -849,7 +849,7 @@ doprring(){ pline("You are not wearing any rings."); else { char lets[3]; - register int ct = 0; + int ct = 0; if(uleft) lets[ct++] = obj_to_let(uleft); if(uright) lets[ct++] = obj_to_let(uright); diff --git a/games/hack/hack.lev.c b/games/hack/hack.lev.c index 82afd61..4047e45 100644 --- a/games/hack/hack.lev.c +++ b/games/hack/hack.lev.c @@ -27,8 +27,8 @@ int fd; xchar lev; { #ifndef NOWORM - register struct wseg *wtmp, *wtmp2; - register tmp; + struct wseg *wtmp, *wtmp2; + tmp; #endif NOWORM if(fd < 0) panic("Save on bad file!"); /* impossible */ @@ -72,9 +72,9 @@ xchar lev; } bwrite(fd,loc,num) -register fd; -register char *loc; -register unsigned num; +fd; +char *loc; +unsigned num; { /* lint wants the 3rd arg of write to be an int; lint -p an unsigned */ if(write(fd, loc, (int) num) != num) @@ -82,10 +82,10 @@ register unsigned num; } saveobjchn(fd,otmp) -register fd; -register struct obj *otmp; +fd; +struct obj *otmp; { - register struct obj *otmp2; + struct obj *otmp2; unsigned xl; int minusone = -1; @@ -101,10 +101,10 @@ register struct obj *otmp; } savemonchn(fd,mtmp) -register fd; -register struct monst *mtmp; +fd; +struct monst *mtmp; { - register struct monst *mtmp2; + struct monst *mtmp2; unsigned xl; int minusone = -1; struct permonst *monbegin = &mons[0]; @@ -124,10 +124,10 @@ register struct monst *mtmp; } savegoldchn(fd,gold) -register fd; -register struct gold *gold; +fd; +struct gold *gold; { - register struct gold *gold2; + struct gold *gold2; while(gold) { gold2 = gold->ngold; bwrite(fd, (char *) gold, sizeof(struct gold)); @@ -138,10 +138,10 @@ register struct gold *gold; } savetrapchn(fd,trap) -register fd; -register struct trap *trap; +fd; +struct trap *trap; { - register struct trap *trap2; + struct trap *trap2; while(trap) { trap2 = trap->ntrap; bwrite(fd, (char *) trap, sizeof(struct trap)); @@ -155,12 +155,12 @@ getlev(fd,pid,lev) int fd,pid; xchar lev; { - register struct gold *gold; - register struct trap *trap; + struct gold *gold; + struct trap *trap; #ifndef NOWORM - register struct wseg *wtmp; + struct wseg *wtmp; #endif NOWORM - register tmp; + tmp; long omoves; int hpid; xchar dlvl; @@ -188,7 +188,7 @@ xchar lev; /* regenerate animals while on another level */ { long tmoves = (moves > omoves) ? moves-omoves : 0; - register struct monst *mtmp, *mtmp2; + struct monst *mtmp, *mtmp2; extern char genocided[]; for(mtmp = fmon; mtmp; mtmp = mtmp2) { @@ -256,11 +256,11 @@ xchar lev; } mread(fd, buf, len) -register fd; -register char *buf; -register unsigned len; +fd; +char *buf; +unsigned len; { - register int rlen; + int rlen; extern boolean restoring; rlen = read(fd, buf, (int) len); diff --git a/games/hack/hack.main.c b/games/hack/hack.main.c index af3080f..0d07c6e 100644 --- a/games/hack/hack.main.c +++ b/games/hack/hack.main.c @@ -45,9 +45,9 @@ main(argc,argv) int argc; char *argv[]; { - register int fd; + int fd; #ifdef CHDIR - register char *dir; + char *dir; #endif hname = argv[0]; @@ -89,7 +89,7 @@ char *argv[]; * Note that we trust him here; it is possible to play under * somebody else's name. */ - { register char *s; + { char *s; initoptions(); if(!*plname && (s = getenv("USER"))) @@ -214,7 +214,7 @@ char *argv[]; getlock(); /* sets lock if locknum != 0 */ #ifdef WIZARD } else { - register char *sfoo; + char *sfoo; (void) strcpy(lock,plname); if(sfoo = getenv("MAGIC")) while(*sfoo) { @@ -225,8 +225,8 @@ char *argv[]; } if(sfoo = getenv("GENOCIDED")){ if(*sfoo == '!'){ - register struct permonst *pm = mons; - register char *gp = genocided; + struct permonst *pm = mons; + char *gp = genocided; while(pm < mons+CMNUM+2){ if(!index(sfoo, pm->mlet)) @@ -270,7 +270,7 @@ not_recovered: setsee(); flags.botlx = 1; makedog(); - { register struct monst *mtmp; + { struct monst *mtmp; if(mtmp = m_at(u.ux, u.uy)) mnexto(mtmp); /* riv05!a3 */ } seemons(); @@ -405,10 +405,10 @@ not_recovered: } glo(foo) -register foo; +foo; { /* construct the string xlock.n */ - register char *tf; + char *tf; tf = lock; while(*tf && *tf != '.') tf++; @@ -421,7 +421,7 @@ register foo; * It may still contain a suffix denoting pl_character. */ askname(){ -register int c,ct; +int c,ct; printf("\nWho are you? "); (void) fflush(stdout); ct = 0; @@ -442,7 +442,7 @@ register int c,ct; /*VARARGS1*/ impossible(s,x1,x2) -register char *s; +char *s; { pline(s,x1,x2); pline("Program in disorder - perhaps you'd better Quit."); @@ -480,7 +480,7 @@ boolean wr; /* perhaps we should also test whether . is writable */ /* unfortunately the access systemcall is worthless */ if(wr) { - register fd; + fd; if(dir == NULL) dir = "."; diff --git a/games/hack/hack.makemon.c b/games/hack/hack.makemon.c index 7ad6385..cce2183 100644 --- a/games/hack/hack.makemon.c +++ b/games/hack/hack.makemon.c @@ -18,10 +18,10 @@ struct monst zeromonst; */ struct monst * makemon(ptr,x,y) -register struct permonst *ptr; +struct permonst *ptr; { - register struct monst *mtmp; - register tmp, ct; + struct monst *mtmp; + tmp, ct; boolean anything = (!ptr); extern boolean in_mklev; @@ -94,7 +94,7 @@ gotmon: if(anything) if(ptr->mlet == 'O' || ptr->mlet == 'k') { coord enexto(); coord mm; - register int cnt = rnd(10); + int cnt = rnd(10); mm.x = x; mm.y = y; while(cnt--) { @@ -108,9 +108,9 @@ gotmon: coord enexto(xx,yy) -register xchar xx,yy; +xchar xx,yy; { - register xchar x,y; + xchar x,y; coord foo[15], *tfoo; int range; @@ -160,8 +160,8 @@ goodpos(x,y) /* used only in mnexto and rloc */ rloc(mtmp) struct monst *mtmp; { - register tx,ty; - register char ch = mtmp->data->mlet; + tx,ty; + char ch = mtmp->data->mlet; #ifndef NOWORM if(ch == 'w' && mtmp->mx) return; /* do not relocate worms */ @@ -185,10 +185,10 @@ struct monst *mtmp; struct monst * mkmon_at(let,x,y) char let; -register int x,y; +int x,y; { - register int ct; - register struct permonst *ptr; + int ct; + struct permonst *ptr; for(ct = 0; ct < CMNUM; ct++) { ptr = &mons[ct]; diff --git a/games/hack/hack.mhitu.c b/games/hack/hack.mhitu.c index f41e00e..4d71229 100644 --- a/games/hack/hack.mhitu.c +++ b/games/hack/hack.mhitu.c @@ -10,10 +10,10 @@ extern struct monst *makemon(); * returns 1 if monster dies (e.g. 'y', 'F'), 0 otherwise */ mhitu(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { - register struct permonst *mdat = mtmp->data; - register int tmp, ctmp; + struct permonst *mdat = mtmp->data; + int tmp, ctmp; nomul(0); @@ -294,7 +294,7 @@ register struct monst *mtmp; (void) hitu(mtmp,rnd(5)); break; case 'x': - { register long side = rn2(2) ? RIGHT_SIDE : LEFT_SIDE; + { long side = rn2(2) ? RIGHT_SIDE : LEFT_SIDE; pline("%s pricks in your %s leg!", Monnam(mtmp), (side == RIGHT_SIDE) ? "right" : "left"); set_wounded_legs(side, rnd(50)); @@ -319,10 +319,10 @@ register struct monst *mtmp; } hitu(mtmp,dam) -register struct monst *mtmp; -register dam; +struct monst *mtmp; +dam; { - register tmp, res; + tmp, res; nomul(0); if(u.uswallow) return(0); @@ -330,7 +330,7 @@ register dam; if(mtmp->mhide && mtmp->mundetected) { mtmp->mundetected = 0; if(!Blind) { - register struct obj *obj; + struct obj *obj; extern char * Xmonnam(); if(obj = o_at(mtmp->mx,mtmp->my)) pline("%s was hidden under %s!", diff --git a/games/hack/hack.mklev.c b/games/hack/hack.mklev.c index cad724f..760c401 100644 --- a/games/hack/hack.mklev.c +++ b/games/hack/hack.mklev.c @@ -39,9 +39,9 @@ int rscnt,rsmax; /* 0..rscnt-1: currently under consideration */ makelevel() { - register struct mkroom *croom, *troom; - register unsigned tryct; - register x,y; + struct mkroom *croom, *troom; + unsigned tryct; + x,y; nroom = 0; doorindex = 0; @@ -141,8 +141,8 @@ makelevel() } makerooms() { -register struct rectangle *rsp; -register int lx, ly, hx, hy, lowx, lowy, hix, hiy, dx, dy; +struct rectangle *rsp; +int lx, ly, hx, hy, lowx, lowy, hix, hiy, dx, dy; int tryct = 0, xlim, ylim; /* init */ @@ -213,10 +213,10 @@ int tryct = 0, xlim, ylim; } addrs(lowx,lowy,hix,hiy) -register int lowx,lowy,hix,hiy; +int lowx,lowy,hix,hiy; { - register struct rectangle *rsp; - register int lx,ly,hx,hy,xlim,ylim; + struct rectangle *rsp; + int lx,ly,hx,hy,xlim,ylim; boolean discarded; xlim = XLIM + secret; @@ -249,10 +249,10 @@ register int lowx,lowy,hix,hiy; } addrsx(lx,ly,hx,hy,discarded) -register int lx,ly,hx,hy; +int lx,ly,hx,hy; boolean discarded; /* piece of a discarded area */ { - register struct rectangle *rsp; + struct rectangle *rsp; /* check inclusions */ for(rsp = rs; rsp < &rs[rsmax]; rsp++) { @@ -281,7 +281,7 @@ boolean discarded; /* piece of a discarded area */ } comp(x,y) -register struct mkroom *x,*y; +struct mkroom *x,*y; { if(x->lx < y->lx) return(-1); return(x->lx > y->lx); @@ -290,7 +290,7 @@ register struct mkroom *x,*y; coord finddpos(xl,yl,xh,yh) { coord ff; - register x,y; + x,y; x = (xl == xh) ? xl : (xl + rn2(xh-xl+1)); y = (yl == yh) ? yl : (yl + rn2(yh-yl+1)); @@ -315,7 +315,7 @@ gotit: /* see whether it is allowable to create a door at [x,y] */ okdoor(x,y) -register x,y; +x,y; { if(levl[x-1][y].typ == DOOR || levl[x+1][y].typ == DOOR || levl[x][y+1].typ == DOOR || levl[x][y-1].typ == DOOR || @@ -328,8 +328,8 @@ register x,y; } dodoor(x,y,aroom) -register x,y; -register struct mkroom *aroom; +x,y; +struct mkroom *aroom; { if(doorindex >= DOORMAX) { impossible("DOORMAX exceeded?"); @@ -341,12 +341,12 @@ register struct mkroom *aroom; } dosdoor(x,y,aroom,type) -register x,y; -register struct mkroom *aroom; -register type; +x,y; +struct mkroom *aroom; +type; { - register struct mkroom *broom; - register tmp; + struct mkroom *broom; + tmp; if(!IS_WALL(levl[x][y].typ)) /* avoid SDOORs with '+' as scrsym */ type = DOOR; @@ -368,9 +368,9 @@ register type; maker(lowx,ddx,lowy,ddy) schar lowx,ddx,lowy,ddy; { - register struct mkroom *croom; - register x, y, hix = lowx+ddx, hiy = lowy+ddy; - register xlim = XLIM + secret, ylim = YLIM + secret; + struct mkroom *croom; + x, y, hix = lowx+ddx, hiy = lowy+ddy; + xlim = XLIM + secret, ylim = YLIM + secret; if(nroom >= MAXNROFROOMS) return(0); if(lowx < XLIM) lowx = XLIM; @@ -443,7 +443,7 @@ chk: } makecorridors() { - register a,b; + a,b; nxcor = 0; for(a = 0; a < nroom-1; a++) @@ -465,13 +465,13 @@ makecorridors() { } join(a,b) -register a,b; +a,b; { coord cc,tt; - register tx, ty, xx, yy; - register struct rm *crm; - register struct mkroom *croom, *troom; - register dx, dy, dix, diy, cct; + tx, ty, xx, yy; + struct rm *crm; + struct mkroom *croom, *troom; + dx, dy, dix, diy, cct; croom = &rooms[a]; troom = &rooms[b]; @@ -552,7 +552,7 @@ register a,b; /* do we have to change direction ? */ if(dy && dix > diy) { - register ddx = (xx > tx) ? -1 : 1; + ddx = (xx > tx) ? -1 : 1; crm = &levl[xx+ddx][yy]; if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) { @@ -561,7 +561,7 @@ register a,b; continue; } } else if(dx && diy > dix) { - register ddy = (yy > ty) ? -1 : 1; + ddy = (yy > ty) ? -1 : 1; crm = &levl[xx][yy+ddy]; if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) { @@ -607,7 +607,7 @@ register a,b; make_niches() { - register int ct = rnd(nroom/2 + 1); + int ct = rnd(nroom/2 + 1); while(ct--) makeniche(FALSE); } @@ -619,12 +619,12 @@ makevtele() makeniche(with_trap) boolean with_trap; { - register struct mkroom *aroom; - register struct rm *rm; - register int vct = 8; + struct mkroom *aroom; + struct rm *rm; + int vct = 8; coord dd; - register dy,xx,yy; - register struct trap *ttmp; + dy,xx,yy; + struct trap *ttmp; if(doorindex < DOORMAX) while(vct--) { @@ -666,12 +666,12 @@ boolean with_trap; /* make a trap somewhere (in croom if mazeflag = 0) */ mktrap(num,mazeflag,croom) -register num,mazeflag; -register struct mkroom *croom; +num,mazeflag; +struct mkroom *croom; { - register struct trap *ttmp; - register int kind,nopierc,nomimic,fakedoor,fakegold,tryct = 0; - register xchar mx,my; + struct trap *ttmp; + int kind,nopierc,nomimic,fakedoor,fakegold,tryct = 0; + xchar mx,my; extern char fut_geno[]; if(!num || num >= TRAPNUM) { @@ -683,7 +683,7 @@ register struct mkroom *croom; } else kind = num; if(kind == MIMIC) { - register struct monst *mtmp; + struct monst *mtmp; fakedoor = (!rn2(3) && !mazeflag); fakegold = (!fakedoor && !rn2(2)); diff --git a/games/hack/hack.mkmaze.c b/games/hack/hack.mkmaze.c index 66cf634..620d83b 100644 --- a/games/hack/hack.mkmaze.c +++ b/games/hack/hack.mkmaze.c @@ -14,7 +14,7 @@ struct permonst hell_hound = makemaz() { int x,y; - register zx,zy; + zx,zy; coord mm; boolean al = (dlevel >= 30 && !flags.made_amulet); @@ -22,7 +22,7 @@ makemaz() for(y = 2; y < ROWNO-1; y++) levl[x][y].typ = (x%2 && y%2) ? 0 : HWALL; if(al) { - register struct monst *mtmp; + struct monst *mtmp; zx = 2*(COLNO/4) - 1; zy = 2*(ROWNO/4) - 1; @@ -88,7 +88,7 @@ makemaz() } walkfrom(x,y) int x,y; { -register int q,a,dir; +int q,a,dir; int dirs[4]; levl[x][y].typ = ROOM; while(1) { @@ -105,8 +105,8 @@ int dirs[4]; } move(x,y,dir) -register int *x, *y; -register int dir; +int *x, *y; +int dir; { switch(dir){ case 0: --(*y); break; @@ -118,7 +118,7 @@ register int dir; okay(x,y,dir) int x,y; -register int dir; +int dir; { move(&x,&y,dir); move(&x,&y,dir); diff --git a/games/hack/hack.mkobj.c b/games/hack/hack.mkobj.c index d377e21..61b4235 100644 --- a/games/hack/hack.mkobj.c +++ b/games/hack/hack.mkobj.c @@ -9,9 +9,9 @@ struct obj *mkobj(), *mksobj(); struct obj * mkobj_at(let,x,y) -register let,x,y; +let,x,y; { - register struct obj *otmp = mkobj(let); + struct obj *otmp = mkobj(let); otmp->ox = x; otmp->oy = y; otmp->nobj = fobj; @@ -20,9 +20,9 @@ register let,x,y; } mksobj_at(otyp,x,y) -register otyp,x,y; +otyp,x,y; { - register struct obj *otmp = mksobj(otyp); + struct obj *otmp = mksobj(otyp); otmp->ox = x; otmp->oy = y; otmp->nobj = fobj; @@ -47,9 +47,9 @@ struct obj zeroobj; struct obj * mksobj(otyp) -register otyp; +otyp; { - register struct obj *otmp; + struct obj *otmp; char let = objects[otyp].oc_olet; otmp = newobj(0); @@ -123,17 +123,17 @@ letter(c) { } weight(obj) -register struct obj *obj; +struct obj *obj; { -register int wt = objects[obj->otyp].oc_weight; +int wt = objects[obj->otyp].oc_weight; return(wt ? wt*obj->quan : (obj->quan + 1)/2); } mkgold(num,x,y) -register long num; +long num; { - register struct gold *gold; - register long amount = (num ? num : 1 + (rnd(dlevel+2) * rnd(30))); + struct gold *gold; + long amount = (num ? num : 1 + (rnd(dlevel+2) * rnd(30))); if(gold = g_at(x,y)) gold->amount += amount; diff --git a/games/hack/hack.mkshop.c b/games/hack/hack.mkshop.c index 2ed2d41..289368c 100644 --- a/games/hack/hack.mkshop.c +++ b/games/hack/hack.mkshop.c @@ -15,15 +15,15 @@ extern char shtypes[]; /* = "=/)%?!["; 8 types: 7 specialized, 1 mixed */ schar shprobs[] = { 3,3,5,5,10,10,14,50 }; /* their probabilities */ mkshop(){ -register struct mkroom *sroom; -register int sh,sx,sy,i = -1; -register char let; +struct mkroom *sroom; +int sh,sx,sy,i = -1; +char let; int roomno; -register struct monst *shk; +struct monst *shk; #ifdef WIZARD /* first determine shoptype */ if(wizard){ - register char *ep = getenv("SHOPTYPE"); + char *ep = getenv("SHOPTYPE"); if(ep){ if(*ep == 'z' || *ep == 'Z'){ mkzoo(ZOO); @@ -65,7 +65,7 @@ gottype: } if(i < 0) { /* shoptype not yet determined */ - register int j; + int j; for(j = rn2(100), i = 0; (j -= shprobs[i])>= 0; i++) if(!shtypes[i]) break; /* superfluous */ @@ -84,7 +84,7 @@ gottype: #ifdef WIZARD /* This is said to happen sometimes, but I've never seen it. */ if(wizard) { - register int j = sroom->doorct; + int j = sroom->doorct; extern int doorindex; pline("Where is shopdoor?"); @@ -118,7 +118,7 @@ gottype: findname(ESHK->shknam, let); for(sx = sroom->lx; sx <= sroom->hx; sx++) for(sy = sroom->ly; sy <= sroom->hy; sy++){ - register struct monst *mtmp; + struct monst *mtmp; if((sx == sroom->lx && doors[sh].x == sx-1) || (sx == sroom->hx && doors[sh].x == sx+1) || (sy == sroom->ly && doors[sh].y == sy-1) || @@ -137,9 +137,9 @@ gottype: mkzoo(type) int type; { - register struct mkroom *sroom; - register struct monst *mon; - register int sh,sx,sy,i; + struct mkroom *sroom; + struct monst *mon; + int sh,sx,sy,i; int goldlim = 500 * dlevel; int moct = 0; struct permonst *morguemon(); @@ -197,7 +197,7 @@ struct permonst * morguemon() { extern struct permonst pm_ghost; - register int i = rn2(100), hd = rn2(dlevel); + int i = rn2(100), hd = rn2(dlevel); if(hd > 10 && i < 10) return(PM_DEMON); if(hd > 8 && i > 85) return(PM_VAMPIRE); @@ -206,8 +206,8 @@ morguemon() mkswamp() /* Michiel Huisjes & Fred de Wilde */ { - register struct mkroom *sroom; - register int sx,sy,i,eelct = 0; + struct mkroom *sroom; + int sx,sy,i,eelct = 0; extern struct permonst pm_eel; for(i=0; i<5; i++) { /* 5 tries */ @@ -233,10 +233,10 @@ mkswamp() /* Michiel Huisjes & Fred de Wilde */ } nexttodoor(sx,sy) -register sx,sy; +sx,sy; { - register dx,dy; - register struct rm *lev; + dx,dy; + struct rm *lev; for(dx = -1; dx <= 1; dx++) for(dy = -1; dy <= 1; dy++) if((lev = &levl[sx+dx][sy+dy])->typ == DOOR || lev->typ == SDOOR || lev->typ == LDOOR) @@ -245,23 +245,23 @@ register sx,sy; } has_dnstairs(sroom) -register struct mkroom *sroom; +struct mkroom *sroom; { return(sroom->lx <= xdnstair && xdnstair <= sroom->hx && sroom->ly <= ydnstair && ydnstair <= sroom->hy); } has_upstairs(sroom) -register struct mkroom *sroom; +struct mkroom *sroom; { return(sroom->lx <= xupstair && xupstair <= sroom->hx && sroom->ly <= yupstair && yupstair <= sroom->hy); } isbig(sroom) -register struct mkroom *sroom; +struct mkroom *sroom; { - register int area = (sroom->hx - sroom->lx) * (sroom->hy - sroom->ly); + int area = (sroom->hx - sroom->lx) * (sroom->hy - sroom->ly); return( area > 20 ); } diff --git a/games/hack/hack.mon.c b/games/hack/hack.mon.c index 237fada..90511b1 100644 --- a/games/hack/hack.mon.c +++ b/games/hack/hack.mon.c @@ -21,8 +21,8 @@ char *warnings[] = { movemon() { - register struct monst *mtmp; - register int fr; + struct monst *mtmp; + int fr; warnlevel = 0; @@ -80,7 +80,7 @@ movemon() warnlevel = SIZE(warnings)-1; if(warnlevel >= 0) if(warnlevel > lastwarnlev || moves > lastwarntime + 5){ - register char *rr; + char *rr; switch(Warning & (LEFT_RING | RIGHT_RING)){ case LEFT_RING: rr = "Your left ring glows"; @@ -104,7 +104,7 @@ movemon() } justswld(mtmp,name) -register struct monst *mtmp; +struct monst *mtmp; char *name; { @@ -121,8 +121,8 @@ char *name; } youswld(mtmp,dam,die,name) -register struct monst *mtmp; -register dam,die; +struct monst *mtmp; +dam,die; char *name; { if(mtmp != u.ustuck) return; @@ -136,11 +136,11 @@ char *name; /* flags.botlx = 1; */ /* should we show status line ? */ } -dochugw(mtmp) register struct monst *mtmp; { -register x = mtmp->mx; -register y = mtmp->my; -register d = dochug(mtmp); -register dd; +dochugw(mtmp) struct monst *mtmp; { +x = mtmp->mx; +y = mtmp->my; +d = dochug(mtmp); +dd; if(!d) /* monster still alive */ if(Warning) if(!mtmp->mpeaceful) @@ -154,10 +154,10 @@ register dd; /* returns 1 if monster died moving, 0 otherwise */ dochug(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { - register struct permonst *mdat; - register tmp, nearby, scared; + struct permonst *mdat; + tmp, nearby, scared; if(mtmp->cham && !rn2(6)) (void) newcham(mtmp, &mons[dlevel+14+rn2(CMNUM-14-dlevel)]); @@ -236,10 +236,10 @@ register struct monst *mtmp; } m_move(mtmp,after) -register struct monst *mtmp; +struct monst *mtmp; { - register struct monst *mtmp2; - register nx,ny,omx,omy,appr,nearer,cnt,i,j; + struct monst *mtmp2; + nx,ny,omx,omy,appr,nearer,cnt,i,j; xchar gx,gy,nix,niy,chcnt; schar chi; boolean likegold, likegems, likeobjs; @@ -327,7 +327,7 @@ not_special: if(msym == '@' || ('a' <= msym && msym <= 'z')) { extern coord *gettrack(); - register coord *cp; + coord *cp; schar mroom; mroom = inroom(omx,omy); if(mroom < 0 || mroom != inroom(u.ux,u.uy)){ @@ -345,9 +345,9 @@ not_special: likeobjs = mtmp->mhide; #define SRCHRADIUS 25 { xchar mind = SRCHRADIUS; /* not too far away */ - register int dd; + int dd; if(likegold){ - register struct gold *gold; + struct gold *gold; for(gold = fgold; gold; gold = gold->ngold) if((dd = DIST(omx,omy,gold->gx,gold->gy)) < mind){ mind = dd; @@ -356,7 +356,7 @@ not_special: } } if(likegems || likeobjs){ - register struct obj *otmp; + struct obj *otmp; for(otmp = fobj; otmp; otmp = otmp->nobj) if(likeobjs || otmp->olet == GEM_SYM) if(msym != 'u' || @@ -449,8 +449,8 @@ postmov: return(mmoved); } -mpickgold(mtmp) register struct monst *mtmp; { -register struct gold *gold; +mpickgold(mtmp) struct monst *mtmp; { +struct gold *gold; while(gold = g_at(mtmp->mx, mtmp->my)){ mtmp->mgold += gold->amount; freegold(gold); @@ -459,8 +459,8 @@ register struct gold *gold; } } -mpickgems(mtmp) register struct monst *mtmp; { -register struct obj *otmp; +mpickgems(mtmp) struct monst *mtmp; { +struct obj *otmp; for(otmp = fobj; otmp; otmp = otmp->nobj) if(otmp->olet == GEM_SYM) if(otmp->ox == mtmp->mx && otmp->oy == mtmp->my) @@ -475,12 +475,12 @@ register struct obj *otmp; /* return number of acceptable neighbour positions */ mfndpos(mon,poss,info,flag) -register struct monst *mon; +struct monst *mon; coord poss[9]; int info[9], flag; { - register int x,y,nx,ny,cnt = 0,ntyp; - register struct monst *mtmp; + int x,y,nx,ny,cnt = 0,ntyp; + struct monst *mtmp; int nowtyp; boolean pool; @@ -530,8 +530,8 @@ nexttry: /* eels prefer the water, but if there is no water nearby, info[cnt] |= NOTONL; } /* we cannot avoid traps of an unknown kind */ - { register struct trap *ttmp = t_at(nx, ny); - register int tt; + { struct trap *ttmp = t_at(nx, ny); + int tt; if(ttmp) { tt = 1 << ttmp->ttyp; if(mon->mtrapseen & tt){ @@ -556,9 +556,9 @@ dist(x,y) int x,y; { } poisoned(string, pname) -register char *string, *pname; +char *string, *pname; { - register int i; + int i; if(Blind) pline("It was poisoned."); else pline("The %s was poisoned!",string); @@ -582,7 +582,7 @@ register char *string, *pname; } mondead(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { relobj(mtmp,1); unpmon(mtmp); @@ -598,7 +598,7 @@ register struct monst *mtmp; /* called when monster is moved to larger structure */ replmon(mtmp,mtmp2) -register struct monst *mtmp, *mtmp2; +struct monst *mtmp, *mtmp2; { relmon(mtmp); monfree(mtmp); @@ -610,9 +610,9 @@ register struct monst *mtmp, *mtmp2; } relmon(mon) -register struct monst *mon; +struct monst *mon; { - register struct monst *mtmp; + struct monst *mtmp; if(mon == fmon) fmon = fmon->nmon; else { @@ -625,13 +625,13 @@ register struct monst *mon; available shortly after their demise */ struct monst *fdmon; /* chain of dead monsters, need not to be saved */ -monfree(mtmp) register struct monst *mtmp; { +monfree(mtmp) struct monst *mtmp; { mtmp->nmon = fdmon; fdmon = mtmp; } dmonsfree(){ -register struct monst *mtmp; +struct monst *mtmp; while(mtmp = fdmon){ fdmon = mtmp->nmon; free((char *) mtmp); @@ -639,7 +639,7 @@ register struct monst *mtmp; } unstuck(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { if(u.ustuck == mtmp) { if(u.uswallow){ @@ -654,13 +654,13 @@ register struct monst *mtmp; } killed(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { #ifdef lint #define NEW_SCORING #endif lint - register int tmp,tmp2,nk,x,y; - register struct permonst *mdat; + int tmp,tmp2,nk,x,y; + struct permonst *mdat; extern long newuexp(); if(mtmp->cham) mtmp->data = PM_CHAMELEON; @@ -754,7 +754,7 @@ register struct monst *mtmp; if(ACCESSIBLE(levl[x][y].typ)) /* might be mimic in wall or dead eel*/ if(x != u.ux || y != u.uy) /* might be here after swallowed */ if(index("NTVm&",mdat->mlet) || rn2(5)) { - register struct obj *obj2 = mkobj_at(tmp,x,y); + struct obj *obj2 = mkobj_at(tmp,x,y); if(cansee(x,y)) atl(x,y,obj2->olet); stackobj(obj2); @@ -762,7 +762,7 @@ register struct monst *mtmp; } kludge(str,arg) -register char *str,*arg; +char *str,*arg; { if(Blind) { if(*str == '%') pline(str,"It"); @@ -772,7 +772,7 @@ register char *str,*arg; rescham() /* force all chameleons to become normal */ { - register struct monst *mtmp; + struct monst *mtmp; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) if(mtmp->cham) { @@ -783,10 +783,10 @@ rescham() /* force all chameleons to become normal */ newcham(mtmp,mdat) /* make a chameleon look like a new monster */ /* returns 1 if the monster actually changed */ -register struct monst *mtmp; -register struct permonst *mdat; +struct monst *mtmp; +struct permonst *mdat; { - register mhp, hpn, hpd; + mhp, hpn, hpd; if(mdat == mtmp->data) return(0); /* still the same monster */ #ifndef NOWORM @@ -832,11 +832,11 @@ struct monst *mtmp; pmon(mtmp); } -ishuman(mtmp) register struct monst *mtmp; { +ishuman(mtmp) struct monst *mtmp; { return(mtmp->data->mlet == '@'); } -setmangry(mtmp) register struct monst *mtmp; { +setmangry(mtmp) struct monst *mtmp; { if(!mtmp->mpeaceful) return; if(mtmp->mtame) return; mtmp->mpeaceful = 0; @@ -846,7 +846,7 @@ setmangry(mtmp) register struct monst *mtmp; { /* not one hundred procent correct: now a snake may hide under an invisible object */ canseemon(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { return((!mtmp->minvis || See_invisible) && (!mtmp->mhide || !o_at(mtmp->mx,mtmp->my)) diff --git a/games/hack/hack.o_init.c b/games/hack/hack.o_init.c index f55d96c..6cac5dd 100644 --- a/games/hack/hack.o_init.c +++ b/games/hack/hack.o_init.c @@ -9,17 +9,17 @@ extern char *index(); int -letindex(let) register char let; { -register int i = 0; -register char ch; +letindex(let) char let; { +int i = 0; +char ch; while((ch = obj_symbols[i++]) != 0) if(ch == let) return(i); return(0); } init_objects(){ -register int i, j, first, last, sum, end; -register char let, *tmp; +int i, j, first, last, sum, end; +char let, *tmp; /* init base; if probs given check that they add up to 100, otherwise compute probs; shuffle descriptions */ end = SIZE(objects); @@ -64,9 +64,9 @@ register char let, *tmp; } } -probtype(let) register char let; { -register int i = bases[letindex(let)]; -register int prob = rn2(100); +probtype(let) char let; { +int i = bases[letindex(let)]; +int prob = rn2(100); while((prob -= objects[i].oc_prob) >= 0) i++; if(objects[i].oc_olet != let || !objects[i].oc_name) panic("probtype(%c) error, i=%d", let, i); @@ -75,7 +75,7 @@ register int prob = rn2(100); setgemprobs() { - register int j,first; + int j,first; extern xchar dlevel; first = bases[letindex(GEM_SYM)]; @@ -99,8 +99,8 @@ oinit() /* level dependent initialization */ extern long *alloc(); -savenames(fd) register fd; { -register int i; +savenames(fd) fd; { +int i; unsigned len; bwrite(fd, (char *) bases, sizeof bases); bwrite(fd, (char *) objects, sizeof objects); @@ -116,8 +116,8 @@ unsigned len; } } -restnames(fd) register fd; { -register int i; +restnames(fd) fd; { +int i; unsigned len; mread(fd, (char *) bases, sizeof bases); mread(fd, (char *) objects, sizeof objects); @@ -131,7 +131,7 @@ unsigned len; dodiscovered() /* free after Robert Viduya */ { extern char *typename(); - register int i, end; + int i, end; int ct = 0; cornline(0, "Discoveries"); @@ -153,7 +153,7 @@ dodiscovered() /* free after Robert Viduya */ } interesting_to_discover(i) -register int i; +int i; { return( objects[i].oc_uname != NULL || diff --git a/games/hack/hack.objnam.c b/games/hack/hack.objnam.c index ad47e7e..eebc052 100644 --- a/games/hack/hack.objnam.c +++ b/games/hack/hack.objnam.c @@ -11,8 +11,8 @@ extern char *eos(); extern int bases[]; char * -strprepend(s,pref) register char *s, *pref; { -register int i = strlen(pref); +strprepend(s,pref) char *s, *pref; { +int i = strlen(pref); if(i > PREFIX) { pline("WARNING: prefix too short."); return(s); @@ -31,14 +31,14 @@ static char buf[13]; char * typename(otyp) -register int otyp; +int otyp; { static char buf[BUFSZ]; -register struct objclass *ocl = &objects[otyp]; -register char *an = ocl->oc_name; -register char *dn = ocl->oc_descr; -register char *un = ocl->oc_uname; -register int nn = ocl->oc_name_known; +struct objclass *ocl = &objects[otyp]; +char *an = ocl->oc_name; +char *dn = ocl->oc_descr; +char *un = ocl->oc_uname; +int nn = ocl->oc_name_known; switch(ocl->oc_olet) { case POTION_SYM: Strcpy(buf, "potion"); @@ -82,15 +82,15 @@ register int nn = ocl->oc_name_known; char * xname(obj) -register struct obj *obj; +struct obj *obj; { static char bufr[BUFSZ]; -register char *buf = &(bufr[PREFIX]); /* leave room for "17 -3 " */ -register int nn = objects[obj->otyp].oc_name_known; -register char *an = objects[obj->otyp].oc_name; -register char *dn = objects[obj->otyp].oc_descr; -register char *un = objects[obj->otyp].oc_uname; -register int pl = (obj->quan != 1); +char *buf = &(bufr[PREFIX]); /* leave room for "17 -3 " */ +int nn = objects[obj->otyp].oc_name_known; +char *an = objects[obj->otyp].oc_name; +char *dn = objects[obj->otyp].oc_descr; +char *un = objects[obj->otyp].oc_uname; +int pl = (obj->quan != 1); if(!obj->dknown && !Blind) obj->dknown = 1; /* %% doesnt belong here */ switch(obj->olet) { case AMULET_SYM: @@ -210,12 +210,12 @@ register int pl = (obj->quan != 1); obj->olet,obj->olet,obj->otyp,obj->spe); } if(pl) { - register char *p; + char *p; for(p = buf; *p; p++) { if(!strncmp(" of ", p, 4)) { /* pieces of, cloves of, lumps of */ - register int c1, c2 = 's'; + int c1, c2 = 's'; do { c1 = c2; c2 = *p; *p++ = c1; @@ -242,10 +242,10 @@ nopl: char * doname(obj) -register struct obj *obj; +struct obj *obj; { char prefix[PREFIX]; -register char *bp = xname(obj); +char *bp = xname(obj); if(obj->quan != 1) Sprintf(prefix, "%u ", obj->quan); else @@ -290,7 +290,7 @@ register char *bp = xname(obj); /* used only in hack.fight.c (thitu) */ setan(str,buf) -register char *str,*buf; +char *str,*buf; { if(index(vowels,*str)) Sprintf(buf, "an %s", str); @@ -299,8 +299,8 @@ register char *str,*buf; } char * -aobjnam(otmp,verb) register struct obj *otmp; register char *verb; { -register char *bp = xname(otmp); +aobjnam(otmp,verb) struct obj *otmp; char *verb; { +char *bp = xname(otmp); char prefix[PREFIX]; if(otmp->quan != 1) { Sprintf(prefix, "%u ", otmp->quan); @@ -324,9 +324,9 @@ char prefix[PREFIX]; char * Doname(obj) -register struct obj *obj; +struct obj *obj; { - register char *s = doname(obj); + char *s = doname(obj); if('a' <= *s && *s <= 'z') *s -= ('a' - 'A'); return(s); @@ -336,9 +336,9 @@ char *wrp[] = { "wand", "ring", "potion", "scroll", "gem" }; char wrpsym[] = { WAND_SYM, RING_SYM, POTION_SYM, SCROLL_SYM, GEM_SYM }; struct obj * -readobjnam(bp) register char *bp; { -register char *p; -register int i; +readobjnam(bp) char *bp; { +char *p; +int i; int cnt, spe, spesgn, typ, heavy; char let; char *un, *dn, *an; @@ -461,7 +461,7 @@ sing: goto srch; } for(i = 0; i < sizeof(wrpsym); i++) { - register int j = strlen(wrp[i]); + int j = strlen(wrp[i]); if(!strncmp(bp, wrp[i], j)){ let = wrpsym[i]; bp += j; @@ -496,7 +496,7 @@ srch: i = 1; if(let) i = bases[letindex(let)]; while(i <= NROFOBJECTS && (!let || objects[i].oc_olet == let)){ - register char *zn = objects[i].oc_name; + char *zn = objects[i].oc_name; if(!zn) goto nxti; if(an && strcmp(an, zn)) @@ -514,7 +514,7 @@ any: if(!let) let = wrpsym[rn2(sizeof(wrpsym))]; typ = probtype(let); typfnd: - { register struct obj *otmp; + { struct obj *otmp; extern struct obj *mksobj(); let = objects[typ].oc_olet; otmp = mksobj(typ); diff --git a/games/hack/hack.options.c b/games/hack/hack.options.c index 1c3a4a5..7bd1baa 100644 --- a/games/hack/hack.options.c +++ b/games/hack/hack.options.c @@ -9,7 +9,7 @@ extern char *eos(); initoptions() { - register char *opts; + char *opts; flags.time = flags.nonews = flags.notombstone = flags.end_own = flags.standout = flags.nonull = FALSE; @@ -24,10 +24,10 @@ initoptions() } parseoptions(opts, from_env) -register char *opts; +char *opts; boolean from_env; { - register char *op,*op2; + char *op,*op2; unsigned num; boolean negated; @@ -193,7 +193,7 @@ doset() flags.end_top, flags.end_around); if(flags.end_own) (void) strcat(buf, "/own scores"); } else { - register char *eop = eos(buf); + char *eop = eos(buf); if(*--eop == ',') *eop = 0; } pline(buf); diff --git a/games/hack/hack.pager.c b/games/hack/hack.pager.c index 3610494..17df161 100644 --- a/games/hack/hack.pager.c +++ b/games/hack/hack.pager.c @@ -21,7 +21,7 @@ dowhatis() { FILE *fp; char bufr[BUFSZ+6]; - register char *buf = &bufr[6], *ep, q; + char *buf = &bufr[6], *ep, q; extern char readchar(); if(!(fp = fopen(DATAFILE, "r"))) @@ -71,7 +71,7 @@ page_more(fp,strip) FILE *fp; int strip; /* nr of chars to be stripped from each line (0 or 1) */ { - register char *bufr, *ep; + char *bufr, *ep; sig_t prevsig = signal(SIGINT, intruph); set_pager(0); @@ -103,7 +103,7 @@ set_whole_screen() { /* called in termcap as soon as LI is known */ #ifdef NEWS readnews() { - register int ret; + int ret; whole_screen = TRUE; /* force a docrt(), our first */ ret = page_file(NEWS, TRUE); @@ -113,7 +113,7 @@ readnews() { #endif NEWS set_pager(mode) -register int mode; /* 0: open 1: wait+close 2: close */ +int mode; /* 0: open 1: wait+close 2: close */ { static boolean so; if(mode == 0) { @@ -143,7 +143,7 @@ register int mode; /* 0: open 1: wait+close 2: close */ } page_line(s) /* returns 1 if we should quit */ -register char *s; +char *s; { extern char morc; @@ -190,7 +190,7 @@ char *text; } *texthead, *texttail; static int maxlen; static int linect; - register struct line *tl; + struct line *tl; if(mode == 0) { texthead = 0; @@ -204,7 +204,7 @@ char *text; } if(mode == 1) { - register int len; + int len; if(!text) return; /* superfluous, just to be sure */ linect++; @@ -229,7 +229,7 @@ char *text; pline(texthead->line_text); else if(mode == 2) { - register int curline, lth; + int curline, lth; if(flags.toplin == 1) more(); /* ab@unido */ remember_topl(); @@ -290,14 +290,14 @@ dohelp() } page_file(fnam, silent) /* return: 0 - cannot open fnam; 1 - otherwise */ -register char *fnam; +char *fnam; boolean silent; { #ifdef DEF_PAGER /* this implies that UNIX is defined */ { /* use external pager; this may give security problems */ - register int fd = open(fnam, 0); + int fd = open(fnam, 0); if(fd < 0) { if(!silent) pline("Cannot open %s.", fnam); @@ -341,7 +341,7 @@ boolean silent; #ifdef UNIX #ifdef SHELL dosh(){ -register char *str; +char *str; if(child(0)) { if(str = getenv("SHELL")) execl(str, str, (char *) 0); @@ -375,7 +375,7 @@ union wait { /* used only for the cast (union wait *) 0 */ child(wt) { int status; - register int f; + int f; f = fork(); if(f == 0){ /* child */ diff --git a/games/hack/hack.potion.c b/games/hack/hack.potion.c index 1beaa1a..5709f25 100644 --- a/games/hack/hack.potion.c +++ b/games/hack/hack.potion.c @@ -9,9 +9,9 @@ extern struct monst youmonst; extern struct monst *makemon(); dodrink() { - register struct obj *otmp,*objs; - register struct monst *mtmp; - register int unkn = 0, nothing = 0; + struct obj *otmp,*objs; + struct monst *mtmp; + int unkn = 0, nothing = 0; otmp = getobj("!", "drink"); if(!otmp) return(0); @@ -191,7 +191,7 @@ use_it: pluslvl() { - register num; + num; pline("You feel more experienced."); num = rnd(10); @@ -207,8 +207,8 @@ pluslvl() } strange_feeling(obj,txt) -register struct obj *obj; -register char *txt; +struct obj *obj; +char *txt; { if(flags.beginner) pline("You have a strange feeling for a moment, then it passes."); @@ -224,11 +224,11 @@ char *bottlenames[] = { }; potionhit(mon, obj) -register struct monst *mon; -register struct obj *obj; +struct monst *mon; +struct obj *obj; { extern char *xname(); - register char *botlnam = bottlenames[rn2(SIZE(bottlenames))]; + char *botlnam = bottlenames[rn2(SIZE(bottlenames))]; boolean uclose, isyou = (mon == &youmonst); if(isyou) { @@ -296,7 +296,7 @@ register struct obj *obj; } potionbreathe(obj) -register struct obj *obj; +struct obj *obj; { switch(obj->otyp) { case POT_RESTORE_STRENGTH: @@ -355,7 +355,7 @@ register struct obj *obj; * -- become a jug? Etc. */ dodip(){ - register struct obj *potion, *obj; + struct obj *potion, *obj; if(!(obj = getobj("#", "dip"))) return(0); @@ -374,7 +374,7 @@ dodip(){ ghost_from_bottle(){ extern struct permonst pm_ghost; - register struct monst *mtmp; + struct monst *mtmp; if(!(mtmp = makemon(PM_GHOST,u.ux,u.uy))){ pline("This bottle turns out to be empty."); diff --git a/games/hack/hack.pri.c b/games/hack/hack.pri.c index fcbd581..a948cb4 100644 --- a/games/hack/hack.pri.c +++ b/games/hack/hack.pri.c @@ -52,9 +52,9 @@ char *str; } atl(x,y,ch) -register x,y; +x,y; { - register struct rm *crm = &levl[x][y]; + struct rm *crm = &levl[x][y]; if(x<0 || x>COLNO-1 || y<0 || y>ROWNO-1){ impossible("atl(%d,%d,%c)",x,y,ch); @@ -67,7 +67,7 @@ register x,y; } on_scr(x,y) -register x,y; +x,y; { if(x < scrlx) scrlx = x; if(x > scrhx) scrhx = x; @@ -114,7 +114,7 @@ Tmp_at(x,y) schar x,y; { static char let; static xchar cnt; static coord tc[COLNO]; /* but watch reflecting beams! */ -register xx,yy; +xx,yy; if((int)x == -1) { if(y > 0) { /* open call */ let = y; @@ -152,7 +152,7 @@ setclipped(){ } at(x,y,ch) -register xchar x,y; +xchar x,y; char ch; { #ifndef lint @@ -184,9 +184,9 @@ doredraw() docrt() { - register x,y; - register struct rm *room; - register struct monst *mtmp; + x,y; + struct rm *room; + struct monst *mtmp; if(u.uswallow) { swallowed(); @@ -221,10 +221,10 @@ docrt() bot(); } -docorner(xmin,ymax) register xmin,ymax; { - register x,y; - register struct rm *room; - register struct monst *mtmp; +docorner(xmin,ymax) xmin,ymax; { + x,y; + struct rm *room; + struct monst *mtmp; if(u.uswallow) { /* Can be done more efficiently */ swallowed(); @@ -292,9 +292,9 @@ extern struct wseg *m_atseg; /* print a position that is visible for @ */ prl(x,y) { - register struct rm *room; - register struct monst *mtmp; - register struct obj *otmp; + struct rm *room; + struct monst *mtmp; + struct obj *otmp; if(x == u.ux && y == u.uy && (!Invisible)) { pru(); @@ -333,12 +333,12 @@ prl(x,y) char news0(x,y) -register xchar x,y; +xchar x,y; { - register struct obj *otmp; - register struct trap *ttmp; + struct obj *otmp; + struct trap *ttmp; struct rm *room; - register char tmp; + char tmp; room = &levl[x][y]; if(!room->seen) tmp = ' '; @@ -382,7 +382,7 @@ register xchar x,y; } newsym(x,y) -register x,y; +x,y; { atl(x,y,news0(x,y)); } @@ -390,9 +390,9 @@ register x,y; /* used with wand of digging (or pick-axe): fill scrsym and force display */ /* also when a POOL evaporates */ mnewsym(x,y) -register x,y; +x,y; { - register struct rm *room; + struct rm *room; char newscrsym; if(!vism_at(x,y)) { @@ -406,9 +406,9 @@ register x,y; } nosee(x,y) -register x,y; +x,y; { - register struct rm *room; + struct rm *room; if(!isok(x,y)) return; room = &levl[x][y]; @@ -421,7 +421,7 @@ register x,y; #ifndef QUEST prl1(x,y) -register x,y; +x,y; { if(u.dx) { if(u.dy) { @@ -443,7 +443,7 @@ register x,y; } nose1(x,y) -register x,y; +x,y; { if(u.dx) { if(u.dy) { @@ -466,9 +466,9 @@ register x,y; #endif QUEST vism_at(x,y) -register x,y; +x,y; { - register struct monst *mtmp; + struct monst *mtmp; return((x == u.ux && y == u.uy && !Invisible) ? 1 : @@ -478,8 +478,8 @@ register x,y; } #ifdef NEWSCR -pobj(obj) register struct obj *obj; { -register int show = (!obj->oinvis || See_invisible) && +pobj(obj) struct obj *obj; { +int show = (!obj->oinvis || See_invisible) && cansee(obj->ox,obj->oy); if(obj->odispl){ if(obj->odx != obj->ox || obj->ody != obj->oy || !show) @@ -497,7 +497,7 @@ register int show = (!obj->oinvis || See_invisible) && } #endif NEWSCR -unpobj(obj) register struct obj *obj; { +unpobj(obj) struct obj *obj; { /* if(obj->odispl){ if(!vism_at(obj->odx, obj->ody)) newsym(obj->odx, obj->ody); @@ -509,7 +509,7 @@ unpobj(obj) register struct obj *obj; { } seeobjs(){ -register struct obj *obj, *obj2; +struct obj *obj, *obj2; for(obj = fobj; obj; obj = obj2) { obj2 = obj->nobj; if(obj->olet == FOOD_SYM && obj->otyp >= CORPSE @@ -525,7 +525,7 @@ register struct obj *obj, *obj2; } seemons(){ -register struct monst *mtmp; +struct monst *mtmp; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon){ if(mtmp->data->mlet == ';') mtmp->minvis = (u.ustuck != mtmp && @@ -537,8 +537,8 @@ register struct monst *mtmp; } } -pmon(mon) register struct monst *mon; { -register int show = (Blind && Telepat) || canseemon(mon); +pmon(mon) struct monst *mon; { +int show = (Blind && Telepat) || canseemon(mon); if(mon->mdispl){ if(mon->mdx != mon->mx || mon->mdy != mon->my || !show) unpmon(mon); @@ -554,7 +554,7 @@ register int show = (Blind && Telepat) || canseemon(mon); } } -unpmon(mon) register struct monst *mon; { +unpmon(mon) struct monst *mon; { if(mon->mdispl){ newsym(mon->mdx, mon->mdy); mon->mdispl = 0; @@ -563,8 +563,8 @@ unpmon(mon) register struct monst *mon; { nscr() { - register x,y; - register struct rm *room; + x,y; + struct rm *room; if(u.uswallow || u.ux == FAR || flags.nscrinh) return; pru(); @@ -582,7 +582,7 @@ nscr() /* 100 suffices for bot(); no relation with COLNO */ char oldbot[100], newbot[100]; cornbot(lth) -register int lth; +int lth; { if(lth < sizeof(oldbot)) { oldbot[lth] = 0; @@ -592,8 +592,8 @@ register int lth; bot() { -register char *ob = oldbot, *nb = newbot; -register int i; +char *ob = oldbot, *nb = newbot; +int i; extern char *eos(); if(flags.botlx) *ob = 0; flags.botl = flags.botlx = 0; @@ -622,7 +622,7 @@ extern char *eos(); if(flags.time) (void) sprintf(eos(newbot), " %ld", moves); if(strlen(newbot) >= COLNO) { - register char *bp0, *bp1; + char *bp0, *bp1; bp0 = bp1 = newbot; do { if(*bp0 != ' ' || bp0[1] != ' ' || bp0[2] != ' ') @@ -642,7 +642,7 @@ extern char *eos(); } #ifdef WAN_PROBING -mstatusline(mtmp) register struct monst *mtmp; { +mstatusline(mtmp) struct monst *mtmp; { pline("Status of %s: ", monnam(mtmp)); pline("Level %-2d Gold %-5lu Hp %3d(%d) Ac %-2d Dam %d", mtmp->data->mlevel, mtmp->mgold, mtmp->mhp, mtmp->mhpmax, diff --git a/games/hack/hack.read.c b/games/hack/hack.read.c index 00c9584..3c81d93 100644 --- a/games/hack/hack.read.c +++ b/games/hack/hack.read.c @@ -9,9 +9,9 @@ extern struct obj *mkobj_at(); int identify(); doread() { - register struct obj *scroll; - register boolean confused = (Confusion != 0); - register boolean known = FALSE; + struct obj *scroll; + boolean confused = (Confusion != 0); + boolean known = FALSE; extern struct obj *some_armor(); scroll = getobj("?", "read"); @@ -34,7 +34,7 @@ doread() { break; #endif MAIL case SCR_ENCHANT_ARMOR: - { register struct obj *otmp = some_armor(); + { struct obj *otmp = some_armor(); if(!otmp) { strange_feeling(scroll,"Your skin glows then fades."); return(1); @@ -59,7 +59,7 @@ doread() { } case SCR_DESTROY_ARMOR: if(confused) { - register struct obj *otmp = some_armor(); + struct obj *otmp = some_armor(); if(!otmp) { strange_feeling(scroll,"Your bones itch."); return(1); @@ -94,8 +94,8 @@ doread() { } break; case SCR_SCARE_MONSTER: - { register int ct = 0; - register struct monst *mtmp; + { int ct = 0; + struct monst *mtmp; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) if(cansee(mtmp->mx,mtmp->my)) { @@ -121,7 +121,7 @@ doread() { pline("This scroll seems to be blank."); break; case SCR_REMOVE_CURSE: - { register struct obj *obj; + { struct obj *obj; if(confused) pline("You feel like you need some help."); else @@ -141,7 +141,7 @@ doread() { break; } case SCR_CREATE_MONSTER: - { register int cnt = 1; + { int cnt = 1; if(!rn2(73)) cnt += rnd(4); if(confused) cnt += 12; @@ -169,9 +169,9 @@ doread() { return(1); break; case SCR_TAMING: - { register int i,j; - register int bd = confused ? 5 : 1; - register struct monst *mtmp; + { int i,j; + int bd = confused ? 5 : 1; + struct monst *mtmp; for(i = -bd; i <= bd; i++) for(j = -bd; j <= bd; j++) if(mtmp = m_at(u.ux+i, u.uy+j)) @@ -181,7 +181,7 @@ doread() { case SCR_GENOCIDE: { extern char genocided[], fut_geno[]; char buf[BUFSZ]; - register struct monst *mtmp, *mtmp2; + struct monst *mtmp, *mtmp2; pline("You have found a scroll of genocide!"); known = TRUE; @@ -220,11 +220,11 @@ doread() { level_tele(); else { #ifdef QUEST - register int oux = u.ux, ouy = u.uy; + int oux = u.ux, ouy = u.uy; tele(); if(dist(oux, ouy) > 100) known = TRUE; #else QUEST - register int uroom = inroom(u.ux, u.uy); + int uroom = inroom(u.ux, u.uy); tele(); if(uroom != inroom(u.ux, u.uy)) known = TRUE; #endif QUEST @@ -234,7 +234,7 @@ doread() { /* Unfortunately this code has become slightly less elegant, now that gold and traps no longer are of the same type. */ if(confused) { - register struct trap *ttmp; + struct trap *ttmp; if(!ftrap) { strange_feeling(scroll, "Your toes stop itching."); @@ -254,7 +254,7 @@ doread() { pline("You feel very greedy!"); } } else { - register struct gold *gtmp; + struct gold *gtmp; if(!fgold) { strange_feeling(scroll, "You feel materially poor."); @@ -280,9 +280,9 @@ doread() { docrt(); break; case SCR_FOOD_DETECTION: - { register ct = 0, ctu = 0; - register struct obj *obj; - register char foodsym = confused ? POTION_SYM : FOOD_SYM; + { ct = 0, ctu = 0; + struct obj *obj; + char foodsym = confused ? POTION_SYM : FOOD_SYM; for(obj = fobj; obj; obj = obj->nobj) if(obj->olet == FOOD_SYM) { @@ -326,8 +326,8 @@ doread() { ); return(1); case SCR_MAGIC_MAPPING: - { register struct rm *lev; - register int num, zx, zy; + { struct rm *lev; + int num, zx, zy; known = TRUE; pline("On this scroll %s a map!", @@ -361,7 +361,7 @@ doread() { break; } case SCR_AMNESIA: - { register int zx, zy; + { int zx, zy; known = TRUE; for(zx = 0; zx < COLNO; zx++) for(zy = 0; zy < ROWNO; zy++) @@ -373,8 +373,8 @@ doread() { break; } case SCR_FIRE: - { register int num; - register struct monst *mtmp; + { int num; + struct monst *mtmp; known = TRUE; if(confused) { @@ -437,7 +437,7 @@ doread() { } identify(otmp) /* also called by newmail() */ -register struct obj *otmp; +struct obj *otmp; { objects[otmp->otyp].oc_name_known = 1; otmp->known = otmp->dknown = 1; @@ -446,9 +446,9 @@ register struct obj *otmp; } litroom(on) -register boolean on; +boolean on; { - register num,zx,zy; + num,zx,zy; /* first produce the text (provided he is not blind) */ if(Blind) goto do_it; @@ -521,9 +521,9 @@ do_it: /* Test whether we may genocide all monsters with symbol ch */ monstersym(ch) /* arnold@ucsfcgl */ -register char ch; +char ch; { - register struct permonst *mp; + struct permonst *mp; extern struct permonst pm_eel; /* diff --git a/games/hack/hack.rip.c b/games/hack/hack.rip.c index f9d4a4a..843d3cc 100644 --- a/games/hack/hack.rip.c +++ b/games/hack/hack.rip.c @@ -26,10 +26,10 @@ static char *rip[] = { }; outrip(){ - register char **dp = rip; - register char *dpx; + char **dp = rip; + char *dpx; char buf[BUFSZ]; - register x,y; + x,y; cls(); (void) strcpy(buf, plname); @@ -44,7 +44,7 @@ outrip(){ center(8, buf); (void) strcpy(buf, killer); if(strlen(buf) > 16) { - register int i,i0,i1; + int i,i0,i1; i0 = i1 = 0; for(i = 0; i <= 16; i++) if(buf[i] == ' ') i0 = i, i1 = i+1; @@ -75,7 +75,7 @@ outrip(){ } center(line, text) int line; char *text; { -register char *ip,*op; +char *ip,*op; ip = text; op = &rip[line][28 - ((strlen(text)+1)/2)]; while(*ip) *op++ = *ip++; diff --git a/games/hack/hack.rumors.c b/games/hack/hack.rumors.c index 2a3d5ca..6d63ee5 100644 --- a/games/hack/hack.rumors.c +++ b/games/hack/hack.rumors.c @@ -11,8 +11,8 @@ int n_rumors = 0; int n_used_rumors = -1; char *usedbits; -init_rumors(rumf) register FILE *rumf; { -register int i; +init_rumors(rumf) FILE *rumf; { +int i; n_used_rumors = 0; while(skipline(rumf)) n_rumors++; rewind(rumf); @@ -21,7 +21,7 @@ register int i; for( ; i>=0; i--) usedbits[i] = 0; } -skipline(rumf) register FILE *rumf; { +skipline(rumf) FILE *rumf; { char line[COLNO]; while(1) { if(!fgets(line, sizeof(line), rumf)) return(0); @@ -29,9 +29,9 @@ char line[COLNO]; } } -outline(rumf) register FILE *rumf; { +outline(rumf) FILE *rumf; { char line[COLNO]; -register char *ep; +char *ep; if(!fgets(line, sizeof(line), rumf)) return; if((ep = index(line, '\n')) != 0) *ep = 0; pline("This cookie has a scrap of paper inside! It reads: "); @@ -39,8 +39,8 @@ register char *ep; } outrumor(){ -register int rn,i; -register FILE *rumf; +int rn,i; +FILE *rumf; if(n_rumors <= n_used_rumors || (rumf = fopen(RUMORFILE, "r")) == (FILE *) 0) return; if(n_used_rumors < 0) init_rumors(rumf); @@ -59,6 +59,6 @@ none: (void) fclose(rumf); } -used(i) register int i; { +used(i) int i; { return(usedbits[i/CHARSZ] & (1 << (i % CHARSZ))); } diff --git a/games/hack/hack.save.c b/games/hack/hack.save.c index d6b3e37..9f13c99 100644 --- a/games/hack/hack.save.c +++ b/games/hack/hack.save.c @@ -32,8 +32,8 @@ hangup(){ /* returns 1 if save successful */ dosave0(hu) int hu; { - register fd, ofd; - int tmp; /* not register ! */ + fd, ofd; + int tmp; /* not ! */ (void) signal(SIGHUP, SIG_IGN); (void) signal(SIGINT, SIG_IGN); @@ -89,10 +89,10 @@ dosave0(hu) int hu; { } dorecover(fd) -register fd; +fd; { - register nfd; - int tmp; /* not a register ! */ + nfd; + int tmp; /* not a ! */ unsigned mid; /* idem */ struct obj *otmp; extern boolean restoring; @@ -154,7 +154,7 @@ register fd; } } if(u.ustuck) { - register struct monst *mtmp; + struct monst *mtmp; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) if(mtmp->m_id == mid) goto monfnd; @@ -172,10 +172,10 @@ register fd; struct obj * restobjchn(fd) -register fd; +fd; { - register struct obj *otmp, *otmp2; - register struct obj *first = 0; + struct obj *otmp, *otmp2; + struct obj *first = 0; int xl; #ifdef lint /* suppress "used before set" warning from lint */ @@ -200,10 +200,10 @@ register fd; struct monst * restmonchn(fd) -register fd; +fd; { - register struct monst *mtmp, *mtmp2; - register struct monst *first = 0; + struct monst *mtmp, *mtmp2; + struct monst *first = 0; int xl; struct permonst *monbegin; diff --git a/games/hack/hack.search.c b/games/hack/hack.search.c index fcb0a85..8476c88 100644 --- a/games/hack/hack.search.c +++ b/games/hack/hack.search.c @@ -9,9 +9,9 @@ extern struct monst *makemon(); findit() /* returns number of things found */ { int num; - register xchar zx,zy; - register struct trap *ttmp; - register struct monst *mtmp; + xchar zx,zy; + struct trap *ttmp; + struct monst *mtmp; xchar lx,hx,ly,hy; if(u.uswallow) return(0); @@ -51,9 +51,9 @@ findit() /* returns number of things found */ dosearch() { - register xchar x,y; - register struct trap *trap; - register struct monst *mtmp; + xchar x,y; + struct trap *trap; + struct monst *mtmp; if(u.uswallow) pline("What are you looking for? The exit?"); @@ -98,8 +98,8 @@ dosearch() } doidtrap() { -register struct trap *trap; -register int x,y; +struct trap *trap; +int x,y; if(!getdir(1)) return(0); x = u.ux + u.dx; y = u.uy + u.dy; @@ -116,7 +116,7 @@ register int x,y; } wakeup(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { mtmp->msleep = 0; setmangry(mtmp); @@ -125,7 +125,7 @@ register struct monst *mtmp; /* NOTE: we must check if(mtmp->mimic) before calling this routine */ seemimic(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { mtmp->mimic = 0; mtmp->mappearance = 0; diff --git a/games/hack/hack.shk.c b/games/hack/hack.shk.c index cb9fb5e..a648761 100644 --- a/games/hack/hack.shk.c +++ b/games/hack/hack.shk.c @@ -7,7 +7,7 @@ int shlevel = 0; struct monst *shopkeeper = 0; struct obj *billobjs = 0; -obfree(obj,merge) register struct obj *obj, *merge; { +obfree(obj,merge) struct obj *obj, *merge; { free((char *) obj); } inshop(){ return(0); } @@ -65,7 +65,7 @@ static char *shopnam[] = { char * shkname(mtmp) /* called in do_name.c */ -register struct monst *mtmp; +struct monst *mtmp; { return(ESHK(mtmp)->shknam); } @@ -73,9 +73,9 @@ register struct monst *mtmp; static void setpaid(); shkdead(mtmp) /* called in mon.c */ -register struct monst *mtmp; +struct monst *mtmp; { - register struct eshk *eshk = ESHK(mtmp); + struct eshk *eshk = ESHK(mtmp); if(eshk->shoplevel == dlevel) rooms[eshk->shoproom].rtype = 0; @@ -87,7 +87,7 @@ register struct monst *mtmp; } replshk(mtmp,mtmp2) -register struct monst *mtmp, *mtmp2; +struct monst *mtmp, *mtmp2; { if(mtmp == shopkeeper) { shopkeeper = mtmp2; @@ -98,8 +98,8 @@ register struct monst *mtmp, *mtmp2; static void setpaid(){ /* caller has checked that shopkeeper exists */ /* either we paid or left the shop or he just died */ -register struct obj *obj; -register struct monst *mtmp; +struct obj *obj; +struct monst *mtmp; for(obj = invent; obj; obj = obj->nobj) obj->unpaid = 0; for(obj = fobj; obj; obj = obj->nobj) @@ -122,8 +122,8 @@ register struct monst *mtmp; static addupbill(){ /* delivers result in total */ /* caller has checked that shopkeeper exists */ -register ct = ESHK(shopkeeper)->billct; -register struct bill_x *bp = bill; +ct = ESHK(shopkeeper)->billct; +struct bill_x *bp = bill; total = 0; while(ct--){ total += bp->price * bp->bquan; @@ -132,7 +132,7 @@ register struct bill_x *bp = bill; } inshop(){ -register roomno = inroom(u.ux,u.uy); +roomno = inroom(u.ux,u.uy); static void findshk(); @@ -161,8 +161,8 @@ register roomno = inroom(u.ux,u.uy); /* Did we just enter a zoo of some kind? */ if(roomno >= 0) { - register int rt = rooms[roomno].rtype; - register struct monst *mtmp; + int rt = rooms[roomno].rtype; + struct monst *mtmp; if(rt == ZOO) { pline("Welcome to David's treasure zoo!"); } else @@ -230,9 +230,9 @@ register roomno = inroom(u.ux,u.uy); static void findshk(roomno) -register roomno; +roomno; { -register struct monst *mtmp; +struct monst *mtmp; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) if(mtmp->isshk && ESHK(mtmp)->shoproom == roomno && ESHK(mtmp)->shoplevel == dlevel) { @@ -252,8 +252,8 @@ register struct monst *mtmp; } static struct bill_x * -onbill(obj) register struct obj *obj; { -register struct bill_x *bp; +onbill(obj) struct obj *obj; { +struct bill_x *bp; if(!shopkeeper) return(0); for(bp = bill; bp < &bill[ESHK(shopkeeper)->billct]; bp++) if(bp->bo_id == obj->o_id) { @@ -265,9 +265,9 @@ register struct bill_x *bp; } /* called with two args on merge */ -obfree(obj,merge) register struct obj *obj, *merge; { -register struct bill_x *bp = onbill(obj); -register struct bill_x *bpm; +obfree(obj,merge) struct obj *obj, *merge; { +struct bill_x *bp = onbill(obj); +struct bill_x *bpm; if(bp) { if(!merge){ bp->useup = 1; @@ -294,7 +294,7 @@ register struct bill_x *bpm; static pay(tmp,shkp) long tmp; -register struct monst *shkp; +struct monst *shkp; { long robbed = ESHK(shkp)->robbed; @@ -310,8 +310,8 @@ register struct monst *shkp; dopay(){ long ltmp; -register struct bill_x *bp; -register struct monst *shkp; +struct bill_x *bp; +struct monst *shkp; int pass, tmp; static int dopayobj(); @@ -427,8 +427,8 @@ int pass, tmp; /* 0 if not enough money */ /* -1 if object could not be found (but was paid) */ static -dopayobj(bp) register struct bill_x *bp; { -register struct obj *obj; +dopayobj(bp) struct bill_x *bp; { +struct obj *obj; long ltmp; /* find the object on one of the lists */ @@ -457,7 +457,7 @@ long ltmp; pline("You bought %s for %ld gold piece%s.", doname(obj), ltmp, plur(ltmp)); if(bp->useup) { - register struct obj *otmp = billobjs; + struct obj *otmp = billobjs; if(obj == billobjs) billobjs = obj->nobj; else { @@ -492,11 +492,11 @@ paybill(){ /* find obj on one of the lists */ struct obj * bp_to_obj(bp) -register struct bill_x *bp; +struct bill_x *bp; { - register struct obj *obj; - register struct monst *mtmp; - register unsigned id = bp->bo_id; + struct obj *obj; + struct monst *mtmp; + unsigned id = bp->bo_id; if(bp->useup) obj = o_on(id, billobjs); @@ -516,8 +516,8 @@ register struct bill_x *bp; static int getprice(); /* called in hack.c when we pickup an object */ -addtobill(obj) register struct obj *obj; { -register struct bill_x *bp; +addtobill(obj) struct obj *obj; { +struct bill_x *bp; if(!inshop() || (u.ux == ESHK(shopkeeper)->shk.x && u.uy == ESHK(shopkeeper)->shk.y) || (u.ux == ESHK(shopkeeper)->shd.x && u.uy == ESHK(shopkeeper)->shd.y) || @@ -536,10 +536,10 @@ register struct bill_x *bp; obj->unpaid = 1; } -splitbill(obj,otmp) register struct obj *obj, *otmp; { +splitbill(obj,otmp) struct obj *obj, *otmp; { /* otmp has been split off from obj */ -register struct bill_x *bp; -register int tmp; +struct bill_x *bp; +int tmp; bp = onbill(obj); if(!bp) { impossible("splitbill: not on bill?"); @@ -566,11 +566,11 @@ register int tmp; } } -subfrombill(obj) register struct obj *obj; { +subfrombill(obj) struct obj *obj; { long ltmp; -register int tmp; -register struct obj *otmp; -register struct bill_x *bp; +int tmp; +struct obj *otmp; +struct bill_x *bp; if(!inshop() || (u.ux == ESHK(shopkeeper)->shk.x && u.uy == ESHK(shopkeeper)->shk.y) || (u.ux == ESHK(shopkeeper)->shd.x && u.uy == ESHK(shopkeeper)->shd.y)) return; @@ -632,13 +632,13 @@ pline("Thank you for your contribution to restock this recently plundered shop." doinvbill(mode) int mode; /* 0: deliver count 1: paged */ { - register struct bill_x *bp; - register struct obj *obj; + struct bill_x *bp; + struct obj *obj; long totused, thisused; char buf[BUFSZ]; if(mode == 0) { - register int cnt = 0; + int cnt = 0; if(shopkeeper) for(bp = bill; bp - bill < ESHK(shopkeeper)->billct; bp++) @@ -665,7 +665,7 @@ int mode; /* 0: deliver count 1: paged */ goto quit; } if(bp->useup || bp->bquan > obj->quan) { - register int cnt, oquan, uquan; + int cnt, oquan, uquan; oquan = obj->quan; uquan = (bp->useup ? bp->bquan : bp->bquan - oquan); @@ -693,8 +693,8 @@ quit: } static -getprice(obj) register struct obj *obj; { -register int tmp, ac; +getprice(obj) struct obj *obj; { +int tmp, ac; static int realhunger(); switch(obj->olet){ @@ -753,8 +753,8 @@ register int tmp, ac; static realhunger(){ /* not completely foolproof */ -register tmp = u.uhunger; -register struct obj *otmp = invent; +tmp = u.uhunger; +struct obj *otmp = invent; while(otmp){ if(otmp->olet == FOOD_SYM && !otmp->unpaid) tmp += objects[otmp->otyp].nutrition; @@ -764,9 +764,9 @@ register struct obj *otmp = invent; } shkcatch(obj) -register struct obj *obj; +struct obj *obj; { - register struct monst *shkp = shopkeeper; + struct monst *shkp = shopkeeper; if(u.uinshop && shkp && !shkp->mfroz && !shkp->msleep && u.dx && u.dy && @@ -785,13 +785,13 @@ register struct obj *obj; * shk_move: return 1: he moved 0: he didnt -1: let m_move do it */ shk_move(shkp) -register struct monst *shkp; +struct monst *shkp; { - register struct monst *mtmp; - register struct permonst *mdat = shkp->data; - register xchar gx,gy,omx,omy,nx,ny,nix,niy; - register schar appr,i; - register int udist; + struct monst *mtmp; + struct permonst *mdat = shkp->data; + xchar gx,gy,omx,omy,nx,ny,nix,niy; + schar appr,i; + int udist; int z; schar shkroom,chi,chcnt,cnt; boolean uondoor, satdoor, avoid, badinv; @@ -903,7 +903,7 @@ register struct monst *shkp; || ESHK(shkp)->following) { #ifdef STUPID /* cater for stupid compilers */ - register int zz; + int zz; #endif STUPID if(uondoor && (ib = sobj_at(ICE_BOX, nx, ny))) { nix = nx; niy = ny; chi = i; break; @@ -947,7 +947,7 @@ register struct monst *shkp; /* He is digging in the shop. */ shopdig(fall) -register int fall; +int fall; { if(!fall) { if(u.utraptype == TT_PIT) @@ -955,7 +955,7 @@ register int fall; else pline("\"Please, do not damage the floor here.\""); } else if(dist(shopkeeper->mx, shopkeeper->my) < 3) { - register struct obj *obj, *obj2; + struct obj *obj, *obj2; pline("%s grabs your backpack!", shkname(shopkeeper)); for(obj = invent; obj; obj = obj2) { @@ -978,7 +978,7 @@ online(x,y) { /* Does this monster follow me downstairs? */ follower(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { return( mtmp->mtame || index("1TVWZi&, ", mtmp->data->mlet) #ifndef QUEST diff --git a/games/hack/hack.shknam.c b/games/hack/hack.shknam.c index b0a015a..f3bf8f0 100644 --- a/games/hack/hack.shknam.c +++ b/games/hack/hack.shknam.c @@ -125,9 +125,9 @@ struct shk_nx { }; findname(nampt, let) char *nampt; char let; { -register struct shk_nx *p = shk_nx; -register char **q; -register int i; +struct shk_nx *p = shk_nx; +char **q; +int i; while(p->x && p->x != let) p++; q = p->xn; for(i=0; i<dlevel; i++) if(!q[i]){ diff --git a/games/hack/hack.steal.c b/games/hack/hack.steal.c index 232863d..e6a2a1a 100644 --- a/games/hack/hack.steal.c +++ b/games/hack/hack.steal.c @@ -10,9 +10,9 @@ somegold(){ (u.ugold > 10000) ? rnd(10000) : rnd((int) u.ugold) ); } -stealgold(mtmp) register struct monst *mtmp; { -register struct gold *gold = g_at(u.ux, u.uy); -register long tmp; +stealgold(mtmp) struct monst *mtmp; { +struct gold *gold = g_at(u.ux, u.uy); +long tmp; if(gold && ( !u.ugold || gold->amount > u.ugold || !rn2(5))) { mtmp->mgold += gold->amount; freegold(gold); @@ -37,8 +37,8 @@ register long tmp; unsigned stealoid; /* object to be stolen */ unsigned stealmid; /* monster doing the stealing */ stealarm(){ - register struct monst *mtmp; - register struct obj *otmp; + struct monst *mtmp; + struct obj *otmp; for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp->o_id == stealoid) { @@ -64,9 +64,9 @@ stealarm(){ steal(mtmp) struct monst *mtmp; { - register struct obj *otmp; - register tmp; - register named = 0; + struct obj *otmp; + tmp; + named = 0; if(!invent){ if(Blind) @@ -150,17 +150,17 @@ struct monst *mtmp; } mpickobj(mtmp,otmp) -register struct monst *mtmp; -register struct obj *otmp; +struct monst *mtmp; +struct obj *otmp; { otmp->nobj = mtmp->minvent; mtmp->minvent = otmp; } stealamulet(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { - register struct obj *otmp; + struct obj *otmp; for(otmp = invent; otmp; otmp = otmp->nobj) { if(otmp->olet == AMULET_SYM) { @@ -177,10 +177,10 @@ register struct monst *mtmp; /* release the objects the killed animal has stolen */ relobj(mtmp,show) -register struct monst *mtmp; -register show; +struct monst *mtmp; +show; { - register struct obj *otmp, *otmp2; + struct obj *otmp, *otmp2; for(otmp = mtmp->minvent; otmp; otmp = otmp2){ otmp->ox = mtmp->mx; @@ -194,7 +194,7 @@ register show; } mtmp->minvent = (struct obj *) 0; if(mtmp->mgold || mtmp->data->mlet == 'L') { - register long tmp; + long tmp; tmp = (mtmp->mgold > 10000) ? 10000 : mtmp->mgold; mkgold((long)(tmp + d(dlevel,30)), mtmp->mx, mtmp->my); diff --git a/games/hack/hack.termcap.c b/games/hack/hack.termcap.c index ce11e82..586f56f 100644 --- a/games/hack/hack.termcap.c +++ b/games/hack/hack.termcap.c @@ -20,8 +20,8 @@ int CO, LI; /* used in pri.c and whatis.c */ startup() { - register char *term; - register char *tptr; + char *term; + char *tptr; char *tbufptr, *pc; tptr = (char *) alloc(1024); @@ -92,7 +92,7 @@ end_screen() extern xchar curx, cury; curs(x, y) -register int x, y; /* not xchar: perhaps xchar is unsigned and +int x, y; /* not xchar: perhaps xchar is unsigned and curx-x would be unsigned as well */ { @@ -160,7 +160,7 @@ nocmov(x, y) } cmov(x, y) -register x, y; +x, y; { xputs(tgoto(CM, x-1, y-1)); cury = y; @@ -181,7 +181,7 @@ cl_end() { else { /* no-CE fix - free after Harold Rynes */ /* this looks terrible, especially on a slow terminal but is better than nothing */ - register cx = curx, cy = cury; + cx = curx, cy = cury; while(curx < COLNO) { xputc(' '); @@ -250,8 +250,8 @@ delay_output() { } else if(ospeed > 0 || ospeed < SIZE(tmspc10)) if(CM) { /* delay by sending cm(here) an appropriate number of times */ - register int cmlen = strlen(tgoto(CM, curx-1, cury-1)); - register int i = 500 + tmspc10[ospeed]/2; + int cmlen = strlen(tgoto(CM, curx-1, cury-1)); + int i = 500 + tmspc10[ospeed]/2; while(i > 0) { cmov(curx, cury); @@ -267,7 +267,7 @@ cl_eos() /* free after Robert Viduya */ if(CD) xputs(CD); else { - register int cx = curx, cy = cury; + int cx = curx, cy = cury; while(cury <= LI-2) { cl_end(); xputc('\n'); diff --git a/games/hack/hack.timeout.c b/games/hack/hack.timeout.c index ea0cc82..f23febf 100644 --- a/games/hack/hack.timeout.c +++ b/games/hack/hack.timeout.c @@ -5,7 +5,7 @@ #include "hack.h" timeout(){ -register struct prop *upp; +struct prop *upp; if(Stoned) stoned_dialogue(); for(upp = u.uprops; upp < u.uprops+SIZE(u.uprops); upp++) if((upp->p_flgs & TIMEOUT) && !--upp->p_flgs) { @@ -52,7 +52,7 @@ char *stoned_texts[] = { stoned_dialogue() { - register long i = (Stoned & TIMEOUT); + long i = (Stoned & TIMEOUT); if(i > 0 && i <= SIZE(stoned_texts)) pline(stoned_texts[SIZE(stoned_texts) - i]); diff --git a/games/hack/hack.topl.c b/games/hack/hack.topl.c index 2817359..739b2ce 100644 --- a/games/hack/hack.topl.c +++ b/games/hack/hack.topl.c @@ -41,8 +41,8 @@ redotoplin() { } remember_topl() { -register struct topl *tl; -register int cnt = OTLMAX; +struct topl *tl; +int cnt = OTLMAX; if(last_redone_topl && !strcmp(toplines, last_redone_topl->topl_text)) return; if(old_toplines && @@ -101,7 +101,7 @@ more(){ } cmore(s) -register char *s; +char *s; { xmore(s); } @@ -118,11 +118,11 @@ clrlin(){ /*VARARGS1*/ pline(line,arg1,arg2,arg3,arg4,arg5,arg6) -register char *line,*arg1,*arg2,*arg3,*arg4,*arg5,*arg6; +char *line,*arg1,*arg2,*arg3,*arg4,*arg5,*arg6; { char pbuf[BUFSZ]; - register char *bp = pbuf, *tl; - register int n,n0; + char *bp = pbuf, *tl; + int n,n0; if(!line || !*line) return; if(!index(line, '%')) (void) strcpy(pbuf,line); else @@ -188,6 +188,6 @@ putsym(c) char c; { (void) putchar(c); } -putstr(s) register char *s; { +putstr(s) char *s; { while(*s) putsym(*s++); } diff --git a/games/hack/hack.track.c b/games/hack/hack.track.c index bb6564a..92d4890 100644 --- a/games/hack/hack.track.c +++ b/games/hack/hack.track.c @@ -24,8 +24,8 @@ settrack(){ } coord * -gettrack(x,y) register x,y; { -register int i,cnt,dist; +gettrack(x,y) x,y; { +int i,cnt,dist; coord tc; cnt = utcnt; for(i = utpnt-1; cnt--; i--){ diff --git a/games/hack/hack.trap.c b/games/hack/hack.trap.c index d8a89c7..502773d 100644 --- a/games/hack/hack.trap.c +++ b/games/hack/hack.trap.c @@ -22,9 +22,9 @@ char *traps[] = { struct trap * maketrap(x,y,typ) -register x,y,typ; +x,y,typ; { - register struct trap *ttmp; + struct trap *ttmp; ttmp = newtrap(); ttmp->ttyp = typ; @@ -37,8 +37,8 @@ register x,y,typ; return(ttmp); } -dotrap(trap) register struct trap *trap; { - register int ttype = trap->ttyp; +dotrap(trap) struct trap *trap; { + int ttype = trap->ttyp; nomul(0); if(trap->tseen && !rn2(5) && ttype != PIT) @@ -86,7 +86,7 @@ if(uarmh) pline("Fortunately, you are wearing a helmet!"); stackobj(fobj); if(Invisible) newsym(u.ux, u.uy); } else { - register int newlevel = dlevel + 1; + int newlevel = dlevel + 1; while(!rn2(4) && newlevel < 29) newlevel++; pline("A trap door opens up under you!"); @@ -136,16 +136,16 @@ if(uarmh) pline("Fortunately, you are wearing a helmet!"); } } -mintrap(mtmp) register struct monst *mtmp; { - register struct trap *trap = t_at(mtmp->mx, mtmp->my); - register int wasintrap = mtmp->mtrapped; +mintrap(mtmp) struct monst *mtmp; { + struct trap *trap = t_at(mtmp->mx, mtmp->my); + int wasintrap = mtmp->mtrapped; if(!trap) { mtmp->mtrapped = 0; /* perhaps teleported? */ } else if(wasintrap) { if(!rn2(40)) mtmp->mtrapped = 0; } else { - register int tt = trap->ttyp; + int tt = trap->ttyp; int in_sight = cansee(mtmp->mx,mtmp->my); extern char mlarge[]; @@ -248,7 +248,7 @@ float_up(){ } float_down(){ - register struct trap *trap; + struct trap *trap; pline("You float gently to the ground."); if(trap = t_at(u.ux,u.uy)) switch(trap->ttyp) { @@ -265,10 +265,10 @@ float_down(){ vtele() { #include "def.mkroom.h" - register struct mkroom *croom; + struct mkroom *croom; for(croom = &rooms[0]; croom->hx >= 0; croom++) if(croom->rtype == VAULT) { - register x,y; + x,y; x = rn2(2) ? croom->lx : croom->hx; y = rn2(2) ? croom->ly : croom->hy; @@ -283,7 +283,7 @@ vtele() { tele() { extern coord getpos(); coord cc; - register int nux,nuy; + int nux,nuy; if(Teleport_control) { pline("To what position do you want to be teleported?"); @@ -304,7 +304,7 @@ tele() { } teleds(nux, nuy) -register int nux,nuy; +int nux,nuy; { if(Punished) unplacebc(); unsee(); @@ -326,7 +326,7 @@ register int nux,nuy; if(!Blind) read_engr_at(u.ux,u.uy); } -teleok(x,y) register int x,y; { /* might throw him into a POOL */ +teleok(x,y) int x,y; { /* might throw him into a POOL */ return( isok(x,y) && !IS_ROCK(levl[x][y].typ) && !m_at(x,y) && !sobj_at(ENORMOUS_ROCK,x,y) && !t_at(x,y) ); @@ -381,7 +381,7 @@ unplacebc(){ } level_tele() { -register int newlevel; +int newlevel; if(Teleport_control) { char buf[BUFSZ]; @@ -432,7 +432,7 @@ drown() pline("You can't swim!"); if(rn2(3) < u.uluck+2) { /* most scrolls become unreadable */ - register struct obj *obj; + struct obj *obj; for(obj = invent; obj; obj = obj->nobj) if(obj->olet == SCROLL_SYM && rn2(12) > u.uluck) diff --git a/games/hack/hack.tty.c b/games/hack/hack.tty.c index d0b3b58..671def6 100644 --- a/games/hack/hack.tty.c +++ b/games/hack/hack.tty.c @@ -149,9 +149,9 @@ setctty(){ setftty(){ -register int ef = 0; /* desired value of flags & ECHO */ -register int cf = CBRKON(CBRKMASK); /* desired value of flags & CBREAK */ -register int change = 0; +int ef = 0; /* desired value of flags & ECHO */ +int cf = CBRKON(CBRKMASK); /* desired value of flags & CBREAK */ +int change = 0; flags.cbreak = ON; flags.echo = OFF; /* Should use (ECHO|CRMOD) here instead of ECHO */ @@ -194,10 +194,10 @@ error(s,x,y) char *s; { * resulting string is "\033". */ getlin(bufp) -register char *bufp; +char *bufp; { - register char *obufp = bufp; - register int c; + char *obufp = bufp; + int c; flags.toplin = 2; /* nonempty, no --More-- required */ for(;;) { @@ -243,7 +243,7 @@ getret() { } cgetret(s) -register char *s; +char *s; { putsym('\n'); if(flags.standout) @@ -259,9 +259,9 @@ register char *s; char morc; /* tell the outside world what char he used */ xwaitforspace(s) -register char *s; /* chars allowed besides space or return */ +char *s; /* chars allowed besides space or return */ { -register int c; +int c; morc = 0; @@ -281,7 +281,7 @@ char * parse() { static char inputline[COLNO]; - register foo; + foo; flags.move = 1; if(!Invisible) curs_on_u(); else home(); @@ -310,7 +310,7 @@ parse() char readchar() { - register int sym; + int sym; (void) fflush(stdout); if((sym = getchar()) == EOF) @@ -320,7 +320,7 @@ readchar() { * (?like when one hits break or for interrupted systemcalls?), * and we must see several before we quit. */ - register int cnt = NR_OF_EOFS; + int cnt = NR_OF_EOFS; while (cnt--) { clearerr(stdin); /* omit if clearerr is undefined */ if((sym = getchar()) != EOF) goto noteof; diff --git a/games/hack/hack.u_init.c b/games/hack/hack.u_init.c index 913aef3..e3900af 100644 --- a/games/hack/hack.u_init.c +++ b/games/hack/hack.u_init.c @@ -95,7 +95,7 @@ struct trobj Wizard[] = { }; u_init(){ -register int i; +int i; char exper = 'y', pc; extern char readchar(); if(flags.female) /* should have been set in HACKOPTIONS */ @@ -237,7 +237,7 @@ got_suffix: } find_ac(); if(!rn2(20)) { - register int d = rn2(7) - 2; /* biased variation */ + int d = rn2(7) - 2; /* biased variation */ u.ustr += d; u.ustrmax += d; } @@ -251,8 +251,8 @@ got_suffix: u.ustr++, u.ustrmax++; } -ini_inv(trop) register struct trobj *trop; { -register struct obj *obj; +ini_inv(trop) struct trobj *trop; { +struct obj *obj; extern struct obj *mkobj(); while(trop->trolet) { obj = mkobj(trop->trolet); @@ -308,9 +308,9 @@ extern struct obj *mkobj(); #ifdef WIZARD wiz_inv(){ -register struct trobj *trop = &Extra_objs[0]; -register char *ep = getenv("INVENT"); -register int type; +struct trobj *trop = &Extra_objs[0]; +char *ep = getenv("INVENT"); +int type; while(ep && *ep) { type = atoi(ep); ep = index(ep, ','); @@ -334,7 +334,7 @@ register int type; #endif WIZARD plnamesuffix() { -register char *p; +char *p; if(p = rindex(plname, '-')) { *p = 0; pl_character[0] = p[1]; @@ -350,7 +350,7 @@ role_index(pc) char pc; { /* must be called only from u_init() */ /* so that rolesyms[] is defined */ - register char *cp; + char *cp; if(cp = index(rolesyms, pc)) return(cp - rolesyms); diff --git a/games/hack/hack.unix.c b/games/hack/hack.unix.c index 8781744..e8ddfca 100644 --- a/games/hack/hack.unix.c +++ b/games/hack/hack.unix.c @@ -46,7 +46,7 @@ char * getdate() { static char datestr[7]; - register struct tm *lt = getlt(); + struct tm *lt = getlt(); (void) snprintf(datestr, sizeof(datestr), "%02d%02d%02d", lt->tm_year % 100, lt->tm_mon + 1, lt->tm_mday); @@ -56,8 +56,8 @@ getdate() phase_of_the_moon() /* 0-7, with 0: new, 4: full */ { /* moon period: 29.5306 days */ /* year: 365.2422 days */ - register struct tm *lt = getlt(); - register int epact, diy, golden; + struct tm *lt = getlt(); + int epact, diy, golden; diy = lt->tm_yday; golden = (lt->tm_year % 19) + 1; @@ -70,7 +70,7 @@ phase_of_the_moon() /* 0-7, with 0: new, 4: full */ night() { - register int hour = getlt()->tm_hour; + int hour = getlt()->tm_hour; return(hour < 6 || hour > 21); } @@ -84,7 +84,7 @@ struct stat buf, hbuf; gethdate(name) char *name; { /* old version - for people short of space */ -register char *np; +char *np; name = "/usr/games/hide/hack"; if(stat(name, &hbuf)) @@ -101,7 +101,7 @@ register char *np; */ #define MAXPATHLEN 1024 -register char *np, *path; +char *np, *path; char filename[MAXPATHLEN+1]; if (index(name, '/') != NULL || (path = getenv("PATH")) == NULL) path = ""; @@ -141,7 +141,7 @@ uptodate(fd) { /* see whether we should throw away this xlock file */ veryold(fd) { - register int i; + int i; time_t date; if(fstat(fd, &buf)) return(0); /* cannot get status */ @@ -175,13 +175,13 @@ veryold(fd) { getlock() { extern int errno, hackpid, locknum; - register int i = 0, fd; + int i = 0, fd; (void) fflush(stdout); /* we ignore QUIT and INT at this point */ if (link(HLOCK, LLOCK) == -1) { - register int errnosv = errno; + int errnosv = errno; perror(HLOCK); printf("Cannot link %s to %s\n", LLOCK, HLOCK); @@ -316,8 +316,8 @@ ckmailstatus() { newmail() { /* produce a scroll of mail */ - register struct obj *obj; - register struct monst *md; + struct obj *obj; + struct monst *md; extern char plname[]; extern struct obj *mksobj(), *addinv(); extern struct monst *makemon(); @@ -344,14 +344,14 @@ newmail() { /* make md run through the cave */ mdrush(md,away) -register struct monst *md; +struct monst *md; boolean away; { - register int uroom = inroom(u.ux, u.uy); + int uroom = inroom(u.ux, u.uy); if(uroom >= 0) { - register int tmp = rooms[uroom].fdoor; - register int cnt = rooms[uroom].doorct; - register int fx = u.ux, fy = u.uy; + int tmp = rooms[uroom].fdoor; + int cnt = rooms[uroom].doorct; + int fx = u.ux, fy = u.uy; while(cnt--) { if(dist(fx,fy) < dist(doors[tmp].x, doors[tmp].y)){ fx = doors[tmp].x; @@ -366,7 +366,7 @@ boolean away; tmp = fy; fy = md->my; md->my = tmp; } while(fx != md->mx || fy != md->my) { - register int dx,dy,nfx = fx,nfy = fy,d1,d2; + int dx,dy,nfx = fx,nfy = fy,d1,d2; tmp_at(fx,fy); d1 = DIST(fx,fy,md->mx,md->my); @@ -398,7 +398,7 @@ boolean away; readmail() { #ifdef DEF_MAILREADER /* This implies that UNIX is defined */ - register char *mr = 0; + char *mr = 0; more(); if(!(mr = getenv("MAILREADER"))) mr = DEF_MAILREADER; @@ -416,9 +416,9 @@ readmail() { #endif MAIL regularize(s) /* normalize file name - we don't like ..'s or /'s */ -register char *s; +char *s; { - register char *lp; + char *lp; while((lp = index(s, '.')) || (lp = index(s, '/'))) *lp = '_'; diff --git a/games/hack/hack.vault.c b/games/hack/hack.vault.c index a436903..5bce18d 100644 --- a/games/hack/hack.vault.c +++ b/games/hack/hack.vault.c @@ -37,8 +37,8 @@ static int gdlevel; static restfakecorr() { - register fcx,fcy,fcbeg; - register struct rm *crm; + fcx,fcy,fcbeg; + struct rm *crm; while((fcbeg = EGD->fcbeg) < EGD->fcend) { fcx = EGD->fakecorr[fcbeg].fx; @@ -60,7 +60,7 @@ restfakecorr() static goldincorridor() { - register int fci; + int fci; for(fci = EGD->fcbeg; fci < EGD->fcend; fci++) if(g_at(EGD->fakecorr[fci].fx, EGD->fakecorr[fci].fy)) @@ -69,7 +69,7 @@ goldincorridor() } setgd(){ -register struct monst *mtmp; +struct monst *mtmp; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) if(mtmp->isgd){ guard = mtmp; gdlevel = dlevel; @@ -79,14 +79,14 @@ register struct monst *mtmp; } invault(){ -register tmp = inroom(u.ux, u.uy); +tmp = inroom(u.ux, u.uy); if(tmp < 0 || rooms[tmp].rtype != VAULT) { u.uinvault = 0; return; } if(++u.uinvault % 50 == 0 && (!guard || gdlevel != dlevel)) { char buf[BUFSZ]; - register x,y,dd,gx,gy; + x,y,dd,gx,gy; /* first find the goal for the guard */ for(dd = 1; (dd < ROWNO || dd < COLNO); dd++) { @@ -109,7 +109,7 @@ fnd: /* next find a good place for a door in the wall */ x = u.ux; y = u.uy; while(levl[x][y].typ == ROOM) { - register int dx,dy; + int dx,dy; dx = (gx > x) ? 1 : (gx < x) ? -1 : 0; dy = (gy > y) ? 1 : (gy < y) ? -1 : 0; @@ -163,9 +163,9 @@ fnd: } gd_move(){ -register int x,y,dx,dy,gx,gy,nx,ny,typ; -register struct fakecorridor *fcp; -register struct rm *crm; +int x,y,dx,dy,gx,gy,nx,ny,typ; +struct fakecorridor *fcp; +struct rm *crm; if(!guard || gdlevel != dlevel){ impossible("Where is the guard?"); return(2); /* died */ @@ -183,7 +183,7 @@ register struct rm *crm; if(nx == x || ny == y) if(nx != x || ny != y) if(isok(nx,ny)) if(!IS_WALL(typ = (crm = &levl[nx][ny])->typ) && typ != POOL) { - register int i; + int i; for(i = EGD->fcbeg; i < EGD->fcend; i++) if(EGD->fakecorr[i].fx == nx && EGD->fakecorr[i].fy == ny) @@ -251,7 +251,7 @@ gddead(){ } replgd(mtmp,mtmp2) -register struct monst *mtmp, *mtmp2; +struct monst *mtmp, *mtmp2; { if(mtmp == guard) guard = mtmp2; diff --git a/games/hack/hack.wield.c b/games/hack/hack.wield.c index a23e763..751be01 100644 --- a/games/hack/hack.wield.c +++ b/games/hack/hack.wield.c @@ -5,14 +5,14 @@ #include "hack.h" extern struct obj zeroobj; -setuwep(obj) register struct obj *obj; { +setuwep(obj) struct obj *obj; { setworn(obj, W_WEP); } dowield() { - register struct obj *wep; - register int res = 0; + struct obj *wep; + int res = 0; multi = 0; if(!(wep = getobj("#-)", "wield"))) /* nothing */; @@ -56,11 +56,11 @@ corrode_weapon(){ } chwepon(otmp,amount) -register struct obj *otmp; -register amount; +struct obj *otmp; +amount; { -register char *color = (amount < 0) ? "black" : "green"; -register char *time; +char *color = (amount < 0) ? "black" : "green"; +char *time; if(!uwep || uwep->olet != WEAPON_SYM) { strange_feeling(otmp, (amount > 0) ? "Your hands twitch." diff --git a/games/hack/hack.wizard.c b/games/hack/hack.wizard.c index 8bc7f36..f4a4712 100644 --- a/games/hack/hack.wizard.c +++ b/games/hack/hack.wizard.c @@ -15,8 +15,8 @@ char wizapp[] = "@DNPTUVXcemntx"; /* If he has found the Amulet, make the wizard appear after some time */ amulet(){ - register struct obj *otmp; - register struct monst *mtmp; + struct obj *otmp; + struct monst *mtmp; if(!flags.made_amulet || !flags.no_of_wizards) return; @@ -35,7 +35,7 @@ amulet(){ } wiz_hit(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { /* if we have stolen or found the amulet, we disappear */ if(mtmp->minvent && mtmp->minvent->olet == AMULET_SYM && @@ -47,7 +47,7 @@ register struct monst *mtmp; /* if it is lying around someplace, we teleport to it */ if(!carrying(AMULET_OF_YENDOR)) { - register struct obj *otmp; + struct obj *otmp; for(otmp = fobj; otmp; otmp = otmp->nobj) if(otmp->olet == AMULET_SYM && !otmp->spe) { @@ -81,9 +81,9 @@ hithim: } inrange(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { - register schar tx,ty; + schar tx,ty; /* do nothing if cancelled (but make '1' say something) */ if(mtmp->data->mlet != '1' && mtmp->mcan) @@ -167,7 +167,7 @@ register struct monst *mtmp; aggravate() { - register struct monst *mtmp; + struct monst *mtmp; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { mtmp->msleep = 0; @@ -177,9 +177,9 @@ aggravate() } clonewiz(mtmp) -register struct monst *mtmp; +struct monst *mtmp; { - register struct monst *mtmp2; + struct monst *mtmp2; if(mtmp2 = makemon(PM_WIZARD, mtmp->mx, mtmp->my)) { flags.no_of_wizards = 2; diff --git a/games/hack/hack.worm.c b/games/hack/hack.worm.c index 784e12c..5785f6d 100644 --- a/games/hack/hack.worm.c +++ b/games/hack/hack.worm.c @@ -11,7 +11,7 @@ struct wseg *wheads[32]; long wgrowtime[32]; getwn(mtmp) struct monst *mtmp; { -register tmp; +tmp; for(tmp=1; tmp<32; tmp++) if(!wsegs[tmp]) { mtmp->wormno = tmp; return(1); @@ -21,8 +21,8 @@ register tmp; /* called to initialize a worm unless cut in half */ initworm(mtmp) struct monst *mtmp; { -register struct wseg *wtmp; -register tmp = mtmp->wormno; +struct wseg *wtmp; +tmp = mtmp->wormno; if(!tmp) return; wheads[tmp] = wsegs[tmp] = wtmp = newseg(); wgrowtime[tmp] = 0; @@ -33,8 +33,8 @@ register tmp = mtmp->wormno; } worm_move(mtmp) struct monst *mtmp; { -register struct wseg *wtmp, *whd; -register tmp = mtmp->wormno; +struct wseg *wtmp, *whd; +tmp = mtmp->wormno; wtmp = newseg(); wtmp->wx = mtmp->mx; wtmp->wy = mtmp->my; @@ -59,9 +59,9 @@ register tmp = mtmp->wormno; remseg(whd); } -worm_nomove(mtmp) register struct monst *mtmp; { -register tmp; -register struct wseg *wtmp; +worm_nomove(mtmp) struct monst *mtmp; { +tmp; +struct wseg *wtmp; tmp = mtmp->wormno; wtmp = wsegs[tmp]; if(wtmp == wheads[tmp]) return; @@ -71,9 +71,9 @@ register struct wseg *wtmp; mtmp->mhp -= 3; /* mhpmax not changed ! */ } -wormdead(mtmp) register struct monst *mtmp; { -register tmp = mtmp->wormno; -register struct wseg *wtmp, *wtmp2; +wormdead(mtmp) struct monst *mtmp; { +tmp = mtmp->wormno; +struct wseg *wtmp, *wtmp2; if(!tmp) return; mtmp->wormno = 0; for(wtmp = wsegs[tmp]; wtmp; wtmp = wtmp2){ @@ -83,16 +83,16 @@ register struct wseg *wtmp, *wtmp2; wsegs[tmp] = 0; } -wormhit(mtmp) register struct monst *mtmp; { -register tmp = mtmp->wormno; -register struct wseg *wtmp; +wormhit(mtmp) struct monst *mtmp; { +tmp = mtmp->wormno; +struct wseg *wtmp; if(!tmp) return; /* worm without tail */ for(wtmp = wsegs[tmp]; wtmp; wtmp = wtmp->nseg) (void) hitu(mtmp,1); } -wormsee(tmp) register unsigned tmp; { -register struct wseg *wtmp = wsegs[tmp]; +wormsee(tmp) unsigned tmp; { +struct wseg *wtmp = wsegs[tmp]; if(!wtmp) panic("wormsee: wtmp==0"); for(; wtmp->nseg; wtmp = wtmp->nseg) if(!cansee(wtmp->wx,wtmp->wy) && wtmp->wdispl){ @@ -101,7 +101,7 @@ register struct wseg *wtmp = wsegs[tmp]; } } -pwseg(wtmp) register struct wseg *wtmp; { +pwseg(wtmp) struct wseg *wtmp; { if(!wtmp->wdispl){ atl(wtmp->wx, wtmp->wy, '~'); wtmp->wdispl = 1; @@ -109,13 +109,13 @@ pwseg(wtmp) register struct wseg *wtmp; { } cutworm(mtmp,x,y,weptyp) -register struct monst *mtmp; -register xchar x,y; -register uchar weptyp; /* uwep->otyp or 0 */ +struct monst *mtmp; +xchar x,y; +uchar weptyp; /* uwep->otyp or 0 */ { - register struct wseg *wtmp, *wtmp2; - register struct monst *mtmp2; - register tmp,tmp2; + struct wseg *wtmp, *wtmp2; + struct monst *mtmp2; + tmp,tmp2; if(mtmp->mx == x && mtmp->my == y) return; /* hit headon */ /* cutting goes best with axe or sword */ @@ -176,7 +176,7 @@ register uchar weptyp; /* uwep->otyp or 0 */ panic("Cannot find worm segment"); } -remseg(wtmp) register struct wseg *wtmp; { +remseg(wtmp) struct wseg *wtmp; { if(wtmp->wdispl) newsym(wtmp->wx, wtmp->wy); free((char *) wtmp); diff --git a/games/hack/hack.worn.c b/games/hack/hack.worn.c index 38ffac2..f4ae772 100644 --- a/games/hack/hack.worn.c +++ b/games/hack/hack.worn.c @@ -22,11 +22,11 @@ struct worn { }; setworn(obj, mask) -register struct obj *obj; +struct obj *obj; long mask; { - register struct worn *wp; - register struct obj *oobj; + struct worn *wp; + struct obj *oobj; for(wp = worn; wp->w_mask; wp++) if(wp->w_mask & mask) { oobj = *(wp->w_obj); @@ -50,8 +50,8 @@ long mask; } /* called e.g. when obj is destroyed */ -setnotworn(obj) register struct obj *obj; { - register struct worn *wp; +setnotworn(obj) struct obj *obj; { + struct worn *wp; for(wp = worn; wp->w_mask; wp++) if(obj == *(wp->w_obj)) { diff --git a/games/hack/hack.zap.c b/games/hack/hack.zap.c index 1d32124..20f5a91 100644 --- a/games/hack/hack.zap.c +++ b/games/hack/hack.zap.c @@ -20,14 +20,14 @@ char *fl[]= { /* Routines for IMMEDIATE wands. */ /* bhitm: monster mtmp was hit by the effect of wand otmp */ bhitm(mtmp, otmp) -register struct monst *mtmp; -register struct obj *otmp; +struct monst *mtmp; +struct obj *otmp; { wakeup(mtmp); switch(otmp->otyp) { case WAN_STRIKING: if(u.uswallow || rnd(20) < 10+mtmp->data->ac) { - register int tmp = d(2,12); + int tmp = d(2,12); hit("wand", mtmp, exclam(tmp)); mtmp->mhp -= tmp; if(mtmp->mhp < 1) killed(mtmp); @@ -70,9 +70,9 @@ register struct obj *otmp; } bhito(obj, otmp) /* object obj was hit by the effect of wand otmp */ -register struct obj *obj, *otmp; /* returns TRUE if sth was done */ +struct obj *obj, *otmp; /* returns TRUE if sth was done */ { - register int res = TRUE; + int res = TRUE; if(obj == uball || obj == uchain) res = FALSE; @@ -121,7 +121,7 @@ register struct obj *obj, *otmp; /* returns TRUE if sth was done */ dozap() { - register struct obj *obj; + struct obj *obj; xchar zx,zy; obj = getobj("/", "zap"); @@ -140,7 +140,7 @@ dozap() bhitm(u.ustuck, obj); else if(u.dz) { if(u.dz > 0) { - register struct obj *otmp = o_at(u.ux, u.uy); + struct obj *otmp = o_at(u.ux, u.uy); if(otmp) (void) bhito(otmp, obj); } @@ -155,7 +155,7 @@ dozap() if(!findit()) return(1); break; case WAN_CREATE_MONSTER: - { register int cnt = 1; + { int cnt = 1; if(!rn2(23)) cnt += rn2(7) + 1; while(cnt--) (void) makemon((struct permonst *) 0, u.ux, u.uy); @@ -163,7 +163,7 @@ dozap() break; case WAN_WISHING: { char buf[BUFSZ]; - register struct obj *otmp; + struct obj *otmp; extern struct obj *readobjnam(), *addinv(); if(u.uluck + rn2(5) < 0) { pline("Unfortunately, nothing happens."); @@ -185,10 +185,10 @@ dozap() * Currently: dig for digdepth positions; * also down on request of Lennart Augustsson. */ - { register struct rm *room; - register int digdepth; + { struct rm *room; + int digdepth; if(u.uswallow) { - register struct monst *mtmp = u.ustuck; + struct monst *mtmp = u.ustuck; pline("You pierce %s's stomach wall!", monnam(mtmp)); @@ -261,7 +261,7 @@ dozap() char * exclam(force) -register int force; +int force; { /* force == 0 occurs e.g. with sleep ray */ /* note that large force is usual with wands so that !! would @@ -270,17 +270,17 @@ register int force; } hit(str,mtmp,force) -register char *str; -register struct monst *mtmp; -register char *force; /* usually either "." or "!" */ +char *str; +struct monst *mtmp; +char *force; /* usually either "." or "!" */ { if(!cansee(mtmp->mx,mtmp->my)) pline("The %s hits it.", str); else pline("The %s hits %s%s", str, monnam(mtmp), force); } miss(str,mtmp) -register char *str; -register struct monst *mtmp; +char *str; +struct monst *mtmp; { if(!cansee(mtmp->mx,mtmp->my)) pline("The %s misses it.",str); else pline("The %s misses %s.",str,monnam(mtmp)); @@ -296,14 +296,14 @@ register struct monst *mtmp; struct monst * bhit(ddx,ddy,range,sym,fhitm,fhito,obj) -register int ddx,ddy,range; /* direction and range */ +int ddx,ddy,range; /* direction and range */ char sym; /* symbol displayed on path */ int (*fhitm)(), (*fhito)(); /* fns called when mon/obj hit */ struct obj *obj; /* 2nd arg to fhitm/fhito */ { - register struct monst *mtmp; - register struct obj *otmp; - register int typ; + struct monst *mtmp; + struct obj *otmp; + int typ; bhitpos.x = u.ux; bhitpos.y = u.uy; @@ -341,8 +341,8 @@ struct obj *obj; /* 2nd arg to fhitm/fhito */ struct monst * boomhit(dx,dy) { - register int i, ct; - register struct monst *mtmp; + int i, ct; + struct monst *mtmp; char sym = ')'; extern schar xdir[], ydir[]; @@ -386,7 +386,7 @@ boomhit(dx,dy) { } char -dirlet(dx,dy) register dx,dy; { +dirlet(dx,dy) dx,dy; { return (dx == dy) ? '\\' : (dx && dy) ? '/' : dx ? '-' : '|'; } @@ -395,18 +395,18 @@ dirlet(dx,dy) register dx,dy; { /* type == -1,-2,-3: bolts sent out by wizard */ /* called with dx = dy = 0 with vertical bolts */ buzz(type,sx,sy,dx,dy) -register int type; -register xchar sx,sy; -register int dx,dy; +int type; +xchar sx,sy; +int dx,dy; { int abstype = abs(type); - register char *fltxt = (type == -1) ? "blaze of fire" : fl[abstype]; + char *fltxt = (type == -1) ? "blaze of fire" : fl[abstype]; struct rm *lev; xchar range; struct monst *mon; if(u.uswallow) { - register int tmp; + int tmp; if(type < 0) return; tmp = zhit(u.ustuck, type); @@ -460,7 +460,7 @@ register int dx,dy; (type != -1 || mon->data->mlet != 'D')) { wakeup(mon); if(rnd(20) < 18 + mon->data->ac) { - register int tmp = zhit(mon,abstype); + int tmp = zhit(mon,abstype); if(mon->mhp < 1) { if(type < 0) { if(cansee(mon->mx,mon->my)) @@ -477,7 +477,7 @@ register int dx,dy; } else if(sx == u.ux && sy == u.uy) { nomul(0); if(rnd(20) < 18+u.uac) { - register int dam = 0; + int dam = 0; range -= 2; pline("The %s hits you!",fltxt); switch(abstype) { @@ -542,10 +542,10 @@ register int dx,dy; } zhit(mon,type) /* returns damage to mon */ -register struct monst *mon; -register type; +struct monst *mon; +type; { - register int tmp = 0; + int tmp = 0; switch(type) { case 0: /* magic missile */ @@ -578,9 +578,9 @@ register type; ? 'a' + (otyp - DEAD_ACID_BLOB)\ : '@' + (otyp - DEAD_HUMAN)) revive(obj) -register struct obj *obj; +struct obj *obj; { - register struct monst *mtmp; + struct monst *mtmp; if(obj->olet == FOOD_SYM && obj->otyp > CORPSE) { /* do not (yet) revive shopkeepers */ @@ -593,9 +593,9 @@ register struct obj *obj; } rloco(obj) -register struct obj *obj; +struct obj *obj; { - register tx,ty,otx,oty; + tx,ty,otx,oty; otx = obj->ox; oty = obj->oy; @@ -610,7 +610,7 @@ register struct obj *obj; } fracture_rock(obj) /* fractured by pick-axe or wand of striking */ -register struct obj *obj; /* no texts here! */ +struct obj *obj; /* no texts here! */ { /* unpobj(obj); */ obj->otyp = ROCK; @@ -623,8 +623,8 @@ register struct obj *obj; /* no texts here! */ burn_scrolls() { - register struct obj *obj, *obj2; - register int cnt = 0; + struct obj *obj, *obj2; + int cnt = 0; for(obj = invent; obj; obj = obj2) { obj2 = obj->nobj; diff --git a/games/hack/makedefs.c b/games/hack/makedefs.c index 1d75449..add5f1b 100644 --- a/games/hack/makedefs.c +++ b/games/hack/makedefs.c @@ -16,9 +16,9 @@ main(argc, argv) int argc; char **argv; { -register int index = 0; -register int propct = 0; -register char *sp; +int index = 0; +int propct = 0; +char *sp; if (argc != 2) { (void)fprintf(stderr, "usage: makedefs file\n"); exit(1); @@ -60,7 +60,7 @@ char line[LINSZ], *lp = line, *lp0 = line, *lpe = line; int eof; readline(){ -register int n = read(fd, lp0, (line+LINSZ)-lp0); +int n = read(fd, lp0, (line+LINSZ)-lp0); if(n < 0){ printf("Input error.\n"); exit(1); @@ -79,7 +79,7 @@ nextchar(){ } skipuntil(s) char *s; { -register char *sp0, *sp1; +char *sp0, *sp1; loop: while(*s != nextchar()) if(eof) { @@ -87,7 +87,7 @@ loop: exit(1); } if(strlen(s) > lpe-lp+1){ - register char *lp1, *lp2; + char *lp1, *lp2; lp2 = lp; lp1 = lp = lp0; while(lp2 != lpe) *lp1++ = *lp2++; @@ -167,7 +167,7 @@ char identif[NSZ], *ip; case '\n': /* watch for #define at begin of line */ if((ch = nextchar()) == '#'){ - register char pch; + char pch; /* skip until '\n' not preceded by '\\' */ do { pch = ch; @@ -195,9 +195,9 @@ char identif[NSZ], *ip; continue; case '"': { - register char *sp = string + prefix; - register char pch; - register int store = (inbraces || inparens) + char *sp = string + prefix; + char pch; + int store = (inbraces || inparens) && !stringseen++ && !commaseen; do { pch = ch; @@ -212,15 +212,15 @@ char identif[NSZ], *ip; } } -capitalize(sp) register char *sp; { +capitalize(sp) char *sp; { if('a' <= *sp && *sp <= 'z') *sp += 'A'-'a'; } -letter(ch) register char ch; { +letter(ch) char ch; { return( ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') ); } -digit(ch) register char ch; { +digit(ch) char ch; { return( '0' <= ch && ch <= '9' ); } diff --git a/games/hack/rnd.c b/games/hack/rnd.c index 3d43597..b209e38 100644 --- a/games/hack/rnd.c +++ b/games/hack/rnd.c @@ -6,27 +6,27 @@ #define RND(x) (random() % x) rn1(x,y) -register x,y; +x,y; { return(RND(x)+y); } rn2(x) -register x; +x; { return(RND(x)); } rnd(x) -register x; +x; { return(RND(x)+1); } d(n,x) -register n,x; +n,x; { - register tmp = n; + tmp = n; while(n--) tmp += RND(x); return(tmp); diff --git a/games/hangman/endgame.c b/games/hangman/endgame.c index 720e7e6..2839cce 100644 --- a/games/hangman/endgame.c +++ b/games/hangman/endgame.c @@ -45,7 +45,7 @@ static char sccsid[] = "@(#)endgame.c 8.1 (Berkeley) 5/31/93"; */ endgame() { - register char ch; + char ch; prman(); if (Errors >= MAXERRS) diff --git a/games/hangman/getguess.c b/games/hangman/getguess.c index 9223651..e25697e 100644 --- a/games/hangman/getguess.c +++ b/games/hangman/getguess.c @@ -46,9 +46,9 @@ static char sccsid[] = "@(#)getguess.c 8.1 (Berkeley) 5/31/93"; */ getguess() { - register int i; - register int ch; - register bool correct; + int i; + int ch; + bool correct; leaveok(stdscr, FALSE); for (;;) { @@ -90,7 +90,7 @@ getguess() */ readch() { - register int cnt, r; + int cnt, r; auto char ch; cnt = 0; diff --git a/games/hangman/getword.c b/games/hangman/getword.c index 1d2451a..0cd63d3 100644 --- a/games/hangman/getword.c +++ b/games/hangman/getword.c @@ -46,9 +46,9 @@ static char sccsid[] = "@(#)getword.c 8.1 (Berkeley) 5/31/93"; */ getword() { - register FILE *inf; - register char *wp, *gp; - register long pos; + FILE *inf; + char *wp, *gp; + long pos; inf = Dict; for (;;) { diff --git a/games/hangman/playgame.c b/games/hangman/playgame.c index 610bfb6..4d82ea4 100644 --- a/games/hangman/playgame.c +++ b/games/hangman/playgame.c @@ -45,7 +45,7 @@ static char sccsid[] = "@(#)playgame.c 8.1 (Berkeley) 5/31/93"; */ playgame() { - register bool *bp; + bool *bp; getword(); Errors = 0; diff --git a/games/hangman/prdata.c b/games/hangman/prdata.c index 12c1303..a59da6c 100644 --- a/games/hangman/prdata.c +++ b/games/hangman/prdata.c @@ -45,7 +45,7 @@ static char sccsid[] = "@(#)prdata.c 8.1 (Berkeley) 5/31/93"; */ prdata() { - register bool *bp; + bool *bp; move(GUESSY, GUESSX + sizeof "Guessed: "); bp = Guessed; diff --git a/games/hangman/prman.c b/games/hangman/prman.c index f1f09dd..6e38515 100644 --- a/games/hangman/prman.c +++ b/games/hangman/prman.c @@ -46,7 +46,7 @@ static char sccsid[] = "@(#)prman.c 8.1 (Berkeley) 5/31/93"; */ prman() { - register int i; + int i; for (i = 0; i < Errors; i++) mvaddch(Err_pos[i].y, Err_pos[i].x, Err_pos[i].ch); diff --git a/games/hangman/setup.c b/games/hangman/setup.c index c10ea05..3f9f767 100644 --- a/games/hangman/setup.c +++ b/games/hangman/setup.c @@ -46,7 +46,7 @@ static char sccsid[] = "@(#)setup.c 8.1 (Berkeley) 5/31/93"; */ setup() { - register char **sp; + char **sp; static struct stat sbuf; noecho(); diff --git a/games/larn/bill.c b/games/larn/bill.c index 360b65d..59eb96e 100644 --- a/games/larn/bill.c +++ b/games/larn/bill.c @@ -115,7 +115,7 @@ char *mail[] = { void mailbill() { - register int i; + int i; char fname[32]; char buf[128]; char **cp; diff --git a/games/larn/create.c b/games/larn/create.c index 50d3290..1bfa1ee 100644 --- a/games/larn/create.c +++ b/games/larn/create.c @@ -12,7 +12,7 @@ extern short oldx,oldy; */ makeplayer() { - register int i; + int i; scbr(); clear(); c[HPMAX]=c[HP]=10; /* start player off with 15 hit points */ c[LEVEL]=1; /* player starts at level one */ @@ -45,9 +45,9 @@ makeplayer() Note that it is here we remove genocided monsters from the present level. */ newcavelevel(x) - register int x; + int x; { - register int i,j; + int i,j; if (beenhere[level]) savelevel(); /* put the level back into storage */ level = x; /* get the new level and put in working storage */ if (beenhere[x]==0) for (i=0; i<MAXY; i++) for (j=0; j<MAXX; j++) know[j][i]=mitem[j][i]=0; @@ -76,7 +76,7 @@ static int mx,mxl,mxh,my,myl,myh,tmp2; makemaze(k) int k; { - register int i,j,tmp; + int i,j,tmp; int z; if (k > 1 && (rnd(17)<=4 || k==MAXLEVEL-1 || k==MAXLEVEL+MAXVLEVEL-1)) { @@ -118,9 +118,9 @@ static int mx,mxl,mxh,my,myl,myh,tmp2; function to eat away a filled in maze */ eat(xx,yy) - register int xx,yy; + int xx,yy; { - register int dir,try; + int dir,try; dir = rnd(4); try=2; while (try) { @@ -166,7 +166,7 @@ cannedlevel(k) int k; { char *row,*lgetl(); - register int i,j; + int i,j; int it,arg,mit,marg; if (lopen(larnlevels)<0) { @@ -217,9 +217,9 @@ cannedlevel(k) level V3 has potion of cure dianthroritis and demon prince */ treasureroom(lv) - register int lv; + int lv; { - register int tx,ty,xsize,ysize; + int tx,ty,xsize,ysize; for (tx=1+rnd(10); tx<MAXX-10; tx+=10) if ( (lv==MAXLEVEL-1) || (lv==MAXLEVEL+MAXVLEVEL-1) || rnd(13)==2) @@ -240,7 +240,7 @@ treasureroom(lv) troom(lv,xsize,ysize,tx,ty,glyph) int lv,xsize,ysize,tx,ty,glyph; { - register int i,j; + int i,j; int tp1,tp2; for (j=ty-1; j<=ty+ysize; j++) for (i=tx-1; i<=tx+xsize; i++) /* clear out space for room */ @@ -286,9 +286,9 @@ static void fillroom(); subroutine to create the objects in the maze for the given level */ makeobject(j) - register int j; + int j; { - register int i; + int i; if (j==0) { fillroom(OENTRANCE,0); /* entrance to dungeon */ @@ -377,7 +377,7 @@ fillmroom(n,what,arg) int n,arg; char what; { - register int i; + int i; for (i=0; i<n; i++) fillroom(what,arg); } froom(n,itm,arg) @@ -394,7 +394,7 @@ fillroom(what,arg) int arg; char what; { - register int x,y; + int x,y; #ifdef EXTRA c[FILLROOM]++; @@ -422,7 +422,7 @@ fillroom(what,arg) fillmonst(what) char what; { - register int x,y,trys; + int x,y,trys; for (trys=5; trys>0; --trys) /* max # of creation attempts */ { x=rnd(MAXX-2); y=rnd(MAXY-2); @@ -443,7 +443,7 @@ fillmonst(what) sethp(flg) int flg; { - register int i,j; + int i,j; if (flg) for (i=0; i<MAXY; i++) for (j=0; j<MAXX; j++) stealth[j][i]=0; if (level==0) { c[TELEFLAG]=0; return; } /* if teleported and found level 1 then know level we are on */ if (flg) j = rnd(12) + 2 + (level>>1); else j = (level>>1) + 1; @@ -456,7 +456,7 @@ sethp(flg) */ checkgen() { - register int x,y; + int x,y; for (y=0; y<MAXY; y++) for (x=0; x<MAXX; x++) if (monster[mitem[x][y]].genocided) diff --git a/games/larn/diag.c b/games/larn/diag.c index db4761c..860b18a 100644 --- a/games/larn/diag.c +++ b/games/larn/diag.c @@ -18,7 +18,7 @@ static struct tms cputime; static int rndcount[16]; diag() { - register int i,j; + int i,j; int hit,dam; cursors(); lwclose(); if (lcreat(diagfile) < 0) /* open the diagnostic file */ @@ -113,7 +113,7 @@ diag() dcount(l) int l; { - register int i,j,p; + int i,j,p; int k; k=0; for (i=0; i<MAXX; i++) @@ -128,7 +128,7 @@ dcount(l) */ diagdrawscreen() { - register int i,j,k; + int i,j,k; for (i=0; i<MAXY; i++) @@ -148,8 +148,8 @@ static time_t zzz=0; savegame(fname) char *fname; { - register int i,k; - register struct sphere *sp; + int i,k; + struct sphere *sp; struct stat statbuf; nosignal=1; lflush(); savelevel(); ointerest(); @@ -194,8 +194,8 @@ savegame(fname) restoregame(fname) char *fname; { - register int i,k; - register struct sphere *sp,*sp2; + int i,k; + struct sphere *sp,*sp2; struct stat filetimes; cursors(); lprcat("\nRestoring . . ."); lflush(); if (lopen(fname) <= 0) diff --git a/games/larn/display.c b/games/larn/display.c index b0192c5..0c30590 100644 --- a/games/larn/display.c +++ b/games/larn/display.c @@ -28,7 +28,7 @@ static void botsub(); bot_linex() { - register int i; + int i; if (cbak[SPELLS] <= -50 || (always)) { cursor( 1,18); @@ -132,7 +132,7 @@ static struct bot_side_def botside() { - register int i,idx; + int i,idx; for (i=0; i<17; i++) { idx = bot_data[i].typ; @@ -149,10 +149,10 @@ botside() static void botsub(idx,str) - register int idx; + int idx; char *str; { - register int x,y; + int x,y; y = idx & 0xff; x = (idx>>8) & 0xff; idx >>= 16; if (c[idx] != cbak[idx]) { cbak[idx]=c[idx]; cursor(x,y); lprintf(str,(long)c[idx]); } @@ -167,7 +167,7 @@ int d_xmin=0,d_xmax=MAXX,d_ymin=0,d_ymax=MAXY; /* for limited screen drawing */ draws(xmin,xmax,ymin,ymax) int xmin,xmax,ymin,ymax; { - register int i,idx; + int i,idx; if (xmin==0 && xmax==MAXX) /* clear section of screen as needed */ { if (ymin==0) cl_up(79,ymax); @@ -198,7 +198,7 @@ draws(xmin,xmax,ymin,ymax) char screen[MAXX][MAXY],d_flag; /* template for the screen */ drawscreen() { - register int i,j,k; + int i,j,k; int lastx,lasty; /* variables used to optimize the object printing */ if (d_xmin==0 && d_xmax==MAXX && d_ymin==0 && d_ymax==MAXY) { @@ -268,7 +268,7 @@ drawscreen() showcell(x,y) int x,y; { - register int i,j,k,m; + int i,j,k,m; if (c[BLINDCOUNT]) return; /* see nothing if blind */ if (c[AWARENESS]) { minx = x-3; maxx = x+3; miny = y-3; maxy = y+3; } else { minx = x-1; maxx = x+1; miny = y-1; maxy = y+1; } @@ -350,7 +350,7 @@ moveplayer(dir) [6-northwest] [7-southeast] [8-southwest] if direction=0, don't move--just show where he is */ { - register int k,m,i,j; + int k,m,i,j; if (c[CONFUSE]) if (c[LEVEL]<rnd(30)) dir=rund(9); /*if confused any dir*/ k = playerx + diroffx[dir]; m = playery + diroffy[dir]; if (k<0 || k>=MAXX || m<0 || m>=MAXY) { nomove=1; return(yrepcount = 0); } @@ -376,7 +376,7 @@ static int lincount,count; seemagic(arg) int arg; { - register int i,number; + int i,number; count = lincount = 0; nosignal=1; if (arg== -1) /* if display spells while casting one */ diff --git a/games/larn/global.c b/games/larn/global.c index 9fa19d9..4f7f29a 100644 --- a/games/larn/global.c +++ b/games/larn/global.c @@ -65,9 +65,9 @@ loselevel() subroutine to increase experience points */ raiseexperience(x) - register long x; + long x; { - register int i,tmp; + int i,tmp; i=c[LEVEL]; c[EXPERIENCE]+=x; while (c[EXPERIENCE] >= skill[c[LEVEL]] && (c[LEVEL] < MAXPLEVEL)) { @@ -93,9 +93,9 @@ raiseexperience(x) subroutine to lose experience points */ loseexperience(x) - register long x; + long x; { - register int i,tmp; + int i,tmp; i=c[LEVEL]; c[EXPERIENCE]-=x; if (c[EXPERIENCE] < 0) c[EXPERIENCE]=0; while (c[EXPERIENCE] < skill[c[LEVEL]-1]) @@ -125,7 +125,7 @@ loseexperience(x) warning -- will kill player if hp goes to zero */ losehp(x) - register int x; + int x; { if ((c[HP] -= x) <= 0) { @@ -134,7 +134,7 @@ losehp(x) } losemhp(x) - register int x; + int x; { c[HP] -= x; if (c[HP] < 1) c[HP]=1; c[HPMAX] -= x; if (c[HPMAX] < 1) c[HPMAX]=1; @@ -150,13 +150,13 @@ losemhp(x) subroutine to gain maximum hit points */ raisehp(x) - register int x; + int x; { if ((c[HP] += x) > c[HPMAX]) c[HP] = c[HPMAX]; } raisemhp(x) - register int x; + int x; { c[HPMAX] += x; c[HP] += x; } @@ -171,13 +171,13 @@ raisemhp(x) subroutine to gain maximum spells */ raisespells(x) - register int x; + int x; { if ((c[SPELLS] += x) > c[SPELLMAX]) c[SPELLS] = c[SPELLMAX]; } raisemspells(x) - register int x; + int x; { c[SPELLMAX]+=x; c[SPELLS]+=x; } @@ -192,13 +192,13 @@ raisemspells(x) subroutine to lose maximum spells */ losespells(x) - register int x; + int x; { if ((c[SPELLS] -= x) < 0) c[SPELLS]=0; } losemspells(x) - register int x; + int x; { if ((c[SPELLMAX] -= x) < 0) c[SPELLMAX]=0; if ((c[SPELLS] -= x) < 0) c[SPELLS]=0; @@ -212,9 +212,9 @@ losemspells(x) for the given cave level */ makemonst(lev) - register int lev; + int lev; { - register int tmp,x; + int tmp,x; if (lev < 1) lev = 1; if (lev > 12) lev = 12; tmp=WATERLORD; if (lev < 5) @@ -250,7 +250,7 @@ positionplayer() */ recalc() { - register int i,j,k; + int i,j,k; c[AC] = c[MOREDEFENSES]; if (c[WEAR] >= 0) switch(iven[c[WEAR]]) @@ -315,7 +315,7 @@ recalc() */ quit() { - register int i; + int i; cursors(); strcpy(lastmonst,""); lprcat("\n\nDo you really want to quit?"); while (1) @@ -344,7 +344,7 @@ more() take(itm,arg) int itm,arg; { - register int i,limit; + int i,limit; /* cursors(); */ if ((limit = 15+(c[LEVEL]>>1)) > 26) limit=26; for (i=0; i<limit; i++) @@ -401,7 +401,7 @@ drop_object(k) */ enchantarmor() { - register int tmp; + int tmp; if (c[WEAR]<0) { if (c[SHIELD] < 0) { cursors(); beep(); lprcat("\nYou feel a sense of loss"); return; } else { tmp=iven[c[SHIELD]]; if (tmp != OSCROLL) if (tmp != OPOTION) { ivenarg[c[SHIELD]]++; bottomline(); } } } @@ -414,7 +414,7 @@ enchantarmor() */ enchweapon() { - register int tmp; + int tmp; if (c[WIELD]<0) { cursors(); beep(); lprcat("\nYou feel a sense of loss"); return; } tmp = iven[c[WIELD]]; @@ -431,7 +431,7 @@ enchweapon() */ pocketfull() { - register int i,limit; + int i,limit; if ((limit = 15+(c[LEVEL]>>1)) > 26) limit=26; for (i=0; i<limit; i++) if (iven[i]==0) return(0); return(1); @@ -442,7 +442,7 @@ pocketfull() */ nearbymonst() { - register int tmp,tmp2; + int tmp,tmp2; for (tmp=playerx-1; tmp<playerx+2; tmp++) for (tmp2=playery-1; tmp2<playery+2; tmp2++) if (mitem[tmp][tmp2]) return(1); /* if monster nearby */ @@ -455,7 +455,7 @@ nearbymonst() */ stealsomething() { - register int i,j; + int i,j; j=100; while (1) { @@ -474,7 +474,7 @@ stealsomething() */ emptyhanded() { - register int i; + int i; for (i=0; i<26; i++) if (iven[i]) if (i!=c[WIELD]) if (i!=c[WEAR]) if (i!=c[SHIELD]) return(0); return(1); @@ -485,7 +485,7 @@ emptyhanded() */ creategem() { - register int i,j; + int i,j; switch(rnd(4)) { case 1: i=ODIAMOND; j=50; break; @@ -503,7 +503,7 @@ creategem() adjustcvalues(itm,arg) int itm,arg; { - register int flag; + int flag; flag=0; switch(itm) { @@ -530,9 +530,9 @@ adjustcvalues(itm,arg) returns a pointer to the string */ gettokstr(str) - register char *str; + char *str; { - register int i,j; + int i,j; i=50; while ((getchar() != '"') && (--i > 0)); i=36; @@ -552,8 +552,8 @@ gettokstr(str) static char gpwbuf[33]; getpassword() { - register int i,j; - register char *gpwp; + int i,j; + char *gpwp; extern char *password; scbr(); /* system("stty -echo cbreak"); */ gpwp = gpwbuf; lprcat("\nEnter Password: "); lflush(); @@ -571,7 +571,7 @@ getpassword() */ getyn() { - register int i; + int i; i=0; while (i!='y' && i!='n' && i!='\33') i=getchar(); return(i); } @@ -582,7 +582,7 @@ getyn() */ packweight() { - register int i,j,k; + int i,j,k; k=c[GOLD]/1000; j=25; while ((iven[j]==0) && (j>0)) --j; for (i=0; i<=j; i++) switch(iven[i]) diff --git a/games/larn/help.c b/games/larn/help.c index 0d06d6f..fa31c82 100644 --- a/games/larn/help.c +++ b/games/larn/help.c @@ -13,7 +13,7 @@ extern char helpfile[]; help() { - register int i,j; + int i,j; #ifndef VT100 char tmbuf[128]; /* intermediate translation buffer when not a VT100 */ #endif VT100 @@ -48,7 +48,7 @@ help() */ welcome() { - register int i; + int i; #ifndef VT100 char tmbuf[128]; /* intermediate translation buffer when not a VT100 */ #endif VT100 diff --git a/games/larn/io.c b/games/larn/io.c index a7fac5d..112268b 100644 --- a/games/larn/io.c +++ b/games/larn/io.c @@ -156,7 +156,7 @@ sncbr() */ newgame() { - register long *p,*pe; + long *p,*pe; for (p=c,pe=c+100; p<pe; *p++ =0); time(&initialtime); srandomdev(); lcreat((char*)0); /* open buffering for output to terminal */ @@ -198,9 +198,9 @@ lprintf(va_alist) va_dcl { va_list ap; /* pointer for variable argument list */ - register char *fmt; - register char *outb,*tmpb; - register long wide,left,cont,n; /* data for lprintf */ + char *fmt; + char *outb,*tmpb; + long wide,left,cont,n; /* data for lprintf */ char db[12]; /* %d buffer in lprintf */ va_start(ap); /* initialize the var args pointer */ @@ -280,7 +280,7 @@ va_dcl * Returns nothing of value. */ lprint(x) - register long x; + long x; { if (lpnt >= lpend) lflush(); *lpnt++ = 255 & x; *lpnt++ = 255 & (x>>8); @@ -296,11 +296,11 @@ lprint(x) * Returns nothing of value */ lwrite(buf,len) - register char *buf; + char *buf; int len; { - register char *str; - register int num2; + char *str; + int num2; if (len > 399) /* don't copy data if can just write it */ { #ifdef EXTRA @@ -333,7 +333,7 @@ lwrite(buf,len) */ long lgetc() { - register int i; + int i; if (ipoint != iepoint) return(inbuffer[ipoint++]); if (iepoint!=MAXIBUF) return(0); if ((i=read(fd,inbuffer,MAXIBUF))<=0) @@ -359,7 +359,7 @@ long lgetc() */ long lrint() { - register unsigned long i; + unsigned long i; i = 255 & lgetc(); i |= (255 & lgetc()) << 8; i |= (255 & lgetc()) << 16; i |= (255 & lgetc()) << 24; return(i); @@ -374,11 +374,11 @@ long lrint() * Returns nothing of value */ lrfill(adr,num) - register char *adr; + char *adr; int num; { - register char *pnt; - register int num2; + char *pnt; + int num2; while (num) { if (iepoint == ipoint) @@ -408,8 +408,8 @@ lrfill(adr,num) */ char *lgetw() { - register char *lgp,cc; - register int n=LINBUFSIZE,quote=0; + char *lgp,cc; + int n=LINBUFSIZE,quote=0; lgp = lgetwbuf; do cc=lgetc(); while ((cc <= 32) && (cc > NULL)); /* eat whitespace */ for ( ; ; --n,cc=lgetc()) @@ -427,8 +427,8 @@ char *lgetw() */ char *lgetl() { - register int i=LINBUFSIZE,ch; - register char *str=lgetwbuf; + int i=LINBUFSIZE,ch; + char *str=lgetwbuf; for ( ; ; --i) { if ((*str++ = ch = lgetc()) == NULL) @@ -523,9 +523,9 @@ lwclose() * avoids calls to lprintf (time consuming) */ lprcat(str) - register char *str; + char *str; { - register char *str2; + char *str2; if (lpnt >= lpend) lflush(); str2 = lpnt; while (*str2++ = *str++); @@ -557,7 +557,7 @@ static char *x_num[]= { "H","H",";2H",";3H",";4H",";5H",";6H",";7H",";8H",";9H", cursor(x,y) int x,y; { - register char *p; + char *p; if (lpnt >= lpend) lflush(); p = y_num[y]; /* get the string to print */ @@ -679,12 +679,12 @@ cl_line(x,y) * cl_up(x,y) Clear screen from [x,1] to current position. Leave cursor at [x,y] */ cl_up(x,y) - register int x,y; + int x,y; { #ifdef VT100 cursor(x,y); lprcat("\33[1J\33[2K"); #else VT100 - register int i; + int i; cursor(1,1); for (i=1; i<=y; i++) { *lpnt++ = CL_LINE; *lpnt++ = '\n'; } cursor(x,y); @@ -695,12 +695,12 @@ cl_up(x,y) * cl_dn(x,y) Clear screen from [1,y] to end of display. Leave cursor at [x,y] */ cl_dn(x,y) - register int x,y; + int x,y; { #ifdef VT100 cursor(x,y); lprcat("\33[J\33[2K"); #else VT100 - register int i; + int i; cursor(1,y); if (!CD) { @@ -718,7 +718,7 @@ cl_dn(x,y) * standout(str) Print the argument string in inverse video (standout mode). */ standout(str) - register char *str; + char *str; { #ifdef VT100 setbold(); @@ -752,8 +752,8 @@ set_score_output() static int scrline=18; /* line # for wraparound instead of scrolling if no DL */ lflush () { - register int lpoint; - register char *str; + int lpoint; + char *str; static int curx = 0; static int cury = 0; @@ -838,7 +838,7 @@ lflush () */ lflush() { - register int lpoint; + int lpoint; if ((lpoint = lpnt - lpbuf) > 0) { #ifdef EXTRA @@ -878,9 +878,9 @@ flush_buf() * Processes only the \33[#m sequence (converts . files for termcap use */ char *tmcapcnv(sd,ss) - register char *sd,*ss; + char *sd,*ss; { - register int tmstate=0; /* 0=normal, 1=\33 2=[ 3=# */ + int tmstate=0; /* 0=normal, 1=\33 2=[ 3=# */ char tmdigit=0; /* the # in \33[#m */ while (*ss) { diff --git a/games/larn/main.c b/games/larn/main.c index a554031..7aa5697 100644 --- a/games/larn/main.c +++ b/games/larn/main.c @@ -39,7 +39,7 @@ main(argc,argv) int argc; char **argv; { - register int i,j; + int i,j; int hard; char *ptr=0,*ttype; struct passwd *pwe; @@ -236,7 +236,7 @@ main(argc,argv) */ showstr() { - register int i,number; + int i,number; for (number=3, i=0; i<26; i++) if (iven[i]) number++; /* count items in inventory */ t_setup(number); qshowstr(); t_endup(number); @@ -244,7 +244,7 @@ showstr() qshowstr() { - register int i,j,k,sigsav; + int i,j,k,sigsav; srcount=0; sigsav=nosignal; nosignal=1; /* don't allow ^c etc */ if (c[GOLD]) { lprintf(".) %d gold pieces",(long)c[GOLD]); srcount++; } for (k=26; k>=0; k--) @@ -260,7 +260,7 @@ qshowstr() * subroutine to clear screen depending on # lines to display */ t_setup(count) - register int count; + int count; { if (count<20) /* how do we clear the screen? */ { @@ -276,7 +276,7 @@ t_setup(count) * subroutine to restore normal display screen depending on t_setup() */ t_endup(count) - register int count; + int count; { if (count<18) /* how did we clear the screen? */ draws(0,MAXX,0,(count>MAXY) ? MAXY : count); @@ -291,7 +291,7 @@ t_endup(count) */ showwear() { - register int i,j,sigsav,count; + int i,j,sigsav,count; sigsav=nosignal; nosignal=1; /* don't allow ^c etc */ srcount=0; @@ -325,7 +325,7 @@ showwear() */ showwield() { - register int i,j,sigsav,count; + int i,j,sigsav,count; sigsav=nosignal; nosignal=1; /* don't allow ^c etc */ srcount=0; @@ -361,7 +361,7 @@ showwield() */ showread() { - register int i,j,sigsav,count; + int i,j,sigsav,count; sigsav=nosignal; nosignal=1; /* don't allow ^c etc */ srcount=0; @@ -387,7 +387,7 @@ showread() */ showeat() { - register int i,j,sigsav,count; + int i,j,sigsav,count; sigsav=nosignal; nosignal=1; /* don't allow ^c etc */ srcount=0; @@ -413,7 +413,7 @@ showeat() */ showquaff() { - register int i,j,sigsav,count; + int i,j,sigsav,count; sigsav=nosignal; nosignal=1; /* don't allow ^c etc */ srcount=0; @@ -435,8 +435,8 @@ showquaff() } show1(idx,str2) - register int idx; - register char *str2[]; + int idx; + char *str2[]; { if (str2==0) lprintf("\n%c) %s",idx+'a',objectname[iven[idx]]); else if (*str2[ivenarg[idx]]==0) lprintf("\n%c) %s",idx+'a',objectname[iven[idx]]); @@ -444,7 +444,7 @@ show1(idx,str2) } show3(index) - register int index; + int index; { switch(iven[index]) { @@ -486,7 +486,7 @@ randmonst() */ parse() { - register int i,j,k,flag; + int i,j,k,flag; while (1) { k = yylex(); @@ -578,7 +578,7 @@ parse() c[LANCEDEATH]=1; c[WEAR] = c[SHIELD] = -1; raiseexperience(6000000L); c[AWARENESS] += 25000; { - register int i,j; + int i,j; for (i=0; i<MAXY; i++) for (j=0; j<MAXX; j++) know[j][i]=1; for (i=0; i<SPNUM; i++) spelknow[i]=1; @@ -645,7 +645,7 @@ parse2() run(dir) int dir; { - register int i; + int i; i=1; while (i) { i=moveplayer(dir); @@ -660,7 +660,7 @@ run(dir) */ wield() { - register int i; + int i; while (1) { if ((i = whatitem("wield"))=='\33') return; @@ -691,7 +691,7 @@ ycwi(x) */ wear() { - register int i; + int i; while (1) { if ((i = whatitem("wear"))=='\33') return; @@ -719,8 +719,8 @@ wear() */ dropobj() { - register int i; - register char *p; + int i; + char *p; long amt; p = &item[playerx][playery]; while (1) @@ -763,7 +763,7 @@ dropobj() */ readscr() { - register int i; + int i; while (1) { if ((i = whatitem("read"))=='\33') return; @@ -785,7 +785,7 @@ readscr() */ eatcookie() { -register int i; +int i; char *p; while (1) { @@ -819,7 +819,7 @@ while (1) */ quaff() { - register int i; + int i; while (1) { if ((i = whatitem("quaff"))=='\33') return; @@ -855,8 +855,8 @@ whatitem(str) unsigned long readnum(mx) long mx; { - register int i; - register unsigned long amt=0; + int i; + unsigned long amt=0; sncbr(); if ((i=getchar()) == '*') amt = mx; /* allow him to say * for all gold */ else @@ -875,7 +875,7 @@ unsigned long readnum(mx) * routine to zero every byte in a string */ szero(str) - register char *str; + char *str; { while (*str) *str++ = 0; diff --git a/games/larn/monster.c b/games/larn/monster.c index 909cec1..240df92 100644 --- a/games/larn/monster.c +++ b/games/larn/monster.c @@ -116,7 +116,7 @@ struct isave /* used for altar reality */ createmonster(mon) int mon; { - register int x,y,k,i; + int x,y,k,i; if (mon<1 || mon>MAXMONST+8) /* check for monster number out of bounds */ { beep(); lprintf("\ncan't createmonst(%d)\n",(long)mon); nap(3000); return; @@ -152,7 +152,7 @@ createmonster(mon) * This routine will return FALSE if at a wall or the dungeon exit on level 1 */ int cgood(x,y,itm,monst) - register int x,y; + int x,y; int itm,monst; { if ((y>=0) && (y<=MAXY-1) && (x>=0) && (x<=MAXX-1)) /* within bounds? */ @@ -174,7 +174,7 @@ int cgood(x,y,itm,monst) createitem(it,arg) int it,arg; { - register int x,y,k,i; + int x,y,k,i; if (it >= MAXOBJ) return; /* no such object */ for (k=rnd(8), i= -8; i<0; i++,k++) /* choose direction, then try all */ { @@ -195,7 +195,7 @@ createitem(it,arg) static char eys[] = "\nEnter your spell: "; cast() { - register int i,j,a,b,d; + int i,j,a,b,d; cursors(); if (c[SPELLS]<=0) { lprcat("\nYou don't have any spells!"); return; } lprcat(eys); --c[SPELLS]; @@ -229,9 +229,9 @@ static int dirsub(); speldamage(x) int x; { - register int i,j,clev; + int i,j,clev; int xl,xh,yl,yh; - register char *p,*kn,*pm; + char *p,*kn,*pm; if (x>=SPNUM) return; /* no such spell */ if (c[TIMESTOP]) { lprcat(" It didn't seem to work"); return; } /* not if time stopped */ clev = c[LEVEL]; @@ -487,7 +487,7 @@ isconfuse() nospell(x,monst) int x,monst; { - register int tmp; + int tmp; if (x>=SPNUM || monst>=MAXMONST+8 || monst<0 || x<0) return(0); /* bad spell or monst */ if ((tmp=spelweird[monst-1][x])==0) return(0); cursors(); lprc('\n'); lprintf(spelmes[tmp],monster[monst].name); return(1); @@ -503,7 +503,7 @@ nospell(x,monst) fullhit(xx) int xx; { - register int i; + int i; if (xx<0 || xx>20) return(0); /* fullhits are out of range */ if (c[LANCEDEATH]) return(10000); /* lance of death */ i = xx * ((c[WCLASS]>>1)+c[STRENGTH]+c[STREXTRA]-c[HARDGAME]-12+c[MOREDAM]); @@ -525,7 +525,7 @@ direct(spnum,dam,str,arg) char *str; { int x,y; - register int m; + int m; if (spnum<0 || spnum>=SPNUM || str==0) return; /* bad arguments */ if (isconfuse()) return; dirsub(&x,&y); @@ -575,8 +575,8 @@ godirect(spnum,dam,str,delay,cshow) int spnum,dam,delay; char *str,cshow; { - register char *p; - register int x,y,m; + char *p; + int x,y,m; int dx,dy; if (spnum<0 || spnum>=SPNUM || str==0 || delay<0) return; /* bad args */ if (isconfuse()) return; @@ -683,7 +683,7 @@ tdirect(spnum) int spnum; { int x,y; - register int m; + int m; if (spnum<0 || spnum>=SPNUM) return; /* bad args */ if (isconfuse()) return; dirsub(&x,&y); @@ -708,7 +708,7 @@ omnidirect(spnum,dam,str) int spnum,dam; char *str; { - register int x,y,m; + int x,y,m; if (spnum<0 || spnum>=SPNUM || str==0) return; /* bad args */ for (x=playerx-1; x<playerx+2; x++) for (y=playery-1; y<playery+2; y++) @@ -738,7 +738,7 @@ static int dirsub(x,y) int *x,*y; { - register int i; + int i; lprcat("\nIn What Direction? "); for (i=0; ; ) switch(getchar()) @@ -813,7 +813,7 @@ dirpoly(spnum) hitmonster(x,y) int x,y; { - register int tmp,monst,damag,flag; + int tmp,monst,damag,flag; if (c[TIMESTOP]) return; /* not if time stopped */ vxy(&x,&y); /* verify coordinates are within range */ if ((monst = mitem[x][y]) == 0) return; @@ -853,9 +853,9 @@ hitmonster(x,y) */ hitm(x,y,amt) int x,y; - register amt; + amt; { - register int monst; + int monst; int hpoints,amt2; vxy(&x,&y); /* verify coordinates are within range */ amt2 = amt; /* save initial damage so we can return it */ @@ -898,7 +898,7 @@ hitm(x,y,amt) hitplayer(x,y) int x,y; { - register int dam,tmp,mster,bias; + int dam,tmp,mster,bias; vxy(&x,&y); /* verify coordinates are within range */ lastnum = mster = mitem[x][y]; /* spirit naga's and poltergeist's do nothing if scarab of negate spirit */ @@ -973,7 +973,7 @@ dropsomething(monst) * Returns nothing of value. */ dropgold(amount) - register int amount; + int amount; { if (amount > 250) createitem(OMAXGOLD,amount/100); else createitem(OGOLDPILE,amount); } @@ -989,7 +989,7 @@ dropgold(amount) something(level) int level; { - register int j; + int j; int i; if (level<0 || level>MAXLEVEL+MAXVLEVEL) return; /* correct level? */ if (rnd(101)<8) something(level); /* possibly more than one item */ @@ -1012,9 +1012,9 @@ static char nobjtab[] = { 0, OSCROLL, OSCROLL, OSCROLL, OSCROLL, OPOTION, OLONGSWORD }; newobject(lev,i) - register int lev,*i; + int lev,*i; { - register int tmp=32,j; + int tmp=32,j; if (level<0 || level>MAXLEVEL+MAXVLEVEL) return(0); /* correct level? */ if (lev>6) tmp=37; else if (lev>4) tmp=35; j = nobjtab[tmp=rnd(tmp)]; /* the object type */ @@ -1079,8 +1079,8 @@ static char spsel[] = { 1, 2, 3, 5, 6, 8, 9, 11, 13, 14 }; spattack(x,xx,yy) int x,xx,yy; { - register int i,j=0,k,m; - register char *p=0; + int i,j=0,k,m; + char *p=0; if (c[CANCELLATION]) return(0); vxy(&xx,&yy); /* verify x & y coordinates */ switch(x) @@ -1226,8 +1226,8 @@ checkloss(x) annihilate() { int i,j; - register long k; - register char *p; + long k; + char *p; for (k=0, i=playerx-1; i<=playerx+1; i++) for (j=playery-1; j<=playery+1; j++) if (!vxy(&i,&j)) /* if not out of bounds */ @@ -1326,7 +1326,7 @@ boom: sphboom(x,y); /* blow up stuff around sphere */ rmsphere(x,y) int x,y; { - register struct sphere *sp,*sp2=0; + struct sphere *sp,*sp2=0; for (sp=spheres; sp; sp2=sp,sp=sp->p) if (level==sp->lev) /* is sphere on this level? */ if ((x==sp->x) && (y==sp->y)) /* locate sphere at this location */ @@ -1351,7 +1351,7 @@ rmsphere(x,y) sphboom(x,y) int x,y; { - register int i,j; + int i,j; if (c[HOLDMONST]) c[HOLDMONST]=1; if (c[CANCELLATION]) c[CANCELLATION]=1; for (j=max(1,x-2); j<min(x+3,MAXX-1); j++) @@ -1376,7 +1376,7 @@ sphboom(x,y) */ genmonst() { - register int i,j; + int i,j; cursors(); lprcat("\nGenocide what monster? "); for (i=0; (!isalpha(i)) && (i!=' '); i=getchar()); lprc(i); diff --git a/games/larn/moreobj.c b/games/larn/moreobj.c index 2f6f21c..ddad0d6 100644 --- a/games/larn/moreobj.c +++ b/games/larn/moreobj.c @@ -120,7 +120,7 @@ ohear() othrone(arg) int arg; { - register int i,k; + int i,k; lprcat("\nDo you (p) pry off jewels, (s) sit down"); iopts(); while (1) @@ -162,7 +162,7 @@ othrone(arg) odeadthrone() { - register int k; + int k; lprcat("\nDo you (s) sit down"); iopts(); while (1) @@ -189,7 +189,7 @@ odeadthrone() */ ochest() { - register int i,k; + int i,k; lprcat("\nDo you (t) take it, (o) try to open it"); iopts(); while (1) { @@ -245,7 +245,7 @@ ochest() ofountain() { - register int x; + int x; cursors(); lprcat("\nDo you (d) drink, (w) wash yourself"); iopts(); while (1) switch(getchar()) @@ -326,7 +326,7 @@ fch(how,x) fntchange(how) int how; { - register long j; + long j; lprc('\n'); switch(rnd(9)) { diff --git a/games/larn/movem.c b/games/larn/movem.c index 5091875..8ae1358 100644 --- a/games/larn/movem.c +++ b/games/larn/movem.c @@ -22,7 +22,7 @@ static short w1[9],w1x[9],w1y[9]; static int tmp1,tmp2,tmp3,tmp4,distance; movemonst() { - register int i,j; + int i,j; if (c[TIMESTOP]) return; /* no action if time is stopped */ if (c[HASTESELF]) if ((c[HASTESELF]&1)==0) return; if (spheres) movsphere(); /* move the spheres of annihilation if any */ @@ -95,7 +95,7 @@ static int tmpitem,xl,xh,yl,yh; movemt(i,j) int i,j; { - register int k,m,z,tmp,xtmp,ytmp,monst; + int k,m,z,tmp,xtmp,ytmp,monst; switch(monst=mitem[i][j]) /* for half speed monsters */ { case TROGLODYTE: case HOBGOBLIN: case METAMORPH: case XVART: @@ -192,7 +192,7 @@ out: if (tmp<distance) /* did find connectivity */ mmove(aa,bb,cc,dd) int aa,bb,cc,dd; { - register int tmp,i,flag; + int tmp,i,flag; char *who,*p; flag=0; /* set to 1 if monster hit by arrow trap */ if ((cc==playerx) && (dd==playery)) @@ -276,8 +276,8 @@ mmove(aa,bb,cc,dd) #define SPHMAX 20 /* maximum number of spheres movsphere can handle */ movsphere() { - register int x,y,dir,len; - register struct sphere *sp,*sp2; + int x,y,dir,len; + struct sphere *sp,*sp2; struct sphere sph[SPHMAX]; /* first duplicate sphere list */ diff --git a/games/larn/nap.c b/games/larn/nap.c index 7b294fa..fbe4f61 100644 --- a/games/larn/nap.c +++ b/games/larn/nap.c @@ -14,7 +14,7 @@ * routine to take a nap for n milliseconds */ nap(x) - register int x; + int x; { if (x<=0) return; /* eliminate chance for infinite loop */ lflush(); @@ -93,7 +93,7 @@ static napms(time) struct timeb _gtime; time_t matchtime; unsigned short matchmilli; - register struct timeb *tp = & _gtime; + struct timeb *tp = & _gtime; if (time <= 0) return; ftime(tp); diff --git a/games/larn/object.c b/games/larn/object.c index 230e7bc..cb5c216 100644 --- a/games/larn/object.c +++ b/games/larn/object.c @@ -12,7 +12,7 @@ */ lookforobject() { -register int i,j; +int i,j; if (c[TIMESTOP]) return; /* can't find objects is time is stopped */ i=item[playerx][playery]; if (i==0) return; showcell(playerx,playery); cursors(); yrepcount=0; @@ -289,7 +289,7 @@ finditem(itm) ostairs(dir) int dir; { - register int k; + int k; lprcat("\nDo you (s) stay here "); if (dir > 0) lprcat("(u) go up "); else lprcat("(d) go down "); lprcat("or (f) kick stairs? "); @@ -345,7 +345,7 @@ ostairs(dir) oteleport(err) int err; { - register int tmp; + int tmp; if (err) if (rnd(151)<3) died(264); /* stuck in a rock */ c[TELEFLAG]=1; /* show ?? on bottomline if been teleported */ if (level==0) tmp=0; @@ -390,7 +390,7 @@ opotion(pot) quaffpotion(pot) int pot; { - register int i,j,k; + int i,j,k; if (pot<0 || pot>=MAXPOTION) return; /* check for within bounds */ potionname[pot][0] = ' '; switch(pot) @@ -534,9 +534,9 @@ char time_change[] = { HASTESELF,HERO,ALTPRO,PROTECTIONTIME,DEXCOUNT, * function to adjust time when time warping and taking courses in school */ adjtime(tim) - register long tim; + long tim; { - register int j; + int j; for (j=0; j<26; j++) /* adjust time related parameters */ if (c[time_change[j]]) if ((c[time_change[j]] -= tim) < 1) c[time_change[j]]=1; @@ -549,7 +549,7 @@ adjtime(tim) read_scroll(typ) int typ; { - register int i,j; + int i,j; if (typ<0 || typ>=MAXSCROLL) return; /* be sure we are within bounds */ scrollname[typ][0] = ' '; switch(typ) @@ -640,7 +640,7 @@ oorb() opit() { - register int i; + int i; if (rnd(101)<81) if (rnd(70) > 9*c[DEXTERITY]-packweight() || rnd(101)<5) if (level==MAXLEVEL-1) obottomless(); else @@ -704,9 +704,9 @@ obook() function to read a book */ readbook(lev) - register int lev; + int lev; { - register int i,tmp; + int i,tmp; if (lev<=3) i = rund((tmp=splev[lev])?tmp:1); else i = rnd((tmp=splev[lev]-9)?tmp:1) + 9; spelknow[i]=1; @@ -741,7 +741,7 @@ ocookie() ogold(arg) int arg; { - register long i; + long i; i = iarg[playerx][playery]; if (arg==OMAXGOLD) i *= 100; else if (arg==OKGOLD) i *= 1000; @@ -752,7 +752,7 @@ ogold(arg) ohome() { - register int i; + int i; nosignal = 1; /* disable signals */ for (i=0; i<26; i++) if (iven[i]==OPOTION) if (ivenarg[i]==21) { diff --git a/games/larn/regen.c b/games/larn/regen.c index 06ac28d..40b84f6 100644 --- a/games/larn/regen.c +++ b/games/larn/regen.c @@ -11,8 +11,8 @@ */ regen() { - register int i,flag; - register long *d; + int i,flag; + long *d; d = c; #ifdef EXTRA d[MOVESMADE]++; diff --git a/games/larn/savelev.c b/games/larn/savelev.c index 702801f..1ef873f 100644 --- a/games/larn/savelev.c +++ b/games/larn/savelev.c @@ -8,10 +8,10 @@ extern struct cel *cell; */ savelevel() { - register struct cel *pcel; - register char *pitem,*pknow,*pmitem; - register short *phitp,*piarg; - register struct cel *pecel; + struct cel *pcel; + char *pitem,*pknow,*pmitem; + short *phitp,*piarg; + struct cel *pecel; pcel = &cell[level*MAXX*MAXY]; /* pointer to this level's cells */ pecel = pcel + MAXX*MAXY; /* pointer to past end of this level's cells */ pitem=item[0]; piarg=iarg[0]; pknow=know[0]; pmitem=mitem[0]; phitp=hitp[0]; @@ -30,10 +30,10 @@ savelevel() */ getlevel() { - register struct cel *pcel; - register char *pitem,*pknow,*pmitem; - register short *phitp,*piarg; - register struct cel *pecel; + struct cel *pcel; + char *pitem,*pknow,*pmitem; + short *phitp,*piarg; + struct cel *pecel; pcel = &cell[level*MAXX*MAXY]; /* pointer to this level's cells */ pecel = pcel + MAXX*MAXY; /* pointer to past end of this level's cells */ pitem=item[0]; piarg=iarg[0]; pknow=know[0]; pmitem=mitem[0]; phitp=hitp[0]; diff --git a/games/larn/scores.c b/games/larn/scores.c index c5c8b93..b932beb 100644 --- a/games/larn/scores.c +++ b/games/larn/scores.c @@ -124,7 +124,7 @@ writeboard() */ makeboard() { - register int i; + int i; for (i=0; i<SCORESIZE; i++) { winr[i].taxes = winr[i].score = sco[i].score = 0; @@ -145,7 +145,7 @@ makeboard() */ hashewon() { - register int i; + int i; c[HARDGAME] = 0; if (readboard() < 0) return(0); /* can't find scoreboard */ for (i=0; i<SCORESIZE; i++) /* search through winners scoreboard */ @@ -167,8 +167,8 @@ hashewon() long paytaxes(x) long x; { - register int i; - register long amt; + int i; + long amt; if (x<0) return(0L); if (readboard()<0) return(0L); for (i=0; i<SCORESIZE; i++) @@ -192,8 +192,8 @@ long paytaxes(x) */ winshou() { - register struct wscofmt *p; - register int i,j,count; + struct wscofmt *p; + int i,j,count; for (count=j=i=0; i<SCORESIZE; i++) /* is there anyone on the scoreboard? */ if (winr[i].score != 0) { j++; break; } @@ -230,7 +230,7 @@ winshou() shou(x) int x; { - register int i,j,n,k; + int i,j,n,k; int count; for (count=j=i=0; i<SCORESIZE; i++) /* is the scoreboard empty? */ if (sco[i].score!= 0) @@ -274,7 +274,7 @@ shou(x) static char esb[] = "The scoreboard is empty.\n"; showscores() { - register int i,j; + int i,j; lflush(); lcreat((char*)0); if (readboard()<0) return; i=winshou(); j=shou(0); if (i+j == 0) lprcat(esb); else lprc('\n'); @@ -288,7 +288,7 @@ showscores() */ showallscores() { - register int i,j; + int i,j; lflush(); lcreat((char*)0); if (readboard()<0) return; c[WEAR] = c[WIELD] = c[SHIELD] = -1; /* not wielding or wearing anything */ for (i=0; i<MAXPOTION; i++) potionname[i][0]=' '; @@ -305,7 +305,7 @@ showallscores() */ sortboard() { - register int i,j,pos; + int i,j,pos; long jdat; for (i=0; i<SCORESIZE; i++) sco[i].order = winr[i].order = -1; pos=0; while (pos < SCORESIZE) @@ -341,7 +341,7 @@ newscore(score, whoo, whyded, winner) int winner, whyded; char *whoo; { - register int i; + int i; long taxes; if (readboard() < 0) return; /* do the scoreboard */ /* if a winner then delete all non-winning scores */ @@ -384,7 +384,7 @@ new1sub(score,i,whoo,taxes) int i; char *whoo; { - register struct wscofmt *p; + struct wscofmt *p; p = &winr[i]; p->taxes += taxes; if ((score >= p->score) || (c[HARDGAME] > p->hardlev)) @@ -409,8 +409,8 @@ new2sub(score,i,whoo,whyded) int i,whyded; char *whoo; { - register int j; - register struct scofmt *p; + int j; + struct scofmt *p; p = &sco[i]; if ((score >= p->score) || (c[HARDGAME] > p->hardlev)) { @@ -467,7 +467,7 @@ static int scorerror; died(x) int x; { - register int f,win; + int f,win; char ch,*mod; time_t zzz; long i; @@ -555,7 +555,7 @@ invalid: diedsub(x) int x; { - register char ch,*mod; + char ch,*mod; lprintf("Score: %d, Diff: %d, %s ",(long)c[GOLD],(long)c[HARDGAME],logname); if (x < 256) { @@ -573,8 +573,8 @@ int x; */ diedlog() { - register int n; - register char *p; + int n; + char *p; struct stat stbuf; lcreat((char*)0); if (lopen(logfile)<0) @@ -620,7 +620,7 @@ getplid(nam) char *nam; { int fd7,high=999,no; - register char *p,*p2; + char *p,*p2; char name[80]; if (havepid != -1) return(havepid); /* already did it */ lflush(); /* flush any pending I/O */ diff --git a/games/larn/store.c b/games/larn/store.c index e751554..9f64c95 100644 --- a/games/larn/store.c +++ b/games/larn/store.c @@ -174,7 +174,7 @@ static void dnditem(); dnd_hed() { - register int i; + int i; for (i=dnditm; i<26+dnditm; i++) dnditem(i); cursor(50,18); lprcat("You have "); } @@ -204,7 +204,7 @@ static void nogold() dndstore() { - register int i; + int i; dnditm = 0; nosignal = 1; /* disable signals */ clear(); dnd_2hed(); @@ -264,9 +264,9 @@ dndstore() */ static void dnditem(i) - register int i; + int i; { - register int j,k; + int j,k; if (i >= maxitm) return; cursor( (j=(i&1)*40+1) , (k=((i%26)>>1)+5) ); if (itm[i].qty == 0) { lprintf("%39s",""); return; } @@ -318,7 +318,7 @@ sch_hed() oschool() { - register int i; + int i; long time_used; nosignal = 1; /* disable signals */ sch_hed(); @@ -423,7 +423,7 @@ banktitle(str) clear(); lprcat(str); if (outstanding_taxes>0) { - register int i; + int i; lprcat("\n\nThe Larn Revenue Service has ordered that your account be frozen until all\n"); beep(); lprintf("levied taxes have been paid. They have also told us that you owe %d gp in\n",(long)outstanding_taxes); lprcat("taxes, and we must comply with them. We cannot serve you at this time. Sorry.\n"); @@ -444,7 +444,7 @@ banktitle(str) */ ointerest() { - register int i; + int i; if (c[BANKACCOUNT]<0) c[BANKACCOUNT] = 0; else if ((c[BANKACCOUNT]>0) && (c[BANKACCOUNT]<500000)) { @@ -461,7 +461,7 @@ static long gemvalue[26]={0}; /* the appraisal of the gems */ obanksub() { unsigned long amt; - register int i,k; + int i,k; ointerest(); /* credit any needed interest */ for (k=i=0; i<26; i++) @@ -547,9 +547,9 @@ obanksub() subroutine to appraise any stone for the bank */ appraise(gemstone) - register int gemstone; + int gemstone; { - register int j,amt; + int j,amt; for (j=0; j<26; j++) if (iven[j]==gemstone) { @@ -589,7 +589,7 @@ static otradhead() otradepost() { - register int i,j,value,isub,izarg; + int i,j,value,isub,izarg; dnditm = dndcount = 0; nosignal = 1; /* disable signals */ resetscroll(); otradhead(); @@ -652,7 +652,7 @@ cnsitm() */ olrs() { - register int i,first; + int i,first; unsigned long amt; first = nosignal = 1; /* disable signals */ clear(); resetscroll(); cursor(1,4); diff --git a/games/larn/tok.c b/games/larn/tok.c index ff19398..449c7d2 100644 --- a/games/larn/tok.c +++ b/games/larn/tok.c @@ -114,7 +114,7 @@ flushall() sethard(hard) int hard; { - register int j,k,i; + int j,k,i; j=c[HARDGAME]; hashewon(); if (restorflag==0) /* don't set c[HARDGAME] if restoring game */ { @@ -143,8 +143,8 @@ sethard(hard) */ readopts() { - register char *i; - register int j,k; + char *i; + int j,k; int flag; flag=1; /* set to 0 if he specifies a name for his character */ if (lopen(optsfile) < 0) diff --git a/games/mille/comp.c b/games/mille/comp.c index 65f9645..798dce8 100644 --- a/games/mille/comp.c +++ b/games/mille/comp.c @@ -47,13 +47,13 @@ static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93"; calcmove() { - register CARD card; - register int *value; - register PLAY *pp, *op; - register bool foundend, cango, canstop, foundlow; - register unsgn int i, count200, badcount, nummin, nummax, diff; - register int curmin, curmax; - register CARD safe, oppos; + CARD card; + int *value; + PLAY *pp, *op; + bool foundend, cango, canstop, foundlow; + unsgn int i, count200, badcount, nummin, nummax, diff; + int curmin, curmax; + CARD safe, oppos; int valbuf[HAND_SZ], count[NUM_CARDS]; bool playit[HAND_SZ]; @@ -401,9 +401,9 @@ play_it: * Return true if the given player could conceivably win with his next card. */ onecard(pp) -register PLAY *pp; +PLAY *pp; { - register CARD bat, spd, card; + CARD bat, spd, card; bat = pp->battle; spd = pp->speed; @@ -433,8 +433,8 @@ register PLAY *pp; } canplay(pp, op, card) -register PLAY *pp, *op; -register CARD card; +PLAY *pp, *op; +CARD card; { switch (card) { case C_200: diff --git a/games/mille/end.c b/games/mille/end.c index 3a18dba..4fb5f9f 100644 --- a/games/mille/end.c +++ b/games/mille/end.c @@ -48,9 +48,9 @@ static char sccsid[] = "@(#)end.c 8.1 (Berkeley) 5/31/93"; * the end-of-games points to the user who deserves it (if any). */ finalscore(pp) -reg PLAY *pp; { + PLAY *pp; { - reg int temp, tot, num; + int temp, tot, num; if (pp->was_finished == Finished) return; @@ -92,9 +92,9 @@ static int Last_tot[2]; /* last tot used for extrapolate */ * the end-of-games points to the user who deserves it (if any). */ extrapolate(pp) -reg PLAY *pp; { + PLAY *pp; { - reg int x, num, tot, count; + int x, num, tot, count; num = pp - Player; tot += SC_TRIP + SC_DELAY + SC_EXT; diff --git a/games/mille/init.c b/games/mille/init.c index 6aaaf2a..d5e64f7 100644 --- a/games/mille/init.c +++ b/games/mille/init.c @@ -45,9 +45,9 @@ static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93"; init() { - reg PLAY *pp; - reg int i, j; - reg CARD card; + PLAY *pp; + int i, j; + CARD card; bzero(Numseen, sizeof Numseen); Numgos = 0; @@ -88,8 +88,8 @@ init() { shuffle() { - reg int i, r; - reg CARD temp; + int i, r; + CARD temp; for (i = 0; i < DECK_SZ; i++) { r = roll(1, DECK_SZ) - 1; @@ -106,8 +106,8 @@ shuffle() { newboard() { - register int i; - register PLAY *pp; + int i; + PLAY *pp; static int first = TRUE; if (first) { @@ -164,8 +164,8 @@ newboard() { newscore() { - reg int i, new; - register PLAY *pp; + int i, new; + PLAY *pp; static int was_full = -1; static int last_win = -1; diff --git a/games/mille/mille.c b/games/mille/mille.c index ff96b60..ca6e12c 100644 --- a/games/mille/mille.c +++ b/games/mille/mille.c @@ -64,10 +64,10 @@ static void usage __P((void)); int main(ac, av) -reg int ac; -reg char *av[]; { + int ac; + char *av[]; { - reg bool restore; + bool restore; /* revoke */ setgid(getgid()); diff --git a/games/mille/mille.h b/games/mille/mille.h index c8281d5..8269fdb 100644 --- a/games/mille/mille.h +++ b/games/mille/mille.h @@ -167,10 +167,6 @@ # endif # endif SYSV -#ifndef reg -#define reg /* register */ -#endif - typedef struct { bool coups[NUM_SAFE]; bool can_go; diff --git a/games/mille/misc.c b/games/mille/misc.c index 7cf6248..86e6b10 100644 --- a/games/mille/misc.c +++ b/games/mille/misc.c @@ -71,7 +71,7 @@ char *str; CARD getcard() { - reg int c, c1; + int c, c1; for (;;) { while ((c = readch()) == '\n' || c == '\r' || c == ' ') @@ -118,7 +118,7 @@ cont: ; } check_ext(forcomp) -reg bool forcomp; { +bool forcomp; { if (End == 700) @@ -137,8 +137,8 @@ done: } } else { - reg PLAY *pp, *op; - reg int i, safe, miles; + PLAY *pp, *op; + int i, safe, miles; pp = &Player[COMP]; op = &Player[PLAYER]; @@ -172,9 +172,9 @@ done: * also allowed. Return TRUE if the answer was yes, FALSE if no. */ getyn(promptno) -register int promptno; { +int promptno; { - reg char c; + char c; Saved = FALSE; for (;;) { @@ -245,7 +245,7 @@ check_more() readch() { - reg int cnt; + int cnt; static char c; for (cnt = 0; read(0, &c, 1) <= 0; cnt++) diff --git a/games/mille/move.c b/games/mille/move.c index e3c60ba..b3741ee 100644 --- a/games/mille/move.c +++ b/games/mille/move.c @@ -60,9 +60,9 @@ char *Movenames[] = { domove() { - reg PLAY *pp; - reg int i, j; - reg bool goodplay; + PLAY *pp; + int i, j; + bool goodplay; pp = &Player[Play]; if (Play == PLAYER) @@ -163,9 +163,9 @@ acc: */ check_go() { - reg CARD card; - reg PLAY *pp, *op; - reg int i; + CARD card; + PLAY *pp, *op; + int i; for (pp = Player; pp < &Player[2]; pp++) { op = (pp == &Player[COMP] ? &Player[PLAYER] : &Player[COMP]); @@ -192,10 +192,10 @@ check_go() { } playcard(pp) -reg PLAY *pp; +PLAY *pp; { - reg int v; - reg CARD card; + int v; + CARD card; /* * check and see if player has picked @@ -342,7 +342,7 @@ protected: getmove() { - reg char c, *sp; + char c, *sp; #ifdef EXTRAP static bool last_ex = FALSE; /* set if last command was E */ @@ -471,9 +471,9 @@ ret: * return whether or not the player has picked */ haspicked(pp) -reg PLAY *pp; { +PLAY *pp; { - reg int card; + int card; if (Topcard <= Deck) return TRUE; @@ -490,9 +490,9 @@ reg PLAY *pp; { } account(card) -reg CARD card; { +CARD card; { - reg CARD oppos; + CARD oppos; if (card == C_INIT) return; @@ -546,10 +546,10 @@ int promptno; } sort(hand) -reg CARD *hand; +CARD *hand; { - reg CARD *cp, *tp; - reg CARD temp; + CARD *cp, *tp; + CARD temp; cp = hand; hand += HAND_SZ; diff --git a/games/mille/print.c b/games/mille/print.c index 72a97a4..9a227bc 100644 --- a/games/mille/print.c +++ b/games/mille/print.c @@ -48,8 +48,8 @@ static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 5/31/93"; prboard() { - reg PLAY *pp; - reg int i, j, k, temp; + PLAY *pp; + int i, j, k, temp; for (k = 0; k < 2; k++) { pp = &Player[k]; @@ -64,8 +64,8 @@ prboard() { show_card(14, temp, pp->battle, &pp->sh_battle); show_card(16, temp, pp->speed, &pp->sh_speed); for (i = C_25; i <= C_200; i++) { - reg char *name; - reg int end; + char *name; + int end; if (pp->nummiles[i] == pp->sh_nummiles[i]) continue; @@ -102,7 +102,7 @@ prboard() { */ show_card(y, x, c, lc) int y, x; -register CARD c, *lc; +CARD c, *lc; { if (c == *lc) return; @@ -114,10 +114,10 @@ register CARD c, *lc; static char Score_fmt[] = "%4d"; prscore(for_real) -reg bool for_real; { +bool for_real; { - reg PLAY *pp; - reg int x; + PLAY *pp; + int x; stdscr = Score; for (pp = Player; pp < &Player[2]; pp++) { @@ -161,7 +161,7 @@ reg bool for_real; { */ show_score(y, x, s, ls) int y, x; -register int s, *ls; +int s, *ls; { if (s == *ls) return; diff --git a/games/mille/roll.c b/games/mille/roll.c index b91a8d9..017ac3f 100644 --- a/games/mille/roll.c +++ b/games/mille/roll.c @@ -47,9 +47,9 @@ static char sccsid[] = "@(#)roll.c 8.1 (Berkeley) 5/31/93"; */ roll(ndie, nsides) -reg int ndie, nsides; { +int ndie, nsides; { - reg int tot; + int tot; tot = 0; while (ndie--) diff --git a/games/mille/save.c b/games/mille/save.c index 9efb7f8..728bc1c 100644 --- a/games/mille/save.c +++ b/games/mille/save.c @@ -67,9 +67,9 @@ int read(), write(); save() { extern int errno; - reg char *sp; - reg int outf; - reg time_t *tp; + char *sp; + int outf; + time_t *tp; char buf[80]; time_t tme; STAT junk; @@ -143,10 +143,10 @@ over: * be cleaned up before the game starts. */ rest_f(file) -reg char *file; { +char *file; { - reg char *sp; - reg int inf; + char *sp; + int inf; char buf[80]; STAT sbuf; diff --git a/games/mille/table.c b/games/mille/table.c index 3bf601c..b488f31 100644 --- a/games/mille/table.c +++ b/games/mille/table.c @@ -53,7 +53,7 @@ static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 5/31/93"; main() { - reg int i, j, count; + int i, j, count; printf(" %16s -> %5s %5s %4s %s\n", "Card", "cards", "count", "need", "opposite"); for (i = 0; i < NUM_CARDS - 1; i++) { diff --git a/games/mille/types.c b/games/mille/types.c index f03141d..52f4baf 100644 --- a/games/mille/types.c +++ b/games/mille/types.c @@ -44,13 +44,13 @@ static char sccsid[] = "@(#)types.c 8.1 (Berkeley) 5/31/93"; */ isrepair(card) -reg CARD card; { +CARD card; { return card == C_GAS || card == C_SPARE || card == C_REPAIRS || card == C_INIT; } safety(card) -reg CARD card; { +CARD card; { switch (card) { case C_EMPTY: diff --git a/games/mille/varpush.c b/games/mille/varpush.c index 7f79d8f..8257c7a 100644 --- a/games/mille/varpush.c +++ b/games/mille/varpush.c @@ -51,8 +51,8 @@ int read(), write(); * channel file. func() is either read or write. */ varpush(file, func) -reg int file; -reg int (*func)(); { +int file; +int (*func)(); { int temp; diff --git a/games/morse/morse.c b/games/morse/morse.c index 5f3ef36..ba89ec9 100644 --- a/games/morse/morse.c +++ b/games/morse/morse.c @@ -213,8 +213,8 @@ main(int argc, char **argv) { extern char *optarg; extern int optind; - register int ch; - register char *p; + int ch; + char *p; while ((ch = getopt(argc, argv, "spw:f:")) != -1) switch ((char) ch) { diff --git a/games/number/number.c b/games/number/number.c index 6eb8130..75e8008 100644 --- a/games/number/number.c +++ b/games/number/number.c @@ -128,8 +128,8 @@ void convert(line) char *line; { - register flen, len, rval; - register char *p, *fraction; + flen, len, rval; + char *p, *fraction; fraction = NULL; for (p = line; *p != '\0' && *p != '\n'; ++p) { @@ -194,10 +194,10 @@ badnum: errx(1, "illegal number: %s", line); int unit(len, p) - register int len; - register char *p; + int len; + char *p; { - register int off, rval; + int off, rval; rval = 0; if (len > 3) { @@ -230,10 +230,10 @@ unit(len, p) int number(p, len) - register char *p; + char *p; int len; { - register int val, rval; + int val, rval; rval = 0; switch (len) { diff --git a/games/phantasia/fight.c b/games/phantasia/fight.c index 021b89b..ae778d4 100644 --- a/games/phantasia/fight.c +++ b/games/phantasia/fight.c @@ -1166,7 +1166,7 @@ struct monster Othermonster; /* to find a name for mimics */ awardtreasure() { -register int whichtreasure; /* calculated treasure to grant */ +int whichtreasure; /* calculated treasure to grant */ int temp; /* temporary */ int ch; /* input */ double treasuretype; /* monster's treasure type */ @@ -1659,8 +1659,8 @@ scramblestats() { double dbuf[6]; /* to put statistic in */ double dtemp1, dtemp2; /* for swapping values */ -register int first, second; /* indices for swapping */ -register double *dptr; /* pointer for filling and emptying buf[] */ +int first, second; /* indices for swapping */ +double *dptr; /* pointer for filling and emptying buf[] */ /* fill buffer */ dptr = &dbuf[0]; diff --git a/games/phantasia/gamesupport.c b/games/phantasia/gamesupport.c index 14d6bdc..23711d2 100644 --- a/games/phantasia/gamesupport.c +++ b/games/phantasia/gamesupport.c @@ -58,8 +58,8 @@ bool ingameflag; { static char flag[2] = /* for printing values of bools */ {'F', 'T'}; -register struct player *playerp;/* pointer to structure to alter */ -register char *prompt; /* pointer to prompt string */ +struct player *playerp;/* pointer to structure to alter */ +char *prompt; /* pointer to prompt string */ int c; /* input */ int today; /* day of year of today */ int temp; /* temporary variable */ @@ -515,7 +515,7 @@ BALTER: monstlist() { -register int count = 0; /* count in file */ +int count = 0; /* count in file */ puts(" #) Name Str Brain Quick Energy Exper Treas Type Flock%\n"); fseek(Monstfp, 0L, 0); @@ -552,7 +552,7 @@ register int count = 0; /* count in file */ scorelist() { struct scoreboard sbuf; /* for reading entries */ -register FILE *fp; /* to open the file */ +FILE *fp; /* to open the file */ if ((fp = fopen(_PATH_SCORE, "r")) != NULL) { diff --git a/games/phantasia/interplayer.c b/games/phantasia/interplayer.c index 16ef1a6..6a7f9ec 100644 --- a/games/phantasia/interplayer.c +++ b/games/phantasia/interplayer.c @@ -114,7 +114,7 @@ long foeplace; { double dtemp; /* for temporary calculations */ double oldhits = 0.0; /* previous damage inflicted by foe */ -register int loop; /* for timing out */ +int loop; /* for timing out */ int ch; /* input */ short oldtampered; /* old value of foe's p_tampered */ @@ -733,7 +733,7 @@ long loc; /* location in file of other players */ userlist(ingameflag) bool ingameflag; { -register int numusers = 0; /* number of users on file */ +int numusers = 0; /* number of users on file */ if (ingameflag && Player.p_blindness) { @@ -1160,7 +1160,7 @@ FILE *fp; /* for opening gold file */ *************************************************************************/ writevoid(vp, loc) -register struct energyvoid *vp; +struct energyvoid *vp; long loc; { diff --git a/games/phantasia/io.c b/games/phantasia/io.c index af74b56..bfd2564 100644 --- a/games/phantasia/io.c +++ b/games/phantasia/io.c @@ -43,10 +43,10 @@ *************************************************************************/ getstring(cp, mx) -register char *cp; -register int mx; +char *cp; +int mx; { -register char *inptr; /* pointer into string for next string */ +char *inptr; /* pointer into string for next string */ int x, y; /* original x, y coordinates on screen */ int ch; /* input */ @@ -234,7 +234,7 @@ inputoption() interrupt() { char line[81]; /* a place to store data already on screen */ -register int loop; /* counter */ +int loop; /* counter */ int x, y; /* coordinates on screen */ int ch; /* input */ unsigned savealarm; /* to save alarm value */ diff --git a/games/phantasia/main.c b/games/phantasia/main.c index e17630c..8840bae 100644 --- a/games/phantasia/main.c +++ b/games/phantasia/main.c @@ -524,7 +524,7 @@ double x; /* desired new x coordinate */ double y; /* desired new y coordinate */ double temp; /* for temporary calculations */ FILE *fp; /* for opening files */ -register int loop; /* a loop counter */ +int loop; /* a loop counter */ bool hasmoved = FALSE; /* set if player has moved */ ch = inputoption(); @@ -752,7 +752,7 @@ bool hasmoved = FALSE; /* set if player has moved */ titlelist() { -register FILE *fp; /* used for opening various files */ +FILE *fp; /* used for opening various files */ bool councilfound = FALSE; /* set if we find a member of the council */ bool kingfound = FALSE; /* set if we find a king */ double hiexp, nxtexp; /* used for finding the two highest players */ @@ -887,7 +887,7 @@ long recallplayer() { long loc = 0L; /* location in player file */ -register int loop; /* loop counter */ +int loop; /* loop counter */ int ch; /* input */ clear(); @@ -1106,8 +1106,8 @@ int ch; /* input */ genchar(type) int type; { -register int subscript; /* used for subscripting into Stattable */ -register struct charstats *statptr;/* for pointing into Stattable */ +int subscript; /* used for subscripting into Stattable */ +struct charstats *statptr;/* for pointing into Stattable */ subscript = type - '1'; diff --git a/games/phantasia/misc.c b/games/phantasia/misc.c index 28035cb..d0fbecc 100644 --- a/games/phantasia/misc.c +++ b/games/phantasia/misc.c @@ -37,7 +37,7 @@ movelevel() { -register struct charstats *statptr; /* for pointing into Stattable */ +struct charstats *statptr; /* for pointing into Stattable */ double new; /* new level */ double inc; /* increment between new and old levels */ @@ -121,8 +121,8 @@ struct player *playerp; bool shortflag; { double circle; /* corresponding circle for coordinates */ -register int quadrant; /* quandrant of grid */ -register char *label; /* pointer to place name */ +int quadrant; /* quandrant of grid */ +char *label; /* pointer to place name */ static char *nametable[4][4] = /* names of places */ { "Anorien", "Ithilien", "Rohan", "Lorien", @@ -222,8 +222,8 @@ double numitems; /* number of items to purchase */ double cost; /* cost of purchase */ double blessingcost; /* cost of blessing */ int ch; /* input */ -register int size; /* size of the trading post */ -register int loop; /* loop counter */ +int size; /* size of the trading post */ +int loop; /* loop counter */ int cheat = 0; /* number of times player has tried to cheat */ bool dishonest = FALSE;/* set when merchant is dishonest */ @@ -604,7 +604,7 @@ descrtype(playerp, shortflag) struct player *playerp; bool shortflag; { -register int type; /* for caluculating result subscript */ +int type; /* for caluculating result subscript */ static char *results[] = /* description table */ { " Magic User", " MU", @@ -694,8 +694,8 @@ static char *results[] = /* description table */ long findname(name, playerp) -register char *name; -register struct player *playerp; +char *name; +struct player *playerp; { long loc = 0; /* location in the file */ @@ -997,7 +997,7 @@ static char *deathmesg[] = *************************************************************************/ writerecord(playerp, place) -register struct player *playerp; +struct player *playerp; long place; { fseek(Playersfp, place, 0); @@ -1065,9 +1065,9 @@ double experience; *************************************************************************/ truncstring(string) -register char *string; +char *string; { -register int length; /* length of string */ +int length; /* length of string */ length = strlen(string); while (string[--length] == ' ') @@ -1178,7 +1178,7 @@ int operation; *************************************************************************/ readrecord(playerp, loc) -register struct player *playerp; +struct player *playerp; long loc; { fseek(Playersfp, loc, 0); @@ -1327,7 +1327,7 @@ double dtemp; /* for temporary calculations */ *************************************************************************/ initplayer(playerp) -register struct player *playerp; +struct player *playerp; { playerp->p_experience = playerp->p_level = @@ -1559,7 +1559,7 @@ int whichsig; char * descrstatus(playerp) -register struct player *playerp; +struct player *playerp; { switch (playerp->p_status) { diff --git a/games/phantasia/setup.c b/games/phantasia/setup.c index a6f2d6e..fddf7f4 100644 --- a/games/phantasia/setup.c +++ b/games/phantasia/setup.c @@ -60,7 +60,7 @@ main(argc, argv) int argc; char *argv[]; { - register char **filename; /* for pointing to file names */ + char **filename; /* for pointing to file names */ register int fd; /* file descriptor */ FILE *fp; /* for opening files */ struct stat fbuf; /* for getting files statistics */ diff --git a/games/pig/pig.c b/games/pig/pig.c index 51040d9..f0d113f 100644 --- a/games/pig/pig.c +++ b/games/pig/pig.c @@ -59,7 +59,7 @@ main(argc, argv) int argc; char *argv[]; { - register int len; + int len; int ch; char buf[1024]; @@ -95,7 +95,7 @@ pigout(buf, len) char *buf; int len; { - register int ch, start; + int ch, start; int olen; /* diff --git a/games/ppt/ppt.c b/games/ppt/ppt.c index 6bd4706..6d87821 100644 --- a/games/ppt/ppt.c +++ b/games/ppt/ppt.c @@ -51,8 +51,8 @@ main(argc, argv) int argc; char **argv; { - register int c; - register char *p; + int c; + char *p; (void) puts("___________"); if (argc > 1) @@ -67,9 +67,9 @@ main(argc, argv) static void putppt(c) - register int c; + int c; { - register int i; + int i; (void) putchar('|'); for (i = 7; i >= 0; i--) { diff --git a/games/primes/primes.c b/games/primes/primes.c index 9859def..5d78945 100644 --- a/games/primes/primes.c +++ b/games/primes/primes.c @@ -224,11 +224,11 @@ primes(start, stop) ubig start; /* where to start generating */ ubig stop; /* don't generate at or above this value */ { - register char *q; /* sieve spot */ - register ubig factor; /* index and factor */ - register char *tab_lim; /* the limit to sieve on the table */ - register ubig *p; /* prime table pointer */ - register ubig fact_lim; /* highest prime for current block */ + char *q; /* sieve spot */ + ubig factor; /* index and factor */ + char *tab_lim; /* the limit to sieve on the table */ + ubig *p; /* prime table pointer */ + ubig fact_lim; /* highest prime for current block */ /* * A number of systems can not convert double values into unsigned diff --git a/games/quiz/quiz.c b/games/quiz/quiz.c index 962ae90..c5e9dd1 100644 --- a/games/quiz/quiz.c +++ b/games/quiz/quiz.c @@ -80,7 +80,7 @@ main(argc, argv) int argc; char *argv[]; { - register int ch; + int ch; char *indexfile; /* revoke */ @@ -122,8 +122,8 @@ void get_file(file) char *file; { - register FILE *fp; - register QE *qp; + FILE *fp; + QE *qp; size_t len; char *lp; @@ -158,8 +158,8 @@ get_file(file) void show_index() { - register QE *qp; - register char *p, *s; + QE *qp; + char *p, *s; FILE *pf; if ((pf = popen(_PATH_PAGER, "w")) == NULL) @@ -185,7 +185,7 @@ void get_cats(cat1, cat2) char *cat1, *cat2; { - register QE *qp; + QE *qp; int i; char *s; @@ -217,8 +217,8 @@ get_cats(cat1, cat2) void quiz() { - register QE *qp; - register int i; + QE *qp; + int i; size_t len; u_int guesses, rights, wrongs; int next; @@ -297,7 +297,7 @@ quiz() char * next_cat(s) - register char * s; + char * s; { for (;;) switch (*s++) { @@ -315,11 +315,11 @@ next_cat(s) char * appdstr(s, tp, len) char *s; - register char *tp; + char *tp; size_t len; { - register char *mp, *sp; - register int ch; + char *mp, *sp; + int ch; char *m; if ((m = malloc(strlen(s) + len + 1)) == NULL) @@ -350,9 +350,9 @@ score(r, w, g) void downcase(p) - register char *p; + char *p; { - register int ch; + int ch; for (; ch = *p; ++p) if (isascii(ch) && isupper(ch)) diff --git a/games/quiz/rxp.c b/games/quiz/rxp.c index 404ba8f..21180cd 100644 --- a/games/quiz/rxp.c +++ b/games/quiz/rxp.c @@ -86,14 +86,14 @@ static int rxp__match __P((char *, int, Rxp_t *, Rxp_t *, char *)); int rxp_compile(s) - register char * s; + char * s; { return (rxp__compile(s, TRUE)); } static int rxp__compile(s, first) - register char *s; + char *s; int first; { static Rxp_t *rp; @@ -191,7 +191,7 @@ rxp__compile(s, first) */ int rxp_match(s) - register char * s; + char * s; { return (rxp__match(s, TRUE, NULL, NULL, NULL)); } @@ -206,7 +206,7 @@ rxp__match(s, first, j_succ, j_fail, sp_fail) { static Rxp_t *rp; static char *sp; - register int ch; + int ch; Rxp_t *grp_end; int err; diff --git a/games/rain/rain.c b/games/rain/rain.c index 92ea28b..99c1ea6 100644 --- a/games/rain/rain.c +++ b/games/rain/rain.c @@ -63,7 +63,7 @@ main(argc, argv) int argc; char **argv; { - register int x, y, j; + int x, y, j; long cols, lines; int xpos[5], ypos[5]; unsigned int delay = 0; diff --git a/games/robots/init_field.c b/games/robots/init_field.c index 7ed38df..43bf89b 100644 --- a/games/robots/init_field.c +++ b/games/robots/init_field.c @@ -47,9 +47,9 @@ static char sccsid[] = "@(#)init_field.c 8.1 (Berkeley) 5/31/93"; */ init_field() { - register int i; - register WINDOW *wp; - register int j; + int i; + WINDOW *wp; + int j; static bool first = TRUE; static char *desc[] = { "Directions:", diff --git a/games/robots/main.c b/games/robots/main.c index 6ca6f88..0be8409 100644 --- a/games/robots/main.c +++ b/games/robots/main.c @@ -52,9 +52,9 @@ main(ac, av) int ac; char **av; { - register char *sp; - register bool bad_arg; - register bool show_only; + char *sp; + bool bad_arg; + bool show_only; extern char *Scorefile; extern int Max_per_uid; void quit(); @@ -173,7 +173,7 @@ quit() */ another() { - register int y; + int y; #ifdef FANCY if ((Stand_still || Pattern_roll) && !Newscore) diff --git a/games/robots/make_level.c b/games/robots/make_level.c index a6f06ef..06e908e 100644 --- a/games/robots/make_level.c +++ b/games/robots/make_level.c @@ -45,10 +45,10 @@ static char sccsid[] = "@(#)make_level.c 8.1 (Berkeley) 5/31/93"; */ make_level() { - register int i; - register COORD *cp; - register WINDOW *wp; - register int x, *endp; + int i; + COORD *cp; + WINDOW *wp; + int x, *endp; reset_count(); for (i = 1; i < Y_FIELDSIZE; i++) diff --git a/games/robots/move.c b/games/robots/move.c index d3f0d07..6c274b2 100644 --- a/games/robots/move.c +++ b/games/robots/move.c @@ -49,8 +49,8 @@ static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93"; */ get_move() { - register int c; - register int y, x, lastmove; + int c; + int y, x, lastmove; static COORD newpos; if (Waiting) @@ -198,7 +198,7 @@ ret: */ must_telep() { - register int x, y; + int x, y; static COORD newpos; #ifdef FANCY @@ -264,9 +264,9 @@ int dy, dx; * Player would get eaten at this place */ eaten(pos) -register COORD *pos; +COORD *pos; { - register int x, y; + int x, y; for (y = pos->y - 1; y <= pos->y + 1; y++) { if (y <= 0 || y >= Y_FIELDSIZE) diff --git a/games/robots/move_robs.c b/games/robots/move_robs.c index bfc2c5c..560a1b4 100644 --- a/games/robots/move_robs.c +++ b/games/robots/move_robs.c @@ -48,9 +48,9 @@ void move_robots(was_sig) bool was_sig; { - register COORD *rp; - register int y, x; - register int mindist, d; + COORD *rp; + int y, x; + int mindist, d; static COORD newpos; if (Real_time) diff --git a/games/robots/play_level.c b/games/robots/play_level.c index dd72a15..ee33190 100644 --- a/games/robots/play_level.c +++ b/games/robots/play_level.c @@ -45,8 +45,8 @@ static char sccsid[] = "@(#)play_level.c 8.1 (Berkeley) 5/31/93"; */ play_level() { - register COORD *cp; - register int y, x, bonus; + COORD *cp; + int y, x, bonus; move(My_pos.y, My_pos.x); addch(PLAYER); diff --git a/games/robots/query.c b/games/robots/query.c index f7f046e..8f79499 100644 --- a/games/robots/query.c +++ b/games/robots/query.c @@ -47,8 +47,8 @@ static char sccsid[] = "@(#)query.c 8.1 (Berkeley) 5/31/93"; query(prompt) char *prompt; { - register int c, retval; - register int y, x; + int c, retval; + int y, x; getyx(stdscr, y, x); move(Y_PROMPT, X_PROMPT); diff --git a/games/robots/rnd_pos.c b/games/robots/rnd_pos.c index 971b331..933d765 100644 --- a/games/robots/rnd_pos.c +++ b/games/robots/rnd_pos.c @@ -51,7 +51,7 @@ rnd_pos() { static COORD pos; static int call = 0; - register int i = 0; + int i = 0; do { pos.y = rnd(Y_FIELDSIZE - 1) + 1; diff --git a/games/robots/score.c b/games/robots/score.c index 54c66ad..35e6167 100644 --- a/games/robots/score.c +++ b/games/robots/score.c @@ -63,10 +63,10 @@ static SCORE Top[MAXSCORES]; */ score() { - register int inf; - register SCORE *scp; - register int uid; - register bool done_show = FALSE; + int inf; + SCORE *scp; + int uid; + bool done_show = FALSE; static int numscores, max_uid; Newscore = FALSE; @@ -139,9 +139,9 @@ score() } set_name(scp) -register SCORE *scp; +SCORE *scp; { - register PASSWD *pp; + PASSWD *pp; if ((pp = getpwuid(scp->s_uid)) == NULL) pp->pw_name = "???"; @@ -153,7 +153,7 @@ register SCORE *scp; * Compare two scores. */ cmp_sc(s1, s2) -register SCORE *s1, *s2; +SCORE *s1, *s2; { return s2->s_score - s1->s_score; } @@ -164,8 +164,8 @@ register SCORE *s1, *s2; */ show_score() { - register SCORE *scp; - register int inf; + SCORE *scp; + int inf; static int max_score; if ((inf = open(Scorefile, 0)) < 0) { diff --git a/games/rogue/curses.c b/games/rogue/curses.c index e2e29db..6aa548e 100644 --- a/games/rogue/curses.c +++ b/games/rogue/curses.c @@ -168,7 +168,7 @@ char *str; } addch(ch) -register int ch; +int ch; { short row, col; @@ -193,7 +193,7 @@ int ch; refresh() { - register i, j, line; + i, j, line; short old_row, old_col, first_row; if (screen_dirty) { @@ -303,7 +303,7 @@ nonl() clear_buffers() { - register i, j; + i, j; screen_dirty = 0; @@ -317,7 +317,7 @@ clear_buffers() } put_char_at(row, col, ch) -register row, col, ch; +row, col, ch; { put_cursor(row, col); put_st_char(ch); @@ -326,9 +326,9 @@ register row, col, ch; } put_cursor(row, col) -register row, col; +row, col; { - register i, rdif, cdif; + i, rdif, cdif; short ch, t; rdif = (row > cur_row) ? row - cur_row : cur_row - row; @@ -380,7 +380,7 @@ register row, col; } put_st_char(ch) -register ch; +ch; { if ((ch & ST_MASK) && (!term_stand_out)) { ch &= ~ST_MASK; diff --git a/games/rogue/hit.c b/games/rogue/hit.c index c721711..bae3c60 100644 --- a/games/rogue/hit.c +++ b/games/rogue/hit.c @@ -62,7 +62,7 @@ extern short add_strength, ring_exp, r_rings; extern boolean being_held, interrupted, wizard, con_mon; mon_hit(monster) -register object *monster; +object *monster; { short damage, hit_chance; const char *mn; @@ -123,7 +123,7 @@ register object *monster; } rogue_hit(monster, force_hit) -register object *monster; +object *monster; boolean force_hit; { short damage, hit_chance; @@ -180,7 +180,7 @@ get_damage(ds, r) const char *ds; boolean r; { - register i = 0, j, n, d, total = 0; + i = 0, j, n, d, total = 0; while (ds[i]) { n = get_number(ds+i); @@ -206,8 +206,8 @@ get_w_damage(obj) const object *obj; { char new_damage[12]; - register to_hit, damage; - register i = 0; + to_hit, damage; + i = 0; if ((!obj) || (obj->what_is != WEAPON)) { return(-1); @@ -224,8 +224,8 @@ const object *obj; get_number(s) const char *s; { - register i = 0; - register total = 0; + i = 0; + total = 0; while ((s[i] >= '0') && (s[i] <= '9')) { total = (10 * total) + (s[i] - '0'); diff --git a/games/rogue/message.c b/games/rogue/message.c index 28ac6e3..732033c 100644 --- a/games/rogue/message.c +++ b/games/rogue/message.c @@ -192,7 +192,7 @@ boolean do_echo; rgetchar() { - register ch; + ch; for(;;) { ch = getchar(); @@ -222,7 +222,7 @@ Level: 99 Gold: 999999 Hp: 999(999) Str: 99(99) Arm: 99 Exp: 21/10000000 Hungry */ print_stats(stat_mask) -register stat_mask; +stat_mask; { char buf[16]; boolean label; diff --git a/games/rogue/monster.c b/games/rogue/monster.c index 0c32a4b..1490e43 100644 --- a/games/rogue/monster.c +++ b/games/rogue/monster.c @@ -146,8 +146,8 @@ put_mons() object * gr_monster(monster, mn) -register object *monster; -register mn; +object *monster; +mn; { if (!monster) { monster = alloc_object(); @@ -173,7 +173,7 @@ register mn; mv_mons() { - register object *monster, *next_monster, *test_mons; + object *monster, *next_monster, *test_mons; boolean flew; if (haste_self % 2) { @@ -267,9 +267,9 @@ int rn, n; } gmc_row_col(row, col) -register row, col; +row, col; { - register object *monster; + object *monster; if (monster = object_at(&level_monsters, row, col)) { if ((!(detect_monster || see_invisible || r_see_invisible) && @@ -300,7 +300,7 @@ object *monster; } mv_1_monster(monster, row, col) -register object *monster; +object *monster; short row, col; { short i, n; @@ -439,8 +439,8 @@ O: } mtry(monster, row, col) -register object *monster; -register short row, col; +object *monster; +short row, col; { if (mon_can_go(monster, row, col)) { move_mon_to(monster, row, col); @@ -450,11 +450,11 @@ register short row, col; } move_mon_to(monster, row, col) -register object *monster; -register short row, col; +object *monster; +short row, col; { short c; - register mrow, mcol; + mrow, mcol; mrow = monster->row; mcol = monster->col; @@ -501,7 +501,7 @@ register short row, col; mon_can_go(monster, row, col) const object *monster; -register short row, col; +short row, col; { object *obj; short dr, dc; @@ -603,7 +603,7 @@ const object *monster; } rogue_is_around(row, col) -register row, col; +row, col; { short rdif, cdif, retval; @@ -731,9 +731,9 @@ object *monster; } rogue_can_see(row, col) -register row, col; +row, col; { - register retval; + retval; retval = !blind && (((get_room_number(row, col) == cur_room) && diff --git a/games/rogue/move.c b/games/rogue/move.c index 4335a46..59c92e4 100644 --- a/games/rogue/move.c +++ b/games/rogue/move.c @@ -226,7 +226,7 @@ short dirch; } is_passable(row, col) -register row, col; +row, col; { if ((row < MIN_ROW) || (row > (DROWS - 2)) || (col < 0) || (col > (DCOLS-1))) { @@ -239,7 +239,7 @@ register row, col; } next_to_something(drow, dcol) -register drow, dcol; +drow, dcol; { short i, j, i_end, j_end, row, col; short pass_count = 0; @@ -375,7 +375,7 @@ boolean check_hunger(msg_only) boolean msg_only; { - register short i, n; + short i, n; boolean fainted = 0; if (rogue.moves_left == HUNGRY) { diff --git a/games/rogue/object.c b/games/rogue/object.c index 2086a86..3315972 100644 --- a/games/rogue/object.c +++ b/games/rogue/object.c @@ -240,7 +240,7 @@ int row, col; object * object_at(pack, row, col) -register object *pack; +object *pack; short row, col; { object *obj = (object *) 0; diff --git a/games/rogue/pack.c b/games/rogue/pack.c index 8b55e14..6946e96 100644 --- a/games/rogue/pack.c +++ b/games/rogue/pack.c @@ -246,8 +246,8 @@ object *obj, *pack; next_avail_ichar() { - register object *obj; - register i; + object *obj; + i; boolean ichars[26]; for (i = 0; i < 26; i++) { @@ -336,7 +336,7 @@ take_off() wear() { short ch; - register object *obj; + object *obj; char desc[DCOLS]; if (rogue.armor) { @@ -385,7 +385,7 @@ object *obj; wield() { short ch; - register object *obj; + object *obj; char desc[DCOLS]; if (rogue.weapon && rogue.weapon->is_cursed) { @@ -438,7 +438,7 @@ object *obj; call_it() { short ch; - register object *obj; + object *obj; struct id *id_table; char buf[MAX_TITLE_LENGTH+2]; diff --git a/games/rogue/random.c b/games/rogue/random.c index a41b9d9..19102a2 100644 --- a/games/rogue/random.c +++ b/games/rogue/random.c @@ -76,7 +76,7 @@ static long *end_ptr = &rntb[32]; srrandom(x) int x; { - register int i; + int i; state[0] = (long) x; if (rand_type != 0) { @@ -115,9 +115,9 @@ rrandom() #endif get_rand(x, y) -register int x, y; +int x, y; { - register int r, t; + int r, t; long lr; if (x > y) { @@ -133,7 +133,7 @@ register int x, y; } rand_percent(percentage) -register int percentage; +int percentage; { return(get_rand(1, 100) <= percentage); } diff --git a/games/rogue/room.c b/games/rogue/room.c index fe9f25f..6285ec2 100644 --- a/games/rogue/room.c +++ b/games/rogue/room.c @@ -175,9 +175,9 @@ short rn; } get_dungeon_char(row, col) -register row, col; +row, col; { - register unsigned short mask = dungeon[row][col]; + unsigned short mask = dungeon[row][col]; if (mask & MONSTER) { return(gmc_row_col(row, col)); @@ -223,7 +223,7 @@ register row, col; } get_mask_char(mask) -register unsigned short mask; +unsigned short mask; { switch(mask) { case SCROL: @@ -314,7 +314,7 @@ party_objects(rn) } get_room_number(row, col) -register row, col; +row, col; { short i; diff --git a/games/rogue/spec_hit.c b/games/rogue/spec_hit.c index fe87358..d0b99f5 100644 --- a/games/rogue/spec_hit.c +++ b/games/rogue/spec_hit.c @@ -372,7 +372,7 @@ object *monster; } imitating(row, col) -register short row, col; +short row, col; { if (dungeon[row][col] & MONSTER) { object *object_at(), *monster; diff --git a/games/rogue/trap.c b/games/rogue/trap.c index f538b65..7467f55 100644 --- a/games/rogue/trap.c +++ b/games/rogue/trap.c @@ -81,7 +81,7 @@ extern boolean sustain_strength; extern short blind; trap_at(row, col) -register row, col; +row, col; { short i; diff --git a/games/sail/assorted.c b/games/sail/assorted.c index 1f450c8..6056632 100644 --- a/games/sail/assorted.c +++ b/games/sail/assorted.c @@ -43,11 +43,11 @@ table(rig, shot, hittable, on, from, roll) struct ship *on, *from; int rig, shot, hittable, roll; { - register int hhits = 0, chits = 0, ghits = 0, rhits = 0; + int hhits = 0, chits = 0, ghits = 0, rhits = 0; int Ghit = 0, Hhit = 0, Rhit = 0, Chit = 0; int guns, car, pc, hull; int crew[3]; - register int n; + int n; int rigg[4]; char *message; struct Tables *tp; @@ -225,7 +225,7 @@ int rig, shot, hittable, roll; } Cleansnag(from, to, all, flag) -register struct ship *from, *to; +struct ship *from, *to; char all, flag; { if (flag & 1) { @@ -251,7 +251,7 @@ char all, flag; } strike(ship, from) -register struct ship *ship, *from; +struct ship *ship, *from; { int points; diff --git a/games/sail/dr_1.c b/games/sail/dr_1.c index 2c9c27a..00311fb 100644 --- a/games/sail/dr_1.c +++ b/games/sail/dr_1.c @@ -41,10 +41,10 @@ static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93"; unfoul() { - register struct ship *sp; + struct ship *sp; struct ship *to; - register int nat; - register i; + int nat; + i; foreachship(sp) { if (sp->file->captain[0]) @@ -64,7 +64,7 @@ unfoul() boardcomp() { int crew[3]; - register struct ship *sp, *sq; + struct ship *sp, *sq; foreachship(sp) { if (*sp->file->captain) @@ -229,7 +229,7 @@ int key; resolve() { int thwart; - register struct ship *sp, *sq; + struct ship *sp, *sq; foreachship(sp) { if (sp->file->dir == 0) @@ -258,8 +258,8 @@ resolve() compcombat() { - register n; - register struct ship *sp; + n; + struct ship *sp; struct ship *closest; int crew[3], men = 0, target, temp; int r, guns, ready, load, car; @@ -396,7 +396,7 @@ next() people = 0; } if (people <= 0 || windspeed == 7) { - register struct ship *s; + struct ship *s; struct ship *bestship; float net, best = 0.0; foreachship(s) { diff --git a/games/sail/dr_2.c b/games/sail/dr_2.c index 3dc0b1a..8f4549d 100644 --- a/games/sail/dr_2.c +++ b/games/sail/dr_2.c @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)dr_2.c 8.1 (Berkeley) 5/31/93"; thinkofgrapples() { - register struct ship *sp, *sq; + struct ship *sp, *sq; char friendly; foreachship(sp) { @@ -74,8 +74,8 @@ thinkofgrapples() checkup() { - register struct ship *sp, *sq; - register char explode, sink; + struct ship *sp, *sq; + char explode, sink; foreachship(sp) { if (sp->file->dir == 0) @@ -104,7 +104,7 @@ checkup() prizecheck() { - register struct ship *sp; + struct ship *sp; foreachship(sp) { if (sp->file->captured == 0) @@ -123,7 +123,7 @@ prizecheck() strend(str) char *str; { - register char *p; + char *p; for (p = str; *p; p++) ; @@ -131,7 +131,7 @@ char *str; } closeon(from, to, command, ta, ma, af) -register struct ship *from, *to; +struct ship *from, *to; char command[]; int ma, ta, af; { @@ -147,12 +147,12 @@ int dtab[] = {0,1,1,2,3,4,4,5}; /* diagonal distances in x==y */ score(movement, ship, to, onlytemp) char movement[]; -register struct ship *ship, *to; +struct ship *ship, *to; char onlytemp; { char drift; int row, col, dir, total, ran; - register struct File *fp = ship->file; + struct File *fp = ship->file; if ((dir = fp->dir) == 0) return 0; @@ -179,11 +179,11 @@ char onlytemp; } sail_move(p, ship, dir, row, col, drift) -register char *p; -register struct ship *ship; -register char *dir; -register short *row, *col; -register char *drift; +char *p; +struct ship *ship; +char *dir; +short *row, *col; +char *drift; { int dist; char moved = 0; @@ -223,11 +223,11 @@ register char *drift; } try(command, temp, ma, ta, af, vma, dir, f, t, high, rakeme) -register struct ship *f, *t; +struct ship *f, *t; int ma, ta, af, vma, dir, *high, rakeme; char command[], temp[]; { - register int new, n; + int new, n; char st[4]; #define rakeyou (gunsbear(f, t) && !gunsbear(t, f)) @@ -269,7 +269,7 @@ char command[], temp[]; rmend(str) char *str; { - register char *p; + char *p; for (p = str; *p; p++) ; diff --git a/games/sail/dr_3.c b/games/sail/dr_3.c index 5d656d7..5565457 100644 --- a/games/sail/dr_3.c +++ b/games/sail/dr_3.c @@ -41,9 +41,9 @@ static char sccsid[] = "@(#)dr_3.c 8.1 (Berkeley) 5/31/93"; moveall() /* move all comp ships */ { - register struct ship *sp, *sq; /* r11, r10 */ - register int n; /* r9 */ - register int k, l; /* r8, r7 */ + struct ship *sp, *sq; /* r11, r10 */ + int n; /* r9 */ + int k, l; /* r8, r7 */ int row[NSHIP], col[NSHIP], dir[NSHIP], drift[NSHIP]; char moved[NSHIP]; @@ -178,9 +178,9 @@ moveall() /* move all comp ships */ } stillmoving(k) -register int k; +int k; { - register struct ship *sp; + struct ship *sp; foreachship(sp) if (sp->file->movebuf[k]) @@ -189,9 +189,9 @@ register int k; } isolated(ship) -register struct ship *ship; +struct ship *ship; { - register struct ship *sp; + struct ship *sp; foreachship(sp) { if (ship != sp && range(ship, sp) <= 10) @@ -201,9 +201,9 @@ register struct ship *ship; } push(from, to) -register struct ship *from, *to; +struct ship *from, *to; { - register int bs, sb; + int bs, sb; sb = to->specs->guns; bs = from->specs->guns; @@ -216,10 +216,10 @@ register struct ship *from, *to; step(com, sp, moved) char com; -register struct ship *sp; +struct ship *sp; char *moved; { - register int dist; + int dist; switch (com) { case 'r': @@ -257,12 +257,12 @@ char *moved; } sendbp(from, to, sections, isdefense) -register struct ship *from, *to; +struct ship *from, *to; int sections; char isdefense; { int n; - register struct BP *bp; + struct BP *bp; bp = isdefense ? from->file->DBP : from->file->OBP; for (n = 0; n < NBP && bp[n].turnsent; n++) @@ -279,11 +279,11 @@ char isdefense; } toughmelee(ship, to, isdefense, count) -register struct ship *ship, *to; +struct ship *ship, *to; int isdefense, count; { - register struct BP *bp; - register obp = 0; + struct BP *bp; + obp = 0; int n, OBP = 0, DBP = 0, dbp = 0; int qual; @@ -312,7 +312,7 @@ int isdefense, count; reload() { - register struct ship *sp; + struct ship *sp; foreachship(sp) { sp->file->loadwith = 0; @@ -321,8 +321,8 @@ reload() checksails() { - register struct ship *sp; - register int rig, full; + struct ship *sp; + int rig, full; struct ship *close; foreachship(sp) { diff --git a/games/sail/dr_4.c b/games/sail/dr_4.c index d652579..1442a9d 100644 --- a/games/sail/dr_4.c +++ b/games/sail/dr_4.c @@ -40,9 +40,9 @@ static char sccsid[] = "@(#)dr_4.c 8.1 (Berkeley) 5/31/93"; #include "externs.h" ungrap(from, to) -register struct ship *from, *to; +struct ship *from, *to; { - register k; + k; char friend; if ((k = grappled2(from, to)) == 0) @@ -57,7 +57,7 @@ register struct ship *from, *to; } grap(from, to) -register struct ship *from, *to; +struct ship *from, *to; { if (capship(from)->nationality != capship(to)->nationality && die() > 2) return; diff --git a/games/sail/dr_5.c b/games/sail/dr_5.c index 62aa101..893d7cc 100644 --- a/games/sail/dr_5.c +++ b/games/sail/dr_5.c @@ -42,9 +42,9 @@ static char sccsid[] = "@(#)dr_5.c 8.1 (Berkeley) 5/31/93"; subtract(from, totalfrom, crewfrom, fromcap, pcfrom) struct ship *from, *fromcap; int pcfrom; -register int totalfrom, crewfrom[3]; +int totalfrom, crewfrom[3]; { - register int n; + int n; if (fromcap == from && totalfrom) { /* if not captured */ for (n = 0; n < 3; n++) { @@ -70,9 +70,9 @@ int crew[3], *pc; char isdefense; { /* returns # of crew squares sent */ int men = 0; - register int n; + int n; int c1, c2, c3; - register struct BP *bp; + struct BP *bp; *pc = from->file->pcrew; *captured = from->file->captured; diff --git a/games/sail/dr_main.c b/games/sail/dr_main.c index cbb3c73..ed5378e 100644 --- a/games/sail/dr_main.c +++ b/games/sail/dr_main.c @@ -41,8 +41,8 @@ static char sccsid[] = "@(#)dr_main.c 8.2 (Berkeley) 4/16/94"; dr_main() { - register int n; - register struct ship *sp; + int n; + struct ship *sp; int nat[NNATION]; int value = 0; diff --git a/games/sail/game.c b/games/sail/game.c index b2e6988..646340a 100644 --- a/games/sail/game.c +++ b/games/sail/game.c @@ -40,10 +40,10 @@ static char sccsid[] = "@(#)game.c 8.1 (Berkeley) 5/31/93"; #include "externs.h" maxturns(ship, af) -register struct ship *ship; +struct ship *ship; char *af; { - register int turns; + int turns; turns = ship->specs->ta; if (*af = (ship->file->drift > 1 && turns)) { @@ -55,10 +55,10 @@ char *af; } maxmove(ship, dir, fs) -register struct ship *ship; +struct ship *ship; int dir, fs; { - register int riggone = 0, Move, flank = 0; + int riggone = 0, Move, flank = 0; Move = ship->specs->bs; if (!ship->specs->rig1) diff --git a/games/sail/main.c b/games/sail/main.c index 8bb7f81..79d0c71 100644 --- a/games/sail/main.c +++ b/games/sail/main.c @@ -48,9 +48,9 @@ static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; /*ARGSUSED*/ main(argc, argv) int argc; - register char **argv; + char **argv; { - register char *p; + char *p; int i; srandomdev(); diff --git a/games/sail/misc.c b/games/sail/misc.c index 256425d4..56dc3c2 100644 --- a/games/sail/misc.c +++ b/games/sail/misc.c @@ -46,9 +46,9 @@ static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93"; range(from, to) struct ship *from, *to; { - register bow1r, bow1c, bow2r, bow2c; + bow1r, bow1c, bow2r, bow2c; int stern1r, stern1c, stern2c, stern2r; - register int bb, bs, sb, ss, result; + int bb, bs, sb, ss, result; if (!to->file->dir) return -1; @@ -72,11 +72,11 @@ struct ship *from, *to; struct ship * closestenemy(from, side, anyship) -register struct ship *from; +struct ship *from; char side, anyship; { - register struct ship *sp; - register char a; + struct ship *sp; + char a; int olddist = 30000, dist; struct ship *closest = 0; @@ -100,9 +100,9 @@ char side, anyship; } angle(dr, dc) -register dr, dc; +dr, dc; { - register i; + i; if (dc >= 0 && dr > 0) i = 0; @@ -127,10 +127,10 @@ register dr, dc; } gunsbear(from, to) /* checks for target bow or stern */ -register struct ship *from, *to; +struct ship *from, *to; { int Dr, Dc, i; - register ang; + ang; Dr = from->file->row - to->file->row; Dc = to->file->col - from->file->col; @@ -148,11 +148,11 @@ register struct ship *from, *to; } portside(from, on, quick) -register struct ship *from, *on; +struct ship *from, *on; int quick; /* returns true if fromship is */ { /* shooting at onship's starboard side */ - register ang; - register Dr, Dc; + ang; + Dr, Dc; Dr = from->file->row - on->file->row; Dc = on->file->col - from->file->col; @@ -168,9 +168,9 @@ int quick; /* returns true if fromship is */ } colours(sp) -register struct ship *sp; +struct ship *sp; { - register char flag; + char flag; if (sp->file->struck) flag = '!'; @@ -186,14 +186,14 @@ register struct ship *sp; #include <sys/file.h> log(s) -register struct ship *s; +struct ship *s; { FILE *fp; int persons; int n; struct logs log[NLOG]; float net; - register struct logs *lp; + struct logs *lp; if ((fp = fopen(_PATH_LOGFILE, "r+")) == NULL) return; diff --git a/games/sail/parties.c b/games/sail/parties.c index 874d071..250b1a0 100644 --- a/games/sail/parties.c +++ b/games/sail/parties.c @@ -41,10 +41,10 @@ static char sccsid[] = "@(#)parties.c 8.1 (Berkeley) 5/31/93"; meleeing(from, to) struct ship *from; -register struct ship *to; +struct ship *to; { - register struct BP *p = from->file->OBP; - register struct BP *q = p + NBP; + struct BP *p = from->file->OBP; + struct BP *q = p + NBP; for (; p < q; p++) if (p->turnsent && p->toship == to) @@ -53,11 +53,11 @@ register struct ship *to; } boarding(from, isdefense) -register struct ship *from; +struct ship *from; char isdefense; { - register struct BP *p = isdefense ? from->file->DBP : from->file->OBP; - register struct BP *q = p + NBP; + struct BP *p = isdefense ? from->file->DBP : from->file->OBP; + struct BP *q = p + NBP; for (; p < q; p++) if (p->turnsent) @@ -66,11 +66,11 @@ char isdefense; } unboard(ship, to, isdefense) -register struct ship *ship, *to; -register char isdefense; +struct ship *ship, *to; +char isdefense; { - register struct BP *p = isdefense ? ship->file->DBP : ship->file->OBP; - register n; + struct BP *p = isdefense ? ship->file->DBP : ship->file->OBP; + n; for (n = 0; n < NBP; p++, n++) if (p->turnsent && (p->toship == to || isdefense || ship == to)) diff --git a/games/sail/pl_2.c b/games/sail/pl_2.c index 0929419..1512443 100644 --- a/games/sail/pl_2.c +++ b/games/sail/pl_2.c @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)pl_2.c 8.1 (Berkeley) 5/31/93"; play() { - register struct ship *sp; + struct ship *sp; for (;;) { switch (sgetch("~\b", (struct ship *)0, 0)) { diff --git a/games/sail/pl_3.c b/games/sail/pl_3.c index ac1040e..26591f2 100644 --- a/games/sail/pl_3.c +++ b/games/sail/pl_3.c @@ -216,8 +216,8 @@ acceptcombat() grapungrap() { - register struct ship *sp; - register int i; + struct ship *sp; + int i; foreachship(sp) { if (sp == ms || sp->file->dir == 0) @@ -258,8 +258,8 @@ grapungrap() unfoulplayer() { - register struct ship *to; - register i; + struct ship *to; + i; foreachship(to) { if (fouled2(ms, to) == 0) diff --git a/games/sail/pl_4.c b/games/sail/pl_4.c index e487aaf..db979d9 100644 --- a/games/sail/pl_4.c +++ b/games/sail/pl_4.c @@ -68,7 +68,7 @@ changesail() acceptsignal() { char buf[60]; - register char *p = buf; + char *p = buf; *p++ = '"'; sgetstr("Message? ", p, sizeof buf - 2); @@ -81,9 +81,9 @@ acceptsignal() lookout() { - register struct ship *sp; + struct ship *sp; char buf[3]; - register char c; + char c; sgetstr("What ship? ", buf, sizeof buf); foreachship(sp) { @@ -98,7 +98,7 @@ lookout() char * saywhat(sp, flag) -register struct ship *sp; +struct ship *sp; char flag; { if (sp->file->captain[0]) @@ -114,7 +114,7 @@ char flag; } eyeball(ship) -register struct ship *ship; +struct ship *ship; { int i; diff --git a/games/sail/pl_5.c b/games/sail/pl_5.c index 8949173..5623bba 100644 --- a/games/sail/pl_5.c +++ b/games/sail/pl_5.c @@ -51,7 +51,7 @@ acceptmove() int vma, dir; char prompt[60]; char buf[60], last = '\0'; - register char *p; + char *p; if (!mc->crew3 || snagged(ms) || !windspeed) { Signal("Unable to move", (struct ship *)0); @@ -148,8 +148,8 @@ acceptmove() acceptboard() { - register struct ship *sp; - register int n; + struct ship *sp; + int n; int crew[3]; int men = 0; char c; @@ -199,12 +199,12 @@ acceptboard() } parties(crew, to, isdefense, buf) -register struct ship *to; +struct ship *to; int crew[3]; char isdefense; char buf; { - register int k, j, men; + int k, j, men; struct BP *ptr; int temp[3]; diff --git a/games/sail/pl_6.c b/games/sail/pl_6.c index aa6f541..19ecc07 100644 --- a/games/sail/pl_6.c +++ b/games/sail/pl_6.c @@ -42,9 +42,9 @@ static char sccsid[] = "@(#)pl_6.c 8.1 (Berkeley) 5/31/93"; repair() { char c; - register char *repairs; - register struct shipspecs *ptr = mc; - register int count; + char *repairs; + struct shipspecs *ptr = mc; + int count; #define FIX(x, m) (m - ptr->x > count \ ? (ptr->x += count, count = 0) : (count -= m - ptr->x, ptr->x = m)) @@ -134,7 +134,7 @@ repair() turned() { - register char *p; + char *p; for (p = movebuf; *p; p++) if (*p == 'r' || *p == 'l') @@ -145,7 +145,7 @@ turned() loadplayer() { char c; - register loadL, loadR, ready, load; + loadL, loadR, ready, load; if (!mc->crew3) { Signal("Out of crew", (struct ship *)0); diff --git a/games/sail/pl_7.c b/games/sail/pl_7.c index 6ad01cc..e3bdcb2 100644 --- a/games/sail/pl_7.c +++ b/games/sail/pl_7.c @@ -136,7 +136,7 @@ newturn() /*VARARGS2*/ Signal(fmt, ship, a, b, c, d) char *fmt; -register struct ship *ship; +struct ship *ship; int a, b, c, d; { if (!done_curses) @@ -160,7 +160,7 @@ Scroll() } prompt(p, ship) -register char *p; +char *p; struct ship *ship; { static char buf[60]; @@ -189,7 +189,7 @@ char *p; struct ship *ship; char flag; { - register c; + c; prompt(p, ship); blockalarm(); @@ -205,11 +205,11 @@ char flag; sgetstr(pr, buf, n) char *pr; -register char *buf; -register n; +char *buf; +n; { - register c; - register char *p = buf; + c; + char *p = buf; prompt(pr, (struct ship *)0); sc_buf = buf; @@ -252,7 +252,7 @@ draw_screen() draw_view() { - register struct ship *sp; + struct ship *sp; (void) werase(view_w); foreachship(sp) { @@ -385,7 +385,7 @@ draw_slot() draw_board() { - register int n; + int n; (void) clear(); (void) werase(view_w); diff --git a/games/sail/sync.c b/games/sail/sync.c index 786d284..3890091 100644 --- a/games/sail/sync.c +++ b/games/sail/sync.c @@ -56,7 +56,7 @@ static FILE *sync_fp; makesignal(from, fmt, ship, a, b, c) struct ship *from; char *fmt; - register struct ship *ship; + struct ship *ship; { char message[80]; @@ -141,7 +141,7 @@ Write(type, ship, isstr, a, b, c, d) Sync() { sig_t sighup, sigint; - register n; + n; int type, shipnum, isstr, a, b, c, d; char buf[80]; char erred = 0; @@ -180,7 +180,7 @@ Sync() if (isstr != 0 && isstr != 1) goto bad; if (isstr) { - register char *p; + char *p; for (p = buf;;) { switch (*p++ = getc(sync_fp)) { case '\n': @@ -228,26 +228,26 @@ out: sync_update(type, ship, a, b, c, d) int type; - register struct ship *ship; + struct ship *ship; long a, b, c, d; { switch (type) { case W_DBP: { - register struct BP *p = &ship->file->DBP[a]; + struct BP *p = &ship->file->DBP[a]; p->turnsent = b; p->toship = SHIP(c); p->mensent = d; break; } case W_OBP: { - register struct BP *p = &ship->file->OBP[a]; + struct BP *p = &ship->file->OBP[a]; p->turnsent = b; p->toship = SHIP(c); p->mensent = d; break; } case W_FOUL: { - register struct snag *p = &ship->file->foul[a]; + struct snag *p = &ship->file->foul[a]; if (SHIP(a)->file->dir == 0) break; if (p->sn_count++ == 0) @@ -256,7 +256,7 @@ sync_update(type, ship, a, b, c, d) break; } case W_GRAP: { - register struct snag *p = &ship->file->grap[a]; + struct snag *p = &ship->file->grap[a]; if (SHIP(a)->file->dir == 0) break; if (p->sn_count++ == 0) @@ -265,7 +265,7 @@ sync_update(type, ship, a, b, c, d) break; } case W_UNFOUL: { - register struct snag *p = &ship->file->foul[a]; + struct snag *p = &ship->file->foul[a]; if (p->sn_count > 0) { if (b) { ship->file->nfoul -= p->sn_count; @@ -278,7 +278,7 @@ sync_update(type, ship, a, b, c, d) break; } case W_UNGRAP: { - register struct snag *p = &ship->file->grap[a]; + struct snag *p = &ship->file->grap[a]; if (p->sn_count > 0) { if (b) { ship->file->ngrap -= p->sn_count; @@ -299,7 +299,7 @@ sync_update(type, ship, a, b, c, d) } break; case W_CREW: { - register struct shipspecs *s = ship->specs; + struct shipspecs *s = ship->specs; s->crew1 = a; s->crew2 = b; s->crew3 = c; @@ -330,13 +330,13 @@ sync_update(type, ship, a, b, c, d) ship->file->FS = a; break; case W_GUNL: { - register struct shipspecs *s = ship->specs; + struct shipspecs *s = ship->specs; s->gunL = a; s->carL = b; break; } case W_GUNR: { - register struct shipspecs *s = ship->specs; + struct shipspecs *s = ship->specs; s->gunR = a; s->carR = b; break; @@ -359,7 +359,7 @@ sync_update(type, ship, a, b, c, d) ship->specs->qual = a; break; case W_RIGG: { - register struct shipspecs *s = ship->specs; + struct shipspecs *s = ship->specs; s->rig1 = a; s->rig2 = b; s->rig3 = c; diff --git a/games/snake/snake/snake.c b/games/snake/snake/snake.c index bd61e38..684dcc3 100644 --- a/games/snake/snake/snake.c +++ b/games/snake/snake/snake.c @@ -417,7 +417,7 @@ setup(){ /* drawbox() { - register int i; + int i; struct point p; p.line = -1; @@ -446,7 +446,7 @@ snrand(sp) struct point *sp; { struct point p; - register int i; + int i; for (;;) { p.col = random() % ccnt; diff --git a/games/trek/abandon.c b/games/trek/abandon.c index 259612d..3be1770 100644 --- a/games/trek/abandon.c +++ b/games/trek/abandon.c @@ -66,10 +66,10 @@ static char sccsid[] = "@(#)abandon.c 8.1 (Berkeley) 5/31/93"; abandon() { - register struct quad *q; - register int i; + struct quad *q; + int i; int j; - register struct event *e; + struct event *e; if (Ship.ship == QUEENE) return (printf("You may not abandon ye Faire Queene\n")); diff --git a/games/trek/attack.c b/games/trek/attack.c index 874793b..92dc164 100644 --- a/games/trek/attack.c +++ b/games/trek/attack.c @@ -72,7 +72,7 @@ static char sccsid[] = "@(#)attack.c 8.1 (Berkeley) 5/31/93"; attack(resting) int resting; /* set if attack while resting */ { - register int hit, i, l; + int hit, i, l; int maxhit, tothit, shldabsb; double chgfac, propor, extradm; double dustfac, tothe; diff --git a/games/trek/autover.c b/games/trek/autover.c index da0ca7d..9fdaa26 100644 --- a/games/trek/autover.c +++ b/games/trek/autover.c @@ -60,7 +60,7 @@ static char sccsid[] = "@(#)autover.c 8.1 (Berkeley) 5/31/93"; autover() { double dist; - register int course; + int course; printf("\07RED ALERT: The %s is in a supernova quadrant\n", Ship.shipname); printf("*** Emergency override attempts to hurl %s to safety\n", Ship.shipname); diff --git a/games/trek/capture.c b/games/trek/capture.c index 553b533..db1b0b9 100644 --- a/games/trek/capture.c +++ b/games/trek/capture.c @@ -55,8 +55,8 @@ static char sccsid[] = "@(#)capture.c 8.1 (Berkeley) 5/31/93"; capture() { - register int i; - register struct kling *k; + int i; + struct kling *k; double x; extern struct kling *selectklingon(); @@ -120,7 +120,7 @@ capture() struct kling *selectklingon() { - register int i; + int i; if (Etc.nkling < 2) i = 0; diff --git a/games/trek/check_out.c b/games/trek/check_out.c index 8d923c4..c50af43 100644 --- a/games/trek/check_out.c +++ b/games/trek/check_out.c @@ -53,7 +53,7 @@ static char sccsid[] = "@(#)check_out.c 8.1 (Berkeley) 5/31/93"; check_out(device) int device; { - register int dev; + int dev; dev = device; diff --git a/games/trek/checkcond.c b/games/trek/checkcond.c index 0be2a7b..4270027 100644 --- a/games/trek/checkcond.c +++ b/games/trek/checkcond.c @@ -66,7 +66,7 @@ static char sccsid[] = "@(#)checkcond.c 8.1 (Berkeley) 5/31/93"; checkcond() { - register int i, j; + int i, j; /* see if we are still alive and well */ if (Ship.reserves < 0.0) diff --git a/games/trek/compkl.c b/games/trek/compkl.c index b183f13..68ab951 100644 --- a/games/trek/compkl.c +++ b/games/trek/compkl.c @@ -53,7 +53,7 @@ static char sccsid[] = "@(#)compkl.c 8.1 (Berkeley) 5/31/93"; compkldist(f) int f; /* set if new quadrant */ { - register int i, dx, dy; + int i, dx, dy; double d; double temp; @@ -95,7 +95,7 @@ int f; /* set if new quadrant */ sortkl() { struct kling t; - register int f, i, m; + int f, i, m; m = Etc.nkling - 1; f = 1; diff --git a/games/trek/computer.c b/games/trek/computer.c index a230cf2..e6d2bae 100644 --- a/games/trek/computer.c +++ b/games/trek/computer.c @@ -103,7 +103,7 @@ struct cvntab Cputab[] = computer() { int ix, iy; - register int i, j; + int i, j; int numout; int tqx, tqy; struct cvntab *r; @@ -112,7 +112,7 @@ computer() double dist, time; double warpfact; struct quad *q; - register struct event *e; + struct event *e; if (check_out(COMPUTER)) return; @@ -317,7 +317,7 @@ double *dist; double dx, dy; double quadsize; double angle; - register int course; + int course; /* normalize to quadrant distances */ quadsize = NSECTS; diff --git a/games/trek/damage.c b/games/trek/damage.c index 9f14123..eaff84f 100644 --- a/games/trek/damage.c +++ b/games/trek/damage.c @@ -55,10 +55,10 @@ damage(dev1, dam) int dev1; /* device index */ double dam; /* time to repair */ { - register int i; - register struct event *e; + int i; + struct event *e; int f; - register int dev; + int dev; /* ignore zero damages */ if (dam <= 0.0) diff --git a/games/trek/damaged.c b/games/trek/damaged.c index 0bcf91b..301a12f 100644 --- a/games/trek/damaged.c +++ b/games/trek/damaged.c @@ -49,9 +49,9 @@ static char sccsid[] = "@(#)damaged.c 8.1 (Berkeley) 5/31/93"; damaged(dev) int dev; { - register int d; - register struct event *e; - register int i; + int d; + struct event *e; + int i; d = dev; diff --git a/games/trek/dcrept.c b/games/trek/dcrept.c index 8b7e97d..258fbd1 100644 --- a/games/trek/dcrept.c +++ b/games/trek/dcrept.c @@ -53,10 +53,10 @@ static char sccsid[] = "@(#)dcrept.c 8.1 (Berkeley) 5/31/93"; dcrept() { - register int i, f; + int i, f; double x; double m1, m2; - register struct event *e; + struct event *e; /* set up the magic factors to output the time till fixed */ if (Ship.cond == DOCKED) diff --git a/games/trek/destruct.c b/games/trek/destruct.c index 3ff212c..ae123f0 100644 --- a/games/trek/destruct.c +++ b/games/trek/destruct.c @@ -62,7 +62,7 @@ static char sccsid[] = "@(#)destruct.c 8.1 (Berkeley) 5/31/93"; destruct() { char checkpass[15]; - register int i, j; + int i, j; double zap; if (damaged(COMPUTER)) diff --git a/games/trek/dock.c b/games/trek/dock.c index 504daff..f190e46 100644 --- a/games/trek/dock.c +++ b/games/trek/dock.c @@ -56,9 +56,9 @@ static char sccsid[] = "@(#)dock.c 8.1 (Berkeley) 5/31/93"; dock() { - register int i, j; + int i, j; int ok; - register struct event *e; + struct event *e; if (Ship.cond == DOCKED) return (printf("Chekov: But captain, we are already docked\n")); @@ -123,8 +123,8 @@ dock() undock() { - register struct event *e; - register int i; + struct event *e; + int i; if (Ship.cond != DOCKED) { diff --git a/games/trek/dumpgame.c b/games/trek/dumpgame.c index e77fbc4..8406f11 100644 --- a/games/trek/dumpgame.c +++ b/games/trek/dumpgame.c @@ -78,9 +78,9 @@ struct dump Dump_template[] = dumpgame() { int version; - register int fd; - register struct dump *d; - register int i; + int fd; + struct dump *d; + int i; if ((fd = creat("trek.dump", 0644)) < 0) return (printf("cannot dump\n")); @@ -112,7 +112,7 @@ dumpgame() restartgame() { - register int fd; + int fd; int version; if ((fd = open("trek.dump", O_RDONLY)) < 0 || @@ -142,9 +142,9 @@ restartgame() readdump(fd1) int fd1; { - register int fd; - register struct dump *d; - register int i; + int fd; + struct dump *d; + int i; long junk; fd = fd1; diff --git a/games/trek/dumpme.c b/games/trek/dumpme.c index 2e361dc..4d2ff37 100644 --- a/games/trek/dumpme.c +++ b/games/trek/dumpme.c @@ -54,10 +54,10 @@ static char sccsid[] = "@(#)dumpme.c 8.1 (Berkeley) 5/31/93"; dumpme(flag) int flag; { - register int f; + int f; double x; - register struct event *e; - register int i; + struct event *e; + int i; f = flag; Ship.quadx = ranf(NQUADS); diff --git a/games/trek/dumpssradio.c b/games/trek/dumpssradio.c index 1589c48..4a57ffd 100644 --- a/games/trek/dumpssradio.c +++ b/games/trek/dumpssradio.c @@ -45,9 +45,9 @@ static char sccsid[] = "@(#)dumpssradio.c 8.1 (Berkeley) 5/31/93"; dumpssradio() { - register struct event *e; - register int j; - register int chkrest; + struct event *e; + int j; + int chkrest; chkrest = 0; for (j = 0; j < MAXEVENTS; j++) diff --git a/games/trek/events.c b/games/trek/events.c index 12c7fbc..f2aa111 100644 --- a/games/trek/events.c +++ b/games/trek/events.c @@ -51,7 +51,7 @@ static char sccsid[] = "@(#)events.c 8.1 (Berkeley) 5/31/93"; events(warp) int warp; /* set if called in a time warp */ { - register int i; + int i; int j; struct kling *k; double rtime; @@ -59,8 +59,8 @@ int warp; /* set if called in a time warp */ double idate; struct event *ev, *xsched(), *schedule(); int ix, iy; - register struct quad *q; - register struct event *e; + struct quad *q; + struct event *e; int evnum; int restcancel; diff --git a/games/trek/getpar.c b/games/trek/getpar.c index 2fd11fc..7cb2fc8 100644 --- a/games/trek/getpar.c +++ b/games/trek/getpar.c @@ -47,7 +47,7 @@ static char sccsid[] = "@(#)getpar.c 8.1 (Berkeley) 5/31/93"; getintpar(s) char *s; { - register int i; + int i; int n; while (1) @@ -71,7 +71,7 @@ char *s; double getfltpar(s) char *s; { - register int i; + int i; double d; while (1) @@ -118,9 +118,9 @@ char *s; struct cvntab tab[]; { char input[100]; - register struct cvntab *r; + struct cvntab *r; int flag; - register char *p, *q; + char *p, *q; int c; int f; @@ -196,9 +196,9 @@ char *r; int l; char *t; { - register int i; + int i; char format[20]; - register int f; + int f; if (t == 0) t = " \t\n;"; @@ -225,7 +225,7 @@ char *t; testnl() { - register char c; + char c; while ((c = cgetc(0)) != '\n') if ((c >= '0' && c <= '9') || c == '.' || c == '!' || @@ -261,7 +261,7 @@ char c; testterm() { - register char c; + char c; if (!(c = cgetc(0))) return (1); @@ -284,7 +284,7 @@ testterm() readdelim(d) char d; { - register char c; + char c; while (c = cgetc(0)) { diff --git a/games/trek/help.c b/games/trek/help.c index 6f3244a..b6f967c 100644 --- a/games/trek/help.c +++ b/games/trek/help.c @@ -64,9 +64,9 @@ char *Cntvect[3] = help() { - register int i; + int i; double dist, x; - register int dx, dy; + int dx, dy; int j, l; /* check to see if calling for help is reasonable ... */ diff --git a/games/trek/impulse.c b/games/trek/impulse.c index 4f2a943..bde44da 100644 --- a/games/trek/impulse.c +++ b/games/trek/impulse.c @@ -46,9 +46,9 @@ static char sccsid[] = "@(#)impulse.c 8.1 (Berkeley) 5/31/93"; impulse() { int course; - register int power; + int power; double dist, time; - register int percent; + int percent; extern double move(); if (Ship.cond == DOCKED) diff --git a/games/trek/initquad.c b/games/trek/initquad.c index 69e3fb1..72dc83b 100644 --- a/games/trek/initquad.c +++ b/games/trek/initquad.c @@ -59,10 +59,10 @@ static char sccsid[] = "@(#)initquad.c 8.1 (Berkeley) 5/31/93"; initquad(f) int f; { - register int i, j; + int i, j; int rx, ry; int nbases, nstars; - register struct quad *q; + struct quad *q; int nholes; q = &Quad[Ship.quadx][Ship.quady]; @@ -141,7 +141,7 @@ int f; sector(x, y) int *x, *y; { - register int i, j; + int i, j; do { diff --git a/games/trek/kill.c b/games/trek/kill.c index 79ebe48..6bae9d1 100644 --- a/games/trek/kill.c +++ b/games/trek/kill.c @@ -58,7 +58,7 @@ static char sccsid[] = "@(#)kill.c 8.1 (Berkeley) 5/31/93"; killk(ix, iy) int ix, iy; { - register int i, j; + int i, j; printf(" *** Klingon at %d,%d destroyed ***\n", ix, iy); @@ -98,8 +98,8 @@ int ix, iy; killb(qx, qy) int qx, qy; { - register struct quad *q; - register struct xy *b; + struct quad *q; + struct xy *b; q = &Quad[qx][qy]; @@ -146,9 +146,9 @@ kills(x, y, f) int x, y; /* quad coords if f == 0, else sector coords */ int f; /* f != 0 -- this quad; f < 0 -- Enterprise's fault */ { - register struct quad *q; - register struct event *e; - register char *name; + struct quad *q; + struct event *e; + char *name; char *systemname(); if (f) @@ -190,9 +190,9 @@ killd(x, y, f) int x, y; /* quadrant coordinates */ int f; /* set if user is to be informed */ { - register struct event *e; - register int i; - register struct quad *q; + struct event *e; + int i; + struct quad *q; q = &Quad[x][y]; for (i = 0; i < MAXEVENTS; i++) diff --git a/games/trek/klmove.c b/games/trek/klmove.c index c7be2c2..783195f 100644 --- a/games/trek/klmove.c +++ b/games/trek/klmove.c @@ -66,10 +66,10 @@ klmove(fl) int fl; { int n; - register struct kling *k; + struct kling *k; double dx, dy; int nextx, nexty; - register int lookx, looky; + int lookx, looky; int motion; int fudgex, fudgey; int qx, qy; diff --git a/games/trek/lrscan.c b/games/trek/lrscan.c index a4dc143..1679337 100644 --- a/games/trek/lrscan.c +++ b/games/trek/lrscan.c @@ -53,8 +53,8 @@ static char sccsid[] = "@(#)lrscan.c 8.1 (Berkeley) 5/31/93"; lrscan() { - register int i, j; - register struct quad *q; + int i, j; + struct quad *q; if (check_out(LRSCAN)) { diff --git a/games/trek/main.c b/games/trek/main.c index 36d85b2..16f19b7 100644 --- a/games/trek/main.c +++ b/games/trek/main.c @@ -157,10 +157,10 @@ int argc; char **argv; { /* extern FILE *f_log; */ - register char opencode; + char opencode; int prio; - register int ac; - register char **av; + int ac; + char **av; struct sgttyb argp; /* revoke */ diff --git a/games/trek/move.c b/games/trek/move.c index 983315f..6aa0072 100644 --- a/games/trek/move.c +++ b/games/trek/move.c @@ -82,10 +82,10 @@ double speed; { double angle; double x, y, dx, dy; - register int ix, iy; + int ix, iy; double bigger; int n; - register int i; + int i; double dist; double sectsize; double xn; diff --git a/games/trek/nova.c b/games/trek/nova.c index 3522f30..a327b0d 100644 --- a/games/trek/nova.c +++ b/games/trek/nova.c @@ -56,8 +56,8 @@ static char sccsid[] = "@(#)nova.c 8.1 (Berkeley) 5/31/93"; nova(x, y) int x, y; { - register int i, j; - register int se; + int i, j; + int se; if (Sect[x][y] != STAR || Quad[Ship.quadx][Ship.quady].stars < 0) return; diff --git a/games/trek/out.c b/games/trek/out.c index cd57891..21b5058 100644 --- a/games/trek/out.c +++ b/games/trek/out.c @@ -46,7 +46,7 @@ static char sccsid[] = "@(#)out.c 8.1 (Berkeley) 5/31/93"; out(dev) int dev; { - register struct device *d; + struct device *d; d = &Device[dev]; printf("%s reports %s ", d->person, d->name); diff --git a/games/trek/phaser.c b/games/trek/phaser.c index a2e252a..45d2285 100644 --- a/games/trek/phaser.c +++ b/games/trek/phaser.c @@ -91,12 +91,12 @@ struct banks phaser() { - register int i; + int i; int j; - register struct kling *k; + struct kling *k; double dx, dy; double anglefactor, distfactor; - register struct banks *b; + struct banks *b; int manual, flag, extra; int hit; double tot; diff --git a/games/trek/ram.c b/games/trek/ram.c index f156ad8..9d5d177 100644 --- a/games/trek/ram.c +++ b/games/trek/ram.c @@ -53,8 +53,8 @@ static char sccsid[] = "@(#)ram.c 8.1 (Berkeley) 5/31/93"; ram(ix, iy) int ix, iy; { - register int i; - register char c; + int i; + char c; printf("\07RED ALERT\07: collision imminent\n"); c = Sect[ix][iy]; diff --git a/games/trek/rest.c b/games/trek/rest.c index 224c0fc..09f3f58 100644 --- a/games/trek/rest.c +++ b/games/trek/rest.c @@ -57,7 +57,7 @@ static char sccsid[] = "@(#)rest.c 8.1 (Berkeley) 5/31/93"; rest() { double t; - register int percent; + int percent; /* get the time to rest */ t = getfltpar("How long"); diff --git a/games/trek/schedule.c b/games/trek/schedule.c index 3b68005..e66ead7 100644 --- a/games/trek/schedule.c +++ b/games/trek/schedule.c @@ -55,8 +55,8 @@ double offset; char x, y; char z; { - register struct event *e; - register int i; + struct event *e; + int i; double date; date = Now.date + offset; @@ -95,7 +95,7 @@ struct event *e1; double offset; { double date; - register struct event *e; + struct event *e; e = e1; @@ -119,7 +119,7 @@ double offset; unschedule(e1) struct event *e1; { - register struct event *e; + struct event *e; e = e1; @@ -147,7 +147,7 @@ int ev1; int factor; int x, y, z; { - register int ev; + int ev; ev = ev1; return (schedule(ev, -Param.eventdly[ev] * Param.time * log(franf()) / factor, x, y, z)); @@ -166,8 +166,8 @@ struct event *e1; int ev1; int factor; { - register int ev; - register struct event *e; + int ev; + struct event *e; ev = ev1; e = e1; diff --git a/games/trek/score.c b/games/trek/score.c index 652fb31..6e85895 100644 --- a/games/trek/score.c +++ b/games/trek/score.c @@ -46,8 +46,8 @@ static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93"; long score() { - register int u; - register int t; + int u; + int t; long s; double r; extern struct cvntab Skitab[]; diff --git a/games/trek/setup.c b/games/trek/setup.c index cd8523a..d06f9e8 100644 --- a/games/trek/setup.c +++ b/games/trek/setup.c @@ -75,13 +75,13 @@ struct cvntab Skitab[] = setup() { struct cvntab *r; - register int i, j; + int i, j; double f; int d; int fd; int klump; int ix, iy; - register struct quad *q; + struct quad *q; struct event *e; while (1) diff --git a/games/trek/shield.c b/games/trek/shield.c index 6cf1114..5f2a486 100644 --- a/games/trek/shield.c +++ b/games/trek/shield.c @@ -67,7 +67,7 @@ struct cvntab Udtab[] = shield(f) int f; { - register int i; + int i; char c; struct cvntab *r; char s[100]; diff --git a/games/trek/snova.c b/games/trek/snova.c index 54b9bb3..5871084 100644 --- a/games/trek/snova.c +++ b/games/trek/snova.c @@ -64,11 +64,11 @@ snova(x, y) int x, y; { int qx, qy; - register int ix, iy; + int ix, iy; int f; int dx, dy; int n; - register struct quad *q; + struct quad *q; f = 0; ix = x; diff --git a/games/trek/srscan.c b/games/trek/srscan.c index 1733e99..d4a16ac 100644 --- a/games/trek/srscan.c +++ b/games/trek/srscan.c @@ -66,8 +66,8 @@ char *Color[4] = srscan(f) int f; { - register int i, j; - register int statinfo; + int i, j; + int statinfo; char *s; int percent; struct quad *q; diff --git a/games/trek/systemname.c b/games/trek/systemname.c index 0a1ed19..e5d0e5d 100644 --- a/games/trek/systemname.c +++ b/games/trek/systemname.c @@ -53,8 +53,8 @@ static char sccsid[] = "@(#)systemname.c 8.1 (Berkeley) 5/31/93"; char *systemname(q1) struct quad *q1; { - register struct quad *q; - register int i; + struct quad *q; + int i; q = q1; diff --git a/games/trek/torped.c b/games/trek/torped.c index 502bc74..68df0e9 100644 --- a/games/trek/torped.c +++ b/games/trek/torped.c @@ -62,11 +62,11 @@ static char sccsid[] = "@(#)torped.c 8.1 (Berkeley) 5/31/93"; torped() { - register int ix, iy; + int ix, iy; double x, y, dx, dy; double angle; int course, course2; - register int k; + int k; double bigger; double sectsize; int burst; @@ -221,7 +221,7 @@ randcourse(n) int n; { double r; - register int d; + int d; d = ((franf() + franf()) - 1.0) * 20; if (abs(d) > 12) diff --git a/games/trek/utility.c b/games/trek/utility.c index 5625d40..f876ac2 100644 --- a/games/trek/utility.c +++ b/games/trek/utility.c @@ -54,8 +54,8 @@ char *bmove(a, b, l) char *a, *b; int l; { - register int n; - register char *p, *q; + int n; + char *p, *q; p = a; q = b; @@ -76,7 +76,7 @@ int l; sequal(a, b) char *a, *b; { - register char *p, *q; + char *p, *q; p = a; q = b; @@ -99,8 +99,8 @@ char *a, *b; char *concat(s1, s2, s3) char *s1, *s2, *s3; { - register char *p; - register char *q; + char *p; + char *q; p = s3; q = s1; @@ -124,8 +124,8 @@ char *s1, *s2, *s3; length(s) char *s; { - register int l; - register char *p; + int l; + char *p; l = 0; p = s; diff --git a/games/trek/visual.c b/games/trek/visual.c index 1a8e291..758a4b5 100644 --- a/games/trek/visual.c +++ b/games/trek/visual.c @@ -66,9 +66,9 @@ struct xy Visdelta[11] = visual() { - register int ix, iy; + int ix, iy; int co; - register struct xy *v; + struct xy *v; co = getintpar("direction"); if (co < 0 || co > 360) diff --git a/games/trek/warp.c b/games/trek/warp.c index 1a70033..c9012d7 100644 --- a/games/trek/warp.c +++ b/games/trek/warp.c @@ -65,8 +65,8 @@ double d; double time; double speed; double frac; - register int percent; - register int i; + int percent; + int i; extern double move(); if (Ship.cond == DOCKED) diff --git a/games/trek/win.c b/games/trek/win.c index 47b664a..83c7c27 100644 --- a/games/trek/win.c +++ b/games/trek/win.c @@ -60,7 +60,7 @@ win() extern jmp_buf env; extern long score(); extern struct cvntab Skitab[]; - register struct cvntab *p; + struct cvntab *p; sleep(1); printf("\nCongratulations, you have saved the Federation\n"); diff --git a/games/worm/worm.c b/games/worm/worm.c index 6c40362..a408474 100644 --- a/games/worm/worm.c +++ b/games/worm/worm.c @@ -139,8 +139,8 @@ main(argc, argv) life() { - register struct body *bp, *np; - register int i; + struct body *bp, *np; + int i; head = newlink(); head->x = start_len+2; @@ -210,7 +210,7 @@ prize() process(ch) char ch; { - register int x,y; + int x,y; struct body *nh; alarm(0); diff --git a/games/wump/wump.c b/games/wump/wump.c index 8c1f32c..dc7010e 100644 --- a/games/wump/wump.c +++ b/games/wump/wump.c @@ -227,7 +227,7 @@ quiver holds %d custom super anti-evil Wumpus arrows. Good luck.\n", display_room_stats() { - register int i; + int i; /* * Routine will explain what's going on with the current room, as well @@ -487,7 +487,7 @@ The arrow is weakly shot and can go no further!\n"); cave_init() { - register int i, j, k, link; + int i, j, k, link; int delta, int_compare(); /* @@ -560,7 +560,7 @@ try_again: link = (random() % room_num) + 1; clear_things_in_cave() { - register int i; + int i; /* * remove bats and pits from the current cave in preparation for us @@ -572,7 +572,7 @@ clear_things_in_cave() initialize_things_in_cave() { - register int i, loc; + int i, loc; /* place some bats, pits, the wumpus, and the player. */ for (i = 0; i < bat_num; ++i) { @@ -636,7 +636,7 @@ getans(prompt) bats_nearby() { - register int i; + int i; /* check for bats in the immediate vicinity */ for (i = 0; i < link_num; ++i) @@ -647,7 +647,7 @@ bats_nearby() pit_nearby() { - register int i; + int i; /* check for pits in the immediate vicinity */ for (i = 0; i < link_num; ++i) @@ -658,7 +658,7 @@ pit_nearby() wump_nearby() { - register int i, j; + int i, j; /* check for a wumpus within TWO caves of where we are */ for (i = 0; i < link_num; ++i) { |