diff options
author | Kevin Ryde <user42@zip.com.au> | 2002-02-08 22:12:00 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2002-02-08 22:12:00 +0100 |
commit | 0b7e0f8f6c9c38ef3ae37ed08b35a16444d9a4f8 (patch) | |
tree | aeba1a30c4822a4f7ed58efaa8cc51ddd13a1945 /mpz/get_str.c | |
parent | 55d8bb0fecbf3403f26c4a28dac55ea433d68b81 (diff) | |
download | gmp-0b7e0f8f6c9c38ef3ae37ed08b35a16444d9a4f8.tar.gz |
* mpz/get_str.c, mpz/sizeinbase.c, mpbsd/mout.c, tune/speed.h: Use
MPN_SIZEINBASE.
Diffstat (limited to 'mpz/get_str.c')
-rw-r--r-- | mpz/get_str.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mpz/get_str.c b/mpz/get_str.c index 5c5686a60..e84f947fc 100644 --- a/mpz/get_str.c +++ b/mpz/get_str.c @@ -27,6 +27,7 @@ MA 02111-1307, USA. */ #include <string.h> /* for strlen */ #include "gmp.h" #include "gmp-impl.h" +#include "longlong.h" char * mpz_get_str (char *res_str, int base, mpz_srcptr x) @@ -57,7 +58,8 @@ mpz_get_str (char *res_str, int base, mpz_srcptr x) if (res_str == NULL) { /* digits, null terminator, possible minus sign */ - alloc_size = mpn_sizeinbase (PTR(x), ABS(x_size), base) + 1 + (x_size<0); + MPN_SIZEINBASE (alloc_size, PTR(x), ABS(x_size), base); + alloc_size += 1 + (x_size<0); res_str = (char *) (*__gmp_allocate_func) (alloc_size); } return_str = res_str; |