mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 08:05:21 +00:00
Use ControlStatementsExceptControlMacros for SpaceBeforeParens
> Put a space before opening parentheses only after control statement
> keywords (for/if/while...) except this option doesn’t apply to ForEach
> and If macros. This is useful in projects where ForEach/If macros are
> treated as function calls instead of control statements.
(cherry picked from commit 42496f3f4a
)
This commit is contained in:
@@ -82,3 +82,4 @@ ContinuationIndentWidth: 8
|
|||||||
ForEachMacros: [ 'cds_lfs_for_each', 'cds_lfs_for_each_safe', 'cds_list_for_each_entry_safe', 'ISC_LIST_FOREACH', 'ISC_LIST_FOREACH_SAFE', 'ISC_LIST_FOREACH_REV', 'ISC_LIST_FOREACH_REV_SAFE' ]
|
ForEachMacros: [ 'cds_lfs_for_each', 'cds_lfs_for_each_safe', 'cds_list_for_each_entry_safe', 'ISC_LIST_FOREACH', 'ISC_LIST_FOREACH_SAFE', 'ISC_LIST_FOREACH_REV', 'ISC_LIST_FOREACH_REV_SAFE' ]
|
||||||
RemoveParentheses: ReturnStatement
|
RemoveParentheses: ReturnStatement
|
||||||
RemoveSemicolon: true
|
RemoveSemicolon: true
|
||||||
|
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
||||||
|
@@ -81,3 +81,4 @@ Standard: Cpp11
|
|||||||
ContinuationIndentWidth: 8
|
ContinuationIndentWidth: 8
|
||||||
RemoveParentheses: ReturnStatement
|
RemoveParentheses: ReturnStatement
|
||||||
RemoveSemicolon: true
|
RemoveSemicolon: true
|
||||||
|
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
||||||
|
@@ -462,8 +462,7 @@ static void
|
|||||||
dns__acl_destroy_port_transports(dns_acl_t *acl) {
|
dns__acl_destroy_port_transports(dns_acl_t *acl) {
|
||||||
dns_acl_port_transports_t *port_proto = NULL;
|
dns_acl_port_transports_t *port_proto = NULL;
|
||||||
dns_acl_port_transports_t *next = NULL;
|
dns_acl_port_transports_t *next = NULL;
|
||||||
ISC_LIST_FOREACH_SAFE (acl->ports_and_transports, port_proto, link,
|
ISC_LIST_FOREACH_SAFE(acl->ports_and_transports, port_proto, link, next)
|
||||||
next)
|
|
||||||
{
|
{
|
||||||
ISC_LIST_DEQUEUE(acl->ports_and_transports, port_proto, link);
|
ISC_LIST_DEQUEUE(acl->ports_and_transports, port_proto, link);
|
||||||
isc_mem_put(acl->mctx, port_proto, sizeof(*port_proto));
|
isc_mem_put(acl->mctx, port_proto, sizeof(*port_proto));
|
||||||
|
@@ -472,7 +472,7 @@ static void
|
|||||||
msgresetname(dns_message_t *msg, dns_name_t *name) {
|
msgresetname(dns_message_t *msg, dns_name_t *name) {
|
||||||
dns_rdataset_t *rds = NULL, *next_rds = NULL;
|
dns_rdataset_t *rds = NULL, *next_rds = NULL;
|
||||||
|
|
||||||
ISC_LIST_FOREACH_SAFE (name->list, rds, link, next_rds) {
|
ISC_LIST_FOREACH_SAFE(name->list, rds, link, next_rds) {
|
||||||
ISC_LIST_UNLINK(name->list, rds, link);
|
ISC_LIST_UNLINK(name->list, rds, link);
|
||||||
|
|
||||||
dns__message_putassociatedrdataset(msg, &rds);
|
dns__message_putassociatedrdataset(msg, &rds);
|
||||||
@@ -485,8 +485,7 @@ msgresetnames(dns_message_t *msg, unsigned int first_section) {
|
|||||||
for (size_t i = first_section; i < DNS_SECTION_MAX; i++) {
|
for (size_t i = first_section; i < DNS_SECTION_MAX; i++) {
|
||||||
dns_name_t *name = NULL, *next_name = NULL;
|
dns_name_t *name = NULL, *next_name = NULL;
|
||||||
|
|
||||||
ISC_LIST_FOREACH_SAFE (msg->sections[i], name, link, next_name)
|
ISC_LIST_FOREACH_SAFE(msg->sections[i], name, link, next_name) {
|
||||||
{
|
|
||||||
ISC_LIST_UNLINK(msg->sections[i], name, link);
|
ISC_LIST_UNLINK(msg->sections[i], name, link);
|
||||||
|
|
||||||
msgresetname(msg, name);
|
msgresetname(msg, name);
|
||||||
@@ -814,7 +813,7 @@ findname(dns_name_t **foundname, const dns_name_t *target,
|
|||||||
dns_namelist_t *section) {
|
dns_namelist_t *section) {
|
||||||
dns_name_t *name = NULL;
|
dns_name_t *name = NULL;
|
||||||
|
|
||||||
ISC_LIST_FOREACH_REV (*section, name, link) {
|
ISC_LIST_FOREACH_REV(*section, name, link) {
|
||||||
if (dns_name_equal(name, target)) {
|
if (dns_name_equal(name, target)) {
|
||||||
if (foundname != NULL) {
|
if (foundname != NULL) {
|
||||||
*foundname = name;
|
*foundname = name;
|
||||||
@@ -855,7 +854,7 @@ dns_message_findtype(const dns_name_t *name, dns_rdatatype_t type,
|
|||||||
REQUIRE(name != NULL);
|
REQUIRE(name != NULL);
|
||||||
REQUIRE(rdatasetp == NULL || *rdatasetp == NULL);
|
REQUIRE(rdatasetp == NULL || *rdatasetp == NULL);
|
||||||
|
|
||||||
ISC_LIST_FOREACH_REV (name->list, rds, link) {
|
ISC_LIST_FOREACH_REV(name->list, rds, link) {
|
||||||
if (rds->type == type && rds->covers == covers) {
|
if (rds->type == type && rds->covers == covers) {
|
||||||
SET_IF_NOT_NULL(rdatasetp, rds);
|
SET_IF_NOT_NULL(rdatasetp, rds);
|
||||||
|
|
||||||
@@ -971,7 +970,7 @@ getrdata(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t dctx,
|
|||||||
static void
|
static void
|
||||||
cleanup_name_hashmaps(dns_namelist_t *section) {
|
cleanup_name_hashmaps(dns_namelist_t *section) {
|
||||||
dns_name_t *name = NULL;
|
dns_name_t *name = NULL;
|
||||||
ISC_LIST_FOREACH (*section, name, link) {
|
ISC_LIST_FOREACH(*section, name, link) {
|
||||||
if (name->hashmap != NULL) {
|
if (name->hashmap != NULL) {
|
||||||
isc_hashmap_destroy(&name->hashmap);
|
isc_hashmap_destroy(&name->hashmap);
|
||||||
}
|
}
|
||||||
@@ -2415,9 +2414,9 @@ dns_message_renderreset(dns_message_t *msg) {
|
|||||||
|
|
||||||
msg->cursors[i] = NULL;
|
msg->cursors[i] = NULL;
|
||||||
msg->counts[i] = 0;
|
msg->counts[i] = 0;
|
||||||
ISC_LIST_FOREACH (msg->sections[i], name, link) {
|
ISC_LIST_FOREACH(msg->sections[i], name, link) {
|
||||||
dns_rdataset_t *rds = NULL;
|
dns_rdataset_t *rds = NULL;
|
||||||
ISC_LIST_FOREACH (name->list, rds, link) {
|
ISC_LIST_FOREACH(name->list, rds, link) {
|
||||||
rds->attributes &= ~DNS_RDATASETATTR_RENDERED;
|
rds->attributes &= ~DNS_RDATASETATTR_RENDERED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3417,7 +3416,7 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
|
|||||||
dns_message_currentname(msg, section, &name);
|
dns_message_currentname(msg, section, &name);
|
||||||
|
|
||||||
dns_rdataset_t *rds = NULL;
|
dns_rdataset_t *rds = NULL;
|
||||||
ISC_LIST_FOREACH (name->list, rds, link) {
|
ISC_LIST_FOREACH(name->list, rds, link) {
|
||||||
if (section == DNS_SECTION_ANSWER &&
|
if (section == DNS_SECTION_ANSWER &&
|
||||||
rds->type == dns_rdatatype_soa)
|
rds->type == dns_rdatatype_soa)
|
||||||
{
|
{
|
||||||
@@ -5072,7 +5071,7 @@ message_authority_soa_min(dns_message_t *msg, dns_ttl_t *ttlp) {
|
|||||||
dns_message_currentname(msg, DNS_SECTION_AUTHORITY, &name);
|
dns_message_currentname(msg, DNS_SECTION_AUTHORITY, &name);
|
||||||
|
|
||||||
dns_rdataset_t *rds = NULL;
|
dns_rdataset_t *rds = NULL;
|
||||||
ISC_LIST_FOREACH (name->list, rds, link) {
|
ISC_LIST_FOREACH(name->list, rds, link) {
|
||||||
if ((rds->attributes & DNS_RDATASETATTR_RENDERED) == 0)
|
if ((rds->attributes & DNS_RDATASETATTR_RENDERED) == 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@@ -174,7 +174,7 @@ requests_cancel(void *arg) {
|
|||||||
dns_request_t *request = NULL, *next = NULL;
|
dns_request_t *request = NULL, *next = NULL;
|
||||||
uint32_t tid = isc_tid();
|
uint32_t tid = isc_tid();
|
||||||
|
|
||||||
ISC_LIST_FOREACH_SAFE (requestmgr->requests[tid], request, link, next) {
|
ISC_LIST_FOREACH_SAFE(requestmgr->requests[tid], request, link, next) {
|
||||||
req_log(ISC_LOG_DEBUG(3), "%s(%" PRIu32 ": request %p",
|
req_log(ISC_LOG_DEBUG(3), "%s(%" PRIu32 ": request %p",
|
||||||
__func__, tid, request);
|
__func__, tid, request);
|
||||||
if (DNS_REQUEST_COMPLETE(request)) {
|
if (DNS_REQUEST_COMPLETE(request)) {
|
||||||
|
@@ -291,7 +291,7 @@ destroy_httpdmgr(isc_httpdmgr_t *httpdmgr) {
|
|||||||
* memory.
|
* memory.
|
||||||
*/
|
*/
|
||||||
isc_httpdurl_t *url, *next;
|
isc_httpdurl_t *url, *next;
|
||||||
ISC_LIST_FOREACH_SAFE (httpdmgr->urls, url, link, next) {
|
ISC_LIST_FOREACH_SAFE(httpdmgr->urls, url, link, next) {
|
||||||
isc_mem_free(httpdmgr->mctx, url->url);
|
isc_mem_free(httpdmgr->mctx, url->url);
|
||||||
ISC_LIST_UNLINK(httpdmgr->urls, url, link);
|
ISC_LIST_UNLINK(httpdmgr->urls, url, link);
|
||||||
isc_mem_put(httpdmgr->mctx, url, sizeof(isc_httpdurl_t));
|
isc_mem_put(httpdmgr->mctx, url, sizeof(isc_httpdurl_t));
|
||||||
@@ -781,7 +781,7 @@ prepare_response(void *arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOCK(&mgr->lock);
|
LOCK(&mgr->lock);
|
||||||
ISC_LIST_FOREACH (mgr->urls, url, link) {
|
ISC_LIST_FOREACH(mgr->urls, url, link) {
|
||||||
if (strncmp(path, url->url, path_len) == 0) {
|
if (strncmp(path, url->url, path_len) == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -980,7 +980,7 @@ isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdmgrp) {
|
|||||||
LOCK(&httpdmgr->lock);
|
LOCK(&httpdmgr->lock);
|
||||||
|
|
||||||
isc_httpd_t *httpd = NULL, *next = NULL;
|
isc_httpd_t *httpd = NULL, *next = NULL;
|
||||||
ISC_LIST_FOREACH_SAFE (httpdmgr->running, httpd, link, next) {
|
ISC_LIST_FOREACH_SAFE(httpdmgr->running, httpd, link, next) {
|
||||||
if (httpd->handle != NULL) {
|
if (httpd->handle != NULL) {
|
||||||
httpd_request(httpd->handle, ISC_R_SUCCESS, NULL,
|
httpd_request(httpd->handle, ISC_R_SUCCESS, NULL,
|
||||||
httpd);
|
httpd);
|
||||||
|
@@ -87,8 +87,9 @@ sched_affinity_ncpus(void) {
|
|||||||
int i, n = 0;
|
int i, n = 0;
|
||||||
|
|
||||||
for (i = 0; i < CPU_SETSIZE; ++i) {
|
for (i = 0; i < CPU_SETSIZE; ++i) {
|
||||||
if (CPU_ISSET(i, &cpus))
|
if (CPU_ISSET(i, &cpus)) {
|
||||||
++n;
|
++n;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
#endif
|
#endif
|
||||||
@@ -115,8 +116,9 @@ cpuset_affinity_ncpus(void) {
|
|||||||
if (result != -1) {
|
if (result != -1) {
|
||||||
int i, n = 0;
|
int i, n = 0;
|
||||||
for (i = 0; i < CPU_SETSIZE; ++i) {
|
for (i = 0; i < CPU_SETSIZE; ++i) {
|
||||||
if (CPU_ISSET(i, &cpus))
|
if (CPU_ISSET(i, &cpus)) {
|
||||||
++n;
|
++n;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user