summaryrefslogtreecommitdiff
path: root/mpz/get_str.c
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2012-02-23 21:17:47 +0100
committerMarc Glisse <marc.glisse@inria.fr>2012-02-23 21:17:47 +0100
commit2b06ef413348321424141880c23fea600940e25b (patch)
treed2f66feff6187bda4f7440776914199d7eb0d5b1 /mpz/get_str.c
parent8e1827335d45a049e434a2b095558f14dd4bf36f (diff)
downloadgmp-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.c6
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);