]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
s/REQUIRE/ISC_REQUIRE/; include <isc/assertions.h> if ISC_REQUIRE is used; include...
authorMark Andrews <marka@isc.org>
Thu, 19 Oct 2017 05:39:53 +0000 (16:39 +1100)
committerMark Andrews <marka@isc.org>
Thu, 19 Oct 2017 05:39:53 +0000 (16:39 +1100)
lib/dns/include/dns/rbt.h
lib/isc/include/isc/assertions.h
lib/isc/include/isc/buffer.h
lib/isc/include/isc/error.h

index 084d28732c3394725f96a2a8bb22358b2abf39cc..768f4d301e516bed0654037774c3bd226e69e19b 100644 (file)
@@ -13,6 +13,7 @@
 
 /*! \file dns/rbt.h */
 
+#include <isc/assertions.h>
 #include <isc/crc64.h>
 #include <isc/lang.h>
 #include <isc/magic.h>
@@ -1077,7 +1078,7 @@ dns_rbtnodechain_nextflat(dns_rbtnodechain_t *chain, dns_name_t *name);
        } while (0)
 #else  /* DNS_RBT_USEISCREFCOUNT */
 #define dns_rbtnode_refinit(node, n)    ((node)->references = (n))
-#define dns_rbtnode_refdestroy(node)    REQUIRE((node)->references == 0)
+#define dns_rbtnode_refdestroy(node)    ISC_REQUIRE((node)->references == 0)
 #define dns_rbtnode_refcurrent(node)    ((node)->references)
 
 #if (__STDC_VERSION__ + 0) >= 199901L || defined __GNUC__
