summaryrefslogtreecommitdiff
path: root/mpz
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2002-02-08 22:49:38 +0100
committerKevin Ryde <user42@zip.com.au>2002-02-08 22:49:38 +0100
commit63acee91cd62262abc9fdf2bedbc467670d8ce88 (patch)
treef6585ae9b6aa404ee78c095308775fcfd56e5adb /mpz
parentcb859a0701946974ba6e353ca6d7255d0d2dee10 (diff)
downloadgmp-63acee91cd62262abc9fdf2bedbc467670d8ce88.tar.gz
* mpz/array_init.c, mpz/cfdiv_q_2exp.c, mpz/cfdiv_r_2exp.c,
mpz/cong_2exp.c, mpz/divis_2exp.c, mpz/hamdist.c, mpz/init2.c, mpz/mul_2exp.c, mpz/realloc2.c, mpz/scan0.c, mpz/scan1.c, mpz/setbit.c, mpz/tdiv_q_2exp.c, mpz/tdiv_r_2exp.c, mpz/tstbit.c, mpz/urandomb.c: Use GMP_NUMB_BITS.
Diffstat (limited to 'mpz')
-rw-r--r--mpz/array_init.c5
-rw-r--r--mpz/cfdiv_q_2exp.c8
-rw-r--r--mpz/cfdiv_r_2exp.c6
-rw-r--r--mpz/cong_2exp.c12
-rw-r--r--mpz/divis_2exp.c12
-rw-r--r--mpz/hamdist.c4
-rw-r--r--mpz/init2.c2
-rw-r--r--mpz/mul_2exp.c6
-rw-r--r--mpz/realloc2.c4
-rw-r--r--mpz/scan0.c12
-rw-r--r--mpz/scan1.c12
-rw-r--r--mpz/setbit.c16
-rw-r--r--mpz/tdiv_q_2exp.c6
-rw-r--r--mpz/tdiv_r_2exp.c6
-rw-r--r--mpz/tstbit.c6
-rw-r--r--mpz/urandomb.c4
16 files changed, 59 insertions, 62 deletions
diff --git a/mpz/array_init.c b/mpz/array_init.c
index 65448f614..dbe1b93a6 100644
--- a/mpz/array_init.c
+++ b/mpz/array_init.c
@@ -1,6 +1,7 @@
/* mpz_array_init (array, array_size, size_per_elem) --
-Copyright 1991, 1993, 1994, 1995, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1995, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -29,7 +30,7 @@ mpz_array_init (mpz_ptr arr, mp_size_t arr_size, mp_size_t nbits)
register size_t i;
mp_size_t nlimbs;
- nlimbs = (nbits + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB;
+ nlimbs = (nbits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS;
p = (mp_ptr) (*__gmp_allocate_func) (arr_size * nlimbs * BYTES_PER_MP_LIMB);
for (i = 0; i < arr_size; i++)
diff --git a/mpz/cfdiv_q_2exp.c b/mpz/cfdiv_q_2exp.c
index 44080b715..ea573e0dc 100644
--- a/mpz/cfdiv_q_2exp.c
+++ b/mpz/cfdiv_q_2exp.c
@@ -1,7 +1,7 @@
/* mpz_cdiv_q_2exp, mpz_fdiv_q_2exp -- quotient from mpz divided by 2^n.
-Copyright 1991, 1993, 1994, 1996, 1998, 1999, 2001 Free Software Foundation,
-Inc.
+Copyright 1991, 1993, 1994, 1996, 1998, 1999, 2001, 2002 Free Software
+Foundation, Inc.
This file is part of the GNU MP Library.
@@ -39,7 +39,7 @@ cfdiv_q_2exp (mpz_ptr w, mpz_srcptr u, unsigned long cnt, int dir)
usize = SIZ (u);
abs_usize = ABS (usize);
- limb_cnt = cnt / BITS_PER_MP_LIMB;
+ limb_cnt = cnt / GMP_NUMB_BITS;
wsize = abs_usize - limb_cnt;
if (wsize <= 0)
{
@@ -62,7 +62,7 @@ cfdiv_q_2exp (mpz_ptr w, mpz_srcptr u, unsigned long cnt, int dir)
round = up[i];
wp = PTR(w);
- cnt %= BITS_PER_MP_LIMB;
+ cnt %= GMP_NUMB_BITS;
if (cnt != 0)
{
round |= rmask & mpn_rshift (wp, up + limb_cnt, wsize, cnt);
diff --git a/mpz/cfdiv_r_2exp.c b/mpz/cfdiv_r_2exp.c
index 039198a97..7cf281f0e 100644
--- a/mpz/cfdiv_r_2exp.c
+++ b/mpz/cfdiv_r_2exp.c
@@ -1,6 +1,6 @@
/* mpz_cdiv_r_2exp, mpz_fdiv_r_2exp -- remainder from mpz divided by 2^n.
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -47,8 +47,8 @@ cfdiv_r_2exp (mpz_ptr w, mpz_srcptr u, unsigned long cnt, int dir)
return;
}
- limb_cnt = cnt / BITS_PER_MP_LIMB;
- cnt %= BITS_PER_MP_LIMB;
+ limb_cnt = cnt / GMP_NUMB_BITS;
+ cnt %= GMP_NUMB_BITS;
abs_usize = ABS (usize);
/* MPZ_REALLOC(w) below is only when w!=u, so we can fetch PTR(u) here
diff --git a/mpz/cong_2exp.c b/mpz/cong_2exp.c
index 53556130f..aa205be8e 100644
--- a/mpz/cong_2exp.c
+++ b/mpz/cong_2exp.c
@@ -1,7 +1,6 @@
-/* mpz_congruent_2exp_p -- test congruence of mpz mod 2^n */
+/* mpz_congruent_2exp_p -- test congruence of mpz mod 2^n.
-/*
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -18,8 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA.
-*/
+MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
@@ -36,8 +34,8 @@ mpz_congruent_2exp_p (mpz_srcptr a, mpz_srcptr c, unsigned long d)
if (ABSIZ(a) < ABSIZ(c))
MPZ_SRCPTR_SWAP (a, c);
- dlimbs = d / BITS_PER_MP_LIMB;
- dbits = d % BITS_PER_MP_LIMB;
+ dlimbs = d / GMP_NUMB_BITS;
+ dbits = d % GMP_NUMB_BITS;
dmask = (CNST_LIMB(1) << dbits) - 1;
ap = PTR(a);
diff --git a/mpz/divis_2exp.c b/mpz/divis_2exp.c
index e0552e067..e4c4dcaae 100644
--- a/mpz/divis_2exp.c
+++ b/mpz/divis_2exp.c
@@ -1,7 +1,6 @@
-/* mpz_divisible_2exp_p -- mpz by 2^n divisibility test */
+/* mpz_divisible_2exp_p -- mpz by 2^n divisibility test
-/*
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -18,8 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA.
-*/
+MA 02111-1307, USA. */
#include "gmp.h"
#include "gmp-impl.h"
@@ -34,7 +32,7 @@ mpz_divisible_2exp_p (mpz_srcptr a, unsigned long d)
int asize;
asize = ABSIZ(a);
- dlimbs = d / BITS_PER_MP_LIMB;
+ dlimbs = d / GMP_NUMB_BITS;
/* if d covers the whole of a, then only a==0 is divisible */
if (asize <= dlimbs)
@@ -47,7 +45,7 @@ mpz_divisible_2exp_p (mpz_srcptr a, unsigned long d)
return 0;
/* left over bits must be zero */
- dbits = d % BITS_PER_MP_LIMB;
+ dbits = d % GMP_NUMB_BITS;
dmask = (CNST_LIMB(1) << dbits) - 1;
return (ap[dlimbs] & dmask) == 0;
}
diff --git a/mpz/hamdist.c b/mpz/hamdist.c
index 1c4cfb4cd..45fb0d5b4 100644
--- a/mpz/hamdist.c
+++ b/mpz/hamdist.c
@@ -1,6 +1,6 @@
/* mpz_hamdist -- calculate hamming distance.
-Copyright 1994, 1996, 2001 Free Software Foundation, Inc.
+Copyright 1994, 1996, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -115,7 +115,7 @@ mpz_hamdist (mpz_srcptr u, mpz_srcptr v)
/* part of u corresponding to skipped v zeros */
step = old_vsize - vsize - 1;
- count += step * BITS_PER_MP_LIMB;
+ count += step * GMP_NUMB_BITS;
step = MIN (step, usize);
if (step != 0)
{
diff --git a/mpz/init2.c b/mpz/init2.c
index 6f5e6d007..29661b683 100644
--- a/mpz/init2.c
+++ b/mpz/init2.c
@@ -26,7 +26,7 @@ void
mpz_init2 (mpz_ptr x, unsigned long bits)
{
mp_size_t limbs;
- limbs = (bits + BITS_PER_MP_LIMB-1) / BITS_PER_MP_LIMB;
+ limbs = (bits + GMP_NUMB_BITS-1) / GMP_NUMB_BITS;
limbs = MAX (limbs, 1);
SIZ(x) = 0;
ALLOC(x) = limbs;
diff --git a/mpz/mul_2exp.c b/mpz/mul_2exp.c
index fa1db45c0..f2a7baf7f 100644
--- a/mpz/mul_2exp.c
+++ b/mpz/mul_2exp.c
@@ -1,6 +1,6 @@
/* mpz_mul_2exp -- Multiply a bignum by 2**CNT
-Copyright 1991, 1993, 1994, 1996, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1996, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -38,7 +38,7 @@ mpz_mul_2exp (mpz_ptr w, mpz_srcptr u, unsigned long int cnt)
return;
}
- limb_cnt = cnt / BITS_PER_MP_LIMB;
+ limb_cnt = cnt / GMP_NUMB_BITS;
wsize = abs_usize + limb_cnt + 1;
if (w->_mp_alloc < wsize)
_mpz_realloc (w, wsize);
@@ -46,7 +46,7 @@ mpz_mul_2exp (mpz_ptr w, mpz_srcptr u, unsigned long int cnt)
wp = w->_mp_d;
wsize = abs_usize + limb_cnt;
- cnt %= BITS_PER_MP_LIMB;
+ cnt %= GMP_NUMB_BITS;
if (cnt != 0)
{
wlimb = mpn_lshift (wp + limb_cnt, u->_mp_d, abs_usize, cnt);
diff --git a/mpz/realloc2.c b/mpz/realloc2.c
index 9059b73e1..a530bc29c 100644
--- a/mpz/realloc2.c
+++ b/mpz/realloc2.c
@@ -1,6 +1,6 @@
/* mpz_realloc2 -- change allocated data size.
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -28,7 +28,7 @@ mpz_realloc2 (mpz_ptr m, unsigned long bits)
mp_ptr mp;
mp_size_t new_alloc;
- new_alloc = (bits + BITS_PER_MP_LIMB-1) / BITS_PER_MP_LIMB;
+ new_alloc = (bits + GMP_NUMB_BITS-1) / GMP_NUMB_BITS;
/* Never allocate zero space. */
new_alloc = MAX (new_alloc, 1);
diff --git a/mpz/scan0.c b/mpz/scan0.c
index e44600062..501efc2f2 100644
--- a/mpz/scan0.c
+++ b/mpz/scan0.c
@@ -1,6 +1,6 @@
/* mpz_scan0 -- search for a 0 bit.
-Copyright 2000, 2001 Free Software Foundation, Inc.
+Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -36,7 +36,7 @@ mpz_scan0 (mpz_srcptr u, unsigned long starting_bit)
int size = SIZ(u);
unsigned abs_size = ABS(size);
mp_srcptr u_end = u_ptr + abs_size;
- unsigned long starting_limb = starting_bit / BITS_PER_MP_LIMB;
+ unsigned long starting_limb = starting_bit / GMP_NUMB_BITS;
mp_srcptr p = u_ptr + starting_limb;
mp_limb_t limb;
int cnt;
@@ -51,7 +51,7 @@ mpz_scan0 (mpz_srcptr u, unsigned long starting_bit)
if (size >= 0)
{
/* Mask to 1 all bits before starting_bit, thus ignoring them. */
- limb |= (CNST_LIMB(1) << (starting_bit % BITS_PER_MP_LIMB)) - 1;
+ limb |= (CNST_LIMB(1) << (starting_bit % GMP_NUMB_BITS)) - 1;
/* Search for a limb which isn't all ones. If the end is reached then
the zero bit immediately past the end is returned. */
@@ -59,7 +59,7 @@ mpz_scan0 (mpz_srcptr u, unsigned long starting_bit)
{
p++;
if (p == u_end)
- return (unsigned long) abs_size * BITS_PER_MP_LIMB;
+ return (unsigned long) abs_size * GMP_NUMB_BITS;
limb = *p;
}
@@ -92,7 +92,7 @@ mpz_scan0 (mpz_srcptr u, unsigned long starting_bit)
/* Now seeking a 1 bit. */
/* Mask to 0 all bits before starting_bit, thus ignoring them. */
- limb &= (MP_LIMB_T_MAX << (starting_bit % BITS_PER_MP_LIMB));
+ limb &= (MP_LIMB_T_MAX << (starting_bit % GMP_NUMB_BITS));
if (limb == 0)
{
@@ -120,5 +120,5 @@ mpz_scan0 (mpz_srcptr u, unsigned long starting_bit)
limb &= -limb;
count_leading_zeros (cnt, limb);
- return (p - u_ptr) * BITS_PER_MP_LIMB + BITS_PER_MP_LIMB-1 - cnt;
+ return (p - u_ptr) * GMP_NUMB_BITS + GMP_NUMB_BITS-1 - cnt;
}
diff --git a/mpz/scan1.c b/mpz/scan1.c
index 4ec1d2a3a..9d318cf24 100644
--- a/mpz/scan1.c
+++ b/mpz/scan1.c
@@ -1,6 +1,6 @@
/* mpz_scan1 -- search for a 1 bit.
-Copyright 2000, 2001 Free Software Foundation, Inc.
+Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -36,7 +36,7 @@ mpz_scan1 (mpz_srcptr u, unsigned long starting_bit)
int size = SIZ(u);
unsigned abs_size = ABS(size);
mp_srcptr u_end = u_ptr + abs_size;
- unsigned long starting_limb = starting_bit / BITS_PER_MP_LIMB;
+ unsigned long starting_limb = starting_bit / GMP_NUMB_BITS;
mp_srcptr p = u_ptr + starting_limb;
mp_limb_t limb;
int cnt;
@@ -51,7 +51,7 @@ mpz_scan1 (mpz_srcptr u, unsigned long starting_bit)
if (size >= 0)
{
/* Mask to 0 all bits before starting_bit, thus ignoring them. */
- limb &= (MP_LIMB_T_MAX << (starting_bit % BITS_PER_MP_LIMB));
+ limb &= (MP_LIMB_T_MAX << (starting_bit % GMP_NUMB_BITS));
if (limb == 0)
{
@@ -116,7 +116,7 @@ mpz_scan1 (mpz_srcptr u, unsigned long starting_bit)
/* Now seeking a 0 bit. */
/* Mask to 1 all bits before starting_bit, thus ignoring them. */
- limb |= (CNST_LIMB(1) << (starting_bit % BITS_PER_MP_LIMB)) - 1;
+ limb |= (CNST_LIMB(1) << (starting_bit % GMP_NUMB_BITS)) - 1;
/* Search for a limb which is not all ones. If the end is reached
then the zero immediately past the end is the result. */
@@ -124,7 +124,7 @@ mpz_scan1 (mpz_srcptr u, unsigned long starting_bit)
{
p++;
if (p == u_end)
- return abs_size * BITS_PER_MP_LIMB;
+ return abs_size * GMP_NUMB_BITS;
limb = *p;
}
@@ -138,5 +138,5 @@ mpz_scan1 (mpz_srcptr u, unsigned long starting_bit)
limb &= -limb;
count_leading_zeros (cnt, limb);
- return (p - u_ptr) * BITS_PER_MP_LIMB + BITS_PER_MP_LIMB-1 - cnt;
+ return (p - u_ptr) * GMP_NUMB_BITS + GMP_NUMB_BITS-1 - cnt;
}
diff --git a/mpz/setbit.c b/mpz/setbit.c
index bce208792..fab04cfcf 100644
--- a/mpz/setbit.c
+++ b/mpz/setbit.c
@@ -1,7 +1,7 @@
/* mpz_setbit -- set a specified bit.
-Copyright 1991, 1993, 1994, 1995, 1997, 1999, 2001 Free Software Foundation,
-Inc.
+Copyright 1991, 1993, 1994, 1995, 1997, 1999, 2001, 2002 Free Software
+Foundation, Inc.
This file is part of the GNU MP Library.
@@ -30,12 +30,12 @@ mpz_setbit (mpz_ptr d, unsigned long int bit_index)
mp_ptr dp = d->_mp_d;
mp_size_t limb_index;
- limb_index = bit_index / BITS_PER_MP_LIMB;
+ limb_index = bit_index / GMP_NUMB_BITS;
if (dsize >= 0)
{
if (limb_index < dsize)
{
- dp[limb_index] |= (mp_limb_t) 1 << (bit_index % BITS_PER_MP_LIMB);
+ dp[limb_index] |= (mp_limb_t) 1 << (bit_index % GMP_NUMB_BITS);
d->_mp_size = dsize;
}
else
@@ -48,7 +48,7 @@ mpz_setbit (mpz_ptr d, unsigned long int bit_index)
dp = d->_mp_d;
}
MPN_ZERO (dp + dsize, limb_index - dsize);
- dp[limb_index] = (mp_limb_t) 1 << (bit_index % BITS_PER_MP_LIMB);
+ dp[limb_index] = (mp_limb_t) 1 << (bit_index % GMP_NUMB_BITS);
d->_mp_size = limb_index + 1;
}
}
@@ -73,7 +73,7 @@ mpz_setbit (mpz_ptr d, unsigned long int bit_index)
{
if (limb_index < dsize)
{
- dp[limb_index] &= ~((mp_limb_t) 1 << (bit_index % BITS_PER_MP_LIMB));
+ dp[limb_index] &= ~((mp_limb_t) 1 << (bit_index % GMP_NUMB_BITS));
MPN_NORMALIZE (dp, dsize);
d->_mp_size = -dsize;
}
@@ -81,7 +81,7 @@ mpz_setbit (mpz_ptr d, unsigned long int bit_index)
else if (limb_index == zero_bound)
{
dp[limb_index] = ((dp[limb_index] - 1)
- & ~((mp_limb_t) 1 << (bit_index % BITS_PER_MP_LIMB))) + 1;
+ & ~((mp_limb_t) 1 << (bit_index % GMP_NUMB_BITS))) + 1;
if (dp[limb_index] == 0)
{
mp_size_t i;
@@ -107,7 +107,7 @@ mpz_setbit (mpz_ptr d, unsigned long int bit_index)
else
{
mpn_decr_u (dp + limb_index,
- (mp_limb_t) 1 << (bit_index % BITS_PER_MP_LIMB));
+ (mp_limb_t) 1 << (bit_index % GMP_NUMB_BITS));
dsize -= dp[dsize - 1] == 0;
d->_mp_size = -dsize;
}
diff --git a/mpz/tdiv_q_2exp.c b/mpz/tdiv_q_2exp.c
index 8741083e8..4a2c5bca3 100644
--- a/mpz/tdiv_q_2exp.c
+++ b/mpz/tdiv_q_2exp.c
@@ -1,7 +1,7 @@
/* mpz_tdiv_q_2exp -- Divide an integer by 2**CNT. Round the quotient
towards -infinity.
-Copyright 1991, 1993, 1994, 1996, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1996, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -30,7 +30,7 @@ mpz_tdiv_q_2exp (mpz_ptr w, mpz_srcptr u, unsigned long int cnt)
mp_size_t limb_cnt;
usize = u->_mp_size;
- limb_cnt = cnt / BITS_PER_MP_LIMB;
+ limb_cnt = cnt / GMP_NUMB_BITS;
wsize = ABS (usize) - limb_cnt;
if (wsize <= 0)
w->_mp_size = 0;
@@ -45,7 +45,7 @@ mpz_tdiv_q_2exp (mpz_ptr w, mpz_srcptr u, unsigned long int cnt)
wp = w->_mp_d;
up = u->_mp_d;
- cnt %= BITS_PER_MP_LIMB;
+ cnt %= GMP_NUMB_BITS;
if (cnt != 0)
{
mpn_rshift (wp, up + limb_cnt, wsize, cnt);
diff --git a/mpz/tdiv_r_2exp.c b/mpz/tdiv_r_2exp.c
index 74c6618e5..b301b9fc8 100644
--- a/mpz/tdiv_r_2exp.c
+++ b/mpz/tdiv_r_2exp.c
@@ -1,6 +1,6 @@
/* mpz_tdiv_r_2exp -- Divide a integer by 2**CNT and produce a remainder.
-Copyright 1991, 1993, 1994, 1995, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1995, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -27,7 +27,7 @@ mpz_tdiv_r_2exp (mpz_ptr res, mpz_srcptr in, unsigned long int cnt)
{
mp_size_t in_size = ABS (in->_mp_size);
mp_size_t res_size;
- mp_size_t limb_cnt = cnt / BITS_PER_MP_LIMB;
+ mp_size_t limb_cnt = cnt / GMP_NUMB_BITS;
mp_srcptr in_ptr = in->_mp_d;
if (in_size > limb_cnt)
@@ -35,7 +35,7 @@ mpz_tdiv_r_2exp (mpz_ptr res, mpz_srcptr in, unsigned long int cnt)
/* The input operand is (probably) greater than 2**CNT. */
mp_limb_t x;
- x = in_ptr[limb_cnt] & (((mp_limb_t) 1 << cnt % BITS_PER_MP_LIMB) - 1);
+ x = in_ptr[limb_cnt] & (((mp_limb_t) 1 << cnt % GMP_NUMB_BITS) - 1);
if (x != 0)
{
res_size = limb_cnt + 1;
diff --git a/mpz/tstbit.c b/mpz/tstbit.c
index 5b4492f42..1fb521a52 100644
--- a/mpz/tstbit.c
+++ b/mpz/tstbit.c
@@ -1,6 +1,6 @@
/* mpz_tstbit -- test a specified bit.
-Copyright 2000 Free Software Foundation, Inc.
+Copyright 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -45,7 +45,7 @@ mpz_tstbit (mpz_srcptr u, unsigned long bit_index)
mp_srcptr u_ptr = PTR(u);
int size = SIZ(u);
unsigned abs_size = ABS(size);
- unsigned long limb_index = bit_index / BITS_PER_MP_LIMB;
+ unsigned long limb_index = bit_index / GMP_NUMB_BITS;
mp_srcptr p = u_ptr + limb_index;
mp_limb_t limb;
@@ -68,5 +68,5 @@ mpz_tstbit (mpz_srcptr u, unsigned long bit_index)
}
}
- return (limb >> (bit_index % BITS_PER_MP_LIMB)) & 1;
+ return (limb >> (bit_index % GMP_NUMB_BITS)) & 1;
}
diff --git a/mpz/urandomb.c b/mpz/urandomb.c
index 2533418e4..f07b8013c 100644
--- a/mpz/urandomb.c
+++ b/mpz/urandomb.c
@@ -2,7 +2,7 @@
integer in the range 0 to 2^N - 1, inclusive, using STATE as the
random state previously initialized by a call to gmp_randinit().
-Copyright 1999, 2000 Free Software Foundation, Inc.
+Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -30,7 +30,7 @@ mpz_urandomb (mpz_ptr rop, gmp_randstate_t rstate, unsigned long int nbits)
mp_ptr rp;
mp_size_t size;
- size = (nbits + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB;
+ size = (nbits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS;
if (ALLOC (rop) < size)
_mpz_realloc (rop, size);