summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortege <tege@gmplib.org>2002-05-07 02:21:22 +0200
committertege <tege@gmplib.org>2002-05-07 02:21:22 +0200
commit912d9fa5881d261ac1eb6f92bf8b6ec5ded7ab1d (patch)
treede24e96ac3a5b5e943c570f5c1580a6e44e4b701
parente3b336ad1cd6458215a595c7a02849314ae8fc26 (diff)
downloadgmp-912d9fa5881d261ac1eb6f92bf8b6ec5ded7ab1d.tar.gz
(MPZ_REALLOC): Rewrite to allow the use of _mpz_realloc return value.
-rw-r--r--gmp-impl.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/gmp-impl.h b/gmp-impl.h
index 963c71a53..bc7d8d8c8 100644
--- a/gmp-impl.h
+++ b/gmp-impl.h
@@ -1081,11 +1081,7 @@ void mpn_copyd _PROTO ((mp_ptr, mp_srcptr, mp_size_t));
} while (0)
/* Realloc for an mpz_t WHAT if it has less than NEEDED limbs. */
-#define MPZ_REALLOC(what,needed) \
- do { \
- if ((needed) > ALLOC (what)) \
- _mpz_realloc (what, needed); \
- } while (0)
+#define MPZ_REALLOC(z,n) ((n) > ALLOC(z) ? _mpz_realloc(z,n) : PTR(z))
#define MPZ_EQUAL_1_P(z) (SIZ(z)==1 && PTR(z)[0] == 1)