patches/gmp/4.3.1/100-multiplicity-that-does-not-fit-an-int.patch
changeset 3103 a8bf927f6e37
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gmp/4.3.1/100-multiplicity-that-does-not-fit-an-int.patch	Tue Nov 06 17:02:06 2012 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +diff --git a/mpz/remove.c b/mpz/remove.c
     1.5 +--- a/mpz/remove.c
     1.6 ++++ b/mpz/remove.c
     1.7 +@@ -23,7 +23,7 @@
     1.8 + unsigned long int
     1.9 + mpz_remove (mpz_ptr dest, mpz_srcptr src, mpz_srcptr f)
    1.10 + {
    1.11 +-  mpz_t fpow[40];		/* inexhaustible...until year 2020 or so */
    1.12 ++  mpz_t fpow[GMP_LIMB_BITS];		/* Really MP_SIZE_T_BITS */
    1.13 +   mpz_t x, rem;
    1.14 +   unsigned long int pwr;
    1.15 +   int p;
    1.16 +@@ -69,7 +69,7 @@
    1.17 +       mpz_set (dest, x);
    1.18 +     }
    1.19 + 
    1.20 +-  pwr = (1 << p) - 1;
    1.21 ++  pwr = (1L << p) - 1;
    1.22 + 
    1.23 +   mpz_clear (fpow[p]);
    1.24 + 
    1.25 +diff --git a/mpz/remove.c b/mpz/remove.c
    1.26 +--- a/mpz/remove.c
    1.27 ++++ b/mpz/remove.c
    1.28 +@@ -80,7 +80,7 @@
    1.29 +       mpz_tdiv_qr (x, rem, dest, fpow[p]);
    1.30 +       if (SIZ (rem) == 0)
    1.31 + 	{
    1.32 +-	  pwr += 1 << p;
    1.33 ++	  pwr += 1L << p;
    1.34 + 	  mpz_set (dest, x);
    1.35 + 	}
    1.36 +       mpz_clear (fpow[p]);