refactor literal suffix with u lowercase
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
diff --git a/bn_mp_get_int.c b/bn_mp_get_int.c
index b046c3d..e3571e1 100644
--- a/bn_mp_get_int.c
+++ b/bn_mp_get_int.c
@@ -7,6 +7,6 @@
unsigned long mp_get_int(const mp_int *a)
{
/* force result to 32-bits always so it is consistent on non 32-bit platforms */
- return mp_get_long(a) & 0xFFFFFFFFUL;
+ return mp_get_long(a) & 0xFFFFFFFFuL;
}
#endif
diff --git a/bn_mp_get_long.c b/bn_mp_get_long.c
index 4441d63..a800efb 100644
--- a/bn_mp_get_long.c
+++ b/bn_mp_get_long.c
@@ -19,7 +19,7 @@ unsigned long mp_get_long(const mp_int *a)
/* get most significant digit of result */
res = (unsigned long)a->dp[i];
-#if (ULONG_MAX != 0xFFFFFFFFUL) || (MP_DIGIT_BIT < 32)
+#if (ULONG_MAX != 0xFFFFFFFFuL) || (MP_DIGIT_BIT < 32)
while (--i >= 0) {
res = (res << MP_DIGIT_BIT) | (unsigned long)a->dp[i];
}
diff --git a/bn_mp_set_double.c b/bn_mp_set_double.c
index 98a8248..9e00362 100644
--- a/bn_mp_set_double.c
+++ b/bn_mp_set_double.c
@@ -15,8 +15,8 @@ mp_err mp_set_double(mp_int *a, double b)
} cast;
cast.dbl = b;
- exp = (int)((unsigned)(cast.bits >> 52) & 0x7FFU);
- frac = (cast.bits & ((1ULL << 52) - 1ULL)) | (1ULL << 52);
+ exp = (int)((unsigned)(cast.bits >> 52) & 0x7FFu);
+ frac = (cast.bits & ((1uLL << 52) - 1uLL)) | (1uLL << 52);
if (exp == 0x7FF) { /* +-inf, NaN */
return MP_VAL;
@@ -30,7 +30,7 @@ mp_err mp_set_double(mp_int *a, double b)
return err;
}
- if (((cast.bits >> 63) != 0ULL) && !MP_IS_ZERO(a)) {
+ if (((cast.bits >> 63) != 0uLL) && !MP_IS_ZERO(a)) {
a->sign = MP_NEG;
}
diff --git a/bn_mp_set_int.c b/bn_mp_set_int.c
index a322580..f0c7434 100644
--- a/bn_mp_set_int.c
+++ b/bn_mp_set_int.c
@@ -6,6 +6,6 @@
/* set a 32-bit const */
mp_err mp_set_int(mp_int *a, unsigned long b)
{
- return mp_set_long(a, b & 0xFFFFFFFFUL);
+ return mp_set_long(a, b & 0xFFFFFFFFuL);
}
#endif
diff --git a/demo/test.c b/demo/test.c
index 69c8fbc..e7dd9ff 100644
--- a/demo/test.c
+++ b/demo/test.c
@@ -1239,7 +1239,7 @@ static int test_mp_reduce_2k_l(void)
mp_copy(&b, &c);
printf("Testing: mp_reduce_2k_l...");
fflush(stdout);
- for (cnt = 0; cnt < (int)(1UL << 20); cnt++) {
+ for (cnt = 0; cnt < (int)(1uL << 20); cnt++) {
mp_sqr(&b, &b);
mp_add_d(&b, 1uL, &b);
mp_reduce_2k_l(&b, &a, &d);