From: Mark Wooding Date: Sun, 11 Sep 2016 13:24:34 +0000 (+0100) Subject: math/mpint.h (MP_TOINT): Convert MP digits to target type before shifting. X-Git-Tag: 2.3.0~39 X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/c973f431a370a3adbcb3c94f76dc6896a7279235 math/mpint.h (MP_TOINT): Convert MP digits to target type before shifting. Otherwise conversions to types wider than `mpw' never actually works. --- diff --git a/math/mpint.h b/math/mpint.h index 1b0a7623..6b733d1a 100644 --- a/math/mpint.h +++ b/math/mpint.h @@ -133,7 +133,7 @@ /* --- Do all the arithmetic in negative numbers --- */ \ \ while (_v < _vl && _max > 0) { \ - _i -= *_v << _s; \ + _i -= (type)*_v << _s; \ _s += MPW_BITS; \ _v++; \ _max /= (mpd)MPW_MAX + 1; \