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

@@ -5,8 +5,6 @@
#include "hack.h"
/* #define DEBUG */ /* turn on for diagnostics */
static NEARDATA boolean did_dig_msg;
STATIC_DCL boolean NDECL(rm_waslit);
@@ -1692,9 +1690,7 @@ bury_an_obj(otmp)
struct obj *otmp2;
boolean under_ice;
#ifdef DEBUG
pline("bury_an_obj: %s", xname(otmp));
#endif
debugpline("bury_an_obj: %s", xname(otmp));
if (otmp == uball) {
unpunish();
u.utrap = rn1(50,20);
@@ -1756,10 +1752,8 @@ int x, y;
{
struct obj *otmp, *otmp2;
#ifdef DEBUG
if(level.objects[x][y] != (struct obj *)0)
pline("bury_objs: at %d, %d", x, y);
#endif
debugpline("bury_objs: at %d, %d", x, y);
for (otmp = level.objects[x][y]; otmp; otmp = otmp2)
otmp2 = bury_an_obj(otmp);
@@ -1776,9 +1770,7 @@ int x, y;
struct obj *otmp, *otmp2, *bball;
coord cc;
#ifdef DEBUG
pline("unearth_objs: at %d, %d", x, y);
#endif
debugpline("unearth_objs: at %d, %d", x, y);
cc.x = x; cc.y = y;
bball = buried_ball(&cc);
for (otmp = level.buriedobjlist; otmp; otmp = otmp2) {
@@ -1887,9 +1879,7 @@ void
bury_monst(mtmp)
struct monst *mtmp;
{
#ifdef DEBUG
pline("bury_monst: %s", mon_nam(mtmp));
#endif
debugpline("bury_monst: %s", mon_nam(mtmp));
if(canseemon(mtmp)) {
if(is_flyer(mtmp->data) || is_floater(mtmp->data)) {
pline_The("%s opens up, but %s is not swallowed!",
@@ -1908,9 +1898,7 @@ struct monst *mtmp;
void
bury_you()
{
#ifdef DEBUG
pline("bury_you");
#endif
debugpline("bury_you");
if (!Levitation && !Flying) {
if(u.uswallow)
You_feel("a sensation like falling into a trap!");
@@ -1927,9 +1915,7 @@ bury_you()
void
unearth_you()
{
#ifdef DEBUG
pline("unearth_you");
#endif
debugpline("unearth_you");
u.uburied = FALSE;
under_ground(0);
if(!uamul || uamul->otyp != AMULET_OF_STRANGULATION)
@@ -1940,9 +1926,7 @@ unearth_you()
void
escape_tomb()
{
#ifdef DEBUG
pline("escape_tomb");
#endif
debugpline("escape_tomb");
if ((Teleportation || can_teleport(youmonst.data)) &&
(Teleport_control || rn2(3) < Luck+2)) {
You("attempt a teleport spell.");
@@ -1974,9 +1958,7 @@ bury_obj(otmp)
struct obj *otmp;
{
#ifdef DEBUG
pline("bury_obj");
#endif
debugpline("bury_obj");
if(cansee(otmp->ox, otmp->oy))
pline_The("objects on the %s tumble into a hole!",
surface(otmp->ox, otmp->oy));
@@ -1987,7 +1969,7 @@ struct obj *otmp;
#ifdef DEBUG
int
wiz_debug_cmd() /* in this case, bury everything at your loc and around */
wiz_debug_cmd_bury() /* in this case, bury everything at your loc and around */
{
int x, y;