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:
@@ -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 */
|
||||
|
||||
CK_BYTE modulus[] = {
|
||||
0x00, 0xb7, 0x9c, 0x1f, 0x05, 0xa3, 0xc2, 0x99, 0x44, 0x82, 0x20, 0x78,
|
||||
@@ -237,8 +237,9 @@ main(int argc, char *argv[])
|
||||
hKey[i] = CK_INVALID_HANDLE;
|
||||
|
||||
/* Initialize the CRYPTOKI library */
|
||||
if (lib_name != NULL)
|
||||
if (lib_name != NULL) {
|
||||
pk11_set_lib_name(lib_name);
|
||||
}
|
||||
|
||||
if (pin == NULL) {
|
||||
pin = getpass("Enter Pin: ");
|
||||
@@ -255,13 +256,15 @@ main(int argc, char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pin != NULL)
|
||||
if (pin != NULL) {
|
||||
memset(pin, 0, strlen((char *)pin));
|
||||
}
|
||||
|
||||
hSession = pctx.session;
|
||||
|
||||
if (ontoken)
|
||||
if (ontoken) {
|
||||
kTemplate[2].pValue = &truevalue;
|
||||
}
|
||||
|
||||
if (clock_gettime(CLOCK_REALTIME, &starttime) < 0) {
|
||||
perror("clock_gettime(start)");
|
||||
@@ -276,8 +279,9 @@ main(int argc, char *argv[])
|
||||
fprintf(stderr, "C_CreateObject[%u]: Error = 0x%.8lX\n",
|
||||
i, rv);
|
||||
error = 1;
|
||||
if (i == 0)
|
||||
if (i == 0) {
|
||||
goto exit_objects;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -295,17 +299,19 @@ main(int argc, char *argv[])
|
||||
}
|
||||
printf("%u private RSA keys in %ld.%09lds\n", i, endtime.tv_sec,
|
||||
endtime.tv_nsec);
|
||||
if (i > 0)
|
||||
if (i > 0) {
|
||||
printf("%g private RSA keys/s\n",
|
||||
1024 * i /
|
||||
((double)endtime.tv_sec +
|
||||
(double)endtime.tv_nsec / 1000000000.));
|
||||
}
|
||||
|
||||
exit_objects:
|
||||
for (i = 0; i < count; i++) {
|
||||
/* Destroy objects */
|
||||
if (hKey[i] == CK_INVALID_HANDLE)
|
||||
if (hKey[i] == CK_INVALID_HANDLE) {
|
||||
continue;
|
||||
}
|
||||
rv = pkcs_C_DestroyObject(hSession, hKey[i]);
|
||||
if ((rv != CKR_OK) && !errflg) {
|
||||
fprintf(stderr,
|
||||
|
||||
Reference in New Issue
Block a user