Apply paxed's DEBUG patch to remove DEBUG/D_DEBUG.

Move debugging output into couple preprocessor defines, which
    are no-op without DEBUG.  To show debugging output from a
    certain source files, use sysconf:

    DEBUGFILES=dungeon.c questpgr.c

    Also fix couple debug lines which did not compile.

This also includes fixes due to Derek Ray to depugpline to work better
on other platforms.
This commit is contained in:
Pasi Kallinen
2015-02-09 20:56:44 +02:00
committed by Sean Hunt
parent ac108cd365
commit 612852f7de
32 changed files with 136 additions and 340 deletions

View File

@@ -93,9 +93,7 @@ register int x, y, n;
int cnttmp,cntdiv;
cnttmp = cnt;
# ifdef DEBUG
pline("init group call x=%d,y=%d,n=%d,cnt=%d.", x, y, n, cnt);
# endif
debugpline("init group call x=%d,y=%d,n=%d,cnt=%d.", x, y, n, cnt);
cntdiv = ((u.ulevel < 3) ? 4 : (u.ulevel < 5) ? 2 : 1);
#endif
/* Tuning: cut down on swarming at low character levels [mrs] */
@@ -760,10 +758,8 @@ boolean ghostly;
mvitals[mndx].born++;
if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN) &&
!(mvitals[mndx].mvflags & G_EXTINCT)) {
#ifdef DEBUG
if (wizard) pline("Automatically extinguished %s.",
if (wizard) debugpline("Automatically extinguished %s.",
makeplural(mons[mndx].mname));
#endif
mvitals[mndx].mvflags |= G_EXTINCT;
reset_rndmonst(mndx);
}
@@ -906,11 +902,9 @@ register int mmflags;
/* if you are to make a specific monster and it has
already been genocided, return */
if (mvitals[mndx].mvflags & G_GENOD) return((struct monst *) 0);
#ifdef DEBUG
if (wizard && (mvitals[mndx].mvflags & G_EXTINCT))
pline("Explicitly creating extinct monster %s.",
debugpline("Explicitly creating extinct monster %s.",
mons[mndx].mname);
#endif
} else {
/* make a random (common) monster that can survive here.
* (the special levels ask for random monsters at specific
@@ -922,9 +916,7 @@ register int mmflags;
do {
if(!(ptr = rndmonst())) {
#ifdef DEBUG
pline("Warning: no monster.");
#endif
debugpline("Warning: no monster.");
return((struct monst *) 0); /* no more monsters! */
}
fakemon.data = ptr; /* set up for goodpos */
@@ -1260,9 +1252,7 @@ rndmonst()
}
if (mndx == SPECIAL_PM) {
/* evidently they've all been exterminated */
#ifdef DEBUG
pline("rndmonst: no common mons!");
#endif
debugpline("rndmonst: no common mons!");
return (struct permonst *)0;
} /* else `mndx' now ready for use below */
zlevel = level_difficulty();
@@ -1300,9 +1290,7 @@ rndmonst()
if (rndmonst_state.choice_count <= 0) {
/* maybe no common mons left, or all are too weak or too strong */
#ifdef DEBUG
Norep("rndmonst: choice_count=%d", rndmonst_state.choice_count);
#endif
debugpline("rndmonst: choice_count=%d", rndmonst_state.choice_count);
return (struct permonst *)0;
}