Commit 7fdd6b507dbd4dbbb3be4c09a43fe7f20cf3ddce

Francois Perrad 2019-05-22T10:33:12

literal suffix instead of cast

diff --git a/bn_mp_count_bits.c b/bn_mp_count_bits.c
index bba9a94..b7c2cad 100644
--- a/bn_mp_count_bits.c
+++ b/bn_mp_count_bits.c
@@ -19,9 +19,9 @@ int mp_count_bits(const mp_int *a)
 
    /* take the last digit and count the bits in it */
    q = a->dp[a->used - 1];
-   while (q > (mp_digit)0) {
+   while (q > 0u) {
       ++r;
-      q >>= (mp_digit)1;
+      q >>= 1u;
    }
    return r;
 }
diff --git a/bn_mp_ilogb.c b/bn_mp_ilogb.c
index efcd5f9..0ca0193 100644
--- a/bn_mp_ilogb.c
+++ b/bn_mp_ilogb.c
@@ -24,10 +24,10 @@ static mp_digit s_digit_ilogb(mp_digit base, mp_digit n)
    mp_digit ret, high = 1uL, low = 0uL, mid;
 
    if (n < base) {
-      return (mp_digit)0uL;
+      return 0uL;
    }
    if (n == base) {
-      return (mp_digit)1uL;
+      return 1uL;
    }
 
    bracket_high = (mp_word) base ;