2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Update the source code formatting using clang-format-12

clang-format now tries to keep the type-cast on the same line as the
variable.  Update the formatting.
This commit is contained in:
Ondřej Surý
2021-06-12 09:14:40 +02:00
parent 9f7855322c
commit b3de93e54c
4 changed files with 20 additions and 15 deletions

View File

@@ -96,10 +96,11 @@ typedef uint64_t dns_rpz_zbits_t;
* Mask of the specified and higher numbered policy zones
* Avoid hassles with (1<<33) or (1<<65)
*/
#define DNS_RPZ_ZMASK(n) \
((dns_rpz_zbits_t)( \
(((n) >= DNS_RPZ_MAX_ZONES - 1) ? 0 : (1ULL << ((n) + 1))) - \
1))
#define DNS_RPZ_ZMASK(n) \
((dns_rpz_zbits_t)((((n) >= DNS_RPZ_MAX_ZONES - 1) \
? 0 \
: (1ULL << ((n) + 1))) - \
1))
/*
* The trigger counter type.

View File

@@ -1578,9 +1578,9 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
msg->opt = rdataset;
rdataset = NULL;
free_rdataset = false;
ercode = (dns_rcode_t)(
(msg->opt->ttl & DNS_MESSAGE_EDNSRCODE_MASK) >>
20);
ercode = (dns_rcode_t)((msg->opt->ttl &
DNS_MESSAGE_EDNSRCODE_MASK) >>
20);
msg->rcode |= ercode;
dns_message_puttempname(msg, &name);
free_name = false;

View File

@@ -6848,8 +6848,10 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
if ((rdataset->attributes & DNS_RDATASETATTR_RESIGN) != 0) {
RDATASET_ATTR_SET(newheader, RDATASET_ATTR_RESIGN);
newheader->resign = (isc_stdtime_t)(
dns_time64_from32(rdataset->resign) >> 1);
newheader->resign =
(isc_stdtime_t)(dns_time64_from32(
rdataset->resign) >>
1);
newheader->resign_lsb = rdataset->resign & 0x1;
} else {
newheader->resign = 0;
@@ -7058,8 +7060,9 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
newheader->node = rbtnode;
if ((rdataset->attributes & DNS_RDATASETATTR_RESIGN) != 0) {
RDATASET_ATTR_SET(newheader, RDATASET_ATTR_RESIGN);
newheader->resign = (isc_stdtime_t)(
dns_time64_from32(rdataset->resign) >> 1);
newheader->resign =
(isc_stdtime_t)(dns_time64_from32(rdataset->resign) >>
1);
newheader->resign_lsb = rdataset->resign & 0x1;
} else {
newheader->resign = 0;
@@ -7468,8 +7471,9 @@ loading_addrdataset(void *arg, const dns_name_t *name,
if ((rdataset->attributes & DNS_RDATASETATTR_RESIGN) != 0) {
RDATASET_ATTR_SET(newheader, RDATASET_ATTR_RESIGN);
newheader->resign = (isc_stdtime_t)(
dns_time64_from32(rdataset->resign) >> 1);
newheader->resign =
(isc_stdtime_t)(dns_time64_from32(rdataset->resign) >>
1);
newheader->resign_lsb = rdataset->resign & 0x1;
} else {
newheader->resign = 0;

View File

@@ -185,10 +185,10 @@ typedef uintmax_t atomic_uintmax_t;
fail) \
({ \
__typeof__(obj) __v; \
_Bool __r; \
_Bool __r; \
__v = (__typeof__(obj))__sync_val_compare_and_swap( \
obj, *(expected), desired); \
__r = ((__typeof__(obj)) * (expected) == __v); \
__r = ((__typeof__(obj))*(expected) == __v); \
*(expected) = __v; \
__r; \
})