From 45873ceba39930239253b65357f1761fdc8e25de Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 4 Jan 2023 19:50:27 +0100 Subject: [PATCH] Skip restyling of PSA error code definitions Some preprocessor macro definitions must have a specific expansion so that the same macro name can be defined in different products. The definition of having the same expansion (per the C language specification) means the same sequence of tokens, and also the same absence/presence of spacing between tokens. For PSA error code definitions, the specific expansion is mandated by the PSA Status code specification and the PSA Crypto API specification. In particular, there must not be a space between (psa_status_t) and the numerical value (whereas K&R would put a space). Signed-off-by: Gilles Peskine --- include/psa/crypto_values.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h index cf8a7b2cc..9a0ff4614 100644 --- a/include/psa/crypto_values.h +++ b/include/psa/crypto_values.h @@ -58,6 +58,13 @@ * value, check with the Arm PSA framework group to pick one that other * domains aren't already using. */ +/* Tell uncrustify not to touch the constant definitions, otherwise + * it might change the spacing to something that is not PSA-compliant + * (e.g. adding a space after casts). + * + * *INDENT-OFF* + */ + /** The action was completed successfully. */ #define PSA_SUCCESS ((psa_status_t)0) @@ -328,6 +335,8 @@ */ #define PSA_ERROR_DATA_INVALID ((psa_status_t)-153) +/* *INDENT-ON* */ + /**@}*/ /** \defgroup crypto_types Key and algorithm types