Commit Graph

14 Commits

Author SHA1 Message Date
Paul Brook bd72d66cb5 transfer.c (read_sf): Rename uinty to readlen.
* io/transfer.c (read_sf): Rename uinty to readlen.  Detect EOF.
	(finalize_transfer): Move setjmp after namlist IO.
	* io/unix.c (mem_alloc_r_at): Calculate remaining length correctly.
testsuite/
	* gfortran.dg/eof_1.f90: New test.

From-SVN: r86831
2004-08-31 15:53:31 +00:00
Tobias Schlüter d7177ab25e trans-decl.c, [...]: Replace all occurences of 'gfc_strlen_type_node' by 'gfc_charlen_type_node'.
fortran/
* trans-decl.c, trans-expr.c, trans-io.c, trans-types.c: Replace
all occurences of 'gfc_strlen_type_node' by
'gfc_charlen_type_node'.
* trans-types.h: Same. Also update comment accordingly.

libgfortran/
* libgfortran.h: Replace 'gfc_strlen_type' by
'gfc_charlen_type'. Update comment accordingly.
* intrinsics/args.c, intrinsics/env.c, io/io.h, io/transfer.c:
Replace all occurences of 'gfc_strlen_type' by 'gfc_charlen_type'.

From-SVN: r86828
2004-08-31 16:06:48 +02:00
Bud Davis 55948b693e re PR libfortran/16597 (gfortran: bug in unformatted I/O on scratch files)
2004-08-27  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/16597
        * io/io.h: created typedef for unit_mode.
        * io/io.h (gfc_unit): added mode to unit structure.
        * io/transfer.c (data_transfer_init): flush if a write then
        read is done on a unit (direct access files).
        * io/rewind.c (st_rewind): Used unit mode instead of global.

        * gfortran.dg/pr16597.f90: New test.

From-SVN: r86654
2004-08-27 07:59:30 +00:00
Tobias Schlüter 7fcb18047a io.h, [...]: Fix formatting issues, update copyright years.
* io/io.h, io/list_read.c, io/open.c, io/transfer.c, io/write.c:
Fix formatting issues, update copyright years.

From-SVN: r86425
2004-08-23 16:28:31 +02:00
Paul Brook 22e4cb8c23 Fix typo.
From-SVN: r86363
2004-08-21 13:23:13 +00:00
Bud Davis 0fa1b65cad re PR libfortran/16908 (Segfault in libgfortran/io/transfer.c)
2004-08-21  Bud Davis  <bdavis9659@comcast.net>

	PR 16908
	* io/transfer.c (next_record_w): Do not blank pad.
	* io/transfer.c (next_record): Take into account partial records.
testsuite/
	* gfortran.dg/direct_io.f90: New test.

From-SVN: r86361
2004-08-21 11:20:29 +00:00
Victor Leikehman 3bc268e64b re PR fortran/13278 (derived type namelist I/O support missing, causes ICE)
2004-08-18  Victor Leikehman  <lei@il.ibm.com>

	PR fortran/13278
	* trans-io.c (transfer_namelist_element): New. Recursively handle
	derived-type variables.  Pass string lengths.
	(build_dt): Code moved to build_namelist, with some
	changes and additions.
	(gfc_build_io_library_fndecls): Declare the fifth
	argument in st_set_nml_var_char -- string_length.
libgfortran/
	* io/transfer.c (st_set_nml_var)
	* io/write.c (namelist_write): Allow var_name and var_name_len to be
	null. For strings, use string_length field instead of len.
	* io/io.h (struct namelist_type): New field string_length.
	(st_set_nml_var_char): New argument string_length.

