summaryrefslogtreecommitdiffstats
path: root/games/hack
diff options
context:
space:
mode:
Diffstat (limited to 'games/hack')
-rw-r--r--games/hack/alloc.c10
-rw-r--r--games/hack/hack.apply.c58
-rw-r--r--games/hack/hack.bones.c10
-rw-r--r--games/hack/hack.c74
-rw-r--r--games/hack/hack.cmd.c20
-rw-r--r--games/hack/hack.do.c38
-rw-r--r--games/hack/hack.do_name.c48
-rw-r--r--games/hack/hack.do_wear.c32
-rw-r--r--games/hack/hack.dog.c32
-rw-r--r--games/hack/hack.eat.c24
-rw-r--r--games/hack/hack.end.c38
-rw-r--r--games/hack/hack.engrave.c46
-rw-r--r--games/hack/hack.fight.c32
-rw-r--r--games/hack/hack.invent.c136
-rw-r--r--games/hack/hack.lev.c52
-rw-r--r--games/hack/hack.main.c24
-rw-r--r--games/hack/hack.makemon.c22
-rw-r--r--games/hack/hack.mhitu.c16
-rw-r--r--games/hack/hack.mklev.c86
-rw-r--r--games/hack/hack.mkmaze.c12
-rw-r--r--games/hack/hack.mkobj.c22
-rw-r--r--games/hack/hack.mkshop.c42
-rw-r--r--games/hack/hack.mon.c102
-rw-r--r--games/hack/hack.o_init.c30
-rw-r--r--games/hack/hack.objnam.c60
-rw-r--r--games/hack/hack.options.c8
-rw-r--r--games/hack/hack.pager.c24
-rw-r--r--games/hack/hack.potion.c24
-rw-r--r--games/hack/hack.pri.c86
-rw-r--r--games/hack/hack.read.c60
-rw-r--r--games/hack/hack.rip.c10
-rw-r--r--games/hack/hack.rumors.c16
-rw-r--r--games/hack/hack.save.c24
-rw-r--r--games/hack/hack.search.c20
-rw-r--r--games/hack/hack.shk.c116
-rw-r--r--games/hack/hack.shknam.c6
-rw-r--r--games/hack/hack.steal.c32
-rw-r--r--games/hack/hack.termcap.c16
-rw-r--r--games/hack/hack.timeout.c4
-rw-r--r--games/hack/hack.topl.c14
-rw-r--r--games/hack/hack.track.c4
-rw-r--r--games/hack/hack.trap.c34
-rw-r--r--games/hack/hack.tty.c24
-rw-r--r--games/hack/hack.u_init.c18
-rw-r--r--games/hack/hack.unix.c40
-rw-r--r--games/hack/hack.vault.c24
-rw-r--r--games/hack/hack.wield.c14
-rw-r--r--games/hack/hack.wizard.c18
-rw-r--r--games/hack/hack.worm.c48
-rw-r--r--games/hack/hack.worn.c10
-rw-r--r--games/hack/hack.zap.c84
-rw-r--r--games/hack/makedefs.c26
-rw-r--r--games/hack/rnd.c10
53 files changed, 940 insertions, 940 deletions
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);
OpenPOWER on IntegriCloud