Commit 9cfb6c329819871f3ddd2c0ba80f0aa6cb62d3f9

Jan Nijtmans 2019-11-06T11:52:42

use type-cast in stead of UINT64_C

diff --git a/demo/test.c b/demo/test.c
index 1c86429..94a7ca2 100644
--- a/demo/test.c
+++ b/demo/test.c
@@ -690,7 +690,7 @@ static int test_mp_get_u64(void)
    DOR(mp_init_multi(&a, &b, NULL));
 
    for (i = 0; i < (int)(MP_SIZEOF_BITS(uint64_t) - 1); ++i) {
-      r = (UINT64_C(1) << (i+1)) - 1;
+      r = ((uint64_t)1 << (i+1)) - 1;
       if (!r)
          r = UINT64_MAX;
       printf(" r = 0x%" PRIx64 " i = %d\r", r, i);
diff --git a/mp_set_double.c b/mp_set_double.c
index ca46083..78550c8 100644
--- a/mp_set_double.c
+++ b/mp_set_double.c
@@ -16,7 +16,7 @@ mp_err mp_set_double(mp_int *a, double b)
    cast.dbl = b;
 
    exp = (int)((unsigned)(cast.bits >> 52) & 0x7FFu);
-   frac = (cast.bits & ((UINT64_C(1) << 52) - UINT64_C(1))) | (UINT64_C(1) << 52);
+   frac = (cast.bits & (((uint64_t)1 << 52) - (uint64_t)1)) | ((uint64_t)1 << 52);
 
    if (exp == 0x7FF) { /* +-inf, NaN */
       return MP_VAL;