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.
This commit is contained in:
Dean Luick
2021-01-20 22:18:34 -06:00
parent e0a6ab5e6b
commit 16ba1a583a
2 changed files with 1 additions and 16 deletions
+1 -13
View File
@@ -15,19 +15,7 @@
(also caller's responsibility to ensure it isn't actually modified!) */ (also caller's responsibility to ensure it isn't actually modified!) */
#define nhStr(str) ((char *) str) #define nhStr(str) ((char *) str)
#if defined(GCC_WARN) && !defined(FORCE_ARG_USAGE) #define nhUse(arg) (void)(arg)
#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
/* /*
* This stuff isn't related to lint suppression but lives here to * This stuff isn't related to lint suppression but lives here to
-3
View File
@@ -153,9 +153,6 @@ NEARDATA struct savefile_info sfcap, sfrestinfo, sfsaveinfo;
const char *ARGV0; const char *ARGV0;
#endif #endif
/* support for lint.h */
unsigned nhUse_dummy = 0;
#define IVMAGIC 0xdeadbeef #define IVMAGIC 0xdeadbeef
#ifdef GCC_WARN #ifdef GCC_WARN