summaryrefslogtreecommitdiff
path: root/gmp-h.in
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2015-05-30 08:07:57 +0200
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2015-05-30 08:07:57 +0200
commit0187f2cf5771cd859d53e0ffcc5543180d90dab3 (patch)
tree51f1a96d001137ccff18ce6b16ad0d881c30f9fc /gmp-h.in
parented1d881a9fdcb4c2f22fb0453bf462de4497ce7b (diff)
downloadgmp-0187f2cf5771cd859d53e0ffcc5543180d90dab3.tar.gz
Make mpn_zero_p public (inline).
Diffstat (limited to 'gmp-h.in')
-rw-r--r--gmp-h.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/gmp-h.in b/gmp-h.in
index d5fd0ce30..2dcddda5c 100644
--- a/gmp-h.in
+++ b/gmp-h.in
@@ -1475,6 +1475,11 @@ __GMP_DECLSPEC mp_limb_t mpn_addmul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
__GMP_DECLSPEC int mpn_cmp (mp_srcptr, mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
#endif
+#define mpn_zero_p __MPN(zero_p)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_zero_p)
+__GMP_DECLSPEC int mpn_zero_p (mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
#define mpn_divexact_1 __MPN(divexact_1)
__GMP_DECLSPEC void mpn_divexact_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
@@ -2156,6 +2161,22 @@ mpn_cmp (mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) __GMP_NOT
}
#endif
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_zero_p)
+#if ! defined (__GMP_FORCE_mpn_zero_p)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpn_zero_p (mp_srcptr __gmp_p, mp_size_t __gmp_n) __GMP_NOTHROW
+{
+ if (__gmp_n != 0)
+ do {
+ if (__gmp_p[--__gmp_n] != 0)
+ return 0;
+ } while (__gmp_n != 0);
+ return 1;
+}
+#endif
+
#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_sub)
#if ! defined (__GMP_FORCE_mpn_sub)
__GMP_EXTERN_INLINE