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

@@ -9,7 +9,6 @@
* information regarding copyright ownership.
*/
/*! \file */
#include <errno.h>
@@ -21,13 +20,14 @@
#include <isc/string.h>
#include <isc/util.h>
#include <dns/log.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
#include <dns/log.h>
static void
check_result(isc_result_t result, const char *format, ...) {
check_result(isc_result_t result, const char *format, ...)
{
va_list args;
if (result == ISC_R_SUCCESS)
@@ -41,34 +41,37 @@ check_result(isc_result_t result, const char *format, ...) {
}
static void
output(void *closure, const char *text, int textlen) {
output(void *closure, const char *text, int textlen)
{
UNUSED(closure);
(void) fwrite(text, 1, textlen, stdout);
(void)fwrite(text, 1, textlen, stdout);
}
static void
usage(void) {
usage(void)
{
fprintf(stderr, "usage: cfg_test --rndc|--named "
"[--grammar] [--zonegrammar] [--active] "
"[--memstats] conffile\n");
"[--grammar] [--zonegrammar] [--active] "
"[--memstats] conffile\n");
exit(1);
}
int
main(int argc, char **argv) {
isc_result_t result;
isc_mem_t *mctx = NULL;
isc_log_t *lctx = NULL;
isc_logconfig_t *lcfg = NULL;
main(int argc, char **argv)
{
isc_result_t result;
isc_mem_t * mctx = NULL;
isc_log_t * lctx = NULL;
isc_logconfig_t * lcfg = NULL;
isc_logdestination_t destination;
cfg_parser_t *pctx = NULL;
cfg_obj_t *cfg = NULL;
cfg_type_t *type = NULL;
bool grammar = false;
bool memstats = false;
char *filename = NULL;
unsigned int zonetype = 0;
unsigned int pflags = 0;
cfg_parser_t * pctx = NULL;
cfg_obj_t * cfg = NULL;
cfg_type_t * type = NULL;
bool grammar = false;
bool memstats = false;
char * filename = NULL;
unsigned int zonetype = 0;
unsigned int pflags = 0;
isc_mem_create(&mctx);
@@ -83,10 +86,9 @@ main(int argc, char **argv) {
destination.file.name = NULL;
destination.file.versions = ISC_LOG_ROLLNEVER;
destination.file.maximum_size = 0;
result = isc_log_createchannel(lcfg, "_default",
ISC_LOG_TOFILEDESC,
ISC_LOG_DYNAMIC,
&destination, ISC_LOG_PRINTTIME);
result = isc_log_createchannel(lcfg, "_default", ISC_LOG_TOFILEDESC,
ISC_LOG_DYNAMIC, &destination,
ISC_LOG_PRINTTIME);
check_result(result, "isc_log_createchannel()");
result = isc_log_usechannel(lcfg, "_default", NULL, NULL);
check_result(result, "isc_log_usechannel()");
@@ -106,16 +108,14 @@ main(int argc, char **argv) {
grammar = true;
} else if (strcmp(argv[1], "--zonegrammar") == 0) {
argv++, argc--;
if (argc <= 1) {
if (argc <= 1) {
usage();
}
if (strcmp(argv[1], "master") == 0 ||
strcmp(argv[1], "primary") == 0)
{
strcmp(argv[1], "primary") == 0) {
zonetype = CFG_ZONE_MASTER;
} else if (strcmp(argv[1], "slave") == 0 ||
strcmp(argv[1], "seconary") == 0)
{
strcmp(argv[1], "seconary") == 0) {
zonetype = CFG_ZONE_SLAVE;
} else if (strcmp(argv[1], "mirror") == 0) {
zonetype = CFG_ZONE_MIRROR;