From: Taylor R Campbell Date: Sun, 21 Jan 2018 15:52:51 +0000 (+0000) Subject: Avoid shift of negative, which is undefined in C. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~327 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=8801c4fc0dbd70632d247a9f5bb5314ef6a61b1e;p=mit-scheme.git Avoid shift of negative, which is undefined in C. --- diff --git a/src/microcode/bignmint.h b/src/microcode/bignmint.h index d1c3c02cc..8f9d904a5 100644 --- a/src/microcode/bignmint.h +++ b/src/microcode/bignmint.h @@ -118,7 +118,8 @@ extern void abort (); ((BIGNUM_RADIX / BIGNUM_DIGIT_LENGTH) - BIGNUM_DIGIT_LENGTH) #define BIGNUM_DIGIT(c) ((bignum_digit_type) (c)) -#define BIGNUM_DIGIT_ONES(n) (~ ((~ (BIGNUM_DIGIT (0))) << (n))) +#define BIGNUM_DIGIT_ONES(n) \ + ((bignum_digit_type) (~ ((~ ((uintmax_t) (0))) << (n)))) #define BIGNUM_START_PTR(bignum) \ ((BIGNUM_TO_POINTER (bignum)) + 1)