From cc3c670670286f792ad2222ee0007d705b1a281b Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Thu, 21 Sep 2023 16:33:26 +0100 Subject: [PATCH] Fix compiler cast warning Signed-off-by: Dave Rodgman --- tests/suites/test_suite_constant_time.function | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/suites/test_suite_constant_time.function b/tests/suites/test_suite_constant_time.function index ffcd4d102..5b25c5472 100644 --- a/tests/suites/test_suite_constant_time.function +++ b/tests/suites/test_suite_constant_time.function @@ -129,9 +129,9 @@ void mbedtls_ct_if(char *c_str, char *t_str, char *f_str) * Define ABS_INT_MIN in a way that avoids UB, then use it to * check t and f before making them negative. */ - #define ABS_INT_MIN (UINT_MAX - ((unsigned int)(INT_MIN)) + 1U) - int t_neg = t <= ABS_INT_MIN ? -t : INT_MIN; - int f_neg = f <= ABS_INT_MIN ? -f : INT_MIN; + #define ABS_INT_MIN (UINT_MAX - ((unsigned int) (INT_MIN)) + 1U) + int t_neg = t <= ABS_INT_MIN ? -((int) t) : INT_MIN; + int f_neg = f <= ABS_INT_MIN ? -((int) f) : INT_MIN; int expected0_neg = c ? t_neg : 0; int expected_neg = c ? t_neg : f_neg;