diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2015-11-22 22:14:46 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2015-11-22 22:14:46 +0000 |
commit | ba67259c00e54af656e509537e19ee017929ddc9 (patch) | |
tree | df72fb6bf3a8ab04fdf995c8bf53b8765f1f94f2 /libgfortran | |
parent | 4f8a3b87f948d472c2aeb1bc9177892c8fc6f113 (diff) | |
download | gcc-ba67259c00e54af656e509537e19ee017929ddc9.zip gcc-ba67259c00e54af656e509537e19ee017929ddc9.tar.gz gcc-ba67259c00e54af656e509537e19ee017929ddc9.tar.bz2 |
write_float.def (output_float): Move block determining room for leading zero to before checkng g0 formatting.
2015-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* io/write_float.def (output_float): Move block determining
room for leading zero to before checkng g0 formatting.
From-SVN: r230728
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/io/write_float.def | 20 |
2 files changed, 15 insertions, 10 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 77030e9..f90d530 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2015-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + * io/write_float.def (output_float): Move block determining + room for leading zero to before checkng g0 formatting. + 2015-09-12 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR libfortran/67527 diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def index dd298aa..183fe0b 100644 --- a/libgfortran/io/write_float.def +++ b/libgfortran/io/write_float.def @@ -514,12 +514,21 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size, w = w == 1 ? 2 : w; } } - + /* Work out how much padding is needed. */ nblanks = w - (nbefore + nzero + nafter + edigits + 1); if (sign != S_NONE) nblanks--; + /* See if we have space for a zero before the decimal point. */ + if (nbefore == 0 && nblanks > 0) + { + leadzero = 1; + nblanks--; + } + else + leadzero = 0; + if (dtp->u.p.g0_no_blanks) { w -= nblanks; @@ -544,15 +553,6 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size, return false; } - /* See if we have space for a zero before the decimal point. */ - if (nbefore == 0 && nblanks > 0) - { - leadzero = 1; - nblanks--; - } - else - leadzero = 0; - /* For internal character(kind=4) units, we duplicate the code used for regular output slightly modified. This needs to be maintained consistent with the regular code that follows this block. */ |