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/inp_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/inp_str.c')
-rw-r--r-- | mpz/inp_str.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mpz/inp_str.c b/mpz/inp_str.c index a933eac55..f65bdec58 100644 --- a/mpz/inp_str.c +++ b/mpz/inp_str.c @@ -147,7 +147,7 @@ mpz_inp_str_nowhite (mpz_ptr x, FILE *stream, int base, int c, size_t nread) /* Make sure the string is not empty, mpn_set_str would fail. */ if (str_size == 0) { - x->_mp_size = 0; + SIZ (x) = 0; } else { @@ -155,8 +155,8 @@ mpz_inp_str_nowhite (mpz_ptr x, FILE *stream, int base, int c, size_t nread) MPZ_REALLOC (x, xsize); /* Convert the byte array in base BASE to our bignum format. */ - xsize = mpn_set_str (x->_mp_d, (unsigned char *) str, str_size, base); - x->_mp_size = negative ? -xsize : xsize; + xsize = mpn_set_str (PTR (x), (unsigned char *) str, str_size, base); + SIZ (x) = negative ? -xsize : xsize; } (*__gmp_free_func) (str, alloc_size); return nread; |