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

mercurial at gmplib.org mercurial at gmplib.org
Mon Jun 1 20:02:57 UTC 2015


details:   /var/hg/gmp/rev/faf100614936
changeset: 16670:faf100614936
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon Jun 01 21:54:11 2015 +0200
description:
mini-gmp: Add public mpn_zero_p

details:   /var/hg/gmp/rev/104ecfe38735
changeset: 16671:104ecfe38735
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon Jun 01 22:02:48 2015 +0200
description:
ChangeLog

diffstat:

 ChangeLog              |  9 +++++++++
 mini-gmp/mini-gmp.c    |  8 ++++++--
 mini-gmp/mini-gmp.h    |  3 ++-
 mpz/combit.c           |  2 +-
 mpz/scan1.c            |  2 +-
 tests/mpn/t-brootinv.c |  2 +-
 tests/mpn/t-div.c      |  2 +-
 tests/mpn/t-minvert.c  |  2 +-
 8 files changed, 22 insertions(+), 8 deletions(-)

diffs (112 lines):

diff -r f2964bc8fb03 -r 104ecfe38735 ChangeLog
--- a/ChangeLog	Mon Jun 01 06:12:25 2015 +0200
+++ b/ChangeLog	Mon Jun 01 22:02:48 2015 +0200
@@ -12,6 +12,15 @@
 	* mpn/generic/zero_p: New file to include the function in the library.
 	* configure.ac (gmp_mpn_functions): Add it.
 	* doc/gmp.texi: Document it.
+
+	* mpz/combit.c: Call mpn_zero_p only if size is not zero.
+	* mpz/scan1.c: Likewise.
+	* tests/mpn/t-brootinv.c: Likewise.
+	* tests/mpn/t-div.c: Likewise.
+	* tests/mpn/t-minvert.c: Likewise.
+
+	* mini-gmp/mini-gmp.h: Declare mpn_zero_p.
+	* mini-gmp/mini-gmp.c: Define mpn_zero_p as a function, not a macro.
 	
 2015-05-28  Niels Möller  <nisse at lysator.liu.se>
 
diff -r f2964bc8fb03 -r 104ecfe38735 mini-gmp/mini-gmp.c
--- a/mini-gmp/mini-gmp.c	Mon Jun 01 06:12:25 2015 +0200
+++ b/mini-gmp/mini-gmp.c	Mon Jun 01 22:02:48 2015 +0200
@@ -2,7 +2,7 @@
 
    Contributed to the GNU project by Niels Möller
 
-Copyright 1991-1997, 1999-2014 Free Software Foundation, Inc.
+Copyright 1991-1997, 1999-2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -378,7 +378,11 @@
   return n;
 }
 
-#define mpn_zero_p(xp, n) (mpn_normalized_size ((xp), (n)) == 0)
+int
+mpn_zero_p(mp_srcptr rp, mp_size_t n)
+{
+  return mpn_normalized_size (rp, n) == 0;
+}
 
 void
 mpn_zero (mp_ptr rp, mp_size_t n)
diff -r f2964bc8fb03 -r 104ecfe38735 mini-gmp/mini-gmp.h
--- a/mini-gmp/mini-gmp.h	Mon Jun 01 06:12:25 2015 +0200
+++ b/mini-gmp/mini-gmp.h	Mon Jun 01 22:02:48 2015 +0200
@@ -1,6 +1,6 @@
 /* mini-gmp, a minimalistic implementation of a GNU GMP subset.
 
-Copyright 2011-2014 Free Software Foundation, Inc.
+Copyright 2011-2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -82,6 +82,7 @@
 void mpn_zero (mp_ptr, mp_size_t);
 
 int mpn_cmp (mp_srcptr, mp_srcptr, mp_size_t);
+int mpn_zero_p (mp_srcptr, mp_size_t);
 
 mp_limb_t mpn_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
 mp_limb_t mpn_add_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
diff -r f2964bc8fb03 -r 104ecfe38735 mpz/combit.c
--- a/mpz/combit.c	Mon Jun 01 06:12:25 2015 +0200
+++ b/mpz/combit.c	Mon Jun 01 22:02:48 2015 +0200
@@ -1,6 +1,6 @@
 /* mpz_combit -- complement a specified bit.
 
-Copyright 2002, 2003, 2012 Free Software Foundation, Inc.
+Copyright 2002, 2003, 2012, 2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
diff -r f2964bc8fb03 -r 104ecfe38735 mpz/scan1.c
--- a/mpz/scan1.c	Mon Jun 01 06:12:25 2015 +0200
+++ b/mpz/scan1.c	Mon Jun 01 22:02:48 2015 +0200
@@ -1,6 +1,6 @@
 /* mpz_scan1 -- search for a 1 bit.
 
-Copyright 2000-2002, 2004, 2012 Free Software Foundation, Inc.
+Copyright 2000-2002, 2004, 2012, 2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
diff -r f2964bc8fb03 -r 104ecfe38735 tests/mpn/t-brootinv.c
--- a/tests/mpn/t-brootinv.c	Mon Jun 01 06:12:25 2015 +0200
+++ b/tests/mpn/t-brootinv.c	Mon Jun 01 22:02:48 2015 +0200
@@ -1,4 +1,4 @@
-/* Copyright 2012 Free Software Foundation, Inc.
+/* Copyright 2012, 2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library test suite.
 
diff -r f2964bc8fb03 -r 104ecfe38735 tests/mpn/t-div.c
--- a/tests/mpn/t-div.c	Mon Jun 01 06:12:25 2015 +0200
+++ b/tests/mpn/t-div.c	Mon Jun 01 22:02:48 2015 +0200
@@ -1,4 +1,4 @@
-/* Copyright 2006, 2007, 2009, 2010, 2013, 2014 Free Software Foundation, Inc.
+/* Copyright 2006, 2007, 2009, 2010, 2013-2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library test suite.
 
diff -r f2964bc8fb03 -r 104ecfe38735 tests/mpn/t-minvert.c
--- a/tests/mpn/t-minvert.c	Mon Jun 01 06:12:25 2015 +0200
+++ b/tests/mpn/t-minvert.c	Mon Jun 01 22:02:48 2015 +0200
@@ -1,4 +1,4 @@
-/* Copyright 2013, 2014 Free Software Foundation, Inc.
+/* Copyright 2013-2015 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library test suite.
 


More information about the gmp-commit mailing list