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

@@ -59,7 +59,7 @@
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
#endif /* ifndef CLOCK_REALTIME */
static int
clock_gettime(int32_t id, struct timespec *tp);
@@ -79,7 +79,7 @@ clock_gettime(int32_t id, struct timespec *tp)
}
return (result);
}
#endif
#endif /* ifndef HAVE_CLOCK_GETTIME */
int
main(int argc, char *argv[])
@@ -136,16 +136,18 @@ main(int argc, char *argv[])
hSession[i] = CK_INVALID_HANDLE;
/* Initialize the CRYPTOKI library */
if (lib_name != NULL)
if (lib_name != NULL) {
pk11_set_lib_name(lib_name);
}
rv = pkcs_C_Initialize(NULL_PTR);
if (rv != CKR_OK) {
if (rv == 0xfe)
if (rv == 0xfe) {
fprintf(stderr, "Can't load or link module \"%s\"\n",
pk11_get_lib_name());
else
} else {
fprintf(stderr, "C_Initialize: Error = 0x%.8lX\n", rv);
}
free(hSession);
exit(1);
}
@@ -164,8 +166,9 @@ main(int argc, char *argv[])
fprintf(stderr, "C_OpenSession[%u]: Error = 0x%.8lX\n",
i, rv);
error = 1;
if (i == 0)
if (i == 0) {
goto exit_program;
}
break;
}
}
@@ -183,15 +186,17 @@ main(int argc, char *argv[])
}
printf("%u sessions in %ld.%09lds\n", i, endtime.tv_sec,
endtime.tv_nsec);
if (i > 0)
if (i > 0) {
printf("%g sessions/s\n",
i / ((double)endtime.tv_sec +
(double)endtime.tv_nsec / 1000000000.));
}
for (i = 0; i < count; i++) {
/* Close sessions */
if (hSession[i] == CK_INVALID_HANDLE)
if (hSession[i] == CK_INVALID_HANDLE) {
continue;
}
rv = pkcs_C_CloseSession(hSession[i]);
if ((rv != CKR_OK) && !errflg) {
fprintf(stderr, "C_CloseSession[%u]: Error = 0x%.8lX\n",
@@ -204,8 +209,9 @@ exit_program:
free(hSession);
rv = pkcs_C_Finalize(NULL_PTR);
if (rv != CKR_OK)
if (rv != CKR_OK) {
fprintf(stderr, "C_Finalize: Error = 0x%.8lX\n", rv);
}
exit(error);
}