Commit fd5c835c996521f118ab41336fa852fa1e8c9692

Francois Perrad 2019-10-15T18:11:38

explicit operator precedence

diff --git a/bn_mp_log_u32.c b/bn_mp_log_u32.c
index fa60ba3..dd62c30 100644
--- a/bn_mp_log_u32.c
+++ b/bn_mp_log_u32.c
@@ -108,7 +108,7 @@ mp_err mp_log_u32(const mp_int *a, uint32_t base, uint32_t *c)
    }
 
    cmp = mp_cmp_d(a, base);
-   if (cmp == MP_LT || cmp == MP_EQ) {
+   if ((cmp == MP_LT) || (cmp == MP_EQ)) {
       *c = cmp == MP_EQ;
       return err;
    }
@@ -167,7 +167,7 @@ mp_err mp_log_u32(const mp_int *a, uint32_t base, uint32_t *c)
       }
    }
 
-   *c = mp_cmp(&bracket_high, a) == MP_EQ ? high : low;
+   *c = (mp_cmp(&bracket_high, a) == MP_EQ) ? high : low;
 
 LBL_END:
 LBL_ERR: