]> granicus.if.org Git - nethack/commitdiff
gcc compilation warning bits
authorcohrs <cohrs>
Tue, 25 Apr 2006 04:08:22 +0000 (04:08 +0000)
committercohrs <cohrs>
Tue, 25 Apr 2006 04:08:22 +0000 (04:08 +0000)
some rather complex boolean operations needed more parentheses to avoid
warnings.  I think I put them in the right places.
A couple other items: naked assignments in if stmts, and an extra function decl

src/dungeon.c
src/muse.c
src/music.c

index f17d1d58b79c6a2153c59e7727b8586b2019ff5f..869017d99d31dc00860e445d3e41babda9fa500d 100644 (file)
@@ -62,7 +62,6 @@ STATIC_DCL void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P, struct lch
 
 #ifdef DUNGEON_OVERVIEW
 mapseen *mapseenchn = (struct mapseen *)0;
-STATIC_DCL void FDECL(free_mapseen, (mapseen *));
 STATIC_DCL mapseen *FDECL(load_mapseen, (int));
 STATIC_DCL void FDECL(save_mapseen, (int, mapseen *));
 STATIC_DCL mapseen *FDECL(find_mapseen, (d_level *));
@@ -1841,7 +1840,7 @@ recbranch_mapseen(source, dest)
        /* branch not found, so not a real branch. */
        if (!br) return;
   
-       if (mptr = find_mapseen(source)) {
+       if ((mptr = find_mapseen(source)) != 0) {
                if (mptr->br && br != mptr->br)
                        impossible("Two branches on the same level?");
                mptr->br = br;
@@ -2038,13 +2037,13 @@ d_level *lev;
 }
 
 #define INTEREST(feat) \
-       ((feat).nfount) || \
-       ((feat).nsink) || \
-       ((feat).nthrone) || \
-       ((feat).naltar) || \
-       ((feat).nshop) || \
-       ((feat).ntemple) || \
-       ((feat).ntree)
+       ((feat).nfount || \
+        (feat).nsink || \
+        (feat).nthrone || \
+        (feat).naltar || \
+        (feat).nshop || \
+        (feat).ntemple || \
+        (feat).ntree)
        /*
        || ((feat).water) || \
        ((feat).ice) || \
@@ -2056,11 +2055,12 @@ STATIC_OVL boolean
 interest_mapseen(mptr)
 mapseen *mptr;
 {
-       return (on_level(&u.uz, &mptr->lev) || (!mptr->feat.forgot) && (
+       return on_level(&u.uz, &mptr->lev) ||
+           (!mptr->feat.forgot && (
                INTEREST(mptr->feat) ||
                (mptr->custom) || 
                (mptr->br)
-       ));
+               ));
 }
 
 /* recalculate mapseen for the current level */
@@ -2347,7 +2347,7 @@ boolean printdun;
        /* wizmode prints out proto dungeon names for clarity */
        if (wizard) {
                s_level *slev;
-               if (slev = Is_special(&mptr->lev))
+               if ((slev = Is_special(&mptr->lev)) != 0)
                        Sprintf(eos(buf), " [%s]", slev->proto);
        }
 #endif
index a69171541941725c3d547a028ecae8fd3a67a62c..f1b977ccf0965b9925d5da55adfbe9feda75cdc0 100644 (file)
@@ -2129,9 +2129,9 @@ boolean by_you;
            /* monsters can also use potions of acid */
            if (obj->otyp == POT_ACID ||
                ((obj->otyp == CORPSE || (obj->otyp == TIN && tinok)) &&
-                   obj->corpsenm == PM_LIZARD ||
-                   (acidic(&mons[obj->corpsenm]) &&
-                       obj->corpsenm != PM_GREEN_SLIME))) {
+                   (obj->corpsenm == PM_LIZARD ||
+                    (acidic(&mons[obj->corpsenm]) &&
+                       obj->corpsenm != PM_GREEN_SLIME)))) {
                mon_consume_unstone(mon, obj, by_you, TRUE);
                return TRUE;
            }
index 8939184c0ea3ccaec075f1cf87c7cf94915c5cf1..8ce9a7dbb4020bb5412c6770475648b7337f4b90 100644 (file)
@@ -370,9 +370,9 @@ do_pit:                 chasm = maketrap(x,y,PIT);
                                        exercise(A_DEX, TRUE);
                                    else
                                        selftouch((Upolyd &&
-                                               slithy(youmonst.data) ||
-                                               nolimbs(youmonst.data)) ?
-                                           "Shaken, you" : "Falling down, you");
+                                                  (slithy(youmonst.data) ||
+                                                   nolimbs(youmonst.data))) ?
+                                         "Shaken, you" : "Falling down, you");
                            }
                    } else newsym(x,y);
                    break;