diff options
author | thevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2009-07-29 15:07:08 +0000 |
---|---|---|
committer | thevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2009-07-29 15:07:08 +0000 |
commit | ea5947a6d81a07fa8c786335c406492355680e5a (patch) | |
tree | 6a74cbeb375063df11b4c85ae25f1fc33af2f227 /tests/read_data.c | |
parent | 447be3d6e830a04f7cc5da911ae32ca4dc875ff7 (diff) | |
download | mpc-ea5947a6d81a07fa8c786335c406492355680e5a.tar.gz |
src/mpc-impl.h: Add a C++ iterator on mpfr_rnd_t enum (g++ 4.3.2 refuses to iterate on enumeration, bug reported by Mickael Gastineau).
tests/tgeneric.c: Use prefix iterator ++, iterate between GMP_RNDN and GMP_RND_MAX.
tests/read_data.c: Explicit cast of malloc return.
NEWS: Fix compilation with g++.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@627 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/read_data.c')
-rw-r--r-- | tests/read_data.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/read_data.c b/tests/read_data.c index fc10b18..0071dbb 100644 --- a/tests/read_data.c +++ b/tests/read_data.c @@ -67,12 +67,13 @@ open_data_file (const char *file_name) { FILE *fp; char *src_dir; + char default_srcdir[] = "."; src_dir = getenv ("srcdir"); if (src_dir == NULL) - src_dir = "."; + src_dir = default_srcdir; - pathname = malloc ((strlen (src_dir)) + strlen (file_name) + 2); + pathname = (char *) malloc ((strlen (src_dir)) + strlen (file_name) + 2); if (pathname == NULL) { printf ("Cannot allocate memory\n"); @@ -155,7 +156,7 @@ read_string (FILE *fp, char **buffer_ptr, size_t buffer_length, const char *name line_number++; if (pos + 1 > buffer_length) { - buffer = realloc (buffer, 2 * buffer_length); + buffer = (char *) realloc (buffer, 2 * buffer_length); if (buffer == NULL) { printf ("Cannot allocate memory\n"); @@ -172,7 +173,7 @@ read_string (FILE *fp, char **buffer_ptr, size_t buffer_length, const char *name if (pos + 1 > buffer_length) { - buffer = realloc (buffer, buffer_length + 1); + buffer = (char *) realloc (buffer, buffer_length + 1); if (buffer == NULL) { printf ("Cannot allocate memory\n"); |