diff options
-rw-r--r-- | mpf/clears.c | 3 | ||||
-rw-r--r-- | mpf/inits.c | 3 | ||||
-rw-r--r-- | mpq/clears.c | 3 | ||||
-rw-r--r-- | mpq/inits.c | 3 | ||||
-rw-r--r-- | mpz/clears.c | 3 | ||||
-rw-r--r-- | mpz/inits.c | 3 |
6 files changed, 12 insertions, 6 deletions
diff --git a/mpf/clears.c b/mpf/clears.c index 68a4cbebd..17eca8208 100644 --- a/mpf/clears.c +++ b/mpf/clears.c @@ -39,11 +39,12 @@ mpf_clears (mpf_ptr x, ...) va_start (ap, x); - while (x != NULL) + do { __GMP_FREE_FUNC_LIMBS (PTR(x), PREC(x) + 1); x = va_arg (ap, mpf_ptr); } + while (x != NULL); va_end (ap); } diff --git a/mpf/inits.c b/mpf/inits.c index db7cacc42..ddcf1141a 100644 --- a/mpf/inits.c +++ b/mpf/inits.c @@ -39,11 +39,12 @@ mpf_inits (mpf_ptr x, ...) va_start (ap, x); - while (x != NULL) + do { mpf_init (x); x = va_arg (ap, mpf_ptr); } + while (x != NULL); va_end (ap); } diff --git a/mpq/clears.c b/mpq/clears.c index 73e5f6624..c5f6539a6 100644 --- a/mpq/clears.c +++ b/mpq/clears.c @@ -39,12 +39,13 @@ mpq_clears (mpq_ptr x, ...) va_start (ap, x); - while (x != NULL) + do { __GMP_FREE_FUNC_LIMBS (PTR(NUM(x)), ALLOC(NUM(x))); __GMP_FREE_FUNC_LIMBS (PTR(DEN(x)), ALLOC(DEN(x))); x = va_arg (ap, mpq_ptr); } + while (x != NULL); va_end (ap); } diff --git a/mpq/inits.c b/mpq/inits.c index bb14f93e2..084c71e00 100644 --- a/mpq/inits.c +++ b/mpq/inits.c @@ -39,11 +39,12 @@ mpq_inits (mpq_ptr x, ...) va_start (ap, x); - while (x != NULL) + do { mpq_init (x); x = va_arg (ap, mpq_ptr); } + while (x != NULL); va_end (ap); } diff --git a/mpz/clears.c b/mpz/clears.c index ac00b9931..849fc69f8 100644 --- a/mpz/clears.c +++ b/mpz/clears.c @@ -39,12 +39,13 @@ mpz_clears (mpz_ptr x, ...) va_start (ap, x); - while (x != NULL) + do { if (ALLOC (x)) __GMP_FREE_FUNC_LIMBS (PTR (x), ALLOC (x)); x = va_arg (ap, mpz_ptr); } + while (x != NULL); va_end (ap); } diff --git a/mpz/inits.c b/mpz/inits.c index 3dad9a4c8..925905144 100644 --- a/mpz/inits.c +++ b/mpz/inits.c @@ -40,7 +40,7 @@ mpz_inits (mpz_ptr x, ...) va_start (ap, x); - while (x != NULL) + do { ALLOC (x) = 0; PTR (x) = (mp_ptr) &dummy_limb; @@ -48,6 +48,7 @@ mpz_inits (mpz_ptr x, ...) x = va_arg (ap, mpz_ptr); } + while (x != NULL); va_end (ap); } |