diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2015-05-30 08:07:57 +0200 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2015-05-30 08:07:57 +0200 |
commit | 0187f2cf5771cd859d53e0ffcc5543180d90dab3 (patch) | |
tree | 51f1a96d001137ccff18ce6b16ad0d881c30f9fc /gmp-h.in | |
parent | ed1d881a9fdcb4c2f22fb0453bf462de4497ce7b (diff) | |
download | gmp-0187f2cf5771cd859d53e0ffcc5543180d90dab3.tar.gz |
Make mpn_zero_p public (inline).
Diffstat (limited to 'gmp-h.in')
-rw-r--r-- | gmp-h.in | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 |