summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-16 14:07:58 +0000
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-16 14:07:58 +0000
commit31b1f24d82db2176b3cdd4069e3eb8e99ad18b4b (patch)
treefc5b18ebbb3380f95f4884f2faff23226c4d27e6 /libgfortran
parentb0342e9817077fffa6dccf0c7fda031884ebeeb1 (diff)
downloadgcc-31b1f24d82db2176b3cdd4069e3eb8e99ad18b4b.tar.gz
* io/write.c (write_logical): Don't print extra blank.
(write_integer): Base field width on kind. (list_formatted_write): Output initial blank. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81914 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog7
-rw-r--r--libgfortran/io/write.c30
2 files changed, 33 insertions, 4 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 27531d84d72..05609b4f5b4 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,4 +1,11 @@
2004-05-16 Janne Blomqvist <jblomqvi@cc.hut.fi>
+ Paul Brook <paul@codesourcery.com>
+
+ * io/write.c (write_logical): Don't print extra blank.
+ (write_integer): Base field width on kind.
+ (list_formatted_write): Output initial blank.
+
+2004-05-16 Janne Blomqvist <jblomqvi@cc.hut.fi>
* io/io.h (flush): Add prototype.
* io/transfer.c (finalize_transfer): Flush partial records.
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 05dbd9bb789..8e5a3204d86 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -875,12 +875,10 @@ write_char (char c)
/* write_logical()-- Write a list-directed logical value */
-/* Default logical output should be L2
- according to DEC fortran Manual. */
+
static void
write_logical (const char *source, int length)
{
- write_char (' ');
write_char (extract_int (source, length) ? 'T' : 'F');
}
@@ -893,10 +891,33 @@ write_integer (const char *source, int length)
char *p;
const char *q;
int digits;
- int width = 12;
+ int width;
q = itoa (extract_int (source, length));
+ switch (length)
+ {
+ case 1:
+ width = 4;
+ break;
+
+ case 2:
+ width = 6;
+ break;
+
+ case 4:
+ width = 11;
+ break;
+
+ case 8:
+ width = 20;
+ break;
+
+ default:
+ width = 0;
+ break;
+ }
+
digits = strlen (q);
if(width < digits )
@@ -1039,6 +1060,7 @@ list_formatted_write (bt type, void *p, int len)
{
g.first_item = 0;
char_flag = 0;
+ write_char (' ');
}
else
{