=================================================================== RCS file: /home/cvs/OpenXM_contrib/gmp/Attic/randlc2x.c,v retrieving revision 1.1 retrieving revision 1.1.1.2 diff -u -p -r1.1 -r1.1.1.2 --- OpenXM_contrib/gmp/Attic/randlc2x.c 2000/09/09 14:12:16 1.1 +++ OpenXM_contrib/gmp/Attic/randlc2x.c 2003/08/25 16:06:00 1.1.1.2 @@ -2,7 +2,7 @@ state STATE for a linear congruential generator with multiplier A, adder C, and modulus 2 ^ M2EXP. -Copyright (C) 2000 Free Software Foundation, Inc. +Copyright 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -25,35 +25,26 @@ MA 02111-1307, USA. */ #include "gmp-impl.h" void -#if __STDC__ gmp_randinit_lc_2exp (gmp_randstate_t rstate, - mpz_t a, + mpz_srcptr a, unsigned long int c, unsigned long int m2exp) -#else -gmp_randinit_lc_2exp (rstate, a, c, m2exp) - gmp_randstate_t rstate; - mpz_t a; - unsigned long int c; - unsigned long int m2exp; -#endif { - mpz_init_set_ui (rstate->seed, 1); - _mpz_realloc (rstate->seed, m2exp / BITS_PER_MP_LIMB - + (m2exp % BITS_PER_MP_LIMB != 0)); + mpz_init_set_ui (rstate->_mp_seed, 1); + _mpz_realloc (rstate->_mp_seed, (m2exp + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS); /* Allocate algorithm specific data. */ - rstate->algdata.lc = (__gmp_randata_lc *) - (*_mp_allocate_func) (sizeof (__gmp_randata_lc)); + rstate->_mp_algdata._mp_lc = (__gmp_randata_lc *) + (*__gmp_allocate_func) (sizeof (__gmp_randata_lc)); - mpz_init_set (rstate->algdata.lc->a, a); - rstate->algdata.lc->c = c; + mpz_init_set (rstate->_mp_algdata._mp_lc->_mp_a, a); + rstate->_mp_algdata._mp_lc->_mp_c = c; /* Cover weird case where m2exp is 0, which means that m is used instead of m2exp. */ if (m2exp == 0) - mpz_init_set_ui (rstate->algdata.lc->m, 0); - rstate->algdata.lc->m2exp = m2exp; + mpz_init_set_ui (rstate->_mp_algdata._mp_lc->_mp_m, 0); + rstate->_mp_algdata._mp_lc->_mp_m2exp = m2exp; - rstate->alg = GMP_RAND_ALG_LC; + rstate->_mp_alg = GMP_RAND_ALG_LC; }