summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-07-19 17:31:41 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-07-19 17:31:41 +0000
commit05e028523941a0393cdf50ff22715d77a07eb028 (patch)
treeb4e473f551e12c7e1e49e0ec786bb38c166ba0d2
parentabea9e7f276b764d8a8daaeb26c1e6fb88ad5fac (diff)
downloadmpfr-05e028523941a0393cdf50ff22715d77a07eb028.tar.gz
Merged changeset 5290 from the trunk (except tests/tests.c):
For the terminating null pointer of the functions mpfr_inits, mpfr_inits2, mpfr_clears, always use the type mpfr_ptr (no longer void *). Updated the description of these functions in the manual (mpfr.texi). The reason is that the C standard does not guarantee that (void *) 0 has the same representation as a null pointer to a structure (and even the same size). In most C implementations, the representations are the same, but one never knows (dynamical checking is also always possible)... git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/2.3@5422 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--add1sp.c2
-rw-r--r--fma.c2
-rw-r--r--fms.c2
-rw-r--r--mpfr.texi22
-rw-r--r--mul.c2
-rw-r--r--pow.c2
-rw-r--r--sub1sp.c2
-rw-r--r--tests/tabs.c4
-rw-r--r--tests/tacosh.c6
-rw-r--r--tests/tadd.c2
-rw-r--r--tests/tadd1sp.c12
-rw-r--r--tests/tadd_ui.c4
-rw-r--r--tests/tagm.c4
-rw-r--r--tests/tatan.c12
-rw-r--r--tests/tcomparisons.c8
-rw-r--r--tests/tconst_log2.c2
-rw-r--r--tests/tconst_pi.c2
-rw-r--r--tests/tcos.c4
-rw-r--r--tests/tcot.c4
-rw-r--r--tests/tdiv.c20
-rw-r--r--tests/terf.c8
-rw-r--r--tests/texp.c8
-rw-r--r--tests/tfma.c20
-rw-r--r--tests/tfms.c20
-rw-r--r--tests/tget_str.c2
-rw-r--r--tests/tgmpop.c16
-rw-r--r--tests/tinternals.c4
-rw-r--r--tests/tlog.c6
-rw-r--r--tests/tmul.c12
-rw-r--r--tests/tmul_2exp.c4
-rw-r--r--tests/tnext.c8
-rw-r--r--tests/tpow.c28
-rw-r--r--tests/tpow_z.c8
-rw-r--r--tests/tset_si.c4
-rw-r--r--tests/tset_sj.c4
-rw-r--r--tests/tsi_op.c4
-rw-r--r--tests/tsin.c4
-rw-r--r--tests/tsin_cos.c16
-rw-r--r--tests/tsqr.c4
-rw-r--r--tests/tsub1sp.c8
-rw-r--r--tests/tsub_ui.c8
-rw-r--r--tests/tsum.c8
-rw-r--r--tests/ttrunc.c4
-rw-r--r--tests/tui_div.c4
-rw-r--r--tests/tui_sub.c8
-rw-r--r--tests/tzeta.c4
46 files changed, 174 insertions, 168 deletions
diff --git a/add1sp.c b/add1sp.c
index 80cb1b209..a5e61cc7d 100644
--- a/add1sp.c
+++ b/add1sp.c
@@ -64,7 +64,7 @@ int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
inexact, inexact2);
MPFR_ASSERTN (0);
}
- mpfr_clears (tmpa, tmpb, tmpc, (void *) 0);
+ mpfr_clears (tmpa, tmpb, tmpc, (mpfr_ptr) 0);
return inexact;
}
# define mpfr_add1sp mpfr_add1sp2
diff --git a/fma.c b/fma.c
index cd00abaf0..a8f617e84 100644
--- a/fma.c
+++ b/fma.c
@@ -174,7 +174,7 @@ mpfr_fma (mpfr_ptr s, mpfr_srcptr x, mpfr_srcptr y, mpfr_srcptr z,
{
MPFR_ASSERTN (zz != z);
MPFR_ASSERTN (0); /* TODO... */
- mpfr_clears (zo4, u, (void *) 0);
+ mpfr_clears (zo4, u, (mpfr_ptr) 0);
}
else
{
diff --git a/fms.c b/fms.c
index 50889cca4..4eb5c3e98 100644
--- a/fms.c
+++ b/fms.c
@@ -176,7 +176,7 @@ mpfr_fms (mpfr_ptr s, mpfr_srcptr x, mpfr_srcptr y, mpfr_srcptr z,
{
MPFR_ASSERTN (zz != z);
MPFR_ASSERTN (0); /* TODO... */
- mpfr_clears (zo4, u, (void *) 0);
+ mpfr_clears (zo4, u, (mpfr_ptr) 0);
}
else
{
diff --git a/mpfr.texi b/mpfr.texi
index 3bd2b2f1a..ddbb4296b 100644
--- a/mpfr.texi
+++ b/mpfr.texi
@@ -2255,8 +2255,10 @@ with gcc in c89 mode and with @samp{-pedantic}, you may want to define the
Initialize all the @code{mpfr_t} variables of the given @code{va_list},
set their precision to be the default precision and their value to NaN.
See @code{mpfr_init} for more details.
-The @code{va_list} is assumed to be composed only of type @code{mpfr_t}.
-It begins from @var{x}. It ends when it encounters a null pointer.
+The @code{va_list} is assumed to be composed only of type @code{mpfr_t}
+(or equivalently @code{mpfr_ptr}).
+It begins from @var{x}. It ends when it encounters a null pointer (whose
+type must also be @code{mpfr_ptr}).
@end deftypefun
@@ -2265,15 +2267,19 @@ Initialize all the @code{mpfr_t} variables of the given @code{va_list},
set their precision to be @strong{exactly}
@var{prec} bits and their value to NaN.
See @code{mpfr_init2} for more details.
-The @code{va_list} is assumed to be composed only of type @code{mpfr_t}.
-It begins from @var{x}. It ends when it encounters a null pointer.
+The @code{va_list} is assumed to be composed only of type @code{mpfr_t}
+(or equivalently @code{mpfr_ptr}).
+It begins from @var{x}. It ends when it encounters a null pointer (whose
+type must also be @code{mpfr_ptr}).
@end deftypefun
@deftypefun void mpfr_clears (mpfr_t @var{x}, ...)
Free the space occupied by all the @code{mpfr_t} variables of the given
@code{va_list}. See @code{mpfr_clear} for more details.
-The @code{va_list} is assumed to be composed only of type @code{mpfr_t}.
-It begins from @var{x}. It ends when it encounters a null pointer.
+The @code{va_list} is assumed to be composed only of type @code{mpfr_t}
+(or equivalently @code{mpfr_ptr}).
+It begins from @var{x}. It ends when it encounters a null pointer (whose
+type must also be @code{mpfr_ptr}).
@end deftypefun
Here is an example of how to use multiple initialization functions:
@@ -2281,9 +2287,9 @@ Here is an example of how to use multiple initialization functions:
@example
@{
mpfr_t x, y, z, t;
- mpfr_inits2 (256, x, y, z, t, (void *) 0);
+ mpfr_inits2 (256, x, y, z, t, (mpfr_ptr) 0);
@dots{}
- mpfr_clears (x, y, z, t, (void *) 0);
+ mpfr_clears (x, y, z, t, (mpfr_ptr) 0);
@}
@end example
diff --git a/mul.c b/mul.c
index 3b4b74060..3655753ae 100644
--- a/mul.c
+++ b/mul.c
@@ -191,7 +191,7 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
MPFR_ASSERTN(0);
}
- mpfr_clears (ta, tb, tc, (void *) 0);
+ mpfr_clears (ta, tb, tc, (mpfr_ptr) 0);
return inexact1;
}
diff --git a/pow.c b/pow.c
index e47d83d44..53c33bd45 100644
--- a/pow.c
+++ b/pow.c
@@ -579,7 +579,7 @@ mpfr_pow (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode)
inexact = inex2;
MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
}
- mpfr_clears (u, k, (void *) 0);
+ mpfr_clears (u, k, (mpfr_ptr) 0);
}
mpfr_clear (t);
}
diff --git a/sub1sp.c b/sub1sp.c
index 19bd3edbf..aae88b770 100644
--- a/sub1sp.c
+++ b/sub1sp.c
@@ -64,7 +64,7 @@ int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
inexact, inexact2);
MPFR_ASSERTN (0);
}
- mpfr_clears (tmpa, tmpb, tmpc, (void *) 0);
+ mpfr_clears (tmpa, tmpb, tmpc, (mpfr_ptr) 0);
return inexact;
}
# define mpfr_sub1sp mpfr_sub1sp2
diff --git a/tests/tabs.c b/tests/tabs.c
index ff95d78be..b55685176 100644
--- a/tests/tabs.c
+++ b/tests/tabs.c
@@ -83,7 +83,7 @@ check_cmp(int argc, char *argv[])
mpfr_t x, y;
int n, k, rnd;
- mpfr_inits2 (53, x, y, (void *) 0);
+ mpfr_inits2 (53, x, y, (mpfr_ptr) 0);
mpfr_set_ui(x, 1, GMP_RNDN);
(mpfr_abs) (x, x, GMP_RNDN);
@@ -152,7 +152,7 @@ check_cmp(int argc, char *argv[])
}
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
int
diff --git a/tests/tacosh.c b/tests/tacosh.c
index d2dc6ba8e..641b5f015 100644
--- a/tests/tacosh.c
+++ b/tests/tacosh.c
@@ -171,7 +171,7 @@ bug20070831 (void)
}
MPFR_ASSERTN (inex < 0);
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
static void
@@ -181,7 +181,7 @@ huge (void)
int inex;
/* TODO: extend the exponent range and use mpfr_get_emax (). */
- mpfr_inits2 (32, x, y, z, (void *) 0);
+ mpfr_inits2 (32, x, y, z, (mpfr_ptr) 0);
mpfr_set_ui_2exp (x, 1, 1073741822, GMP_RNDN);
inex = mpfr_acosh (y, x, GMP_RNDN);
mpfr_set_str_binary (z, "0.10110001011100100001011111110101E30");
@@ -195,7 +195,7 @@ huge (void)
}
MPFR_ASSERTN (inex < 0);
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
int
diff --git a/tests/tadd.c b/tests/tadd.c
index 6a1bbf348..4d5e06d71 100644
--- a/tests/tadd.c
+++ b/tests/tadd.c
@@ -99,7 +99,7 @@ pcheck (const char *xs, const char *ys, const char *zs, mp_rnd_t rnd_mode,
xs, ys, mpfr_print_rnd_mode (rnd_mode));
exit (1);
}
- mpfr_clears (xx, yy, zz, (void *) 0);
+ mpfr_clears (xx, yy, zz, (mpfr_ptr) 0);
}
static void
diff --git a/tests/tadd1sp.c b/tests/tadd1sp.c
index 46166c0a9..5ca46250c 100644
--- a/tests/tadd1sp.c
+++ b/tests/tadd1sp.c
@@ -40,7 +40,7 @@ check_overflow (void)
set_emin (-1021);
set_emax (1024);
- mpfr_inits (x, y, z1, z2, (void *) 0);
+ mpfr_inits (x, y, z1, z2, (mpfr_ptr) 0);
mpfr_set_str1 (x, "8.00468257869324898448e+307");
mpfr_set_str1 (y, "7.44784712422708645156e+307");
@@ -51,7 +51,7 @@ check_overflow (void)
printf ("Overflow bug in add1sp.\n");
exit (1);
}
- mpfr_clears (x, y, z1, z2, (void *) 0);
+ mpfr_clears (x, y, z1, z2, (mpfr_ptr) 0);
set_emin (emin);
set_emax (emax);
@@ -110,7 +110,7 @@ void check_random(mp_prec_t p)
int r;
int i, inexact1, inexact2;
- mpfr_inits2 (p, a1, b, c, a2, (void *) 0);
+ mpfr_inits2 (p, a1, b, c, a2, (mpfr_ptr) 0);
for (i = 0 ; i < 500 ; i++)
{
@@ -133,7 +133,7 @@ void check_random(mp_prec_t p)
}
}
- mpfr_clears (a1, a2, b, c, (void *) 0);
+ mpfr_clears (a1, a2, b, c, (mpfr_ptr) 0);
}
void check_special(void)
@@ -143,7 +143,7 @@ void check_special(void)
mpfr_prec_t p;
int i = -1, inexact1, inexact2;
- mpfr_inits (a1, a2, b, c, (void *) 0);
+ mpfr_inits (a1, a2, b, c, (mpfr_ptr) 0);
for (r = 0 ; r < GMP_RND_MAX ; r++)
{
@@ -179,5 +179,5 @@ void check_special(void)
exit (1);
}
- mpfr_clears (a1, a2, b, c, (void *) 0);
+ mpfr_clears (a1, a2, b, c, (mpfr_ptr) 0);
}
diff --git a/tests/tadd_ui.c b/tests/tadd_ui.c
index 84bc0b90e..22363c241 100644
--- a/tests/tadd_ui.c
+++ b/tests/tadd_ui.c
@@ -32,7 +32,7 @@ check3 (const char *xs, unsigned long y, mp_rnd_t rnd_mode, const char *zs)
{
mpfr_t xx, zz;
- mpfr_inits2 (53, xx, zz, (void *) 0);
+ mpfr_inits2 (53, xx, zz, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs);
mpfr_add_ui (zz, xx, y, rnd_mode);
if (mpfr_cmp_str1(zz, zs) )
@@ -43,7 +43,7 @@ check3 (const char *xs, unsigned long y, mp_rnd_t rnd_mode, const char *zs)
xs, y, mpfr_print_rnd_mode(rnd_mode));
exit (1);
}
- mpfr_clears (xx, zz, (void *) 0);
+ mpfr_clears (xx, zz, (mpfr_ptr) 0);
}
static void
diff --git a/tests/tagm.c b/tests/tagm.c
index a9be87886..975fffd07 100644
--- a/tests/tagm.c
+++ b/tests/tagm.c
@@ -32,7 +32,7 @@ check4 (const char *as, const char *bs, mp_rnd_t rnd_mode, const char *res)
{
mpfr_t ta, tb, tres;
- mpfr_inits2 (53, ta, tb, tres, (void *) 0);
+ mpfr_inits2 (53, ta, tb, tres, (mpfr_ptr) 0);
mpfr_set_str1 (ta, as);
mpfr_set_str1 (tb, bs);
@@ -47,7 +47,7 @@ check4 (const char *as, const char *bs, mp_rnd_t rnd_mode, const char *res)
putchar('\n');
exit (1);
}
- mpfr_clears (ta, tb, tres, (void *) 0);
+ mpfr_clears (ta, tb, tres, (mpfr_ptr) 0);
}
static void
diff --git a/tests/tatan.c b/tests/tatan.c
index 64700e6f4..58cc41e08 100644
--- a/tests/tatan.c
+++ b/tests/tatan.c
@@ -248,7 +248,7 @@ special_atan2 (void)
{
mpfr_t x, y, z;
- mpfr_inits2 (4, x, y, z, (void *) 0);
+ mpfr_inits2 (4, x, y, z, (mpfr_ptr) 0);
/* Anything with NAN should be set to NAN */
mpfr_set_ui (y, 0, GMP_RNDN);
@@ -349,7 +349,7 @@ special_atan2 (void)
mpfr_atan2 (z, y, x, GMP_RNDN);
MPFR_ASSERTN (mpfr_cmp_str (z, "-2.356194490192344928", 10, GMP_RNDN) == 0);
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
/* from Christopher Creutzig, 18 Jul 2007 */
@@ -359,7 +359,7 @@ smallvals_atan2 (void)
mpfr_t a, x, y;
mp_exp_t old_emin;
- mpfr_inits (a, x, y, (void *) 0);
+ mpfr_inits (a, x, y, (mpfr_ptr) 0);
mpfr_set_ui (y, 0, GMP_RNDN);
mpfr_nextbelow (y);
mpfr_set_ui (x, 1, GMP_RNDN);
@@ -402,7 +402,7 @@ smallvals_atan2 (void)
mpfr_set_emin (old_emin);
- mpfr_clears (a, x, y, (void *) 0);
+ mpfr_clears (a, x, y, (mpfr_ptr) 0);
}
/* Bug found by Robert Bajema (regression in MPFR 2.3.0).
@@ -412,7 +412,7 @@ atan2_bug_20071003 (void)
{
mpfr_t a, x, y, z;
- mpfr_inits (a, x, y, z, (void *) 0);
+ mpfr_inits (a, x, y, z, (mpfr_ptr) 0);
mpfr_set_underflow ();
mpfr_set_str_binary (y,
@@ -436,7 +436,7 @@ atan2_bug_20071003 (void)
exit (1);
}
- mpfr_clears (a, x, y, z, (void *) 0);
+ mpfr_clears (a, x, y, z, (mpfr_ptr) 0);
}
int
diff --git a/tests/tcomparisons.c b/tests/tcomparisons.c
index 23e30059f..784f55c98 100644
--- a/tests/tcomparisons.c
+++ b/tests/tcomparisons.c
@@ -33,7 +33,7 @@ cmp_tests (void)
mpfr_t x, y;
long i;
- mpfr_inits (x, y, (void *) 0);
+ mpfr_inits (x, y, (mpfr_ptr) 0);
for (i = 0; i < 80000; i++)
{
mp_prec_t precx, precy;
@@ -85,7 +85,7 @@ cmp_tests (void)
exit (1);
}
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
static void
@@ -94,7 +94,7 @@ eq_tests (void)
mpfr_t x, y;
long i;
- mpfr_inits (x, y, (void *) 0);
+ mpfr_inits (x, y, (mpfr_ptr) 0);
for (i = 0; i < 20000; i++)
{
mp_prec_t precx;
@@ -117,7 +117,7 @@ eq_tests (void)
exit (1);
}
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
int
diff --git a/tests/tconst_log2.c b/tests/tconst_log2.c
index 061fabcf1..5b39028ca 100644
--- a/tests/tconst_log2.c
+++ b/tests/tconst_log2.c
@@ -86,7 +86,7 @@ check_large (void)
mpfr_set_prec (x, 26249);
mpfr_const_log2 (x, GMP_RNDZ);
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
static void
diff --git a/tests/tconst_pi.c b/tests/tconst_pi.c
index 1d9befc4c..1082ef0be 100644
--- a/tests/tconst_pi.c
+++ b/tests/tconst_pi.c
@@ -57,7 +57,7 @@ check_large (void)
mpfr_const_pi (x, GMP_RNDZ);
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
int
diff --git a/tests/tcos.c b/tests/tcos.c
index 2993f1271..1bece6dc3 100644
--- a/tests/tcos.c
+++ b/tests/tcos.c
@@ -53,7 +53,7 @@ check53 (const char *xs, const char *cos_xs, mp_rnd_t rnd_mode)
{
mpfr_t xx, c;
- mpfr_inits2 (53, xx, c, (void *) 0);
+ mpfr_inits2 (53, xx, c, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs); /* should be exact */
test_cos (c, xx, rnd_mode);
if (mpfr_cmp_str1 (c, cos_xs))
@@ -65,7 +65,7 @@ check53 (const char *xs, const char *cos_xs, mp_rnd_t rnd_mode)
printf(", expected %s\n", cos_xs);
exit (1);
}
- mpfr_clears (xx, c, (void *) 0);
+ mpfr_clears (xx, c, (mpfr_ptr) 0);
}
#define TEST_FUNCTION test_cos
diff --git a/tests/tcot.c b/tests/tcot.c
index 3d05960f3..7720cbdc5 100644
--- a/tests/tcot.c
+++ b/tests/tcot.c
@@ -97,7 +97,7 @@ two2emin (mp_exp_t e)
exit (1);
}
- mpfr_inits2 (53, x, y, (void *) 0);
+ mpfr_inits2 (53, x, y, (mpfr_ptr) 0);
for (i = -4; i <= 4; i++)
RND_LOOP (rnd)
{
@@ -121,7 +121,7 @@ two2emin (mp_exp_t e)
exit (1);
}
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
mpfr_set_emin (old_emin);
mpfr_set_emax (old_emax);
diff --git a/tests/tdiv.c b/tests/tdiv.c
index 7d8b44817..05437d16f 100644
--- a/tests/tdiv.c
+++ b/tests/tdiv.c
@@ -70,7 +70,7 @@ check4 (const char *Ns, const char *Ds, mp_rnd_t rnd_mode, int p,
{
mpfr_t q, n, d;
- mpfr_inits2 (p, q, n, d, (void *) 0);
+ mpfr_inits2 (p, q, n, d, (mpfr_ptr) 0);
mpfr_set_str1 (n, Ns);
mpfr_set_str1 (d, Ds);
test_div(q, n, d, rnd_mode);
@@ -84,7 +84,7 @@ check4 (const char *Ns, const char *Ds, mp_rnd_t rnd_mode, int p,
putchar('\n');
exit (1);
}
- mpfr_clears (q, n, d, (void *) 0);
+ mpfr_clears (q, n, d, (mpfr_ptr) 0);
}
static void
@@ -92,7 +92,7 @@ check24 (const char *Ns, const char *Ds, mp_rnd_t rnd_mode, const char *Qs)
{
mpfr_t q, n, d;
- mpfr_inits2 (24, q, n, d, (void *) 0);
+ mpfr_inits2 (24, q, n, d, (mpfr_ptr) 0);
mpfr_set_str1 (n, Ns);
mpfr_set_str1 (d, Ds);
@@ -105,7 +105,7 @@ check24 (const char *Ns, const char *Ds, mp_rnd_t rnd_mode, const char *Qs)
mpfr_out_str(stdout,10,0,q, GMP_RNDN); putchar('\n');
exit (1);
}
- mpfr_clears (q, n, d, (void *) 0);
+ mpfr_clears (q, n, d, (mpfr_ptr) 0);
}
/* the following examples come from the paper "Number-theoretic Test
@@ -195,7 +195,7 @@ check_64(void)
{
mpfr_t x,y,z;
- mpfr_inits2 (64, x, y, z, (void *) 0);
+ mpfr_inits2 (64, x, y, z, (mpfr_ptr) 0);
mpfr_set_str_binary(x, "1.00100100110110101001010010101111000001011100100101010000000000E54");
mpfr_set_str_binary(y, "1.00000000000000000000000000000000000000000000000000000000000000E584");
@@ -212,7 +212,7 @@ check_64(void)
exit(1);
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
static void
@@ -736,7 +736,7 @@ consistency (void)
mpfr_t x, y, z1, z2;
int i;
- mpfr_inits (x, y, z1, z2, (void *) 0);
+ mpfr_inits (x, y, z1, z2, (mpfr_ptr) 0);
for (i = 0; i < 10000; i++)
{
@@ -774,7 +774,7 @@ consistency (void)
}
}
- mpfr_clears (x, y, z1, z2, (void *) 0);
+ mpfr_clears (x, y, z1, z2, (mpfr_ptr) 0);
}
/* Reported by Carl Witty on 2007-06-03 */
@@ -840,7 +840,7 @@ test_20070628 (void)
exit (1);
}
- mpfr_inits2 (53, x, y, (void *) 0);
+ mpfr_inits2 (53, x, y, (mpfr_ptr) 0);
mpfr_set_si (x, -1, GMP_RNDN);
mpfr_set_si_2exp (y, 1, -256, GMP_RNDN);
mpfr_clear_flags ();
@@ -861,7 +861,7 @@ test_20070628 (void)
printf ("Error in test_20070628: overflow flag is not set\n");
err++;
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
mpfr_set_emax (old_emax);
}
diff --git a/tests/terf.c b/tests/terf.c
index a5f50c2bb..d5ccb10ee 100644
--- a/tests/terf.c
+++ b/tests/terf.c
@@ -364,7 +364,7 @@ special_erfc (void)
{
mpfr_t x, y;
- mpfr_inits (x, y, (void *) 0);
+ mpfr_inits (x, y, (mpfr_ptr) 0);
/* erfc (NaN) = NaN */
mpfr_set_nan (x);
@@ -405,7 +405,7 @@ special_erfc (void)
exit (1);
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
static void
@@ -520,7 +520,7 @@ test_erfc (void)
mpfr_t x, y, z;
int inex;
- mpfr_inits2 (40, x, y, z, (void *) 0);
+ mpfr_inits2 (40, x, y, z, (mpfr_ptr) 0);
mpfr_set_si_2exp (x, -1, -10, GMP_RNDN);
mpfr_set_str_binary (z, "0.1000000000100100000110111010110111100000E1");
@@ -542,7 +542,7 @@ test_erfc (void)
inex = mpfr_erfc (x, x, GMP_RNDN);
MPFR_ASSERTN(inex > 0 && mpfr_cmp_ui (x, 2) == 0);
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
int
diff --git a/tests/texp.c b/tests/texp.c
index f46534bcd..775619227 100644
--- a/tests/texp.c
+++ b/tests/texp.c
@@ -54,7 +54,7 @@ check3 (const char *op, mp_rnd_t rnd, const char *res)
{
mpfr_t x, y;
- mpfr_inits2 (53, x, y, (void *) 0);
+ mpfr_inits2 (53, x, y, (mpfr_ptr) 0);
/* y negative. If we forget to set the sign in mpfr_exp, we'll see it. */
mpfr_set_si (y, -1, GMP_RNDN);
mpfr_set_str1 (x, op);
@@ -68,7 +68,7 @@ check3 (const char *op, mp_rnd_t rnd, const char *res)
putchar('\n');
exit (1);
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
/* expx is the value of exp(X) rounded towards -infinity */
@@ -77,7 +77,7 @@ check_worst_case (const char *Xs, const char *expxs)
{
mpfr_t x, y;
- mpfr_inits2 (53, x, y, (void *) 0);
+ mpfr_inits2 (53, x, y, (mpfr_ptr) 0);
mpfr_set_str1(x, Xs);
test_exp(y, x, GMP_RNDD);
if (mpfr_cmp_str1 (y, expxs))
@@ -93,7 +93,7 @@ check_worst_case (const char *Xs, const char *expxs)
printf ("exp(x) rounded towards +infinity is wrong\n");
exit(1);
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
/* worst cases communicated by Jean-Michel Muller and Vincent Lefevre */
diff --git a/tests/tfma.c b/tests/tfma.c
index f343887fb..9df041405 100644
--- a/tests/tfma.c
+++ b/tests/tfma.c
@@ -36,7 +36,7 @@ test_exact (void)
int rnd;
mpfr_t a, b, c, r1, r2;
- mpfr_inits2 (8, a, b, c, r1, r2, (void *) 0);
+ mpfr_inits2 (8, a, b, c, r1, r2, (mpfr_ptr) 0);
for (i = 0; i < sv; i++)
for (j = 0; j < sv; j++)
@@ -78,7 +78,7 @@ test_exact (void)
}
}
- mpfr_clears (a, b, c, r1, r2, (void *) 0);
+ mpfr_clears (a, b, c, r1, r2, (mpfr_ptr) 0);
}
static void
@@ -87,7 +87,7 @@ test_overflow1 (void)
mpfr_t x, y, z, r;
int inex;
- mpfr_inits2 (8, x, y, z, r, (void *) 0);
+ mpfr_inits2 (8, x, y, z, r, (mpfr_ptr) 0);
MPFR_SET_POS (x);
mpfr_setmax (x, mpfr_get_emax ()); /* x = 2^emax - ulp */
mpfr_set_ui (y, 2, GMP_RNDN); /* y = 2 */
@@ -110,7 +110,7 @@ test_overflow1 (void)
printf ("Error in test_overflow1: overflow flag set\n");
exit (1);
}
- mpfr_clears (x, y, z, r, (void *) 0);
+ mpfr_clears (x, y, z, r, (mpfr_ptr) 0);
}
static void
@@ -119,7 +119,7 @@ test_overflow2 (void)
mpfr_t x, y, z, r;
int i, inex, rnd, err = 0;
- mpfr_inits2 (8, x, y, z, r, (void *) 0);
+ mpfr_inits2 (8, x, y, z, r, (mpfr_ptr) 0);
MPFR_SET_POS (x);
mpfr_setmin (x, mpfr_get_emax ()); /* x = 0.1@emax */
@@ -191,7 +191,7 @@ test_overflow2 (void)
if (err)
exit (1);
- mpfr_clears (x, y, z, r, (void *) 0);
+ mpfr_clears (x, y, z, r, (mpfr_ptr) 0);
}
static void
@@ -200,7 +200,7 @@ test_underflow1 (void)
mpfr_t x, y, z, r;
int inex, signy, signz, rnd, err = 0;
- mpfr_inits2 (8, x, y, z, r, (void *) 0);
+ mpfr_inits2 (8, x, y, z, r, (mpfr_ptr) 0);
MPFR_SET_POS (x);
mpfr_setmin (x, mpfr_get_emin ()); /* x = 0.1@emin */
@@ -275,7 +275,7 @@ test_underflow1 (void)
if (err)
exit (1);
- mpfr_clears (x, y, z, r, (void *) 0);
+ mpfr_clears (x, y, z, r, (mpfr_ptr) 0);
}
static void
@@ -284,7 +284,7 @@ test_underflow2 (void)
mpfr_t x, y, z, r;
int b, i, inex, same, err = 0;
- mpfr_inits2 (32, x, y, z, r, (void *) 0);
+ mpfr_inits2 (32, x, y, z, r, (mpfr_ptr) 0);
mpfr_set_si_2exp (z, 1, mpfr_get_emin (), GMP_RNDN); /* z = 2^emin */
mpfr_set_si_2exp (x, 1, mpfr_get_emin (), GMP_RNDN); /* x = 2^emin */
@@ -332,7 +332,7 @@ test_underflow2 (void)
if (err)
exit (1);
- mpfr_clears (x, y, z, r, (void *) 0);
+ mpfr_clears (x, y, z, r, (mpfr_ptr) 0);
}
int
diff --git a/tests/tfms.c b/tests/tfms.c
index 523fce8a9..631143fd9 100644
--- a/tests/tfms.c
+++ b/tests/tfms.c
@@ -36,7 +36,7 @@ test_exact (void)
int rnd;
mpfr_t a, b, c, r1, r2;
- mpfr_inits2 (8, a, b, c, r1, r2, (void *) 0);
+ mpfr_inits2 (8, a, b, c, r1, r2, (mpfr_ptr) 0);
for (i = 0; i < sv; i++)
for (j = 0; j < sv; j++)
@@ -78,7 +78,7 @@ test_exact (void)
}
}
- mpfr_clears (a, b, c, r1, r2, (void *) 0);
+ mpfr_clears (a, b, c, r1, r2, (mpfr_ptr) 0);
}
static void
@@ -87,7 +87,7 @@ test_overflow1 (void)
mpfr_t x, y, z, r;
int inex;
- mpfr_inits2 (8, x, y, z, r, (void *) 0);
+ mpfr_inits2 (8, x, y, z, r, (mpfr_ptr) 0);
MPFR_SET_POS (x);
mpfr_setmax (x, mpfr_get_emax ()); /* x = 2^emax - ulp */
mpfr_set_ui (y, 2, GMP_RNDN); /* y = 2 */
@@ -110,7 +110,7 @@ test_overflow1 (void)
printf ("Error in test_overflow1: overflow flag set\n");
exit (1);
}
- mpfr_clears (x, y, z, r, (void *) 0);
+ mpfr_clears (x, y, z, r, (mpfr_ptr) 0);
}
static void
@@ -119,7 +119,7 @@ test_overflow2 (void)
mpfr_t x, y, z, r;
int i, inex, rnd, err = 0;
- mpfr_inits2 (8, x, y, z, r, (void *) 0);
+ mpfr_inits2 (8, x, y, z, r, (mpfr_ptr) 0);
MPFR_SET_POS (x);
mpfr_setmin (x, mpfr_get_emax ()); /* x = 0.1@emax */
@@ -191,7 +191,7 @@ test_overflow2 (void)
if (err)
exit (1);
- mpfr_clears (x, y, z, r, (void *) 0);
+ mpfr_clears (x, y, z, r, (mpfr_ptr) 0);
}
static void
@@ -200,7 +200,7 @@ test_underflow1 (void)
mpfr_t x, y, z, r;
int inex, signy, signz, rnd, err = 0;
- mpfr_inits2 (8, x, y, z, r, (void *) 0);
+ mpfr_inits2 (8, x, y, z, r, (mpfr_ptr) 0);
MPFR_SET_POS (x);
mpfr_setmin (x, mpfr_get_emin ()); /* x = 0.1@emin */
@@ -276,7 +276,7 @@ test_underflow1 (void)
if (err)
exit (1);
- mpfr_clears (x, y, z, r, (void *) 0);
+ mpfr_clears (x, y, z, r, (mpfr_ptr) 0);
}
static void
@@ -285,7 +285,7 @@ test_underflow2 (void)
mpfr_t x, y, z, r;
int b, i, inex, same, err = 0;
- mpfr_inits2 (32, x, y, z, r, (void *) 0);
+ mpfr_inits2 (32, x, y, z, r, (mpfr_ptr) 0);
mpfr_set_si_2exp (z, -1, mpfr_get_emin (), GMP_RNDN); /* z = -2^emin */
mpfr_set_si_2exp (x, 1, mpfr_get_emin (), GMP_RNDN); /* x = 2^emin */
@@ -333,7 +333,7 @@ test_underflow2 (void)
if (err)
exit (1);
- mpfr_clears (x, y, z, r, (void *) 0);
+ mpfr_clears (x, y, z, r, (mpfr_ptr) 0);
}
int
diff --git a/tests/tget_str.c b/tests/tget_str.c
index 56ded0d6f..009c63fea 100644
--- a/tests/tget_str.c
+++ b/tests/tget_str.c
@@ -1051,7 +1051,7 @@ check_bug_base2k (void)
exit (1);
}
mpfr_free_str (s);
- mpfr_clears (xx, yy, zz, (void *) 0);
+ mpfr_clears (xx, yy, zz, (mpfr_ptr) 0);
}
static void
diff --git a/tests/tgmpop.c b/tests/tgmpop.c
index 6b3b8b987..8e97ad07c 100644
--- a/tests/tgmpop.c
+++ b/tests/tgmpop.c
@@ -323,7 +323,7 @@ test_specialz (int (*mpfr_func)(mpfr_ptr, mpfr_srcptr, mpz_srcptr, mp_rnd_t),
mpz_t z1, z2;
int res;
- mpfr_inits2 (128, x1, x2, (void *) 0);
+ mpfr_inits2 (128, x1, x2, (mpfr_ptr) 0);
mpz_init (z1); mpz_init(z2);
mpz_fac_ui (z1, 19); /* 19!+1 fits perfectly in a 128 bits mantissa */
mpz_add_ui (z1, z1, 1);
@@ -386,7 +386,7 @@ test_specialz (int (*mpfr_func)(mpfr_ptr, mpfr_srcptr, mpz_srcptr, mp_rnd_t),
}
mpz_clear (z1); mpz_clear(z2);
- mpfr_clears (x1, x2, (void *) 0);
+ mpfr_clears (x1, x2, (mpfr_ptr) 0);
}
static void
@@ -401,7 +401,7 @@ test_genericz (mp_prec_t p0, mp_prec_t p1, unsigned int N,
int inexact, compare, compare2;
unsigned int n;
- mpfr_inits (arg1, dst_big, dst_small, tmp, (void *) 0);
+ mpfr_inits (arg1, dst_big, dst_small, tmp, (mpfr_ptr) 0);
mpz_init (arg2);
for (prec = p0; prec <= p1; prec++)
@@ -463,7 +463,7 @@ test_genericz (mp_prec_t p0, mp_prec_t p1, unsigned int N,
}
mpz_clear (arg2);
- mpfr_clears (arg1, dst_big, dst_small, tmp, (void *) 0);
+ mpfr_clears (arg1, dst_big, dst_small, tmp, (mpfr_ptr) 0);
}
static void
@@ -478,7 +478,7 @@ test_genericq (mp_prec_t p0, mp_prec_t p1, unsigned int N,
int inexact, compare, compare2;
unsigned int n;
- mpfr_inits (arg1, dst_big, dst_small, tmp, (void *) 0);
+ mpfr_inits (arg1, dst_big, dst_small, tmp, (mpfr_ptr) 0);
mpq_init (arg2);
for (prec = p0; prec <= p1; prec++)
@@ -543,7 +543,7 @@ test_genericq (mp_prec_t p0, mp_prec_t p1, unsigned int N,
}
mpq_clear (arg2);
- mpfr_clears (arg1, dst_big, dst_small, tmp, (void *) 0);
+ mpfr_clears (arg1, dst_big, dst_small, tmp, (mpfr_ptr) 0);
}
static void
@@ -559,7 +559,7 @@ test_specialq (mp_prec_t p0, mp_prec_t p1, unsigned int N,
for (prec = p0 ; prec < p1 ; prec++)
{
- mpfr_inits2 (prec, fra, frb, frq, (void *) 0);
+ mpfr_inits2 (prec, fra, frb, frq, (mpfr_ptr) 0);
mpq_init (q1); mpq_init(q2); mpq_init (qr);
for( n = 0 ; n < N ; n++)
@@ -589,7 +589,7 @@ test_specialq (mp_prec_t p0, mp_prec_t p1, unsigned int N,
}
mpq_clear (q1); mpq_clear (q2); mpq_clear (qr);
- mpfr_clears (fra, frb, frq, (void *) 0);
+ mpfr_clears (fra, frb, frq, (mpfr_ptr) 0);
}
}
diff --git a/tests/tinternals.c b/tests/tinternals.c
index e0a978237..b040b2b16 100644
--- a/tests/tinternals.c
+++ b/tests/tinternals.c
@@ -47,7 +47,7 @@ test_round_near_x (void)
int failures = 0, mx, neg, err, dir, r, inex, inex2;
char buffer[7], *p;
- mpfr_inits (x, y, z, eps, (void *) 0);
+ mpfr_inits (x, y, z, eps, (mpfr_ptr) 0);
mpfr_set_prec (x, 5);
mpfr_set_prec (y, 3);
mpfr_set_prec (z, 3);
@@ -111,7 +111,7 @@ test_round_near_x (void)
if (failures)
exit (1);
- mpfr_clears (x, y, z, eps, (void *) 0);
+ mpfr_clears (x, y, z, eps, (mpfr_ptr) 0);
}
int
diff --git a/tests/tlog.c b/tests/tlog.c
index 81f705144..449706b43 100644
--- a/tests/tlog.c
+++ b/tests/tlog.c
@@ -53,7 +53,7 @@ check2 (const char *as, mp_rnd_t rnd_mode, const char *res1s)
{
mpfr_t ta, tres;
- mpfr_inits2 (53, ta, tres, (void *) 0);
+ mpfr_inits2 (53, ta, tres, (mpfr_ptr) 0);
mpfr_set_str1 (ta, as);
test_log (tres, ta, rnd_mode);
@@ -66,7 +66,7 @@ check2 (const char *as, mp_rnd_t rnd_mode, const char *res1s)
mpfr_out_str(stdout, 10, 0, tres, GMP_RNDN);
exit (1);
}
- mpfr_clears (ta, tres, (void *) 0);
+ mpfr_clears (ta, tres, (mpfr_ptr) 0);
}
static void
@@ -265,7 +265,7 @@ x_near_one (void)
mpfr_dump (y);
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
#define TEST_FUNCTION test_log
diff --git a/tests/tmul.c b/tests/tmul.c
index 1debafaef..d1013c664 100644
--- a/tests/tmul.c
+++ b/tests/tmul.c
@@ -93,7 +93,7 @@ check53 (const char *xs, const char *ys, mp_rnd_t rnd_mode, const char *zs)
{
mpfr_t xx, yy, zz;
- mpfr_inits2 (53, xx, yy, zz, (void *) 0);
+ mpfr_inits2 (53, xx, yy, zz, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs);
mpfr_set_str1 (yy, ys);
test_mul (zz, xx, yy, rnd_mode);
@@ -116,7 +116,7 @@ check53 (const char *xs, const char *ys, mp_rnd_t rnd_mode, const char *zs)
putchar('\n'); */
exit (1);
}
- mpfr_clears (xx, yy, zz, (void *) 0);
+ mpfr_clears (xx, yy, zz, (mpfr_ptr) 0);
}
/* checks that x*y gives the right result with 24 bits of precision */
@@ -125,7 +125,7 @@ check24 (const char *xs, const char *ys, mp_rnd_t rnd_mode, const char *zs)
{
mpfr_t xx, yy, zz;
- mpfr_inits2 (24, xx, yy, zz, (void *) 0);
+ mpfr_inits2 (24, xx, yy, zz, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs);
mpfr_set_str1 (yy, ys);
test_mul (zz, xx, yy, rnd_mode);
@@ -138,7 +138,7 @@ check24 (const char *xs, const char *ys, mp_rnd_t rnd_mode, const char *zs)
putchar('\n');
exit (1);
}
- mpfr_clears (xx, yy, zz, (void *) 0);
+ mpfr_clears (xx, yy, zz, (mpfr_ptr) 0);
}
/* the following examples come from the paper "Number-theoretic Test
@@ -447,7 +447,7 @@ check_regression (void)
mpfr_t x, y, z;
int i;
- mpfr_inits2 (6177, x, y, z, (void *) 0);
+ mpfr_inits2 (6177, x, y, z, (mpfr_ptr) 0);
mpfr_set_str (y,
"5.17cc1b727220a94fe13abe8fa9a6ee06db14acc9e21c820ff28b1d5ef5de2b0db92371d212"
@@ -633,7 +633,7 @@ check_regression (void)
exit (1);
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
#define TEST_FUNCTION test_mul
diff --git a/tests/tmul_2exp.c b/tests/tmul_2exp.c
index 32d0d2957..4dcca9455 100644
--- a/tests/tmul_2exp.c
+++ b/tests/tmul_2exp.c
@@ -54,7 +54,7 @@ main (int argc, char *argv[])
tests_start_mpfr ();
- mpfr_inits2 (53, w, z, (void *) 0);
+ mpfr_inits2 (53, w, z, (mpfr_ptr) 0);
for (i = 0; i < 3; i++)
{
@@ -132,7 +132,7 @@ main (int argc, char *argv[])
}
}
- mpfr_clears (w, z, (void *) 0);
+ mpfr_clears (w, z, (mpfr_ptr) 0);
tests_end_mpfr ();
return 0;
diff --git a/tests/tnext.c b/tests/tnext.c
index 344c3dbf7..1ec3ddfba 100644
--- a/tests/tnext.c
+++ b/tests/tnext.c
@@ -38,7 +38,7 @@ generic_abovebelow (void)
int neg, below;
prec = (randlimb () % 300) + MPFR_PREC_MIN;
- mpfr_inits2 (prec, x, y, z, (void *) 0);
+ mpfr_inits2 (prec, x, y, z, (mpfr_ptr) 0);
mpfr_init2 (t, 3);
/* special tests (executed once is enough) */
@@ -88,7 +88,7 @@ generic_abovebelow (void)
printf ("\n");
exit (1);
}
- mpfr_clears (x, y, z, t, (void *) 0);
+ mpfr_clears (x, y, z, t, (mpfr_ptr) 0);
}
}
@@ -107,7 +107,7 @@ inverse_test (void)
mpfr_t x, y;
int sign;
- mpfr_inits2 (prec, x, y, (void *) 0);
+ mpfr_inits2 (prec, x, y, (mpfr_ptr) 0);
mpfr_set_str (x, tests[i], 10, GMP_RNDN);
if (neg)
mpfr_neg (x, x, GMP_RNDN);
@@ -153,7 +153,7 @@ inverse_test (void)
printf ("\n");
exit (1);
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
}
diff --git a/tests/tpow.c b/tests/tpow.c
index 4d43e2c38..470f21cf6 100644
--- a/tests/tpow.c
+++ b/tests/tpow.c
@@ -385,7 +385,7 @@ pow_si_long_min (void)
mpfr_t x, y, z;
int inex;
- mpfr_inits2 (sizeof(long) * CHAR_BIT + 32, x, y, z, (void *) 0);
+ mpfr_inits2 (sizeof(long) * CHAR_BIT + 32, x, y, z, (mpfr_ptr) 0);
mpfr_set_si_2exp (x, 3, -1, GMP_RNDN); /* 1.5 */
inex = mpfr_set_si (y, LONG_MIN, GMP_RNDN);
@@ -405,7 +405,7 @@ pow_si_long_min (void)
exit (1);
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
static void
@@ -898,7 +898,7 @@ underflows (void)
}
mpfr_set_emin (emin);
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
static void
@@ -939,7 +939,7 @@ overflows2 (void)
emax = mpfr_get_emax ();
set_emin (-128);
- mpfr_inits2 (16, x, y, z, (void *) 0);
+ mpfr_inits2 (16, x, y, z, (mpfr_ptr) 0);
mpfr_set_si_2exp (x, 1, -64, GMP_RNDN); /* 2^(-64) */
mpfr_set_si_2exp (y, -1, -1, GMP_RNDN); /* -0.5 */
@@ -962,7 +962,7 @@ overflows2 (void)
}
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
set_emin (emin);
set_emax (emax);
@@ -985,7 +985,7 @@ overflows3 (void)
set_emin (MPFR_EMIN_MIN);
set_emax (MPFR_EMAX_MAX);
- mpfr_inits2 (16, x, y, z, (void *) 0);
+ mpfr_inits2 (16, x, y, z, (mpfr_ptr) 0);
mpfr_set_si_2exp (x, 1, -2 * (MPFR_EMAX_MAX / 3), GMP_RNDN);
mpfr_set_si_2exp (y, -3, -1, GMP_RNDN);
@@ -1003,7 +1003,7 @@ overflows3 (void)
exit (1);
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
set_emin (emin);
set_emax (emax);
@@ -1031,7 +1031,7 @@ x_near_one (void)
mpfr_dump (z);
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
static int
@@ -1059,7 +1059,7 @@ bug20071103 (void)
mpfr_set_emin (-1000000);
mpfr_set_emax ( 1000000);
- mpfr_inits2 (64, x, y, z, (void *) 0);
+ mpfr_inits2 (64, x, y, z, (mpfr_ptr) 0);
mpfr_set_si_2exp (x, -3, -1, GMP_RNDN); /* x = -1.5 */
mpfr_set_str (y, "-0.ffffffffffffffff", 16, GMP_RNDN);
mpfr_set_exp (y, mpfr_get_emax ());
@@ -1067,7 +1067,7 @@ bug20071103 (void)
mpfr_pow (z, x, y, GMP_RNDN);
MPFR_ASSERTN (mpfr_zero_p (z) && MPFR_SIGN (z) > 0 &&
__gmpfr_flags == (MPFR_FLAGS_UNDERFLOW | MPFR_FLAGS_INEXACT));
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
set_emin (emin);
set_emax (emax);
@@ -1086,7 +1086,7 @@ bug20071104 (void)
mpfr_set_emin (-1000000);
mpfr_set_emax ( 1000000);
- mpfr_inits2 (20, x, y, z, (void *) 0);
+ mpfr_inits2 (20, x, y, z, (mpfr_ptr) 0);
mpfr_set_ui (x, 0, GMP_RNDN);
mpfr_nextbelow (x); /* x = -2^(emin-1) */
mpfr_set_si (y, -2, GMP_RNDN); /* y = -2 */
@@ -1108,7 +1108,7 @@ bug20071104 (void)
printf ("Error in bug20071104: bad flags (%u)\n", __gmpfr_flags);
exit (1);
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
set_emin (emin);
set_emax (emax);
@@ -1206,7 +1206,7 @@ bug20071218 (void)
mpfr_t x, y, z, t;
int tern;
- mpfr_inits2 (64, x, y, z, t, (void *) 0);
+ mpfr_inits2 (64, x, y, z, t, (mpfr_ptr) 0);
mpfr_set_str (x, "0x.80000000000002P-1023", 0, GMP_RNDN);
mpfr_set_str (y, "100000.000000002", 16, GMP_RNDN);
mpfr_set_ui (t, 0, GMP_RNDN);
@@ -1240,7 +1240,7 @@ bug20071218 (void)
" (%d instead of negative)\n", tern);
exit (1);
}
- mpfr_clears (x, y, z, t, (void *) 0);
+ mpfr_clears (x, y, z, t, (mpfr_ptr) 0);
}
int
diff --git a/tests/tpow_z.c b/tests/tpow_z.c
index 29c6b395a..49341104b 100644
--- a/tests/tpow_z.c
+++ b/tests/tpow_z.c
@@ -147,7 +147,7 @@ check_integer (mp_prec_t begin, mp_prec_t end, unsigned long max)
int res1, res2;
mp_rnd_t rnd;
- mpfr_inits2 (begin, x, y1, y2, (void *) 0);
+ mpfr_inits2 (begin, x, y1, y2, (mpfr_ptr) 0);
mpz_init (z);
for (p = begin ; p < end ; p+=4)
{
@@ -190,7 +190,7 @@ check_integer (mp_prec_t begin, mp_prec_t end, unsigned long max)
}
} /* for i */
} /* for p */
- mpfr_clears (x, y1, y2, (void *) 0);
+ mpfr_clears (x, y1, y2, (mpfr_ptr) 0);
mpz_clear (z);
}
@@ -231,7 +231,7 @@ bug20071104 (void)
int inex;
mpz_init_set_si (z, -2);
- mpfr_inits2 (20, x, y, (void *) 0);
+ mpfr_inits2 (20, x, y, (mpfr_ptr) 0);
mpfr_set_ui (x, 0, GMP_RNDN);
mpfr_nextbelow (x); /* x = -2^(emin-1) */
mpfr_clear_flags ();
@@ -252,7 +252,7 @@ bug20071104 (void)
printf ("Error in bug20071104: bad flags (%u)\n", __gmpfr_flags);
exit (1);
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
mpz_clear (z);
}
diff --git a/tests/tset_si.c b/tests/tset_si.c
index 0a1339739..d511b789e 100644
--- a/tests/tset_si.c
+++ b/tests/tset_si.c
@@ -100,7 +100,7 @@ test_macros (void)
mpfr_ptr p;
mpfr_rnd_t r;
- mpfr_inits (x[0], x[1], x[2], (void *) 0);
+ mpfr_inits (x[0], x[1], x[2], (mpfr_ptr) 0);
p = x[0];
r = 0;
mpfr_set_ui (p++, 0, r++);
@@ -119,7 +119,7 @@ test_macros (void)
"r = %d (expecting 1)\n", (int) (p - x[0]), r);
exit (1);
}
- mpfr_clears (x[0], x[1], x[2], (void *) 0);
+ mpfr_clears (x[0], x[1], x[2], (mpfr_ptr) 0);
}
/* FIXME: Comparing against mpfr_get_si/ui is not ideal, it'd be better to
diff --git a/tests/tset_sj.c b/tests/tset_sj.c
index b8bb2aeb4..bee04095e 100644
--- a/tests/tset_sj.c
+++ b/tests/tset_sj.c
@@ -65,7 +65,7 @@ check_set_uj (mp_prec_t pmin, mp_prec_t pmax, int N)
int inex1, inex2, n;
mp_limb_t limb;
- mpfr_inits2 (pmax, x, y, (void *) 0);
+ mpfr_inits2 (pmax, x, y, (mpfr_ptr) 0);
for ( p = pmin ; p < pmax ; p++)
{
@@ -107,7 +107,7 @@ check_set_uj (mp_prec_t pmin, mp_prec_t pmax, int N)
if (!MPFR_IS_ZERO (x))
ERROR ("Setting 0");
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
static void
diff --git a/tests/tsi_op.c b/tests/tsi_op.c
index 00136811f..d1c6cfdeb 100644
--- a/tests/tsi_op.c
+++ b/tests/tsi_op.c
@@ -102,7 +102,7 @@ main (int argc, char *argv[])
int i;
tests_start_mpfr ();
- mpfr_inits2 (53, x, z, (void *) 0);
+ mpfr_inits2 (53, x, z, (mpfr_ptr) 0);
for(i = 0 ; i < numberof (tab) ; i++)
{
mpfr_set_str (x, tab[i].op1, 16, GMP_RNDN);
@@ -132,7 +132,7 @@ main (int argc, char *argv[])
if (mpfr_cmp_str1 (z, "-1024"))
ERROR1("si_div", i, z, "-1024");
- mpfr_clears (x, z, (void *) 0);
+ mpfr_clears (x, z, (mpfr_ptr) 0);
check_invert ();
diff --git a/tests/tsin.c b/tests/tsin.c
index 15125c56d..c63aa20f5 100644
--- a/tests/tsin.c
+++ b/tests/tsin.c
@@ -211,7 +211,7 @@ check_regression ()
int i;
p = strlen (xs) - 2 - 3;
- mpfr_inits2 (p, x, y, (void *) 0);
+ mpfr_inits2 (p, x, y, (mpfr_ptr) 0);
mpfr_set_str (x, xs, 2, GMP_RNDN);
i = mpfr_sin (y, x, GMP_RNDN);
@@ -223,7 +223,7 @@ check_regression ()
mpfr_dump (y);
exit (1);
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
/* Test provided by Christopher Creutzig, 2007-05-21. */
diff --git a/tests/tsin_cos.c b/tests/tsin_cos.c
index cbedbe3ad..424011908 100644
--- a/tests/tsin_cos.c
+++ b/tests/tsin_cos.c
@@ -50,7 +50,7 @@ check53 (const char *xs, const char *sin_xs, const char *cos_xs,
{
mpfr_t xx, s, c;
- mpfr_inits2 (53, xx, s, c, (void *) 0);
+ mpfr_inits2 (53, xx, s, c, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs); /* should be exact */
mpfr_sin_cos (s, c, xx, rnd_mode);
if (mpfr_cmp_str1 (s, sin_xs))
@@ -71,7 +71,7 @@ check53 (const char *xs, const char *sin_xs, const char *cos_xs,
printf(", expected %s\n", cos_xs);
exit (1);
}
- mpfr_clears (xx, s, c, (void *) 0);
+ mpfr_clears (xx, s, c, (mpfr_ptr) 0);
}
static void
@@ -79,7 +79,7 @@ check53sin (const char *xs, const char *sin_xs, mp_rnd_t rnd_mode)
{
mpfr_t xx, s, c;
- mpfr_inits2 (53, xx, s, c, (void *) 0);
+ mpfr_inits2 (53, xx, s, c, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs); /* should be exact */
mpfr_sin_cos (s, c, xx, rnd_mode);
if (mpfr_cmp_str1 (s, sin_xs))
@@ -91,7 +91,7 @@ check53sin (const char *xs, const char *sin_xs, mp_rnd_t rnd_mode)
printf(", expected %s\n", sin_xs);
exit (1);
}
- mpfr_clears (xx, s, c, (void *) 0);
+ mpfr_clears (xx, s, c, (mpfr_ptr) 0);
}
static void
@@ -99,7 +99,7 @@ check53cos (const char *xs, const char *cos_xs, mp_rnd_t rnd_mode)
{
mpfr_t xx, c, s;
- mpfr_inits2 (53, xx, s, c, (void *) 0);
+ mpfr_inits2 (53, xx, s, c, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs); /* should be exact */
mpfr_sin_cos (s, c, xx, rnd_mode);
if (mpfr_cmp_str1 (c, cos_xs))
@@ -111,7 +111,7 @@ check53cos (const char *xs, const char *cos_xs, mp_rnd_t rnd_mode)
printf(", expected %s\n", cos_xs);
exit (1);
}
- mpfr_clears (xx, s, c, (void *) 0);
+ mpfr_clears (xx, s, c, (mpfr_ptr) 0);
}
static void
@@ -258,7 +258,7 @@ tiny (void)
mpfr_t x, s, c;
int i, inex;
- mpfr_inits2 (64, x, s, c, (void *) 0);
+ mpfr_inits2 (64, x, s, c, (mpfr_ptr) 0);
for (i = -1; i <= 1; i += 2)
{
@@ -270,7 +270,7 @@ tiny (void)
MPFR_ASSERTN (!mpfr_nan_p (c) && mpfr_cmp_ui (c, 1) == 0);
}
- mpfr_clears (x, s, c, (void *) 0);
+ mpfr_clears (x, s, c, (mpfr_ptr) 0);
}
/* bug found in nightly tests */
diff --git a/tests/tsqr.c b/tests/tsqr.c
index 0349aaa34..3c9a4d2eb 100644
--- a/tests/tsqr.c
+++ b/tests/tsqr.c
@@ -81,7 +81,7 @@ void check_random(mpfr_prec_t p)
int r;
int i, inexact1, inexact2;
- mpfr_inits2 (p, x, y, z, (void *) 0);
+ mpfr_inits2 (p, x, y, z, (mpfr_ptr) 0);
for(i = 0 ; i < 500 ; i++)
{
mpfr_random (x);
@@ -96,7 +96,7 @@ void check_random(mpfr_prec_t p)
error2 ((mp_rnd_t) r,p,x,y,inexact1,inexact2);
}
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
void check_special(void)
diff --git a/tests/tsub1sp.c b/tests/tsub1sp.c
index 7c0ce0fb8..25708235e 100644
--- a/tests/tsub1sp.c
+++ b/tests/tsub1sp.c
@@ -72,7 +72,7 @@ void check_random(mpfr_prec_t p)
int r;
int i, inexact1, inexact2;
- mpfr_inits2 (p, x, y, z, x2, (void *) 0);
+ mpfr_inits2 (p, x, y, z, x2, (mpfr_ptr) 0);
for (i = 0 ; i < 500 ; i++)
{
@@ -90,7 +90,7 @@ void check_random(mpfr_prec_t p)
}
}
- mpfr_clears (x, y, z, x2, (void *) 0);
+ mpfr_clears (x, y, z, x2, (mpfr_ptr) 0);
}
void check_special(void)
@@ -101,7 +101,7 @@ void check_special(void)
int i = -1, inexact1, inexact2;
mp_exp_t es;
- mpfr_inits (x, y, z, x2, (void *) 0);
+ mpfr_inits (x, y, z, x2, (mpfr_ptr) 0);
for (r = 0 ; r < GMP_RND_MAX ; r++)
{
@@ -502,5 +502,5 @@ void check_special(void)
set_emin (es);
}
- mpfr_clears (x, y, z, x2, (void *) 0);
+ mpfr_clears (x, y, z, x2, (mpfr_ptr) 0);
}
diff --git a/tests/tsub_ui.c b/tests/tsub_ui.c
index 3dadacbd8..9ddb0ae45 100644
--- a/tests/tsub_ui.c
+++ b/tests/tsub_ui.c
@@ -32,7 +32,7 @@ check3 (const char *xs, unsigned long y, mp_rnd_t rnd_mode, const char *zs)
{
mpfr_t xx,zz;
- mpfr_inits2 (53, xx, zz, (void *) 0);
+ mpfr_inits2 (53, xx, zz, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs);
mpfr_sub_ui (zz, xx, y, rnd_mode);
if (mpfr_cmp_str1(zz, zs))
@@ -43,7 +43,7 @@ check3 (const char *xs, unsigned long y, mp_rnd_t rnd_mode, const char *zs)
xs, y, mpfr_print_rnd_mode (rnd_mode));
exit (1);
}
- mpfr_clears (xx, zz, (void *) 0);
+ mpfr_clears (xx, zz, (mpfr_ptr) 0);
}
/* FastTwoSum: if EXP(x) >= EXP(y), u = o(x+y), v = o(u-x), w = o(y-v),
@@ -57,7 +57,7 @@ check_two_sum (mp_prec_t p)
mp_rnd_t rnd;
int inexact;
- mpfr_inits2 (p, y, u, v, w, (void *) 0);
+ mpfr_inits2 (p, y, u, v, w, (mpfr_ptr) 0);
do
{
x = randlimb ();
@@ -83,7 +83,7 @@ check_two_sum (mp_prec_t p)
printf ("inexact = %d\n", inexact);
exit (1);
}
- mpfr_clears (y, u, v, w, (void *) 0);
+ mpfr_clears (y, u, v, w, (mpfr_ptr) 0);
}
static void
diff --git a/tests/tsum.c b/tests/tsum.c
index de905a0e1..3e9ec33fd 100644
--- a/tests/tsum.c
+++ b/tests/tsum.c
@@ -151,7 +151,7 @@ test_sum (mp_prec_t f, unsigned long n)
tab = (mpfr_t *) malloc (n * sizeof(mpfr_t));
for (i = 0; i < n; i++)
mpfr_init2 (tab[i], f);
- mpfr_inits2 (f, sum, real_sum, real_non_rounded, (void *) 0);
+ mpfr_inits2 (f, sum, real_sum, real_non_rounded, (mpfr_ptr) 0);
/* First Uniform */
for (i = 0; i < n; i++)
@@ -193,7 +193,7 @@ test_sum (mp_prec_t f, unsigned long n)
/* Clear stuff */
for (i = 0; i < n; i++)
mpfr_clear (tab[i]);
- mpfr_clears (sum, real_sum, real_non_rounded, (void *) 0);
+ mpfr_clears (sum, real_sum, real_non_rounded, (mpfr_ptr) 0);
free (tab);
}
@@ -204,7 +204,7 @@ void check_special (void)
mpfr_ptr tabp[3];
int i;
- mpfr_inits (tab[0], tab[1], tab[2], r, (void *) 0);
+ mpfr_inits (tab[0], tab[1], tab[2], r, (mpfr_ptr) 0);
tabp[0] = tab[0];
tabp[1] = tab[1];
tabp[2] = tab[2];
@@ -277,7 +277,7 @@ void check_special (void)
exit (1);
}
- mpfr_clears (tab[0], tab[1], tab[2], r, (void *) 0);
+ mpfr_clears (tab[0], tab[1], tab[2], r, (mpfr_ptr) 0);
}
diff --git a/tests/ttrunc.c b/tests/ttrunc.c
index ef8867116..4700f3b71 100644
--- a/tests/ttrunc.c
+++ b/tests/ttrunc.c
@@ -35,7 +35,7 @@ main (void)
tests_start_mpfr ();
- mpfr_inits2 (SIZEX, x, y, z, t, y2, z2, t2, (void *) 0);
+ mpfr_inits2 (SIZEX, x, y, z, t, y2, z2, t2, (mpfr_ptr) 0);
mpfr_set_str1 (x, "0.5");
mpfr_ceil(y, x);
@@ -126,7 +126,7 @@ main (void)
}
}
- mpfr_clears (x, y, z, t, y2, z2, t2, (void *) 0);
+ mpfr_clears (x, y, z, t, y2, z2, t2, (mpfr_ptr) 0);
tests_end_mpfr ();
return 0;
diff --git a/tests/tui_div.c b/tests/tui_div.c
index b8ed92797..d6b2bb494 100644
--- a/tests/tui_div.c
+++ b/tests/tui_div.c
@@ -31,7 +31,7 @@ check (unsigned long y, const char *xs, mp_rnd_t rnd_mode, const char *zs)
{
mpfr_t xx, zz;
- mpfr_inits2 (53, xx, zz, (void *) 0);
+ mpfr_inits2 (53, xx, zz, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs);
mpfr_ui_div (zz, y, xx, rnd_mode);
if (mpfr_cmp_str1(zz, zs))
@@ -42,7 +42,7 @@ check (unsigned long y, const char *xs, mp_rnd_t rnd_mode, const char *zs)
y, xs, mpfr_print_rnd_mode (rnd_mode));
exit (1);
}
- mpfr_clears (xx, zz, (void *) 0);
+ mpfr_clears (xx, zz, (mpfr_ptr) 0);
}
static void
diff --git a/tests/tui_sub.c b/tests/tui_sub.c
index cadd511f9..e6e273427 100644
--- a/tests/tui_sub.c
+++ b/tests/tui_sub.c
@@ -146,7 +146,7 @@ check (unsigned long y, const char *xs, mp_rnd_t rnd_mode, const char *zs)
{
mpfr_t xx, zz;
- mpfr_inits2 (53, xx, zz, (void *) 0);
+ mpfr_inits2 (53, xx, zz, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs);
mpfr_ui_sub (zz, y, xx, rnd_mode);
if (mpfr_cmp_str1 (zz, zs) )
@@ -157,7 +157,7 @@ check (unsigned long y, const char *xs, mp_rnd_t rnd_mode, const char *zs)
y, xs, mpfr_print_rnd_mode (rnd_mode));
exit (1);
}
- mpfr_clears (xx, zz, (void *) 0);
+ mpfr_clears (xx, zz, (mpfr_ptr) 0);
}
/* if u = o(x-y), v = o(u-x), w = o(v+y), then x-y = u-w */
@@ -169,7 +169,7 @@ check_two_sum (mp_prec_t p)
mp_rnd_t rnd;
int inexact;
- mpfr_inits2 (p, y, u, v, w, (void *) 0);
+ mpfr_inits2 (p, y, u, v, w, (mpfr_ptr) 0);
do
{
x = randlimb ();
@@ -195,7 +195,7 @@ check_two_sum (mp_prec_t p)
printf ("inexact = %d\n", inexact);
exit (1);
}
- mpfr_clears (y, u, v, w, (void *) 0);
+ mpfr_clears (y, u, v, w, (mpfr_ptr) 0);
}
static void
diff --git a/tests/tzeta.c b/tests/tzeta.c
index 5db0b86bd..e4b6e36f5 100644
--- a/tests/tzeta.c
+++ b/tests/tzeta.c
@@ -162,7 +162,7 @@ test2 (void)
mpfr_t x, y;
int i, n = numberof(val);
- mpfr_inits2 (55, x, y, (void *) 0);
+ mpfr_inits2 (55, x, y, (mpfr_ptr) 0);
for(i = 0 ; i < n ; i+=2)
{
@@ -184,7 +184,7 @@ test2 (void)
exit(1);
}
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
#define TEST_FUNCTION mpfr_zeta