summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-02-15 17:38:31 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-02-15 17:38:31 +0000
commitc8ed1926e59eda68441ebf8f91e5a9268892cdf9 (patch)
tree58123ad4f453b7758f9846448db8204ecc552c99
parentdad2bf1ef4af25fe87fe24f7ac295fb292987d6d (diff)
downloadmpfr-c8ed1926e59eda68441ebf8f91e5a9268892cdf9.tar.gz
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)... The change has been done with: perl -pi -e \ 's/(mpfr_(clear|init)s.*)\(void *\*\) *0\)/$1(mpfr_ptr) 0)/' **/*.c under zsh. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5290 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--add1sp.c2
-rw-r--r--fma.c2
-rw-r--r--fms.c2
-rw-r--r--li2.c12
-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_d.c2
-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/td_div.c2
-rw-r--r--tests/td_sub.c2
-rw-r--r--tests/tdiv.c20
-rw-r--r--tests/tdiv_d.c2
-rw-r--r--tests/terf.c8
-rw-r--r--tests/tests.c4
-rw-r--r--tests/texp.c8
-rw-r--r--tests/tfma.c20
-rw-r--r--tests/tfmod.c12
-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/tmodf.c2
-rw-r--r--tests/tmul.c12
-rw-r--r--tests/tmul_2exp.c4
-rw-r--r--tests/tmul_d.c2
-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/tsinh_cosh.c6
-rw-r--r--tests/tsprintf.c10
-rw-r--r--tests/tsqr.c4
-rw-r--r--tests/tsub1sp.c8
-rw-r--r--tests/tsub_d.c2
-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
58 files changed, 203 insertions, 197 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/li2.c b/li2.c
index b080a9d25..d65053d44 100644
--- a/li2.c
+++ b/li2.c
@@ -169,7 +169,7 @@ li2_series (mpfr_t sum, mpfr_srcptr z, mpfr_rnd_t rnd_mode)
while (Bm--)
mpz_clear (B[Bm]);
(*__gmp_free_func) (B, Bmax * sizeof (mpz_t));
- mpfr_clears (s, u, v, w, (void *) 0);
+ mpfr_clears (s, u, v, w, (mpfr_ptr) 0);
/* Let K be the returned value.
1. As we compute an alternating series, the truncation error has the same
@@ -452,7 +452,7 @@ mpfr_li2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
}
MPFR_ZIV_FREE (loop);
inexact = mpfr_set (y, s, rnd_mode);
- mpfr_clears (s, u, xx, (void *) 0);
+ mpfr_clears (s, u, xx, (mpfr_ptr) 0);
end_of_case_gt2:
MPFR_SAVE_EXPO_FREE (expo);
@@ -506,7 +506,7 @@ mpfr_li2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
MPFR_ZIV_FREE (loop);
inexact = mpfr_set (y, s, rnd_mode);
- mpfr_clears (s, u, v, xx, (void *) 0);
+ mpfr_clears (s, u, v, xx, (mpfr_ptr) 0);
MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range (y, inexact, rnd_mode);
}
@@ -562,7 +562,7 @@ mpfr_li2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
MPFR_ZIV_FREE (loop);
inexact = mpfr_set (y, s, rnd_mode);
- mpfr_clears (s, u, v, xx, (void *) 0);
+ mpfr_clears (s, u, v, xx, (mpfr_ptr) 0);
MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range (y, inexact, rnd_mode);
}
@@ -602,7 +602,7 @@ mpfr_li2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
MPFR_ZIV_FREE (loop);
inexact = mpfr_set (y, s, rnd_mode);
- mpfr_clears (s, u, xx, (void *) 0);
+ mpfr_clears (s, u, xx, (mpfr_ptr) 0);
MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range (y, inexact, rnd_mode);
}
@@ -675,7 +675,7 @@ mpfr_li2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
}
MPFR_ZIV_FREE (loop);
inexact = mpfr_set (y, s, rnd_mode);
- mpfr_clears (s, u, v, w, xx, (void *) 0);
+ mpfr_clears (s, u, v, w, xx, (mpfr_ptr) 0);
end_of_case_ltm1:
MPFR_SAVE_EXPO_FREE (expo);
diff --git a/mpfr.texi b/mpfr.texi
index f13cc84d5..573fccba3 100644
--- a/mpfr.texi
+++ b/mpfr.texi
@@ -2417,8 +2417,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
@@ -2427,15 +2429,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:
@@ -2443,9 +2449,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 9100b9c10..fc7bfbb15 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);
}
#define TEST_FUNCTION mpfr_abs
diff --git a/tests/tacosh.c b/tests/tacosh.c
index ff82c8b2b..affbe5ad9 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_d.c b/tests/tadd_d.c
index 11670dd86..09b8f0075 100644
--- a/tests/tadd_d.c
+++ b/tests/tadd_d.c
@@ -86,7 +86,7 @@ check_regulars (void)
exit (1);
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
static void
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 d525a494e..186c70363 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 e07599e28..7ddc0b68f 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 d2ef8425f..6e3ddeb08 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 64a174587..84dead02b 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);
}
/* Wrapper for tgeneric */
diff --git a/tests/tcos.c b/tests/tcos.c
index 683af70e5..e56db53fb 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/td_div.c b/tests/td_div.c
index c9104f92b..d8103d783 100644
--- a/tests/td_div.c
+++ b/tests/td_div.c
@@ -103,7 +103,7 @@ main (int argc, char *argv[])
printf ("\n");
exit (1);
}
- mpfr_clears (x, y, z, (void *)0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
check_nans ();
diff --git a/tests/td_sub.c b/tests/td_sub.c
index 50b691aed..a584d294f 100644
--- a/tests/td_sub.c
+++ b/tests/td_sub.c
@@ -97,7 +97,7 @@ main (int argc, char *argv[])
printf ("\n");
exit (1);
}
- mpfr_clears (x, y, z, (void *)0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
check_nans ();
diff --git a/tests/tdiv.c b/tests/tdiv.c
index 22601aa1a..0301f8050 100644
--- a/tests/tdiv.c
+++ b/tests/tdiv.c
@@ -71,7 +71,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);
@@ -85,7 +85,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
@@ -93,7 +93,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);
@@ -106,7 +106,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
@@ -196,7 +196,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");
@@ -213,7 +213,7 @@ check_64(void)
exit(1);
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
static void
@@ -737,7 +737,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++)
{
@@ -775,7 +775,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 */
@@ -841,7 +841,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 ();
@@ -862,7 +862,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/tdiv_d.c b/tests/tdiv_d.c
index 94c8ea457..46cc61f58 100644
--- a/tests/tdiv_d.c
+++ b/tests/tdiv_d.c
@@ -102,7 +102,7 @@ main (int argc, char *argv[])
printf ("\n");
exit (1);
}
- mpfr_clears (x, y, z, (void *)0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
check_nans ();
diff --git a/tests/terf.c b/tests/terf.c
index 8587a1b1d..b869ac8c9 100644
--- a/tests/terf.c
+++ b/tests/terf.c
@@ -366,7 +366,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);
@@ -407,7 +407,7 @@ special_erfc (void)
exit (1);
}
- mpfr_clears (x, y, (void *) 0);
+ mpfr_clears (x, y, (mpfr_ptr) 0);
}
static void
@@ -522,7 +522,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");
@@ -544,7 +544,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/tests.c b/tests/tests.c
index e421afc6d..7c3ac6a6c 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -744,7 +744,7 @@ bad_cases (int (*fct)(), int (*inv)(), char *name,
dbgenv = getenv ("MPFR_DEBUG_BADCASES");
dbg = dbgenv != 0 ? atoi (dbgenv) : 0; /* debug level */
- mpfr_inits (x, y, z, (void *) 0);
+ mpfr_inits (x, y, z, (mpfr_ptr) 0);
for (i = 0; i < n; i++)
{
mp_prec_t px, py, pz;
@@ -845,5 +845,5 @@ bad_cases (int (*fct)(), int (*inv)(), char *name,
mpfr_set_emin (old_emin);
mpfr_set_emax (old_emax);
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
diff --git a/tests/texp.c b/tests/texp.c
index e55d05caf..b7966f1fb 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/tfmod.c b/tests/tfmod.c
index 7d518853e..52c35b0ab 100644
--- a/tests/tfmod.c
+++ b/tests/tfmod.c
@@ -80,7 +80,7 @@ test_failed (mpfr_t erem, mpfr_t grem, mpfr_t x, mpfr_t y, mp_rnd_t rnd)
mpfr_out_str (stdout, 10, 0, grem, GMP_RNDD);
putchar ('\n');
- mpfr_clears (erem, grem, x, y, (void *) 0);
+ mpfr_clears (erem, grem, x, y, (mpfr_ptr) 0);
exit (1);
}
@@ -104,7 +104,7 @@ special (void)
{
int inexact;
mpfr_t x, y, r;
- mpfr_inits (x, y, r, (void *)0);
+ mpfr_inits (x, y, r, (mpfr_ptr) 0);
/* NaN mod NaN is NaN */
mpfr_set_nan (x);
@@ -151,11 +151,11 @@ special (void)
goto error;
}
- mpfr_clears (x, y, r, (void *)0);
+ mpfr_clears (x, y, r, (mpfr_ptr) 0);
return;
error:
- mpfr_clears (x, y, r, (void *)0);
+ mpfr_clears (x, y, r, (mpfr_ptr) 0);
exit (1);
@@ -167,7 +167,7 @@ main (int argc, char *argv[])
mpfr_t x, y, r;
tests_start_mpfr ();
- mpfr_inits (x, y, r, (void *)0);
+ mpfr_inits (x, y, r, (mpfr_ptr) 0);
test_generic (2, 100, 100);
@@ -195,7 +195,7 @@ main (int argc, char *argv[])
mpfr_div_2ui (y, y, 3, GMP_RNDD); /* y = 1/8 */
mpfr_set_prec (r, 123);
check (r, x, y, GMP_RNDD);
- mpfr_clears (x, y, r, (void *)0);
+ mpfr_clears (x, y, r, (mpfr_ptr) 0);
tests_end_mpfr ();
return 0;
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 7a55b7acd..20dfcdfe8 100644
--- a/tests/tget_str.c
+++ b/tests/tget_str.c
@@ -1093,7 +1093,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 c11a4cc08..130002d9d 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/tmodf.c b/tests/tmodf.c
index 95b480ec0..5500b46e7 100644
--- a/tests/tmodf.c
+++ b/tests/tmodf.c
@@ -65,7 +65,7 @@ check (const char *xis, const char *xfs, const char *xs,
printf ("got return value: %d, expected %d\n", inexact, expected_return);
exit (1);
}
- mpfr_clears (xi, xf, x, (void *)0);
+ mpfr_clears (xi, xf, x, (mpfr_ptr) 0);
}
static void
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/tmul_d.c b/tests/tmul_d.c
index 58787a039..9b403498f 100644
--- a/tests/tmul_d.c
+++ b/tests/tmul_d.c
@@ -101,7 +101,7 @@ main (int argc, char *argv[])
printf ("\n");
exit (1);
}
- mpfr_clears (x, y, z, (void *)0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
check_nans ();
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 7b21d5675..dc844a7bd 100644
--- a/tests/tpow.c
+++ b/tests/tpow.c
@@ -387,7 +387,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);
@@ -407,7 +407,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
@@ -900,7 +900,7 @@ underflows (void)
}
mpfr_set_emin (emin);
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
static void
@@ -941,7 +941,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 */
@@ -964,7 +964,7 @@ overflows2 (void)
}
}
- mpfr_clears (x, y, z, (void *) 0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
set_emin (emin);
set_emax (emax);
@@ -987,7 +987,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);
@@ -1005,7 +1005,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);
@@ -1033,7 +1033,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
@@ -1061,7 +1061,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 ());
@@ -1069,7 +1069,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);
@@ -1088,7 +1088,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 */
@@ -1110,7 +1110,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);
@@ -1208,7 +1208,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);
@@ -1242,7 +1242,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 1fc4f85b6..e4e4028cb 100644
--- a/tests/tpow_z.c
+++ b/tests/tpow_z.c
@@ -148,7 +148,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)
{
@@ -191,7 +191,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);
}
@@ -232,7 +232,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 ();
@@ -253,7 +253,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 9029bdac3..81e61606e 100644
--- a/tests/tset_si.c
+++ b/tests/tset_si.c
@@ -101,7 +101,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++);
@@ -120,7 +120,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 4612204e9..029df5160 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 24b32af05..6b71fb59d 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/tsinh_cosh.c b/tests/tsinh_cosh.c
index 2a16056c8..31f110b18 100644
--- a/tests/tsinh_cosh.c
+++ b/tests/tsinh_cosh.c
@@ -42,7 +42,7 @@ failed (mpfr_t x, mpfr_t esh, mpfr_t gsh, mpfr_t ech, mpfr_t gch)
mpfr_out_str (stdout, 10, 0, gch, GMP_RNDD);
putchar ('\n');
- mpfr_clears (x, esh, gsh, ech, gch, (void *) 0);
+ mpfr_clears (x, esh, gsh, ech, gch, (mpfr_ptr) 0);
exit (1);
}
@@ -53,7 +53,7 @@ check (mpfr_t x, mp_rnd_t rnd)
mpfr_t s, c, sx, cx;
int isc, is, ic;
- mpfr_inits2 (MPFR_PREC(x), s, c, sx, cx, (void *)0);
+ mpfr_inits2 (MPFR_PREC(x), s, c, sx, cx, (mpfr_ptr) 0);
isc = mpfr_sinh_cosh (sx, cx, x, rnd);
is = mpfr_sinh (s, x, rnd);
@@ -63,7 +63,7 @@ check (mpfr_t x, mp_rnd_t rnd)
failed (x, s, sx, c, cx);
MPFR_ASSERTN (isc = is || ic);
- mpfr_clears (s, c, sx, cx, (void *) 0);
+ mpfr_clears (s, c, sx, cx, (mpfr_ptr) 0);
}
static void
diff --git a/tests/tsprintf.c b/tests/tsprintf.c
index 9dada6d37..5a0a4ec2a 100644
--- a/tests/tsprintf.c
+++ b/tests/tsprintf.c
@@ -290,7 +290,7 @@ decimal (void)
mpfr_set_si_2exp (x, -1, -15, GMP_RNDN); /* x=-2^-15 */
check_sprintf ("-3.0517578125e-05", "%.300Rg", x);
- mpfr_clears (x, z, (void *)0);
+ mpfr_clears (x, z, (mpfr_ptr) 0);
return 0;
}
@@ -298,7 +298,7 @@ static int
hexadecimal (void)
{
mpfr_t x, z;
- mpfr_inits2 (64, x, z, (void *)0);
+ mpfr_inits2 (64, x, z, (mpfr_ptr) 0);
/* special */
mpfr_set_inf (x, 1);
@@ -355,7 +355,7 @@ hexadecimal (void)
check_sprintf (" -0xfp+24", "%+10.0RUa", x);
check_sprintf (" -0x0p+0", "%+10.0RUa", z);
- mpfr_clears (x, z, (void *)0);
+ mpfr_clears (x, z, (mpfr_ptr) 0);
return 0;
}
@@ -364,7 +364,7 @@ binary (void)
{
mpfr_t x;
mpfr_t z;
- mpfr_inits2 (64, x, z, (void *)0);
+ mpfr_inits2 (64, x, z, (mpfr_ptr) 0);
/* special */
mpfr_set_inf (x, 1);
@@ -410,7 +410,7 @@ binary (void)
check_sprintf (" -1.1p+9", "%+10.1RUb", x);
check_sprintf (" -0.0p+0", "%+10.1RUb", z);
- mpfr_clears (x, z, (void *)0);
+ mpfr_clears (x, z, (mpfr_ptr) 0);
return 0;
}
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_d.c b/tests/tsub_d.c
index a70c8dc36..036ae9c43 100644
--- a/tests/tsub_d.c
+++ b/tests/tsub_d.c
@@ -96,7 +96,7 @@ main (int argc, char *argv[])
printf ("\n");
exit (1);
}
- mpfr_clears (x, y, z, (void *)0);
+ mpfr_clears (x, y, z, (mpfr_ptr) 0);
check_nans ();
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 f7b212f4a..fbfad5948 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 *) mpfr_allocate_func (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);
mpfr_free_func (tab, n * sizeof(mpfr_t));
}
@@ -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 9b3e69e1d..c8f6bba73 100644
--- a/tests/tui_sub.c
+++ b/tests/tui_sub.c
@@ -147,7 +147,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) )
@@ -158,7 +158,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 */
@@ -170,7 +170,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 ();
@@ -196,7 +196,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 dce0422f0..d44ff5336 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