[Gmp-commit] /var/hg/gmp: 2 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Sat Jun 2 07:51:53 CEST 2012


details:   /var/hg/gmp/rev/e812b055d996
changeset: 15042:e812b055d996
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jun 02 07:42:46 2012 +0200
description:
Copyright year.

details:   /var/hg/gmp/rev/41347195eaa3
changeset: 15043:41347195eaa3
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jun 02 07:51:02 2012 +0200
description:
__gmp_tmp_debug_alloc does not like to alloc 0 limbs.

diffstat:

 mpn/generic/remove.c |  4 ++--
 mpz/get_str.c        |  2 +-
 mpz/out_str.c        |  2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r ab2964606143 -r 41347195eaa3 mpn/generic/remove.c
--- a/mpn/generic/remove.c	Fri Jun 01 22:57:12 2012 +0200
+++ b/mpn/generic/remove.c	Sat Jun 02 07:51:02 2012 +0200
@@ -7,7 +7,7 @@
    SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES.  IN FACT, IT IS ALMOST
    GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
 
-Copyright 2009 Free Software Foundation, Inc.
+Copyright 2009, 2012 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -116,7 +116,6 @@
 
   for (i = npowers - 1; i >= 0; i--)
     {
-      qp[qn] = 0;
       pp = pwpsp[i];
       pn = pwpsn[i];
       if (qn < pn)
@@ -125,6 +124,7 @@
       if (pwr + ((mp_bitcnt_t) 1 << i) > cap)
 	continue;		/* V^i would bring us past cap */
 
+      qp[qn] = 0;
       mpn_bdiv_qr (qp2, tp, qp, qn + 1, pp, pn, scratch_out);
       if (!mpn_zero_p (tp, pn))
 	continue;		/* could not divide by V^i */
diff -r ab2964606143 -r 41347195eaa3 mpz/get_str.c
--- a/mpz/get_str.c	Fri Jun 01 22:57:12 2012 +0200
+++ b/mpz/get_str.c	Sat Jun 02 07:51:02 2012 +0200
@@ -82,7 +82,7 @@
   xp = PTR (x);
   if (! POW2_P (base))
     {
-      xp = TMP_ALLOC_LIMBS (x_size);
+      xp = TMP_ALLOC_LIMBS (x_size | 1);  /* |1 in case x_size==0 */
       MPN_COPY (xp, PTR (x), x_size);
     }
 
diff -r ab2964606143 -r 41347195eaa3 mpz/out_str.c
--- a/mpz/out_str.c	Fri Jun 01 22:57:12 2012 +0200
+++ b/mpz/out_str.c	Sat Jun 02 07:51:02 2012 +0200
@@ -79,7 +79,7 @@
   xp = PTR (x);
   if (! POW2_P (base))
     {
-      xp = TMP_ALLOC_LIMBS (x_size);
+      xp = TMP_ALLOC_LIMBS (x_size | 1);  /* |1 in case x_size==0 */
       MPN_COPY (xp, PTR (x), x_size);
     }
 


More information about the gmp-commit mailing list