diff options
author | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2010-08-31 20:31:00 +0000 |
---|---|---|
committer | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2010-08-31 20:31:00 +0000 |
commit | 3c1f08c2642b45c16bc0a938a9947df7e712ba2c (patch) | |
tree | 431cabee40c131445ce5c76ed7deae7146827e0c /tests/random.c | |
parent | 942687bd67524983399677340270d236278cf333 (diff) | |
download | mpc-3c1f08c2642b45c16bc0a938a9947df7e712ba2c.tar.gz |
explicit casts in test/ to avoid warnings with '-Wconversion'
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@824 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/random.c')
-rw-r--r-- | tests/random.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/random.c b/tests/random.c index bf1e70e..02cde40 100644 --- a/tests/random.c +++ b/tests/random.c @@ -1,6 +1,6 @@ /* Handle seed for random numbers. -Copyright (C) 2008, 2009 Philippe Th\'eveny, Paul Zimmermann, Andreas Enge +Copyright (C) 2008, 2009, 2010 Philippe Th\'eveny, Paul Zimmermann, Andreas Enge This file is part of the MPC Library. @@ -66,17 +66,17 @@ test_start (void) gmp_randseed_ui (rands, 0xfac11e); else { - seed = atoi (environment_seed); + seed = (unsigned long int) atoi (environment_seed); if (seed == 0 || seed == 1) { #if HAVE_GETTIMEOFDAY struct timeval tv; gettimeofday (&tv, NULL); - seed = tv.tv_sec + tv.tv_usec; + seed = (unsigned long int) (tv.tv_sec + tv.tv_usec); #else time_t tv; time (&tv); - seed = tv; + seed = (unsigned long int) tv; #endif gmp_randseed_ui (rands, seed); printf ("Seed GMP_CHECK_RANDOMIZE=%lu " @@ -114,7 +114,7 @@ test_default_random (mpc_ptr z, mpfr_exp_t emin, mpfr_exp_t emax, unsigned int negative_probability, unsigned int zero_probability) { - const unsigned long range = (long)emax - (long)emin + 1; + const unsigned long range = (unsigned long int) (emax - emin) + 1; unsigned long r; if (!rands_initialized) |