add cast to fix IAR compiler errors

IAR throws a warning "mixed ENUM with other type"

backport of a5384bdf09

Signed-off-by: Jan Spannberger <jan.spannberger@siemens.com>
This commit is contained in:
Jan Spannberger
2025-10-28 15:14:30 +01:00
committed by Jan Wille
parent d80b9ff511
commit 73d5398f02
2 changed files with 5 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
Changes
* Add casts to some Enums to remove compiler errors thrown by IAR 6.5.
Removes Warning "mixed ENUM with other type".

View File

@@ -1351,14 +1351,14 @@ static inline void mbedtls_ssl_handshake_set_state(mbedtls_ssl_context *ssl,
mbedtls_ssl_states state)
{
MBEDTLS_SSL_DEBUG_MSG(3, ("handshake state: %d (%s) -> %d (%s)",
ssl->state, mbedtls_ssl_states_str(ssl->state),
ssl->state, mbedtls_ssl_states_str((mbedtls_ssl_states)ssl->state),
(int) state, mbedtls_ssl_states_str(state)));
ssl->state = (int) state;
}
static inline void mbedtls_ssl_handshake_increment_state(mbedtls_ssl_context *ssl)
{
mbedtls_ssl_handshake_set_state(ssl, ssl->state + 1);
mbedtls_ssl_handshake_set_state(ssl, (mbedtls_ssl_states)(ssl->state + 1));
}
MBEDTLS_CHECK_RETURN_CRITICAL