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

@@ -587,12 +587,10 @@ register const char *s;
int x_range = x_maze_max - x_maze_min - 2*INVPOS_X_MARGIN - 1,
y_range = y_maze_max - y_maze_min - 2*INVPOS_Y_MARGIN - 1;
#ifdef DEBUG
if (x_range <= INVPOS_X_MARGIN || y_range <= INVPOS_Y_MARGIN ||
(x_range * y_range) <= (INVPOS_DISTANCE * INVPOS_DISTANCE))
panic("inv_pos: maze is too small! (%d x %d)",
debugpline("inv_pos: maze is too small! (%d x %d)",
x_maze_max, y_maze_max);
#endif
inv_pos.x = inv_pos.y = 0; /*{occupied() => invocation_pos()}*/
do {
x = rn1(x_range, x_maze_min + INVPOS_X_MARGIN + 1);
@@ -879,10 +877,8 @@ register xchar x, y, todnum, todlevel;
impossible("portal on top of portal??");
return;
}
#ifdef DEBUG
pline("mkportal: at (%d,%d), to %s, level %d",
debugpline("mkportal: at (%d,%d), to %s, level %d",
x, y, dungeons[todnum].dname, todlevel);
#endif
ttmp->dst.dnum = todnum;
ttmp->dst.dlevel = todlevel;
return;