From: nethack.allison Date: Sun, 11 Jun 2006 18:27:55 +0000 (+0000) Subject: build warning X-Git-Tag: MOVE2GIT~987 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f139b67e43067621f862ff0f8e9b5b535182f6e4;p=nethack build warning - remove an unreferenced variable - continue with recent code trend towards having DEADMONSTER() check in its own if/continue statement in a few more places --- diff --git a/src/dog.c b/src/dog.c index 4ba964f34..037c12659 100644 --- a/src/dog.c +++ b/src/dog.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)dog.c 3.5 2006/04/14 */ +/* SCCS Id: @(#)dog.c 3.5 2006/06/11 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -207,8 +207,10 @@ update_mlstmv() /* monst->mlstmv used to be updated every time `monst' actually moved, but that is no longer the case so we just do a blanket assignment */ - for (mon = fmon; mon; mon = mon->nmon) - if (!DEADMONSTER(mon)) mon->mlstmv = monstermoves; + for (mon = fmon; mon; mon = mon->nmon) { + if (DEADMONSTER(mon)) continue; + mon->mlstmv = monstermoves; + } } void diff --git a/src/hack.c b/src/hack.c index 8dfd01bc0..2ef27dcab 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)hack.c 3.5 2006/05/31 */ +/* SCCS Id: @(#)hack.c 3.5 2006/06/11 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1682,10 +1682,12 @@ int roomno; { register struct monst *mtmp; - for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) - if(!DEADMONSTER(mtmp) && mtmp->data == mdat && - index(in_rooms(mtmp->mx, mtmp->my, 0), roomno + ROOMOFFSET)) + for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { + if (DEADMONSTER(mtmp)) continue; + if (mtmp->data == mdat && + index(in_rooms(mtmp->mx, mtmp->my, 0), roomno + ROOMOFFSET)) return mtmp; + } return (struct monst *)0; } @@ -1940,8 +1942,11 @@ register boolean newlev; } } if (rt == COURT || rt == SWAMP || rt == MORGUE || rt == ZOO) - for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) - if (!DEADMONSTER(mtmp) && !Stealth && !rn2(3)) mtmp->msleeping = 0; + for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { + if (DEADMONSTER(mtmp)) continue; + if (!Stealth && !rn2(3)) + mtmp->msleeping = 0; + } } } diff --git a/src/sounds.c b/src/sounds.c index 542a0ab94..cfe7a9d06 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -261,7 +261,7 @@ dosounds() "*a strident plea for donations.", }; const char *msg; - int idx, trycount = 0, + int trycount = 0, ax = EPRI(mtmp)->shrpos.x, ay = EPRI(mtmp)->shrpos.y; boolean speechless = (mtmp->data->msound <= MS_ANIMAL), in_sight = canseemon(mtmp) || cansee(ax, ay); diff --git a/src/vault.c b/src/vault.c index 415139448..1084014d0 100644 --- a/src/vault.c +++ b/src/vault.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)vault.c 3.5 2006/01/03 */ +/* SCCS Id: @(#)vault.c 3.5 2006/06/11 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -136,9 +136,11 @@ findgd() { register struct monst *mtmp; - for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) - if(mtmp->isgd && !DEADMONSTER(mtmp) && on_level(&(EGD(mtmp)->gdlevel), &u.uz)) + for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { + if (DEADMONSTER(mtmp)) continue; + if (mtmp->isgd && on_level(&(EGD(mtmp)->gdlevel), &u.uz)) return(mtmp); + } return((struct monst *)0); } diff --git a/src/wizard.c b/src/wizard.c index 62f5c3eb3..2ecbac909 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -75,8 +75,9 @@ amulet() if (!context.no_of_wizards) return; /* find Wizard, and wake him if necessary */ - for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) - if (!DEADMONSTER(mtmp) && mtmp->iswiz && mtmp->msleeping && !rn2(40)) { + for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { + if (DEADMONSTER(mtmp)) continue; + if (mtmp->iswiz && mtmp->msleeping && !rn2(40)) { mtmp->msleeping = 0; if (distu(mtmp->mx,mtmp->my) > 2) You( @@ -84,6 +85,7 @@ amulet() ); return; } + } } int