mirror of
https://github.com/espressif/mbedtls.git
synced 2025-06-26 03:24:35 +08:00
Remove spaces around token-pasting macro operator
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
bf4ec79085
commit
d57c0731c9
@ -118,12 +118,12 @@ mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state =
|
|||||||
* - The name <input>_copy is not used for the given value of <input>
|
* - The name <input>_copy is not used for the given value of <input>
|
||||||
*/
|
*/
|
||||||
#define SWAP_FOR_LOCAL_INPUT(input, length) \
|
#define SWAP_FOR_LOCAL_INPUT(input, length) \
|
||||||
psa_crypto_local_input_t input ## _copy = PSA_CRYPTO_LOCAL_INPUT_INIT; \
|
psa_crypto_local_input_t input##_copy = PSA_CRYPTO_LOCAL_INPUT_INIT; \
|
||||||
status = psa_crypto_local_input_alloc(input, length, &input ## _copy); \
|
status = psa_crypto_local_input_alloc(input, length, &input##_copy); \
|
||||||
if (status != PSA_SUCCESS) { \
|
if (status != PSA_SUCCESS) { \
|
||||||
goto exit; \
|
goto exit; \
|
||||||
} \
|
} \
|
||||||
input = input ## _copy.buffer;
|
input = input##_copy.buffer;
|
||||||
|
|
||||||
/* Free the substituted input buffer copy created by SWAP_FOR_LOCAL_INPUT().
|
/* Free the substituted input buffer copy created by SWAP_FOR_LOCAL_INPUT().
|
||||||
* Note that this does not restore the pointer to the original buffer.
|
* Note that this does not restore the pointer to the original buffer.
|
||||||
@ -135,7 +135,7 @@ mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state =
|
|||||||
*/
|
*/
|
||||||
#define FREE_LOCAL_INPUT(input) \
|
#define FREE_LOCAL_INPUT(input) \
|
||||||
input = NULL; \
|
input = NULL; \
|
||||||
psa_crypto_local_input_free(&input ## _copy);
|
psa_crypto_local_input_free(&input##_copy);
|
||||||
|
|
||||||
/* Substitute an output buffer for a local copy of itself.
|
/* Substitute an output buffer for a local copy of itself.
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
@ -144,12 +144,12 @@ mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state =
|
|||||||
* - The name <output>_copy is not used for the given value of <output>
|
* - The name <output>_copy is not used for the given value of <output>
|
||||||
*/
|
*/
|
||||||
#define SWAP_FOR_LOCAL_OUTPUT(output, length) \
|
#define SWAP_FOR_LOCAL_OUTPUT(output, length) \
|
||||||
psa_crypto_local_output_t output ## _copy = PSA_CRYPTO_LOCAL_OUTPUT_INIT; \
|
psa_crypto_local_output_t output##_copy = PSA_CRYPTO_LOCAL_OUTPUT_INIT; \
|
||||||
status = psa_crypto_local_output_alloc(output, length, &output ## _copy); \
|
status = psa_crypto_local_output_alloc(output, length, &output##_copy); \
|
||||||
if (status != PSA_SUCCESS) { \
|
if (status != PSA_SUCCESS) { \
|
||||||
goto exit; \
|
goto exit; \
|
||||||
} \
|
} \
|
||||||
output = output ## _copy.buffer;
|
output = output##_copy.buffer;
|
||||||
|
|
||||||
/* Free the substituted output buffer copy created by SWAP_FOR_LOCAL_OUTPUT()
|
/* Free the substituted output buffer copy created by SWAP_FOR_LOCAL_OUTPUT()
|
||||||
* after first copying back its contents to the original buffer.
|
* after first copying back its contents to the original buffer.
|
||||||
@ -165,13 +165,13 @@ mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state =
|
|||||||
*/
|
*/
|
||||||
#define FREE_LOCAL_OUTPUT(output) \
|
#define FREE_LOCAL_OUTPUT(output) \
|
||||||
output = NULL; \
|
output = NULL; \
|
||||||
psa_status_t output ## _local_output_status; \
|
psa_status_t output##_local_output_status; \
|
||||||
output ## _local_output_status = psa_crypto_local_output_free(&output ## _copy); \
|
output##_local_output_status = psa_crypto_local_output_free(&output##_copy); \
|
||||||
if (output ## _local_output_status != PSA_SUCCESS) { \
|
if (output##_local_output_status != PSA_SUCCESS) { \
|
||||||
/* Since this error case is an internal error, it's more serious than \
|
/* Since this error case is an internal error, it's more serious than \
|
||||||
* any existing error code and so it's fine to overwrite the existing \
|
* any existing error code and so it's fine to overwrite the existing \
|
||||||
* status. */ \
|
* status. */ \
|
||||||
status = output ## _local_output_status; \
|
status = output##_local_output_status; \
|
||||||
}
|
}
|
||||||
#else /* MBEDTLS_PSA_COPY_CALLER_BUFFERS */
|
#else /* MBEDTLS_PSA_COPY_CALLER_BUFFERS */
|
||||||
#define SWAP_FOR_LOCAL_INPUT(input, length)
|
#define SWAP_FOR_LOCAL_INPUT(input, length)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user