gcc compilation warning bits

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
This commit is contained in:
cohrs
2006-04-25 04:08:22 +00:00
parent 3e2f7f946d
commit c654fef3ff
3 changed files with 18 additions and 18 deletions

View File

@@ -62,7 +62,6 @@ STATIC_DCL void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P, struct lch
#ifdef DUNGEON_OVERVIEW #ifdef DUNGEON_OVERVIEW
mapseen *mapseenchn = (struct mapseen *)0; mapseen *mapseenchn = (struct mapseen *)0;
STATIC_DCL void FDECL(free_mapseen, (mapseen *));
STATIC_DCL mapseen *FDECL(load_mapseen, (int)); STATIC_DCL mapseen *FDECL(load_mapseen, (int));
STATIC_DCL void FDECL(save_mapseen, (int, mapseen *)); STATIC_DCL void FDECL(save_mapseen, (int, mapseen *));
STATIC_DCL mapseen *FDECL(find_mapseen, (d_level *)); STATIC_DCL mapseen *FDECL(find_mapseen, (d_level *));
@@ -1841,7 +1840,7 @@ recbranch_mapseen(source, dest)
/* branch not found, so not a real branch. */ /* branch not found, so not a real branch. */
if (!br) return; if (!br) return;
if (mptr = find_mapseen(source)) { if ((mptr = find_mapseen(source)) != 0) {
if (mptr->br && br != mptr->br) if (mptr->br && br != mptr->br)
impossible("Two branches on the same level?"); impossible("Two branches on the same level?");
mptr->br = br; mptr->br = br;
@@ -2038,13 +2037,13 @@ d_level *lev;
} }
#define INTEREST(feat) \ #define INTEREST(feat) \
((feat).nfount) || \ ((feat).nfount || \
((feat).nsink) || \ (feat).nsink || \
((feat).nthrone) || \ (feat).nthrone || \
((feat).naltar) || \ (feat).naltar || \
((feat).nshop) || \ (feat).nshop || \
((feat).ntemple) || \ (feat).ntemple || \
((feat).ntree) (feat).ntree)
/* /*
|| ((feat).water) || \ || ((feat).water) || \
((feat).ice) || \ ((feat).ice) || \
@@ -2056,11 +2055,12 @@ STATIC_OVL boolean
interest_mapseen(mptr) interest_mapseen(mptr)
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) || INTEREST(mptr->feat) ||
(mptr->custom) || (mptr->custom) ||
(mptr->br) (mptr->br)
)); ));
} }
/* recalculate mapseen for the current level */ /* recalculate mapseen for the current level */
@@ -2347,7 +2347,7 @@ boolean printdun;
/* wizmode prints out proto dungeon names for clarity */ /* wizmode prints out proto dungeon names for clarity */
if (wizard) { if (wizard) {
s_level *slev; s_level *slev;
if (slev = Is_special(&mptr->lev)) if ((slev = Is_special(&mptr->lev)) != 0)
Sprintf(eos(buf), " [%s]", slev->proto); Sprintf(eos(buf), " [%s]", slev->proto);
} }
#endif #endif

View File

@@ -2129,9 +2129,9 @@ boolean by_you;
/* monsters can also use potions of acid */ /* monsters can also use potions of acid */
if (obj->otyp == POT_ACID || if (obj->otyp == POT_ACID ||
((obj->otyp == CORPSE || (obj->otyp == TIN && tinok)) && ((obj->otyp == CORPSE || (obj->otyp == TIN && tinok)) &&
obj->corpsenm == PM_LIZARD || (obj->corpsenm == PM_LIZARD ||
(acidic(&mons[obj->corpsenm]) && (acidic(&mons[obj->corpsenm]) &&
obj->corpsenm != PM_GREEN_SLIME))) { obj->corpsenm != PM_GREEN_SLIME)))) {
mon_consume_unstone(mon, obj, by_you, TRUE); mon_consume_unstone(mon, obj, by_you, TRUE);
return TRUE; return TRUE;
} }

View File

@@ -370,9 +370,9 @@ do_pit: chasm = maketrap(x,y,PIT);
exercise(A_DEX, TRUE); exercise(A_DEX, TRUE);
else else
selftouch((Upolyd && selftouch((Upolyd &&
slithy(youmonst.data) || (slithy(youmonst.data) ||
nolimbs(youmonst.data)) ? nolimbs(youmonst.data))) ?
"Shaken, you" : "Falling down, you"); "Shaken, you" : "Falling down, you");
} }
} else newsym(x,y); } else newsym(x,y);
break; break;