Add type int to those variables without a type. This is caused by the

frequent use of ``register var'' instead of ``register int var'' and
the removal of the register hint in the previous commit.
This commit is contained in:
Marcel Moolenaar 1999-11-16 10:26:38 +00:00
parent 727bf60729
commit b945938c63
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=53211
36 changed files with 135 additions and 135 deletions

View File

@ -242,7 +242,7 @@ static boolean dig_down;
static
dig() {
struct rm *lev;
dpx = dig_pos.x, dpy = dig_pos.y;
int 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 */

View File

@ -12,7 +12,7 @@ char bones[] = "bones_xx";
/* save bones and possessions of a deceased adventurer */
savebones(){
fd;
int fd;
struct obj *otmp;
struct trap *ttmp;
struct monst *mtmp;
@ -74,7 +74,7 @@ struct monst *mtmp;
}
getbones(){
fd,x,y,ok;
int 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;

View File

@ -17,7 +17,7 @@ extern boolean hmon();
3. when walking out of a lit room
*/
unsee() {
x,y;
int x,y;
struct rm *lev;
/*
@ -53,7 +53,7 @@ unsee() {
*/
seeoff(mode) /* 1 to redo @, 0 to leave them */
{ /* 1 means misc movement, 0 means blindness */
x,y;
int x,y;
struct rm *lev;
if(u.udispl && mode){
@ -466,7 +466,7 @@ pickup(all)
/* turn around a corner if that is the only way we can proceed */
/* do not turn left or right twice */
lookaround(){
x,y,i,x0,y0,m0,i0 = 9;
int x,y,i,x0,y0,m0,i0 = 9;
int corrct = 0, noturn = 0;
struct monst *mtmp;
#ifdef lint
@ -649,7 +649,7 @@ setsee()
setsee()
{
x,y;
int x,y;
if(Blind) {
pru();
@ -681,7 +681,7 @@ setsee()
#endif QUEST
nomul(nval)
nval;
int 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' */
num;
int num;
{
u.ustr -= num;
while(u.ustr < 3) {
@ -724,7 +724,7 @@ num;
}
losehp(n,knam)
n;
int n;
char *knam;
{
u.uhp -= n;
@ -738,7 +738,7 @@ char *knam;
}
losehp_m(n,mtmp)
n;
int n;
struct monst *mtmp;
{
u.uhp -= n;
@ -749,7 +749,7 @@ struct monst *mtmp;
losexp() /* hit by V or W */
{
num;
int num;
extern long newuexp();
if(u.ulevel > 1)

View File

@ -95,7 +95,7 @@ char *cmd;
{
struct func_tab *tlist = cmdlist;
boolean firsttime = FALSE;
res;
int res;
if(!cmd) {
firsttime = TRUE;
@ -256,7 +256,7 @@ boolean s;
confdir()
{
x = rn2(8);
int x = rn2(8);
u.dx = xdir[x];
u.dy = ydir[x];
}
@ -297,7 +297,7 @@ isroom(x,y) x,y; { /* what about POOL? */
}
#endif QUEST
isok(x,y) x,y; {
isok(x,y) int 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);
}

View File

@ -121,7 +121,7 @@ goto_level(newlevel, at_stairs)
int newlevel;
boolean at_stairs;
{
fd;
int fd;
boolean up = (newlevel < dlevel);
if(newlevel <= 0) done("escaped"); /* in fact < 0 is impossible */
@ -253,7 +253,7 @@ dothrow()
{
struct obj *obj;
struct monst *mon;
tmp;
int tmp;
obj = getobj("#)", "throw"); /* it is also possible to throw food */
/* (or jewels, or iron balls ... ) */

View File

@ -8,7 +8,7 @@ extern char plname[];
coord
getpos(force,goal) int force; char *goal; {
cx,cy,i,c;
int cx,cy,i,c;
extern char sdir[]; /* defined in hack.c */
extern schar xdir[], ydir[]; /* idem */
extern char *visctrl(); /* see below */
@ -99,7 +99,7 @@ extern char *lmonnam();
*/
do_oname(obj) struct obj *obj; {
struct obj *otmp, *otmp2;
lth;
int lth;
char buf[BUFSZ];
pline("What do you want to name %s? ", doname(obj));
getlin(buf);

View File

@ -90,7 +90,7 @@ Meatdone(){
doeat(){
struct obj *otmp;
struct objclass *ftmp;
tmp;
int tmp;
/* Is there some food (probably a heavy corpse) here on the ground? */
if(!Levitation)
@ -277,13 +277,13 @@ gethungry(){
}
/* called after vomiting and after performing feats of magic */
morehungry(num) num; {
morehungry(num) int num; {
u.uhunger -= num;
newuhs(TRUE);
}
/* called after eating something (and after drinking fruit juice) */
lesshungry(num) num; {
lesshungry(num) int num; {
u.uhunger += num;
newuhs(FALSE);
}
@ -362,7 +362,7 @@ struct obj *otmp;
/* returns 1 if some text was printed */
eatcorpse(otmp) struct obj *otmp; {
char let = CORPSE_I_TO_C(otmp->otyp);
tp = 0;
int tp = 0;
if(let != 'a' && moves > otmp->age + 50 + rn2(100)) {
tp++;
pline("Ulch -- that meat was tainted!");

View File

@ -224,7 +224,7 @@ topten(){
char *reclock = "record_lock";
int sleepct = 300;
FILE *rfile;
flg = 0;
int flg = 0;
extern char *getdate();
#define HUP if(!done_hup)
while(link(recfile, reclock) == -1) {
@ -466,7 +466,7 @@ int d = n%10;
}
clearlocks(){
x;
int x;
(void) signal(SIGHUP,SIG_IGN);
for(x = maxdlevel; x >= 0; x--) {
glo(x);
@ -511,7 +511,7 @@ prscore(argc,argv) int argc; char **argv; {
struct toptenentry *t1, *t2;
char *recfile = RECORD;
FILE *rfile;
flg = 0;
int flg = 0;
int i;
#ifdef nonsense
long total_score = 0L;

View File

@ -108,7 +108,7 @@ struct monst *mon;
/* u is hit by sth, but not a monster */
thitu(tlev,dam,name)
tlev,dam;
int tlev,dam;
char *name;
{
char buf[BUFSZ];
@ -131,9 +131,9 @@ boolean
hmon(mon,obj,thrown) /* return TRUE if mon still alive */
struct monst *mon;
struct obj *obj;
thrown;
int thrown;
{
tmp;
int tmp;
boolean hittxt = FALSE;
if(!obj){

View File

@ -170,7 +170,7 @@ struct wseg *m_atseg;
struct monst *
m_at(x,y)
x,y;
int x,y;
{
struct monst *mtmp;
#ifndef NOWORM
@ -196,7 +196,7 @@ x,y;
struct obj *
o_at(x,y)
x,y;
int x,y;
{
struct obj *otmp;
@ -207,7 +207,7 @@ x,y;
struct obj *
sobj_at(n,x,y)
n,x,y;
int n,x,y;
{
struct obj *otmp;
@ -246,7 +246,7 @@ o_on(id, objchn) unsigned int id; struct obj *objchn; {
struct trap *
t_at(x,y)
x,y;
int x,y;
{
struct trap *trap = ftrap;
while(trap) {
@ -258,7 +258,7 @@ x,y;
struct gold *
g_at(x,y)
x,y;
int x,y;
{
struct gold *gold = fgold;
while(gold) {

View File

@ -28,7 +28,7 @@ xchar lev;
{
#ifndef NOWORM
struct wseg *wtmp, *wtmp2;
tmp;
int tmp;
#endif NOWORM
if(fd < 0) panic("Save on bad file!"); /* impossible */
@ -72,7 +72,7 @@ xchar lev;
}
bwrite(fd,loc,num)
fd;
int fd;
char *loc;
unsigned num;
{
@ -82,7 +82,7 @@ unsigned num;
}
saveobjchn(fd,otmp)
fd;
int fd;
struct obj *otmp;
{
struct obj *otmp2;
@ -101,7 +101,7 @@ struct obj *otmp;
}
savemonchn(fd,mtmp)
fd;
int fd;
struct monst *mtmp;
{
struct monst *mtmp2;
@ -124,7 +124,7 @@ struct monst *mtmp;
}
savegoldchn(fd,gold)
fd;
int fd;
struct gold *gold;
{
struct gold *gold2;
@ -138,7 +138,7 @@ struct gold *gold;
}
savetrapchn(fd,trap)
fd;
int fd;
struct trap *trap;
{
struct trap *trap2;
@ -160,7 +160,7 @@ xchar lev;
#ifndef NOWORM
struct wseg *wtmp;
#endif NOWORM
tmp;
int tmp;
long omoves;
int hpid;
xchar dlvl;
@ -256,7 +256,7 @@ xchar lev;
}
mread(fd, buf, len)
fd;
int fd;
char *buf;
unsigned len;
{

View File

@ -405,7 +405,7 @@ char *argv[];
}
glo(foo)
foo;
int foo;
{
/* construct the string xlock.n */
char *tf;
@ -480,7 +480,7 @@ boolean wr;
/* perhaps we should also test whether . is writable */
/* unfortunately the access systemcall is worthless */
if(wr) {
fd;
int fd;
if(dir == NULL)
dir = ".";

View File

@ -21,7 +21,7 @@ makemon(ptr,x,y)
struct permonst *ptr;
{
struct monst *mtmp;
tmp, ct;
int tmp, ct;
boolean anything = (!ptr);
extern boolean in_mklev;
@ -160,7 +160,7 @@ goodpos(x,y) /* used only in mnexto and rloc */
rloc(mtmp)
struct monst *mtmp;
{
tx,ty;
int tx,ty;
char ch = mtmp->data->mlet;
#ifndef NOWORM

View File

@ -320,9 +320,9 @@ struct monst *mtmp;
hitu(mtmp,dam)
struct monst *mtmp;
dam;
int dam;
{
tmp, res;
int tmp, res;
nomul(0);
if(u.uswallow) return(0);

View File

@ -41,7 +41,7 @@ makelevel()
{
struct mkroom *croom, *troom;
unsigned tryct;
x,y;
int x,y;
nroom = 0;
doorindex = 0;
@ -290,7 +290,7 @@ struct mkroom *x,*y;
coord
finddpos(xl,yl,xh,yh) {
coord ff;
x,y;
int x,y;
x = (xl == xh) ? xl : (xl + rn2(xh-xl+1));
y = (yl == yh) ? yl : (yl + rn2(yh-yl+1));
@ -315,7 +315,7 @@ finddpos(xl,yl,xh,yh) {
/* see whether it is allowable to create a door at [x,y] */
okdoor(x,y)
x,y;
int 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,7 +328,7 @@ x,y;
}
dodoor(x,y,aroom)
x,y;
int x,y;
struct mkroom *aroom;
{
if(doorindex >= DOORMAX) {
@ -341,12 +341,12 @@ struct mkroom *aroom;
}
dosdoor(x,y,aroom,type)
x,y;
int x,y;
struct mkroom *aroom;
type;
int type;
{
struct mkroom *broom;
tmp;
int tmp;
if(!IS_WALL(levl[x][y].typ)) /* avoid SDOORs with '+' as scrsym */
type = DOOR;
@ -369,8 +369,8 @@ maker(lowx,ddx,lowy,ddy)
schar lowx,ddx,lowy,ddy;
{
struct mkroom *croom;
x, y, hix = lowx+ddx, hiy = lowy+ddy;
xlim = XLIM + secret, ylim = YLIM + secret;
int x, y, hix = lowx+ddx, hiy = lowy+ddy;
int xlim = XLIM + secret, ylim = YLIM + secret;
if(nroom >= MAXNROFROOMS) return(0);
if(lowx < XLIM) lowx = XLIM;
@ -443,7 +443,7 @@ schar lowx,ddx,lowy,ddy;
}
makecorridors() {
a,b;
int a,b;
nxcor = 0;
for(a = 0; a < nroom-1; a++)
@ -465,13 +465,13 @@ makecorridors() {
}
join(a,b)
a,b;
int a,b;
{
coord cc,tt;
tx, ty, xx, yy;
int tx, ty, xx, yy;
struct rm *crm;
struct mkroom *croom, *troom;
dx, dy, dix, diy, cct;
int dx, dy, dix, diy, cct;
croom = &rooms[a];
troom = &rooms[b];
@ -552,7 +552,7 @@ a,b;
/* do we have to change direction ? */
if(dy && dix > diy) {
ddx = (xx > tx) ? -1 : 1;
int ddx = (xx > tx) ? -1 : 1;
crm = &levl[xx+ddx][yy];
if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) {
@ -561,7 +561,7 @@ a,b;
continue;
}
} else if(dx && diy > dix) {
ddy = (yy > ty) ? -1 : 1;
int ddy = (yy > ty) ? -1 : 1;
crm = &levl[xx][yy+ddy];
if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) {
@ -623,7 +623,7 @@ boolean with_trap;
struct rm *rm;
int vct = 8;
coord dd;
dy,xx,yy;
int dy,xx,yy;
struct trap *ttmp;
if(doorindex < DOORMAX)
@ -666,7 +666,7 @@ boolean with_trap;
/* make a trap somewhere (in croom if mazeflag = 0) */
mktrap(num,mazeflag,croom)
num,mazeflag;
int num,mazeflag;
struct mkroom *croom;
{
struct trap *ttmp;

View File

@ -14,7 +14,7 @@ struct permonst hell_hound =
makemaz()
{
int x,y;
zx,zy;
int zx,zy;
coord mm;
boolean al = (dlevel >= 30 && !flags.made_amulet);

View File

@ -9,7 +9,7 @@ struct obj *mkobj(), *mksobj();
struct obj *
mkobj_at(let,x,y)
let,x,y;
int let,x,y;
{
struct obj *otmp = mkobj(let);
otmp->ox = x;
@ -20,7 +20,7 @@ let,x,y;
}
mksobj_at(otyp,x,y)
otyp,x,y;
int otyp,x,y;
{
struct obj *otmp = mksobj(otyp);
otmp->ox = x;
@ -47,7 +47,7 @@ struct obj zeroobj;
struct obj *
mksobj(otyp)
otyp;
int otyp;
{
struct obj *otmp;
char let = objects[otyp].oc_olet;

View File

@ -233,9 +233,9 @@ mkswamp() /* Michiel Huisjes & Fred de Wilde */
}
nexttodoor(sx,sy)
sx,sy;
int sx,sy;
{
dx,dy;
int 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 ||

View File

@ -122,7 +122,7 @@ char *name;
youswld(mtmp,dam,die,name)
struct monst *mtmp;
dam,die;
int dam,die;
char *name;
{
if(mtmp != u.ustuck) return;
@ -137,10 +137,10 @@ char *name;
}
dochugw(mtmp) struct monst *mtmp; {
x = mtmp->mx;
y = mtmp->my;
d = dochug(mtmp);
dd;
int x = mtmp->mx;
int y = mtmp->my;
int d = dochug(mtmp);
int dd;
if(!d) /* monster still alive */
if(Warning)
if(!mtmp->mpeaceful)
@ -157,7 +157,7 @@ dochug(mtmp)
struct monst *mtmp;
{
struct permonst *mdat;
tmp, nearby, scared;
int tmp, nearby, scared;
if(mtmp->cham && !rn2(6))
(void) newcham(mtmp, &mons[dlevel+14+rn2(CMNUM-14-dlevel)]);
@ -239,7 +239,7 @@ m_move(mtmp,after)
struct monst *mtmp;
{
struct monst *mtmp2;
nx,ny,omx,omy,appr,nearer,cnt,i,j;
int nx,ny,omx,omy,appr,nearer,cnt,i,j;
xchar gx,gy,nix,niy,chcnt;
schar chi;
boolean likegold, likegems, likeobjs;
@ -786,7 +786,7 @@ newcham(mtmp,mdat) /* make a chameleon look like a new monster */
struct monst *mtmp;
struct permonst *mdat;
{
mhp, hpn, hpd;
int mhp, hpn, hpd;
if(mdat == mtmp->data) return(0); /* still the same monster */
#ifndef NOWORM

View File

@ -99,7 +99,7 @@ oinit() /* level dependent initialization */
extern long *alloc();
savenames(fd) fd; {
savenames(fd) int fd; {
int i;
unsigned len;
bwrite(fd, (char *) bases, sizeof bases);
@ -116,7 +116,7 @@ unsigned len;
}
}
restnames(fd) fd; {
restnames(fd) int fd; {
int i;
unsigned len;
mread(fd, (char *) bases, sizeof bases);

View File

@ -191,7 +191,7 @@ dodrink() {
pluslvl()
{
num;
int num;
pline("You feel more experienced.");
num = rnd(10);

View File

@ -52,7 +52,7 @@ char *str;
}
atl(x,y,ch)
x,y;
int x,y;
{
struct rm *crm = &levl[x][y];
@ -67,7 +67,7 @@ x,y;
}
on_scr(x,y)
x,y;
int 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! */
xx,yy;
int xx,yy;
if((int)x == -1) {
if(y > 0) { /* open call */
let = y;
@ -184,7 +184,7 @@ doredraw()
docrt()
{
x,y;
int x,y;
struct rm *room;
struct monst *mtmp;
@ -221,8 +221,8 @@ docrt()
bot();
}
docorner(xmin,ymax) xmin,ymax; {
x,y;
docorner(xmin,ymax) int xmin,ymax; {
int x,y;
struct rm *room;
struct monst *mtmp;
@ -382,7 +382,7 @@ xchar x,y;
}
newsym(x,y)
x,y;
int x,y;
{
atl(x,y,news0(x,y));
}
@ -390,7 +390,7 @@ x,y;
/* used with wand of digging (or pick-axe): fill scrsym and force display */
/* also when a POOL evaporates */
mnewsym(x,y)
x,y;
int x,y;
{
struct rm *room;
char newscrsym;
@ -406,7 +406,7 @@ x,y;
}
nosee(x,y)
x,y;
int x,y;
{
struct rm *room;
@ -421,7 +421,7 @@ x,y;
#ifndef QUEST
prl1(x,y)
x,y;
int x,y;
{
if(u.dx) {
if(u.dy) {
@ -443,7 +443,7 @@ x,y;
}
nose1(x,y)
x,y;
int x,y;
{
if(u.dx) {
if(u.dy) {
@ -466,7 +466,7 @@ x,y;
#endif QUEST
vism_at(x,y)
x,y;
int x,y;
{
struct monst *mtmp;
@ -563,7 +563,7 @@ unpmon(mon) struct monst *mon; {
nscr()
{
x,y;
int x,y;
struct rm *room;
if(u.uswallow || u.ux == FAR || flags.nscrinh) return;

View File

@ -280,7 +280,7 @@ doread() {
docrt();
break;
case SCR_FOOD_DETECTION:
{ ct = 0, ctu = 0;
{ int ct = 0, ctu = 0;
struct obj *obj;
char foodsym = confused ? POTION_SYM : FOOD_SYM;
@ -448,7 +448,7 @@ struct obj *otmp;
litroom(on)
boolean on;
{
num,zx,zy;
int num,zx,zy;
/* first produce the text (provided he is not blind) */
if(Blind) goto do_it;

View File

@ -29,7 +29,7 @@ outrip(){
char **dp = rip;
char *dpx;
char buf[BUFSZ];
x,y;
int x,y;
cls();
(void) strcpy(buf, plname);

View File

@ -32,7 +32,7 @@ hangup(){
/* returns 1 if save successful */
dosave0(hu) int hu; {
fd, ofd;
int fd, ofd;
int tmp; /* not ! */
(void) signal(SIGHUP, SIG_IGN);
@ -89,9 +89,9 @@ dosave0(hu) int hu; {
}
dorecover(fd)
fd;
int fd;
{
nfd;
int nfd;
int tmp; /* not a ! */
unsigned mid; /* idem */
struct obj *otmp;
@ -172,7 +172,7 @@ fd;
struct obj *
restobjchn(fd)
fd;
int fd;
{
struct obj *otmp, *otmp2;
struct obj *first = 0;
@ -200,7 +200,7 @@ fd;
struct monst *
restmonchn(fd)
fd;
int fd;
{
struct monst *mtmp, *mtmp2;
struct monst *first = 0;

View File

@ -122,7 +122,7 @@ struct monst *mtmp;
static
addupbill(){ /* delivers result in total */
/* caller has checked that shopkeeper exists */
ct = ESHK(shopkeeper)->billct;
int ct = ESHK(shopkeeper)->billct;
struct bill_x *bp = bill;
total = 0;
while(ct--){
@ -132,7 +132,7 @@ struct bill_x *bp = bill;
}
inshop(){
roomno = inroom(u.ux,u.uy);
int roomno = inroom(u.ux,u.uy);
static void findshk();
@ -230,7 +230,7 @@ roomno = inroom(u.ux,u.uy);
static void
findshk(roomno)
roomno;
int roomno;
{
struct monst *mtmp;
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
@ -753,7 +753,7 @@ int tmp, ac;
static
realhunger(){ /* not completely foolproof */
tmp = u.uhunger;
int tmp = u.uhunger;
struct obj *otmp = invent;
while(otmp){
if(otmp->olet == FOOD_SYM && !otmp->unpaid)

View File

@ -65,8 +65,8 @@ steal(mtmp)
struct monst *mtmp;
{
struct obj *otmp;
tmp;
named = 0;
int tmp;
int named = 0;
if(!invent){
if(Blind)
@ -178,7 +178,7 @@ struct monst *mtmp;
/* release the objects the killed animal has stolen */
relobj(mtmp,show)
struct monst *mtmp;
show;
int show;
{
struct obj *otmp, *otmp2;

View File

@ -160,7 +160,7 @@ nocmov(x, y)
}
cmov(x, y)
x, y;
int 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 */
cx = curx, cy = cury;
int cx = curx, cy = cury;
while(curx < COLNO) {
xputc(' ');

View File

@ -24,7 +24,7 @@ settrack(){
}
coord *
gettrack(x,y) x,y; {
gettrack(x,y) int x,y; {
int i,cnt,dist;
coord tc;
cnt = utcnt;

View File

@ -22,7 +22,7 @@ char *traps[] = {
struct trap *
maketrap(x,y,typ)
x,y,typ;
int x,y,typ;
{
struct trap *ttmp;
@ -268,7 +268,7 @@ vtele() {
struct mkroom *croom;
for(croom = &rooms[0]; croom->hx >= 0; croom++)
if(croom->rtype == VAULT) {
x,y;
int x,y;
x = rn2(2) ? croom->lx : croom->hx;
y = rn2(2) ? croom->ly : croom->hy;

View File

@ -281,7 +281,7 @@ char *
parse()
{
static char inputline[COLNO];
foo;
int foo;
flags.move = 1;
if(!Invisible) curs_on_u(); else home();

View File

@ -37,7 +37,7 @@ static int gdlevel;
static
restfakecorr()
{
fcx,fcy,fcbeg;
int fcx,fcy,fcbeg;
struct rm *crm;
while((fcbeg = EGD->fcbeg) < EGD->fcend) {
@ -79,14 +79,14 @@ struct monst *mtmp;
}
invault(){
tmp = inroom(u.ux, u.uy);
int 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];
x,y,dd,gx,gy;
int x,y,dd,gx,gy;
/* first find the goal for the guard */
for(dd = 1; (dd < ROWNO || dd < COLNO); dd++) {

View File

@ -57,7 +57,7 @@ corrode_weapon(){
chwepon(otmp,amount)
struct obj *otmp;
amount;
int amount;
{
char *color = (amount < 0) ? "black" : "green";
char *time;

View File

@ -11,7 +11,7 @@ struct wseg *wheads[32];
long wgrowtime[32];
getwn(mtmp) struct monst *mtmp; {
tmp;
int tmp;
for(tmp=1; tmp<32; tmp++) if(!wsegs[tmp]) {
mtmp->wormno = tmp;
return(1);
@ -22,7 +22,7 @@ tmp;
/* called to initialize a worm unless cut in half */
initworm(mtmp) struct monst *mtmp; {
struct wseg *wtmp;
tmp = mtmp->wormno;
int tmp = mtmp->wormno;
if(!tmp) return;
wheads[tmp] = wsegs[tmp] = wtmp = newseg();
wgrowtime[tmp] = 0;
@ -34,7 +34,7 @@ tmp = mtmp->wormno;
worm_move(mtmp) struct monst *mtmp; {
struct wseg *wtmp, *whd;
tmp = mtmp->wormno;
int tmp = mtmp->wormno;
wtmp = newseg();
wtmp->wx = mtmp->mx;
wtmp->wy = mtmp->my;
@ -60,7 +60,7 @@ tmp = mtmp->wormno;
}
worm_nomove(mtmp) struct monst *mtmp; {
tmp;
int tmp;
struct wseg *wtmp;
tmp = mtmp->wormno;
wtmp = wsegs[tmp];
@ -72,7 +72,7 @@ struct wseg *wtmp;
}
wormdead(mtmp) struct monst *mtmp; {
tmp = mtmp->wormno;
int tmp = mtmp->wormno;
struct wseg *wtmp, *wtmp2;
if(!tmp) return;
mtmp->wormno = 0;
@ -84,7 +84,7 @@ struct wseg *wtmp, *wtmp2;
}
wormhit(mtmp) struct monst *mtmp; {
tmp = mtmp->wormno;
int tmp = mtmp->wormno;
struct wseg *wtmp;
if(!tmp) return; /* worm without tail */
for(wtmp = wsegs[tmp]; wtmp; wtmp = wtmp->nseg)
@ -115,7 +115,7 @@ uchar weptyp; /* uwep->otyp or 0 */
{
struct wseg *wtmp, *wtmp2;
struct monst *mtmp2;
tmp,tmp2;
int tmp,tmp2;
if(mtmp->mx == x && mtmp->my == y) return; /* hit headon */
/* cutting goes best with axe or sword */

View File

@ -386,7 +386,7 @@ boomhit(dx,dy) {
}
char
dirlet(dx,dy) dx,dy; {
dirlet(dx,dy) int dx,dy; {
return
(dx == dy) ? '\\' : (dx && dy) ? '/' : dx ? '-' : '|';
}
@ -543,7 +543,7 @@ int dx,dy;
zhit(mon,type) /* returns damage to mon */
struct monst *mon;
type;
int type;
{
int tmp = 0;
@ -595,7 +595,7 @@ struct obj *obj;
rloco(obj)
struct obj *obj;
{
tx,ty,otx,oty;
int tx,ty,otx,oty;
otx = obj->ox;
oty = obj->oy;

View File

@ -6,27 +6,27 @@
#define RND(x) (random() % x)
rn1(x,y)
x,y;
int x,y;
{
return(RND(x)+y);
}
rn2(x)
x;
int x;
{
return(RND(x));
}
rnd(x)
x;
int x;
{
return(RND(x)+1);
}
d(n,x)
n,x;
int n,x;
{
tmp = n;
int tmp = n;
while(n--) tmp += RND(x);
return(tmp);