From-SVN: r86166
2004-08-18 01:20:06 +00:00
Bud Davis bf1df0a046 re PR libfortran/15472 (implicit open for unformatted file causes run-time error)
2004-07-04  Bud Davis  <bdavis9659@comcast.net>
            Paul Brook  <paul@codesourcery.com>

        PR fortran/15472
        * io/transfer.c(us_write): set recl for seq unform writes to max size.
        * io/transfer.c(data_transfer_init): handle un-opened seq unform unit.
        * io/unix.c(fd_alloc_w_at): handle requests at start, fd_flush at
          right time.
        * io/unix.c(is_seekable): set based upon the file/device, not the
          method being used to access it (fd or mmap).
        * io/unix.c(fd_flush): don't set file_size if !seekable.
        * io/unix.c(fd_truncate: ditto.
        * gfortran.fortran-torture/execute/seq_io.f90: New test.

Co-Authored-By: Paul Brook <paul@codesourcery.com>

From-SVN: r84104
2004-07-05 01:19:08 +00:00
Janne Blomqvist 8750f9cdec re PR fortran/15750 (IOLENGTH form of INQUIRE statement not implemented)
PR fortran/15750
	* io.c (gfc_match_inquire): Bugfix for iolength related stuff.
	(gfc_resolve_inquire): Resolve the iolength tag.  Return
	SUCCESS at end of function if no failure has occured.
	* resolve.c (resolve_code): Resolve if iolength is encountered.
	* trans-io.c: (ioparm_iolength, iocall_iolength,
	iocall_iolength_done): New variables.
	(last_dt): Add IOLENGTH.
	(gfc_build_io_library_fndecls ): Set iolength related variables.
	(gfc_trans_iolength): Implement.
	(gfc_trans_dt_end): Treat iolength as a third form of data transfer.
libgfortran/
	PR fortran/15750
	* inquire.c (st_inquire): Add comment
	* io.h (st_parameter): Add iolength.
	(st_iolength, st_iolength_done): Declare.
	* transfer.c (iolength_transfer, iolength_transfer_init,
	st_iolength, st_iolength_done): New functions.
testsuite/
	* gfortran.fortran-torture/execute/iolength_1.f90: New test.
	* gfortran.fortran-torture/execute/iolength_3.f90: New test.

From-SVN: r83472
2004-06-22 00:43:55 +00:00
Bud Davis 898c05b8bd re PR libfortran/14897 ('T' edit descriptor output incorrect)
2004-06-09  Bud Davis  <bdavis9659@comcast.net>

	PR gfortran/14897
	* gfortran.fortran-torture/execute/t_edit.f90

 	* io/transfer.c (formatted_transfer): position is unique
         for T and TL edit descriptors.
 	(data_transfer_init): set record length to size of internal
         file.

From-SVN: r82808
2004-06-09 01:03:02 +00:00
Tobias Schlüter 81f4be3ce1 re PR libfortran/15235 (libgfortran doesn't build on Solaris 10)
PR fortran/15235
* gfortran.h (offset_t): Rename to ...
(gfc_offset): ... this.
* io/backspace.c (formatted_backspace, unformatted_backspace),
io/io.h (stream, gfc_unit, global_t, file_length, file_position),
transfer.c (us_read, us_write, next_record_r, next_record_w),
io/unit.c (init_units), unix.c (unix_stream, fd_alloc,
fd_alloc_r_at, fd_alloc_w_at, fd_seek, mmap_alloc,
mmap_alloc_r_at, mmap_alloc_w_at, mmap_seek, mem_alloc_r_at,
mem_alloc_w_at, mem_seek, file_length, file_position): Replace all
occurences of offset_t by gfc_offset.

From-SVN: r81994
2004-05-18 18:06:09 +02:00
Janne Blomqvist 000aa32a49 io.h (flush): Add prototype.
* io/io.h (flush): Add prototype.
	* io/transfer.c (finalize_transfer): Flush partial records.
	* io/unix.c (flush): New function.

From-SVN: r81913
2004-05-16 13:27:48 +00:00
Tobias Schlüter 909087e0cf re PR libfortran/15234 (libgfortran doesn't compile on Tru64 UNIX V4.0F)
PR fortran/15234
* io/io.h (unit_t): Rename to ...
(gfc_unit) ... this.
(unit_root, current_unit, find_file, find_unit, get_unit): Now
of type gfc_unit.
(delete_file, insert_unit, close_unit): Argument now of type
gfc_unit.
* backspace.c (st_backspace), close.c (st_close), endfile.c
(st_endfile), inquire.c (inquire_via_unit, st_inquire), open.c
(test_endfile, edit_modes, new_unit, already_open, st_open),
rewind.c (st_rewind), transfer.c (current_unit), unit.c
(internal_unit, unit_cache, rotate_left, rotate_right, insert,
insert_unit, delete_root, delete_treap, delete_unit, find_unit,
get_unit, init_units, close_unit), unix.c (find_file0,
find_file, delete_file): Replace all occurences of unit_t by
gfc_unit.

From-SVN: r81903
2004-05-15 22:44:38 +02:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00