diff options
| author | 2020-02-13 08:15:31 +0000 | |
|---|---|---|
| committer | 2020-02-13 08:15:31 +0000 | |
| commit | bdd5abfe143ea10572b424af4dc802c404f44b2f (patch) | |
| tree | 5fccf5d1ddb70b2aadcc246617904232c70e6137 | |
| parent | remove some files containing only comments (diff) | |
| download | wireguard-openbsd-bdd5abfe143ea10572b424af4dc802c404f44b2f.tar.xz wireguard-openbsd-bdd5abfe143ea10572b424af4dc802c404f44b2f.zip | |
unfidef assertions.h to always have assertions enabled; no change
in behaviour.
While here unifdef one remaining __COVERITY__.
While we might want to move away from assertions we can't just nuke
them since they are used for error checking.
| -rw-r--r-- | usr.bin/dig/lib/dns/dns_time.c | 10 | ||||
| -rw-r--r-- | usr.bin/dig/lib/isc/assertions.c | 3 | ||||
| -rw-r--r-- | usr.bin/dig/lib/isc/include/isc/assertions.h | 52 |
3 files changed, 3 insertions, 62 deletions
diff --git a/usr.bin/dig/lib/dns/dns_time.c b/usr.bin/dig/lib/dns/dns_time.c index 105b753e517..d449115a172 100644 --- a/usr.bin/dig/lib/dns/dns_time.c +++ b/usr.bin/dig/lib/dns/dns_time.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dns_time.c,v 1.2 2020/02/11 23:26:11 jsg Exp $ */ +/* $Id: dns_time.c,v 1.3 2020/02/13 08:15:31 florian Exp $ */ /*! \file */ @@ -159,14 +159,6 @@ dns_time64_fromtext(const char *source, int64_t *target) { RANGE(1, 12, month); RANGE(1, days[month - 1] + ((month == 2 && is_leap(year)) ? 1 : 0), day); -#ifdef __COVERITY__ - /* - * Use a simplified range to silence Coverity warning (in - * arithmetic with day below). - */ - RANGE(1, 31, day); -#endif /* __COVERITY__ */ - RANGE(0, 23, hour); RANGE(0, 59, minute); RANGE(0, 60, second); /* 60 == leap second. */ diff --git a/usr.bin/dig/lib/isc/assertions.c b/usr.bin/dig/lib/isc/assertions.c index 5ef8fa32e68..f0d10654b8b 100644 --- a/usr.bin/dig/lib/isc/assertions.c +++ b/usr.bin/dig/lib/isc/assertions.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: assertions.c,v 1.3 2020/02/12 13:05:04 jsg Exp $ */ +/* $Id: assertions.c,v 1.4 2020/02/13 08:15:31 florian Exp $ */ /*! \file */ @@ -38,7 +38,6 @@ static isc_assertioncallback_t isc_assertion_failed_cb = default_callback; */ /*% assertion failed handler */ -/* coverity[+kill] */ void isc_assertion_failed(const char *file, int line, isc_assertiontype_t type, const char *cond) diff --git a/usr.bin/dig/lib/isc/include/isc/assertions.h b/usr.bin/dig/lib/isc/include/isc/assertions.h index 23dc094b718..5db9a0b14d7 100644 --- a/usr.bin/dig/lib/isc/include/isc/assertions.h +++ b/usr.bin/dig/lib/isc/include/isc/assertions.h @@ -15,7 +15,7 @@ */ /* - * $Id: assertions.h,v 1.2 2020/02/12 13:05:04 jsg Exp $ + * $Id: assertions.h,v 1.3 2020/02/13 08:15:31 florian Exp $ */ /*! \file isc/assertions.h */ @@ -42,83 +42,33 @@ typedef enum { typedef void (*isc_assertioncallback_t)(const char *, int, isc_assertiontype_t, const char *); -/* coverity[+kill] */ __dead void isc_assertion_failed(const char *, int, isc_assertiontype_t, const char *); const char * isc_assertion_typetotext(isc_assertiontype_t type); -#if defined(ISC_CHECK_ALL) || defined(__COVERITY__) -#define ISC_CHECK_REQUIRE 1 -#define ISC_CHECK_ENSURE 1 -#define ISC_CHECK_INSIST 1 -#define ISC_CHECK_INVARIANT 1 -#endif - -#if defined(ISC_CHECK_NONE) && !defined(__COVERITY__) -#define ISC_CHECK_REQUIRE 0 -#define ISC_CHECK_ENSURE 0 -#define ISC_CHECK_INSIST 0 -#define ISC_CHECK_INVARIANT 0 -#endif - -#ifndef ISC_CHECK_REQUIRE -#define ISC_CHECK_REQUIRE 1 -#endif - -#ifndef ISC_CHECK_ENSURE -#define ISC_CHECK_ENSURE 1 -#endif - -#ifndef ISC_CHECK_INSIST -#define ISC_CHECK_INSIST 1 -#endif - -#ifndef ISC_CHECK_INVARIANT -#define ISC_CHECK_INVARIANT 1 -#endif - -#if ISC_CHECK_REQUIRE != 0 #define ISC_REQUIRE(cond) \ ((void) ((cond) || \ ((isc_assertion_failed)(__FILE__, __LINE__, \ isc_assertiontype_require, \ #cond), 0))) -#else -#define ISC_REQUIRE(cond) ((void) 0) -#endif /* ISC_CHECK_REQUIRE */ - -#if ISC_CHECK_ENSURE != 0 #define ISC_ENSURE(cond) \ ((void) ((cond) || \ ((isc_assertion_failed)(__FILE__, __LINE__, \ isc_assertiontype_ensure, \ #cond), 0))) -#else -#define ISC_ENSURE(cond) ((void) 0) -#endif /* ISC_CHECK_ENSURE */ - -#if ISC_CHECK_INSIST != 0 #define ISC_INSIST(cond) \ ((void) ((cond) || \ ((isc_assertion_failed)(__FILE__, __LINE__, \ isc_assertiontype_insist, \ #cond), 0))) -#else -#define ISC_INSIST(cond) ((void) 0) -#endif /* ISC_CHECK_INSIST */ -#if ISC_CHECK_INVARIANT != 0 #define ISC_INVARIANT(cond) \ ((void) ((cond) || \ ((isc_assertion_failed)(__FILE__, __LINE__, \ isc_assertiontype_invariant, \ #cond), 0))) -#else -#define ISC_INVARIANT(cond) ((void) 0) -#endif /* ISC_CHECK_INVARIANT */ - ISC_LANG_ENDDECLS #endif /* ISC_ASSERTIONS_H */ |
