1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-11-18 14:00:58 +03:00

Merge pull request #10478 from Cube707/backport/iar-compiler-warning

[backport] add cast to fix IAR compiler errors
This commit is contained in:
Valerio Setti
2025-10-31 12:33:11 +00:00
committed by GitHub
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