Merge pull request #6888 from daverodgman/iar-bignum-warning

Fix IAR warning
This commit is contained in:
Gilles Peskine 2023-01-10 22:08:37 +01:00 committed by GitHub
commit 0770efe4e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -0,0 +1,2 @@
Bugfix
* Fix IAR compiler warnings. Contributed by Glenn Strauss in #3835.

View file

@ -1197,9 +1197,9 @@ static mbedtls_mpi_uint mbedtls_int_div_int( mbedtls_mpi_uint u1,
*/
if( 0 == d || u1 >= d )
{
if (r != NULL) *r = ~0;
if (r != NULL) *r = ~(mbedtls_mpi_uint)0u;
return ( ~0 );
return ( ~(mbedtls_mpi_uint)0u );
}
#if defined(MBEDTLS_HAVE_UDBL)
@ -1338,7 +1338,7 @@ int mbedtls_mpi_div_mpi( mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A,
for( i = n; i > t ; i-- )
{
if( X.p[i] >= Y.p[t] )
Z.p[i - t - 1] = ~0;
Z.p[i - t - 1] = ~(mbedtls_mpi_uint)0u;
else
{
Z.p[i - t - 1] = mbedtls_int_div_int( X.p[i], X.p[i - 1],