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

mercurial at gmplib.org mercurial at gmplib.org
Tue Nov 3 04:27:44 UTC 2015


details:   /var/hg/gmp/rev/1c1930b54cb1
changeset: 16931:1c1930b54cb1
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Tue Nov 03 05:18:45 2015 +0100
description:
Read dh once.

details:   /var/hg/gmp/rev/4cc2dea88e1a
changeset: 16932:4cc2dea88e1a
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Tue Nov 03 05:19:40 2015 +0100
description:
mpn/generic/sec_div.c: Remove unused var.

details:   /var/hg/gmp/rev/a602edd997f6
changeset: 16933:a602edd997f6
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Tue Nov 03 05:21:12 2015 +0100
description:
Use the return value of _mpz_realloc.

details:   /var/hg/gmp/rev/19c740500b7c
changeset: 16934:19c740500b7c
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Tue Nov 03 05:26:59 2015 +0100
description:
ChangeLog

diffstat:

 ChangeLog             |   5 +++++
 mpn/generic/div_q.c   |   9 ++++-----
 mpn/generic/sec_div.c |   3 +--
 mpz/ior.c             |   7 +++----
 mpz/xor.c             |  10 ++++------
 5 files changed, 17 insertions(+), 17 deletions(-)

diffs (143 lines):

diff -r b08f9b35a40a -r 19c740500b7c ChangeLog
--- a/ChangeLog	Sun Nov 01 23:18:32 2015 +0100
+++ b/ChangeLog	Tue Nov 03 05:26:59 2015 +0100
@@ -1,3 +1,8 @@
+2015-11-03 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* mpz/ior.c, mpz/xor.x: Use the return value of _mpz_realloc.
+	* mpn/generic/sec_div.c: Remove unused var.
+
 2015-11-01  Torbjörn Granlund  <torbjorng at google.com>
 
 	* tests/misc.c (seed_from_tod, seed_from_urandom): New functions.
diff -r b08f9b35a40a -r 19c740500b7c mpn/generic/div_q.c
--- a/mpn/generic/div_q.c	Sun Nov 01 23:18:32 2015 +0100
+++ b/mpn/generic/div_q.c	Tue Nov 03 05:26:59 2015 +0100
@@ -6,7 +6,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, 2010 Free Software Foundation, Inc.
+Copyright 2009, 2010, 2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -119,9 +119,10 @@
 
   ASSERT_ALWAYS (FUDGE >= 2);
 
+  dh = dp[dn - 1];
   if (dn == 1)
     {
-      mpn_divrem_1 (qp, 0L, np, nn, dp[dn - 1]);
+      mpn_divrem_1 (qp, 0L, np, nn, dh);
       return;
     }
 
@@ -133,7 +134,6 @@
                           |_______|  */
       new_np = scratch;
 
-      dh = dp[dn - 1];
       if (LIKELY ((dh & GMP_NUMB_HIGHBIT) == 0))
 	{
 	  count_leading_zeros (cnt, dh);
@@ -228,7 +228,6 @@
 	new_np = TMP_ALLOC_LIMBS (new_nn + 1);
 
 
-      dh = dp[dn - 1];
       if (LIKELY ((dh & GMP_NUMB_HIGHBIT) == 0))
 	{
 	  count_leading_zeros (cnt, dh);
@@ -315,7 +314,7 @@
 	  rn -= rp[rn - 1] == 0;
 
           if (rn > nn || mpn_cmp (np, rp, nn) < 0)
-            mpn_decr_u (qp, 1);
+            MPN_DECR_U (qp, qn, 1);
         }
     }
 
diff -r b08f9b35a40a -r 19c740500b7c mpn/generic/sec_div.c
--- a/mpn/generic/sec_div.c	Sun Nov 01 23:18:32 2015 +0100
+++ b/mpn/generic/sec_div.c	Tue Nov 03 05:26:59 2015 +0100
@@ -4,7 +4,7 @@
 
    Contributed to the GNU project by Torbjörn Granlund.
 
-Copyright 2011-2014 Free Software Foundation, Inc.
+Copyright 2011-2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -73,7 +73,6 @@
 {
   mp_limb_t d1, d0;
   unsigned int cnt;
-  gmp_pi1_t dinv;
   mp_limb_t inv32;
 
   ASSERT (dn >= 1);
diff -r b08f9b35a40a -r 19c740500b7c mpz/ior.c
--- a/mpz/ior.c	Sun Nov 01 23:18:32 2015 +0100
+++ b/mpz/ior.c	Tue Nov 03 05:26:59 2015 +0100
@@ -1,7 +1,7 @@
 /* mpz_ior -- Logical inclusive or.
 
-Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2005, 2012, 2013 Free
-Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2005, 2012, 2013,
+2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -178,10 +178,9 @@
 
     if (ALLOC(res) < res_alloc)
       {
-	_mpz_realloc (res, res_alloc);
+	res_ptr = (mp_ptr) _mpz_realloc (res, res_alloc);
 	op1_ptr = PTR(op1);
 	/* op2_ptr points to temporary space.  */
-	res_ptr = PTR(res);
       }
 
     if (op1_size >= op2_size)
diff -r b08f9b35a40a -r 19c740500b7c mpz/xor.c
--- a/mpz/xor.c	Sun Nov 01 23:18:32 2015 +0100
+++ b/mpz/xor.c	Tue Nov 03 05:26:59 2015 +0100
@@ -1,7 +1,7 @@
 /* mpz_xor -- Logical xor.
 
-Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2005, 2012 Free Software
-Foundation, Inc.
+Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2005, 2012, 2015
+Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -57,10 +57,9 @@
 	    {
 	      if (ALLOC(res) < op1_size)
 		{
-		  _mpz_realloc (res, op1_size);
+		  res_ptr =_mpz_realloc (res, op1_size);
 		  /* No overlapping possible: op1_ptr = PTR(op1); */
 		  op2_ptr = PTR(op2);
-		  res_ptr = PTR(res);
 		}
 
 	      if (res_ptr != op1_ptr)
@@ -74,10 +73,9 @@
 	    {
 	      if (ALLOC(res) < op2_size)
 		{
-		  _mpz_realloc (res, op2_size);
+		  res_ptr =_mpz_realloc (res, op2_size);
 		  op1_ptr = PTR(op1);
 		  /* No overlapping possible: op2_ptr = PTR(op2); */
-		  res_ptr = PTR(res);
 		}
 
 	      if (res_ptr != op2_ptr)


More information about the gmp-commit mailing list