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_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/set_str.c')
-rw-r--r-- | mpz/set_str.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mpz/set_str.c b/mpz/set_str.c index 51f3ce4d6..b80b5fdab 100644 --- a/mpz/set_str.c +++ b/mpz/set_str.c @@ -95,7 +95,7 @@ mpz_set_str (mpz_ptr x, const char *str, int base) /* Make sure the string does not become empty, mpn_set_str would fail. */ if (c == 0) { - x->_mp_size = 0; + SIZ (x) = 0; return 0; } @@ -126,8 +126,8 @@ mpz_set_str (mpz_ptr x, const char *str, int base) MPZ_REALLOC (x, xsize); /* Convert the byte array in base BASE to our bignum format. */ - xsize = mpn_set_str (x->_mp_d, (unsigned char *) begs, str_size, base); - x->_mp_size = negative ? -xsize : xsize; + xsize = mpn_set_str (PTR (x), (unsigned char *) begs, str_size, base); + SIZ (x) = negative ? -xsize : xsize; TMP_FREE; return 0; |