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 /games/backgammon | |
parent | ecc8d489403ddff78c214db39def15049d5dae6a (diff) | |
download | FreeBSD-src-44fac3a89d25ca434f91c4f961a363ea590faae8.zip FreeBSD-src-44fac3a89d25ca434f91c4f961a363ea590faae8.tar.gz |
Sync our register usage with NetBSD's (non-)usage.
Diffstat (limited to 'games/backgammon')
-rw-r--r-- | games/backgammon/backgammon/extra.c | 16 | ||||
-rw-r--r-- | games/backgammon/backgammon/main.c | 6 | ||||
-rw-r--r-- | games/backgammon/backgammon/move.c | 44 | ||||
-rw-r--r-- | games/backgammon/backgammon/text.c | 2 | ||||
-rw-r--r-- | games/backgammon/common_source/allow.c | 2 | ||||
-rw-r--r-- | games/backgammon/common_source/board.c | 6 | ||||
-rw-r--r-- | games/backgammon/common_source/check.c | 6 | ||||
-rw-r--r-- | games/backgammon/common_source/fancy.c | 45 | ||||
-rw-r--r-- | games/backgammon/common_source/odds.c | 12 | ||||
-rw-r--r-- | games/backgammon/common_source/one.c | 18 | ||||
-rw-r--r-- | games/backgammon/common_source/save.c | 8 | ||||
-rw-r--r-- | games/backgammon/common_source/subs.c | 34 | ||||
-rw-r--r-- | games/backgammon/common_source/table.c | 10 | ||||
-rw-r--r-- | games/backgammon/teachgammon/teach.c | 4 | ||||
-rw-r--r-- | games/backgammon/teachgammon/tutor.c | 4 |
15 files changed, 108 insertions, 109 deletions
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; |