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 light.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 light.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.17 $ */
/* NetHack 3.5 light.c $Date: 2009/05/06 10:46:38 $ $Revision: 1.15 $ */
/* SCCS Id: @(#)light.c 3.5 2009/01/20 */
/* Copyright (c) Dean Luick, 1994 */
@@ -394,13 +394,13 @@ write_ls(fd, ls)
ls->id = zeroany;
ls->id.a_uint = otmp->o_id;
if (find_oid((unsigned)ls->id.a_uint) != otmp)
debugpline("write_ls: can't find obj #%u!", ls->id.a_uint);
impossible("write_ls: can't find obj #%u!", ls->id.a_uint);
} else { /* ls->type == LS_MONSTER */
mtmp = (struct monst *)ls->id.a_monst;
ls->id = zeroany;
ls->id.a_uint = mtmp->m_id;
if (find_mid((unsigned)ls->id.a_uint, FM_EVERYWHERE) != mtmp)
debugpline("write_ls: can't find mon #%u!", ls->id.a_uint);
impossible("write_ls: can't find mon #%u!", ls->id.a_uint);
}
ls->flags |= LSF_NEEDS_FIXUP;
bwrite(fd, (genericptr_t)ls, sizeof(light_source));