@@ -1090,7 +1091,7 @@ dns_rbtnode_refincrement0(dns_rbtnode_t *node, unsigned int *refs) {
 
 static inline void
 dns_rbtnode_refincrement(dns_rbtnode_t *node, unsigned int *refs) {
-       REQUIRE(node->references > 0);
+       ISC_REQUIRE(node->references > 0);
        node->references++;
        if (refs != NULL)
                *refs = node->references;
@@ -1098,7 +1099,7 @@ dns_rbtnode_refincrement(dns_rbtnode_t *node, unsigned int *refs) {
 
 static inline void
 dns_rbtnode_refdecrement(dns_rbtnode_t *node, unsigned int *refs) {
-       REQUIRE(node->references > 0);
+       ISC_REQUIRE(node->references > 0);
        node->references--;
        if (refs != NULL)
                *refs = node->references;
@@ -1113,14 +1114,14 @@ dns_rbtnode_refdecrement(dns_rbtnode_t *node, unsigned int *refs) {
        } while (0)
 #define dns_rbtnode_refincrement(node, refs)                    \
        do {                                                    \
-               REQUIRE((node)->references > 0);                \
+               ISC_REQUIRE((node)->references > 0);                \
                (node)->references++;                           \
                if ((refs) != NULL)                             \
                        (*refs) = (node)->references;           \
        } while (0)
 #define dns_rbtnode_refdecrement(node, refs)                    \
        do {                                                    \
-               REQUIRE((node)->references > 0);                \
+               ISC_REQUIRE((node)->references > 0);                \
                (node)->references--;                           \
                if ((refs) != NULL)                             \
                        (*refs) = (node)->references;           \
index a3c5ee6077afa8a206e11f47a348164ecbe5b3e4..cb67f6167977721771beea54b61402fef91a4abe 100644 (file)
@@ -16,6 +16,7 @@
 #define ISC_ASSERTIONS_H 1
 
 #include <isc/lang.h>
+#include <isc/likely.h>
 #include <isc/platform.h>
 
 ISC_LANG_BEGINDECLS
index c4f21b774df46908fc8e28c073e479ec959d5350..5f8ad17819c6f26d784627df9916ad0dd1e4b301 100644 (file)
  *** Imports
  ***/
 
+#include <isc/assertions.h>
 #include <isc/formatcheck.h>
 #include <isc/lang.h>
+#include <isc/likely.h>
 #include <isc/magic.h>
 #include <isc/types.h>
 
@@ -911,10 +913,10 @@ ISC_LANG_ENDDECLS
        do { \
                if (ISC_UNLIKELY((_b)->autore)) { \
                        isc_buffer_t *_tmp = _b; \
-                       REQUIRE(isc_buffer_reserve(&_tmp, _length) \
+                       ISC_REQUIRE(isc_buffer_reserve(&_tmp, _length) \
                                == ISC_R_SUCCESS); \
                } \
-               REQUIRE(isc_buffer_availablelength(_b) >= (unsigned int) _length); \
+               ISC_REQUIRE(isc_buffer_availablelength(_b) >= (unsigned int) _length); \
                memmove(isc_buffer_used(_b), (_base), (_length)); \
                (_b)->used += (_length); \
        } while (0)
@@ -926,10 +928,10 @@ ISC_LANG_ENDDECLS
                _length = strlen(_source); \
                if (ISC_UNLIKELY((_b)->autore)) { \
                        isc_buffer_t *_tmp = _b; \
-                       REQUIRE(isc_buffer_reserve(&_tmp, _length) \
+                       ISC_REQUIRE(isc_buffer_reserve(&_tmp, _length) \
                                == ISC_R_SUCCESS); \
                } \
-               REQUIRE(isc_buffer_availablelength(_b) >= (unsigned int) _length); \
+               ISC_REQUIRE(isc_buffer_availablelength(_b) >= (unsigned int) _length); \
                _cp = isc_buffer_used(_b); \
                memmove(_cp, (_source), _length); \
                (_b)->used += (_length); \
@@ -942,10 +944,10 @@ ISC_LANG_ENDDECLS
                isc_uint8_t _val2 = (_val); \
                if (ISC_UNLIKELY((_b)->autore)) { \
                        isc_buffer_t *_tmp = _b; \
-                       REQUIRE(isc_buffer_reserve(&_tmp, 1) \
+                       ISC_REQUIRE(isc_buffer_reserve(&_tmp, 1) \
                                == ISC_R_SUCCESS); \
                } \
-               REQUIRE(isc_buffer_availablelength(_b) >= 1U); \
+               ISC_REQUIRE(isc_buffer_availablelength(_b) >= 1U); \
                _cp = isc_buffer_used(_b); \
                (_b)->used++; \
                _cp[0] = _val2; \
@@ -958,10 +960,10 @@ ISC_LANG_ENDDECLS
                isc_uint16_t _val2 = (_val); \
                if (ISC_UNLIKELY((_b)->autore)) { \
                        isc_buffer_t *_tmp = _b; \
-                       REQUIRE(isc_buffer_reserve(&_tmp, 2) \
+                       ISC_REQUIRE(isc_buffer_reserve(&_tmp, 2) \
                                == ISC_R_SUCCESS); \
                } \
-               REQUIRE(isc_buffer_availablelength(_b) >= 2U); \
+               ISC_REQUIRE(isc_buffer_availablelength(_b) >= 2U); \
                _cp = isc_buffer_used(_b); \
                (_b)->used += 2; \
                _cp[0] = (unsigned char)(_val2 >> 8); \
@@ -975,10 +977,10 @@ ISC_LANG_ENDDECLS
                isc_uint32_t _val2 = (_val); \
                if (ISC_UNLIKELY((_b)->autore)) { \
                        isc_buffer_t *_tmp = _b; \
-                       REQUIRE(isc_buffer_reserve(&_tmp, 3) \
+                       ISC_REQUIRE(isc_buffer_reserve(&_tmp, 3) \
                                == ISC_R_SUCCESS); \
                } \
-               REQUIRE(isc_buffer_availablelength(_b) >= 3U); \
+               ISC_REQUIRE(isc_buffer_availablelength(_b) >= 3U); \
                _cp = isc_buffer_used(_b); \
                (_b)->used += 3; \
                _cp[0] = (unsigned char)(_val2 >> 16); \
@@ -993,10 +995,10 @@ ISC_LANG_ENDDECLS
                isc_uint32_t _val2 = (_val); \
                if (ISC_UNLIKELY((_b)->autore)) { \
                        isc_buffer_t *_tmp = _b; \
-                       REQUIRE(isc_buffer_reserve(&_tmp, 4) \
+                       ISC_REQUIRE(isc_buffer_reserve(&_tmp, 4) \
                                == ISC_R_SUCCESS); \
                } \
-               REQUIRE(isc_buffer_availablelength(_b) >= 4U); \
+               ISC_REQUIRE(isc_buffer_availablelength(_b) >= 4U); \
                _cp = isc_buffer_used(_b); \
                (_b)->used += 4; \
                _cp[0] = (unsigned char)(_val2 >> 24); \
index 78804042a2204f4d5628c5e46d18b0204ce5e108..f808f6d4efd926fa3356981e19fc54b1642c4634 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <isc/formatcheck.h>
 #include <isc/lang.h>
+#include <isc/likely.h>
 #include <isc/platform.h>
 
 ISC_LANG_BEGINDECLS