trickier lint cleanup

Suppress some mostly longstanding "unused parameter" warnings where
the usage was generally conditional.

restlevl() had a conditional closing brace that confused the recent
reformat, resulting in some code inside a funciton ending up flush
against the left border (first column, that is, as if outside of the
function).
This commit is contained in:
PatR
2015-05-24 23:49:05 -07:00
parent 49c997c22c
commit 911745a5ea
5 changed files with 47 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 display.c $NHDT-Date: 1432512771 2015/05/25 00:12:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.53 $ */
/* NetHack 3.6 display.c $NHDT-Date: 1432536528 2015/05/25 06:48:48 $ $NHDT-Branch: master $:$NHDT-Revision: 1.54 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1766,10 +1766,14 @@ int x, y, a, b, c;
/* Return the wall mode for a T wall. */
STATIC_OVL int
set_twall(x0, y0, x1, y1, x2, y2, x3, y3)
int x0, y0, x1, y1, x2, y2, x3, y3;
int x0, y0; /* used #if WA_VERBOSE */
int x1, y1, x2, y2, x3, y3;
{
int wmode, is_1, is_2, is_3;
nhUse(x0);
nhUse(y0);
is_1 = check_pos(x1, y1, WM_T_LONG);
is_2 = check_pos(x2, y2, WM_T_BL);
is_3 = check_pos(x3, y3, WM_T_BR);

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 restore.c $NHDT-Date: 1432512772 2015/05/25 00:12:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.98 $ */
/* NetHack 3.6 restore.c $NHDT-Date: 1432536531 2015/05/25 06:48:51 $ $NHDT-Branch: master $:$NHDT-Revision: 1.99 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -698,17 +698,18 @@ unsigned int stuckid, steedid;
}
}
/*ARGSUSED*/ /* fd used in MFLOPPY only */
STATIC_OVL int restlevelfile(fd, ltmp) register int fd;
/*ARGSUSED*/
STATIC_OVL int
restlevelfile(fd, ltmp)
int fd; /* fd used in MFLOPPY only */
xchar ltmp;
#if defined(macintosh) && (defined(__SC__) || defined(__MRC__)) \
&& !defined(MFLOPPY)
#pragma unused(fd)
#endif
{
register int nfd;
int nfd;
char whynot[BUFSZ];
#ifndef MFLOPPY
nhUse(fd);
#endif
nfd = create_levelfile(ltmp, whynot);
if (nfd < 0) {
/* BUG: should suppress any attempt to write a panic
@@ -727,7 +728,7 @@ xchar ltmp;
(void) nhclose(nfd);
#ifdef AMIGA
clearlocks();
#else
#else /* !AMIGA */
eraseall(levels, alllevels);
eraseall(levels, allbones);
@@ -743,19 +744,16 @@ xchar ltmp;
(void) lseek(fd, (off_t) 0, 0);
(void) validate(fd, (char *) 0); /* skip version etc */
return dorecover(fd); /* 0 or 1 */
} else {
#endif
}
#endif /* ?AMIGA */
pline("Be seeing you...");
terminate(EXIT_SUCCESS);
#ifndef AMIGA
}
#endif
}
#endif
bufon(nfd);
savelev(nfd, ltmp, WRITE_SAVE | FREE_SAVE);
bclose(nfd);
return (2);
#endif /* MFLOPPY */
bufon(nfd);
savelev(nfd, ltmp, WRITE_SAVE | FREE_SAVE);
bclose(nfd);
return 2;
}
int
@@ -933,10 +931,7 @@ boolean rlecomp;
struct rm r;
if (rlecomp) {
#if defined(MAC)
/* Suppress warning about used before set */
(void) memset((genericptr_t) &r, 0, sizeof(r));
#endif
i = 0;
j = 0;
len = 0;
@@ -954,9 +949,12 @@ boolean rlecomp;
j = 0;
i += 1;
}
} else
#endif /* RLECOMP */
mread(fd, (genericptr_t) levl, sizeof(levl));
return;
}
#else /* !RLECOMP */
nhUse(rlecomp);
#endif /* ?RLECOMP */
mread(fd, (genericptr_t) levl, sizeof levl);
}
void

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 save.c $NHDT-Date: 1432512768 2015/05/25 00:12:48 $ $NHDT-Branch: master $:$NHDT-Revision: 1.87 $ */
/* NetHack 3.6 save.c $NHDT-Date: 1432536532 2015/05/25 06:48:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.88 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -591,9 +591,12 @@ boolean rlecomp;
bwrite(fd, (genericptr_t) &match, sizeof(uchar));
bwrite(fd, (genericptr_t) rgrm, sizeof(struct rm));
}
} else
#endif /* RLECOMP */
bwrite(fd, (genericptr_t) levl, sizeof(levl));
return;
}
#else /* !RLECOMP */
nhUse(rlecomp);
#endif /* ?RLECOMP */
bwrite(fd, (genericptr_t) levl, sizeof levl);
}
/*ARGSUSED*/

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1432512764 2015/05/25 00:12:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.57 $ */
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1432536532 2015/05/25 06:48:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.58 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
@@ -2772,7 +2772,7 @@ struct sp_coder *coder;
/*ARGUSED*/
void
spo_end_moninvent(coder)
struct sp_coder *coder;
struct sp_coder *coder UNUSED;
{
if (invent_carrying_monster)
m_dowear(invent_carrying_monster, TRUE);
@@ -2782,7 +2782,7 @@ struct sp_coder *coder;
/*ARGUSED*/
void
spo_pop_container(coder)
struct sp_coder *coder;
struct sp_coder *coder UNUSED;
{
if (container_idx > 0) {
container_idx--;
@@ -4487,7 +4487,7 @@ struct sp_coder *coder;
void
sel_set_wallify(x, y, arg)
int x, y;
genericptr_t arg;
genericptr_t arg UNUSED;
{
wallify_map(x, y, x, y);
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 wintty.c $NHDT-Date: 1432512813 2015/05/25 00:13:33 $ $NHDT-Branch: master $:$NHDT-Revision: 1.93 $ */
/* NetHack 3.6 wintty.c $NHDT-Date: 1432536533 2015/05/25 06:48:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.94 $ */
/* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */
@@ -2980,9 +2980,13 @@ int *x, *y, *mod;
if (ttyDisplay && ttyDisplay->toplin == 1)
ttyDisplay->toplin = 2;
return i;
#else
#else /* !WIN32CON */
nhUse(x);
nhUse(y);
nhUse(mod);
return tty_nhgetch();
#endif
#endif /* ?WIN32CON */
}
void