DEBUG/debugpline() fixup

* Replace variadic debugpline() with fixed argument debugpline0(str),
   debugpline1(fmt,arg), and so on so that C99 support isn't required;
 * showdebug() becomes a function rather than a macro and handles a
   bit more;
 * two debugpline() calls in light.c have been changed to impossible();
 * DEBUGFILES macro (in sys.c) can substitute for SYSCF's DEBUGFILES
   setting in !SYSCF configuration (I hope that's temporary).
This commit is contained in:
PatR
2015-03-15 18:02:26 -07:00
parent de8e1a5a9d
commit 14525ed0c6
27 changed files with 243 additions and 181 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 zap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 zap.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.195 $ */
/* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1708,10 +1708,11 @@ struct obj *obj, *otmp;
* as a safeguard against any stray occurrence left in an obj
* struct someplace, although that should never happen.
*/
if (context.bypasses)
if (context.bypasses) {
return 0;
else {
debugpline("%s for a moment.", Tobjnam(obj, "pulsate"));
} else {
debugpline1("%s for a moment.",
Tobjnam(obj, "pulsate"));
obj->bypass = 0;
}
}
@@ -3405,7 +3406,8 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */
resist(mon, type < ZT_SPELL(0) ? WAND_CLASS : '\0', 0, NOTELL))
tmp /= 2;
if (tmp < 0) tmp = 0; /* don't allow negative damage */
debugpline("zapped monster hp = %d (= %d - %d)", mon->mhp-tmp,mon->mhp,tmp);
debugpline3("zapped monster hp = %d (= %d - %d)",
mon->mhp-tmp, mon->mhp, tmp);
mon->mhp -= tmp;
return(tmp);
}