summaryrefslogtreecommitdiff
path: root/otherlibs/num/nat_stubs.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/num/nat_stubs.c')
-rw-r--r--otherlibs/num/nat_stubs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/otherlibs/num/nat_stubs.c b/otherlibs/num/nat_stubs.c
index ad3e8b25b9..4a5b64b929 100644
--- a/otherlibs/num/nat_stubs.c
+++ b/otherlibs/num/nat_stubs.c
@@ -109,7 +109,7 @@ CAMLprim value is_digit_zero(value nat, value ofs)
CAMLprim value is_digit_normalized(value nat, value ofs)
{
return
- Val_bool(Digit_val(nat, Long_val(ofs)) & (1L << (BNG_BITS_PER_DIGIT-1)));
+ Val_bool(Digit_val(nat, Long_val(ofs)) & ((bngdigit)1 << (BNG_BITS_PER_DIGIT-1)));
}
CAMLprim value is_digit_odd(value nat, value ofs)
@@ -330,8 +330,8 @@ static void serialize_nat(value nat,
#ifdef ARCH_SIXTYFOUR
len = len * 2; /* two 32-bit words per 64-bit digit */
- if (len >= (1L << 32))
- caml_failwith("output_value: nat too big");
+ if (len >= ((mlsize_t)1 << 32))
+ failwith("output_value: nat too big");
#endif
caml_serialize_int_4((int32) len);
#if defined(ARCH_SIXTYFOUR) && defined(ARCH_BIG_ENDIAN)