Merge branch '46-just-use-clang-format-to-reformat-sources' into 'master'

Reformat source code with clang-format

Closes #46

See merge request isc-projects/bind9!2156

(cherry picked from commit 7099e79a9b)

4c3b063e Import Linux kernel .clang-format with small modifications
f50b1e06 Use clang-format to reformat the source files
11341c76 Update the definition files for Windows
df6c1f76 Remove tkey_test (which is no-op anyway)
This commit is contained in:
Ondřej Surý
2020-02-12 14:33:32 +00:00
parent dbe15330fe
commit c931d8e417
974 changed files with 75952 additions and 74434 deletions

View File

@@ -4,6 +4,8 @@
* Copyright (C) 2009-2015 Red Hat ; see COPYRIGHT for license
*/
#include "zone.h"
#include <inttypes.h>
#include <stdbool.h>
@@ -13,11 +15,10 @@
#include <dns/view.h>
#include <dns/zone.h>
#include "util.h"
#include "instance.h"
#include "lock.h"
#include "log.h"
#include "zone.h"
#include "util.h"
extern const char *impname;
@@ -26,14 +27,14 @@ extern const char *impname;
* until it is explicitly added to a view.
*/
isc_result_t
create_zone(sample_instance_t * const inst, dns_name_t * const name,
dns_zone_t ** const rawp)
create_zone(sample_instance_t *const inst, dns_name_t *const name,
dns_zone_t **const rawp)
{
isc_result_t result;
dns_zone_t *raw = NULL;
const char *zone_argv[1];
char zone_name[DNS_NAME_FORMATSIZE];
dns_acl_t *acl_any = NULL;
dns_zone_t * raw = NULL;
const char * zone_argv[1];
char zone_name[DNS_NAME_FORMATSIZE];
dns_acl_t * acl_any = NULL;
REQUIRE(inst != NULL);
REQUIRE(name != NULL);
@@ -43,8 +44,7 @@ create_zone(sample_instance_t * const inst, dns_name_t * const name,
result = dns_zone_create(&raw, inst->mctx);
if (result != ISC_R_SUCCESS) {
log_write(ISC_LOG_ERROR,
"create_zone: dns_zone_create -> %s\n",
log_write(ISC_LOG_ERROR, "create_zone: dns_zone_create -> %s\n",
isc_result_totext(result));
goto cleanup;
}
@@ -70,8 +70,7 @@ create_zone(sample_instance_t * const inst, dns_name_t * const name,
/* This is completely insecure - use some sensible values instead! */
result = dns_acl_any(inst->mctx, &acl_any);
if (result != ISC_R_SUCCESS) {
log_write(ISC_LOG_ERROR,
"create_zone: dns_acl_any -> %s\n",
log_write(ISC_LOG_ERROR, "create_zone: dns_acl_any -> %s\n",
isc_result_totext(result));
goto cleanup;
}
@@ -103,11 +102,12 @@ cleanup:
* to clients.
*/
static isc_result_t
publish_zone(sample_instance_t *inst, dns_zone_t *zone) {
publish_zone(sample_instance_t *inst, dns_zone_t *zone)
{
isc_result_t result;
bool freeze = false;
dns_zone_t *zone_in_view = NULL;
dns_view_t *view_in_zone = NULL;
bool freeze = false;
dns_zone_t * zone_in_view = NULL;
dns_view_t * view_in_zone = NULL;
isc_result_t lock_state = ISC_R_IGNORE;
REQUIRE(inst != NULL);
@@ -175,14 +175,15 @@ cleanup:
* on the secure zone!
*/
static isc_result_t
load_zone(dns_zone_t *zone) {
load_zone(dns_zone_t *zone)
{
isc_result_t result;
bool zone_dynamic;
uint32_t serial;
bool zone_dynamic;
uint32_t serial;
result = dns_zone_load(zone, false);
if (result != ISC_R_SUCCESS && result != DNS_R_UPTODATE
&& result != DNS_R_DYNAMIC && result != DNS_R_CONTINUE)
if (result != ISC_R_SUCCESS && result != DNS_R_UPTODATE &&
result != DNS_R_DYNAMIC && result != DNS_R_CONTINUE)
goto cleanup;
zone_dynamic = (result == DNS_R_DYNAMIC);
@@ -206,7 +207,8 @@ cleanup:
* Add zone to view and call dns_zone_load().
*/
isc_result_t
activate_zone(sample_instance_t *inst, dns_zone_t *raw) {
activate_zone(sample_instance_t *inst, dns_zone_t *raw)
{
isc_result_t result;
/*
@@ -216,16 +218,14 @@ activate_zone(sample_instance_t *inst, dns_zone_t *raw) {
*/
result = publish_zone(inst, raw);
if (result != ISC_R_SUCCESS) {
dns_zone_log(raw, ISC_LOG_ERROR,
"cannot add zone to view: %s",
dns_zone_log(raw, ISC_LOG_ERROR, "cannot add zone to view: %s",
dns_result_totext(result));
goto cleanup;
}
result = load_zone(raw);
if (result != ISC_R_SUCCESS) {
log_write(ISC_LOG_ERROR,
"activate_zone: load_zone -> %s\n",
log_write(ISC_LOG_ERROR, "activate_zone: load_zone -> %s\n",
isc_result_totext(result));
goto cleanup;
}