diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2011-05-05 22:51:35 +0200 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2011-05-05 22:51:35 +0200 |
commit | d7882730113cf0c36d975e30f6c356cda85a80db (patch) | |
tree | 5e13989240ba4fae4795e8a2b3c6f58b5fe4c43b /mpz/gcdext.c | |
parent | be4d6e7e326a372fd8551b4ec38b38231830cafd (diff) | |
download | gmp-d7882730113cf0c36d975e30f6c356cda85a80db.tar.gz |
Use MPZ_REALLOC.
Diffstat (limited to 'mpz/gcdext.c')
-rw-r--r-- | mpz/gcdext.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/mpz/gcdext.c b/mpz/gcdext.c index 47c992634..9867a2eee 100644 --- a/mpz/gcdext.c +++ b/mpz/gcdext.c @@ -55,9 +55,7 @@ mpz_gcdext (mpz_ptr g, mpz_ptr s, mpz_ptr t, mpz_srcptr a, mpz_srcptr b) /* g = |a|, s = sgn(a), t = 0. */ ssize = SIZ (a) >= 0 ? (asize != 0) : -1; - if (ALLOC (g) < asize) - _mpz_realloc (g, asize); - gp = PTR (g); + gp = MPZ_REALLOC (g, asize); MPN_COPY (gp, ap, asize); SIZ (g) = asize; @@ -102,16 +100,12 @@ mpz_gcdext (mpz_ptr g, mpz_ptr s, mpz_ptr t, mpz_srcptr a, mpz_srcptr b) if (s != NULL) { - if (ALLOC (s) < ssize) - _mpz_realloc (s, ssize); - sp = PTR (s); + sp = MPZ_REALLOC (s, ssize); MPN_COPY (sp, tmp_sp, ssize); SIZ (s) = SIZ (&stmp); } - if (ALLOC (g) < gsize) - _mpz_realloc (g, gsize); - gp = PTR (g); + gp = MPZ_REALLOC (g, gsize); MPN_COPY (gp, tmp_gp, gsize); SIZ (g) = gsize; |