mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-30 08:56:50 -04:00
Use do-while(0) format in macros
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
9a7a725ee7
commit
f4194944e8
@ -1668,20 +1668,24 @@ cleanup:
|
|||||||
#endif /* MBEDTLS_FS_IO */
|
#endif /* MBEDTLS_FS_IO */
|
||||||
|
|
||||||
#if !defined(MBEDTLS_X509_REMOVE_INFO)
|
#if !defined(MBEDTLS_X509_REMOVE_INFO)
|
||||||
#define PRINT_ITEM(i) \
|
#define PRINT_ITEM(i) \
|
||||||
{ \
|
do { \
|
||||||
ret = mbedtls_snprintf(p, n, "%s" i, sep); \
|
ret = mbedtls_snprintf(p, n, "%s" i, sep); \
|
||||||
MBEDTLS_X509_SAFE_SNPRINTF; \
|
MBEDTLS_X509_SAFE_SNPRINTF; \
|
||||||
sep = ", "; \
|
sep = ", "; \
|
||||||
}
|
} while (0)
|
||||||
|
|
||||||
#define CERT_TYPE(type, name) \
|
#define CERT_TYPE(type, name) \
|
||||||
if (ns_cert_type & (type)) \
|
do { \
|
||||||
PRINT_ITEM(name);
|
if (ns_cert_type & (type)) \
|
||||||
|
PRINT_ITEM(name); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define KEY_USAGE(code, name) \
|
#define KEY_USAGE(code, name) \
|
||||||
if (key_usage & (code)) \
|
do { \
|
||||||
PRINT_ITEM(name);
|
if (key_usage & (code)) \
|
||||||
|
PRINT_ITEM(name); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
static int x509_info_ext_key_usage(char **buf, size_t *size,
|
static int x509_info_ext_key_usage(char **buf, size_t *size,
|
||||||
const mbedtls_x509_sequence *extended_key_usage)
|
const mbedtls_x509_sequence *extended_key_usage)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user