summaryrefslogtreecommitdiff
path: root/mpz/setbit.c
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/setbit.c
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/setbit.c')
-rw-r--r--mpz/setbit.c16
1 files changed, 8 insertions, 8 deletions
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;
}