From: Dean Luick Date: Fri, 15 Jan 2021 22:34:21 +0000 (-0600) Subject: Update nhUse X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16ba1a583a8ef3c77c18565b025a338eceda84a6;p=nethack Update nhUse 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. --- diff --git a/include/lint.h b/include/lint.h index 66ad73d72..d812117fb 100644 --- a/include/lint.h +++ b/include/lint.h @@ -15,19 +15,7 @@ (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 diff --git a/src/decl.c b/src/decl.c index 62906163a..c257fadb7 100644 --- a/src/decl.c +++ b/src/decl.c @@ -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