summaryrefslogtreecommitdiff
path: root/src/nrandom.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2013-06-06 06:53:57 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2013-06-06 06:53:57 +0000
commit51076c04230ef8d4109e9fb02118431f5a322cf6 (patch)
treed4f9c3df1c744b21221a9523ddaa2b042af8fae6 /src/nrandom.c
parent7212dfb5f748e71a7d2c99ce5c694fa8eed49220 (diff)
downloadmpfr-51076c04230ef8d4109e9fb02118431f5a322cf6.tar.gz
fixed compiler warnings
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8581 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/nrandom.c')
-rw-r--r--src/nrandom.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nrandom.c b/src/nrandom.c
index bfb6b6048..c5c03c77e 100644
--- a/src/nrandom.c
+++ b/src/nrandom.c
@@ -125,15 +125,15 @@ B (unsigned long k, mpfr_random_deviate_t x, gmp_randstate_t r,
{
/* p and q are temporaries */
- /* Check if 2 * k + 2 would overflow; for a 32-bit unsigned long, the
- * probability of this is exp(-2^61)). */
- MPFR_ASSERTN (k < ((unsigned long)(-1) >> 1));
-
unsigned long m = 2 * k + 2;
/* n tracks the parity of the loop; s == 1 on first trip thru loop. */
unsigned n = 0, s = 1;
int f;
+ /* Check if 2 * k + 2 would overflow; for a 32-bit unsigned long, the
+ * probability of this is exp(-2^61)). */
+ MPFR_ASSERTN (k < ((unsigned long)(-1) >> 1));
+
for (;; ++n, s = 0) /* overflow of n is innocuous */
{
if ( ((f = k ? 0 : C (m, r)) < 0) ||