366 changes: 183 additions & 183 deletions mpirxx.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mpn/generic/bdivmod.c
Expand Up @@ -55,7 +55,7 @@ MA 02110-1301, USA. */

mp_limb_t
mpn_bdivmod (mp_ptr qp, mp_ptr up, mp_size_t usize,
mp_srcptr vp, mp_size_t vsize, gmp_ui d)
mp_srcptr vp, mp_size_t vsize, mpir_ui d)
{
mp_limb_t v_inv;

Expand Down
4 changes: 2 additions & 2 deletions mpn/generic/fib2_ui.c
Expand Up @@ -62,11 +62,11 @@ MA 02110-1301, USA. */
fp+=2*(-1)^n, etc. */

mp_size_t
mpn_fib2_ui (mp_ptr fp, mp_ptr f1p, gmp_ui n)
mpn_fib2_ui (mp_ptr fp, mp_ptr f1p, mpir_ui n)
{
mp_ptr xp, yp;
mp_size_t size;
gmp_ui nfirst, mask;
mpir_ui nfirst, mask;
TMP_DECL;

TRACE (printf ("mpn_fib2_ui n=%lu\n", n));
Expand Down
4 changes: 2 additions & 2 deletions mpn/generic/get_d.c
Expand Up @@ -104,8 +104,8 @@ mpn_get_d (mp_srcptr ptr, mp_size_t size, mp_size_t sign, long exp)
/* Adjust exp to a radix point just above {ptr,size}, guarding against
overflow. After this exp can of course be reduced to anywhere within
the {ptr,size} region without underflow. */
if (UNLIKELY ((gmp_ui) (GMP_NUMB_BITS * size)
> (gmp_ui) (LONG_MAX - exp)))
if (UNLIKELY ((mpir_ui) (GMP_NUMB_BITS * size)
> (mpir_ui) (LONG_MAX - exp)))
{
goto ieee_infinity;

Expand Down
2 changes: 1 addition & 1 deletion mpn/generic/invert.c
Expand Up @@ -148,7 +148,7 @@ mpn_invert (mp_ptr xp, mp_srcptr ap, mp_size_t n)
else
{
mp_size_t m = n + 1;
gmp_ui k;
mpir_ui k;
int cc;

k = mpn_fft_best_k (m, 0);
Expand Down
12 changes: 6 additions & 6 deletions mpn/generic/mulmod_2expm1.c
Expand Up @@ -30,7 +30,7 @@ Boston, MA 02110-1301, USA.
// NOTE: not reduced fully means the representation is redundant , although only 0 has two representations ie 0 and 2^b-1
inline static void
mpn_mulmod_2expm1_basecase (mp_ptr xp, mp_srcptr yp, mp_srcptr zp,
gmp_ui b, mp_ptr tp)
mpir_ui b, mp_ptr tp)
{
mp_size_t n, k;
mp_limb_t c;
Expand Down Expand Up @@ -83,7 +83,7 @@ mpn_mulmod_2expm1_basecase (mp_ptr xp, mp_srcptr yp, mp_srcptr zp,
*/
// tp requires 5(n+lg(b)) space
void
mpn_mulmod_2expm1 (mp_ptr xp, mp_ptr yp, mp_ptr zp, gmp_ui b,
mpn_mulmod_2expm1 (mp_ptr xp, mp_ptr yp, mp_ptr zp, mpir_ui b,
mp_ptr tp)
{
mp_size_t h, n, m, k;
Expand Down Expand Up @@ -257,7 +257,7 @@ ASSERT_NOCARRY(mpn_add_1(xp,xp,n,c));
return;}
// (xp,n) = (yp,yn)%(2^b-1) not fully reduced , reduced to nearest limb
void mpn_mod_2expm1(mp_ptr xp,mp_srcptr yp,mp_size_t yn,gmp_ui b)
void mpn_mod_2expm1(mp_ptr xp,mp_srcptr yp,mp_size_t yn,mpir_ui b)
{mp_limb_t c=0;mp_size_t n;
ASSERT(yn>0);//ASSERT(n>0);
Expand Down Expand Up @@ -297,7 +297,7 @@ if(c>=0){c=mpn_sub_1(xp,xp,n,c);}else{c=-c;}
c=mpn_add_1(xp,xp,n,c);
return c;}
void mpn_mod_2expm1(mp_ptr xp,mp_ptr tp,mp_size_t m,gmp_ui b)
void mpn_mod_2expm1(mp_ptr xp,mp_ptr tp,mp_size_t m,mpir_ui b)
{mp_limb_t c;mp_size_t n,k;mp_ptr ttp;
n=BITS_TO_LIMBS(b);k=GMP_NUMB_BITS*n-b;
ttp=__GMP_ALLOCATE_FUNC_LIMBS(2*n);MPN_ZERO(ttp,2*n);MPN_COPY(ttp,tp,m);
Expand All @@ -308,7 +308,7 @@ c=xp[n-1]>>(GMP_NUMB_BITS-k);xp[n-1]&=GMP_NUMB_MASK>>k;
MPN_INCR_U(xp,n,c);return;}
int mpn_mod_2expp1(mp_ptr xp,mp_ptr tp,mp_size_t m,gmp_ui b)
int mpn_mod_2expp1(mp_ptr xp,mp_ptr tp,mp_size_t m,mpir_ui b)
{mp_size_t n,k;mp_limb_t c;mp_ptr ttp;
n=BITS_TO_LIMBS(b);k=GMP_NUMB_BITS*n-b;
Expand All @@ -321,7 +321,7 @@ xp[n-1]&=GMP_NUMB_MASK>>k;
return c;}
void mpn_mulmod_2expm1_new(mp_ptr xp,mp_ptr yp,mp_ptr zp,gmp_ui b,mp_ptr tp)
void mpn_mulmod_2expm1_new(mp_ptr xp,mp_ptr yp,mp_ptr zp,mpir_ui b,mp_ptr tp)
{mp_size_t h,n,m,k;int bor,c,c1,c2;mp_ptr S,D,typm,tzpm,typp,tzpp,temp;mp_limb_t car;
// want y*z %(2^n-1) // want y*z%(2^(2m)-1) = y*z%((2^m-1)(2^m+1)) // use CRT
Expand Down
4 changes: 2 additions & 2 deletions mpn/generic/mulmod_2expp1_basecase.c
Expand Up @@ -35,7 +35,7 @@ static mp_size_t tab[]={0,0,0,2632,304,448,1024,2304,6400,11264,45056,114688,327
// NOTE: 2n is not the same as 2b rounded up to nearest limb
inline static int
mpn_mulmod_2expp1_internal (mp_ptr xp, mp_srcptr yp, mp_srcptr zp,
gmp_ui b, mp_ptr tp)
mpir_ui b, mp_ptr tp)
{
mp_size_t n, k;
mp_limb_t c;
Expand Down Expand Up @@ -93,7 +93,7 @@ mpn_mulmod_2expp1_internal (mp_ptr xp, mp_srcptr yp, mp_srcptr zp,
// c is the top bits of the inputs, must be fully reduced
int
mpn_mulmod_2expp1_basecase (mp_ptr xp, mp_srcptr yp, mp_srcptr zp, int c,
gmp_ui b, mp_ptr tp)
mpir_ui b, mp_ptr tp)
{
int cy, cz;
mp_size_t n, k;
Expand Down
6 changes: 3 additions & 3 deletions mpn/generic/rrandom.c
Expand Up @@ -27,7 +27,7 @@ Boston, MA 02110-1301, USA.
#include "mpir.h"
#include "gmp-impl.h"

static void gmp_rrandomb _PROTO ((mp_ptr rp, gmp_randstate_t rstate, gmp_ui nbits));
static void gmp_rrandomb _PROTO ((mp_ptr rp, gmp_randstate_t rstate, mpir_ui nbits));

/* Ask _gmp_rand for 32 bits per call unless that's more than a limb can hold.
Thus, we get the same random number sequence in the common cases.
Expand Down Expand Up @@ -58,9 +58,9 @@ mpn_rrandom (mp_ptr rp, gmp_randstate_t rnd, mp_size_t n)
}

static void
gmp_rrandomb (mp_ptr rp, gmp_randstate_t rstate, gmp_ui nbits)
gmp_rrandomb (mp_ptr rp, gmp_randstate_t rstate, mpir_ui nbits)
{
gmp_ui bi;
mpir_ui bi;
mp_limb_t ranm; /* buffer for random bits */
unsigned cap_chunksize, chunksize;
mp_size_t i;
Expand Down
2 changes: 1 addition & 1 deletion mpn/generic/urandomb.c
Expand Up @@ -22,5 +22,5 @@ Boston, MA 02110-1301, USA.
#include "mpir.h"
#include "gmp-impl.h"

void mpn_urandomb(mp_ptr rp, gmp_randstate_t rnd, gmp_ui n)
void mpn_urandomb(mp_ptr rp, gmp_randstate_t rnd, mpir_ui n)
{_gmp_rand(rp,rnd,n);return;}
2 changes: 1 addition & 1 deletion mpq/cmp_si.c
Expand Up @@ -28,7 +28,7 @@ MA 02110-1301, USA. */
it a tail call here. */

int
_mpq_cmp_si (mpq_srcptr q, gmp_si n, gmp_ui d)
_mpq_cmp_si (mpq_srcptr q, mpir_si n, mpir_ui d)
{
/* need canonical sign to get right result */
ASSERT (q->_mp_den._mp_size > 0);
Expand Down
2 changes: 1 addition & 1 deletion mpq/cmp_ui.c
Expand Up @@ -26,7 +26,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

int
_mpq_cmp_ui (mpq_srcptr op1, gmp_ui num2, gmp_ui den2)
_mpq_cmp_ui (mpq_srcptr op1, mpir_ui num2, mpir_ui den2)
{
mp_size_t num1_size = op1->_mp_num._mp_size;
mp_size_t den1_size = op1->_mp_den._mp_size;
Expand Down
4 changes: 2 additions & 2 deletions mpq/set_si.c
Expand Up @@ -24,9 +24,9 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

void
mpq_set_si (mpq_ptr dest, gmp_si num, gmp_ui den)
mpq_set_si (mpq_ptr dest, mpir_si num, mpir_ui den)
{
gmp_ui abs_num;
mpir_ui abs_num;

if (GMP_NUMB_BITS < BITS_PER_UI)
{
Expand Down
2 changes: 1 addition & 1 deletion mpq/set_ui.c
Expand Up @@ -24,7 +24,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

void
mpq_set_ui (mpq_ptr dest, gmp_ui num, gmp_ui den)
mpq_set_ui (mpq_ptr dest, mpir_ui num, mpir_ui den)
{
if (GMP_NUMB_BITS < BITS_PER_UI)
{
Expand Down
2 changes: 1 addition & 1 deletion mpz/aors_ui.h
Expand Up @@ -47,7 +47,7 @@ Error, need OPERATION_add_ui or OPERATION_sub_ui


void
FUNCTION (mpz_ptr w, mpz_srcptr u, gmp_ui vval)
FUNCTION (mpz_ptr w, mpz_srcptr u, mpir_ui vval)
{
mp_srcptr up;
mp_ptr wp;
Expand Down
4 changes: 2 additions & 2 deletions mpz/aorsmul_i.c
Expand Up @@ -192,7 +192,7 @@ mpz_aorsmul_1 (mpz_ptr w, mpz_srcptr x, mp_limb_t y, mp_size_t sub)


void
mpz_addmul_ui (mpz_ptr w, mpz_srcptr x, gmp_ui y)
mpz_addmul_ui (mpz_ptr w, mpz_srcptr x, mpir_ui y)
{
#if BITS_PER_UI > GMP_NUMB_BITS
if (UNLIKELY (y > GMP_NUMB_MAX && SIZ(x) != 0))
Expand Down Expand Up @@ -220,7 +220,7 @@ mpz_addmul_ui (mpz_ptr w, mpz_srcptr x, gmp_ui y)
}

void
mpz_submul_ui (mpz_ptr w, mpz_srcptr x, gmp_ui y)
mpz_submul_ui (mpz_ptr w, mpz_srcptr x, mpir_ui y)
{
#if BITS_PER_UI > GMP_NUMB_BITS
if (y > GMP_NUMB_MAX && SIZ(x) != 0)
Expand Down
4 changes: 2 additions & 2 deletions mpz/bin_ui.c
Expand Up @@ -40,7 +40,7 @@ MA 02110-1301, USA. */
} while (0)

void
mpz_bin_ui (mpz_ptr r, mpz_srcptr n, gmp_ui k)
mpz_bin_ui (mpz_ptr r, mpz_srcptr n, mpir_ui k)
{
mpz_t ni;
mp_limb_t i;
Expand Down Expand Up @@ -81,7 +81,7 @@ mpz_bin_ui (mpz_ptr r, mpz_srcptr n, gmp_ui k)
= ni, and new ni of ni+k-ni = k. */
if (mpz_cmp_ui (ni, k) < 0)
{
gmp_ui tmp;
mpir_ui tmp;
tmp = k;
k = mpz_get_ui (ni);
mpz_set_ui (ni, tmp);
Expand Down
6 changes: 3 additions & 3 deletions mpz/bin_uiui.c
Expand Up @@ -50,11 +50,11 @@ MA 02110-1301, USA. */
} while (0)

void
mpz_bin_uiui (mpz_ptr r, gmp_ui n, gmp_ui k)
mpz_bin_uiui (mpz_ptr r, mpir_ui n, mpir_ui k)
{
gmp_ui i, j;
mpir_ui i, j;
mp_limb_t nacc, kacc;
gmp_ui cnt;
mpir_ui cnt;
mp_size_t rsize, ralloc;
mp_ptr rp;

Expand Down
4 changes: 2 additions & 2 deletions mpz/cdiv_q_ui.c
Expand Up @@ -25,8 +25,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_cdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_cdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn, qn;
mp_ptr np, qp;
Expand Down
4 changes: 2 additions & 2 deletions mpz/cdiv_qr_ui.c
Expand Up @@ -26,8 +26,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_cdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_cdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn, qn;
mp_ptr np, qp;
Expand Down
4 changes: 2 additions & 2 deletions mpz/cdiv_r_ui.c
Expand Up @@ -26,8 +26,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_cdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_cdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn;
mp_ptr np;
Expand Down
4 changes: 2 additions & 2 deletions mpz/cdiv_ui.c
Expand Up @@ -26,8 +26,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_cdiv_ui (mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_cdiv_ui (mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn;
mp_ptr np;
Expand Down
6 changes: 3 additions & 3 deletions mpz/cmp_si.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

int
_mpz_cmp_si (mpz_srcptr u, gmp_si v_digit)
_mpz_cmp_si (mpz_srcptr u, mpir_si v_digit)
{
mp_size_t usize = u->_mp_size;
mp_size_t vsize;
Expand Down Expand Up @@ -58,10 +58,10 @@ _mpz_cmp_si (mpz_srcptr u, gmp_si v_digit)

u_digit = u->_mp_d[0];

if (u_digit == (mp_limb_t) (gmp_ui) v_digit)
if (u_digit == (mp_limb_t) (mpir_ui) v_digit)
return 0;

if (u_digit > (mp_limb_t) (gmp_ui) v_digit)
if (u_digit > (mp_limb_t) (mpir_ui) v_digit)
return usize;
else
return -usize;
Expand Down
2 changes: 1 addition & 1 deletion mpz/cmp_ui.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

int
_mpz_cmp_ui (mpz_srcptr u, gmp_ui v_digit)
_mpz_cmp_ui (mpz_srcptr u, mpir_ui v_digit)
{
mp_ptr up;
mp_size_t un;
Expand Down
2 changes: 1 addition & 1 deletion mpz/cmpabs_ui.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

int
mpz_cmpabs_ui (mpz_srcptr u, gmp_ui v_digit)
mpz_cmpabs_ui (mpz_srcptr u, mpir_ui v_digit)
{
mp_ptr up;
mp_size_t un;
Expand Down
2 changes: 1 addition & 1 deletion mpz/cong_ui.c
Expand Up @@ -31,7 +31,7 @@ MA 02110-1301, USA. */
if modexact is being used exclusively then that's not reached. */

int
mpz_congruent_ui_p (mpz_srcptr a, gmp_ui cu, gmp_ui du)
mpz_congruent_ui_p (mpz_srcptr a, mpir_ui cu, mpir_ui du)
{
mp_srcptr ap;
mp_size_t asize;
Expand Down
2 changes: 1 addition & 1 deletion mpz/dive_ui.c
Expand Up @@ -24,7 +24,7 @@ MA 02110-1301, USA.
#include "gmp-impl.h"

void
mpz_divexact_ui (mpz_ptr dst, mpz_srcptr src, gmp_ui divisor)
mpz_divexact_ui (mpz_ptr dst, mpz_srcptr src, mpir_ui divisor)
{
mp_size_t size, abs_size;
mp_ptr dst_ptr;
Expand Down
2 changes: 1 addition & 1 deletion mpz/divis_ui.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */


int
mpz_divisible_ui_p (mpz_srcptr a, gmp_ui d)
mpz_divisible_ui_p (mpz_srcptr a, mpir_ui d)
{
mp_size_t asize;
mp_ptr ap;
Expand Down
2 changes: 1 addition & 1 deletion mpz/export.c
Expand Up @@ -56,7 +56,7 @@ mpz_export (void *data, size_t *countp, int order,
mp_size_t zsize;
mp_srcptr zp;
size_t count, dummy;
gmp_ui numb;
mpir_ui numb;
unsigned align;

ASSERT (order == 1 || order == -1);
Expand Down
90 changes: 45 additions & 45 deletions mpz/fac_ui.c
Expand Up @@ -56,11 +56,11 @@ MA 02110-1301, USA. */
#define FACMUL4 CNST_LIMB(0xfffd)
#endif /* 64 bits */

static void odd_product _PROTO ((gmp_ui low, gmp_ui high, mpz_t * st));
static void ap_product_small _PROTO ((mpz_t ret, mp_limb_t start, mp_limb_t step, gmp_ui count, gmp_ui nm));
static void binary_splitting _PROTO ((mpz_ptr result, gmp_ui *a, gmp_ui L));
static void large_mpz_fac_ui _PROTO ((mpz_ptr result, gmp_ui n));
static gmp_ui ulsqrt _PROTO ((gmp_ui n));
static void odd_product _PROTO ((mpir_ui low, mpir_ui high, mpz_t * st));
static void ap_product_small _PROTO ((mpz_t ret, mp_limb_t start, mp_limb_t step, mpir_ui count, mpir_ui nm));
static void binary_splitting _PROTO ((mpz_ptr result, mpir_ui *a, mpir_ui L));
static void large_mpz_fac_ui _PROTO ((mpz_ptr result, mpir_ui n));
static mpir_ui ulsqrt _PROTO ((mpir_ui n));

/* must be >=2 */
#define APCONST 5
Expand Down Expand Up @@ -108,10 +108,10 @@ static gmp_ui ulsqrt _PROTO ((gmp_ui n));
#if ! defined (BSWAP_UI)
#define BSWAP_UI(dst, src) \
do { \
gmp_ui __bswapl_src = (src); \
gmp_ui __bswapl_dst = 0; \
mpir_ui __bswapl_src = (src); \
mpir_ui __bswapl_dst = 0; \
int __i; \
for (__i = 0; __i < sizeof(gmp_ui); __i++) \
for (__i = 0; __i < sizeof(mpir_ui); __i++) \
{ \
__bswapl_dst = (__bswapl_dst << 8) | (__bswapl_src & 0xFF); \
__bswapl_src >>= 8; \
Expand All @@ -124,7 +124,7 @@ static gmp_ui ulsqrt _PROTO ((gmp_ui n));
/* Note the divides below are all exact */
#define BITREV_UI(x,y) \
do { \
gmp_ui __dst; \
mpir_ui __dst; \
BSWAP_UI(__dst,y); \
__dst = ((__dst>>4)&(GMP_UI_MAX/17)) | ((__dst<<4)&((GMP_UI_MAX/17)*16)); \
__dst = ((__dst>>2)&(GMP_UI_MAX/5) ) | ((__dst<<2)&((GMP_UI_MAX/5)*4) ); \
Expand All @@ -137,11 +137,11 @@ static gmp_ui ulsqrt _PROTO ((gmp_ui n));


void
mpz_fac_ui (mpz_ptr x, gmp_ui n)
mpz_fac_ui (mpz_ptr x, mpir_ui n)
{
gmp_ui z, stt;
mpir_ui z, stt;
int i, j;
mpz_t t1, st[8 * sizeof (gmp_ui) + 1 - APCONST];
mpz_t t1, st[8 * sizeof (mpir_ui) + 1 - APCONST];
mp_limb_t d[4];

static const mp_limb_t table[] = { ONE_LIMB_FACTORIAL_TABLE };
Expand Down Expand Up @@ -176,13 +176,13 @@ mpz_fac_ui (mpz_ptr x, gmp_ui n)
/* so z is the number of bits wanted for st[0] */


if (n <= ((gmp_ui) 1) << (APCONST))
if (n <= ((mpir_ui) 1) << (APCONST))
{
mpz_realloc2 (x, 4 * z);
ap_product_small (x, CNST_LIMB(2), CNST_LIMB(1), n - 1, 4L);
return;
}
if (n <= ((gmp_ui) 1) << (APCONST + 1))
if (n <= ((mpir_ui) 1) << (APCONST + 1))
{ /* use n!=odd(1,n)*(n/2)!*2^(n/2) */
mpz_init2 (t1, 2 * z);
mpz_realloc2 (x, 4 * z);
Expand All @@ -193,7 +193,7 @@ mpz_fac_ui (mpz_ptr x, gmp_ui n)
mpz_mul_2exp (x, x, n / 2);
return;
}
if (n <= ((gmp_ui) 1) << (APCONST + 2))
if (n <= ((mpir_ui) 1) << (APCONST + 2))
{
/* use n!=C_2(1,n/2)^2*C_2(n/2,n)*(n/4)!*2^(n/2+n/4) all int divs
so need (BITS_IN_N-APCONST+1)=(APCONST+3-APCONST+1)=4 stack entries */
Expand Down Expand Up @@ -232,7 +232,7 @@ mpz_fac_ui (mpz_ptr x, gmp_ui n)
}

count_leading_zeros (z, (mp_limb_t) (n / 3));
/* find z st 2^z>n/3 range for z is 1 <= z <= 8 * sizeof(gmp_ui)-1 */
/* find z st 2^z>n/3 range for z is 1 <= z <= 8 * sizeof(mpir_ui)-1 */
z = GMP_LIMB_BITS - z;

/*
Expand All @@ -242,11 +242,11 @@ mpz_fac_ui (mpz_ptr x, gmp_ui n)


mpz_init_set_ui (t1, 1);
for (j = 8 * sizeof (gmp_ui) / 2; j != 0; j >>= 1)
for (j = 8 * sizeof (mpir_ui) / 2; j != 0; j >>= 1)
{
MPZ_SET_1_NZ (x, 1);
for (i = 8 * sizeof (gmp_ui) - j; i >= j; i -= 2 * j)
if ((gmp_si) z >= i)
for (i = 8 * sizeof (mpir_ui) - j; i >= j; i -= 2 * j)
if ((mpir_si) z >= i)
{
odd_product (n >> i, n >> (i - 1), st);
/* largest odd product when j=i=1 then we have
Expand All @@ -257,13 +257,13 @@ mpz_fac_ui (mpz_ptr x, gmp_ui n)
mpz_pow_ui (st[0], st[0], i / j);
mpz_mul (x, x, st[0]);
}
if ((gmp_si) z >= j && j != 1)
if ((mpir_si) z >= j && j != 1)
{
mpz_mul (t1, t1, x);
mpz_mul (t1, t1, t1);
}
}
for (i = 0; i < (gmp_si) stt; i++)
for (i = 0; i < (mpir_si) stt; i++)
mpz_clear (st[i]);
mpz_mul (x, x, t1);
mpz_clear (t1);
Expand All @@ -272,15 +272,15 @@ mpz_fac_ui (mpz_ptr x, gmp_ui n)
return;
}

/* start,step are mp_limb_t although they will fit in gmp_ui */
/* start,step are mp_limb_t although they will fit in mpir_ui */
static void
ap_product_small (mpz_t ret, mp_limb_t start, mp_limb_t step,
gmp_ui count, gmp_ui nm)
mpir_ui count, mpir_ui nm)
{
gmp_ui a;
mpir_ui a;
mp_limb_t b;

ASSERT (count <= (((gmp_ui) 1) << APCONST));
ASSERT (count <= (((mpir_ui) 1) << APCONST));
/* count can never be zero ? check this and remove test below */
if (count == 0)
{
Expand Down Expand Up @@ -362,10 +362,10 @@ ap_product_small (mpz_t ret, mp_limb_t start, mp_limb_t step,
so st[0] needs enough bits for above, st[1] needs half these bits and
st[2] needs 1/4 of these bits etc */
static void
odd_product (gmp_ui low, gmp_ui high, mpz_t * st)
odd_product (mpir_ui low, mpir_ui high, mpz_t * st)
{
gmp_ui stc = 1, stn = 0, n, y, mask, a, nm = 1;
gmp_si z;
mpir_ui stc = 1, stn = 0, n, y, mask, a, nm = 1;
mpir_si z;

low++;
if (low % 2 == 0)
Expand Down Expand Up @@ -396,15 +396,15 @@ odd_product (gmp_ui low, gmp_ui high, mpz_t * st)
}
}
high = (high - low) / 2 + 1; /* high is now count,high<=2^(BITS_PER_UI-1) */
if (high <= (((gmp_ui) 1) << APCONST))
if (high <= (((mpir_ui) 1) << APCONST))
{
ap_product_small (st[0], (mp_limb_t) low, CNST_LIMB(2), high, nm);
return;
}
count_leading_zeros (n, (mp_limb_t) high);
/* assumes clz above is LIMB based not NUMB based */
n = GMP_LIMB_BITS - n - APCONST;
mask = (((gmp_ui) 1) << n);
mask = (((mpir_ui) 1) << n);
a = mask << 1;
mask--;
/* have 2^(BITS_IN_N-APCONST) iterations so need
Expand All @@ -416,7 +416,7 @@ odd_product (gmp_ui low, gmp_ui high, mpz_t * st)
ap_product_small (st[stn],
(mp_limb_t) (low + 2 * ((~y) & mask)), (mp_limb_t) a,
(high + y) >> n, nm);
ASSERT (((high + y) >> n) <= (((gmp_ui) 1) << APCONST));
ASSERT (((high + y) >> n) <= (((mpir_ui) 1) << APCONST));
stn++;
y = stc++;
while ((y & 1) == 0)
Expand All @@ -439,9 +439,9 @@ odd_product (gmp_ui low, gmp_ui high, mpz_t * st)
// Machine Implementation" by A. Schonhage, A. F. W. Grotefeld and E. Vetter,
// BI Wissenschafts-Verlag, Mannheim, 1994.

static void binary_splitting (mpz_ptr result,gmp_ui *a, gmp_ui L) {
static void binary_splitting (mpz_ptr result,mpir_ui *a, mpir_ui L) {
// mulptiplication by binary splitting
gmp_ui i,L0,L1;
mpir_ui i,L0,L1;
mpz_t temp;

if(L==0) {
Expand All @@ -466,21 +466,21 @@ static void binary_splitting (mpz_ptr result,gmp_ui *a, gmp_ui L) {
return;
}

static gmp_ui ulsqrt(gmp_ui n)
{gmp_ui x,y;
static mpir_ui ulsqrt(mpir_ui n)
{mpir_ui x,y;

x=y=n;
do{x=y;
y=(n/x+x)/2;
}while(y<x);
return x;}

static void large_mpz_fac_ui(mpz_ptr result, gmp_ui n) {
gmp_ui Bit[32],e,N,g,p2,*S,*exponent,*isprime,*primes,count,i,p,primepi,sq,n2=(n-1)>>1,n64=(n>>6)+1,memalloc;
static void large_mpz_fac_ui(mpz_ptr result, mpir_ui n) {
mpir_ui Bit[32],e,N,g,p2,*S,*exponent,*isprime,*primes,count,i,p,primepi,sq,n2=(n-1)>>1,n64=(n>>6)+1,memalloc;
int h,expo;
mpz_t temp;
mpz_init(temp);
isprime=__GMP_ALLOCATE_FUNC_TYPE(n64,gmp_ui);
isprime=__GMP_ALLOCATE_FUNC_TYPE(n64,mpir_ui);
ASSERT(n>=2);// cant handle n<2
Bit[0]=1;
for(i=1;i<32;i++) Bit[i]=Bit[i-1]<<1; // Bit[i]=2^i
Expand All @@ -500,9 +500,9 @@ static void large_mpz_fac_ui(mpz_ptr result, gmp_ui n) {
primepi+=((isprime[i>>5]&Bit[i&31])>0);

memalloc=primepi;
primes=__GMP_ALLOCATE_FUNC_TYPE(memalloc,gmp_ui);
S=__GMP_ALLOCATE_FUNC_TYPE(memalloc,gmp_ui);
exponent=__GMP_ALLOCATE_FUNC_TYPE(memalloc,gmp_ui);
primes=__GMP_ALLOCATE_FUNC_TYPE(memalloc,mpir_ui);
S=__GMP_ALLOCATE_FUNC_TYPE(memalloc,mpir_ui);
exponent=__GMP_ALLOCATE_FUNC_TYPE(memalloc,mpir_ui);

primepi=0;
// 1 is not prime and hasn't cancelled, so start from 1*2+1=3
Expand All @@ -517,7 +517,7 @@ static void large_mpz_fac_ui(mpz_ptr result, gmp_ui n) {
primepi++;
}

__GMP_FREE_FUNC_TYPE(isprime,n64,gmp_ui);
__GMP_FREE_FUNC_TYPE(isprime,n64,mpir_ui);

mpz_set_ui(result,1);

Expand All @@ -544,9 +544,9 @@ static void large_mpz_fac_ui(mpz_ptr result, gmp_ui n) {
while(N) N>>=1,e+=N;
mpz_mul_2exp(result,result,e); // shift the number to finally get n!

__GMP_FREE_FUNC_TYPE(S,memalloc,gmp_ui);
__GMP_FREE_FUNC_TYPE(primes,memalloc,gmp_ui);
__GMP_FREE_FUNC_TYPE(exponent,memalloc,gmp_ui);
__GMP_FREE_FUNC_TYPE(S,memalloc,mpir_ui);
__GMP_FREE_FUNC_TYPE(primes,memalloc,mpir_ui);
__GMP_FREE_FUNC_TYPE(exponent,memalloc,mpir_ui);
mpz_clear(temp);
return;
}
4 changes: 2 additions & 2 deletions mpz/fdiv_q_ui.c
Expand Up @@ -24,8 +24,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_fdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_fdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn, qn;
mp_ptr np, qp;
Expand Down
4 changes: 2 additions & 2 deletions mpz/fdiv_qr_ui.c
Expand Up @@ -24,8 +24,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_fdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_fdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn, qn;
mp_ptr np, qp;
Expand Down
4 changes: 2 additions & 2 deletions mpz/fdiv_r_ui.c
Expand Up @@ -24,8 +24,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_fdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_fdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn;
mp_ptr np;
Expand Down
4 changes: 2 additions & 2 deletions mpz/fdiv_ui.c
Expand Up @@ -24,8 +24,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_fdiv_ui (mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_fdiv_ui (mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn;
mp_ptr np;
Expand Down
2 changes: 1 addition & 1 deletion mpz/fib2_ui.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */


void
mpz_fib2_ui (mpz_ptr fn, mpz_ptr fnsub1, gmp_ui n)
mpz_fib2_ui (mpz_ptr fn, mpz_ptr fnsub1, mpir_ui n)
{
mp_ptr fp, f1p;
mp_size_t size;
Expand Down
4 changes: 2 additions & 2 deletions mpz/fib_ui.c
Expand Up @@ -46,11 +46,11 @@ MA 02110-1301, USA. */
limb of F[4m+1] can certainly be 1, and an mpn_add_1 must be used. */

void
mpz_fib_ui (mpz_ptr fn, gmp_ui n)
mpz_fib_ui (mpz_ptr fn, mpir_ui n)
{
mp_ptr fp, xp, yp;
mp_size_t size, xalloc;
gmp_ui n2;
mpir_ui n2;
mp_limb_t c, c2;
TMP_DECL;

Expand Down
4 changes: 2 additions & 2 deletions mpz/gcd_ui.c
Expand Up @@ -24,8 +24,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_gcd_ui (mpz_ptr w, mpz_srcptr u, gmp_ui v)
mpir_ui
mpz_gcd_ui (mpz_ptr w, mpz_srcptr u, mpir_ui v)
{
mp_size_t un;
mp_limb_t res;
Expand Down
4 changes: 2 additions & 2 deletions mpz/get_d_2exp.c
Expand Up @@ -24,12 +24,12 @@ MA 02110-1301, USA. */
#include "longlong.h"

double
mpz_get_d_2exp (gmp_si *exp2, mpz_srcptr src)
mpz_get_d_2exp (mpir_si *exp2, mpz_srcptr src)
{
mp_size_t size, abs_size;
mp_srcptr ptr;
int cnt;
gmp_si exp;
mpir_si exp;

size = SIZ(src);
if (UNLIKELY (size == 0))
Expand Down
6 changes: 3 additions & 3 deletions mpz/get_si.c
Expand Up @@ -23,7 +23,7 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_si
mpir_si
mpz_get_si (mpz_srcptr z)
{
mp_ptr zp = z->_mp_d;
Expand All @@ -36,10 +36,10 @@ mpz_get_si (mpz_srcptr z)
#endif

if (size > 0)
return (gmp_si) zl & GMP_UI_MAX;
return (mpir_si) zl & GMP_UI_MAX;
else if (size < 0)
/* This expression is necessary to properly handle 0x80000000 */
return ~(((gmp_si) zl - 1L) & GMP_UI_MAX);
return ~(((mpir_si) zl - 1L) & GMP_UI_MAX);
else
return 0;
}
4 changes: 2 additions & 2 deletions mpz/iset_si.c
Expand Up @@ -25,15 +25,15 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

void
mpz_init_set_si (mpz_ptr dest, gmp_si val)
mpz_init_set_si (mpz_ptr dest, mpir_si val)
{
mp_size_t size;
mp_limb_t vl;

dest->_mp_alloc = 1;
dest->_mp_d = (mp_ptr) (*__gmp_allocate_func) (BYTES_PER_MP_LIMB);

vl = (mp_limb_t) (gmp_ui) (val >= 0 ? val : -val);
vl = (mp_limb_t) (mpir_ui) (val >= 0 ? val : -val);

dest->_mp_d[0] = vl & GMP_NUMB_MASK;
size = vl != 0;
Expand Down
2 changes: 1 addition & 1 deletion mpz/iset_ui.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

void
mpz_init_set_ui (mpz_ptr dest, gmp_ui val)
mpz_init_set_ui (mpz_ptr dest, mpir_ui val)
{
mp_size_t size;

Expand Down
4 changes: 2 additions & 2 deletions mpz/kronsz.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */


int
mpz_si_kronecker (gmp_si a, mpz_srcptr b)
mpz_si_kronecker (mpir_si a, mpz_srcptr b)
{
mp_srcptr b_ptr;
mp_limb_t b_low;
Expand Down Expand Up @@ -63,7 +63,7 @@ mpz_si_kronecker (gmp_si a, mpz_srcptr b)
/* b odd */

result_bit1 ^= JACOBI_ASGN_SU_BIT1 (a, b_low);
a_limb = (gmp_ui) ABS(a);
a_limb = (mpir_ui) ABS(a);

if ((a_limb & 1) == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion mpz/kronuz.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */


int
mpz_ui_kronecker (gmp_ui a, mpz_srcptr b)
mpz_ui_kronecker (mpir_ui a, mpz_srcptr b)
{
mp_srcptr b_ptr;
mp_limb_t b_low;
Expand Down
4 changes: 2 additions & 2 deletions mpz/kronzs.c
Expand Up @@ -28,7 +28,7 @@ MA 02110-1301, USA. */
long, because 0x80..00 doesn't fit in a signed long. */

int
mpz_kronecker_si (mpz_srcptr a, gmp_si b)
mpz_kronecker_si (mpz_srcptr a, mpir_si b)
{
mp_srcptr a_ptr;
mp_size_t a_size;
Expand All @@ -52,7 +52,7 @@ mpz_kronecker_si (mpz_srcptr a, gmp_si b)
#endif

result_bit1 = JACOBI_BSGN_SS_BIT1 (a_size, b);
b_limb = (gmp_ui) ABS (b);
b_limb = (mpir_ui) ABS (b);
a_ptr = PTR(a);

if ((b_limb & 1) == 0)
Expand Down
2 changes: 1 addition & 1 deletion mpz/kronzu.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */


int
mpz_kronecker_ui (mpz_srcptr a, gmp_ui b)
mpz_kronecker_ui (mpz_srcptr a, mpir_ui b)
{
mp_srcptr a_ptr;
mp_size_t a_size;
Expand Down
6 changes: 3 additions & 3 deletions mpz/lcm_ui.c
Expand Up @@ -25,12 +25,12 @@ MA 02110-1301, USA. */


void
mpz_lcm_ui (mpz_ptr r, mpz_srcptr u, gmp_ui v)
mpz_lcm_ui (mpz_ptr r, mpz_srcptr u, mpir_ui v)
{
mp_size_t usize;
mp_srcptr up;
mp_ptr rp;
gmp_ui g;
mpir_ui g;
mp_limb_t c;

#if BITS_PER_UI > GMP_NUMB_BITS /* avoid warnings about shift amount */
Expand Down Expand Up @@ -59,7 +59,7 @@ mpz_lcm_ui (mpz_ptr r, mpz_srcptr u, gmp_ui v)
MPZ_REALLOC (r, usize+1);

up = PTR(u);
g = (gmp_ui) mpn_gcd_1 (up, usize, (mp_limb_t) v);
g = (mpir_ui) mpn_gcd_1 (up, usize, (mp_limb_t) v);
v /= g;

rp = PTR(r);
Expand Down
2 changes: 1 addition & 1 deletion mpz/likely_prime_p.c
Expand Up @@ -829,7 +829,7 @@ int is_likely_prime_BPSW(mp_limb_t n)

// could call it mpz_likely_composite_p then when true we could return more info about it , ie a factor
int
mpz_likely_prime_p (mpz_srcptr N, gmp_randstate_t STATE, gmp_ui td)
mpz_likely_prime_p (mpz_srcptr N, gmp_randstate_t STATE, mpir_ui td)
{
int d, t, r;
unsigned long tdlim, i;
Expand Down
2 changes: 1 addition & 1 deletion mpz/lucnum2_ui.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */


void
mpz_lucnum2_ui (mpz_ptr ln, mpz_ptr lnsub1, gmp_ui n)
mpz_lucnum2_ui (mpz_ptr ln, mpz_ptr lnsub1, mpir_ui n)
{
mp_ptr lp, l1p, f1p;
mp_size_t size;
Expand Down
2 changes: 1 addition & 1 deletion mpz/lucnum_ui.c
Expand Up @@ -46,7 +46,7 @@ MA 02110-1301, USA. */
obviously huge, but probably should be made to work. */

void
mpz_lucnum_ui (mpz_ptr ln, gmp_ui n)
mpz_lucnum_ui (mpz_ptr ln, mpir_ui n)
{
mp_size_t lalloc, xalloc, lsize, xsize;
mp_ptr lp, xp;
Expand Down
2 changes: 1 addition & 1 deletion mpz/miller_rabin.c
Expand Up @@ -35,7 +35,7 @@ MA 02110-1301, USA. */

static int
mill_rab (mpz_srcptr n, mpz_srcptr nm1, mpz_ptr x, mpz_ptr y,
mpz_srcptr q, gmp_ui k)
mpz_srcptr q, mpir_ui k)
{
unsigned long int i;

Expand Down
6 changes: 3 additions & 3 deletions mpz/mul_i.h
Expand Up @@ -27,13 +27,13 @@ MA 02110-1301, USA. */

#ifdef OPERATION_mul_si
#define FUNCTION mpz_mul_si
#define MULTIPLICAND_UNSIGNED gmp_si
#define MULTIPLICAND_ABS(x) ((gmp_ui) ABS(x))
#define MULTIPLICAND_UNSIGNED mpir_si
#define MULTIPLICAND_ABS(x) ((mpir_ui) ABS(x))
#endif

#ifdef OPERATION_mul_ui
#define FUNCTION mpz_mul_ui
#define MULTIPLICAND_UNSIGNED gmp_ui
#define MULTIPLICAND_UNSIGNED mpir_ui
#define MULTIPLICAND_ABS(x) x
#endif

Expand Down
2 changes: 1 addition & 1 deletion mpz/n_pow_ui.c
Expand Up @@ -150,7 +150,7 @@ MA 02110-1301, USA. */


void
mpz_n_pow_ui (mpz_ptr r, mp_srcptr bp, mp_size_t bsize, gmp_ui e)
mpz_n_pow_ui (mpz_ptr r, mp_srcptr bp, mp_size_t bsize, mpir_ui e)
{
mp_ptr rp;
mp_size_t rtwos_limbs, ralloc, rsize;
Expand Down
2 changes: 1 addition & 1 deletion mpz/nthroot.c
Expand Up @@ -26,7 +26,7 @@ Boston, MA 02110-1301, USA.
#include "gmp-impl.h"

void
mpz_nthroot (mpz_ptr root, mpz_srcptr u, gmp_ui nth)
mpz_nthroot (mpz_ptr root, mpz_srcptr u, mpir_ui nth)
{
mp_ptr rootp, up, remp;
mp_size_t us, un, rootn;
Expand Down
12 changes: 6 additions & 6 deletions mpz/perfpow.c
Expand Up @@ -44,8 +44,8 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"
#include "longlong.h"

static gmp_ui gcd _PROTO ((gmp_ui a, gmp_ui b));
static int isprime _PROTO ((gmp_ui t));
static mpir_ui gcd _PROTO ((mpir_ui a, mpir_ui b));
static int isprime _PROTO ((mpir_ui t));

static const unsigned short primes[] =
{ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53,
Expand Down Expand Up @@ -210,8 +210,8 @@ mpz_perfect_power_p (mpz_srcptr u)
return exact;
}

static gmp_ui
gcd (gmp_ui a, gmp_ui b)
static mpir_ui
gcd (mpir_ui a, mpir_ui b)
{
int an2, bn2, n2;

Expand Down Expand Up @@ -250,9 +250,9 @@ gcd (gmp_ui a, gmp_ui b)
}

static int
isprime (gmp_ui t)
isprime (mpir_ui t)
{
gmp_ui q, r, d;
mpir_ui q, r, d;

if (t < 3 || (t & 1) == 0)
return t == 2;
Expand Down
2 changes: 1 addition & 1 deletion mpz/pow_ui.c
Expand Up @@ -23,7 +23,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

void
mpz_pow_ui (mpz_ptr r, mpz_srcptr b, gmp_ui e)
mpz_pow_ui (mpz_ptr r, mpz_srcptr b, mpir_ui e)
{
mpz_n_pow_ui (r, PTR(b), (mp_size_t) SIZ(b), e);
}
4 changes: 2 additions & 2 deletions mpz/powm.c
Expand Up @@ -64,7 +64,7 @@ phi (mp_limb_t t)
m = d - 1;
for (;;)
{
gmp_ui q = t / d;
mpir_ui q = t / d;
if (q < d)
{
if (t <= 1)
Expand Down Expand Up @@ -122,7 +122,7 @@ mpz_powm (mpz_ptr r, mpz_srcptr b, mpz_srcptr e, mpz_srcptr m)
mp_srcptr bp, ep, mp;
mp_size_t bn, es, en, mn, xn;
mp_limb_t invm, c;
gmp_ui enb;
mpir_ui enb;
mp_size_t i, K, j, l, k;
int m_zero_cnt, e_zero_cnt;
int sh;
Expand Down
2 changes: 1 addition & 1 deletion mpz/powm_ui.c
Expand Up @@ -42,7 +42,7 @@ reduce (mp_ptr tp, mp_srcptr ap, mp_size_t an, mp_srcptr mp, mp_size_t mn)
}

void
mpz_powm_ui (mpz_ptr r, mpz_srcptr b, gmp_ui el, mpz_srcptr m)
mpz_powm_ui (mpz_ptr r, mpz_srcptr b, mpir_ui el, mpz_srcptr m)
{
mp_ptr xp, tp, qp, mp, bp;
mp_size_t xn, tn, mn, bn;
Expand Down
8 changes: 4 additions & 4 deletions mpz/pprime_p.c
Expand Up @@ -30,7 +30,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"
#include "longlong.h"

static int isprime _PROTO ((gmp_ui t));
static int isprime _PROTO ((mpir_ui t));


/* MPN_MOD_OR_MODEXACT_1_ODD can be used instead of mpn_mod_1 for the trial
Expand Down Expand Up @@ -101,7 +101,7 @@ mpz_probab_prime_p (mpz_srcptr n, int reps)
overflow a single limb. We divide our number by the small primes product,
and look for factors in the remainder. */
{
gmp_ui ln2, q;
mpir_ui ln2, q;
mp_limb_t p1, p0, p;
unsigned int primes[15];
int nprimes;
Expand Down Expand Up @@ -140,9 +140,9 @@ mpz_probab_prime_p (mpz_srcptr n, int reps)
}

static int
isprime (gmp_ui t)
isprime (mpir_ui t)
{
gmp_ui q, r, d;
mpir_ui q, r, d;

if (t < 3 || (t & 1) == 0)
return t == 2;
Expand Down
2 changes: 1 addition & 1 deletion mpz/probable_prime_p.c
Expand Up @@ -23,7 +23,7 @@ Boston, MA 02110-1301, USA.
#include "gmp-impl.h"

int
mpz_probable_prime_p (mpz_srcptr N, gmp_randstate_t STATE, int PROB, gmp_ui td)
mpz_probable_prime_p (mpz_srcptr N, gmp_randstate_t STATE, int PROB, mpir_ui td)
{
int d, t, i, r;
mpz_t base, nm1, x, e, n;
Expand Down
2 changes: 1 addition & 1 deletion mpz/root.c
Expand Up @@ -23,7 +23,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#include "gmp-impl.h"

int
mpz_root (mpz_ptr root, mpz_srcptr u, gmp_ui nth)
mpz_root (mpz_ptr root, mpz_srcptr u, mpir_ui nth)
{
mp_ptr rootp, up;
mp_size_t us, un, rootn, remn;
Expand Down
2 changes: 1 addition & 1 deletion mpz/rootrem.c
Expand Up @@ -25,7 +25,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#include "gmp-impl.h"

void
mpz_rootrem (mpz_ptr root, mpz_ptr rem, mpz_srcptr u, gmp_ui nth)
mpz_rootrem (mpz_ptr root, mpz_ptr rem, mpz_srcptr u, mpir_ui nth)
{
mp_ptr rootp, up, remp;
mp_size_t us, un, rootn, remn;
Expand Down
4 changes: 2 additions & 2 deletions mpz/set_si.c
Expand Up @@ -24,12 +24,12 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

void
mpz_set_si (mpz_ptr dest, gmp_si val)
mpz_set_si (mpz_ptr dest, mpir_si val)
{
mp_size_t size;
mp_limb_t vl;

vl = (mp_limb_t) (gmp_ui) (val >= 0 ? val : -val);
vl = (mp_limb_t) (mpir_ui) (val >= 0 ? val : -val);

dest->_mp_d[0] = vl & GMP_NUMB_MASK;
size = vl != 0;
Expand Down
2 changes: 1 addition & 1 deletion mpz/set_ui.c
Expand Up @@ -24,7 +24,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

void
mpz_set_ui (mpz_ptr dest, gmp_ui val)
mpz_set_ui (mpz_ptr dest, mpir_ui val)
{
mp_size_t size;

Expand Down
4 changes: 2 additions & 2 deletions mpz/tdiv_q_ui.c
Expand Up @@ -24,8 +24,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_tdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_tdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn, qn;
mp_ptr np, qp;
Expand Down
4 changes: 2 additions & 2 deletions mpz/tdiv_qr_ui.c
Expand Up @@ -25,8 +25,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_tdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_tdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn, qn;
mp_ptr np, qp;
Expand Down
4 changes: 2 additions & 2 deletions mpz/tdiv_r_ui.c
Expand Up @@ -24,8 +24,8 @@ MA 02110-1301, USA. */
#include "mpir.h"
#include "gmp-impl.h"

gmp_ui
mpz_tdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_tdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn;
mp_ptr np;
Expand Down
4 changes: 2 additions & 2 deletions mpz/tdiv_ui.c
Expand Up @@ -24,8 +24,8 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"
#include "longlong.h"

gmp_ui
mpz_tdiv_ui (mpz_srcptr dividend, gmp_ui divisor)
mpir_ui
mpz_tdiv_ui (mpz_srcptr dividend, mpir_ui divisor)
{
mp_size_t ns, nn;
mp_ptr np;
Expand Down
2 changes: 1 addition & 1 deletion mpz/ui_pow_ui.c
Expand Up @@ -24,7 +24,7 @@ MA 02110-1301, USA. */


void
mpz_ui_pow_ui (mpz_ptr r, gmp_ui b, gmp_ui e)
mpz_ui_pow_ui (mpz_ptr r, mpir_ui b, mpir_ui e)
{
#if GMP_NAIL_BITS != 0
if (b > GMP_NUMB_MAX)
Expand Down
2 changes: 1 addition & 1 deletion mpz/ui_sub.c
Expand Up @@ -23,7 +23,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"

void
mpz_ui_sub (mpz_ptr w, gmp_ui uval, mpz_srcptr v)
mpz_ui_sub (mpz_ptr w, mpir_ui uval, mpz_srcptr v)
{
mp_ptr vp, wp;
mp_size_t vn, wn;
Expand Down
4 changes: 2 additions & 2 deletions randbui.c
Expand Up @@ -26,8 +26,8 @@ MA 02110-1301, USA. */
/* Currently bits>=BITS_PER_ULONG is quietly truncated to BITS_PER_ULONG,
maybe this should raise an exception or something. */

gmp_ui
gmp_urandomb_ui (gmp_randstate_ptr rstate, gmp_ui bits)
mpir_ui
gmp_urandomb_ui (gmp_randstate_ptr rstate, mpir_ui bits)
{
mp_limb_t a[LIMBS_PER_UI];

Expand Down
2 changes: 1 addition & 1 deletion randlc2s.c
Expand Up @@ -38,7 +38,7 @@ struct __gmp_rand_lc_scheme_struct
{
unsigned long int m2exp; /* Modulus is 2 ^ m2exp. */
const char *astr; /* Multiplier in string form. */
gmp_ui c; /* Addend. */
mpir_ui c; /* Addend. */
};

static const struct __gmp_rand_lc_scheme_struct __gmp_rand_lc_scheme[] =
Expand Down
14 changes: 7 additions & 7 deletions randlc2x.c
Expand Up @@ -52,22 +52,22 @@ typedef struct {
mpz_t _mp_a;
mp_size_t _cn;
mp_limb_t _cp[LIMBS_PER_UI];
gmp_ui _mp_m2exp;
mpir_ui _mp_m2exp;
} gmp_rand_lc_struct;


/* lc (rp, state) -- Generate next number in LC sequence. Return the
number of valid bits in the result. Discards the lower half of the
result. */

static gmp_ui
static mpir_ui
lc (mp_ptr rp, gmp_randstate_t rstate)
{
mp_ptr tp, seedp, ap;
mp_size_t ta;
mp_size_t tn, seedn, an;
gmp_ui m2exp;
gmp_ui bits;
mpir_ui m2exp;
mpir_ui bits;
int cy;
mp_size_t xn;
gmp_rand_lc_struct *p;
Expand Down Expand Up @@ -141,9 +141,9 @@ lc (mp_ptr rp, gmp_randstate_t rstate)

/* Obtain a sequence of random numbers. */
static void
randget_lc (gmp_randstate_t rstate, mp_ptr rp, gmp_ui nbits)
randget_lc (gmp_randstate_t rstate, mp_ptr rp, mpir_ui nbits)
{
gmp_ui rbitpos;
mpir_ui rbitpos;
int chunk_nbits;
mp_ptr tp;
mp_size_t tn;
Expand Down Expand Up @@ -284,7 +284,7 @@ randiset_lc (gmp_randstate_ptr dst, gmp_randstate_srcptr src)
void
gmp_randinit_lc_2exp (gmp_randstate_t rstate,
mpz_srcptr a,
gmp_ui c,
mpir_ui c,
mp_bitcnt_t m2exp)
{
gmp_rand_lc_struct *p;
Expand Down
2 changes: 1 addition & 1 deletion randmt.c
Expand Up @@ -183,7 +183,7 @@ __gmp_mt_recalc_buffer (gmp_uint_least32_t mt[])
Note that Mersenne Twister is designed to produce outputs in
32-bit words. */
void
__gmp_randget_mt (gmp_randstate_t rstate, mp_ptr dest, gmp_ui nbits)
__gmp_randget_mt (gmp_randstate_t rstate, mp_ptr dest, mpir_ui nbits)
{
gmp_uint_least32_t y;
int rbits;
Expand Down
2 changes: 1 addition & 1 deletion randmt.h
Expand Up @@ -37,6 +37,6 @@ typedef struct


void __gmp_mt_recalc_buffer __GMP_PROTO ((gmp_uint_least32_t *));
void __gmp_randget_mt __GMP_PROTO ((gmp_randstate_t, mp_ptr, gmp_ui));
void __gmp_randget_mt __GMP_PROTO ((gmp_randstate_t, mp_ptr, mpir_ui));
void __gmp_randclear_mt __GMP_PROTO ((gmp_randstate_t rstate));
void __gmp_randiset_mt __GMP_PROTO ((gmp_randstate_ptr, gmp_randstate_srcptr));
4 changes: 2 additions & 2 deletions randmui.c
Expand Up @@ -34,8 +34,8 @@ MA 02110-1301, USA. */

#define MAX_URANDOMM_ITER 80

gmp_ui
gmp_urandomm_ui (gmp_randstate_ptr rstate, gmp_ui n)
mpir_ui
gmp_urandomm_ui (gmp_randstate_ptr rstate, mpir_ui n)
{
mp_limb_t a[LIMBS_PER_UI];
unsigned long ret, bits, leading;
Expand Down
2 changes: 1 addition & 1 deletion randsdui.c
Expand Up @@ -25,7 +25,7 @@ MA 02110-1301, USA. */

void
gmp_randseed_ui (gmp_randstate_t rstate,
gmp_ui seed)
mpir_ui seed)
{
mpz_t zseed;
mp_limb_t zlimbs[LIMBS_PER_UI];
Expand Down
4 changes: 2 additions & 2 deletions scanf/doscan.c
Expand Up @@ -398,9 +398,9 @@ gmpscan (const struct gmp_doscan_funs_t *funs, void *data,
long exp;
exp = strtol (s + hexexp + 1, &dummy, 10);
if (exp >= 0)
mpf_mul_2exp (f, f, (gmp_ui) exp);
mpf_mul_2exp (f, f, (mpir_ui) exp);
else
mpf_div_2exp (f, f, - (gmp_ui) exp);
mpf_div_2exp (f, f, - (mpir_ui) exp);
}
}
break;
Expand Down
2 changes: 1 addition & 1 deletion tests/cxx/t-assign.cc
Expand Up @@ -133,7 +133,7 @@ check_mpz (void)
long long int a = 0xfedcba9876543210;
mpz_class b;
b = a;
ASSERT_ALWAYS(b == (gmp_si)0xfedcba9876543210);
ASSERT_ALWAYS(b == (mpir_si)0xfedcba9876543210);
}

// operator=(float)
Expand Down
6 changes: 3 additions & 3 deletions tests/cxx/t-ops.cc
Expand Up @@ -180,9 +180,9 @@ check_mpz (void)
c = ai % b; ASSERT_ALWAYS(c == -1);
}
{
mpz_class a ((gmp_si)GMP_SI_MIN);
gmp_si ai = GMP_SI_MIN;
mpz_class b = - mpz_class ((gmp_si)GMP_SI_MIN);
mpz_class a ((mpir_si)GMP_SI_MIN);
mpir_si ai = GMP_SI_MIN;
mpz_class b = - mpz_class ((mpir_si)GMP_SI_MIN);
mpz_class c;
c = a / b; ASSERT_ALWAYS(c == -1);
c = a % b; ASSERT_ALWAYS(c == 0);
Expand Down
14 changes: 7 additions & 7 deletions tests/cxx/t-rand.cc
Expand Up @@ -37,20 +37,20 @@ check_randinit (void)

{
mpz_class a(0);
gmp_ui c = 0;
mpir_ui c = 0;
mp_bitcnt_t m2exp = 8;
gmp_randclass r(gmp_randinit_lc_2exp, a, c, m2exp);
}

{
gmp_ui m2exp = 64;
mpir_ui m2exp = 64;
gmp_randclass r(gmp_randinit_lc_2exp_size, m2exp);
}

/* gmp_randinit_lc_2exp_size, with excessive size */
{
try {
gmp_ui m2exp = ULONG_MAX;
mpir_ui m2exp = ULONG_MAX;
gmp_randclass r(gmp_randinit_lc_2exp_size, m2exp);
ASSERT_ALWAYS (0); /* should not be reached */
} catch (length_error) {
Expand All @@ -64,17 +64,17 @@ check_randinit (void)
/* obsolete, but still available */
{
gmp_randalg_t alg = GMP_RAND_ALG_LC;
gmp_ui m2exp = 64;
mpir_ui m2exp = 64;
gmp_randclass r(alg, m2exp);
}
{
gmp_randalg_t alg = GMP_RAND_ALG_DEFAULT;
gmp_ui m2exp = 64;
mpir_ui m2exp = 64;
gmp_randclass r(alg, m2exp);
}
{
gmp_randalg_t alg = (gmp_randalg_t) 0;
gmp_ui m2exp = 64;
mpir_ui m2exp = 64;
gmp_randclass r(alg, m2exp);
}
}
Expand All @@ -93,7 +93,7 @@ check_mpz (void)
{
gmp_randclass r(gmp_randinit_default);
mpz_class a(256);
gmp_ui b = 123;
mpir_ui b = 123;
mpz_class c;
r.seed(b);
c = r.get_z_bits(a);
Expand Down
16 changes: 8 additions & 8 deletions tests/mpf/t-get_si.c
Expand Up @@ -32,7 +32,7 @@ check_data (void)
static const struct {
int base;
const char *f;
gmp_si want;
mpir_si want;
} data[] = {
{ 10, "0", 0 },
{ 10, "1", 1 },
Expand All @@ -59,7 +59,7 @@ check_data (void)

int i;
mpf_t f;
gmp_si got;
mpir_si got;

mpf_init2 (f, 2000);
for (i = 0; i < numberof (data); i++)
Expand Down Expand Up @@ -88,8 +88,8 @@ void
check_max (void)
{
mpf_t f;
gmp_si want;
gmp_si got;
mpir_si want;
mpir_si got;

mpf_init2 (f, 200L);

Expand Down Expand Up @@ -128,7 +128,7 @@ check_limbdata (void)
mp_exp_t exp;
mp_size_t size;
mp_limb_t d[10];
gmp_si want;
mpir_si want;

} data[] = {

Expand Down Expand Up @@ -179,7 +179,7 @@ check_limbdata (void)
};

mpf_t f;
gmp_si got;
mpir_si got;
int i;
mp_limb_t buf[20 + numberof(data[i].d)];

Expand All @@ -201,8 +201,8 @@ check_limbdata (void)
printf ("mpf_get_si wrong at limb data[%d]\n", i);
mpf_trace (" f", f);
mpn_trace (" d", data[i].d, data[i].size);
printf (" size %ld\n", (gmp_si) data[i].size);
printf (" exp %ld\n", (gmp_si) data[i].exp);
printf (" size %ld\n", (mpir_si) data[i].size);
printf (" exp %ld\n", (mpir_si) data[i].exp);
printf (" got %Mu (%#Mx)\n", got, got);
printf (" want %Mu (%#Mx)\n", data[i].want, data[i].want);
abort();
Expand Down
4 changes: 2 additions & 2 deletions tests/mpf/t-get_ui.c
Expand Up @@ -36,7 +36,7 @@ check_limbdata (void)
mp_exp_t exp;
mp_size_t size;
mp_limb_t d[10];
gmp_ui want;
mpir_ui want;

} data[] = {

Expand Down Expand Up @@ -87,7 +87,7 @@ check_limbdata (void)
};

mpf_t f;
gmp_ui got;
mpir_ui got;
int i;
mp_limb_t buf[20 + numberof(data[i].d)];

Expand Down
2 changes: 1 addition & 1 deletion tests/mpf/t-mul_ui.c
Expand Up @@ -26,7 +26,7 @@ MA 02110-1301, USA. */
#include "tests.h"

void
check_one (const char *desc, mpf_ptr got, mpf_srcptr u, gmp_ui v)
check_one (const char *desc, mpf_ptr got, mpf_srcptr u, mpir_ui v)
{
mp_size_t usize, usign;
mp_ptr wp;
Expand Down
2 changes: 1 addition & 1 deletion tests/mpf/t-set_si.c
Expand Up @@ -29,7 +29,7 @@ void
check_data (void)
{
static const struct {
gmp_si x;
mpir_si x;
mp_size_t want_size;
mp_limb_t want_data[2];
} data[] = {
Expand Down
2 changes: 1 addition & 1 deletion tests/mpf/t-set_ui.c
Expand Up @@ -29,7 +29,7 @@ void
check_data (void)
{
static const struct {
gmp_ui x;
mpir_ui x;
mp_size_t want_size;
mp_limb_t want_data[2];
} data[] = {
Expand Down
4 changes: 2 additions & 2 deletions tests/mpq/t-cmp_si.c
Expand Up @@ -36,8 +36,8 @@ check_data (void)
{
static const struct {
const char *q;
gmp_si n;
gmp_ui d;
mpir_si n;
mpir_ui d;
int want;
} data[] = {
{ "0", 0, 1, 0 },
Expand Down
8 changes: 4 additions & 4 deletions tests/mpq/t-cmp_ui.c
Expand Up @@ -50,7 +50,7 @@ mpz_intrandom2 (mpz_ptr x, gmp_randstate_t rands, mp_size_t size)


int
ref_mpq_cmp_ui (mpq_t a, gmp_ui bn, gmp_ui bd)
ref_mpq_cmp_ui (mpq_t a, mpir_ui bn, mpir_ui bd)
{
mpz_t ai, bi;
int cc;
Expand Down Expand Up @@ -78,7 +78,7 @@ main (int argc, char **argv)
int reps = 10000;
int i;
int cc, ccref;
gmp_ui bn, bd;
mpir_ui bn, bd;
gmp_randstate_t rands;

tests_start ();
Expand All @@ -102,11 +102,11 @@ main (int argc, char **argv)
while (mpz_cmp_ui (DEN (a), 0) == 0);

mpz_intrandom2 (NUM (b), rands, (mp_size_t) 1);
mpz_mod_ui (NUM (b), NUM (b), ~(gmp_ui) 0);
mpz_mod_ui (NUM (b), NUM (b), ~(mpir_ui) 0);
mpz_add_ui (NUM (b), NUM (b), 1);

mpz_intrandom2 (DEN (b), rands ,(mp_size_t) 1);
mpz_mod_ui (DEN (b), DEN (b), ~(gmp_ui) 0);
mpz_mod_ui (DEN (b), DEN (b), ~(mpir_ui) 0);
mpz_add_ui (DEN (b), DEN (b), 1);

mpq_canonicalize (a);
Expand Down
4 changes: 2 additions & 2 deletions tests/mpz/dive_ui.c
Expand Up @@ -34,7 +34,7 @@ check_random (int argc, char *argv[])
int reps = 5000;
mpz_t a, q, got;
int i, qneg;
gmp_ui d;
mpir_ui d;

if (argc == 2)
reps = atoi (argv[1]);
Expand All @@ -46,7 +46,7 @@ check_random (int argc, char *argv[])

for (i = 0; i < reps; i++)
{
d = (gmp_ui) urandom(rands);
d = (mpir_ui) urandom(rands);
mpz_erandomb (q, rands, 512);
mpz_mul_ui (a, q, d);

Expand Down
10 changes: 5 additions & 5 deletions tests/mpz/t-cdiv_ui.c
Expand Up @@ -27,7 +27,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"
#include "tests.h"

void dump_abort _PROTO ((char *, mpz_t, gmp_ui));
void dump_abort _PROTO ((char *, mpz_t, mpir_ui));
void debug_mp _PROTO ((mpz_t, int));

int
Expand All @@ -38,13 +38,13 @@ main (int argc, char **argv)
mpz_t quotient2, remainder2;
mpz_t temp;
mp_size_t dividend_size;
gmp_ui divisor;
mpir_ui divisor;
int i;
int reps = 10000;
gmp_randstate_t rands;
mpz_t bs;
gmp_ui bsi, size_range;
gmp_ui r_rq, r_q, r_r, r;
mpir_ui bsi, size_range;
mpir_ui r_rq, r_q, r_r, r;

tests_start ();
gmp_randinit_default(rands);
Expand Down Expand Up @@ -146,7 +146,7 @@ main (int argc, char **argv)
}

void
dump_abort (char *str, mpz_t dividend, gmp_ui divisor)
dump_abort (char *str, mpz_t dividend, mpir_ui divisor)
{
fprintf (stderr, "ERROR: %s\n", str);
fprintf (stderr, "dividend = "); debug_mp (dividend, -16);
Expand Down
4 changes: 2 additions & 2 deletions tests/mpz/t-fac_ui.c
Expand Up @@ -38,8 +38,8 @@ MA 02110-1301, USA. */
int
main (int argc, char *argv[])
{
gmp_ui n;
gmp_ui limit = 1500;
mpir_ui n;
mpir_ui limit = 1500;
mpz_t f, r;

tests_start ();
Expand Down
10 changes: 5 additions & 5 deletions tests/mpz/t-fdiv_ui.c
Expand Up @@ -27,7 +27,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"
#include "tests.h"

void dump_abort _PROTO ((char *, mpz_t, gmp_ui));
void dump_abort _PROTO ((char *, mpz_t, mpir_ui));
void debug_mp _PROTO ((mpz_t, int));

int
Expand All @@ -38,13 +38,13 @@ main (int argc, char **argv)
mpz_t quotient2, remainder2;
mpz_t temp;
mp_size_t dividend_size;
gmp_ui divisor;
mpir_ui divisor;
int i;
int reps = 10000;
gmp_randstate_t rands;
mpz_t bs;
gmp_ui bsi, size_range;
gmp_ui r_rq, r_q, r_r, r;
mpir_ui bsi, size_range;
mpir_ui r_rq, r_q, r_r, r;

tests_start ();
gmp_randinit_default(rands);
Expand Down Expand Up @@ -146,7 +146,7 @@ main (int argc, char **argv)
}

void
dump_abort (char *str, mpz_t dividend, gmp_ui divisor)
dump_abort (char *str, mpz_t dividend, mpir_ui divisor)
{
fprintf (stderr, "ERROR: %s\n", str);
fprintf (stderr, "dividend = "); debug_mp (dividend, -16);
Expand Down
2 changes: 1 addition & 1 deletion tests/mpz/t-gcd_ui.c
Expand Up @@ -33,7 +33,7 @@ MA 02110-1301, USA. */
static void
check_ui_range (void)
{
gmp_ui got;
mpir_ui got;
mpz_t x;
int i;

Expand Down
4 changes: 2 additions & 2 deletions tests/mpz/t-get_si.c
Expand Up @@ -31,7 +31,7 @@ check_data (void)
{
static const struct {
const char *n;
gmp_si want;
mpir_si want;
} data[] = {
{ "0", 0L },
{ "1", 1L },
Expand All @@ -44,7 +44,7 @@ check_data (void)

int i;
mpz_t n;
gmp_si got;
mpir_si got;

mpz_init (n);
for (i = 0; i < numberof (data); i++)
Expand Down
2 changes: 1 addition & 1 deletion tests/mpz/t-set_si.c
Expand Up @@ -36,7 +36,7 @@ check_data (void)
#endif

static const struct {
gmp_si n;
mpir_si n;
mp_size_t want_size;
mp_limb_t want_data[2];
} data[] = {
Expand Down
10 changes: 5 additions & 5 deletions tests/mpz/t-tdiv_ui.c
Expand Up @@ -27,7 +27,7 @@ MA 02110-1301, USA. */
#include "gmp-impl.h"
#include "tests.h"

void dump_abort _PROTO ((char *, mpz_t, gmp_ui));
void dump_abort _PROTO ((char *, mpz_t, mpir_ui));
void debug_mp _PROTO ((mpz_t, int));

int
Expand All @@ -38,13 +38,13 @@ main (int argc, char **argv)
mpz_t quotient2, remainder2;
mpz_t temp;
mp_size_t dividend_size;
gmp_ui divisor;
mpir_ui divisor;
int i;
int reps = 10000;
gmp_randstate_t rands;
mpz_t bs;
gmp_ui bsi, size_range;
gmp_ui r_rq, r_q, r_r, r;
mpir_ui bsi, size_range;
mpir_ui r_rq, r_q, r_r, r;

tests_start ();
gmp_randinit_default(rands);
Expand Down Expand Up @@ -146,7 +146,7 @@ main (int argc, char **argv)
}

void
dump_abort (char *str, mpz_t dividend, gmp_ui divisor)
dump_abort (char *str, mpz_t dividend, mpir_ui divisor)
{
fprintf (stderr, "ERROR: %s\n", str);
fprintf (stderr, "dividend = "); debug_mp (dividend, -16);
Expand Down
10 changes: 5 additions & 5 deletions tests/rand/t-lc2exp.c
Expand Up @@ -28,11 +28,11 @@ MA 02110-1301, USA. */

/* a=0 and c=0 produces zero results always. */
void
check_zero (gmp_ui m2exp)
check_zero (mpir_ui m2exp)
{
gmp_randstate_t r;
mpz_t a;
gmp_ui c;
mpir_ui c;
int i;

mpz_init_set_ui (a, 0L);
Expand Down Expand Up @@ -62,7 +62,7 @@ check_nega (void)
{
gmp_randstate_t r;
mpz_t a;
gmp_ui c, m2exp;
mpir_ui c, m2exp;
int i;

mpz_init (a);
Expand Down Expand Up @@ -90,7 +90,7 @@ check_bigc (void)
{
gmp_randstate_t r;
mpz_t a;
gmp_ui c, m2exp, bits;
mpir_ui c, m2exp, bits;
int i;

mpz_init_set_ui (a, 0L);
Expand Down Expand Up @@ -122,7 +122,7 @@ check_bigc1 (void)
{
gmp_randstate_t r;
mpz_t a;
gmp_ui c, m2exp;
mpir_ui c, m2exp;
int i;

mpz_init_set_ui (a, 0L);
Expand Down
4 changes: 2 additions & 2 deletions tests/rand/t-urbui.c
Expand Up @@ -31,13 +31,13 @@ MA 02110-1301, USA. */
void
check_one (const char *name, gmp_randstate_ptr rstate)
{
gmp_ui bits, limit, got;
mpir_ui bits, limit, got;
int i;

for (bits = 0; bits < BITS_PER_UI; bits++)
{
/* will demand got < limit */
limit = (((gmp_ui)1) << bits);
limit = (((mpir_ui)1) << bits);

for (i = 0; i < 5; i++)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/rand/t-urmui.c
Expand Up @@ -31,7 +31,7 @@ MA 02110-1301, USA. */
void
check_one (const char *name, gmp_randstate_ptr rstate)
{
static const gmp_ui n_table[] = {
static const mpir_ui n_table[] = {
1, 2, 3, 4, 5, 6, 7, 8,
123, 456, 789,

Expand All @@ -44,7 +44,7 @@ check_one (const char *name, gmp_randstate_ptr rstate)
GMP_UI_MAX-2, GMP_UI_MAX-1, GMP_UI_MAX,
};

gmp_ui got, n;
mpir_ui got, n;
int i, j;

for (i = 0; i < numberof (n_table); i++)
Expand Down
8 changes: 4 additions & 4 deletions tests/t-constants.c
Expand Up @@ -234,7 +234,7 @@ main (int argc, char *argv[])
CHECK_HIGHBIT (UINT_HIGHBIT, unsigned int, "0x%X");
CHECK_HIGHBIT (USHRT_HIGHBIT, unsigned short, "0x%hX");
CHECK_HIGHBIT (LONG_HIGHBIT, long, "0x%lX");
CHECK_HIGHBIT (GMP_UI_HIBIT, gmp_ui, "%#Mx");
CHECK_HIGHBIT (GMP_UI_HIBIT, mpir_ui, "%#Mx");

#if 0 /* Bad! */
CHECK_HIGHBIT (INT_HIGHBIT, int, "0x%X");
Expand All @@ -248,7 +248,7 @@ main (int argc, char *argv[])
#endif
CHECK_MAX (ULONG_MAX, 0, unsigned long, "%lu");
CHECK_MAX (UINT_MAX, 0, unsigned int, "%u");
CHECK_MAX (GMP_UI_MAX, 0, gmp_ui, "%M");
CHECK_MAX (GMP_UI_MAX, 0, mpir_ui, "%M");
CHECK_MAX (USHRT_MAX, 0, unsigned short, "%hu");
#if 0 /* Bad! */
CHECK_MAX (MP_SIZE_T_MAX, MP_SIZE_T_MIN, mp_size_t, SS("%d","%ld"));
Expand Down Expand Up @@ -367,13 +367,13 @@ main (int argc, char *argv[])
CALC_BITS (bits, long); printf (" long %d\n", bits);
CALC_BITS (bits, int); printf (" int %d\n", bits);
CALC_BITS (bits, short); printf (" short %d\n", bits);
CALC_BITS (bits, gmp_si); printf (" GMP signed int %d\n", bits);
CALC_BITS (bits, mpir_si); printf (" GMP signed int %d\n", bits);
CALC_BITS (bits, unsigned long long); printf (" unsigned long long %d\n", bits);
CALC_BITS (bits, unsigned long); printf (" unsigned long %d\n", bits);
CALC_BITS (bits, unsigned int); printf (" unsigned int %d\n", bits);
CALC_BITS (bits, unsigned short); printf (" unsigned short %d\n", bits);
CALC_BITS (bits, mp_size_t); printf (" mp_size_t %d\n", bits);
CALC_BITS (bits, gmp_ui); printf (" GMP unsigned int %d\n", bits);
CALC_BITS (bits, mpir_ui); printf (" GMP unsigned int %d\n", bits);
}

if (error)
Expand Down