diff options
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/backspace.c | 11 | ||||
-rw-r--r-- | libgfortran/io/format.c | 40 | ||||
-rw-r--r-- | libgfortran/io/list_read.c | 61 | ||||
-rw-r--r-- | libgfortran/io/lock.c | 2 | ||||
-rw-r--r-- | libgfortran/io/open.c | 134 | ||||
-rw-r--r-- | libgfortran/io/read.c | 32 | ||||
-rw-r--r-- | libgfortran/io/transfer.c | 35 | ||||
-rw-r--r-- | libgfortran/io/unix.c | 36 | ||||
-rw-r--r-- | libgfortran/io/write.c | 14 |
9 files changed, 116 insertions, 249 deletions
diff --git a/libgfortran/io/backspace.c b/libgfortran/io/backspace.c index e378adf..eb25b10 100644 --- a/libgfortran/io/backspace.c +++ b/libgfortran/io/backspace.c @@ -71,9 +71,8 @@ formatted_backspace (void) } while (base != 0); -/* base is the new pointer. Seek to it exactly */ - -done: + /* base is the new pointer. Seek to it exactly */ + done: if (sseek (current_unit->s, base) == FAILURE) goto io_error; current_unit->last_record--; @@ -81,7 +80,7 @@ done: return; -io_error: + io_error: generate_error (ERROR_OS, NULL); } @@ -110,7 +109,7 @@ unformatted_backspace (void) current_unit->last_record--; return; -io_error: + io_error: generate_error (ERROR_OS, NULL); } @@ -156,6 +155,6 @@ st_backspace (void) unformatted_backspace (); } -done: + done: library_end (); } diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c index 0e42810..4083ca3 100644 --- a/libgfortran/io/format.c +++ b/libgfortran/io/format.c @@ -146,7 +146,6 @@ free_fnode (fnode * f) void free_fnodes (void) { - if (avail - array >= FARRAY_SIZE) free_fnode (&array[0]); @@ -441,9 +440,8 @@ parse_format_list (void) head = tail = NULL; -/* Get the next format item */ - -format_item: + /* Get the next format item */ + format_item: t = format_lex (); switch (t) { @@ -631,10 +629,9 @@ format_item: goto finished; } -/* In this state, t must currently be a data descriptor. Deal with - * things that can/must follow the descriptor */ - -data_desc: + /* In this state, t must currently be a data descriptor. Deal with + things that can/must follow the descriptor */ + data_desc: switch (t) { case FMT_P: @@ -726,8 +723,7 @@ data_desc: tail->u.real.e = -1; -/* Look for optional exponent */ - + /* Look for optional exponent */ t = format_lex (); if (t != FMT_E) saved_token = t; @@ -822,8 +818,8 @@ data_desc: goto finished; } -/* Between a descriptor and what comes next */ -between_desc: + /* Between a descriptor and what comes next */ + between_desc: t = format_lex (); switch (t) { @@ -851,10 +847,9 @@ between_desc: goto finished; } -/* Optional comma is a weird between state where we've just finished - * reading a colon, slash or P descriptor. */ - -optional_comma: + /* Optional comma is a weird between state where we've just finished + reading a colon, slash or P descriptor. */ + optional_comma: t = format_lex (); switch (t) { @@ -871,7 +866,7 @@ optional_comma: goto format_item; -finished: + finished: return head; } @@ -935,20 +930,19 @@ format_error (fnode * f, const char *message) void parse_format (void) { - format_string = ioparm.format; format_string_len = ioparm.format_len; saved_token = FMT_NONE; error = NULL; -/* Initialize variables used during traversal of the tree */ + /* Initialize variables used during traversal of the tree */ reversion_ok = 0; g.reversion_flag = 0; saved_format = NULL; -/* Allocate the first format node as the root of the tree */ + /* Allocate the first format node as the root of the tree */ avail = array; @@ -1082,8 +1076,7 @@ next_format (void) } /* If this is a data edit descriptor, then reversion has become OK. */ - -done: + done: t = f->format; if (!reversion_ok && @@ -1105,7 +1098,6 @@ done: void unget_format (fnode * f) { - saved_format = f; } @@ -1248,7 +1240,6 @@ dump_format0 (fnode * f) static void dump_format1 (fnode * f) { - for (; f; f = f->next) dump_format1 (f); } @@ -1258,7 +1249,6 @@ dump_format1 (fnode * f) void dump_format (void) { - st_printf ("format = "); dump_format0 (&array[0]); st_printf ("\n"); diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 80078a8..cee5c74 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -107,7 +107,6 @@ push_char (char c) static void free_saved (void) { - if (saved_string == NULL) return; @@ -165,7 +164,6 @@ done: static void unget_char (char c) { - last_char = c; } @@ -253,7 +251,7 @@ finish_separator (void) { char c; -restart: + restart: eat_spaces (); c = next_char (); @@ -354,7 +352,7 @@ convert_integer (int length, int negative) free_saved (); return m; -overflow: + overflow: if (length == -1) st_sprintf (message, "Repeat count overflow in item %d of list input", g.item_count); @@ -434,11 +432,11 @@ parse_repeat (void) } } -done: + done: repeat_count = repeat; return 0; -bad_repeat: + bad_repeat: st_sprintf (message, "Bad repeat count in item %d of list input", g.item_count); @@ -514,7 +512,7 @@ read_logical (int length) return; -bad_logical: + bad_logical: st_sprintf (message, "Bad logical value while reading item %d", g.item_count); @@ -582,7 +580,7 @@ read_integer (int length) } } -repeat: + repeat: if (convert_integer (-1, 0)) return; @@ -608,7 +606,7 @@ repeat: break; } -get_integer: + get_integer: if (!isdigit (c)) goto bad_integer; push_char (c); @@ -630,7 +628,7 @@ get_integer: } } -bad_integer: + bad_integer: free_saved (); st_sprintf (message, "Bad integer for item %d in list input", g.item_count); @@ -638,7 +636,7 @@ bad_integer: return; -done: + done: unget_char (c); eat_separator (); @@ -710,7 +708,7 @@ read_character (int length) } } -got_repeat: + got_repeat: if (convert_integer (-1, 0)) return; @@ -734,7 +732,7 @@ got_repeat: break; } -get_string: + get_string: for (;;) { c = next_char (); @@ -778,10 +776,9 @@ get_string: } } -/* At this point, we have to have a separator, or else the string is - invalid. */ - -done: + /* At this point, we have to have a separator, or else the string is + invalid. */ + done: c = next_char (); if (is_separator (c)) { @@ -861,7 +858,7 @@ parse_real (void *buffer, int length) } } -exp1: + exp1: c = next_char (); if (c != '-' && c != '+') push_char ('+'); @@ -871,7 +868,7 @@ exp1: c = next_char (); } -exp2: + exp2: if (!isdigit (c)) goto bad; push_char (c); @@ -894,7 +891,7 @@ exp2: } } -done: + done: unget_char (c); push_char ('\0'); @@ -903,7 +900,7 @@ done: return m; -bad: + bad: free_saved (); st_sprintf (message, "Bad floating point number for item %d", g.item_count); generate_error (ERROR_READ_VALUE, message); @@ -966,7 +963,7 @@ read_complex (int length) saved_type = BT_COMPLEX; return; -bad_complex: + bad_complex: st_sprintf (message, "Bad complex value in item %d of list input", g.item_count); @@ -1055,7 +1052,7 @@ read_real (int length) } } -got_repeat: + got_repeat: if (convert_integer (-1, 0)) return; @@ -1091,7 +1088,7 @@ got_repeat: push_char (c); -real_loop: + real_loop: for (;;) { c = next_char (); @@ -1130,7 +1127,7 @@ real_loop: } } -exp1: + exp1: push_char ('e'); c = next_char (); @@ -1142,7 +1139,7 @@ exp1: c = next_char (); } -exp2: + exp2: if (!isdigit (c)) goto bad_real; push_char (c); @@ -1167,7 +1164,7 @@ exp2: } } -done: + done: push_char ('\0'); if (convert_real (value, saved_string, length)) return; @@ -1176,7 +1173,7 @@ done: saved_type = BT_REAL; return; -bad_real: + bad_real: st_sprintf (message, "Bad real number in item %d of list input", g.item_count); @@ -1281,7 +1278,6 @@ list_formatted_read (bt type, void *p, int len) repeat_count = 1; } - switch (type) { case BT_INTEGER: @@ -1309,7 +1305,7 @@ list_formatted_read (bt type, void *p, int len) if (ioparm.library_return != LIBRARY_OK) return; -set_value: + set_value: switch (saved_type) { case BT_COMPLEX: @@ -1345,7 +1341,7 @@ set_value: } void -init_at_eol() +init_at_eol(void) { at_eol = 0; } @@ -1365,7 +1361,6 @@ finish_list_read (void) return; } - do { c = next_char (); @@ -1440,7 +1435,7 @@ namelist_read (void) return; } -restart: + restart: c = next_char (); switch (c) { diff --git a/libgfortran/io/lock.c b/libgfortran/io/lock.c index 1d3f069..8daf1aa 100644 --- a/libgfortran/io/lock.c +++ b/libgfortran/io/lock.c @@ -34,7 +34,6 @@ global_t g; void library_start (void) { - if (g.in_library) internal_error ("Recursive library calls not allowed"); @@ -81,4 +80,3 @@ library_end (void) memset (&ioparm, '\0', sizeof (ioparm)); ioparm.library_return = t; } - diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index 2d04537..ef8aad2 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -30,106 +30,61 @@ static st_option access_opt[] = { {"sequential", ACCESS_SEQUENTIAL}, {"direct", ACCESS_DIRECT}, {NULL} -}, action_opt[] = +}; + +static st_option action_opt[] = { - { - "read", ACTION_READ} - , - { - "write", ACTION_WRITE} - , - { - "readwrite", ACTION_READWRITE} - , - { - NULL} -} + { "read", ACTION_READ}, + { "write", ACTION_WRITE}, + { "readwrite", ACTION_READWRITE}, + { NULL} +}; -, blank_opt[] = +static st_option blank_opt[] = { - { - "null", BLANK_NULL} - , - { - "zero", BLANK_ZERO} - , - { - NULL} -} + { "null", BLANK_NULL}, + { "zero", BLANK_ZERO}, + { NULL} +}; -, delim_opt[] = +static st_option delim_opt[] = { - { - "none", DELIM_NONE} - , - { - "apostrophe", DELIM_APOSTROPHE} - , - { - "quote", DELIM_QUOTE} - , - { - NULL} -} + { "none", DELIM_NONE}, + { "apostrophe", DELIM_APOSTROPHE}, + { "quote", DELIM_QUOTE}, + { NULL} +}; -, form_opt[] = +static st_option form_opt[] = { - { - "formatted", FORM_FORMATTED} - , - { - "unformatted", FORM_UNFORMATTED} - , - { - NULL} -} + { "formatted", FORM_FORMATTED}, + { "unformatted", FORM_UNFORMATTED}, + { NULL} +}; -, position_opt[] = +static st_option position_opt[] = { - { - "asis", POSITION_ASIS} - , - { - "rewind", POSITION_REWIND} - , - { - "append", POSITION_APPEND} - , - { - NULL} -} + { "asis", POSITION_ASIS}, + { "rewind", POSITION_REWIND}, + { "append", POSITION_APPEND}, + { NULL} +}; -, status_opt[] = +static st_option status_opt[] = { - { - "unknown", STATUS_UNKNOWN} - , - { - "old", STATUS_OLD} - , - { - "new", STATUS_NEW} - , - { - "replace", STATUS_REPLACE} - , - { - "scratch", STATUS_SCRATCH} - , - { - NULL} -} + { "unknown", STATUS_UNKNOWN}, + { "old", STATUS_OLD}, + { "new", STATUS_NEW}, + { "replace", STATUS_REPLACE}, + { "scratch", STATUS_SCRATCH}, + { NULL} +}; -, pad_opt[] = +static st_option pad_opt[] = { - { - "yes", PAD_YES} - , - { - "no", PAD_NO} - , - { - NULL} + { "yes", PAD_YES}, + { "no", PAD_NO}, + { NULL} }; @@ -141,7 +96,6 @@ static st_option access_opt[] = { void test_endfile (gfc_unit * u) { - if (u->endfile == NO_ENDFILE && file_length (u->s) == file_position (u->s)) u->endfile = AT_ENDFILE; } @@ -153,7 +107,6 @@ test_endfile (gfc_unit * u) static void edit_modes (gfc_unit * u, unit_flags * flags) { - /* Complain about attempts to change the unchangeable. */ if (flags->status != STATUS_UNSPECIFIED && @@ -416,7 +369,7 @@ new_unit (unit_flags * flags) test_endfile (u); -cleanup: + cleanup: /* Free memory associated with a temporary filename. */ @@ -431,7 +384,6 @@ cleanup: static void already_open (gfc_unit * u, unit_flags * flags) { - if (ioparm.file == NULL) { edit_modes (u, flags); diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index 34454d6..962c0a2 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -36,7 +36,6 @@ Boston, MA 02111-1307, USA. */ void set_integer (void *dest, int64_t value, int length) { - switch (length) { case 8: @@ -95,7 +94,6 @@ max_value (int length, int signed_flag) int convert_real (void *dest, const char *buffer, int length) { - errno = 0; switch (length) @@ -204,7 +202,6 @@ read_a (fnode * f, char *p, int length) static char * eat_leading_spaces (int *width, char *p) { - for (;;) { if (*width == 0 || *p != ' ') @@ -325,11 +322,11 @@ read_decimal (fnode * f, char *dest, int length) set_integer (dest, v, length); return; -bad: + bad: generate_error (ERROR_READ_VALUE, "Bad value during integer read"); return; -overflow: + overflow: generate_error (ERROR_READ_OVERFLOW, "Value overflowed during integer read"); return; @@ -461,11 +458,11 @@ read_radix (fnode * f, char *dest, int length, int radix) set_integer (dest, v, length); return; -bad: + bad: generate_error (ERROR_READ_VALUE, "Bad value during integer read"); return; -overflow: + overflow: generate_error (ERROR_READ_OVERFLOW, "Value overflowed during integer read"); return; @@ -588,20 +585,18 @@ read_f (fnode * f, char *dest, int length) } } -/* No exponent has been seen, so we use the current scale factor */ - + /* No exponent has been seen, so we use the current scale factor */ exponent = -g.scale_factor; goto done; -bad_float: + bad_float: generate_error (ERROR_READ_VALUE, "Bad value during floating point read"); if (buffer != scratch) free_mem (buffer); return; -/* At this point the start of an exponent has been found */ - -exp1: + /* At this point the start of an exponent has been found */ + exp1: while (w > 0 && *p == ' ') { w--; @@ -623,11 +618,10 @@ exp1: if (w == 0) goto bad_float; -/* At this point a digit string is required. We calculate the value - of the exponent in order to take account of the scale factor and - the d parameter before explict conversion takes place. */ - -exp2: + /* At this point a digit string is required. We calculate the value + of the exponent in order to take account of the scale factor and + the d parameter before explict conversion takes place. */ + exp2: if (!isdigit (*p)) goto bad_float; @@ -654,7 +648,7 @@ exp2: exponent = exponent * exponent_sign; -done: + done: /* Use the precision specified in the format if no decimal point has been seen. */ if (!seen_dp) diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index c27f0f7..ec5240d 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -745,16 +745,14 @@ formatted_transfer (bt type, void *p, int len) return; -/* Come here when we need a data descriptor but don't have one. We - push the current format node back onto the input, then return and - let the user program call us back with the data. */ - -need_data: + /* Come here when we need a data descriptor but don't have one. We + push the current format node back onto the input, then return and + let the user program call us back with the data. */ + need_data: unget_format (f); } - /* Data transfer entry points. The type of the data entity is implicit in the subroutine call. This prevents us from having to share a common enum with the compiler. */ @@ -762,7 +760,6 @@ need_data: void transfer_integer (void *p, int kind) { - g.item_count++; if (ioparm.library_return != LIBRARY_OK) return; @@ -773,7 +770,6 @@ transfer_integer (void *p, int kind) void transfer_real (void *p, int kind) { - g.item_count++; if (ioparm.library_return != LIBRARY_OK) return; @@ -784,7 +780,6 @@ transfer_real (void *p, int kind) void transfer_logical (void *p, int kind) { - g.item_count++; if (ioparm.library_return != LIBRARY_OK) return; @@ -795,7 +790,6 @@ transfer_logical (void *p, int kind) void transfer_character (void *p, int len) { - g.item_count++; if (ioparm.library_return != LIBRARY_OK) return; @@ -806,7 +800,6 @@ transfer_character (void *p, int len) void transfer_complex (void *p, int kind) { - g.item_count++; if (ioparm.library_return != LIBRARY_OK) return; @@ -873,7 +866,6 @@ us_write (void) static void pre_position (void) { - if (current_unit->current_record) return; /* Already positioned. */ @@ -1140,9 +1132,7 @@ data_transfer_init (int read_flag) /* Start the data transfer if we are doing a formatted transfer. */ if (current_unit->flags.form == FORM_FORMATTED && !ioparm.list_format && ioparm.namelist_name == NULL && ionml == NULL) - - formatted_transfer (0, NULL, 0); - + formatted_transfer (0, NULL, 0); } @@ -1198,7 +1188,6 @@ next_record_r (int done) current_unit->bytes_left -= length; } } - break; case FORMATTED_SEQUENTIAL: @@ -1367,7 +1356,6 @@ next_record (int done) static void finalize_transfer (void) { - if ((ionml != NULL) && (ioparm.namelist_name != NULL)) { if (ioparm.namelist_read_mode) @@ -1429,7 +1417,6 @@ iolength_transfer (bt type, void *dest, int len) static void iolength_transfer_init (void) { - if (ioparm.iolength != NULL) *ioparm.iolength = 0; @@ -1438,7 +1425,6 @@ iolength_transfer_init (void) /* Set up the subroutine that will handle the transfers. */ transfer = iolength_transfer; - } @@ -1451,7 +1437,6 @@ void st_iolength (void) { library_start (); - iolength_transfer_init (); } @@ -1467,7 +1452,6 @@ st_iolength_done (void) void st_read (void) { - library_start (); data_transfer_init (1); @@ -1502,7 +1486,6 @@ void st_read_done (void) { finalize_transfer (); - library_end (); } @@ -1510,7 +1493,6 @@ st_read_done (void) void st_write (void) { - library_start (); data_transfer_init (0); } @@ -1519,7 +1501,6 @@ st_write (void) void st_write_done (void) { - finalize_transfer (); /* Deal with endfile conditions associated with sequential files. */ @@ -1590,7 +1571,6 @@ void st_set_nml_var_int (void * var_addr, char * var_name, int var_name_len, int kind) { - st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_INTEGER, 0); } @@ -1598,7 +1578,6 @@ void st_set_nml_var_float (void * var_addr, char * var_name, int var_name_len, int kind) { - st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_REAL, 0); } @@ -1606,7 +1585,6 @@ void st_set_nml_var_char (void * var_addr, char * var_name, int var_name_len, int kind, gfc_charlen_type string_length) { - st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_CHARACTER, string_length); } @@ -1615,7 +1593,6 @@ void st_set_nml_var_complex (void * var_addr, char * var_name, int var_name_len, int kind) { - st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_COMPLEX, 0); } @@ -1623,7 +1600,5 @@ void st_set_nml_var_log (void * var_addr, char * var_name, int var_name_len, int kind) { - st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_LOGICAL, 0); } - diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 8e3afbd..11aed70 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -181,8 +181,8 @@ fix_fd (int fd) input = output = error = 0; -/* Unix allocates the lowest descriptors first, so a loop is not - * required, but this order is. */ + /* Unix allocates the lowest descriptors first, so a loop is not + required, but this order is. */ if (fd == STDIN_FILENO) { @@ -271,7 +271,6 @@ readn (int fd, char *buffer, int len) const char * get_oserror (void) { - return strerror (errno); } @@ -281,7 +280,6 @@ get_oserror (void) void sys_exit (int code) { - exit (code); } @@ -295,7 +293,6 @@ sys_exit (int code) static try fd_flush (unix_stream * s) { - if (s->ndirty == 0) return SUCCESS;; @@ -476,7 +473,6 @@ fd_alloc_w_at (unix_stream * s, int *len, gfc_offset where) static try fd_sfree (unix_stream * s) { - if (s->ndirty != 0 && (s->buffer != s->small_buffer || options.all_unbuffered || s->unbuffered)) @@ -489,7 +485,6 @@ fd_sfree (unix_stream * s) static int fd_seek (unix_stream * s, gfc_offset offset) { - s->physical_offset = s->logical_offset = offset; return (lseek (s->fd, offset, SEEK_SET) < 0) ? FAILURE : SUCCESS; @@ -503,7 +498,6 @@ fd_seek (unix_stream * s, gfc_offset offset) static try fd_truncate (unix_stream * s) { - if (lseek (s->fd, s->logical_offset, SEEK_SET) == -1) return FAILURE; @@ -511,9 +505,7 @@ fd_truncate (unix_stream * s) the fd is a regular file at this point */ if (ftruncate (s->fd, s->logical_offset)) - { return FAILURE; - } s->physical_offset = s->file_length = s->logical_offset; @@ -524,7 +516,6 @@ fd_truncate (unix_stream * s) static try fd_close (unix_stream * s) { - if (fd_flush (s) == FAILURE) return FAILURE; @@ -543,7 +534,6 @@ fd_close (unix_stream * s) static void fd_open (unix_stream * s) { - if (isatty (s->fd)) s->unbuffered = 1; @@ -578,7 +568,6 @@ static int page_size, page_mask; static try mmap_flush (unix_stream * s) { - if (!s->mmaped) return fd_flush (s); @@ -683,7 +672,6 @@ mmap_alloc_w_at (unix_stream * s, int *len, gfc_offset where) static int mmap_seek (unix_stream * s, gfc_offset offset) { - s->logical_offset = offset; return SUCCESS; } @@ -707,7 +695,6 @@ mmap_close (unix_stream * s) static try mmap_sfree (unix_stream * s) { - return SUCCESS; } @@ -810,7 +797,6 @@ mem_alloc_w_at (unix_stream * s, int *len, gfc_offset where) static int mem_seek (unix_stream * s, gfc_offset offset) { - if (offset > s->file_length) { errno = ESPIPE; @@ -825,7 +811,6 @@ mem_seek (unix_stream * s, gfc_offset offset) static int mem_truncate (unix_stream * s) { - return SUCCESS; } @@ -842,7 +827,6 @@ mem_close (unix_stream * s) static try mem_sfree (unix_stream * s) { - return SUCCESS; } @@ -858,8 +842,8 @@ mem_sfree (unix_stream * s) void empty_internal_buffer(stream *strm) { - unix_stream * s = (unix_stream *) strm; - memset(s->buffer, ' ', s->file_length); + unix_stream * s = (unix_stream *) strm; + memset(s->buffer, ' ', s->file_length); } /* open_internal()-- Returns a stream structure from an internal file */ @@ -925,7 +909,6 @@ fd_to_stream (int fd, int prot) int unit_to_fd(int unit) { - gfc_unit *us; us = find_unit(unit); @@ -943,7 +926,6 @@ unit_to_fd(int unit) static int unpack_filename (char *cstring, const char *fstring, int len) { - len = fstrlen (fstring, len); if (len >= PATH_MAX) return 1; @@ -1065,7 +1047,7 @@ regular_file (unit_action action, unit_status status) internal_error ("regular_file(): Bad status"); } - // mode |= O_LARGEFILE; + /* mode |= O_LARGEFILE; */ return open (path, mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); @@ -1121,7 +1103,6 @@ open_external (unit_action action, unit_status status) stream * input_stream (void) { - return fd_to_stream (STDIN_FILENO, PROT_READ); } @@ -1132,7 +1113,6 @@ input_stream (void) stream * output_stream (void) { - return fd_to_stream (STDOUT_FILENO, PROT_WRITE); } @@ -1386,7 +1366,6 @@ inquire_formatted (const char *string, int len) const char * inquire_unformatted (const char *string, int len) { - return inquire_formatted (string, len); } @@ -1413,7 +1392,6 @@ inquire_access (const char *string, int len, int mode) const char * inquire_read (const char *string, int len) { - return inquire_access (string, len, R_OK); } @@ -1424,7 +1402,6 @@ inquire_read (const char *string, int len) const char * inquire_write (const char *string, int len) { - return inquire_access (string, len, W_OK); } @@ -1435,7 +1412,6 @@ inquire_write (const char *string, int len) const char * inquire_readwrite (const char *string, int len) { - return inquire_access (string, len, R_OK | W_OK); } @@ -1445,7 +1421,6 @@ inquire_readwrite (const char *string, int len) gfc_offset file_length (stream * s) { - return ((unix_stream *) s)->file_length; } @@ -1455,7 +1430,6 @@ file_length (stream * s) gfc_offset file_position (stream * s) { - return ((unix_stream *) s)->logical_offset; } diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index fd4665b..4d9c015 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -780,7 +780,7 @@ write_int (fnode *f, const char *source, int len, char *(*conv) (uint64_t)) memcpy (p, q, digits); -done: + done: return; } @@ -865,7 +865,7 @@ write_decimal (fnode *f, const char *source, int len, char *(*conv) (int64_t)) memcpy (p, q, digits); -done: + done: return; } @@ -928,7 +928,6 @@ btoa (uint64_t n) void write_i (fnode * f, const char *p, int len) { - write_decimal (f, p, len, (void *) itoa); } @@ -936,7 +935,6 @@ write_i (fnode * f, const char *p, int len) void write_b (fnode * f, const char *p, int len) { - write_int (f, p, len, btoa); } @@ -944,14 +942,12 @@ write_b (fnode * f, const char *p, int len) void write_o (fnode * f, const char *p, int len) { - write_int (f, p, len, otoa); } void write_z (fnode * f, const char *p, int len) { - write_int (f, p, len, xtoa); } @@ -959,7 +955,6 @@ write_z (fnode * f, const char *p, int len) void write_d (fnode *f, const char *p, int len) { - write_float (f, p, len); } @@ -967,7 +962,6 @@ write_d (fnode *f, const char *p, int len) void write_e (fnode *f, const char *p, int len) { - write_float (f, p, len); } @@ -975,7 +969,6 @@ write_e (fnode *f, const char *p, int len) void write_f (fnode *f, const char *p, int len) { - write_float (f, p, len); } @@ -983,7 +976,6 @@ write_f (fnode *f, const char *p, int len) void write_en (fnode *f, const char *p, int len) { - write_float (f, p, len); } @@ -991,7 +983,6 @@ write_en (fnode *f, const char *p, int len) void write_es (fnode *f, const char *p, int len) { - write_float (f, p, len); } @@ -1172,7 +1163,6 @@ write_real (const char *source, int length) static void write_complex (const char *source, int len) { - if (write_char ('(')) return; write_real (source, len); |