This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi, move_pos_offset is nowadays not needed anymore. Back with the old low level I/O library, the sseek function didn't have a whence argument, but now the same functionality is provided by sseek(..., SEEK_CUR). The attached patch removes said function, and updates callers. Regtested on i686-pc-linux-gnu, though with lots of ICE's due to some other patch, but no I/O regressions it seems. Ok for trunk? -- Janne Blomqvist
2009-04-10 Janne Blomqvist <jb@gcc.gnu.org> * 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.
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index 02b14ce..4ef2318 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 343dfb8..717041d 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 fe181a1..4d5ec70 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,
Attachment:
signature.asc
Description: OpenPGP digital signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |