From b6bf5f5533f5c7eedf3b7609b5c963605267b574 Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Tue, 3 Jan 2023 11:07:09 +0000 Subject: [PATCH] Workaround Uncrustify parsing of "asm" The following code: #ifndef asm #define asm __asm #endif causes Uncrustify to stop correcting the rest of the file. This may be due to parsing the "asm" keyword in the definition. Work around this by wrapping the idiom in an *INDENT-OFF* comment wherever it appears. Signed-off-by: David Horstmann --- include/mbedtls/bn_mul.h | 2 ++ library/aesni.c | 2 ++ library/padlock.c | 2 ++ library/timing.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/include/mbedtls/bn_mul.h b/include/mbedtls/bn_mul.h index a3fc36381..30d445e63 100644 --- a/include/mbedtls/bn_mul.h +++ b/include/mbedtls/bn_mul.h @@ -86,9 +86,11 @@ #if defined(MBEDTLS_HAVE_ASM) +/* *INDENT-OFF* */ #ifndef asm #define asm __asm #endif +/* *INDENT-ON* */ /* armcc5 --gnu defines __GNUC__ but doesn't support GNU's extended asm */ #if defined(__GNUC__) && \ diff --git a/library/aesni.c b/library/aesni.c index 996292ff6..4b16d9250 100644 --- a/library/aesni.c +++ b/library/aesni.c @@ -36,9 +36,11 @@ #include +/* *INDENT-OFF* */ #ifndef asm #define asm __asm #endif +/* *INDENT-ON* */ #if defined(MBEDTLS_HAVE_X86_64) diff --git a/library/padlock.c b/library/padlock.c index 837337413..12ea2472d 100644 --- a/library/padlock.c +++ b/library/padlock.c @@ -31,9 +31,11 @@ #include +/* *INDENT-OFF* */ #ifndef asm #define asm __asm #endif +/* *INDENT-ON* */ #if defined(MBEDTLS_HAVE_X86) diff --git a/library/timing.c b/library/timing.c index ca29e56a6..7f559bebd 100644 --- a/library/timing.c +++ b/library/timing.c @@ -33,9 +33,11 @@ #error "This module only works on Unix and Windows, see MBEDTLS_TIMING_C in config.h" #endif +/* *INDENT-OFF* */ #ifndef asm #define asm __asm #endif +/* *INDENT-ON* */ #if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32)