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 commit67b68e06ad)36c6105eUse coccinelle to add braces to nested single line statementd14bb713Add copy of run-clang-tidy that can fixup the filepaths056e133cUse clang-tidy to add curly braces around one-line statements
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user