diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-19 13:11:54 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-19 13:11:54 +0000 |
commit | 1bb7bffb26000ffd3b2268551fd598fd922838ef (patch) | |
tree | eec8aba9ca8a253c9df3df6becb0502fbf9138c3 /libgfortran/io/unix.c | |
parent | 1f3d2e3f83165b46221d86b0a39ad34246c1319b (diff) | |
download | gcc-1bb7bffb26000ffd3b2268551fd598fd922838ef.tar.gz |
2010-07-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/44953
* io/unix.c (mem_alloc_w4): Return gfc_char4_t instead of char type
pointer. (mem_write4): Remove cast to gfc_char4_t.
* io/transfer.c (write_block): Use a gfc_char4_t pointer.
(memset4): New helper function. (next_record_w): Use new helper
function rather than sset for internal units. Don't attempt to pad
with spaces if it is not needed.
* io/unix.h: Update prototype for mem_alloc_w4.
* io/write.c (memset4): Use gfc_char4_t pointer and chracter type.
Don't use multiply by 4 to compute offset. (memcpy4): Likewise.
(write_default_char4): Use a gfc_char4_t pointer and update memset4
and memcpy calls. (write_a): Likewise. (write_l): Likewise.
(write_boz): Likewise. (write_decimal): Likewise. (write_x): Likewise.
(write_char): Add support for character(kind=4) internal units that
was previously missed. (write_integer): Use a gfc_char4_t pointer and
update memset4 and memcpy calls. (write_character): Likewise.
(write_separator): Add support for character(kind=4) internal units
that was previously missed.
* write_float.def (output_float): Use a gfc_char4_t pointer and
update memset4 and memcpy calls. (write_infnan): Likewise.
(output_float_FMT_G_): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162304 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r-- | libgfortran/io/unix.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 65decce1be3..3a795aef536 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -659,12 +659,13 @@ mem_alloc_w (stream * strm, int * len) } -char * +gfc_char4_t * mem_alloc_w4 (stream * strm, int * len) { unix_stream * s = (unix_stream *) strm; gfc_offset m; gfc_offset where = s->logical_offset; + gfc_char4_t *result = (gfc_char4_t *) s->buffer; m = where + *len; @@ -675,7 +676,7 @@ mem_alloc_w4 (stream * strm, int * len) return NULL; s->logical_offset = m; - return s->buffer + (where - s->buffer_offset) * 4; + return &result[where - s->buffer_offset]; } @@ -744,7 +745,7 @@ mem_write4 (stream * s, const void * buf, ssize_t nwords) gfc_char4_t *p; int nw = nwords; - p = (gfc_char4_t *) mem_alloc_w4 (s, &nw); + p = mem_alloc_w4 (s, &nw); if (p) { while (nw--) |