From f83707dc6df306e2ed07eafe518b19e8e3c427ca Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Wed, 13 Sep 2023 20:41:58 +0200 Subject: [PATCH] open brace '{' following struct go on the same line Found by running the checkpatch.pl Linux script to enforce coding style. Reviewed-by: Neil Horman Reviewed-by: David von Oheimb Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/22097) --- apps/lib/cmp_mock_srv.c | 3 +-- crypto/cmp/cmp_server.c | 3 +-- crypto/evp/p_lib.c | 3 +-- crypto/hpke/hpke.c | 3 +-- crypto/mem_sec.c | 6 ++---- crypto/self_test_core.c | 6 ++---- engines/e_afalg.c | 3 +-- include/internal/sha3.h | 3 +-- ssl/priority_queue.c | 3 +-- ssl/record/methods/recmethod_local.h | 6 ++---- test/bntest.c | 11 +++++------ test/hexstr_test.c | 3 +-- test/hpke_test.c | 6 ++---- 13 files changed, 21 insertions(+), 38 deletions(-) diff --git a/apps/lib/cmp_mock_srv.c b/apps/lib/cmp_mock_srv.c index ce62af2b007..d98d4598a97 100644 --- a/apps/lib/cmp_mock_srv.c +++ b/apps/lib/cmp_mock_srv.c @@ -16,8 +16,7 @@ #include /* the context for the CMP mock server */ -typedef struct -{ +typedef struct { X509 *refCert; /* cert to expect for oldCertID in kur/rr msg */ X509 *certOut; /* certificate to be returned in cp/ip/kup msg */ X509_CRL *crlOut; /* CRL to be returned in genp for crls */ diff --git a/crypto/cmp/cmp_server.c b/crypto/cmp/cmp_server.c index 53c41bc96ee..84bddcec090 100644 --- a/crypto/cmp/cmp_server.c +++ b/crypto/cmp/cmp_server.c @@ -20,8 +20,7 @@ #include /* the context for the generic CMP server */ -struct ossl_cmp_srv_ctx_st -{ +struct ossl_cmp_srv_ctx_st { OSSL_CMP_CTX *ctx; /* CMP client context reused for transactionID etc. */ void *custom_ctx; /* application-specific server context */ int certReqId; /* of ir/cr/kur, OSSL_CMP_CERTREQID_NONE for p10cr */ diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index b7377751bd4..09bd185a25b 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -525,8 +525,7 @@ EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e, return new_raw_key_int(NULL, NULL, NULL, type, e, pub, len, 0); } -struct raw_key_details_st -{ +struct raw_key_details_st { unsigned char **key; size_t *len; int selection; diff --git a/crypto/hpke/hpke.c b/crypto/hpke/hpke.c index a53488d9ec4..5a403097c41 100644 --- a/crypto/hpke/hpke.c +++ b/crypto/hpke/hpke.c @@ -45,8 +45,7 @@ static const char OSSL_HPKE_SECRET_LABEL[] = "\x73\x65\x63\x72\x65\x74"; /** * @brief sender or receiver context */ -struct ossl_hpke_ctx_st -{ +struct ossl_hpke_ctx_st { OSSL_LIB_CTX *libctx; /* library context */ char *propq; /* properties */ int mode; /* HPKE mode */ diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c index 269c7dcb6d4..f411522fab1 100644 --- a/crypto/mem_sec.c +++ b/crypto/mem_sec.c @@ -321,14 +321,12 @@ size_t CRYPTO_secure_actual_size(void *ptr) ((char*)(p) >= (char*)sh.freelist && (char*)(p) < (char*)&sh.freelist[sh.freelist_size]) -typedef struct sh_list_st -{ +typedef struct sh_list_st { struct sh_list_st *next; struct sh_list_st **p_next; } SH_LIST; -typedef struct sh_st -{ +typedef struct sh_st { char* map_result; size_t map_size; char *arena; diff --git a/crypto/self_test_core.c b/crypto/self_test_core.c index f31fce57c81..0d31b4d78f2 100644 --- a/crypto/self_test_core.c +++ b/crypto/self_test_core.c @@ -13,14 +13,12 @@ #include "internal/cryptlib.h" #include "crypto/context.h" -typedef struct self_test_cb_st -{ +typedef struct self_test_cb_st { OSSL_CALLBACK *cb; void *cbarg; } SELF_TEST_CB; -struct ossl_self_test_st -{ +struct ossl_self_test_st { /* local state variables */ const char *phase; const char *type; diff --git a/engines/e_afalg.c b/engines/e_afalg.c index 3ca5b0211e7..3644524e9fc 100644 --- a/engines/e_afalg.c +++ b/engines/e_afalg.c @@ -125,8 +125,7 @@ static ossl_inline int io_read(aio_context_t ctx, long n, struct iocb **iocb) } /* A version of 'struct timespec' with 32-bit time_t and nanoseconds. */ -struct __timespec32 -{ +struct __timespec32 { __kernel_long_t tv_sec; __kernel_long_t tv_nsec; }; diff --git a/include/internal/sha3.h b/include/internal/sha3.h index 77bd9dbd32d..6bd53f6d2ae 100644 --- a/include/internal/sha3.h +++ b/include/internal/sha3.h @@ -26,8 +26,7 @@ typedef size_t (sha3_absorb_fn)(void *vctx, const void *in, size_t inlen); typedef int (sha3_final_fn)(void *vctx, unsigned char *out, size_t outlen); typedef int (sha3_squeeze_fn)(void *vctx, unsigned char *out, size_t outlen); -typedef struct prov_sha3_meth_st -{ +typedef struct prov_sha3_meth_st { sha3_absorb_fn *absorb; sha3_final_fn *final; sha3_squeeze_fn *squeeze; diff --git a/ssl/priority_queue.c b/ssl/priority_queue.c index 5393c532a7a..6862fb603a6 100644 --- a/ssl/priority_queue.c +++ b/ssl/priority_queue.c @@ -46,8 +46,7 @@ struct pq_elem_st { #endif }; -struct ossl_pqueue_st -{ +struct ossl_pqueue_st { struct pq_heap_st *heap; struct pq_elem_st *elements; int (*compare)(const void *, const void *); diff --git a/ssl/record/methods/recmethod_local.h b/ssl/record/methods/recmethod_local.h index e08737eb76f..364a3a01bbe 100644 --- a/ssl/record/methods/recmethod_local.h +++ b/ssl/record/methods/recmethod_local.h @@ -91,8 +91,7 @@ typedef struct tls_rl_record_st { /* Protocol version specific function pointers */ -struct record_functions_st -{ +struct record_functions_st { /* * Returns either OSSL_RECORD_RETURN_SUCCESS, OSSL_RECORD_RETURN_FATAL or * OSSL_RECORD_RETURN_NON_FATAL_ERR if we can keep trying to find an @@ -209,8 +208,7 @@ struct record_functions_st int (*prepare_write_bio)(OSSL_RECORD_LAYER *rl, int type); }; -struct ossl_record_layer_st -{ +struct ossl_record_layer_st { OSSL_LIB_CTX *libctx; const char *propq; int isdtls; diff --git a/test/bntest.c b/test/bntest.c index 20020cac42f..8c682038664 100644 --- a/test/bntest.c +++ b/test/bntest.c @@ -2847,12 +2847,11 @@ static int test_gcd_prime(void) return st; } -typedef struct mod_exp_test_st -{ - const char *base; - const char *exp; - const char *mod; - const char *res; +typedef struct mod_exp_test_st { + const char *base; + const char *exp; + const char *mod; + const char *res; } MOD_EXP_TEST; static const MOD_EXP_TEST ModExpTests[] = { diff --git a/test/hexstr_test.c b/test/hexstr_test.c index 89d6d971397..f2581d2ba89 100644 --- a/test/hexstr_test.c +++ b/test/hexstr_test.c @@ -16,8 +16,7 @@ #include "internal/cryptlib.h" #include "testutil.h" -struct testdata -{ +struct testdata { const char *in; const unsigned char *expected; size_t expected_len; diff --git a/test/hpke_test.c b/test/hpke_test.c index a8bd1f8f643..7ce51a6f329 100644 --- a/test/hpke_test.c +++ b/test/hpke_test.c @@ -46,8 +46,7 @@ typedef struct { const char *pskid; /* want terminating NUL here */ } TEST_BASEDATA; -typedef struct -{ +typedef struct { int seq; const unsigned char *pt; size_t ptlen; @@ -57,8 +56,7 @@ typedef struct size_t expected_ctlen; } TEST_AEADDATA; -typedef struct -{ +typedef struct { const unsigned char *context; size_t contextlen; const unsigned char *expected_secret; -- 2.47.2