summaryrefslogtreecommitdiff
path: root/mpf
diff options
context:
space:
mode:
authorTorbjorn Granlund <tg@gmplib.org>2016-08-29 16:48:20 +0200
committerTorbjorn Granlund <tg@gmplib.org>2016-08-29 16:48:20 +0200
commit9deac7786c2eebbb7bdb805a544e7f7f0f3f86d3 (patch)
treeae5c0ede128c654a480e12668b60b5625b409854 /mpf
parentd6b531d0501182336bed7d7c799fee506c756867 (diff)
downloadgmp-9deac7786c2eebbb7bdb805a544e7f7f0f3f86d3.tar.gz
Use __GMP_ALLOCATE_FUNC_TYPE and friends.
Diffstat (limited to 'mpf')
-rw-r--r--mpf/get_str.c2
-rw-r--r--mpf/inp_str.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/mpf/get_str.c b/mpf/get_str.c
index 682819daa..0bfd99fe4 100644
--- a/mpf/get_str.c
+++ b/mpf/get_str.c
@@ -170,7 +170,7 @@ mpf_get_str (char *dbuf, mp_exp_t *exp, int base, size_t n_digits, mpf_srcptr u)
/* We didn't get a string from the user. Allocate one (and return
a pointer to it) with space for `-' and terminating null. */
alloc_size = n_digits + 2;
- dbuf = (char *) (*__gmp_allocate_func) (n_digits + 2);
+ dbuf = __GMP_ALLOCATE_FUNC_TYPE (n_digits + 2, char);
}
if (un == 0)
diff --git a/mpf/inp_str.c b/mpf/inp_str.c
index 45cc34ceb..3db589705 100644
--- a/mpf/inp_str.c
+++ b/mpf/inp_str.c
@@ -47,7 +47,7 @@ mpf_inp_str (mpf_ptr rop, FILE *stream, int base)
stream = stdin;
alloc_size = 100;
- str = (char *) (*__gmp_allocate_func) (alloc_size);
+ str = __GMP_ALLOCATE_FUNC_TYPE (alloc_size, char);
str_size = 0;
nread = 0;
@@ -65,7 +65,7 @@ mpf_inp_str (mpf_ptr rop, FILE *stream, int base)
{
size_t old_alloc_size = alloc_size;
alloc_size = alloc_size * 3 / 2;
- str = (char *) (*__gmp_reallocate_func) (str, old_alloc_size, alloc_size);
+ str = __GMP_REALLOCATE_FUNC_TYPE (str, old_alloc_size, alloc_size, char);
}
if (c == EOF || isspace (c))
break;
@@ -79,7 +79,7 @@ mpf_inp_str (mpf_ptr rop, FILE *stream, int base)
{
size_t old_alloc_size = alloc_size;
alloc_size = alloc_size * 3 / 2;
- str = (char *) (*__gmp_reallocate_func) (str, old_alloc_size, alloc_size);
+ str = __GMP_REALLOCATE_FUNC_TYPE (str, old_alloc_size, alloc_size, char);
}
str[str_size] = 0;