summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Zimmermann <Paul.Zimmermann@inria.fr>2020-03-02 10:55:58 +0100
committerPaul Zimmermann <Paul.Zimmermann@inria.fr>2020-03-02 10:55:58 +0100
commit710c409046f327f1a971aa786fe7126c468aa53e (patch)
tree17dd94dea6cc2178ef955049b427485e66759100
parent408dce9b5d291e37a694bb8dc2e2e867d1f81aa2 (diff)
downloadmpc-git-710c409046f327f1a971aa786fe7126c468aa53e.tar.gz
fixes for 32-bit mpfr_exp_t
-rw-r--r--src/get_x.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/get_x.c b/src/get_x.c
index 31610ac..deac8fe 100644
--- a/src/get_x.c
+++ b/src/get_x.c
@@ -53,12 +53,12 @@ mpc_get_ldc (mpc_srcptr op, mpc_rnd_t rnd) {
of the locale is used. */
/* mpfr_prec_t can be either int or long int */
-#if (__GMP_MP_SIZE_T_INT == 1)
+#if (_MPFR_EXP_FORMAT == 2)
#define MPC_EXP_FORMAT_SPEC "i"
-#elif (__GMP_MP_SIZE_T_INT == 0)
+#elif (_MPFR_EXP_FORMAT == 3)
#define MPC_EXP_FORMAT_SPEC "li"
#else
-#error "mpfr_exp_t size not supported"
+#error "value of _MPFR_EXP_FORMAT not supported"
#endif
static char *
@@ -76,13 +76,13 @@ pretty_zero (mpfr_srcptr zero)
}
static char *
-prettify (const char *str, const mp_exp_t expo, int base, int special)
+prettify (const char *str, const mpfr_exp_t expo, int base, int special)
{
size_t sz;
char *pretty;
char *p;
const char *s;
- mp_exp_t x;
+ mpfr_exp_t x;
int sign;
sz = strlen (str) + 1; /* + terminal '\0' */
@@ -112,14 +112,14 @@ prettify (const char *str, const mp_exp_t expo, int base, int special)
{
/* augment sz with the size needed for an exponent written in base
ten */
- mp_exp_t xx;
+ mpfr_exp_t xx;
sz += 3; /* + exponent char + sign + 1 digit */
if (x < 0)
{
/* avoid overflow when changing sign (assuming that, for the
- mp_exp_t type, (max value) is greater than (- min value / 10)) */
+ mpfr_exp_t type, (max value) is greater than (- min value / 10)) */
if (x < -10)
{
xx = - (x / 10);
@@ -189,7 +189,7 @@ prettify (const char *str, const mp_exp_t expo, int base, int special)
static char *
get_pretty_str (const int base, const size_t n, mpfr_srcptr x, mpfr_rnd_t rnd)
{
- mp_exp_t expo;
+ mpfr_exp_t expo;
char *ugly;
char *pretty;