]> granicus.if.org Git - nethack/commitdiff
more warning bits
authornhmall <nhmall@nethack.org>
Sat, 10 Oct 2020 20:28:17 +0000 (16:28 -0400)
committernhmall <nhmall@nethack.org>
Sat, 10 Oct 2020 20:28:17 +0000 (16:28 -0400)
include/obj.h
src/display.c
src/dokick.c
src/invent.c
src/mdlib.c
src/mkobj.c
src/options.c
src/restore.c
src/sp_lev.c
src/sys.c
win/tty/wintty.c

index d6577da91ce0add80a7f07a7a3a7f42cf1b699aa..88c4902d01bc97a63e3a2dfc92d976dd17dcecf4 100644 (file)
@@ -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 */
index 0efe1582c9c33cfe9a463bcf081fe46e2480965d..89e7c95a5e0957469fb526804cfe12f0e4badb5e 100644 (file)
@@ -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);
index 5564c84c5da3764305d0e1bd3b316014db8da712..979f1315cf45a7885a2d733fc58fb6f645403648 100644 (file)
@@ -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)
index eeb5404493a51c183e58ab4f88e9e551f8a78e87..cfc80f5eb2a87fff131184881a553dacb0be76f5 100644 (file)
@@ -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;
 
index 623333df845d8786f4d0a464f3056f20584f0570..bbd85225b6e321546801692807e93167d10f61d3 100644 (file)
@@ -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)
index 6c3d8b4a90ba0ba00441ae272f5b5c0d8ef5176c..d894ae920ffbf24e9cc20ae6739d3113131a9da4 100644 (file)
@@ -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;
 }
 
index f8ddb2f5e3d5b70a30fa4aa637901d0ec5cfd7d2..ac50af93653bfb8c7bff45a93d20ffd91080622d 100644 (file)
@@ -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;
index 816ca3f8eb48418e3344527339931674083235e4..ea75d54daf6c14004ffa8b635373f836d5730409 100644 (file)
@@ -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);
     }
index f11099af29faab368f7dc5738fa160f1d5f0e052..c469d974733ffbc20de4173440e7b4e5b9c61973 100755 (executable)
@@ -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;
 }
 
index 8ef53398057cdb458285e46f9d323e93f151167f..650c20e086de09e2e6bc2529eadf296d7e643dbd 100644 (file)
--- 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;
 }
 
index 73f390df27d774c6cbd229fc988298de9b5889f8..8af5db6340c69273b6858d96a3cc3c7d90cb24ba 100644 (file)
@@ -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;