diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-11-26 15:14:23 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-11-26 15:14:23 +0000 |
commit | 5d1d1b05eaddec01ebb7fdd6bf0f9fb3e77266aa (patch) | |
tree | e9b057fc27bc99d70f720b9f340cc983afc317b9 | |
parent | be03870116e21b11766edce1326d79f9ce817143 (diff) | |
download | mpfr-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.h | 6 | ||||
-rw-r--r-- | out_str.c | 2 | ||||
-rw-r--r-- | strtofr.c | 2 |
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 @@ -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); @@ -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; |