diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2009-12-20 23:54:57 +0100 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2009-12-20 23:54:57 +0100 |
commit | 3ba1597c34eeddef0c820863d98ed9506c8d3e9c (patch) | |
tree | 967966420d447f3e630ca1cc85709b7f9c1e03af /mpz/scan0.c | |
parent | a6426a5313cac3c0fb05358e7d254653222f745f (diff) | |
download | gmp-3ba1597c34eeddef0c820863d98ed9506c8d3e9c.tar.gz |
Change all bit counts for bignums to use mp_bitcnt_t. Update documentation.
Diffstat (limited to 'mpz/scan0.c')
-rw-r--r-- | mpz/scan0.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mpz/scan0.c b/mpz/scan0.c index 3ad0941a3..9cb05337d 100644 --- a/mpz/scan0.c +++ b/mpz/scan0.c @@ -27,14 +27,14 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ search under u<0, but usually the search won't go very far so it seems reasonable to inline that code. */ -unsigned long -mpz_scan0 (mpz_srcptr u, unsigned long starting_bit) +mp_bitcnt_t +mpz_scan0 (mpz_srcptr u, mp_bitcnt_t starting_bit) { mp_srcptr u_ptr = PTR(u); mp_size_t size = SIZ(u); mp_size_t abs_size = ABS(size); mp_srcptr u_end = u_ptr + abs_size; - unsigned long starting_limb = starting_bit / GMP_NUMB_BITS; + mp_size_t starting_limb = starting_bit / GMP_NUMB_BITS; mp_srcptr p = u_ptr + starting_limb; mp_limb_t limb; int cnt; @@ -57,7 +57,7 @@ mpz_scan0 (mpz_srcptr u, unsigned long starting_bit) { p++; if (p == u_end) - return (unsigned long) abs_size * GMP_NUMB_BITS; + return (mp_bitcnt_t) abs_size * GMP_NUMB_BITS; limb = *p; } @@ -115,5 +115,5 @@ mpz_scan0 (mpz_srcptr u, unsigned long starting_bit) ASSERT (limb != 0); count_trailing_zeros (cnt, limb); - return (p - u_ptr) * GMP_NUMB_BITS + cnt; + return (mp_bitcnt_t) (p - u_ptr) * GMP_NUMB_BITS + cnt; } |