diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2012-02-23 21:17:47 +0100 |
---|---|---|
committer | Marc Glisse <marc.glisse@inria.fr> | 2012-02-23 21:17:47 +0100 |
commit | 2b06ef413348321424141880c23fea600940e25b (patch) | |
tree | d2f66feff6187bda4f7440776914199d7eb0d5b1 /mpz/iset_si.c | |
parent | 8e1827335d45a049e434a2b095558f14dd4bf36f (diff) | |
download | gmp-2b06ef413348321424141880c23fea600940e25b.tar.gz |
Use the macros ALLOC etc to access the fields of mpz_t in mpz/*.
Test mpz_abs when it requires a reallocation.
Diffstat (limited to 'mpz/iset_si.c')
-rw-r--r-- | mpz/iset_si.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mpz/iset_si.c b/mpz/iset_si.c index 64e51b386..76201cd55 100644 --- a/mpz/iset_si.c +++ b/mpz/iset_si.c @@ -28,22 +28,22 @@ mpz_init_set_si (mpz_ptr dest, signed long int 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); + ALLOC (dest) = 1; + PTR (dest) = (mp_ptr) (*__gmp_allocate_func) (BYTES_PER_MP_LIMB); vl = (mp_limb_t) ABS_CAST (unsigned long int, val); - dest->_mp_d[0] = vl & GMP_NUMB_MASK; + PTR (dest)[0] = vl & GMP_NUMB_MASK; size = vl != 0; #if GMP_NAIL_BITS != 0 if (vl > GMP_NUMB_MAX) { MPZ_REALLOC (dest, 2); - dest->_mp_d[1] = vl >> GMP_NUMB_BITS; + PTR (dest)[1] = vl >> GMP_NUMB_BITS; size = 2; } #endif - dest->_mp_size = val >= 0 ? size : -size; + SIZ (dest) = val >= 0 ? size : -size; } |