mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Use clang-tidy to add curly braces around one-line statements
The command used to reformat the files in this commit was: ./util/run-clang-tidy \ -clang-tidy-binary clang-tidy-11 -clang-apply-replacements-binary clang-apply-replacements-11 \ -checks=-*,readability-braces-around-statements \ -j 9 \ -fix \ -format \ -style=file \ -quiet clang-format -i --style=format $(git ls-files '*.c' '*.h') uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h') clang-format -i --style=format $(git ls-files '*.c' '*.h')
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
static const char *geoip_dbnames[] = {
|
||||
"country", "city", "asnum", "isp", "domain", NULL,
|
||||
};
|
||||
#endif
|
||||
#endif /* if defined(HAVE_GEOIP2) */
|
||||
|
||||
isc_result_t
|
||||
cfg_aclconfctx_create(isc_mem_t *mctx, cfg_aclconfctx_t **ret)
|
||||
@@ -52,7 +52,7 @@ cfg_aclconfctx_create(isc_mem_t *mctx, cfg_aclconfctx_t **ret)
|
||||
|
||||
#if defined(HAVE_GEOIP2)
|
||||
actx->geoip = NULL;
|
||||
#endif
|
||||
#endif /* if defined(HAVE_GEOIP2) */
|
||||
|
||||
*ret = actx;
|
||||
return (ISC_R_SUCCESS);
|
||||
@@ -100,8 +100,9 @@ get_acl_def(const cfg_obj_t *cctx, const char *name, const cfg_obj_t **ret)
|
||||
const cfg_listelt_t *elt;
|
||||
|
||||
result = cfg_map_get(cctx, "acl", &acls);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
for (elt = cfg_list_first(acls); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
const cfg_obj_t *acl = cfg_listelt_value(elt);
|
||||
@@ -163,8 +164,9 @@ convert_named_acl(const cfg_obj_t *nameobj, const cfg_obj_t *cctx,
|
||||
ISC_LIST_UNLINK(ctx->named_acl_cache, &loop, nextincache);
|
||||
loop.magic = 0;
|
||||
loop.name = NULL;
|
||||
if (result != ISC_R_SUCCESS)
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
dacl->name = isc_mem_strdup(dacl->mctx, aclname);
|
||||
ISC_LIST_APPEND(ctx->named_acl_cache, dacl, nextincache);
|
||||
dns_acl_attach(dacl, target);
|
||||
@@ -215,8 +217,9 @@ count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
|
||||
REQUIRE(count != NULL);
|
||||
|
||||
if (has_negative != NULL)
|
||||
if (has_negative != NULL) {
|
||||
*has_negative = false;
|
||||
}
|
||||
|
||||
for (elt = cfg_list_first(caml); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
@@ -227,8 +230,9 @@ count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
const cfg_obj_t *negated = cfg_tuple_get(ce, "negated");
|
||||
if (!cfg_obj_isvoid(negated)) {
|
||||
ce = negated;
|
||||
if (has_negative != NULL)
|
||||
if (has_negative != NULL) {
|
||||
*has_negative = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,11 +243,13 @@ count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
uint32_t sub;
|
||||
result = count_acl_elements(ce, cctx, lctx, ctx, mctx,
|
||||
&sub, &negative);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
n += sub;
|
||||
if (negative)
|
||||
if (negative) {
|
||||
n++;
|
||||
}
|
||||
#if defined(HAVE_GEOIP2)
|
||||
} else if (cfg_obj_istuple(ce) &&
|
||||
cfg_obj_isvoid(cfg_tuple_get(ce, "negated"))) {
|
||||
@@ -264,13 +270,15 @@ count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
result = convert_named_acl(ce, cctx, lctx, ctx,
|
||||
mctx, 0, &inneracl);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
if (inneracl->has_negatives)
|
||||
if (inneracl->has_negatives) {
|
||||
n++;
|
||||
else
|
||||
} else {
|
||||
n += inneracl->length;
|
||||
}
|
||||
dns_acl_detach(&inneracl);
|
||||
} else
|
||||
} else {
|
||||
return (result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -425,8 +433,8 @@ geoip_can_answer(dns_aclelement_t *elt, cfg_aclconfctx_t *ctx)
|
||||
if (ctx->geoip->country != NULL) {
|
||||
return (true);
|
||||
}
|
||||
/* city db can answer these too, so: */
|
||||
/* FALLTHROUGH */
|
||||
/* city db can answer these too, so: */
|
||||
/* FALLTHROUGH */
|
||||
case dns_geoip_region:
|
||||
case dns_geoip_regionname:
|
||||
case dns_geoip_city_countrycode:
|
||||
@@ -637,8 +645,9 @@ cfg_acl_fromconfig2(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
int new_nest_level = 0;
|
||||
bool setpos;
|
||||
|
||||
if (nest_level != 0)
|
||||
if (nest_level != 0) {
|
||||
new_nest_level = nest_level - 1;
|
||||
}
|
||||
|
||||
REQUIRE(target != NULL);
|
||||
REQUIRE(*target == NULL || DNS_ACL_VALID(*target));
|
||||
@@ -664,8 +673,9 @@ cfg_acl_fromconfig2(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
if (nest_level == 0) {
|
||||
result = count_acl_elements(caml, cctx, lctx, ctx, mctx,
|
||||
&nelem, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
} else {
|
||||
nelem = cfg_list_length(caml, false);
|
||||
}
|
||||
@@ -869,8 +879,9 @@ cfg_acl_fromconfig2(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
de->type = dns_aclelementtype_localnets;
|
||||
de->negative = neg;
|
||||
} else {
|
||||
if (inneracl != NULL)
|
||||
if (inneracl != NULL) {
|
||||
dns_acl_detach(&inneracl);
|
||||
}
|
||||
/*
|
||||
* This call should just find the cached
|
||||
* of the named acl.
|
||||
|
Reference in New Issue
Block a user