Merge branch '46-add-curly-braces' into 'master'

Add curly braces using uncrustify and then reformat with clang-format back

Closes #46

See merge request isc-projects/bind9!3057

(cherry picked from commit 67b68e06ad)

36c6105e Use coccinelle to add braces to nested single line statement
d14bb713 Add copy of run-clang-tidy that can fixup the filepaths
056e133c Use clang-tidy to add curly braces around one-line statements
This commit is contained in:
Ondřej Surý
2020-02-13 21:28:07 +00:00
parent 6270e602ea
commit 2e55baddd8
639 changed files with 29724 additions and 17080 deletions

View File

@@ -30,8 +30,9 @@ check_result(isc_result_t result, const char *format, ...)
{
va_list args;
if (result == ISC_R_SUCCESS)
if (result == ISC_R_SUCCESS) {
return;
}
va_start(args, format);
vfprintf(stderr, format, args);
@@ -98,8 +99,9 @@ main(int argc, char **argv)
*/
isc_log_setdebuglevel(lctx, 2);
if (argc < 3)
if (argc < 3) {
usage();
}
while (argc > 1) {
if (strcmp(argv[1], "--active") == 0) {
@@ -151,14 +153,16 @@ main(int argc, char **argv)
}
if (grammar) {
if (type == NULL)
if (type == NULL) {
usage();
}
cfg_print_grammar(type, pflags, output, NULL);
} else if (zonetype != 0) {
cfg_print_zonegrammar(zonetype, pflags, output, NULL);
} else {
if (type == NULL || filename == NULL)
if (type == NULL || filename == NULL) {
usage();
}
RUNTIME_CHECK(cfg_parser_create(mctx, lctx, &pctx) ==
ISC_R_SUCCESS);
@@ -166,8 +170,9 @@ main(int argc, char **argv)
fprintf(stderr, "read config: %s\n", isc_result_totext(result));
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
exit(1);
}
cfg_print(cfg, output, NULL);
@@ -177,14 +182,16 @@ main(int argc, char **argv)
}
isc_log_destroy(&lctx);
if (memstats)
if (memstats) {
isc_mem_stats(mctx, stderr);
}
isc_mem_destroy(&mctx);
fflush(stdout);
if (ferror(stdout)) {
fprintf(stderr, "write error\n");
return (1);
} else
} else {
return (0);
}
}