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

@@ -12,11 +12,6 @@
#include "hack.h"
#include "dlb.h"
/* #define DEBUG */ /* uncomment to enable code debugging */
#ifdef DEBUG
#define debugpline if (wizard) pline
#endif
#include "sp_lev.h"
@@ -329,10 +324,8 @@ chk:
lev = &levl[x][y];
for (; y <= ymax; y++) {
if (lev++->typ) {
#ifdef DEBUG
if(!vault)
debugpline("strange area [%d,%d] in check_room.",x,y);
#endif
if (!rn2(3)) return FALSE;
if (x < *lowx)
*lowx = x + xlim + 1;
@@ -405,9 +398,7 @@ xchar rtype, rlit;
r1 = rnd_rect(); /* Get a random rectangle */
if (!r1) { /* No more free rectangles ! */
#ifdef DEBUG
debugpline("No more rects...");
#endif
return FALSE;
}
hx = r1->hx;
@@ -1320,10 +1311,8 @@ schar ftyp, btyp;
if (xx <= 0 || yy <= 0 || tx <= 0 || ty <= 0 ||
xx > COLNO-1 || tx > COLNO-1 ||
yy > ROWNO-1 || ty > ROWNO-1) {
#ifdef DEBUG
debugpline("dig_corridor: bad coords : (%d,%d) (%d,%d).",
xx,yy,tx,ty);
#endif
return FALSE;
}
if (tx > xx) dx = 1;