]> granicus.if.org Git - nethack/commitdiff
build warning
authornethack.allison <nethack.allison>
Sun, 11 Jun 2006 18:27:55 +0000 (18:27 +0000)
committernethack.allison <nethack.allison>
Sun, 11 Jun 2006 18:27:55 +0000 (18:27 +0000)
- remove an unreferenced variable
- continue with recent code trend towards having DEADMONSTER()
  check in its own if/continue statement in a few more places

src/dog.c
src/hack.c
src/sounds.c
src/vault.c
src/wizard.c

index 4ba964f3455bc7679bd713033bd8306f629f7074..037c12659410f360ec05ad30aaaf74c0dfef9fc1 100644 (file)
--- 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
index 8dfd01bc09b898df3a9ae6d4a98e04a9d933757a..2ef27dcabb77c56da1d9130f80eb288e3e2dd54f 100644 (file)
@@ -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;
+                   }
            }
        }
 
index 542a0ab947aa0a278b1631065117aebc4f317dcc..cfe7a9d06b41689c2f21a7416ee2809d8edaa697 100644 (file)
@@ -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);
index 415139448af3c9e001a5137becf06362ef235690..1084014d0904687abf0937adf3ab51f71787bfca 100644 (file)
@@ -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);
 }
 
index 62f5c3eb30e58c6230fef1afe095a2d918c053e9..2ecbac909346e3c48bc66c1e48c492e447375fef 100644 (file)
@@ -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