diff --git a/bin/delv/delv.c b/bin/delv/delv.c index 262f83cdb2..ae7aad957c 100644 --- a/bin/delv/delv.c +++ b/bin/delv/delv.c @@ -371,7 +371,7 @@ print_status(dns_rdataset_t *rdataset) { if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) { strlcat(buf, "negative response", sizeof(buf)); - strlcat(buf, (yaml ? "_" : ", "), sizeof(buf)); + strlcat(buf, yaml ? "_" : ", ", sizeof(buf)); } switch (rdataset->trust) { diff --git a/bin/dnssec/dnssec-keygen.c b/bin/dnssec/dnssec-keygen.c index c3e24a39e7..9212f32185 100644 --- a/bin/dnssec/dnssec-keygen.c +++ b/bin/dnssec/dnssec-keygen.c @@ -389,10 +389,10 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) { fatal("-S and -G cannot be used together"); } - ret = dst_key_fromnamedfile( - ctx->predecessor, ctx->directory, - (DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | DST_TYPE_STATE), - mctx, &prevkey); + ret = dst_key_fromnamedfile(ctx->predecessor, ctx->directory, + DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | + DST_TYPE_STATE, + mctx, &prevkey); if (ret != ISC_R_SUCCESS) { fatal("Invalid keyfile %s: %s", ctx->predecessor, isc_result_totext(ret)); diff --git a/bin/dnssec/dnssec-ksr.c b/bin/dnssec/dnssec-ksr.c index ea96d41c11..0279a0f3e7 100644 --- a/bin/dnssec/dnssec-ksr.c +++ b/bin/dnssec/dnssec-ksr.c @@ -482,11 +482,11 @@ create_key(ksr_ctx_t *ksr, dns_kasp_t *kasp, dns_kasp_key_t *kaspkey, dst_key_setbool(key, DST_BOOL_KSK, ksr->ksk); dst_key_setbool(key, DST_BOOL_ZSK, !ksr->ksk); dst_key_settime(key, DST_TIME_CREATED, ksr->now); - dst_key_settime(key, DST_TIME_PUBLISH, (active - prepub)); + dst_key_settime(key, DST_TIME_PUBLISH, active - prepub); dst_key_settime(key, DST_TIME_ACTIVATE, active); if (ksr->ksk) { dns_keymgr_settime_syncpublish(key, kasp, - (inception == ksr->start)); + inception == ksr->start); } if (ksr->lifetime > 0) { @@ -502,7 +502,7 @@ create_key(ksr_ctx_t *ksr, dns_kasp_t *kasp, dns_kasp_key_t *kaspkey, ksr->retiresafety + ksr->signdelay; } dst_key_settime(key, DST_TIME_INACTIVE, inactive); - dst_key_settime(key, DST_TIME_DELETE, (inactive + remove)); + dst_key_settime(key, DST_TIME_DELETE, inactive + remove); *expiration = inactive; } else { *expiration = 0; diff --git a/bin/named/dlz_dlopen_driver.c b/bin/named/dlz_dlopen_driver.c index 95f4ddd366..4906fad548 100644 --- a/bin/named/dlz_dlopen_driver.c +++ b/bin/named/dlz_dlopen_driver.c @@ -267,13 +267,13 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[], cd->dlz_allowzonexfr = (dlz_dlopen_allowzonexfr_t *)dl_load_symbol( cd, "dlz_allowzonexfr", false); cd->dlz_allnodes = (dlz_dlopen_allnodes_t *)dl_load_symbol( - cd, "dlz_allnodes", (cd->dlz_allowzonexfr != NULL)); + cd, "dlz_allnodes", cd->dlz_allowzonexfr != NULL); cd->dlz_authority = (dlz_dlopen_authority_t *)dl_load_symbol( cd, "dlz_authority", false); cd->dlz_newversion = (dlz_dlopen_newversion_t *)dl_load_symbol( cd, "dlz_newversion", false); cd->dlz_closeversion = (dlz_dlopen_closeversion_t *)dl_load_symbol( - cd, "dlz_closeversion", (cd->dlz_newversion != NULL)); + cd, "dlz_closeversion", cd->dlz_newversion != NULL); cd->dlz_configure = (dlz_dlopen_configure_t *)dl_load_symbol( cd, "dlz_configure", false); cd->dlz_ssumatch = (dlz_dlopen_ssumatch_t *)dl_load_symbol( diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 435150e380..efb8cb9512 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -2514,10 +2514,10 @@ dbfind_name(dns_adbname_t *adbname, isc_stdtime_t now, dns_rdatatype_t rdtype) { if ((adbname->flags & DNS_ADBFIND_STARTATZONE) != 0) { options |= DNS_DBFIND_PENDINGOK; } - result = dns_view_find( - adb->view, adbname->name, rdtype, now, options, true, - ((adbname->flags & DNS_ADBFIND_STARTATZONE) != 0), NULL, NULL, - fname, &rdataset, NULL); + result = dns_view_find(adb->view, adbname->name, rdtype, now, options, + true, + (adbname->flags & DNS_ADBFIND_STARTATZONE) != 0, + NULL, NULL, fname, &rdataset, NULL); switch (result) { case DNS_R_GLUE: diff --git a/lib/dns/byaddr.c b/lib/dns/byaddr.c index fff186746e..e2f5208ddb 100644 --- a/lib/dns/byaddr.c +++ b/lib/dns/byaddr.c @@ -57,10 +57,10 @@ dns_byaddr_createptrname(const isc_netaddr_t *address, dns_name_t *name) { if (address->family == AF_INET) { (void)snprintf(textname, sizeof(textname), "%u.%u.%u.%u.in-addr.arpa.", - ((unsigned int)bytes[3] & 0xffU), - ((unsigned int)bytes[2] & 0xffU), - ((unsigned int)bytes[1] & 0xffU), - ((unsigned int)bytes[0] & 0xffU)); + (unsigned int)bytes[3] & 0xffU, + (unsigned int)bytes[2] & 0xffU, + (unsigned int)bytes[1] & 0xffU, + (unsigned int)bytes[0] & 0xffU); } else if (address->family == AF_INET6) { size_t remaining; diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index 9fc034e0f9..c7e99bfb56 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -564,7 +564,7 @@ udp_recv(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region, dispentry_log(resp, ISC_LOG_DEBUG(92), "got valid DNS message header, /QR %c, id %u", - (((flags & DNS_MESSAGEFLAG_QR) != 0) ? '1' : '0'), id); + ((flags & DNS_MESSAGEFLAG_QR) != 0) ? '1' : '0', id); /* * Look at the message flags. If it's a query, ignore it. @@ -668,7 +668,7 @@ tcp_recv_success(dns_dispatch_t *disp, isc_region_t *region, dispatch_log(disp, ISC_LOG_DEBUG(92), "got valid DNS message header, /QR %c, id %u", - (((flags & DNS_MESSAGEFLAG_QR) != 0) ? '1' : '0'), id); + ((flags & DNS_MESSAGEFLAG_QR) != 0) ? '1' : '0', id); /* * Look at the message flags. If it's a query, ignore it and keep diff --git a/lib/dns/dnssec.c b/lib/dns/dnssec.c index 993168e3dc..414324ca08 100644 --- a/lib/dns/dnssec.c +++ b/lib/dns/dnssec.c @@ -1584,7 +1584,7 @@ dns_dnssec_keylistfromrdataset(const dns_name_t *origin, dns_kasp_t *kasp, /* Try to read the public key. */ result = keyfromfile(kasp, directory, dnskey, - (DST_TYPE_PUBLIC | DST_TYPE_STATE), mctx, + DST_TYPE_PUBLIC | DST_TYPE_STATE, mctx, &pubkey); if (result == ISC_R_FILENOTFOUND || result == ISC_R_NOPERM) { result = ISC_R_SUCCESS; @@ -1599,10 +1599,10 @@ dns_dnssec_keylistfromrdataset(const dns_name_t *origin, dns_kasp_t *kasp, } /* Now read the private key. */ - result = keyfromfile( - kasp, directory, dnskey, - (DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | DST_TYPE_STATE), - mctx, &privkey); + result = keyfromfile(kasp, directory, dnskey, + DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | + DST_TYPE_STATE, + mctx, &privkey); /* * If the key was revoked and the private file @@ -1616,9 +1616,9 @@ dns_dnssec_keylistfromrdataset(const dns_name_t *origin, dns_kasp_t *kasp, dst_key_setflags(dnskey, flags & ~DNS_KEYFLAG_REVOKE); result = keyfromfile(kasp, directory, dnskey, - (DST_TYPE_PUBLIC | - DST_TYPE_PRIVATE | - DST_TYPE_STATE), + DST_TYPE_PUBLIC | + DST_TYPE_PRIVATE | + DST_TYPE_STATE, mctx, &privkey); if (result == ISC_R_SUCCESS && dst_key_pubcompare(dnskey, privkey, false)) @@ -1640,8 +1640,8 @@ dns_dnssec_keylistfromrdataset(const dns_name_t *origin, dns_kasp_t *kasp, result2 = dst_key_getfilename( dst_key_name(dnskey), dst_key_id(dnskey), dst_key_alg(dnskey), - (DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | - DST_TYPE_STATE), + DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | + DST_TYPE_STATE, NULL, mctx, &buf); if (result2 != ISC_R_SUCCESS) { char namebuf[DNS_NAME_FORMATSIZE]; diff --git a/lib/dns/keymgr.c b/lib/dns/keymgr.c index 26a2b2c1a1..30039ca519 100644 --- a/lib/dns/keymgr.c +++ b/lib/dns/keymgr.c @@ -200,7 +200,7 @@ dns_keymgr_settime_syncpublish(dst_key_t *key, dns_kasp_t *kasp, bool first) { ret = dst_key_getnum(key, DST_NUM_LIFETIME, &lifetime); if (ret == ISC_R_SUCCESS && lifetime > 0) { dst_key_settime(key, DST_TIME_SYNCDELETE, - (syncpublish + lifetime)); + syncpublish + lifetime); } } @@ -297,7 +297,7 @@ keymgr_prepublication_time(dns_dnsseckey_t *key, dns_kasp_t *kasp, syncpub); if (klifetime > 0) { dst_key_settime(key->key, DST_TIME_SYNCDELETE, - (syncpub + klifetime)); + syncpub + klifetime); } } } @@ -1621,12 +1621,12 @@ keymgr_key_init(dns_dnsseckey_t *key, dns_kasp_t *kasp, isc_stdtime_t now, ret = dst_key_getbool(key->key, DST_BOOL_KSK, &ksk); if (ret != ISC_R_SUCCESS) { ksk = ((dst_key_flags(key->key) & DNS_KEYFLAG_KSK) != 0); - dst_key_setbool(key->key, DST_BOOL_KSK, (ksk || csk)); + dst_key_setbool(key->key, DST_BOOL_KSK, ksk || csk); } ret = dst_key_getbool(key->key, DST_BOOL_ZSK, &zsk); if (ret != ISC_R_SUCCESS) { zsk = ((dst_key_flags(key->key) & DNS_KEYFLAG_KSK) == 0); - dst_key_setbool(key->key, DST_BOOL_ZSK, (zsk || csk)); + dst_key_setbool(key->key, DST_BOOL_ZSK, zsk || csk); } /* Get time metadata. */ @@ -1753,7 +1753,7 @@ keymgr_key_rollover(dns_kasp_key_t *kaspkey, dns_dnsseckey_t *active_key, "DNSKEY %s (%s) (policy %s) in %u " "seconds", keystr, keymgr_keyrole(active_key->key), - dns_kasp_getname(kasp), (prepub - now)); + dns_kasp_getname(kasp), prepub - now); } } if (prepub == 0 || prepub > now) { @@ -2092,7 +2092,7 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass, ISC_LIST_FOREACH (*keyring, dkey, link) { bool found_match = false; - keymgr_key_init(dkey, kasp, now, (numkeys == 1)); + keymgr_key_init(dkey, kasp, now, numkeys == 1); ISC_LIST_FOREACH (dns_kasp_keys(kasp), kkey, link) { if (dns_kasp_key_match(kkey, dkey)) { @@ -2472,8 +2472,7 @@ rollover_status(dns_dnsseckey_t *dkey, dns_kasp_t *kasp, isc_stdtime_t now, "scheduled on ")); retire_time = keymgr_prepublication_time( dkey, kasp, - (retire_time - active_time), - now); + retire_time - active_time, now); } else { RETERR(isc_buffer_printf( buf, " Key will retire on ")); diff --git a/lib/dns/message.c b/lib/dns/message.c index 76558fdf37..1141562a58 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -67,7 +67,7 @@ hexdump(const char *msg, const char *msg2, void *base, size_t len) { } else if (cnt % 8 == 0) { printf(" |"); } - printf(" %02x %c", *p, (isprint(*p) ? *p : ' ')); + printf(" %02x %c", *p, isprint(*p) ? *p : ' '); p++; cnt++; @@ -4826,8 +4826,8 @@ logfmtpacket(dns_message_t *message, const char *description, } else if (result == ISC_R_SUCCESS) { isc_log_write(category, module, level, "%s%s%s%s%s\n%.*s", description, - (from != NULL ? " from " : ""), frombuf, - (to != NULL ? " to " : ""), tobuf, + from != NULL ? " from " : "", frombuf, + to != NULL ? " to " : "", tobuf, (int)isc_buffer_usedlength(&buffer), buf); } } while (result == ISC_R_NOSPACE); diff --git a/lib/dns/nsec3.c b/lib/dns/nsec3.c index e0fa980410..a5e411271f 100644 --- a/lib/dns/nsec3.c +++ b/lib/dns/nsec3.c @@ -2079,9 +2079,9 @@ dns_nsec3_noexistnodata(dns_rdatatype_t type, const dns_name_t *name, *optout = ((nsec3.flags & DNS_NSEC3FLAG_OPTOUT) != 0); (*logit)(arg, ISC_LOG_DEBUG(3), - (*optout ? "NSEC3 indicates optout" - : "NSEC3 indicates secure " - "range")); + *optout ? "NSEC3 indicates optout" + : "NSEC3 indicates secure " + "range"); } answer = ISC_R_SUCCESS; } diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index ea7252e264..9d7f9a3ca6 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -2492,7 +2492,7 @@ svcb_hashttp(isc_textregion_t *alpn) { s = alpn->base; } } - if (svcb_ishttp(s, (alpn->base - s))) { + if (svcb_ishttp(s, alpn->base - s)) { return true; } } diff --git a/lib/dns/rdata/generic/opt_41.c b/lib/dns/rdata/generic/opt_41.c index b52288dc9b..514e076fde 100644 --- a/lib/dns/rdata/generic/opt_41.c +++ b/lib/dns/rdata/generic/opt_41.c @@ -44,7 +44,7 @@ fromtext_opt(ARGS_FROMTEXT) { static isc_result_t totext_opt(ARGS_TOTEXT) { isc_region_t r; - isc_region_t or ; + isc_region_t or; uint16_t option; uint16_t length; char buf[sizeof("64000 64000")]; diff --git a/lib/dns/rdataset.c b/lib/dns/rdataset.c index 4eed85c4af..b57f61a2b8 100644 --- a/lib/dns/rdataset.c +++ b/lib/dns/rdataset.c @@ -618,7 +618,7 @@ dns_rdataset_trimttl(dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset, * If we accept expired RRsets keep them for no more than 120 seconds. */ if (acceptexpired && - (isc_serial_le(rrsig->timeexpire, ((now + 120) & 0xffffffff)) || + (isc_serial_le(rrsig->timeexpire, (now + 120) & 0xffffffff) || isc_serial_le(rrsig->timeexpire, now))) { ttl = 120; diff --git a/lib/dns/rdataslab.c b/lib/dns/rdataslab.c index 8b158a15c0..888f14f3dd 100644 --- a/lib/dns/rdataslab.c +++ b/lib/dns/rdataslab.c @@ -851,8 +851,8 @@ void dns_slabheader_copycase(dns_slabheader_t *dest, dns_slabheader_t *src) { if (CASESET(src)) { uint_least16_t attr = DNS_SLABHEADER_GETATTR( - src, (DNS_SLABHEADERATTR_CASESET | - DNS_SLABHEADERATTR_CASEFULLYLOWER)); + src, DNS_SLABHEADERATTR_CASESET | + DNS_SLABHEADERATTR_CASEFULLYLOWER); DNS_SLABHEADER_SETATTR(dest, attr); memmove(dest->upper, src->upper, sizeof(src->upper)); } diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 8947973236..af4be39a4b 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -7702,7 +7702,7 @@ resquery_response_continue(void *arg, isc_result_t result) { /* * Clear cache bits. */ - FCTX_ATTR_CLR(fctx, (FCTX_ATTR_WANTNCACHE | FCTX_ATTR_WANTCACHE)); + FCTX_ATTR_CLR(fctx, FCTX_ATTR_WANTNCACHE | FCTX_ATTR_WANTCACHE); /* * Did we get any answers? diff --git a/lib/dns/stats.c b/lib/dns/stats.c index 06a301966b..3560312cb8 100644 --- a/lib/dns/stats.c +++ b/lib/dns/stats.c @@ -196,7 +196,7 @@ dns_rdatatypestats_create(isc_mem_t *mctx, dns_stats_t **statsp) { * Create rdtype statistics for the first 255 RRtypes, * plus one additional for other RRtypes. */ - create_stats(mctx, dns_statstype_rdtype, (RDTYPECOUNTER_MAXTYPE + 1), + create_stats(mctx, dns_statstype_rdtype, RDTYPECOUNTER_MAXTYPE + 1, statsp); } @@ -204,7 +204,7 @@ void dns_rdatasetstats_create(isc_mem_t *mctx, dns_stats_t **statsp) { REQUIRE(statsp != NULL && *statsp == NULL); - create_stats(mctx, dns_statstype_rdataset, (RDTYPECOUNTER_MAXVAL + 1), + create_stats(mctx, dns_statstype_rdataset, RDTYPECOUNTER_MAXVAL + 1, statsp); } @@ -366,7 +366,7 @@ dns_dnssecsignstats_increment(dns_stats_t *stats, dns_keytag_t id, uint8_t alg, uint32_t counter = isc_stats_get_counter(stats->counters, idx); if (counter == kval) { /* Match */ - isc_stats_increment(stats->counters, (idx + operation)); + isc_stats_increment(stats->counters, idx + operation); return; } } @@ -377,23 +377,23 @@ dns_dnssecsignstats_increment(dns_stats_t *stats, dns_keytag_t id, uint8_t alg, uint32_t counter = isc_stats_get_counter(stats->counters, idx); if (counter == 0) { isc_stats_set(stats->counters, kval, idx); - isc_stats_increment(stats->counters, (idx + operation)); + isc_stats_increment(stats->counters, idx + operation); return; } } /* No room, grow stats storage. */ isc_stats_resize(&stats->counters, - (num_keys * dnssecsign_block_size * 2)); + num_keys * dnssecsign_block_size * 2); /* Reset counters for new key (new index, nidx). */ int nidx = num_keys * dnssecsign_block_size; isc_stats_set(stats->counters, kval, nidx); - isc_stats_set(stats->counters, 0, (nidx + dns_dnssecsignstats_sign)); - isc_stats_set(stats->counters, 0, (nidx + dns_dnssecsignstats_refresh)); + isc_stats_set(stats->counters, 0, nidx + dns_dnssecsignstats_sign); + isc_stats_set(stats->counters, 0, nidx + dns_dnssecsignstats_refresh); /* And increment the counter for the given operation. */ - isc_stats_increment(stats->counters, (nidx + operation)); + isc_stats_increment(stats->counters, nidx + operation); } void @@ -416,9 +416,9 @@ dns_dnssecsignstats_clear(dns_stats_t *stats, dns_keytag_t id, uint8_t alg) { /* Match */ isc_stats_set(stats->counters, 0, idx); isc_stats_set(stats->counters, 0, - (idx + dns_dnssecsignstats_sign)); + idx + dns_dnssecsignstats_sign); isc_stats_set(stats->counters, 0, - (idx + dns_dnssecsignstats_refresh)); + idx + dns_dnssecsignstats_refresh); return; } } @@ -545,7 +545,7 @@ dnssec_statsdump(isc_stats_t *stats, dnssecsignstats_type_t operation, continue; } - val = isc_stats_get_counter(stats, (idx + operation)); + val = isc_stats_get_counter(stats, idx + operation); if ((options & ISC_STATSDUMP_VERBOSE) == 0 && val == 0) { continue; } diff --git a/lib/dns/ttl.c b/lib/dns/ttl.c index e36adef6e4..4605abb068 100644 --- a/lib/dns/ttl.c +++ b/lib/dns/ttl.c @@ -89,23 +89,23 @@ dns_ttl_totext(uint32_t src, bool verbose, bool upcase, isc_buffer_t *target) { x = 0; if (weeks != 0) { - RETERR(ttlfmt(weeks, "week", verbose, (x > 0), target)); + RETERR(ttlfmt(weeks, "week", verbose, x > 0, target)); x++; } if (days != 0) { - RETERR(ttlfmt(days, "day", verbose, (x > 0), target)); + RETERR(ttlfmt(days, "day", verbose, x > 0, target)); x++; } if (hours != 0) { - RETERR(ttlfmt(hours, "hour", verbose, (x > 0), target)); + RETERR(ttlfmt(hours, "hour", verbose, x > 0, target)); x++; } if (mins != 0) { - RETERR(ttlfmt(mins, "minute", verbose, (x > 0), target)); + RETERR(ttlfmt(mins, "minute", verbose, x > 0, target)); x++; } if (secs != 0 || (weeks == 0 && days == 0 && hours == 0 && mins == 0)) { - RETERR(ttlfmt(secs, "second", verbose, (x > 0), target)); + RETERR(ttlfmt(secs, "second", verbose, x > 0, target)); x++; } INSIST(x > 0); diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 2100a9810b..7371e17526 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -1590,7 +1590,7 @@ dns_zone_getdbtype(dns_zone_t *zone, char ***argv, isc_mem_t *mctx) { REQUIRE(argv != NULL && *argv == NULL); LOCK_ZONE(zone); - size = ISC_CHECKED_MUL((zone->db_argc + 1), sizeof(char *)); + size = ISC_CHECKED_MUL(zone->db_argc + 1, sizeof(char *)); for (i = 0; i < zone->db_argc; i++) { size += strlen(zone->db_argv[i]) + 1; } @@ -1599,7 +1599,7 @@ dns_zone_getdbtype(dns_zone_t *zone, char ***argv, isc_mem_t *mctx) { tmp = mem; tmp2 = mem; base = mem; - tmp2 += ISC_CHECKED_MUL((zone->db_argc + 1), sizeof(char *)); + tmp2 += ISC_CHECKED_MUL(zone->db_argc + 1, sizeof(char *)); for (i = 0; i < zone->db_argc; i++) { *tmp++ = tmp2; strlcpy(tmp2, zone->db_argv[i], size - (tmp2 - base)); @@ -1838,7 +1838,7 @@ setfilename(dns_zone_t *zone, char **field, const char *value) { for (size_t i = 0; i < tags; i++) { size_t tokenlen = 0; - CHECK(putmem(&b, p, (positions[i] - p))); + CHECK(putmem(&b, p, positions[i] - p)); p = positions[i]; INSIST(p != NULL); @@ -4531,7 +4531,7 @@ load_secroots(dns_zone_t *zone, dns_name_t *name, dns_rdataset_t *rdataset) { /* Add to keytables. */ trusted++; - trust_key(zone, name, &dnskey, (keydata.addhd == 0)); + trust_key(zone, name, &dnskey, keydata.addhd == 0); } if (trusted == 0 && pending != 0) { @@ -4706,7 +4706,7 @@ add_soa(dns_zone_t *zone, dns_db_t *db) { failure: dns_diff_clear(&diff); if (ver != NULL) { - dns_db_closeversion(db, &ver, (result == ISC_R_SUCCESS)); + dns_db_closeversion(db, &ver, result == ISC_R_SUCCESS); } INSIST(ver == NULL); @@ -6450,7 +6450,7 @@ keyfromfile(dns_zone_t *zone, dst_key_t *pubkey, isc_mem_t *mctx, result = dst_key_fromfile( dst_key_name(pubkey), dst_key_id(pubkey), dst_key_alg(pubkey), - (DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | DST_TYPE_STATE), + DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | DST_TYPE_STATE, directory, mctx, &foundkey); } else { ISC_LIST_FOREACH (dns_kasp_keys(kasp), kkey, link) { @@ -6461,8 +6461,8 @@ keyfromfile(dns_zone_t *zone, dst_key_t *pubkey, isc_mem_t *mctx, result = dst_key_fromfile( dst_key_name(pubkey), dst_key_id(pubkey), dst_key_alg(pubkey), - (DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | - DST_TYPE_STATE), + DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | + DST_TYPE_STATE, directory, mctx, &foundkey); if (result == ISC_R_SUCCESS) { break; @@ -6544,8 +6544,8 @@ findzonekeys(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver, result2 = dst_key_getfilename( dst_key_name(pubkey), dst_key_id(pubkey), dst_key_alg(pubkey), - (DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | - DST_TYPE_STATE), + DST_TYPE_PUBLIC | DST_TYPE_PRIVATE | + DST_TYPE_STATE, NULL, mctx, &buf); if (result2 != ISC_R_SUCCESS) { char namebuf[DNS_NAME_FORMATSIZE]; @@ -6961,8 +6961,7 @@ del_sigs(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, if (!dns_rdatatype_iskeymaterial(type)) { bool warn = false, deleted = false; - if (delsig_ok(&rrsig, keys, nkeys, (kasp != NULL), - &warn)) + if (delsig_ok(&rrsig, keys, nkeys, kasp != NULL, &warn)) { result = update_one_rr(db, ver, zonediff->diff, DNS_DIFFOP_DELRESIGN, @@ -16118,9 +16117,8 @@ dns_zone_logv(dns_zone_t *zone, isc_logcategory_t category, int level, } isc_log_write(category, DNS_LOGMODULE_ZONE, level, "%s%s%s%s: %s", - (prefix != NULL ? prefix : ""), - (prefix != NULL ? ": " : ""), zstr, zone->strnamerd, - message); + prefix != NULL ? prefix : "", prefix != NULL ? ": " : "", + zstr, zone->strnamerd, message); } static void @@ -16376,7 +16374,7 @@ fail: addrbuf, isc_result_totext(result)); notify->flags |= DNS_NOTIFY_TCP; dns_request_destroy(¬ify->request); - notify_send_queue(notify, (notify->flags & DNS_NOTIFY_STARTUP)); + notify_send_queue(notify, notify->flags & DNS_NOTIFY_STARTUP); return; } else if (result == ISC_R_TIMEDOUT) { notify_log(notify->zone, ISC_LOG_WARNING, @@ -22537,7 +22535,7 @@ zone_rekey(dns_zone_t *zone) { CHECK(dns_diff_apply(&diff, db, ver)); CHECK(clean_nsec3param(zone, db, ver, &diff)); CHECK(add_signing_records(db, zone->privatetype, ver, - &diff, (newalg || fullsign))); + &diff, newalg || fullsign)); CHECK(update_soa_serial(zone, db, ver, &diff, mctx, zone->updatemethod)); CHECK(add_chains(zone, db, ver, &diff)); @@ -24254,7 +24252,7 @@ setserial(void *arg) { "setserial: desired serial (%u) " "out of range (%u-%u)", desired, oldserial + 1, - (oldserial + 0x7fffffff)); + oldserial + 0x7fffffff); } goto failure; } diff --git a/lib/isc/netmgr/proxyudp.c b/lib/isc/netmgr/proxyudp.c index be575cea0d..a4d038c641 100644 --- a/lib/isc/netmgr/proxyudp.c +++ b/lib/isc/netmgr/proxyudp.c @@ -867,7 +867,7 @@ isc__nm_proxyudp_send(isc_nmhandle_t *handle, isc_region_t *region, } send_req = proxyudp_get_send_req(sock->worker->mctx, sock, handle, - (sock->client ? region : NULL), cb, + sock->client ? region : NULL, cb, cbarg); if (sock->client) { isc_region_t send_data = { 0 }; diff --git a/lib/isc/proxy2.c b/lib/isc/proxy2.c index ccf386bd26..7837b65528 100644 --- a/lib/isc/proxy2.c +++ b/lib/isc/proxy2.c @@ -1336,7 +1336,7 @@ isc_proxy2_header_append_tlv(isc_buffer_t *restrict outbuf, } append_type_and_length(outbuf, (uint8_t)tlv_type, - ((uint16_t)tlv_data->length), true); + (uint16_t)tlv_data->length, true); if (tlv_data->length > 0) { isc_result_t result = isc_proxy2_header_append(outbuf, @@ -1413,7 +1413,7 @@ isc_proxy2_append_tlv(isc_buffer_t *restrict outbuf, const uint8_t type, return ISC_R_RANGE; } - append_type_and_length(outbuf, (uint8_t)type, ((uint16_t)data->length), + append_type_and_length(outbuf, (uint8_t)type, (uint16_t)data->length, false); if (data->length > 0) { diff --git a/lib/isc/radix.c b/lib/isc/radix.c index ba3c875b71..31cceed1b0 100644 --- a/lib/isc/radix.c +++ b/lib/isc/radix.c @@ -392,7 +392,7 @@ isc_radix_insert(isc_radix_tree_t *radix, isc_radix_node_t **target, } /* I know the better way, but for now. */ for (j = 0; j < 8; j++) { - if (BIT_TEST(r, (0x80 >> j))) { + if (BIT_TEST(r, 0x80 >> j)) { break; } } diff --git a/lib/isc/result.c b/lib/isc/result.c index 67363786a2..322928942a 100644 --- a/lib/isc/result.c +++ b/lib/isc/result.c @@ -484,13 +484,13 @@ static const char *identifier[ISC_R_NRESULTS] = { [ISCCC_R_MAXDEPTH] = "ISCCC_R_MAXDEPTH", }; -STATIC_ASSERT((DNS_R_SERVFAIL - DNS_R_NOERROR == 2), +STATIC_ASSERT(DNS_R_SERVFAIL - DNS_R_NOERROR == 2, "DNS_R_NOERROR has wrong value"); -STATIC_ASSERT((DNS_R_BADVERS - DNS_R_NOERROR == 16), +STATIC_ASSERT(DNS_R_BADVERS - DNS_R_NOERROR == 16, "DNS_R_BADVERS has wrong value"); -STATIC_ASSERT((ISC_R_NRESULTS < INT32_MAX), "result.h enum too big"); +STATIC_ASSERT(ISC_R_NRESULTS < INT32_MAX, "result.h enum too big"); const char * isc_result_totext(isc_result_t result) { diff --git a/lib/isccfg/kaspconf.c b/lib/isccfg/kaspconf.c index 4b424d4bfb..a7a71585a3 100644 --- a/lib/isccfg/kaspconf.c +++ b/lib/isccfg/kaspconf.c @@ -743,7 +743,7 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp, if (default_kasp != NULL && dns_kasp_nsec3(default_kasp)) { dns_kasp_setnsec3param( kasp, dns_kasp_nsec3iter(default_kasp), - (dns_kasp_nsec3flags(default_kasp) == 0x01), + dns_kasp_nsec3flags(default_kasp) == 0x01, dns_kasp_nsec3saltlen(default_kasp)); } else { dns_kasp_setnsec3(kasp, false); diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index c9a358c35f..faf64099cb 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -537,9 +537,9 @@ cfg_parser_create(isc_mem_t *mctx, cfg_parser_t **ret) { isc_lex_create(pctx->mctx, 1024, &pctx->lexer); isc_lex_setspecials(pctx->lexer, specials); - isc_lex_setcomments(pctx->lexer, - (ISC_LEXCOMMENT_C | ISC_LEXCOMMENT_CPLUSPLUS | - ISC_LEXCOMMENT_SHELL)); + isc_lex_setcomments(pctx->lexer, ISC_LEXCOMMENT_C | + ISC_LEXCOMMENT_CPLUSPLUS | + ISC_LEXCOMMENT_SHELL); CHECK(cfg_create_list(pctx, &cfg_type_filelist, &pctx->open_files)); CHECK(cfg_create_list(pctx, &cfg_type_filelist, &pctx->closed_files)); diff --git a/lib/ns/client.c b/lib/ns/client.c index 87e79e1333..6696bd15f2 100644 --- a/lib/ns/client.c +++ b/lib/ns/client.c @@ -1370,8 +1370,8 @@ process_cookie(ns_client_t *client, isc_buffer_t *buf, size_t optlen) { if (alwaysvalid) { now = when; } - if (isc_serial_gt(when, (now + 300)) /* In the future. */ || - isc_serial_lt(when, (now - 3600)) /* In the past. */) + if (isc_serial_gt(when, now + 300) /* In the future. */ || + isc_serial_lt(when, now - 3600) /* In the past. */) { client->attributes |= NS_CLIENTATTR_BADCOOKIE; ns_stats_increment(client->manager->sctx->nsstats, diff --git a/tests/bench/qpmulti.c b/tests/bench/qpmulti.c index 248b740df4..ac1c10b3d6 100644 --- a/tests/bench/qpmulti.c +++ b/tests/bench/qpmulti.c @@ -747,7 +747,7 @@ collect(void *varg) { nloops = zipf ? bctx->nloops : bctx->readers + bctx->mutate; for (uint32_t t = 0; t < nloops; t++) { struct thread_args *tp = &thread[t]; - elapsed = ISC_MAX(elapsed, (tp->stop - tp->start)); + elapsed = ISC_MAX(elapsed, tp->stop - tp->start); bool mut = t < bctx->mutate; stats[mut].worked += tp->worked; diff --git a/tests/dns/dst_test.c b/tests/dns/dst_test.c index 225706ffea..08e77df46e 100644 --- a/tests/dns/dst_test.c +++ b/tests/dns/dst_test.c @@ -63,7 +63,7 @@ sig_fromfile(const char *path, isc_buffer_t *buf) { result = isc_file_getsizefd(fileno(fp), &size); assert_int_equal(result, ISC_R_SUCCESS); - data = isc_mem_get(mctx, (size + 1)); + data = isc_mem_get(mctx, size + 1); assert_non_null(data); len = (size_t)size; @@ -144,7 +144,7 @@ check_sig(const char *datapath, const char *sigpath, const char *keyname, result = isc_file_getsizefd(fileno(fp), &size); assert_int_equal(result, ISC_R_SUCCESS); - data = isc_mem_get(mctx, (size + 1)); + data = isc_mem_get(mctx, size + 1); assert_non_null(data); p = data; diff --git a/tests/dns/name_test.c b/tests/dns/name_test.c index be4cbb3c0f..7777acda1e 100644 --- a/tests/dns/name_test.c +++ b/tests/dns/name_test.c @@ -708,7 +708,7 @@ ISC_RUN_TEST_IMPL(hash) { testcases[i].name2, h2); } - assert_int_equal((h1 == h2), testcases[i].expect); + assert_int_equal(h1 == h2, testcases[i].expect); /* Now case-sensitive */ h1 = dns_name_hash(n1); @@ -721,7 +721,7 @@ ISC_RUN_TEST_IMPL(hash) { testcases[i].name2, h2); } - assert_int_equal((h1 == h2), testcases[i].expect); + assert_int_equal(h1 == h2, testcases[i].expect); } } diff --git a/tests/dns/skr_test.c b/tests/dns/skr_test.c index c93757bf3d..71f7a1f827 100644 --- a/tests/dns/skr_test.c +++ b/tests/dns/skr_test.c @@ -236,7 +236,7 @@ create_bundle(FILE *fp, isc_stdtime_t btime, int bnum) { ISC_LIST_APPEND(dnskeylist->rdata, &test_bundles[bnum].ksk, link); dns_rdatalist_tordataset(dnskeylist, dnskeyset); dns_rdata_init(&test_bundles[bnum].dnskey_rrsig); - sign_rrset(fp, btime, (btime + LIFETIME), dnskeyset, + sign_rrset(fp, btime, btime + LIFETIME, dnskeyset, test_bundles[bnum].rrsig1buf, &test_bundles[bnum].dnskey_rrsig); ISC_LIST_FOREACH (dnskeylist->rdata, rd, link) { @@ -261,7 +261,7 @@ create_bundle(FILE *fp, isc_stdtime_t btime, int bnum) { ISC_LIST_APPEND(cdnskeylist->rdata, &test_bundles[bnum].cdnskey, link); dns_rdatalist_tordataset(cdnskeylist, cdnskeyset); dns_rdata_init(&test_bundles[bnum].cdnskey_rrsig); - sign_rrset(fp, btime, (btime + LIFETIME), cdnskeyset, + sign_rrset(fp, btime, btime + LIFETIME, cdnskeyset, test_bundles[bnum].rrsig2buf, &test_bundles[bnum].cdnskey_rrsig); ISC_LIST_FOREACH (cdnskeylist->rdata, rd, link) { @@ -285,7 +285,7 @@ create_bundle(FILE *fp, isc_stdtime_t btime, int bnum) { ISC_LIST_APPEND(cdslist->rdata, &test_bundles[bnum].cds, link); dns_rdatalist_tordataset(cdslist, cdsset); dns_rdata_init(&test_bundles[bnum].cds_rrsig); - sign_rrset(fp, btime, (btime + LIFETIME), cdsset, + sign_rrset(fp, btime, btime + LIFETIME, cdsset, test_bundles[bnum].rrsig3buf, &test_bundles[bnum].cds_rrsig); ISC_LIST_FOREACH (cdslist->rdata, rd, link) { ISC_LIST_UNLINK(cdslist->rdata, rd, link); diff --git a/tests/isc/hmac_test.c b/tests/isc/hmac_test.c index 67483c9d4e..05b93bf79a 100644 --- a/tests/isc/hmac_test.c +++ b/tests/isc/hmac_test.c @@ -123,7 +123,7 @@ isc_hmac_test(isc_hmac_t *hmac_st, const void *key, size_t keylen, assert_return_code(res, ISC_R_SUCCESS); - assert_memory_equal(hexdigest, result, (result ? strlen(result) : 0)); + assert_memory_equal(hexdigest, result, result ? strlen(result) : 0); assert_int_equal(isc_hmac_reset(hmac_st), ISC_R_SUCCESS); } diff --git a/tests/isc/md_test.c b/tests/isc/md_test.c index e8cdeeb4ae..3602f968e7 100644 --- a/tests/isc/md_test.c +++ b/tests/isc/md_test.c @@ -108,7 +108,7 @@ isc_md_test(isc_md_t *md, const isc_md_type_t *type, const char *buf, assert_return_code(res, ISC_R_SUCCESS); - assert_memory_equal(hexdigest, result, (result ? strlen(result) : 0)); + assert_memory_equal(hexdigest, result, result ? strlen(result) : 0); assert_int_equal(isc_md_reset(md), ISC_R_SUCCESS); } diff --git a/tests/isc/netmgr_common.c b/tests/isc/netmgr_common.c index 05c61d2d5d..9e92dd480c 100644 --- a/tests/isc/netmgr_common.c +++ b/tests/isc/netmgr_common.c @@ -395,9 +395,9 @@ connect_connect_cb(isc_nmhandle_t *handle, isc_result_t eresult, void *cbarg) { do_cconnects_shutdown(loopmgr); } else if (do_send) { isc_async_current(stream_recv_send_connect, - (cbarg == NULL - ? get_stream_connect_function() - : (stream_connect_function)cbarg)); + cbarg == NULL + ? get_stream_connect_function() + : (stream_connect_function)cbarg); } isc_refcount_increment0(&active_creads);