From c973f431a370a3adbcb3c94f76dc6896a7279235 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 11 Sep 2016 14:24:34 +0100 Subject: [PATCH] math/mpint.h (MP_TOINT): Convert MP digits to target type before shifting. Otherwise conversions to types wider than `mpw' never actually works. --- math/mpint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; \ -- 2.11.0