[Gmp-commit] /var/hg/gmp: mini-gmp: add mpn_zero.

mercurial at gmplib.org mercurial at gmplib.org
Sat Feb 1 23:09:26 UTC 2014


details:   /var/hg/gmp/rev/db2be6fb8b27
changeset: 16270:db2be6fb8b27
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Feb 01 20:58:12 2014 +0100
description:
mini-gmp: add mpn_zero.

diffstat:

 mini-gmp/mini-gmp.c |  9 +++++++++
 mini-gmp/mini-gmp.h |  1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diffs (30 lines):

diff -r 09c2da8f0aed -r db2be6fb8b27 mini-gmp/mini-gmp.c
--- a/mini-gmp/mini-gmp.c	Wed Jan 29 14:35:42 2014 +0100
+++ b/mini-gmp/mini-gmp.c	Sat Feb 01 20:58:12 2014 +0100
@@ -380,6 +380,15 @@
 
 #define mpn_zero_p(xp, n) (mpn_normalized_size ((xp), (n)) == 0)
 
+void
+mpn_zero (mp_ptr rp, mp_size_t n)
+{
+  mp_size_t i;
+
+  for (i = 0; i < n; i++)
+    rp[i] = 0;
+}
+
 mp_limb_t
 mpn_add_1 (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t b)
 {
diff -r 09c2da8f0aed -r db2be6fb8b27 mini-gmp/mini-gmp.h
--- a/mini-gmp/mini-gmp.h	Wed Jan 29 14:35:42 2014 +0100
+++ b/mini-gmp/mini-gmp.h	Sat Feb 01 20:58:12 2014 +0100
@@ -79,6 +79,7 @@
 
 void mpn_copyi (mp_ptr, mp_srcptr, mp_size_t);
 void mpn_copyd (mp_ptr, mp_srcptr, mp_size_t);
+void mpn_zero (mp_ptr, mp_size_t);
 
 int mpn_cmp (mp_srcptr, mp_srcptr, mp_size_t);
 


More information about the gmp-commit mailing list