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);
@@ -84,27 +82,26 @@ clock_gettime(int32_t id, struct timespec *tp)
CK_BYTE label[] = "foo??bar!!";
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_ATTRIBUTE sTemplate[] = {
{ CKA_LABEL, label, (CK_ULONG)sizeof(label) },
CK_ATTRIBUTE sTemplate[] = {
{ CKA_LABEL, label, (CK_ULONG)sizeof(label) },
};
CK_OBJECT_HANDLE sKey = CK_INVALID_HANDLE;
CK_ULONG found = 0;
pk11_context_t pctx;
pk11_optype_t op_type = OP_RSA;
char * lib_name = NULL;
char * pin = NULL;
int error = 0;
int c, errflg = 0;
unsigned int count = 1000;
unsigned int i;
struct timespec starttime;
struct timespec endtime;
CK_ULONG found = 0;
pk11_context_t pctx;
pk11_optype_t op_type = OP_RSA;
char *lib_name = NULL;
char *pin = NULL;
int error = 0;
int c, errflg = 0;
unsigned int count = 1000;
unsigned int i;
struct timespec starttime;
struct timespec endtime;
while ((c = isc_commandline_parse(argc, argv, ":m:s:p:n:")) != -1) {
switch (c) {
@@ -156,7 +153,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);