summaryrefslogtreecommitdiffstats
path: root/libgfortran/io/transfer.c
Commit message (Collapse)AuthorAgeFilesLines
...
* PR libfortran/31210fxcoudert2007-05-041-0/+9
| | | | | | | | | * io/transfer.c (transfer_character): Avoid passing a NULL pointer as source to the transfer routines, if the string length is zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124428 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-04-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2007-04-281-7/+10
| | | | | | | | | | | | | | PR libfortran/31501 * io/list_read.c (next_char): Fix whitespace. * io/io.h: Remove prototypes and define macros for is_array_io, is_stream_io, and is_internal_unit. * io/unit.c (is_array_io), (is_internal_unit), (is_stream_io): Delete these functions. * io/transfer.c (read_sf): Change handling of internal_unit to make a single call to salloc_r and use memcpy to transfer the data. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124266 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-04-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2007-04-281-2/+4
| | | | | | | | | | | | | | | | PR libfortran/31532 * io/file_pos.c (st_backspace): Set flags.position for end of file condition and use new function update_position. (st_endfile): Use new function update_position. * io/io.h: Add prototype for new function. * io/inquire.c (inquire_via_unit): If not direct access, set NEXTREC to zero. * io/unit.c (update_position): New function to update position info used by inquire. * io/transfer.c (next_record): Fix typo and use new function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124252 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-04-23 Thomas Koenig <tkoenig@gcc.gnu.org>tkoenig2007-04-231-38/+69
| | | | | | | | | | | | | | | | | | PR fortran/31618 * io/transfer.c (read_block_direct): Instead of calling us_read, set dtp->u.p.current_unit->current_record = 0 so that pre_position will read the record marker. (data_transfer_init): For different error conditions, call generate_error, then return. 2007-04-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/31618 * gfortran.dg/backspace_8.f: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124079 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-04-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2007-04-011-4/+3
| | | | | | | | | | | | | PR libgfortran/31052 * io/open.c (test_endfile): Delete this function. (edit_modes): Delete call to test_endfile. (new_unit): Likewise. * io/io.h: Delete prototype for test_endfile. * io/transfer.c (next_record_r): Remove use of test_endfile. (st_read): Add test for end file condition and adjust status. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123403 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-04-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2007-04-011-1/+0
| | | | | | | | | | | | | | | PR libgfortran/31366 * io/transfer.c (read_block_direct): Do not generate error when reading past EOF on a short record that is less than the RECL= specified. 2007-04-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/31207 * io/unit.c (close_unit_1): If there are bytes previously written from ADVANCE="no", move to the end before closing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123401 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-03-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2007-03-281-1/+2
| | | | | | | | | PR libgfortran/31052 * io/transfer.c (next_record_r): Do not call test_endfile if in namelist mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123284 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-03-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2007-03-261-1/+12
| | | | | | | | | | | | | PR libgfortran/31199 *io/io.h: Add saved_pos to gfc_unit structure. *io/open.c (new_unit): Initialize saved_pos. *io/transfer.c (data_transfer_init): Set max_pos to value in saved_pos. (next_record_w): Fix whitespace. (finalze_transfer): Calculate max_pos for ADVANCE="no" and save it for later use. If not ADVANCE="no" set saved_pos to zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123205 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-03-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2007-03-231-2/+6
| | | | | | | | | | | | | | | PR libgfortran/31052 * file_pos.c: Update Copyright year. * io/open.c (test_endfile): Restore test_endfile to fix SPEC regression. Update Copyright year. * io/io.h: Same. * io/unix.c (is_special): Add missing type for this function. Update Copyright year. * io/transfer.c (next_record_r): Restore test_endfile. (st_read): Fix whitespace. Update Copyright year git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123139 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-03-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2007-03-181-7/+1
| | | | | | | | | | | | | | | PR libgfortran/31052 * io/file_position (st_rewind): Fix comments. Remove use of test_endfile. Don't seek if already at 0 position. Use new is_special function to set endfile state. * io/open.c (test_endfile): Delete this function. * io/io.h: Delete prototype for test_endfile. Add prototype for is_special. * io/unix.c (is_special): New function. Fix whitespace. * io/transfer.c (next_record_r): Remove use of test_endfile. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123038 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-03-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2007-03-151-3/+8
| | | | | | | | | PR libgfortran/31051 * io/transfer.c (formatted_transfer_scalar): Adjust position for pending spaces when in writing mode. Clean up some formatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122940 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-03-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2007-03-091-4/+5
| | | | | | | | | | | | PR libgfortran/31099 * io/open.c (new_unit): Initialize bytes_left and recl_subrecord. * io/transfer.c (next_record_w): Set bytes left to record length for sequential unformatted I/O. (next_record_r): Ditto. (read_block_direct): Fix test for exceeding bytes_left. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122763 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-02-02 Paul Thomas <pault@gcc.gnu.org>pault2007-02-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR fortran/30284 PR fortran/30626 * trans-expr.c (gfc_conv_aliased_arg): Remove static attribute from function and make sure that substring lengths are translated. (is_aliased_array): Remove static attribute. * trans.c : Add prototypes for gfc_conv_aliased_arg and is_aliased_array. * trans-io.c (set_internal_unit): Add the post block to the arguments of the function. Use is_aliased_array to check if temporary is needed; if so call gfc_conv_aliased_arg. (build_dt): Pass the post block to set_internal_unit and add to the block after all io activiy is done. 2007-02-02 Paul Thomas <pault@gcc.gnu.org> PR fortran/30284 PR fortran/30626 * io/transfer.c (init_loop_spec, next_array_record): Change to lbound rather than unity base. 2007-02-02 Paul Thomas <pault@gcc.gnu.org> PR fortran/30284 * gfortran.dg/arrayio_11.f90.f90: New test. PR fortran/30626 * gfortran.dg/arrayio_12.f90.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121500 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-12-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-12-281-2/+2
| | | | | | | | | | | PR libgfortran/30014 *io/io.h (st_parameter_dt): Change *size and *iolength type to GFC_IO_INT. *io/transfer.c (finalize_transfer): Cast dtp->u.p.size_used to GFC_IO_INT. (iolength_transfer): Cast size * nelems to GFC_IO_INT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120234 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-12-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-12-151-1/+1
| | | | | | | | PR libfortran/30145 * io/transfer.c (transfer_array): Check for negative extent. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119942 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-12-06 Thomas Koenig <Thomas.Koenig@online.de>tkoenig2006-12-061-32/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR libfortran/30009 PR libfortran/30056 * gfortran.dg/read_eof_4.f90: Add tests. * gfortran.dg/readwrite_unf_direct_eor_1.f90: New test. * gfortran.dg/unf_read_corrupted_1.f90: New test. 2006-12-06 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30009 PR libfortran/30056 * libgfortran.h: Add ERROR_CORRUPT_FILE to error_codes. * runtime/error.c (translate_error): Add handling for ERROR_CORRUPT_FILE. * io/transfer.c (read_block_direct): Add comment about EOR for stream files. Remove test for no bytes left for direct access files. Generate an ERROR_SHORT_RECORD if the read was short. For unformatted sequential files: Check endfile condition. Remove test for no bytes left. End of file here means that the file structure has been corrupted. Pre-position the file for the next record in case of error. (write_buf): Whitespace fix. Subtract the number of bytes written from bytes_left. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119592 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-12-01 Thomas Koenig <Thomas.Koenig@online.de>tkoenig2006-12-011-159/+393
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR libfortran/29568 * gfortran.dg/convert_implied_open.f90: Change to new default record length. * gfortran.dg/unf_short_record_1.f90: Adapt to new error message. * gfortran.dg/unformatted_subrecords_1.f90: New test. 2006-12-01 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/29568 * gfortran.h (gfc_option_t): Add max_subrecord_length. (top level): Define MAX_SUBRECORD_LENGTH. * lang.opt: Add option -fmax-subrecord-length=. * trans-decl.c: Add new function set_max_subrecord_length. (gfc_generate_function_code): If we are within the main program and max_subrecord_length has been set, call set_max_subrecord_length. * options.c (gfc_init_options): Add defaults for max_subrecord_lenght, convert and record_marker. (gfc_handle_option): Add handling for -fmax_subrecord_length. * invoke.texi: Document the new default for -frecord-marker=<n>. 2006-12-01 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/29568 * libgfortran/libgfortran.h (compile_options_t): Add record_marker. (top level): Define GFC_MAX_SUBRECORD_LENGTH. * runtime/compile_options.c (set_record_marker): Change default to four-byte record marker. (set_max_subrecord_length): New function. * runtime/error.c (translate_error): Change error message for short record on unformatted read. * io/io.h (gfc_unit): Add recl_subrecord, bytes_left_subrecord and continued. * io/file_pos.c (unformatted_backspace): Change default of record marker size to four bytes. Loop over subrecords. * io/open.c: Default recl is max_offset. If compile_options.max_subrecord_length has been set, set set u->recl_subrecord to its value, to the maximum value otherwise. * io/transfer.c (top level): Add prototypes for us_read, us_write, next_record_r_unf and next_record_w_unf. (read_block_direct): Separate codepaths for unformatted direct and unformatted sequential. If a recl has been set by the user, use the number of bytes left for the record if it is smaller than the read request. Loop over subrecords. Set an error if the user has set a recl and the read was short. (write_buf): Separate codepaths for unformatted direct and unformatted sequential. If a recl has been set by the user, use the number of bytes left for the record if it is smaller than the read request. Loop over subrecords. Set an error if the user has set a recl and the read was short. (us_read): Add parameter continued (to indicate that bytes_left should not be intialized). Change default of record marker size to four bytes. Use subrecord. If the subrecord length is smaller than zero, this indicates a continuation. (us_write): Add parameter continued (to indicate that the continued flag should be set). Use subrecord. (pre_position): Use 0 for continued on us_write and us_read calls. (skip_record): New function. (next_record_r_unf): New function. (next_record_r): Use next_record_r_unf. (write_us_marker): Default size for record markers is four bytes. (next_record_w_unf): New function. (next_record_w): Use next_record_w_unf. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119412 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-11-221-4/+5
| | | | | | | | | | * io/io.h (unit_flags): Add new flag has_recl. * io.open.c (new_unit): Set flag if RECL= was specified. * io/transfer.c (us_write): If flag set, leave recl as initialized by new_unit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119087 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-11-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-11-091-3/+6
| | | | | | | | PR libgfortran/29752 * io/transfer.c (finalize_transfer): Flush on ADVANCE_NO. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118611 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-11-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-11-051-1/+1
| | | | | | | * io/transfer.c (next_record_w): Fix indentation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118508 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-11-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-11-051-113/+90
| | | | | | | | | | | | | PR libgfortran/25545 * io/transfer.c (write_block): Cleanup code paths between stream and non-stream I/O. (write_buf): Cleanup. (read_block): Cleanup. (finalize_transfer): Call next_record for '$' edit descriptor handling of internal unit. Cleanup code for readability. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118506 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-10-31 Thomas Koenig <Thomas.Koenig@online.de>tkoenig2006-10-311-49/+41
| | | | | | | | | | | | | | | | | | | | | PR libfortran/29627 * libgfortran.h: Add ERROR_SHORT_RECORD * runtime/error.c (translate_error): Add case for ERROR_SHORT_RECORD. * io/transfer.c (read_block_direct): Separate codepaths for stream and record unformatted I/O. Remove unneeded tests for standard input, padding and formatted I/O. If the record is short, read in as much data as possible, then raise the error. 2006-10-31 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/29627 * gfortran.dg/unf_short_record_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118341 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-10-28 Tobias Burnus <burnus@net-b.de>burnus2006-10-281-2/+12
| | | | | | | | | | | PR fortran/29625 * io/transfer.c (formatted_transfer_scalar): Allow binary edit descriptors for real variables; give error for BOZ edit descriptor for non-integers when using -std=f*. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118111 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-10-16 Tobias Burnus <burnus@net-b.de>burnus2006-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * m4/in_pack.m4: Fixed a typo. * m4/iforeach.m4: Fixed a typo. * m4/eoshift1.m4: Fixed a typo. * m4/eoshift3.m4: Fixed a typo. * m4/cshift1.m4: Fixed a typo. * m4/in_unpack.m4: Fixed a typo. * m4/reshape.m4: Fixed a typo. * m4/ifunction.m4: Fixed a typo. * runtime/environ.c: Fixed a typo. * runtime/in_pack_generic.c: Fixed a typo. * runtime/in_unpack_generic.c: Fixed a typo. * runtime/memory.c: Fixed a typo. * intrinsics/cshift0.c: Fixed a typo. * intrinsics/cpu_time.c: Fixed a typo. * intrinsics/pack_generic.c: Fixed a typo. * intrinsics/unpack_generic.c: Fixed a typo. * intrinsics/eoshift0.c: Fixed a typo. * intrinsics/eoshift2.c: Fixed a typo. * intrinsics/reshape_generic.c: Fixed a typo. * io/open.c: Fixed a typo. * io/list_read.c: Fixed a typo. * io/io.h: Fixed a typo. * io/transfer.c: Fixed a typo. * io/write.c: Fixed a typo. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117857 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-10-181-22/+38
| | | | | | | | | | | | | | | PR libgfortran/29277 * io/list_read.c (next_char): Update strm_pos. (eat_separator): Delete extra call to unget_char. * io/transfer.c (read_block): Use read_sf for formatted stream I/O. (next_record_r): Update strm_pos for formatted stream I/O and handle end-of-record correctly. (next_record_w): Ditto. (next_record): Enable next record (r/w) functions and update strm_pos. (finalize_transfer): Call next_record to finish the record. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117846 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-09-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-09-151-18/+21
| | | | | | | | | | | | | | | | | | PR libgfortran/29053 * io.h (gfc_unit): Add variable, strm_pos, to track STREAM I/O file position. * file_pos.c (st_rewind): Set strm_pos to beginning. * open.c (new_unit): Initialize strm_pos. * read.c (read_x): Bump strm_pos. * inquire.c (inquire_via_unit): Return strm_pos value. * transfer.c (read_block),(read_block_direct),(write_block) (write_buf): Seek to strm_pos - 1. Update strm_pos when done. (pre_position): Initialize strm_pos. (data_transfer_init): Set strm_pos if DT_HAS_REC. (finalize_transfer): Flush file, no need to update strm_pos. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116970 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-08-151-120/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR libgfortran/25828 * libgfortran.h: Rename GFC_LARGE_IO_INT to GFC_IO_INT. * io/file_pos.c (st_backspace): Ignore if access=STREAM. (st_rewind): Handle case of access=STREAM. * io/open.c (access_opt): Add STREAM_ACCESS. (edit_modes): Set current_record to zero only if not STREAM. (new_unit): Initialize maxrec, recl, and last_record for STREAM. * io/read.c (read_x): Advance file position for STREAM. * io/io.h (enum unit_access): Align IOPARM flags with frontend. Add ACCESS_STREAM. Add prototype for is_stream_io () function. Use GFC_IO_INT. * io/inquire.c (inquire_via_unit): Add text for access = "STREAM". * io/unit.c (is_stream_io): New function to return true if access = STREAM. * io/transfer.c (file_mode): Add modes for unformatted stream and formatted stream. (current_mode): Return appropriate file mode based on access flags. (read_block): Handle formatted stream reads. (read_block_direct): Handle unformatted stream reads. (write_block): Handle formatted stream writes. (write_buf): Handle unformatted stream writes. (unformatted_read): Fix up, use temporary for size. (pre_position): Position file for STREAM access. (data_transfer_init): Initialize for stream access, skip irrelevent error checks. (next_record_r),(next_record_w), and (next_record): Do nothing for stream I/O. (finalize_transfer): Flush when all done if stream I/O. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116172 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-07-30 Janne Blomqvist <jb@gcc.gnu.org>jb2006-07-301-3/+0
| | | | | | | | * io/transfer.c (transfer_array): Remove stride0 fix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115818 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-07-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-07-221-4/+9
| | | | | | | | | | | PR libgfortran/28339 * io/transfer.c (next_record_w): Use next_array_record result to set END_FILE. (write_block): Test for END_FILE before the next write occurs. * io/unit.c (get_internal_unit): Initialize iunit->endfile for internal unit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115670 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-07-041-1/+2
| | | | | | | | | | | | | | | | PR libgfortran/27704 * runtime/error.c (notify_std): Pass common flags into function. Use flags to show locus of error or warning. * libgfortran.h: Add enum try. Add prototype for notify_std. * io/open.c (edit_modes): Allow status="old" and add extension to allow status="scratch" *io/list_read.c (nml_read_obj): Update call to notify_std. *io/io.h: Remove enum try and prototype for notify_std. *io/transfer.c (read_sf): Update call to notify_std. *io/format.c (parse_format_list): Update call to notify_std. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115168 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-05-201-1/+1
| | | | | | | | PR libgfortran/22423 * io/transfer.c (read_block): Return NULL instead of nothing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113923 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-05-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-05-171-0/+14
| | | | | | | | | PR libgfortran/27575 * io/transfer.c (read_block): Add check for end file condition. (read_block_direct): Add check for end file condition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113837 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-04-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-04-281-1/+7
| | | | | | | | | | PR libgfortran/27304 * io/transfer.c (formatted_transfer_scalar): Generate error if data descriptors are exhausted. * io/format.c (next_format0): Fix comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113363 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-04-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-04-231-29/+60
| | | | | | | | | | | | | | | | | | | | | | | PR libgfortran/20257 * io/io.h: Add prototypes for get_internal_unit and free_internal_unit. * io/unit.c (get_internal_unit): Initialize unit number, not zero. (free_internal_unit): New function to consolidate freeing memory. (get_unit): Initialize internal_unit_desc to NULL when unit is external. * io/unix.c (mem_close): Check for not NULL before freeing memory. * io/transfer.c (read_block): Reset bytes_left and skip error if unit is preconnected and default record length is reached. (read_block_direct): Ditto. (write_block): Ditto. (write_buf): Ditto. (data_transfer_init): Only flush if not internal unit. (finalize_transfer): Ditto and delete code to free memory used by internal units. (st_read_done): Use new function - free_internal_unit. (st_write_done): Use new function - free_internal unit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113190 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-04-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-04-131-5/+12
| | | | | | | | | | | | | | | | | | PR libgfortran/26766 * io/io.h: Add bit to identify associated unit as internal. * io/unit.c (get_external_unit): Renamed the find_unit_1 function to reflect the external unit functionality vs internal unit. (get_internal_unit): New function to allocate and initialize an internal unit structure. (get_unit): Use get_internal_unit and get_external_unit. (is_internal_unit): Revised to use new bit added in io.h. * io/transfer.c (data_transfer_init): Fix line width. (st_read_done): Free memory allocated for internal unit. (st_write_done): Add test to only flush and truncate when not an internal unit. Free memory allocated for internal unit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112914 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-03-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-03-311-9/+9
| | | | | | | | | | | | | | | PR libgfortran/26890 * io/io.h: Add size_used to st_parameter_dt, adjust pad size. *io/transfer.c (data_transfer_init): Initialize size_used to zero. (read_sf): Use size_used. (read_block): Likewise. (read_block_direct): Likewise. (write_block): Likewise. (write_buf): Likewise and eliminate erroneous FAILURE return. (finalize_transfer): Assign value of size_used to *dtp->size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112570 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-03-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-03-261-4/+8
| | | | | | | | | | | | | PR libgfortran/26661 * io/io.h: Add read_sf so it can be used by read_x. * io/transfer.c (read_sf): Pass no_error flag to read_sf. Use it to break out rather than error on EOF or EOR conditions. (read_block): Update call to read_sf. (read_block_direct): Ditto. * io/read.c (read_x): Use the modified read_sf instead of read_block. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112390 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-03-25 Thomas Koenig <Thomas.Koenig@online.de>tkoenig2006-03-251-0/+31
| | | | | | | | | | | | | | | | PR libfortran/26735 * io/transfer.c (data_transfer_init): Set u_flags.convert on an unopened unit if specified by environment variable (via get_unformatted_convert) or by compile-time option. 2006-03-25 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/26735 * gfortran.dg/convert_implied_open.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112382 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-03-22 Thomas Koenig <Thomas.Koenig@onlien.de>tkoenig2006-03-221-18/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR fortran/19303 * gfortran.h (gfc_option_t): Add record_marker. * lang.opt: Add -frecord-marker=4 and -frecord-marker=8. * trans-decl.c: Add gfor_fndecl_set_record_marker. (gfc_build_builtin_function_decls): Set gfor_fndecl_set_record_marker. (gfc_generate_function_code): If we are in the main program and -frecord-marker was provided, call set_record_marker. * options.c (gfc_handle_option): Add handling for -frecord-marker=4 and -frecord-marker=8. * invoke.texi: Document -frecord-marker. 2006-03-22 Thomas Koenig <Thomas.Koenig@onlien.de> PR fortran/19303 * libgfortran.h (compile_options_t): Add record_marker. * runtime/compile_options.c (set_record_marker): New function. * io/open.c: If we have four-byte record markers, use GFC_INTEGER_4_HUGE as default record length. * io/file_pos.c (unformatted_backspace): Handle different size record markers. * io/transfer.c (us_read): Likewise. (us_write): Likewise. (next_record_r): Likewise. (write_us_marker): Likewise. (next_record_w): Likewise. 2006-03-22 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/19303 * gfortran.dg/record_marker_1.f90: New test case. * gfortran.dg/record_marker_2.f: New test case. * gfortran.dg/record_marker_3.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112290 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-03-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-03-181-1/+4
| | | | | | | | | | | PR libgfortran/26509 * libgfortran.h: Add ERROR_DIRECT_EOR. * runtime/error.c (translate_error): Add translation for new error. * io/transfer.c (write_buf): Add check for EOR when mode is direct access. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112198 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-03-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-03-101-7/+6
| | | | | | | | | | | | PR libgfortran/26499 * io/file_pos (st_rewind): Flush always. * io/unix.c (fd_truncate): Return SUCCESS rather than FAILURE for special files like /dev/null. * io/transfer.c (st_write_done): Remove broken logic that prevented calling fd_truncate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111924 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-02-281-1/+0
| | | | | | | | | | PR libgfortran/26464 * io/file_pos.c (st_backspace): Flush and truncate file when in AFTER_ENDFILE condition. * io/transfer.c (st_read_done): Remove flush, no longer needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111506 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-12 Janne Blomqvist <jb@gcc.gnu.org>jb2006-02-121-76/+62
| | | | | | | | | | | | | | | | | | | | | | PR libgfortran/25949 * io/io.h: Add set function pointer to struct stream. * io/unix.c (fd_seek): Only update offset, don't seek. (fd_sset): New function. (fd_read): Call lseek directly if necessary. (fd_write): Likewise. (fd_open): Set pointer to fd_sset. (mem_set): New function. (open_internal): Set pointer to mem_set. * io/transfer.c (write_block_direct): Rename to write_buf, add error return, non-pointer length argument. (unformatted_write): Update to use write_buf. (us_write): Simplify by using swrite instead of salloc_w. (write_us_marker): New function. (new_record_w): Use sset instead of memset, use write_us_marker, simplify by using swrite instead of salloc_w. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110895 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-01-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-01-251-0/+1
| | | | | | | | PR libgfortran/25835 * io/transfer.c (st_read_done): Flush buffers when read is done. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110200 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-01-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-01-181-2/+8
| | | | | | | | | PR libgfortran/25697 * io/transfer.c (us_read): Detect end of file condition from previous operations and bail out (no need to pre-position). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109870 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-01-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-01-181-1/+15
| | | | | | | | | PR libgfortran/25631 * io/transfer.c (formatted_transfer_scalar): Adjust pending_spaces and skips so that TL works correctly when no bytes_used yet. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109858 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-01-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2006-01-061-2/+5
| | | | | | | | | | | PR libgfortran/25598 * io/file_pos.c (unformatted_backspace): Assure the new file position to seek is not less than zero. (st_backspace): Set unit bytes_left to zero. * io/transfer.c (next_record_r): Fix line lengths, no functional change. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109405 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-12-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2005-12-281-2/+5
| | | | | | | | | | | | | PR libgfortran/25139 * io/unix.c (fd_truncate): Set s->active to zero. PR libgfortran/25510 * libgfortran.h: Add ERROR_INTERNAL and ERROR_INTERNAL_UNIT. * runtime/error.c (translate_error): Add messages for new errors. * io/list_read.c (next_char): Use new errors. * io/transfer.c (next_record_r) (next_record_w): Use new errors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109122 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-12-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2005-12-191-1/+1
| | | | | | | | | PR libgfortran/25463 * io/transfer.c (finalize_transfer): Fix execution order so that next_record is set to zero in all cases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108784 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-12-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>jvdelisle2005-12-161-10/+58
| | | | | | | | | | | | PR libgfortran/25264 PR libgfortran/25349 * io/unit.c (get_unit): Delete code that cleared the string when the unit was opened, which is too soon. * io/transfer.c (next_record_w): Pass done flag in. Change logic for setting max_pos. Add code to position unit and pad record as needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108671 138bc75d-0d04-0410-961f-82ee72b054a4
OpenPOWER on IntegriCloud