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/set_ui.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/set_ui.c')
-rw-r--r-- | mpz/set_ui.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mpz/set_ui.c b/mpz/set_ui.c index 13afc6a78..59568914e 100644 --- a/mpz/set_ui.c +++ b/mpz/set_ui.c @@ -26,17 +26,17 @@ mpz_set_ui (mpz_ptr dest, unsigned long int val) { mp_size_t size; - dest->_mp_d[0] = val & GMP_NUMB_MASK; + PTR (dest)[0] = val & GMP_NUMB_MASK; size = val != 0; #if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */ if (val > GMP_NUMB_MAX) { MPZ_REALLOC (dest, 2); - dest->_mp_d[1] = val >> GMP_NUMB_BITS; + PTR (dest)[1] = val >> GMP_NUMB_BITS; size = 2; } #endif - dest->_mp_size = size; + SIZ (dest) = size; } |