explicit operator precedence
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
diff --git a/bn_mp_kronecker.c b/bn_mp_kronecker.c
index c44d10e..f3a423a 100644
--- a/bn_mp_kronecker.c
+++ b/bn_mp_kronecker.c
@@ -37,7 +37,7 @@ int mp_kronecker(const mp_int *a, const mp_int *p, int *c)
static const int table[8] = {0, 1, 0, -1, 0, -1, 0, 1};
if (mp_iszero(p) != MP_NO) {
- if (a->used == 1 && a->dp[0] == 1u) {
+ if ((a->used == 1) && (a->dp[0] == 1u)) {
*c = 1;
return e;
} else {
diff --git a/bn_mp_prime_frobenius_underwood.c b/bn_mp_prime_frobenius_underwood.c
index 0a10342..6a2a51d 100644
--- a/bn_mp_prime_frobenius_underwood.c
+++ b/bn_mp_prime_frobenius_underwood.c
@@ -48,7 +48,8 @@ int mp_prime_frobenius_underwood(const mp_int *N, int *result)
for (a = 0; a < LTM_FROBENIUS_UNDERWOOD_A; a++) {
/* TODO: That's ugly! No, really, it is! */
- if (a==2||a==4||a==7||a==8||a==10||a==14||a==18||a==23||a==26||a==28) {
+ if ((a==2) || (a==4) || (a==7) || (a==8) || (a==10) ||
+ (a==14) || (a==18) || (a==23) || (a==26) || (a==28)) {
continue;
}
/* (32764^2 - 4) < 2^31, no bigint for >MP_8BIT needed) */
@@ -83,7 +84,7 @@ int mp_prime_frobenius_underwood(const mp_int *N, int *result)
goto LBL_FU_ERR;
}
/* Composite if N and (a+4)*(2*a+5) are not coprime */
- if ((e = mp_set_long(&T1z, (unsigned long)((a+4)*(2*a+5)))) != MP_OKAY) {
+ if ((e = mp_set_long(&T1z, (unsigned long)((a+4)*((2*a)+5)))) != MP_OKAY) {
goto LBL_FU_ERR;
}
@@ -91,7 +92,7 @@ int mp_prime_frobenius_underwood(const mp_int *N, int *result)
goto LBL_FU_ERR;
}
- if (!(T1z.used == 1 && T1z.dp[0] == 1u)) {
+ if (!((T1z.used == 1) && (T1z.dp[0] == 1u))) {
goto LBL_FU_ERR;
}
@@ -174,7 +175,7 @@ int mp_prime_frobenius_underwood(const mp_int *N, int *result)
}
}
- if ((e = mp_set_long(&T1z, (unsigned long)(2 * a + 5))) != MP_OKAY) {
+ if ((e = mp_set_long(&T1z, (unsigned long)((2 * a) + 5))) != MP_OKAY) {
goto LBL_FU_ERR;
}
if ((e = mp_mod(&T1z,N,&T1z)) != MP_OKAY) {
diff --git a/bn_mp_prime_is_prime.c b/bn_mp_prime_is_prime.c
index 5bde2c8..99f8d04 100644
--- a/bn_mp_prime_is_prime.c
+++ b/bn_mp_prime_is_prime.c
@@ -41,7 +41,7 @@ int mp_prime_is_prime(const mp_int *a, int t, int *result)
/* Some shortcuts */
/* N > 3 */
if (a->used == 1) {
- if (a->dp[0] == 0u || a->dp[0] == 1u) {
+ if ((a->dp[0] == 0u) || (a->dp[0] == 1u)) {
*result = 0;
return MP_OKAY;
}
diff --git a/bn_mp_prime_strong_lucas_selfridge.c b/bn_mp_prime_strong_lucas_selfridge.c
index 878a6bf..579baff 100644
--- a/bn_mp_prime_strong_lucas_selfridge.c
+++ b/bn_mp_prime_strong_lucas_selfridge.c
@@ -133,7 +133,7 @@ int mp_prime_strong_lucas_selfridge(const mp_int *a, int *result)
}
D += 2;
- if (D > INT_MAX - 2) {
+ if (D > (INT_MAX - 2)) {
e = MP_VAL;
goto LBL_LS_ERR;
}