diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-21 04:44:10 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-21 04:44:10 +0000 |
commit | fff1407ebe3a534c5f12178026be94ed6593c8be (patch) | |
tree | a258b1d92af9602654e72eacbb1a483b32e2750f /libgfortran | |
parent | 084f03c676f6d780de5bdbc089ae34ce4655a854 (diff) | |
download | gcc-fff1407ebe3a534c5f12178026be94ed6593c8be.tar.gz |
2008-07-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/36857
* io/write_float.def: Comment out locale dependent code and fix general
comments.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138021 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/write_float.def | 53 |
2 files changed, 34 insertions, 25 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index c845606c803..48a20e99d21 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2008-07-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/36857 + * io/write_float.def: Comment out locale dependent code and fix general + comments. + 2008-07-07 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36341 diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def index 090bd712eb4..ed4c45f6277 100644 --- a/libgfortran/io/write_float.def +++ b/libgfortran/io/write_float.def @@ -99,32 +99,13 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size, if (d < 0) internal_error (&dtp->common, "Unspecified precision"); - /* Use sprintf to print the number in the format +D.DDDDe+ddd - For an N digit exponent, this gives us (MIN_FIELD_WIDTH-5)-N digits - after the decimal point, plus another one before the decimal point. */ - sign = calculate_sign (dtp, sign_bit); - - /* # The result will always contain a decimal point, even if no - * digits follow it - * - * - The converted value is to be left adjusted on the field boundary - * - * + A sign (+ or -) always be placed before a number - * - * MIN_FIELD_WIDTH minimum field width - * - * * (ndigits-1) is used as the precision - * - * e format: [-]d.ddde±dd where there is one digit before the - * decimal-point character and the number of digits after it is - * equal to the precision. The exponent always contains at least two - * digits; if the value is zero, the exponent is 00. - */ - - /* Check the given string has punctuation in the correct places. */ - if (d != 0 && (buffer[2] != '.' || buffer[ndigits + 2] != 'e')) - internal_error (&dtp->common, "printf is broken"); + + /* The following code checks the given string has punctuation in the correct + places. Uncomment if needed for debugging. + if (d != 0 && ((buffer[2] != '.' && buffer[2] != ',') + || buffer[ndigits + 2] != 'e')) + internal_error (&dtp->common, "printf is broken"); */ /* Read the exponent back in. */ e = atoi (&buffer[ndigits + 3]) + 1; @@ -702,8 +683,30 @@ OUTPUT_FLOAT_FMT_G(16) #undef OUTPUT_FLOAT_FMT_G + /* Define a macro to build code for write_float. */ + /* Note: Before output_float is called, sprintf is used to print to buffer the + number in the format +D.DDDDe+ddd. For an N digit exponent, this gives us + (MIN_FIELD_WIDTH-5)-N digits after the decimal point, plus another one + before the decimal point. + + # The result will always contain a decimal point, even if no + digits follow it + + - The converted value is to be left adjusted on the field boundary + + + A sign (+ or -) always be placed before a number + + MIN_FIELD_WIDTH minimum field width + + * (ndigits-1) is used as the precision + + e format: [-]d.ddde±dd where there is one digit before the + decimal-point character and the number of digits after it is + equal to the precision. The exponent always contains at least two + digits; if the value is zero, the exponent is 00. */ + #ifdef HAVE_SNPRINTF #define DTOA \ |