summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-11-26 15:14:23 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-11-26 15:14:23 +0000
commit5d1d1b05eaddec01ebb7fdd6bf0f9fb3e77266aa (patch)
treee9b057fc27bc99d70f720b9f340cc983afc317b9
parentbe03870116e21b11766edce1326d79f9ce817143 (diff)
downloadmpfr-5d1d1b05eaddec01ebb7fdd6bf0f9fb3e77266aa.tar.gz
MPFR_DECIMAL_POINT now needs to have type char (because of vasprintf.c).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5019 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--mpfr-impl.h6
-rw-r--r--out_str.c2
-rw-r--r--strtofr.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/mpfr-impl.h b/mpfr-impl.h
index 71e0588fa..4dcc87f4b 100644
--- a/mpfr-impl.h
+++ b/mpfr-impl.h
@@ -954,9 +954,11 @@ do { \
/* Needs <locale.h> */
#ifdef HAVE_LOCALE_H
#include <locale.h>
-#define MPFR_DECIMAL_POINT ((unsigned char) localeconv()->decimal_point[0])
+/* Warning! In case of signed char, the value of MPFR_DECIMAL_POINT may
+ be negative (the ISO C99 does not seem to forbid negative values). */
+#define MPFR_DECIMAL_POINT (localeconv()->decimal_point[0])
#else
-#define MPFR_DECIMAL_POINT '.'
+#define MPFR_DECIMAL_POINT ((char) '.')
#endif
diff --git a/out_str.c b/out_str.c
index 84922309d..44d87755a 100644
--- a/out_str.c
+++ b/out_str.c
@@ -82,7 +82,7 @@ mpfr_out_str (FILE *stream, int base, size_t n_digits, mpfr_srcptr op,
/* outputs mantissa */
fputc (*s++, stream); e--; /* leading digit */
- fputc (MPFR_DECIMAL_POINT, stream);
+ fputc ((unsigned char) MPFR_DECIMAL_POINT, stream);
fputs (s, stream); /* rest of mantissa */
(*__gmp_free_func) (s0, l);
diff --git a/strtofr.c b/strtofr.c
index 2fbb8a258..ade78a906 100644
--- a/strtofr.c
+++ b/strtofr.c
@@ -226,7 +226,7 @@ parse_string (mpfr_t x, struct parsed_string *pstr,
const char *prefix_str;
int decimal_point;
- decimal_point = MPFR_DECIMAL_POINT;
+ decimal_point = (unsigned char) MPFR_DECIMAL_POINT;
/* Init variable */
pstr->mantissa = NULL;