gcc/libgfortran/ChangeLog

124 lines
4.1 KiB
Plaintext
Raw Normal View History

PR 78534, 83704 Handle large formatted I/O In order to handle large characters when doing formatted I/O, use size_t and ptrdiff_t for lengths. Compared to the previous patch, based on discussions on IRC use size_t for sizes that don't need to be negative rather than ptrdiff_t everywhere. Regtested on x86_64-pc-linux-gnu, approved as part of the PR 78534 approval, committed to trunk. libgfortran/ChangeLog: 2018-01-07 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/78534 PR fortran/83704 * io/fbuf.c (fbuf_init): Use size_t instead of int for length. (fbuf_debug): Convert debug output to unsigned long. (fbuf_reset): Use ptrdiff_t for return value. (fbuf_alloc): Use size_t for length argument. (fbuf_flush): Handle large buffers. (fbuf_flush_list): Likewise. (fbuf_seek): Use ptrdiff_t for offset and return value. (fbuf_read): Use size_t for length argument. (fbuf_getc_refill): Use size_t to match fbuf_read. * io/fbuf.h (struct fbuf): Use size_t for lengths. (fbuf_init): Use size_t instead of int for length. (fbuf_reset): Use ptrdiff_t for return value. (fbuf_alloc): Use size_t for length argument. (fbuf_seek): Use ptrdiff_t for offset and return value. (fbuf_read): Use size_t for length argument. * io/io.h (read_block_form): Likewise. (read_block_form4): Likewise. (write_block): Likewise. (read_a): Likewise. (read_a_char4): Likewise. (read_x): Likewise. (write_a): Likewise. (write_a_char4): Likewise. * io/list_read.c (list_formatted_read_scalar): Use size_t to handle large buffers. * io/read.c (read_l): Likewise. (read_utf8): Likewise. (read_utf8_char1): Likewise. (read_default_char1): Likewise. (read_utf8_char4): Likewise. (read_default_char4): Likewise. (read_a): Likewise. (read_a_char4): Likewise. (eat_leading_spaces): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. (read_x): Likewise. * io/transfer.c (read_sf_internal): Likewise. (read_sf): Likewise. (read_block_form): Likewise. (read_block_form4): Likewise. (write_block): Likewise. (formatted_transfer_scalar_write): Likewise. (next_record_w): Likewise. * io/unix.c (mem_alloc_r): Likewise. (mem_alloc_r4): Likewise. (mem_alloc_w): Likewise. (mem_alloc_w4): Likewise. (mem_read): Likewise. (mem_read4): Likewise. (mem_write): Likewise. (mem_write4): Likewise. (open_internal): Likewise. (open_internal4): Likewise. * io/unix.h (open_internal): Likewise. (open_internal4): Likewise. (mem_alloc_w): Likewise. (mem_alloc_r): Likewise. (mem_alloc_w4): Likewise. (mem_alloc_r4): Likewise. * io/write.c (write_check_cc): Likewise. (write_cc): Likewise. (write_a): Likewise. (write_a_char4): Likewise. From-SVN: r256322
2018-01-07 11:17:52 +01:00
2018-01-07 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/78534
PR fortran/83704
* io/fbuf.c (fbuf_init): Use size_t instead of int for length.
(fbuf_debug): Convert debug output to unsigned long.
(fbuf_reset): Use ptrdiff_t for return value.
(fbuf_alloc): Use size_t for length argument.
(fbuf_flush): Handle large buffers.
(fbuf_flush_list): Likewise.
(fbuf_seek): Use ptrdiff_t for offset and return value.
(fbuf_read): Use size_t for length argument.
(fbuf_getc_refill): Use size_t to match fbuf_read.
* io/fbuf.h (struct fbuf): Use size_t for lengths.
(fbuf_init): Use size_t instead of int for length.
(fbuf_reset): Use ptrdiff_t for return value.
(fbuf_alloc): Use size_t for length argument.
(fbuf_seek): Use ptrdiff_t for offset and return value.
(fbuf_read): Use size_t for length argument.
* io/io.h (read_block_form): Likewise.
(read_block_form4): Likewise.
(write_block): Likewise.
(read_a): Likewise.
(read_a_char4): Likewise.
(read_x): Likewise.
(write_a): Likewise.
(write_a_char4): Likewise.
* io/list_read.c (list_formatted_read_scalar): Use size_t to
handle large buffers.
* io/read.c (read_l): Likewise.
(read_utf8): Likewise.
(read_utf8_char1): Likewise.
(read_default_char1): Likewise.
(read_utf8_char4): Likewise.
(read_default_char4): Likewise.
(read_a): Likewise.
(read_a_char4): Likewise.
(eat_leading_spaces): Likewise.
(next_char): Likewise.
(read_decimal): Likewise.
(read_radix): Likewise.
(read_f): Likewise.
(read_x): Likewise.
* io/transfer.c (read_sf_internal): Likewise.
(read_sf): Likewise.
(read_block_form): Likewise.
(read_block_form4): Likewise.
(write_block): Likewise.
(formatted_transfer_scalar_write): Likewise.
(next_record_w): Likewise.
* io/unix.c (mem_alloc_r): Likewise.
(mem_alloc_r4): Likewise.
(mem_alloc_w): Likewise.
(mem_alloc_w4): Likewise.
(mem_read): Likewise.
(mem_read4): Likewise.
(mem_write): Likewise.
(mem_write4): Likewise.
(open_internal): Likewise.
(open_internal4): Likewise.
* io/unix.h (open_internal): Likewise.
(open_internal4): Likewise.
(mem_alloc_w): Likewise.
(mem_alloc_r): Likewise.
(mem_alloc_w4): Likewise.
(mem_alloc_r4): Likewise.
* io/write.c (write_check_cc): Likewise.
(write_cc): Likewise.
(write_a): Likewise.
(write_a_char4): Likewise.
2018-01-06 Janne Blomqvist <jb@gcc.gnu.org>
* io/write.c (namelist_write): Remove unused variable "i".
2018-01-06 Dominique d'Humieres <dominiq@lps.ens.fr>
Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/83704
* io/write.c (write_character): Use size_t instead of int for
length.
2018-01-05 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/78534
* intrinsics/args.c (getarg_i4): Use gfc_charlen_type.
(get_command_argument_i4): Likewise.
(get_command_i4): Likewise.
* intrinsics/chmod.c (chmod_internal): Likewise.
* intrinsics/env.c (get_environment_variable_i4): Likewise.
* intrinsics/extends_type_of.c (struct vtype): Use size_t for size
member.
* intrinsics/gerror.c (gerror): Use gfc_charlen_type.
* intrinsics/getlog.c (getlog): Likewise.
* intrinsics/hostnm.c (hostnm_0): Likewise.
* intrinsics/string_intrinsics_inc.c (string_len_trim): Rework to
work if gfc_charlen_type is unsigned.
(string_scan): Likewise.
* io/transfer.c (transfer_character): Modify prototype.
(transfer_character_write): Likewise.
(transfer_character_wide): Likewise.
(transfer_character_wide_write): Likewise.
(transfer_array): Typecast to avoid signed-unsigned comparison.
* io/unit.c (is_trim_ok): Use gfc_charlen_type.
* io/write.c (namelist_write): Likewise.
* libgfortran.h (gfc_charlen_type): Change typedef to size_t.
2018-01-03 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2018-01-02 Janne Blomqvist <jb@gcc.gnu.org>
PR libgfortran/83649
* io/unix.c (MAX_CHUNK): New define.
(raw_read): For reads larger than MAX_CHUNK, loop.
(raw_write): Write no more than MAX_CHUNK bytes per iteration.
Copyright (C) 2018 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.