From 73d8591f7f4b5b963ae645fbd307f41127028dc4 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Thu, 28 Sep 2023 17:00:50 +0100 Subject: [PATCH] Fix IAR change of sign warning Signed-off-by: Dave Rodgman --- library/bignum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/bignum.c b/library/bignum.c index 61353ca53..bb2d44a8a 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -386,7 +386,7 @@ static inline mbedtls_mpi_uint mpi_sint_abs(mbedtls_mpi_sint z) /* Convert x to a sign, i.e. to 1, if x is positive, or -1, if x is negative. * This looks awkward but generates smaller code than (x < 0 ? -1 : 1) */ -#define TO_SIGN(x) ((((mbedtls_mpi_uint) x) >> (biL - 1)) * -2 + 1) +#define TO_SIGN(x) ((mbedtls_mpi_sint) (((mbedtls_mpi_uint) x) >> (biL - 1)) * -2 + 1) /* * Set value from integer