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/get_str.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/get_str.c')
-rw-r--r-- | mpz/get_str.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mpz/get_str.c b/mpz/get_str.c index 56e4282a0..486b88b95 100644 --- a/mpz/get_str.c +++ b/mpz/get_str.c @@ -31,7 +31,7 @@ char * mpz_get_str (char *res_str, int base, mpz_srcptr x) { mp_ptr xp; - mp_size_t x_size = x->_mp_size; + mp_size_t x_size = SIZ (x); char *str; char *return_str; size_t str_size; @@ -80,11 +80,11 @@ mpz_get_str (char *res_str, int base, mpz_srcptr x) /* mpn_get_str clobbers its input on non power-of-2 bases */ TMP_MARK; - xp = x->_mp_d; + xp = PTR (x); if (! POW2_P (base)) { xp = TMP_ALLOC_LIMBS (x_size + 1); /* +1 in case x_size==0 */ - MPN_COPY (xp, x->_mp_d, x_size); + MPN_COPY (xp, PTR (x), x_size); } str_size = mpn_get_str ((unsigned char *) res_str, base, xp, x_size); |