diff options
author | thevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2008-06-25 12:26:17 +0000 |
---|---|---|
committer | thevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2008-06-25 12:26:17 +0000 |
commit | 92f431b9650ad6562e5856f64ff94537e8f7ad9e (patch) | |
tree | 7488b6519dff7356adca0503fbbfe02cbf9f3581 /tests/random.c | |
parent | 0b9a7c0d9613725f31f4f26ca8f1a0b80f25d2ef (diff) | |
download | mpc-92f431b9650ad6562e5856f64ff94537e8f7ad9e.tar.gz |
Remove use of mpfr global variables mpfr_rands and mpfr_rands_initialized.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@153 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/random.c')
-rw-r--r-- | tests/random.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/tests/random.c b/tests/random.c index 90d32e2..c6a1da5 100644 --- a/tests/random.c +++ b/tests/random.c @@ -41,10 +41,8 @@ MA 02111-1307, USA. */ # endif #endif -/* Use the global variables of MPFR since we are using mpfr_random2 through - mpc_random2. */ -extern gmp_randstate_t mpfr_rands; -extern char mpfr_rands_initialized; +gmp_randstate_t rands; +char rands_initialized; void test_start () @@ -52,19 +50,19 @@ test_start () char *environment_seed; unsigned long seed; - if (mpfr_rands_initialized) + if (rands_initialized) { fprintf (stderr, "Put test_start at the beginning of your test function.\n"); exit (1); } - gmp_randinit_default (mpfr_rands); - mpfr_rands_initialized = 1; + gmp_randinit_default (rands); + rands_initialized = 1; environment_seed = getenv ("GMP_CHECK_RANDOMIZE"); if (environment_seed == NULL) - gmp_randseed_ui (mpfr_rands, 0xfac11e); + gmp_randseed_ui (rands, 0xfac11e); else { seed = atoi (environment_seed); @@ -79,14 +77,14 @@ test_start () time (&tv); seed = tv; #endif - gmp_randseed_ui (mpfr_rands, seed); + gmp_randseed_ui (rands, seed); printf ("Seed GMP_CHECK_RANDOMIZE=%lu " "(include this in bug reports)\n", seed); } else { printf ("Re-seeding with GMP_CHECK_RANDOMIZE=%lu\n", seed); - gmp_randseed_ui (mpfr_rands, seed); + gmp_randseed_ui (rands, seed); } } } @@ -94,9 +92,9 @@ test_start () void test_end () { - if (mpfr_rands_initialized) + if (rands_initialized) { - mpfr_rands_initialized = 0; - gmp_randclear (mpfr_rands); + rands_initialized = 0; + gmp_randclear (rands); } } |