From: Bob Beck Date: Thu, 28 Aug 2025 18:59:59 +0000 (-0600) Subject: Disable clang format around .c includes X-Git-Tag: 4.0-PRE-CLANG-FORMAT-WEBKIT~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64bc3acda26e4d4c030a7f0363b26ac26a9fd7ce;p=thirdparty%2Fopenssl.git Disable clang format around .c includes we assume these to be order sensitive and not self contained, so as per our new style we disable clang format around them. we should consider renaming to .inc, or doing away with some of these and just putting the code inline, but that's for later consideration. Reviewed-by: Saša Nedvědický Reviewed-by: Nikola Pajkovsky Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/29241) --- diff --git a/crypto/LPdir_win32.c b/crypto/LPdir_win32.c index b29e096ff30..33b8261774c 100644 --- a/crypto/LPdir_win32.c +++ b/crypto/LPdir_win32.c @@ -38,4 +38,6 @@ #define LP_SYS_WIN32 #define LP_MULTIBYTE_AVAILABLE +/* clang-format off */ #include "LPdir_win.c" +/* clang-format on */ diff --git a/crypto/LPdir_wince.c b/crypto/LPdir_wince.c index ebf89628272..e4c883dcefe 100644 --- a/crypto/LPdir_wince.c +++ b/crypto/LPdir_wince.c @@ -41,4 +41,6 @@ * We might want to define LP_MULTIBYTE_AVAILABLE here. It's currently under * investigation what the exact conditions would be */ +/* clang-format off */ #include "LPdir_win.c" +/* clang-format on */ diff --git a/crypto/bn/asm/x86_64-gcc.c b/crypto/bn/asm/x86_64-gcc.c index 18d0b136086..7049a4f3824 100644 --- a/crypto/bn/asm/x86_64-gcc.c +++ b/crypto/bn/asm/x86_64-gcc.c @@ -9,7 +9,9 @@ #include "../bn_local.h" #if !(defined(__GNUC__) && __GNUC__>=2) +/* clang-format off */ # include "../bn_asm.c" /* kind of dirty hack for Sun Studio */ +/* clang-format on */ #else /*- * x86_64 BIGNUM accelerator version 0.1, December 2002. diff --git a/crypto/des/cbc_enc.c b/crypto/des/cbc_enc.c index aa8ac1a5c33..d13cbe19d2b 100644 --- a/crypto/des/cbc_enc.c +++ b/crypto/des/cbc_enc.c @@ -15,4 +15,6 @@ #define CBC_ENC_C__DONT_UPDATE_IV +/* clang-format off */ #include "ncbc_enc.c" /* des_cbc_encrypt */ +/* clang-format on */ diff --git a/crypto/des/des_enc.c b/crypto/des/des_enc.c index 0041f21b8d3..37a424cd4e7 100644 --- a/crypto/des/des_enc.c +++ b/crypto/des/des_enc.c @@ -195,7 +195,9 @@ void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, #ifndef DES_DEFAULT_OPTIONS # undef CBC_ENC_C__DONT_UPDATE_IV +/* clang-format off */ # include "ncbc_enc.c" /* DES_ncbc_encrypt */ +/* clang-format on */ void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, long length, DES_key_schedule *ks1, diff --git a/crypto/o_dir.c b/crypto/o_dir.c index d7f5d64d064..36d33fbed4f 100644 --- a/crypto/o_dir.c +++ b/crypto/o_dir.c @@ -22,6 +22,7 @@ #include "internal/o_dir.h" +/* clang-format off */ #define LPDIR_H #if defined OPENSSL_SYS_UNIX || defined DJGPP \ || (defined __VMS_VER && __VMS_VER >= 70000000) @@ -35,3 +36,4 @@ #else # include "LPdir_nyi.c" #endif +/* clang-format on */ diff --git a/engines/e_afalg.c b/engines/e_afalg.c index 22df8d50e11..83c5c8f0940 100644 --- a/engines/e_afalg.c +++ b/engines/e_afalg.c @@ -48,8 +48,10 @@ void engine_load_afalg_int(void) # include # include +/* clang-format off */ # include "e_afalg.h" # include "e_afalg_err.c" +/* clang-format on */ # ifndef SOL_ALG # define SOL_ALG 279 diff --git a/engines/e_capi.c b/engines/e_capi.c index 73a81f7d168..5d5546b98fc 100644 --- a/engines/e_capi.c +++ b/engines/e_capi.c @@ -99,8 +99,10 @@ # include # include +/* clang-format off */ # include "e_capi_err.h" # include "e_capi_err.c" +/* clang-format on */ static const char *engine_capi_id = "capi"; static const char *engine_capi_name = "CryptoAPI ENGINE"; diff --git a/engines/e_dasync.c b/engines/e_dasync.c index 5f809e83219..47eca87a6b1 100644 --- a/engines/e_dasync.c +++ b/engines/e_dasync.c @@ -46,7 +46,9 @@ # define ASYNC_WIN #endif +/* clang-format off */ #include "e_dasync_err.c" +/* clang-format on */ /* Engine Id and Name */ static const char *engine_dasync_id = "dasync"; diff --git a/engines/e_loader_attic.c b/engines/e_loader_attic.c index 223929463a5..e7597c54ef9 100644 --- a/engines/e_loader_attic.c +++ b/engines/e_loader_attic.c @@ -40,7 +40,9 @@ #include "crypto/ctype.h" /* For ossl_isdigit */ #include "crypto/pem.h" /* For PVK and "blob" PEM headers */ +/* clang-format off */ #include "e_loader_attic_err.c" +/* clang-format on */ DEFINE_STACK_OF(OSSL_STORE_INFO) diff --git a/engines/e_ossltest.c b/engines/e_ossltest.c index e31d82d0a5b..dd5bef57dc1 100644 --- a/engines/e_ossltest.c +++ b/engines/e_ossltest.c @@ -41,7 +41,9 @@ #include #include +/* clang-format off */ #include "e_ossltest_err.c" +/* clang-format on */ /* Engine Id and Name */ static const char *engine_ossltest_id = "ossltest"; diff --git a/engines/e_padlock.c b/engines/e_padlock.c index 5e7fc4df30d..bdad24b5b2f 100644 --- a/engines/e_padlock.c +++ b/engines/e_padlock.c @@ -156,7 +156,9 @@ static int padlock_aes_set_decrypt_key(const unsigned char *userKey, # define AES_ASM # define AES_set_encrypt_key padlock_aes_set_encrypt_key # define AES_set_decrypt_key padlock_aes_set_decrypt_key +/* clang-format off */ # include "../crypto/aes/aes_core.c" +/* clang-format on */ # endif /* diff --git a/providers/implementations/macs/blake2b_mac.c b/providers/implementations/macs/blake2b_mac.c index b445cbd5787..7ba2b71b376 100644 --- a/providers/implementations/macs/blake2b_mac.c +++ b/providers/implementations/macs/blake2b_mac.c @@ -29,5 +29,7 @@ /* OSSL_DISPATCH symbol */ #define BLAKE2_FUNCTIONS ossl_blake2bmac_functions +/* clang-format off */ #include "blake2_mac_impl.c" +/* clang-format on */ diff --git a/providers/implementations/macs/blake2s_mac.c b/providers/implementations/macs/blake2s_mac.c index 6b3fa28bd36..0d89267aa6c 100644 --- a/providers/implementations/macs/blake2s_mac.c +++ b/providers/implementations/macs/blake2s_mac.c @@ -29,4 +29,6 @@ /* OSSL_DISPATCH symbol */ #define BLAKE2_FUNCTIONS ossl_blake2smac_functions +/* clang-format off */ #include "blake2_mac_impl.c" +/* clang-format on */ diff --git a/test/mem_alloc_custom_fns_test.c b/test/mem_alloc_custom_fns_test.c index 2b0a7a2bda1..832801b8936 100644 --- a/test/mem_alloc_custom_fns_test.c +++ b/test/mem_alloc_custom_fns_test.c @@ -1,2 +1,4 @@ #define USE_CUSTOM_ALLOC_FNS 1 +/* clang-format off */ #include "mem_alloc_test.c" +/* clang-format on */ diff --git a/test/radix/quic_radix.c b/test/radix/quic_radix.c index 3400eda3fda..ada8773b502 100644 --- a/test/radix/quic_radix.c +++ b/test/radix/quic_radix.c @@ -6,8 +6,10 @@ * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +/* clang-format off */ #include "terp.c" #include "quic_bindings.c" #include "quic_ops.c" #include "quic_tests.c" #include "main.c" +/* clang-format on */