!DEBUG warnings

With DEBUG suppressed, I started getting
16      warning: empty body in an if-statement
and 2   warning: empty body in an else-statement
from gcc.

Using braces for an empty block instead of just ';' avoids the warning:
    if (foo)
        debugpline("foo");
is bad,
    if (bar) {
        debugpline("bar");
    }
is good.  ;-)

The changes to lint.h are just precautionary.

modified:
    include/lint.h
    src/attrib.c, bones.c, dbridge.c, dig.c, eat.c,
        makemon.c, mkmaze.c, mon.c, sp_lev.c
This commit is contained in:
PatR
2015-12-04 14:58:49 -08:00
parent 3c5cb6ae5c
commit 171fb90746
10 changed files with 70 additions and 56 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1449051497 2015/12/02 10:18:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.76 $ */
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1449269920 2015/12/04 22:58:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.77 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
@@ -1033,8 +1033,9 @@ chk:
lev = &levl[x][y];
for (; y <= ymax; y++) {
if (lev++->typ) {
if (!vault)
if (!vault) {
debugpline2("strange area [%d,%d] in check_room.", x, y);
}
if (!rn2(3))
return FALSE;
if (x < *lowx)