used, unused variables

some variables marked as unused, are now actually used
some unused variables are eliminated or commented out
This commit is contained in:
nhmall
2024-03-16 12:53:58 -04:00
parent cad4d87101
commit 295d6e257c
10 changed files with 24 additions and 21 deletions

View File

@@ -26,9 +26,15 @@ staticfn void debug_fields(const char *);
staticfn void dump_enums(void);
#endif
#ifdef CRASHREPORT
#define USED_FOR_CRASHREPORT
#else
#define USED_FOR_CRASHREPORT UNUSED
#endif
/*ARGSUSED*/
void
early_init(int argc UNUSED, char *argv[] UNUSED)
early_init(int argc USED_FOR_CRASHREPORT, char *argv[] USED_FOR_CRASHREPORT)
{
#ifdef CRASHREPORT
/* Do this as early as possible, but let ports do other things first. */

View File

@@ -1370,7 +1370,7 @@ evaluate_and_notify_windowport(
boolean *valsetlist,
int idx)
{
int i, fld, updated = 0, notpresent UNUSED = 0;
int i, fld, updated = 0;
/*
* Now pass the changed values to window port.
@@ -1384,7 +1384,6 @@ evaluate_and_notify_windowport(
|| ((fld == BL_XP || i == BL_EXP) && Upolyd)
|| ((fld == BL_VERS) && !flags.showvers)
) {
notpresent++;
continue;
}
if (eval_notify_windowport_field(fld, valsetlist, idx))

View File

@@ -2048,11 +2048,7 @@ DISABLE_WARNING_FORMAT_NONLITERAL
void
silly_thing(const char *word,
#ifdef OBSOLETE_HANDLING
struct obj *otmp)
#else
struct obj *otmp UNUSED)
#endif
{
#ifdef OBSOLETE_HANDLING
/* 'P','R' vs 'W','T' handling is obsolete */

View File

@@ -487,7 +487,7 @@ do_improvisation(struct obj *instr)
struct obj itmp;
boolean mundane = FALSE, same_old_song = FALSE;
static char my_goto_song[] = {'C', '\0'},
*improvisation SOUNDLIBONLY = my_goto_song;
*improvisation = my_goto_song;
itmp = *instr;
itmp.oextra = (struct oextra *) 0; /* ok on this copy as instr maintains
@@ -706,6 +706,7 @@ do_improvisation(struct obj *instr)
impossible("What a weird instrument (%d)!", instr->otyp);
return 0;
}
nhUse(improvisation);
return 2; /* That takes time */
}

View File

@@ -1970,7 +1970,7 @@ optfn_map_mode(int optidx, int req, boolean negated, char *opts, char *op)
/* all the key assignment options for menu_* commands are identical
but optlist.h treats them as distinct rather than sharing one */
staticfn int
shared_menu_optfn(int optidx UNUSED, int req, boolean negated UNUSED,
shared_menu_optfn(int optidx UNUSED, int req, boolean negated,
char *opts, char *op)
{
if (req == do_init) {
@@ -3969,7 +3969,7 @@ extern const char *const known_restrictions[]; /* symbols.c */
staticfn int
optfn_symset(
int optidx UNUSED,
int optidx,
int req,
boolean negated UNUSED,
char *opts,
@@ -8621,7 +8621,7 @@ doset(void) /* changing options via menu by Per Liboriussen */
(void) parseoptions(buf, setinitial, fromfile);
} else {
/* compound option */
int k = opt_indx, reslt UNUSED;
int k = opt_indx, reslt;
if (allopt[k].has_handler && allopt[k].optfn) {
reslt = (*allopt[k].optfn)(allopt[k].idx, do_handler,

View File

@@ -5890,7 +5890,7 @@ lspo_wallify(lua_State *L)
/* reset_level is only needed for testing purposes */
int
lspo_reset_level(lua_State *L UNUSED)
lspo_reset_level(lua_State *L)
{
boolean wtower = In_W_tower(u.ux, u.uy, &u.uz);
@@ -5906,7 +5906,7 @@ lspo_reset_level(lua_State *L UNUSED)
/* finalize_level is only needed for testing purposes */
int
lspo_finalize_level(lua_State *L UNUSED)
lspo_finalize_level(lua_State *L)
{
boolean wtower = In_W_tower(u.ux, u.uy, &u.uz);
int i;

View File

@@ -3724,7 +3724,7 @@ mhitm_ad_pest(
void
mhitm_ad_deth(
struct monst *magr,
struct attack *mattk UNUSED,
struct attack *mattk,
struct monst *mdef, struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
@@ -3831,7 +3831,7 @@ do_stone_u(struct monst *mtmp)
void
do_stone_mon(
struct monst *magr,
struct attack *mattk UNUSED,
struct attack *mattk,
struct monst *mdef, struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;