]> granicus.if.org Git - nethack/commitdiff
Update nhUse
authorDean Luick <dean@nethack.org>
Fri, 15 Jan 2021 22:34:21 +0000 (16:34 -0600)
committerDean Luick <dean@nethack.org>
Thu, 21 Jan 2021 04:18:34 +0000 (22:18 -0600)
There is no longer any compiler reason to disable nhUse - remove
nhUse's conditional definition.

Update the nhUse definition to "use" a variable without it needing
to be an integer.

This change removes some gcc compiler unused variable and parameter
warnings.

include/lint.h
src/decl.c

index 66ad73d72fdd0718aa428259d13a993f8a75a843..d812117fbd62c7c1c026ab29d5db8357e7261334 100644 (file)
    (also caller's responsibility to ensure it isn't actually modified!) */
 #define nhStr(str) ((char *) str)
 
-#if defined(GCC_WARN) && !defined(FORCE_ARG_USAGE)
-#define FORCE_ARG_USAGE
-#endif
-
-#ifdef FORCE_ARG_USAGE
-/* force an unused function argument to become used in an arbitrary
-   manner in order to suppress warning about unused function arguments;
-   viable for scalar and pointer arguments */
-#define nhUse(arg) nhUse_dummy += (unsigned) !(arg)
-extern unsigned nhUse_dummy;
-#else
-#define nhUse(arg) /*empty*/
-#endif
+#define nhUse(arg) (void)(arg)
 
 /*
  * This stuff isn't related to lint suppression but lives here to
index 62906163a691e73e1aab28dad842a3bfa32e4afe..c257fadb79034d25abddf0a3e2e2af8f1a09b6a2 100644 (file)
@@ -153,9 +153,6 @@ NEARDATA struct savefile_info sfcap, sfrestinfo, sfsaveinfo;
 const char *ARGV0;
 #endif
 
-/* support for lint.h */
-unsigned nhUse_dummy = 0;
-
 #define IVMAGIC 0xdeadbeef
 
 #ifdef GCC_WARN