From aad89ecff0130860eaba36a041dad8f60601c479 Mon Sep 17 00:00:00 2001 From: jb Date: Tue, 19 Mar 2013 11:13:32 +0000 Subject: Use C99 bool instead of enum try. 2013-03-19 Janne Blomqvist * libgfortran.h: Include stdbool.h. (enum try): Remove. (notify_std): Change return type to bool. * intrinsics/chmod.c: Don't include stdbool.h. * intrinsics/execute_command_line.c: Likewise. * io/format.c: Likewise. * io/list_read.c (nml_parse_qualifier): Change return type to bool. (nml_read_obj): Likewise. (nml_get_obj_data): Likewise. * io/transfer.c (read_block_form): Fix comment. (write_buf): Change return type to bool. * io/write.c: Don't include stdbool.h. * io/write_float.def (output_float): Change return type to bool. (output_float_FMT_G_ ## x): Change type of result variable. * runtime/error.c (notify_std): Change return type to bool. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196791 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/io/transfer.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'libgfortran/io/transfer.c') diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index d97a325a772..6fa954ce287 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -401,7 +401,7 @@ read_sf (st_parameter_dt *dtp, int * length) /* Function for reading the next couple of bytes from the current - file, advancing the current position. We return FAILURE on end of record or + file, advancing the current position. We return NULL on end of record or end of file. This function is only for formatted I/O, unformatted uses read_block_direct. @@ -774,7 +774,7 @@ write_block (st_parameter_dt *dtp, int length) called for unformatted files. There are three cases to consider: Stream I/O, unformatted direct, unformatted sequential. */ -static try +static bool write_buf (st_parameter_dt *dtp, void *buf, size_t nbytes) { @@ -790,12 +790,12 @@ write_buf (st_parameter_dt *dtp, void *buf, size_t nbytes) if (unlikely (have_written < 0)) { generate_error (&dtp->common, LIBERROR_OS, NULL); - return FAILURE; + return false; } dtp->u.p.current_unit->strm_pos += (gfc_offset) have_written; - return SUCCESS; + return true; } /* Unformatted direct access. */ @@ -805,23 +805,23 @@ write_buf (st_parameter_dt *dtp, void *buf, size_t nbytes) if (unlikely (dtp->u.p.current_unit->bytes_left < (gfc_offset) nbytes)) { generate_error (&dtp->common, LIBERROR_DIRECT_EOR, NULL); - return FAILURE; + return false; } if (buf == NULL && nbytes == 0) - return SUCCESS; + return true; have_written = swrite (dtp->u.p.current_unit->s, buf, nbytes); if (unlikely (have_written < 0)) { generate_error (&dtp->common, LIBERROR_OS, NULL); - return FAILURE; + return false; } dtp->u.p.current_unit->strm_pos += (gfc_offset) have_written; dtp->u.p.current_unit->bytes_left -= (gfc_offset) have_written; - return SUCCESS; + return true; } /* Unformatted sequential. */ @@ -854,7 +854,7 @@ write_buf (st_parameter_dt *dtp, void *buf, size_t nbytes) if (unlikely (to_write_subrecord < 0)) { generate_error (&dtp->common, LIBERROR_OS, NULL); - return FAILURE; + return false; } dtp->u.p.current_unit->strm_pos += (gfc_offset) to_write_subrecord; @@ -871,9 +871,9 @@ write_buf (st_parameter_dt *dtp, void *buf, size_t nbytes) if (unlikely (short_record)) { generate_error (&dtp->common, LIBERROR_SHORT_RECORD, NULL); - return FAILURE; + return false; } - return SUCCESS; + return true; } -- cgit v1.2.1