From ec075c6efbc094820643299f4f743b2af0267b91 Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Thu, 16 Dec 1999 22:42:05 +0000 Subject: [PATCH] revert assertions.h, and add UNUSED() to util.h --- lib/isc/include/isc/assertions.h | 12 +++++------- lib/isc/include/isc/util.h | 11 +++++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/isc/include/isc/assertions.h b/lib/isc/include/isc/assertions.h index 842f7cf9e2..3961dcf587 100644 --- a/lib/isc/include/isc/assertions.h +++ b/lib/isc/include/isc/assertions.h @@ -16,7 +16,7 @@ */ /* - * $Id: assertions.h,v 1.5 1999/12/15 01:48:46 explorer Exp $ + * $Id: assertions.h,v 1.6 1999/12/16 22:42:04 explorer Exp $ */ #ifndef ISC_ASSERTIONS_H @@ -24,8 +24,6 @@ #include -#define UNUSED(x) (void)(x) - ISC_LANG_BEGINDECLS typedef enum { @@ -80,7 +78,7 @@ char *isc_assertion_typetotext(isc_assertiontype_t type); isc_assertiontype_require, \ #cond), 0))) #else -#define REQUIRE(cond) (UNUSED(0)) +#define REQUIRE(cond) ((void) 0) #endif /* CHECK_REQUIRE */ #if CHECK_ENSURE != 0 @@ -90,7 +88,7 @@ char *isc_assertion_typetotext(isc_assertiontype_t type); isc_assertiontype_ensure, \ #cond), 0))) #else -#define ENSURE(cond) (UNUSED(0)) +#define ENSURE(cond) ((void) 0) #endif /* CHECK_ENSURE */ #if CHECK_INSIST != 0 @@ -100,7 +98,7 @@ char *isc_assertion_typetotext(isc_assertiontype_t type); isc_assertiontype_insist, \ #cond), 0))) #else -#define INSIST(cond) (UNUSED(0)) +#define INSIST(cond) ((void) 0) #endif /* CHECK_INSIST */ #if CHECK_INVARIANT != 0 @@ -110,7 +108,7 @@ char *isc_assertion_typetotext(isc_assertiontype_t type); isc_assertiontype_invariant, \ #cond), 0))) #else -#define INVARIANT(cond) (UNUSED(0)) +#define INVARIANT(cond) ((void) 0) #endif /* CHECK_INVARIANT */ ISC_LANG_ENDDECLS diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h index 59b8dffdd1..ef24f98f44 100644 --- a/lib/isc/include/isc/util.h +++ b/lib/isc/include/isc/util.h @@ -35,6 +35,17 @@ *** General Macros. ***/ +/* + * Use this to hide unused function arguments. + * + * int + * foo(char *bar) + * { + * UNUSED(bar); + * } + */ +#define UNUSED(x) (void)(x) + #define ISC_MAX(a, b) ((a) > (b) ? (a) : (b)) #define ISC_MIN(a, b) ((a) < (b) ? (a) : (b))