cppcheck: fixes from reviewing report

This commit is contained in:
Sean Parkinson
2021-05-19 11:08:40 +10:00
parent 0e23d40250
commit 2c6285ccba
27 changed files with 367 additions and 223 deletions

View File

@@ -686,7 +686,8 @@ int mp_mod_2d (mp_int * a, int b, mp_int * c)
/* clear the digit that is not completely outside/inside the modulus */
x = DIGIT_BIT - (b % DIGIT_BIT);
if (x != DIGIT_BIT) {
c->dp[b / DIGIT_BIT] &= ~((mp_digit)0) >> (x + ((sizeof(mp_digit)*8) - DIGIT_BIT));
c->dp[b / DIGIT_BIT] &=
((mp_digit)~((mp_digit)0)) >> (x + ((sizeof(mp_digit)*8) - DIGIT_BIT));
}
mp_clamp (c);
return MP_OKAY;