From 48fa4fa5dd47e41e6e42bd7d7f04e452dc43640d Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 10 Oct 2020 16:28:17 -0400 Subject: [PATCH] more warning bits --- include/obj.h | 1 + src/display.c | 10 ++++------ src/dokick.c | 5 +++-- src/invent.c | 9 ++++++--- src/mdlib.c | 12 +++++++++++- src/mkobj.c | 2 +- src/options.c | 12 ++++++++++-- src/restore.c | 8 +++++--- src/sp_lev.c | 3 +-- src/sys.c | 7 ++++--- win/tty/wintty.c | 8 ++++---- 11 files changed, 50 insertions(+), 27 deletions(-) diff --git a/include/obj.h b/include/obj.h index d6577da91..88c4902d0 100644 --- a/include/obj.h +++ b/include/obj.h @@ -115,6 +115,7 @@ struct obj { #define leashmon corpsenm /* gets m_id of attached pet */ #define fromsink corpsenm /* a potion from a sink */ #define novelidx corpsenm /* 3.6 tribute - the index of the novel title */ +#define migr_species corpsenm /* species to endow for MIGR_TO_SPECIES */ int usecount; /* overloaded for various things that tally */ #define spestudied usecount /* # of times a spellbook has been studied */ unsigned oeaten; /* nutrition left in food, if partly eaten */ diff --git a/src/display.c b/src/display.c index 0efe1582c..89e7c95a5 100644 --- a/src/display.c +++ b/src/display.c @@ -2075,17 +2075,15 @@ int x, y, a, b, c; /* Return the wall mode for a T wall. */ static int set_twall(x0, y0, x1, y1, x2, y2, x3, y3) +#ifdef WA_VERBOSE int x0, y0; /* used #if WA_VERBOSE */ +#else +int x0, y0 UNUSED; +#endif int x1, y1, x2, y2, x3, y3; { int wmode, is_1, is_2, is_3; -#ifndef WA_VERBOSE - /* non-verbose more_than_one() doesn't use these */ - nhUse(x0); - nhUse(y0); -#endif - 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); diff --git a/src/dokick.c b/src/dokick.c index 5564c84c5..979f1315c 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -1708,7 +1708,8 @@ unsigned long deliverflags; if ((where & MIGR_TO_SPECIES) == 0) continue; - if ((mtmp->data->mflags2 & DELIVER_PM) == otmp->corpsenm) { + if (otmp->migr_species != NON_PM + && (mtmp->data->mflags2 & DELIVER_PM) == (unsigned) otmp->migr_species) { obj_extract_self(otmp); otmp->owornmask = 0L; otmp->ox = otmp->oy = 0; @@ -1725,7 +1726,7 @@ unsigned long deliverflags; } free_oname(otmp); } - otmp->corpsenm = NON_PM; + otmp->migr_species = NON_PM; (void) add_to_minv(mtmp, otmp); cnt++; if (maxobj && cnt >= maxobj) diff --git a/src/invent.c b/src/invent.c index eeb540449..cfc80f5eb 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1884,11 +1884,14 @@ register const char *let, *word; void silly_thing(word, otmp) const char *word; +#ifdef OBSOLETE_HANDLING struct obj *otmp; -{ -#if 1 /* 'P','R' vs 'W','T' handling is obsolete */ - nhUse(otmp); #else +struct obj *otmp UNUSED; +#endif +{ +#ifdef OBSOLETE_HANDLING + /* 'P','R' vs 'W','T' handling is obsolete */ const char *s1, *s2, *s3; int ocls = otmp->oclass, otyp = otmp->otyp; diff --git a/src/mdlib.c b/src/mdlib.c index 623333df8..bbd85225b 100644 --- a/src/mdlib.c +++ b/src/mdlib.c @@ -60,7 +60,6 @@ static char *FDECL(version_string, (char *, const char *)); static char *FDECL(version_id_string, (char *, const char *)); static char *FDECL(bannerc_string, (char *, const char *)); -static int FDECL(case_insensitive_comp, (const char *, const char *)); static void NDECL(make_version); static char *FDECL(eos, (char *)); #if 0 @@ -74,6 +73,11 @@ static int FDECL(mkstemp, (char *)); #endif #endif /* MAKEDEFS_C || FOR_RUNTIME */ +#if defined(MAKEDEFS_C) || defined(FOR_RUNTIME) || defined(WIN32) \ + || (defined(CROSSCOMPILE_TARGET) && defined(__DATE__) && defined(__TIME__)) +static int FDECL(case_insensitive_comp, (const char *, const char *)); +#endif + #if !defined(MAKEDEFS_C) && defined(WIN32) extern int GUILaunched; #endif @@ -88,7 +92,10 @@ static void FDECL(opt_out_words, (char *, int *)); static void NDECL(build_savebones_compat_string); static int idxopttext, done_runtime_opt_init_once = 0; #define MAXOPT 40 +#if !defined(MAKEDEFS_C) && defined(CROSSCOMPILE_TARGET) \ + && defined(__DATE__) && defined(__TIME__) static char rttimebuf[MAXOPT]; +#endif static char *opttext[120] = { 0 }; char optbuf[BUFSZ]; static struct version_info version; @@ -348,6 +355,8 @@ char *template; #endif /* HAS_NO_MKSTEMP */ #endif /* MAKEDEFS_C || FOR_RUNTIME */ +#if defined(MAKEDEFS_C) || defined(FOR_RUNTIME) || defined(WIN32) \ + || (defined(CROSSCOMPILE_TARGET) && defined(__DATE__) && defined(__TIME__)) static int case_insensitive_comp(s1, s2) const char *s1; @@ -367,6 +376,7 @@ const char *s2; } return u1 - u2; } +#endif static char * eos(str) diff --git a/src/mkobj.c b/src/mkobj.c index 6c3d8b4a9..d894ae920 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -210,7 +210,7 @@ boolean init, artif; otmp = mksobj(otyp, init, artif); add_to_migration(otmp); otmp->owornmask = (long) MIGR_TO_SPECIES; - otmp->corpsenm = mflags2; + otmp->migr_species = mflags2; return otmp; } diff --git a/src/options.c b/src/options.c index f8ddb2f5e..ac50af936 100644 --- a/src/options.c +++ b/src/options.c @@ -304,7 +304,10 @@ register char *opts; boolean tinitial, tfrom_file; { char *op; - boolean negated, got_match = FALSE, has_val = FALSE; + boolean negated, got_match = FALSE; +#if 0 + boolean has_val = FALSE; +#endif int i, matchidx = -1, optresult = optn_err, optlen, optlen_wo_val; boolean retval = TRUE; @@ -345,11 +348,16 @@ boolean tinitial, tfrom_file; optlen = (int) strlen(opts); optlen_wo_val = length_without_val(opts, optlen); if (optlen_wo_val < optlen) { +#if 0 has_val = TRUE; +#endif optlen = optlen_wo_val; - } else { + } +#if 0 + else { has_val = FALSE; } +#endif for (i = 0; i < OPTCOUNT; ++i) { got_match = FALSE; diff --git a/src/restore.c b/src/restore.c index 816ca3f8e..ea75d54da 100644 --- a/src/restore.c +++ b/src/restore.c @@ -954,7 +954,11 @@ struct cemetery **cemeteryaddr; static void rest_levl(nhfp, rlecomp) NHFILE *nhfp; +#ifdef RLECOMP boolean rlecomp; +#else +boolean rlecomp UNUSED; +#endif { #ifdef RLECOMP short i, j; @@ -984,9 +988,7 @@ boolean rlecomp; } return; } -#else /* !RLECOMP */ - nhUse(rlecomp); -#endif /* ?RLECOMP */ +#endif /* RLECOMP */ if (nhfp->structlevel) { mread(nhfp->fd, (genericptr_t) levl, sizeof levl); } diff --git a/src/sp_lev.c b/src/sp_lev.c index f11099af2..c469d9747 100755 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -3076,7 +3076,7 @@ lua_State *L; static int find_montype(L, s) -lua_State *L; +lua_State *L UNUSED; const char *s; { int i; @@ -3084,7 +3084,6 @@ const char *s; for (i = LOW_PM; i < NUMMONS; i++) if (!strcmpi(mons[i].mname, s)) return i; - nhUse(L); return NON_PM; } diff --git a/src/sys.c b/src/sys.c index 8ef533980..650c20e08 100644 --- a/src/sys.c +++ b/src/sys.c @@ -130,9 +130,9 @@ extern const struct attack c_sa_no[NATTK]; void sysopt_seduce_set(val) +#if 0 int val; { -#if 0 /* * Attack substitution is now done on the fly in getmattk(mhitu.c). */ @@ -144,8 +144,9 @@ int val; mons[PM_SUCCUBUS].mattk[x] = setval[x]; } #else - nhUse(val); -#endif /*0*/ +int val UNUSED; +{ +#endif return; } diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 73f390df2..8af5db634 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -3592,7 +3592,11 @@ tty_nhgetch() /*ARGSUSED*/ int tty_nh_poskey(x, y, mod) +#if defined(WIN32CON) int *x, *y, *mod; +#else +int *x UNUSED, *y UNUSED, *mod UNUSED; +#endif { int i; @@ -3612,10 +3616,6 @@ int *x, *y, *mod; if (ttyDisplay && ttyDisplay->toplin == 1) ttyDisplay->toplin = 2; #else /* !WIN32CON */ - nhUse(x); - nhUse(y); - nhUse(mod); - i = tty_nhgetch(); #endif /* ?WIN32CON */ return i; -- 2.50.1