Merge branch 'each-style-tweak' into 'master'

adjust clang-format options to get closer to ISC style

See merge request isc-projects/bind9!3061

(cherry picked from commit d3b49b6675)

0255a974 revise .clang-format and add a C formatting script in util
e851ed0b apply the modified style
This commit is contained in:
Ondřej Surý
2020-02-14 05:35:17 +00:00
parent c646c20e79
commit cdef20bb66
672 changed files with 36044 additions and 42228 deletions

View File

@@ -61,14 +61,12 @@
#define CLOCK_REALTIME 0
#endif /* ifndef CLOCK_REALTIME */
static int
clock_gettime(int32_t id, struct timespec *tp);
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
clock_gettime(int32_t id, struct timespec *tp) {
struct timeval tv;
int result;
int result;
UNUSED(id);
@@ -82,36 +80,35 @@ clock_gettime(int32_t id, struct timespec *tp)
#endif /* ifndef HAVE_CLOCK_GETTIME */
CK_BYTE buf[1024];
char label[16];
char label[16];
static CK_BBOOL truevalue = TRUE;
static CK_BBOOL falsevalue = FALSE;
int
main(int argc, char *argv[])
{
isc_result_t result;
CK_RV rv;
CK_SLOT_ID slot = 0;
main(int argc, char *argv[]) {
isc_result_t result;
CK_RV rv;
CK_SLOT_ID slot = 0;
CK_SESSION_HANDLE hSession = CK_INVALID_HANDLE;
CK_OBJECT_HANDLE *hKey;
CK_OBJECT_CLASS kClass = CKO_DATA;
CK_ULONG len = sizeof(buf);
CK_ATTRIBUTE kTemplate[] = {
{ CKA_CLASS, &kClass, (CK_ULONG)sizeof(kClass) },
{ CKA_TOKEN, &falsevalue, (CK_ULONG)sizeof(falsevalue) },
{ CKA_PRIVATE, &falsevalue, (CK_ULONG)sizeof(falsevalue) },
{ CKA_LABEL, (CK_BYTE_PTR)label, (CK_ULONG)sizeof(label) },
{ CKA_VALUE, buf, (CK_ULONG)sizeof(buf) }
CK_OBJECT_CLASS kClass = CKO_DATA;
CK_ULONG len = sizeof(buf);
CK_ATTRIBUTE kTemplate[] = {
{ CKA_CLASS, &kClass, (CK_ULONG)sizeof(kClass) },
{ CKA_TOKEN, &falsevalue, (CK_ULONG)sizeof(falsevalue) },
{ CKA_PRIVATE, &falsevalue, (CK_ULONG)sizeof(falsevalue) },
{ CKA_LABEL, (CK_BYTE_PTR)label, (CK_ULONG)sizeof(label) },
{ CKA_VALUE, buf, (CK_ULONG)sizeof(buf) }
};
pk11_context_t pctx;
char * lib_name = NULL;
char * pin = NULL;
int error = 0;
int c, errflg = 0;
int ontoken = 0;
unsigned int count = 1000;
unsigned int i;
pk11_context_t pctx;
char *lib_name = NULL;
char *pin = NULL;
int error = 0;
int c, errflg = 0;
int ontoken = 0;
unsigned int count = 1000;
unsigned int i;
struct timespec starttime;
struct timespec endtime;
@@ -176,7 +173,8 @@ main(int argc, char *argv[])
(const char *)pin, slot);
if ((result != ISC_R_SUCCESS) && (result != PK11_R_NORANDOMSERVICE) &&
(result != PK11_R_NODIGESTSERVICE) &&
(result != PK11_R_NOAESSERVICE)) {
(result != PK11_R_NOAESSERVICE))
{
fprintf(stderr, "Error initializing PKCS#11: %s\n",
isc_result_totext(result));
exit(1);