284 lines
6.7 KiB
Diff
284 lines
6.7 KiB
Diff
|
--- mpn/generic/dive_1.c
|
||
|
+++ mpn/generic/dive_1.c
|
||
|
@@ -70,7 +70,7 @@
|
||
|
{
|
||
|
mp_size_t i;
|
||
|
mp_limb_t c, h, l, ls, s, s_next, inverse, dummy;
|
||
|
- unsigned shift;
|
||
|
+ unsigned long shift;
|
||
|
|
||
|
ASSERT (size >= 1);
|
||
|
ASSERT (divisor != 0);
|
||
|
--- mpn/generic/divis.c
|
||
|
+++ mpn/generic/divis.c
|
||
|
@@ -118,7 +118,7 @@
|
||
|
|
||
|
if ((dlow & 1) == 0)
|
||
|
{
|
||
|
- unsigned twos;
|
||
|
+ unsigned long twos;
|
||
|
count_trailing_zeros (twos, dlow);
|
||
|
dlow >>= twos;
|
||
|
}
|
||
|
@@ -130,7 +130,7 @@
|
||
|
mp_limb_t dsecond = dp[1];
|
||
|
if (dsecond <= dmask)
|
||
|
{
|
||
|
- unsigned twos;
|
||
|
+ unsigned long twos;
|
||
|
count_trailing_zeros (twos, dlow);
|
||
|
dlow = (dlow >> twos) | (dsecond << (GMP_NUMB_BITS-twos));
|
||
|
ASSERT_LIMB (dlow);
|
||
|
--- mpn/generic/gcd.c
|
||
|
+++ mpn/generic/gcd.c
|
||
|
@@ -264,7 +264,7 @@
|
||
|
|
||
|
if ((up[0] & 1) == 0) /* Result even; remove twos. */
|
||
|
{
|
||
|
- unsigned int r;
|
||
|
+ unsigned long r;
|
||
|
count_trailing_zeros (r, up[0]);
|
||
|
mpn_rshift (anchor_up, up, usize, r);
|
||
|
usize -= (anchor_up[usize - 1] == 0);
|
||
|
@@ -382,7 +382,7 @@
|
||
|
up += 1, usize -= 1;
|
||
|
if ((up[0] & 1) == 0)
|
||
|
{
|
||
|
- unsigned int r;
|
||
|
+ unsigned long r;
|
||
|
count_trailing_zeros (r, up[0]);
|
||
|
mpn_rshift (up, up, usize, r);
|
||
|
usize -= (up[usize - 1] == 0);
|
||
|
--- mpn/generic/scan0.c
|
||
|
+++ mpn/generic/scan0.c
|
||
|
@@ -33,7 +33,7 @@
|
||
|
{
|
||
|
mp_size_t starting_word;
|
||
|
mp_limb_t alimb;
|
||
|
- int cnt;
|
||
|
+ long cnt;
|
||
|
mp_srcptr p;
|
||
|
|
||
|
/* Start at the word implied by STARTING_BIT. */
|
||
|
--- mpn/generic/scan1.c
|
||
|
+++ mpn/generic/scan1.c
|
||
|
@@ -33,7 +33,7 @@
|
||
|
{
|
||
|
mp_size_t starting_word;
|
||
|
mp_limb_t alimb;
|
||
|
- int cnt;
|
||
|
+ long cnt;
|
||
|
mp_srcptr p;
|
||
|
|
||
|
/* Start at the word implied by STARTING_BIT. */
|
||
|
--- mpq/set_d.c
|
||
|
+++ mpq/set_d.c
|
||
|
@@ -41,7 +41,7 @@
|
||
|
mp_limb_t tp[LIMBS_PER_DOUBLE];
|
||
|
mp_ptr np, dp;
|
||
|
mp_size_t nn, dn;
|
||
|
- int c;
|
||
|
+ long c;
|
||
|
|
||
|
DOUBLE_NAN_INF_ACTION (d,
|
||
|
__gmp_invalid_operation (),
|
||
|
--- mpq/set_f.c
|
||
|
+++ mpq/set_f.c
|
||
|
@@ -83,7 +83,7 @@
|
||
|
else
|
||
|
{
|
||
|
/* right shift numerator, adjust denominator accordingly */
|
||
|
- int shift;
|
||
|
+ long shift;
|
||
|
|
||
|
den_size--;
|
||
|
count_trailing_zeros (shift, flow);
|
||
|
--- mpz/cong.c
|
||
|
+++ mpz/cong.c
|
||
|
@@ -115,7 +115,7 @@
|
||
|
/* Strip low zero bits to get odd d required by modexact. If
|
||
|
d==e*2^n then a==c mod d if and only if both a==c mod e and
|
||
|
a==c mod 2^n, the latter having been done above. */
|
||
|
- unsigned twos;
|
||
|
+ unsigned long twos;
|
||
|
count_trailing_zeros (twos, dlow);
|
||
|
dlow >>= twos;
|
||
|
}
|
||
|
@@ -133,7 +133,7 @@
|
||
|
|
||
|
if (dsecond <= dmask)
|
||
|
{
|
||
|
- unsigned twos;
|
||
|
+ unsigned long twos;
|
||
|
count_trailing_zeros (twos, dlow);
|
||
|
dlow = (dlow >> twos) | (dsecond << (GMP_NUMB_BITS-twos));
|
||
|
ASSERT_LIMB (dlow);
|
||
|
--- mpz/cong_ui.c
|
||
|
+++ mpz/cong_ui.c
|
||
|
@@ -93,7 +93,7 @@
|
||
|
d==e*2^n then a==c mod d if and only if both a==c mod 2^n
|
||
|
and a==c mod e. */
|
||
|
|
||
|
- unsigned twos;
|
||
|
+ unsigned long twos;
|
||
|
|
||
|
if ((ap[0]-c) & LOW_ZEROS_MASK (d))
|
||
|
return 0;
|
||
|
--- mpz/divegcd.c
|
||
|
+++ mpz/divegcd.c
|
||
|
@@ -78,7 +78,7 @@
|
||
|
if (SIZ(d) == 1)
|
||
|
{
|
||
|
mp_limb_t dl = PTR(d)[0];
|
||
|
- int twos;
|
||
|
+ long twos;
|
||
|
|
||
|
if (dl == 1)
|
||
|
{
|
||
|
--- mpz/divexact.c
|
||
|
+++ mpz/divexact.c
|
||
|
@@ -114,7 +114,7 @@
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
- unsigned int r;
|
||
|
+ unsigned long r;
|
||
|
tp = (mp_ptr) TMP_ALLOC (tsize * BYTES_PER_MP_LIMB);
|
||
|
count_trailing_zeros (r, dp[0]);
|
||
|
mpn_rshift (tp, dp, tsize, r);
|
||
|
--- mpz/divis_ui.c
|
||
|
+++ mpz/divis_ui.c
|
||
|
@@ -29,7 +29,7 @@
|
||
|
{
|
||
|
mp_size_t asize;
|
||
|
mp_ptr ap;
|
||
|
- unsigned twos;
|
||
|
+ unsigned long twos;
|
||
|
|
||
|
asize = SIZ(a);
|
||
|
if (UNLIKELY (d == 0))
|
||
|
--- mpz/jacobi.c
|
||
|
+++ mpz/jacobi.c
|
||
|
@@ -87,7 +87,7 @@
|
||
|
mp_size_t asize, bsize;
|
||
|
mp_ptr ap, bp;
|
||
|
mp_limb_t alow, blow, ahigh, bhigh, asecond, bsecond;
|
||
|
- unsigned atwos, btwos;
|
||
|
+ unsigned long atwos, btwos;
|
||
|
int result_bit1;
|
||
|
TMP_DECL;
|
||
|
|
||
|
@@ -285,7 +285,7 @@
|
||
|
if ((alow & 1) == 0)
|
||
|
{
|
||
|
/* factors of 2 from a */
|
||
|
- unsigned twos;
|
||
|
+ unsigned long twos;
|
||
|
count_trailing_zeros (twos, alow);
|
||
|
TRACE (printf ("twos %u\n", twos));
|
||
|
result_bit1 ^= JACOBI_TWOS_U_BIT1 (twos, blow);
|
||
|
--- mpz/kronsz.c
|
||
|
+++ mpz/kronsz.c
|
||
|
@@ -32,7 +32,7 @@
|
||
|
mp_size_t b_size;
|
||
|
mp_size_t b_abs_size;
|
||
|
mp_limb_t a_limb, b_rem;
|
||
|
- unsigned twos;
|
||
|
+ unsigned long twos;
|
||
|
int result_bit1;
|
||
|
|
||
|
#if GMP_NUMB_BITS < BITS_PER_ULONG
|
||
|
--- mpz/kronuz.c
|
||
|
+++ mpz/kronuz.c
|
||
|
@@ -31,7 +31,7 @@
|
||
|
mp_limb_t b_low;
|
||
|
int b_abs_size;
|
||
|
mp_limb_t b_rem;
|
||
|
- int twos;
|
||
|
+ long twos;
|
||
|
int result_bit1;
|
||
|
|
||
|
/* (a/-1)=1 when a>=0, so the sign of b is ignored */
|
||
|
--- mpz/kronzs.c
|
||
|
+++ mpz/kronzs.c
|
||
|
@@ -58,7 +58,7 @@
|
||
|
if ((b_limb & 1) == 0)
|
||
|
{
|
||
|
mp_limb_t a_low = a_ptr[0];
|
||
|
- int twos;
|
||
|
+ long twos;
|
||
|
|
||
|
if (b_limb == 0)
|
||
|
return JACOBI_LS0 (a_low, a_size); /* (a/0) */
|
||
|
--- mpz/kronzu.c
|
||
|
+++ mpz/kronzu.c
|
||
|
@@ -54,7 +54,7 @@
|
||
|
else
|
||
|
{
|
||
|
mp_limb_t a_low = a_ptr[0];
|
||
|
- int twos;
|
||
|
+ long twos;
|
||
|
|
||
|
if (b == 0)
|
||
|
return JACOBI_LS0 (a_low, a_size); /* (a/0) */
|
||
|
--- mpz/n_pow_ui.c
|
||
|
+++ mpz/n_pow_ui.c
|
||
|
@@ -154,7 +154,8 @@
|
||
|
{
|
||
|
mp_ptr rp;
|
||
|
mp_size_t rtwos_limbs, ralloc, rsize;
|
||
|
- int rneg, i, cnt, btwos, r_bp_overlap;
|
||
|
+ int rneg, i, cnt, r_bp_overlap;
|
||
|
+ long btwos;
|
||
|
mp_limb_t blimb, rl;
|
||
|
unsigned long rtwos_bits;
|
||
|
#if HAVE_NATIVE_mpn_mul_2
|
||
|
--- mpz/perfpow.c
|
||
|
+++ mpz/perfpow.c
|
||
|
@@ -209,7 +209,7 @@
|
||
|
static unsigned long int
|
||
|
gcd (unsigned long int a, unsigned long int b)
|
||
|
{
|
||
|
- int an2, bn2, n2;
|
||
|
+ long an2, bn2, n2;
|
||
|
|
||
|
if (a == 0)
|
||
|
return b;
|
||
|
--- tests/mpn/t-mp_bases.c
|
||
|
+++ tests/mpn/t-mp_bases.c
|
||
|
@@ -31,7 +31,8 @@
|
||
|
main (int argc, char *argv[])
|
||
|
{
|
||
|
mp_limb_t want_bb, want_bb_inv;
|
||
|
- int base, want_chars_per_limb;
|
||
|
+ int base;
|
||
|
+ unsigned long want_chars_per_limb;
|
||
|
|
||
|
want_chars_per_limb = refmpn_chars_per_limb (10);
|
||
|
if (MP_BASES_CHARS_PER_LIMB_10 != want_chars_per_limb)
|
||
|
--- tests/t-count_zeros.c
|
||
|
+++ tests/t-count_zeros.c
|
||
|
@@ -44,7 +44,7 @@
|
||
|
void
|
||
|
check_ctz (int want, mp_limb_t n)
|
||
|
{
|
||
|
- int got;
|
||
|
+ long got;
|
||
|
count_trailing_zeros (got, n);
|
||
|
if (got != want)
|
||
|
{
|
||
|
--- tune/common.c
|
||
|
+++ tune/common.c
|
||
|
@@ -1825,9 +1825,9 @@
|
||
|
speed_routine_count_zeros_setup (struct speed_params *s,
|
||
|
mp_ptr xp, int leading, int zero)
|
||
|
{
|
||
|
- int i, c;
|
||
|
+ int i;
|
||
|
mp_limb_t n;
|
||
|
-
|
||
|
+ long c;
|
||
|
if (s->r == 0)
|
||
|
{
|
||
|
/* Make uniformly distributed data. If zero isn't allowed then change
|