summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2012-12-06 11:09:42 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2012-12-06 11:09:42 +0100
commit55728301938e20a62c15ec1edee91b489c5d7fe3 (patch)
tree19e54bd844df6bf9265d3d0260c21cf2b1ec5d60
parent59bc8e8ad67150416f64ad9880020aa8c822bc53 (diff)
downloadgmp-55728301938e20a62c15ec1edee91b489c5d7fe3.tar.gz
mpz/{abs,neg}.c: Use NEWALLOC.
-rw-r--r--ChangeLog3
-rw-r--r--mpz/abs.c2
-rw-r--r--mpz/neg.c5
3 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 55e762eef..470f65264 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* tests/mpq/reuse.c: New test (adapted from mpf/reuse.c).
* tests/mpq/Makefile.am (check_PROGRAMS): Add reuse.
+ * mpz/abs.c: Use NEWALLOC.
+ * mpz/neg.c: Likewise.
+
2012-12-05 Niels Möller <nisse@lysator.liu.se>
* mpn/generic/brootinv.c (mpn_brootinv): Make valgrind happier, at
diff --git a/mpz/abs.c b/mpz/abs.c
index 564dc3a5e..fcbb4a2f1 100644
--- a/mpz/abs.c
+++ b/mpz/abs.c
@@ -33,7 +33,7 @@ mpz_abs (mpz_ptr w, mpz_srcptr u)
if (u != w)
{
- wp = MPZ_REALLOC (w, size);
+ wp = MPZ_NEWALLOC (w, size);
up = PTR (u);
diff --git a/mpz/neg.c b/mpz/neg.c
index cf4c6fe10..caf2df5d4 100644
--- a/mpz/neg.c
+++ b/mpz/neg.c
@@ -25,7 +25,8 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
void
mpz_neg (mpz_ptr w, mpz_srcptr u)
{
- mp_ptr wp, up;
+ mp_ptr wp;
+ mp_srcptr up;
mp_size_t usize, size;
usize = SIZ (u);
@@ -34,7 +35,7 @@ mpz_neg (mpz_ptr w, mpz_srcptr u)
{
size = ABS (usize);
- wp = MPZ_REALLOC (w, size);
+ wp = MPZ_NEWALLOC (w, size);
up = PTR (u);