From 4dadda8fb0ca2ba78608c3e86afcb2d12d5f7f25 Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Fri, 10 Apr 2009 11:26:56 +0300 Subject: [PATCH] io.h (move_pos_offset): Remove prototype. 2009-04-10 Janne Blomqvist * io/io.h (move_pos_offset): Remove prototype. * io/transfer.c (formatted_transfer_scalar_read): Use sseek instead of move_pos_offset. * io/unix.c (move_pos_offset): Remove. From-SVN: r145876 --- libgfortran/ChangeLog | 7 +++++++ libgfortran/io/io.h | 3 --- libgfortran/io/transfer.c | 4 ++-- libgfortran/io/unix.c | 25 ------------------------- 4 files changed, 9 insertions(+), 30 deletions(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index ed6162be686..b3fb58cb338 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2009-04-10 Janne Blomqvist + + * io/io.h (move_pos_offset): Remove prototype. + * io/transfer.c (formatted_transfer_scalar_read): Use sseek + instead of move_pos_offset. + * io/unix.c (move_pos_offset): Remove. + 2009-04-10 Janne Blomqvist PR libfortran/39665 libfortran/39702 libfortran/39709 diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index 7e4742ec294..c9b3db3da5f 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -707,9 +707,6 @@ fnode; /* unix.c */ -extern int move_pos_offset (stream *, int); -internal_proto(move_pos_offset); - extern int compare_files (stream *, stream *); internal_proto(compare_files); diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 343dfb8453a..717041d0b41 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -1153,7 +1153,7 @@ formatted_transfer_scalar_read (st_parameter_dt *dtp, bt type, void *p, int kind if (dtp->u.p.skips < 0) { if (is_internal_unit (dtp)) - move_pos_offset (dtp->u.p.current_unit->s, dtp->u.p.skips); + sseek (dtp->u.p.current_unit->s, dtp->u.p.skips, SEEK_CUR); else fbuf_seek (dtp->u.p.current_unit, dtp->u.p.skips, SEEK_CUR); dtp->u.p.current_unit->bytes_left -= (gfc_offset) dtp->u.p.skips; @@ -1329,7 +1329,7 @@ formatted_transfer_scalar_write (st_parameter_dt *dtp, bt type, void *p, int kin if (dtp->u.p.skips < 0) { if (is_internal_unit (dtp)) - move_pos_offset (dtp->u.p.current_unit->s, dtp->u.p.skips); + sseek (dtp->u.p.current_unit->s, dtp->u.p.skips, SEEK_CUR); else fbuf_seek (dtp->u.p.current_unit, dtp->u.p.skips, SEEK_CUR); dtp->u.p.current_unit->bytes_left -= (gfc_offset) dtp->u.p.skips; diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index fe181a122d9..4d5ec70ae84 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -146,31 +146,6 @@ typedef struct unix_stream; -/*move_pos_offset()-- Move the record pointer right or left - *relative to current position */ - -int -move_pos_offset (stream* st, int pos_off) -{ - unix_stream * str = (unix_stream*)st; - if (pos_off < 0) - { - str->logical_offset += pos_off; - - if (str->ndirty > str->logical_offset) - { - if (str->ndirty + pos_off > 0) - str->ndirty += pos_off; - else - str->ndirty = 0; - } - - return pos_off; - } - return 0; -} - - /* fix_fd()-- Given a file descriptor, make sure it is not one of the * standard descriptors, returning a non-standard descriptor. If the * user specifies that system errors should go to standard output,