From f21edfd62d267934ad7e9475976719bc41ee7dc3 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 6 Dec 2004 16:01:01 -0800 Subject: [PATCH] c99_functions.c, [...]: Whitespace fixes. * intrinsics/c99_functions.c, intrinsics/eoshift0.c, intrinsics/eoshift2.c, intrinsics/exit.c, intrinsics/flush.c, intrinsics/ishftc.c, intrinsics/mvbits.c, intrinsics/pack_generic.c, intrinsics/random.c, intrinsics/reshape_generic.c, intrinsics/size.c, intrinsics/spread_generic.c, intrinsics/stat.c, intrinsics/string_intrinsics.c, intrinsics/system_clock.c, intrinsics/transpose_generic.c, intrinsics/unlink.c, intrinsics/unpack_generic.c, io/backspace.c, io/format.c, io/list_read.c, io/lock.c, io/open.c, io/transfer.c, io/unix.c, io/write.c, runtime/environ.c, runtime/error.c, runtime/in_pack_generic.c, runtime/in_unpack_generic.c, runtime/main.c, runtime/memory.c, runtime/pause.c, runtime/stop.c, runtime/string.c: Whitespace fixes. From-SVN: r91794 --- libgfortran/ChangeLog | 16 +++ libgfortran/intrinsics/c99_functions.c | 1 - libgfortran/intrinsics/eoshift0.c | 1 - libgfortran/intrinsics/eoshift2.c | 1 - libgfortran/intrinsics/exit.c | 2 - libgfortran/intrinsics/flush.c | 1 - libgfortran/intrinsics/ishftc.c | 1 - libgfortran/intrinsics/mvbits.c | 1 - libgfortran/intrinsics/pack_generic.c | 1 - libgfortran/intrinsics/random.c | 8 +- libgfortran/intrinsics/reshape_generic.c | 1 - libgfortran/intrinsics/size.c | 1 - libgfortran/intrinsics/spread_generic.c | 1 - libgfortran/intrinsics/stat.c | 7 -- libgfortran/intrinsics/string_intrinsics.c | 4 +- libgfortran/intrinsics/system_clock.c | 1 - libgfortran/intrinsics/transpose_generic.c | 1 - libgfortran/intrinsics/unlink.c | 3 - libgfortran/intrinsics/unpack_generic.c | 2 - libgfortran/io/backspace.c | 11 +- libgfortran/io/format.c | 40 +++--- libgfortran/io/list_read.c | 61 +++++----- libgfortran/io/lock.c | 2 - libgfortran/io/open.c | 134 +++++++-------------- libgfortran/io/read.c | 32 ++--- libgfortran/io/transfer.c | 35 +----- libgfortran/io/unix.c | 36 +----- libgfortran/io/write.c | 14 +-- libgfortran/runtime/environ.c | 50 +++----- libgfortran/runtime/error.c | 12 +- libgfortran/runtime/in_pack_generic.c | 1 - libgfortran/runtime/in_unpack_generic.c | 1 - libgfortran/runtime/main.c | 2 - libgfortran/runtime/memory.c | 6 - libgfortran/runtime/pause.c | 1 - libgfortran/runtime/stop.c | 1 - libgfortran/runtime/string.c | 5 - 37 files changed, 156 insertions(+), 342 deletions(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 3ac40292c69a..50dde4e40e0c 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,19 @@ +2004-12-06 Richard Henderson + + * intrinsics/c99_functions.c, intrinsics/eoshift0.c, + intrinsics/eoshift2.c, intrinsics/exit.c, intrinsics/flush.c, + intrinsics/ishftc.c, intrinsics/mvbits.c, intrinsics/pack_generic.c, + intrinsics/random.c, intrinsics/reshape_generic.c, intrinsics/size.c, + intrinsics/spread_generic.c, intrinsics/stat.c, + intrinsics/string_intrinsics.c, intrinsics/system_clock.c, + intrinsics/transpose_generic.c, intrinsics/unlink.c, + intrinsics/unpack_generic.c, io/backspace.c, io/format.c, + io/list_read.c, io/lock.c, io/open.c, io/transfer.c, io/unix.c, + io/write.c, runtime/environ.c, runtime/error.c, + runtime/in_pack_generic.c, runtime/in_unpack_generic.c, runtime/main.c, + runtime/memory.c, runtime/pause.c, runtime/stop.c, + runtime/string.c: Whitespace fixes. + 2004-12-06 Richard Henderson * Makefile.am: Generate all m4 output under $(srcdir). diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c index 2c11ceb6a890..617e0d57ecb4 100644 --- a/libgfortran/intrinsics/c99_functions.c +++ b/libgfortran/intrinsics/c99_functions.c @@ -322,4 +322,3 @@ roundf(float x) } } #endif - diff --git a/libgfortran/intrinsics/eoshift0.c b/libgfortran/intrinsics/eoshift0.c index fca1ef08fff4..2f7a0338461a 100644 --- a/libgfortran/intrinsics/eoshift0.c +++ b/libgfortran/intrinsics/eoshift0.c @@ -204,4 +204,3 @@ __eoshift0_8 (gfc_array_char * ret, const gfc_array_char * array, { __eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1); } - diff --git a/libgfortran/intrinsics/eoshift2.c b/libgfortran/intrinsics/eoshift2.c index 18c3f558ae03..c89c5c59d906 100644 --- a/libgfortran/intrinsics/eoshift2.c +++ b/libgfortran/intrinsics/eoshift2.c @@ -220,4 +220,3 @@ __eoshift2_8 (gfc_array_char * ret, const gfc_array_char * array, { __eoshift2 (ret, array, *pshift, bound, pdim ? *pdim : 1); } - diff --git a/libgfortran/intrinsics/exit.c b/libgfortran/intrinsics/exit.c index 6ae4dfdf3353..f15d56787bf4 100644 --- a/libgfortran/intrinsics/exit.c +++ b/libgfortran/intrinsics/exit.c @@ -33,7 +33,6 @@ Boston, MA 02111-1307, USA. */ void prefix(exit_i4) (GFC_INTEGER_4 * status) { - if (status == NULL) exit(0); exit(*status); @@ -42,7 +41,6 @@ prefix(exit_i4) (GFC_INTEGER_4 * status) void prefix(exit_i8) (GFC_INTEGER_8 * status) { - if (status == NULL) exit(0); exit((int) *status); diff --git a/libgfortran/intrinsics/flush.c b/libgfortran/intrinsics/flush.c index 4603d709f484..5f75195b9e4a 100644 --- a/libgfortran/intrinsics/flush.c +++ b/libgfortran/intrinsics/flush.c @@ -48,7 +48,6 @@ recursive_flush (gfc_unit *us) void prefix(flush_i4) (GFC_INTEGER_4 * unit) { - gfc_unit *us; /* flush all streams */ diff --git a/libgfortran/intrinsics/ishftc.c b/libgfortran/intrinsics/ishftc.c index 0bb3d422eb25..2677c3313f91 100644 --- a/libgfortran/intrinsics/ishftc.c +++ b/libgfortran/intrinsics/ishftc.c @@ -61,4 +61,3 @@ ishftc8 (GFC_INTEGER_8 i, GFC_INTEGER_8 shift, GFC_INTEGER_8 size) bits = i & ~mask; return (i & mask) | (bits >> (size - shift)) | ((i << shift) & ~mask); } - diff --git a/libgfortran/intrinsics/mvbits.c b/libgfortran/intrinsics/mvbits.c index 683b9b210699..97fdc41177cb 100644 --- a/libgfortran/intrinsics/mvbits.c +++ b/libgfortran/intrinsics/mvbits.c @@ -60,4 +60,3 @@ SUB_NAME (const TYPE *from, const GFC_INTEGER_4 *frompos, # undef TYPE # undef UTYPE #endif - diff --git a/libgfortran/intrinsics/pack_generic.c b/libgfortran/intrinsics/pack_generic.c index 301948e7e86d..da0bc5798271 100644 --- a/libgfortran/intrinsics/pack_generic.c +++ b/libgfortran/intrinsics/pack_generic.c @@ -123,7 +123,6 @@ __pack (gfc_array_char * ret, const gfc_array_char * array, if (vector != NULL) { - /* The return array will have as many elements as there are in VECTOR. */ total = vector->dim[0].ubound + 1 - vector->dim[0].lbound; diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c index b49868405832..2cc5d20372d8 100644 --- a/libgfortran/intrinsics/random.c +++ b/libgfortran/intrinsics/random.c @@ -485,7 +485,6 @@ prefix(random_r8) (GFC_REAL_8 *x) void prefix(arandom_r4) (gfc_array_r4 *x) { - index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; index_type stride[GFC_MAX_DIMENSIONS - 1]; @@ -550,7 +549,6 @@ prefix(arandom_r4) (gfc_array_r4 *x) void prefix(arandom_r8) (gfc_array_r8 *x) { - index_type count[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1]; index_type stride[GFC_MAX_DIMENSIONS - 1]; @@ -614,10 +612,8 @@ prefix(arandom_r8) (gfc_array_r8 *x) must be called with no argument or exactly one argument. */ void -random_seed (GFC_INTEGER_4 *size, gfc_array_i4 * put, - gfc_array_i4 * get) +random_seed (GFC_INTEGER_4 *size, gfc_array_i4 *put, gfc_array_i4 *get) { - int i; if (size == NULL && put == NULL && get == NULL) @@ -670,5 +666,3 @@ random_seed (GFC_INTEGER_4 *size, gfc_array_i4 * put, get->data[i * get->dim[0].stride] = (GFC_INTEGER_4) kiss_seed[i]; } } - - diff --git a/libgfortran/intrinsics/reshape_generic.c b/libgfortran/intrinsics/reshape_generic.c index ca6f6aacd006..5314456ca26a 100644 --- a/libgfortran/intrinsics/reshape_generic.c +++ b/libgfortran/intrinsics/reshape_generic.c @@ -228,4 +228,3 @@ __reshape (parray * ret, parray * source, shape_type * shape, } } } - diff --git a/libgfortran/intrinsics/size.c b/libgfortran/intrinsics/size.c index c4c792d6c755..f83f6c0162ec 100644 --- a/libgfortran/intrinsics/size.c +++ b/libgfortran/intrinsics/size.c @@ -50,4 +50,3 @@ index_type size1 (const array_t * array, index_type dim) size = 0; return size; } - diff --git a/libgfortran/intrinsics/spread_generic.c b/libgfortran/intrinsics/spread_generic.c index a789c98448bc..f65f869d3b0e 100644 --- a/libgfortran/intrinsics/spread_generic.c +++ b/libgfortran/intrinsics/spread_generic.c @@ -115,4 +115,3 @@ __spread (const gfc_array_char * ret, const gfc_array_char * source, } } } - diff --git a/libgfortran/intrinsics/stat.c b/libgfortran/intrinsics/stat.c index e597e44aa1cc..8f250d460f02 100644 --- a/libgfortran/intrinsics/stat.c +++ b/libgfortran/intrinsics/stat.c @@ -56,7 +56,6 @@ void prefix(stat_i4_sub) (char * name, gfc_array_i4 * sarray, GFC_INTEGER_4 * status, gfc_charlen_type name_len) { - int val; char *str; struct stat sb; @@ -147,7 +146,6 @@ void prefix(stat_i8_sub) (char * name, gfc_array_i8 * sarray, GFC_INTEGER_8 * status, gfc_charlen_type name_len) { - int val; char *str; struct stat sb; @@ -250,7 +248,6 @@ GFC_INTEGER_8 prefix(stat_i8) (char * name, gfc_array_i8 * sarray, gfc_charlen_type name_len) { - GFC_INTEGER_8 val; prefix(stat_i8_sub) (name, sarray, &val, name_len); return val; @@ -271,7 +268,6 @@ void prefix(fstat_i4_sub) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray, GFC_INTEGER_4 * status) { - int val; struct stat sb; @@ -355,7 +351,6 @@ void prefix(fstat_i8_sub) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray, GFC_INTEGER_8 * status) { - int val; struct stat sb; @@ -439,7 +434,6 @@ prefix(fstat_i8_sub) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray, GFC_INTEGER_4 prefix(fstat_i4) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray) { - GFC_INTEGER_4 val; prefix(fstat_i4_sub) (unit, sarray, &val); return val; @@ -449,7 +443,6 @@ prefix(fstat_i4) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray) GFC_INTEGER_8 prefix(fstat_i8) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray) { - GFC_INTEGER_8 val; prefix(fstat_i8_sub) (unit, sarray, &val); return val; diff --git a/libgfortran/intrinsics/string_intrinsics.c b/libgfortran/intrinsics/string_intrinsics.c index ac70a9bb8734..53d9b4e99029 100644 --- a/libgfortran/intrinsics/string_intrinsics.c +++ b/libgfortran/intrinsics/string_intrinsics.c @@ -168,7 +168,8 @@ concat_string (GFC_INTEGER_4 destlen, char * dest, /* Return string with all trailing blanks removed. */ void -string_trim (GFC_INTEGER_4 * len, void ** dest, GFC_INTEGER_4 slen, const char * src) +string_trim (GFC_INTEGER_4 * len, void ** dest, GFC_INTEGER_4 slen, + const char * src) { int i; @@ -392,4 +393,3 @@ string_repeat (char * dest, GFC_INTEGER_4 slen, memmove (dest + (i * slen), src, slen); } } - diff --git a/libgfortran/intrinsics/system_clock.c b/libgfortran/intrinsics/system_clock.c index 6b6ae9d06a31..d11d1a99d35c 100644 --- a/libgfortran/intrinsics/system_clock.c +++ b/libgfortran/intrinsics/system_clock.c @@ -197,4 +197,3 @@ prefix(system_clock_8)(GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate, if (count_max != NULL) *count_max = mx; } - diff --git a/libgfortran/intrinsics/transpose_generic.c b/libgfortran/intrinsics/transpose_generic.c index b9bdbe4a0416..ad08ea7893a3 100644 --- a/libgfortran/intrinsics/transpose_generic.c +++ b/libgfortran/intrinsics/transpose_generic.c @@ -88,4 +88,3 @@ __transpose (gfc_array_char * ret, gfc_array_char * source) rptr += rxstride - (rystride * xcount); } } - diff --git a/libgfortran/intrinsics/unlink.c b/libgfortran/intrinsics/unlink.c index 11c35099a906..7ea2a1002a3d 100644 --- a/libgfortran/intrinsics/unlink.c +++ b/libgfortran/intrinsics/unlink.c @@ -63,9 +63,7 @@ void prefix(unlink_i8_sub) (char * name, GFC_INTEGER_8 * status, gfc_charlen_type name_len) { - GFC_INTEGER_4 status4; - prefix (unlink_i4_sub) (name, &status4, name_len); if (status) *status = status4; @@ -82,4 +80,3 @@ prefix(unlink) (char * name, gfc_charlen_type name_len) prefix(unlink_i4_sub) (name, &status, name_len); return status; } - diff --git a/libgfortran/intrinsics/unpack_generic.c b/libgfortran/intrinsics/unpack_generic.c index 3d02a3e6060e..a301b58d46be 100644 --- a/libgfortran/intrinsics/unpack_generic.c +++ b/libgfortran/intrinsics/unpack_generic.c @@ -82,7 +82,6 @@ __unpack1 (const gfc_array_char * ret, const gfc_array_char * vector, mptr = mask->data; vptr = vector->data; - /* Use the same loop for both logical types. */ if (GFC_DESCRIPTOR_SIZE (mask) != 4) { @@ -151,4 +150,3 @@ __unpack0 (const gfc_array_char * ret, const gfc_array_char * vector, tmp.data = field; __unpack1 (ret, vector, mask, &tmp); } - diff --git a/libgfortran/io/backspace.c b/libgfortran/io/backspace.c index e378adf90e67..eb25b108146c 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 0e42810873ef..4083ca3b656e 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 80078a879994..cee5c74c5944 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 1d3f06912e04..8daf1aa57c3a 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 2d04537045ff..ef8aad24eccc 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 34454d663f70..962c0a2581fe 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 c27f0f7bb83d..ec5240ddf49e 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 8e3afbdfdc5e..11aed70a7e80 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 fd4665b4542d..4d9c015dca38 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); diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c index 71419616920b..dc6e590a10b2 100644 --- a/libgfortran/runtime/environ.c +++ b/libgfortran/runtime/environ.c @@ -79,7 +79,6 @@ print_spaces (int n) static const char * var_source (variable * v) { - if (getenv (v->name) == NULL) return "Default"; @@ -111,7 +110,7 @@ init_integer (variable * v) *v->var = atoi (p); return; -set_default: + set_default: *v->var = v->value; return; } @@ -122,7 +121,6 @@ set_default: static void show_integer (variable * v) { - st_printf ("%s %d\n", var_source (v), *v->var); } @@ -164,7 +162,6 @@ set_default: static void show_boolean (variable * v) { - st_printf ("%s %s\n", var_source (v), *v->var ? "Yes" : "No"); } @@ -288,7 +285,6 @@ set_default: static void show_sep (variable * v) { - st_printf ("%s \"%s\"\n", var_source (v), options.separator); } @@ -330,31 +326,21 @@ static choice rounding[] = { {"DOWN", FP_ROUND_DOWN}, {"ZERO", FP_ROUND_ZERO}, {NULL} -}, precision[] = +}; + +static choice precision[] = { - { - "24", 1} - , - { - "53", 2} - , - { - "64", 0} - , - { - NULL} -} + { "24", 1}, + { "53", 2}, + { "64", 0}, + { NULL} +}; -, signal_choices[] = +static choice signal_choices[] = { - { - "IGNORE", 1} - , - { - "ABORT", 0} - , - { - NULL} + { "IGNORE", 1}, + { "ABORT", 0}, + { NULL} }; @@ -380,7 +366,7 @@ init_choice (variable * v, choice * c) *v->var = c->value; return; -set_default: + set_default: *v->var = v->value; } @@ -388,7 +374,6 @@ set_default: static void show_choice (variable * v, choice * c) { - st_printf ("%s ", var_source (v)); for (; c->name; c++) @@ -399,7 +384,6 @@ show_choice (variable * v, choice * c) st_printf ("%s\n", c->name); else st_printf ("(Unknown)\n"); - } @@ -408,6 +392,7 @@ init_round (variable * v) { init_choice (v, rounding); } + static void show_round (variable * v) { @@ -419,6 +404,7 @@ init_precision (variable * v) { init_choice (v, precision); } + static void show_precision (variable * v) { @@ -430,6 +416,7 @@ init_signal (variable * v) { init_choice (v, signal_choices); } + static void show_signal (variable * v) { @@ -615,7 +602,8 @@ show_variables (void) char *p, **e; variable *v; int n; -/* TODO: print version number. */ + + /* TODO: print version number. */ st_printf ("GNU Fortran 95 runtime library version " "UNKNOWN" "\n\n"); diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c index 5eb5b0bb31e6..913812c9f516 100644 --- a/libgfortran/runtime/error.c +++ b/libgfortran/runtime/error.c @@ -281,7 +281,6 @@ st_sprintf (char *buffer, const char *format, ...) void show_locus (void) { - if (!options.locus || filename == NULL) return; @@ -300,8 +299,9 @@ recursion_check (void) { static int magic = 0; + /* Don't even try to print something at this point */ if (magic == MAGIC) - sys_exit (4); /* Don't even try to print something at this point */ + sys_exit (4); magic = MAGIC; } @@ -314,12 +314,9 @@ recursion_check (void) void os_error (const char *message) { - recursion_check (); - show_locus (); st_printf ("Operating system error: %s\n%s\n", get_oserror (), message); - sys_exit (1); } @@ -330,12 +327,9 @@ os_error (const char *message) void runtime_error (const char *message) { - recursion_check (); - show_locus (); st_printf ("Fortran runtime error: %s\n", message); - sys_exit (2); } @@ -346,9 +340,7 @@ runtime_error (const char *message) void internal_error (const char *message) { - recursion_check (); - show_locus (); st_printf ("Internal Error: %s\n", message); sys_exit (3); diff --git a/libgfortran/runtime/in_pack_generic.c b/libgfortran/runtime/in_pack_generic.c index 8af4f3f0eb7e..fefac079dbd7 100644 --- a/libgfortran/runtime/in_pack_generic.c +++ b/libgfortran/runtime/in_pack_generic.c @@ -120,4 +120,3 @@ internal_pack (gfc_array_char * source) } return destptr; } - diff --git a/libgfortran/runtime/in_unpack_generic.c b/libgfortran/runtime/in_unpack_generic.c index 82a6771906fd..d468e741ea7a 100644 --- a/libgfortran/runtime/in_unpack_generic.c +++ b/libgfortran/runtime/in_unpack_generic.c @@ -117,4 +117,3 @@ internal_unpack (gfc_array_char * d, const void * s) } } } - diff --git a/libgfortran/runtime/main.c b/libgfortran/runtime/main.c index e3eaf2b2ffcc..4e1f78c93c74 100644 --- a/libgfortran/runtime/main.c +++ b/libgfortran/runtime/main.c @@ -71,7 +71,6 @@ set_args (int argc, char **argv) void get_args (int *argc, char ***argv) { - *argc = argc_save; *argv = argv_save; } @@ -112,4 +111,3 @@ cleanup () { close_units (); } - diff --git a/libgfortran/runtime/memory.c b/libgfortran/runtime/memory.c index 5b146000b8d5..22808483619a 100644 --- a/libgfortran/runtime/memory.c +++ b/libgfortran/runtime/memory.c @@ -65,7 +65,6 @@ static malloc_t mem_root; void memory_init (void) { - /* The root should never be used directly, so don't set the magic. */ mem_root.magic = 0; mem_root.next = &mem_root; @@ -111,7 +110,6 @@ get_mem (size_t n) void free_mem (void *p) { - free (p); } @@ -250,7 +248,6 @@ allocate_size (void **mem, size_t size, GFC_INTEGER_4 * stat) void allocate (void **mem, GFC_INTEGER_4 size, GFC_INTEGER_4 * stat) { - if (size < 0) { runtime_error ("Attempt to allocate negative amount of memory. " @@ -265,7 +262,6 @@ allocate (void **mem, GFC_INTEGER_4 size, GFC_INTEGER_4 * stat) void allocate64 (void **mem, GFC_INTEGER_8 size, GFC_INTEGER_4 * stat) { - if (size < 0) { runtime_error @@ -283,7 +279,6 @@ allocate64 (void **mem, GFC_INTEGER_8 size, GFC_INTEGER_4 * stat) void deallocate (void **mem, GFC_INTEGER_4 * stat) { - if (!mem) runtime_error ("Internal: NULL mem pointer in ALLOCATE."); @@ -309,4 +304,3 @@ deallocate (void **mem, GFC_INTEGER_4 * stat) if (stat) *stat = 0; } - diff --git a/libgfortran/runtime/pause.c b/libgfortran/runtime/pause.c index 9b8447f66c9b..e2d08bea6b30 100644 --- a/libgfortran/runtime/pause.c +++ b/libgfortran/runtime/pause.c @@ -68,4 +68,3 @@ pause_string (char *string, GFC_INTEGER_4 len) do_pause (); } - diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c index bc901bbad96a..ef8741aa748d 100644 --- a/libgfortran/runtime/stop.c +++ b/libgfortran/runtime/stop.c @@ -53,4 +53,3 @@ stop_string (const char *string, GFC_INTEGER_4 len) sys_exit (0); } - diff --git a/libgfortran/runtime/string.c b/libgfortran/runtime/string.c index bcd60928da68..eade7c17a8a1 100644 --- a/libgfortran/runtime/string.c +++ b/libgfortran/runtime/string.c @@ -51,7 +51,6 @@ compare0 (const char *s1, int s1_len, const char *s2) int fstrlen (const char *string, int len) { - for (len--; len >= 0; len--) if (string[len] != ' ') break; @@ -60,11 +59,9 @@ fstrlen (const char *string, int len) } - void fstrcpy (char *dest, int destlen, const char *src, int srclen) { - if (srclen >= destlen) { /* This will truncate if too long. */ @@ -108,7 +105,6 @@ int find_option (const char *s1, int s1_len, st_option * opts, const char *error_message) { - for (; opts->name; opts++) if (compare0 (s1, s1_len, opts->name)) return opts->value; @@ -117,4 +113,3 @@ find_option (const char *s1, int s1_len, st_option * opts, return -1; } - -- 2.43.5