From: Mark Andrews Date: Fri, 17 May 2024 02:29:59 +0000 (+1000) Subject: Clang-format header file changes X-Git-Tag: v9.20.0~29^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7de2c7cb959fa35099d72c3f9b13938348c74e6;p=thirdparty%2Fbind9.git Clang-format header file changes --- diff --git a/lib/dns/include/dns/name.h b/lib/dns/include/dns/name.h index 8180b1bb038..7d90ff836f9 100644 --- a/lib/dns/include/dns/name.h +++ b/lib/dns/include/dns/name.h @@ -166,28 +166,34 @@ extern const dns_name_t *dns_wildcardname; * unsigned char offsets[] = { 0, 6 }; * dns_name_t value = DNS_NAME_INITABSOLUTE(data, offsets); */ -#define DNS_NAME_INITNONABSOLUTE(A, B) \ - { \ - .magic = DNS_NAME_MAGIC, .ndata = A, \ - .length = (sizeof(A) - 1), .labels = sizeof(B), \ - .attributes = { .readonly = true }, .offsets = B, \ - .link = ISC_LINK_INITIALIZER, .list = ISC_LIST_INITIALIZER, \ +#define DNS_NAME_INITNONABSOLUTE(A, B) \ + { \ + .magic = DNS_NAME_MAGIC, \ + .ndata = A, \ + .length = (sizeof(A) - 1), \ + .labels = sizeof(B), \ + .attributes = { .readonly = true }, \ + .offsets = B, \ + .link = ISC_LINK_INITIALIZER, \ + .list = ISC_LIST_INITIALIZER, \ } -#define DNS_NAME_INITABSOLUTE(A, B) \ - { \ - .magic = DNS_NAME_MAGIC, .ndata = A, .length = sizeof(A), \ - .labels = sizeof(B), \ - .attributes = { .readonly = true, .absolute = true }, \ - .offsets = B, .link = ISC_LINK_INITIALIZER, \ - .list = ISC_LIST_INITIALIZER, \ +#define DNS_NAME_INITABSOLUTE(A, B) \ + { \ + .magic = DNS_NAME_MAGIC, \ + .ndata = A, \ + .length = sizeof(A), \ + .labels = sizeof(B), \ + .attributes = { .readonly = true, .absolute = true }, \ + .offsets = B, \ + .link = ISC_LINK_INITIALIZER, \ + .list = ISC_LIST_INITIALIZER, \ } -#define DNS_NAME_INITEMPTY \ - { \ - .magic = DNS_NAME_MAGIC, .link = ISC_LINK_INITIALIZER, \ - .list = ISC_LIST_INITIALIZER \ - } +#define DNS_NAME_INITEMPTY \ + { .magic = DNS_NAME_MAGIC, \ + .link = ISC_LINK_INITIALIZER, \ + .list = ISC_LIST_INITIALIZER } /*% * Standard sizes of a wire format name diff --git a/lib/dns/include/dns/rdataset.h b/lib/dns/include/dns/rdataset.h index c4c819b5a9e..a54cde615e2 100644 --- a/lib/dns/include/dns/rdataset.h +++ b/lib/dns/include/dns/rdataset.h @@ -223,11 +223,10 @@ struct dns_rdataset { #define DNS_RDATASET_COUNT_UNDEFINED UINT32_MAX -#define DNS_RDATASET_INIT \ - { \ - .magic = DNS_RDATASET_MAGIC, .link = ISC_LINK_INITIALIZER, \ - .count = DNS_RDATASET_COUNT_UNDEFINED \ - } +#define DNS_RDATASET_INIT \ + { .magic = DNS_RDATASET_MAGIC, \ + .link = ISC_LINK_INITIALIZER, \ + .count = DNS_RDATASET_COUNT_UNDEFINED } /*! * \def DNS_RDATASETATTR_RENDERED diff --git a/lib/isc/include/isc/list.h b/lib/isc/include/isc/list.h index 67ed208c2c0..9668e89f989 100644 --- a/lib/isc/include/isc/list.h +++ b/lib/isc/include/isc/list.h @@ -17,9 +17,10 @@ #define ISC_LINK_TOMBSTONE(type) ((type *)-1) -#define ISC_LIST_INITIALIZER \ - { \ - .head = NULL, .tail = NULL, \ +#define ISC_LIST_INITIALIZER \ + { \ + .head = NULL, \ + .tail = NULL, \ } #define ISC_LINK_INITIALIZER_TYPE(type) \ { \ diff --git a/lib/isc/net.c b/lib/isc/net.c index 038d2aa7725..19c15071df5 100644 --- a/lib/isc/net.c +++ b/lib/isc/net.c @@ -80,14 +80,10 @@ #ifdef __OpenBSD__ #define USE_SYSCTL_PORTRANGE -#define SYSCTL_V4PORTRANGE_LOW \ - { \ - CTL_NET, PF_INET, IPPROTO_IP, IPCTL_IPPORT_HIFIRSTAUTO \ - } -#define SYSCTL_V4PORTRANGE_HIGH \ - { \ - CTL_NET, PF_INET, IPPROTO_IP, IPCTL_IPPORT_HILASTAUTO \ - } +#define SYSCTL_V4PORTRANGE_LOW \ + { CTL_NET, PF_INET, IPPROTO_IP, IPCTL_IPPORT_HIFIRSTAUTO } +#define SYSCTL_V4PORTRANGE_HIGH \ + { CTL_NET, PF_INET, IPPROTO_IP, IPCTL_IPPORT_HILASTAUTO } /* Same for IPv6 */ #define SYSCTL_V6PORTRANGE_LOW SYSCTL_V4PORTRANGE_LOW #define SYSCTL_V6PORTRANGE_HIGH SYSCTL_V4PORTRANGE_HIGH diff --git a/lib/isc/netmgr/http.c b/lib/isc/netmgr/http.c index d33d778df61..a807124c1de 100644 --- a/lib/isc/netmgr/http.c +++ b/lib/isc/netmgr/http.c @@ -855,18 +855,13 @@ send_client_connection_header(isc_nm_http_session_t *session) { return (true); } -#define MAKE_NV(NAME, VALUE, VALUELEN) \ - { \ - (uint8_t *)(uintptr_t)(NAME), (uint8_t *)(uintptr_t)(VALUE), \ - sizeof(NAME) - 1, VALUELEN, NGHTTP2_NV_FLAG_NONE \ - } +#define MAKE_NV(NAME, VALUE, VALUELEN) \ + { (uint8_t *)(uintptr_t)(NAME), (uint8_t *)(uintptr_t)(VALUE), \ + sizeof(NAME) - 1, VALUELEN, NGHTTP2_NV_FLAG_NONE } -#define MAKE_NV2(NAME, VALUE) \ - { \ - (uint8_t *)(uintptr_t)(NAME), (uint8_t *)(uintptr_t)(VALUE), \ - sizeof(NAME) - 1, sizeof(VALUE) - 1, \ - NGHTTP2_NV_FLAG_NONE \ - } +#define MAKE_NV2(NAME, VALUE) \ + { (uint8_t *)(uintptr_t)(NAME), (uint8_t *)(uintptr_t)(VALUE), \ + sizeof(NAME) - 1, sizeof(VALUE) - 1, NGHTTP2_NV_FLAG_NONE } static ssize_t client_read_callback(nghttp2_session *ngsession, int32_t stream_id, @@ -2000,10 +1995,8 @@ server_send_response(nghttp2_session *ngsession, int32_t stream_id, return (ISC_R_SUCCESS); } -#define MAKE_ERROR_REPLY(tag, code, desc) \ - { \ - tag, MAKE_NV2(":status", #code), desc \ - } +#define MAKE_ERROR_REPLY(tag, code, desc) \ + { tag, MAKE_NV2(":status", #code), desc } /* * Here we use roughly the same error codes that Unbound uses. diff --git a/tests/dns/rdata_test.c b/tests/dns/rdata_test.c index d52a1950dec..f5746279ab4 100644 --- a/tests/dns/rdata_test.c +++ b/tests/dns/rdata_test.c @@ -78,42 +78,19 @@ typedef struct wire_ok { unsigned int loop; } wire_ok_t; -#define COMPARE(r1, r2, answer) \ - { \ - r1, r2, answer, __LINE__ \ - } -#define COMPARE_SENTINEL() \ - { \ - NULL, NULL, 0, __LINE__ \ - } +#define COMPARE(r1, r2, answer) { r1, r2, answer, __LINE__ } +#define COMPARE_SENTINEL() { NULL, NULL, 0, __LINE__ } -#define TEXT_VALID_CHANGED(data_in, data_out) \ - { \ - data_in, data_out, 0 \ - } -#define TEXT_VALID(data) \ - { \ - data, data, 0 \ - } -#define TEXT_VALID_LOOP(loop, data) \ - { \ - data, data, loop \ - } -#define TEXT_VALID_LOOPCHG(loop, data_in, data_out) \ - { \ - data_in, data_out, loop \ - } -#define TEXT_INVALID(data) \ - { \ - data, NULL, 0 \ - } -#define TEXT_SENTINEL() TEXT_INVALID(NULL) +#define TEXT_VALID_CHANGED(data_in, data_out) { data_in, data_out, 0 } +#define TEXT_VALID(data) { data, data, 0 } +#define TEXT_VALID_LOOP(loop, data) { data, data, loop } +#define TEXT_VALID_LOOPCHG(loop, data_in, data_out) { data_in, data_out, loop } +#define TEXT_INVALID(data) { data, NULL, 0 } +#define TEXT_SENTINEL() TEXT_INVALID(NULL) #define VARGC(...) (sizeof((unsigned char[]){ __VA_ARGS__ })) -#define WIRE_TEST(ok, loop, ...) \ - { \ - { __VA_ARGS__ }, VARGC(__VA_ARGS__), ok, loop \ - } +#define WIRE_TEST(ok, loop, ...) \ + { { __VA_ARGS__ }, VARGC(__VA_ARGS__), ok, loop } #define WIRE_VALID(...) WIRE_TEST(true, 0, __VA_ARGS__) #define WIRE_VALID_LOOP(loop, ...) WIRE_TEST(true, loop, __VA_ARGS__) /* diff --git a/tests/dns/sigs_test.c b/tests/dns/sigs_test.c index 09105040030..aeadb93ae60 100644 --- a/tests/dns/sigs_test.c +++ b/tests/dns/sigs_test.c @@ -59,10 +59,7 @@ typedef struct { const char *type; } zonediff_t; -#define ZONEDIFF_SENTINEL \ - { \ - 0, NULL, 0, NULL \ - } +#define ZONEDIFF_SENTINEL { 0, NULL, 0, NULL } /*% * Structure defining a dns__zone_updatesigs() test. diff --git a/tests/include/tests/dns.h b/tests/include/tests/dns.h index 22a626f35e2..2ce75fcc96b 100644 --- a/tests/include/tests/dns.h +++ b/tests/include/tests/dns.h @@ -44,10 +44,7 @@ typedef struct { const char *rdata; } zonechange_t; -#define ZONECHANGE_SENTINEL \ - { \ - 0, NULL, 0, NULL, NULL \ - } +#define ZONECHANGE_SENTINEL { 0, NULL, 0, NULL, NULL } isc_result_t dns_test_makeview(const char *name, bool with_dispatchmgr, bool with_cache, diff --git a/tests/include/tests/ns.h b/tests/include/tests/ns.h index 8661d1d8ddd..c313abfa04d 100644 --- a/tests/include/tests/ns.h +++ b/tests/include/tests/ns.h @@ -41,10 +41,7 @@ typedef struct ns_test_id { int lineno; } ns_test_id_t; -#define NS_TEST_ID(desc) \ - { \ - .description = desc, .lineno = __LINE__ \ - } +#define NS_TEST_ID(desc) { .description = desc, .lineno = __LINE__ } extern dns_dispatchmgr_t *dispatchmgr; extern ns_interfacemgr_t *interfacemgr;