diff options
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/set_f.c')
-rw-r--r-- | Build/source/libs/mpfr/mpfr-src/src/set_f.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_f.c b/Build/source/libs/mpfr/mpfr-src/src/set_f.c index 07dc69277fd..82b4e125bfe 100644 --- a/Build/source/libs/mpfr/mpfr-src/src/set_f.c +++ b/Build/source/libs/mpfr/mpfr-src/src/set_f.c @@ -21,17 +21,20 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #define MPFR_NEED_LONGLONG_H +#define MPFR_NEED_MPF_INTERNALS #include "mpfr-impl.h" +#ifndef MPFR_USE_MINI_GMP int mpfr_set_f (mpfr_ptr y, mpf_srcptr x, mpfr_rnd_t rnd_mode) { mp_limb_t *my, *mx, *tmp; - unsigned long cnt, sx, sy; + int cnt; + mp_size_t sx, sy; int inexact, carry = 0; MPFR_TMP_DECL(marker); - sx = ABS(SIZ(x)); /* number of limbs of the mantissa of x */ + sx = ABSIZ(x); /* number of limbs of the mantissa of x */ if (sx == 0) /* x is zero */ { @@ -51,7 +54,7 @@ mpfr_set_f (mpfr_ptr y, mpf_srcptr x, mpfr_rnd_t rnd_mode) if (sy <= sx) /* we may have to round even when sy = sx */ { - unsigned long xprec = sx * GMP_NUMB_BITS; + mpfr_prec_t xprec = (mpfr_prec_t) sx * GMP_NUMB_BITS; MPFR_TMP_MARK(marker); tmp = MPFR_TMP_LIMBS_ALLOC (sx); @@ -92,8 +95,9 @@ mpfr_set_f (mpfr_ptr y, mpf_srcptr x, mpfr_rnd_t rnd_mode) else { /* Do not use MPFR_SET_EXP as the exponent may be out of range. */ - MPFR_EXP (y) = EXP (x) * GMP_NUMB_BITS - (mpfr_exp_t) cnt + carry; + MPFR_EXP (y) = EXP (x) * GMP_NUMB_BITS - cnt + carry; } return mpfr_check_range (y, inexact, rnd_mode); } +#endif |