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
committed by Pasi Kallinen
parent 4c28a96b92
commit 058299aa3a
27 changed files with 243 additions and 181 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 rnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 rnd.c $NHDT-Date: 1426465440 2015/03/16 00:24:00 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.8 $ */
/* NetHack 3.5 rnd.c $Date: 2009/05/06 10:47:41 $ $Revision: 1.7 $ */
/* SCCS Id: @(#)rnd.c 3.5 2004/08/27 */
/* NetHack may be freely redistributed. See license for details. */
@@ -24,7 +24,7 @@ register int x;
{
#ifdef BETA
if (x <= 0) {
debugpline("rn2(%d) attempted", x);
debugpline1("rn2(%d) attempted", x);
return(0);
}
x = RND(x);
@@ -42,7 +42,7 @@ register int x; /* good luck approaches 0, bad luck approaches (x-1) */
#ifdef BETA
if (x <= 0) {
debugpline("rnl(%d) attempted", x);
debugpline1("rnl(%d) attempted", x);
return(0);
}
#endif
@@ -81,7 +81,7 @@ register int x;
{
#ifdef BETA
if (x <= 0) {
debugpline("rnd(%d) attempted", x);
debugpline1("rnd(%d) attempted", x);
return(1);
}
x = RND(x)+1;
@@ -99,7 +99,7 @@ register int n, x;
#ifdef BETA
if (x < 0 || n < 0 || (x == 0 && n != 0)) {
debugpline("d(%d,%d) attempted", n, x);
debugpline2("d(%d,%d) attempted", n, x);
return(1);
}
#endif