Commit f21edfd6 by Richard Henderson Committed by Richard Henderson

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
parent 9f91e6cc
2004-12-06 Richard Henderson <rth@redhat.com> 2004-12-06 Richard Henderson <rth@redhat.com>
* 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 <rth@redhat.com>
* Makefile.am: Generate all m4 output under $(srcdir). * Makefile.am: Generate all m4 output under $(srcdir).
* Makefile.in: Regenerate. * Makefile.in: Regenerate.
......
...@@ -322,4 +322,3 @@ roundf(float x) ...@@ -322,4 +322,3 @@ roundf(float x)
} }
} }
#endif #endif
...@@ -204,4 +204,3 @@ __eoshift0_8 (gfc_array_char * ret, const gfc_array_char * array, ...@@ -204,4 +204,3 @@ __eoshift0_8 (gfc_array_char * ret, const gfc_array_char * array,
{ {
__eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1); __eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1);
} }
...@@ -220,4 +220,3 @@ __eoshift2_8 (gfc_array_char * ret, const gfc_array_char * array, ...@@ -220,4 +220,3 @@ __eoshift2_8 (gfc_array_char * ret, const gfc_array_char * array,
{ {
__eoshift2 (ret, array, *pshift, bound, pdim ? *pdim : 1); __eoshift2 (ret, array, *pshift, bound, pdim ? *pdim : 1);
} }
...@@ -33,7 +33,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -33,7 +33,6 @@ Boston, MA 02111-1307, USA. */
void void
prefix(exit_i4) (GFC_INTEGER_4 * status) prefix(exit_i4) (GFC_INTEGER_4 * status)
{ {
if (status == NULL) if (status == NULL)
exit(0); exit(0);
exit(*status); exit(*status);
...@@ -42,7 +41,6 @@ prefix(exit_i4) (GFC_INTEGER_4 * status) ...@@ -42,7 +41,6 @@ prefix(exit_i4) (GFC_INTEGER_4 * status)
void void
prefix(exit_i8) (GFC_INTEGER_8 * status) prefix(exit_i8) (GFC_INTEGER_8 * status)
{ {
if (status == NULL) if (status == NULL)
exit(0); exit(0);
exit((int) *status); exit((int) *status);
......
...@@ -48,7 +48,6 @@ recursive_flush (gfc_unit *us) ...@@ -48,7 +48,6 @@ recursive_flush (gfc_unit *us)
void void
prefix(flush_i4) (GFC_INTEGER_4 * unit) prefix(flush_i4) (GFC_INTEGER_4 * unit)
{ {
gfc_unit *us; gfc_unit *us;
/* flush all streams */ /* flush all streams */
......
...@@ -61,4 +61,3 @@ ishftc8 (GFC_INTEGER_8 i, GFC_INTEGER_8 shift, GFC_INTEGER_8 size) ...@@ -61,4 +61,3 @@ ishftc8 (GFC_INTEGER_8 i, GFC_INTEGER_8 shift, GFC_INTEGER_8 size)
bits = i & ~mask; bits = i & ~mask;
return (i & mask) | (bits >> (size - shift)) | ((i << shift) & ~mask); return (i & mask) | (bits >> (size - shift)) | ((i << shift) & ~mask);
} }
...@@ -60,4 +60,3 @@ SUB_NAME (const TYPE *from, const GFC_INTEGER_4 *frompos, ...@@ -60,4 +60,3 @@ SUB_NAME (const TYPE *from, const GFC_INTEGER_4 *frompos,
# undef TYPE # undef TYPE
# undef UTYPE # undef UTYPE
#endif #endif
...@@ -123,7 +123,6 @@ __pack (gfc_array_char * ret, const gfc_array_char * array, ...@@ -123,7 +123,6 @@ __pack (gfc_array_char * ret, const gfc_array_char * array,
if (vector != NULL) if (vector != NULL)
{ {
/* The return array will have as many /* The return array will have as many
elements as there are in VECTOR. */ elements as there are in VECTOR. */
total = vector->dim[0].ubound + 1 - vector->dim[0].lbound; total = vector->dim[0].ubound + 1 - vector->dim[0].lbound;
......
...@@ -485,7 +485,6 @@ prefix(random_r8) (GFC_REAL_8 *x) ...@@ -485,7 +485,6 @@ prefix(random_r8) (GFC_REAL_8 *x)
void void
prefix(arandom_r4) (gfc_array_r4 *x) prefix(arandom_r4) (gfc_array_r4 *x)
{ {
index_type count[GFC_MAX_DIMENSIONS - 1]; index_type count[GFC_MAX_DIMENSIONS - 1];
index_type extent[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1];
index_type stride[GFC_MAX_DIMENSIONS - 1]; index_type stride[GFC_MAX_DIMENSIONS - 1];
...@@ -550,7 +549,6 @@ prefix(arandom_r4) (gfc_array_r4 *x) ...@@ -550,7 +549,6 @@ prefix(arandom_r4) (gfc_array_r4 *x)
void void
prefix(arandom_r8) (gfc_array_r8 *x) prefix(arandom_r8) (gfc_array_r8 *x)
{ {
index_type count[GFC_MAX_DIMENSIONS - 1]; index_type count[GFC_MAX_DIMENSIONS - 1];
index_type extent[GFC_MAX_DIMENSIONS - 1]; index_type extent[GFC_MAX_DIMENSIONS - 1];
index_type stride[GFC_MAX_DIMENSIONS - 1]; index_type stride[GFC_MAX_DIMENSIONS - 1];
...@@ -614,10 +612,8 @@ prefix(arandom_r8) (gfc_array_r8 *x) ...@@ -614,10 +612,8 @@ prefix(arandom_r8) (gfc_array_r8 *x)
must be called with no argument or exactly one argument. */ must be called with no argument or exactly one argument. */
void void
random_seed (GFC_INTEGER_4 *size, gfc_array_i4 * put, random_seed (GFC_INTEGER_4 *size, gfc_array_i4 *put, gfc_array_i4 *get)
gfc_array_i4 * get)
{ {
int i; int i;
if (size == NULL && put == NULL && get == NULL) if (size == NULL && put == NULL && get == NULL)
...@@ -670,5 +666,3 @@ random_seed (GFC_INTEGER_4 *size, gfc_array_i4 * put, ...@@ -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]; get->data[i * get->dim[0].stride] = (GFC_INTEGER_4) kiss_seed[i];
} }
} }
...@@ -228,4 +228,3 @@ __reshape (parray * ret, parray * source, shape_type * shape, ...@@ -228,4 +228,3 @@ __reshape (parray * ret, parray * source, shape_type * shape,
} }
} }
} }
...@@ -50,4 +50,3 @@ index_type size1 (const array_t * array, index_type dim) ...@@ -50,4 +50,3 @@ index_type size1 (const array_t * array, index_type dim)
size = 0; size = 0;
return size; return size;
} }
...@@ -115,4 +115,3 @@ __spread (const gfc_array_char * ret, const gfc_array_char * source, ...@@ -115,4 +115,3 @@ __spread (const gfc_array_char * ret, const gfc_array_char * source,
} }
} }
} }
...@@ -56,7 +56,6 @@ void ...@@ -56,7 +56,6 @@ void
prefix(stat_i4_sub) (char * name, gfc_array_i4 * sarray, prefix(stat_i4_sub) (char * name, gfc_array_i4 * sarray,
GFC_INTEGER_4 * status, gfc_charlen_type name_len) GFC_INTEGER_4 * status, gfc_charlen_type name_len)
{ {
int val; int val;
char *str; char *str;
struct stat sb; struct stat sb;
...@@ -147,7 +146,6 @@ void ...@@ -147,7 +146,6 @@ void
prefix(stat_i8_sub) (char * name, gfc_array_i8 * sarray, prefix(stat_i8_sub) (char * name, gfc_array_i8 * sarray,
GFC_INTEGER_8 * status, gfc_charlen_type name_len) GFC_INTEGER_8 * status, gfc_charlen_type name_len)
{ {
int val; int val;
char *str; char *str;
struct stat sb; struct stat sb;
...@@ -250,7 +248,6 @@ GFC_INTEGER_8 ...@@ -250,7 +248,6 @@ GFC_INTEGER_8
prefix(stat_i8) (char * name, gfc_array_i8 * sarray, prefix(stat_i8) (char * name, gfc_array_i8 * sarray,
gfc_charlen_type name_len) gfc_charlen_type name_len)
{ {
GFC_INTEGER_8 val; GFC_INTEGER_8 val;
prefix(stat_i8_sub) (name, sarray, &val, name_len); prefix(stat_i8_sub) (name, sarray, &val, name_len);
return val; return val;
...@@ -271,7 +268,6 @@ void ...@@ -271,7 +268,6 @@ void
prefix(fstat_i4_sub) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray, prefix(fstat_i4_sub) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray,
GFC_INTEGER_4 * status) GFC_INTEGER_4 * status)
{ {
int val; int val;
struct stat sb; struct stat sb;
...@@ -355,7 +351,6 @@ void ...@@ -355,7 +351,6 @@ void
prefix(fstat_i8_sub) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray, prefix(fstat_i8_sub) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray,
GFC_INTEGER_8 * status) GFC_INTEGER_8 * status)
{ {
int val; int val;
struct stat sb; struct stat sb;
...@@ -439,7 +434,6 @@ prefix(fstat_i8_sub) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray, ...@@ -439,7 +434,6 @@ prefix(fstat_i8_sub) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray,
GFC_INTEGER_4 GFC_INTEGER_4
prefix(fstat_i4) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray) prefix(fstat_i4) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray)
{ {
GFC_INTEGER_4 val; GFC_INTEGER_4 val;
prefix(fstat_i4_sub) (unit, sarray, &val); prefix(fstat_i4_sub) (unit, sarray, &val);
return val; return val;
...@@ -449,7 +443,6 @@ prefix(fstat_i4) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray) ...@@ -449,7 +443,6 @@ prefix(fstat_i4) (GFC_INTEGER_4 * unit, gfc_array_i4 * sarray)
GFC_INTEGER_8 GFC_INTEGER_8
prefix(fstat_i8) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray) prefix(fstat_i8) (GFC_INTEGER_8 * unit, gfc_array_i8 * sarray)
{ {
GFC_INTEGER_8 val; GFC_INTEGER_8 val;
prefix(fstat_i8_sub) (unit, sarray, &val); prefix(fstat_i8_sub) (unit, sarray, &val);
return val; return val;
......
...@@ -168,7 +168,8 @@ concat_string (GFC_INTEGER_4 destlen, char * dest, ...@@ -168,7 +168,8 @@ concat_string (GFC_INTEGER_4 destlen, char * dest,
/* Return string with all trailing blanks removed. */ /* Return string with all trailing blanks removed. */
void 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; int i;
...@@ -392,4 +393,3 @@ string_repeat (char * dest, GFC_INTEGER_4 slen, ...@@ -392,4 +393,3 @@ string_repeat (char * dest, GFC_INTEGER_4 slen,
memmove (dest + (i * slen), src, slen); memmove (dest + (i * slen), src, slen);
} }
} }
...@@ -197,4 +197,3 @@ prefix(system_clock_8)(GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate, ...@@ -197,4 +197,3 @@ prefix(system_clock_8)(GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate,
if (count_max != NULL) if (count_max != NULL)
*count_max = mx; *count_max = mx;
} }
...@@ -88,4 +88,3 @@ __transpose (gfc_array_char * ret, gfc_array_char * source) ...@@ -88,4 +88,3 @@ __transpose (gfc_array_char * ret, gfc_array_char * source)
rptr += rxstride - (rystride * xcount); rptr += rxstride - (rystride * xcount);
} }
} }
...@@ -63,9 +63,7 @@ void ...@@ -63,9 +63,7 @@ void
prefix(unlink_i8_sub) (char * name, GFC_INTEGER_8 * status, prefix(unlink_i8_sub) (char * name, GFC_INTEGER_8 * status,
gfc_charlen_type name_len) gfc_charlen_type name_len)
{ {
GFC_INTEGER_4 status4; GFC_INTEGER_4 status4;
prefix (unlink_i4_sub) (name, &status4, name_len); prefix (unlink_i4_sub) (name, &status4, name_len);
if (status) if (status)
*status = status4; *status = status4;
...@@ -82,4 +80,3 @@ prefix(unlink) (char * name, gfc_charlen_type name_len) ...@@ -82,4 +80,3 @@ prefix(unlink) (char * name, gfc_charlen_type name_len)
prefix(unlink_i4_sub) (name, &status, name_len); prefix(unlink_i4_sub) (name, &status, name_len);
return status; return status;
} }
...@@ -82,7 +82,6 @@ __unpack1 (const gfc_array_char * ret, const gfc_array_char * vector, ...@@ -82,7 +82,6 @@ __unpack1 (const gfc_array_char * ret, const gfc_array_char * vector,
mptr = mask->data; mptr = mask->data;
vptr = vector->data; vptr = vector->data;
/* Use the same loop for both logical types. */ /* Use the same loop for both logical types. */
if (GFC_DESCRIPTOR_SIZE (mask) != 4) if (GFC_DESCRIPTOR_SIZE (mask) != 4)
{ {
...@@ -151,4 +150,3 @@ __unpack0 (const gfc_array_char * ret, const gfc_array_char * vector, ...@@ -151,4 +150,3 @@ __unpack0 (const gfc_array_char * ret, const gfc_array_char * vector,
tmp.data = field; tmp.data = field;
__unpack1 (ret, vector, mask, &tmp); __unpack1 (ret, vector, mask, &tmp);
} }
...@@ -71,9 +71,8 @@ formatted_backspace (void) ...@@ -71,9 +71,8 @@ formatted_backspace (void)
} }
while (base != 0); while (base != 0);
/* base is the new pointer. Seek to it exactly */ /* base is the new pointer. Seek to it exactly */
done:
done:
if (sseek (current_unit->s, base) == FAILURE) if (sseek (current_unit->s, base) == FAILURE)
goto io_error; goto io_error;
current_unit->last_record--; current_unit->last_record--;
...@@ -81,7 +80,7 @@ done: ...@@ -81,7 +80,7 @@ done:
return; return;
io_error: io_error:
generate_error (ERROR_OS, NULL); generate_error (ERROR_OS, NULL);
} }
...@@ -110,7 +109,7 @@ unformatted_backspace (void) ...@@ -110,7 +109,7 @@ unformatted_backspace (void)
current_unit->last_record--; current_unit->last_record--;
return; return;
io_error: io_error:
generate_error (ERROR_OS, NULL); generate_error (ERROR_OS, NULL);
} }
...@@ -156,6 +155,6 @@ st_backspace (void) ...@@ -156,6 +155,6 @@ st_backspace (void)
unformatted_backspace (); unformatted_backspace ();
} }
done: done:
library_end (); library_end ();
} }
...@@ -146,7 +146,6 @@ free_fnode (fnode * f) ...@@ -146,7 +146,6 @@ free_fnode (fnode * f)
void void
free_fnodes (void) free_fnodes (void)
{ {
if (avail - array >= FARRAY_SIZE) if (avail - array >= FARRAY_SIZE)
free_fnode (&array[0]); free_fnode (&array[0]);
...@@ -441,9 +440,8 @@ parse_format_list (void) ...@@ -441,9 +440,8 @@ parse_format_list (void)
head = tail = NULL; head = tail = NULL;
/* Get the next format item */ /* Get the next format item */
format_item:
format_item:
t = format_lex (); t = format_lex ();
switch (t) switch (t)
{ {
...@@ -631,10 +629,9 @@ format_item: ...@@ -631,10 +629,9 @@ format_item:
goto finished; goto finished;
} }
/* In this state, t must currently be a data descriptor. Deal with /* In this state, t must currently be a data descriptor. Deal with
* things that can/must follow the descriptor */ things that can/must follow the descriptor */
data_desc:
data_desc:
switch (t) switch (t)
{ {
case FMT_P: case FMT_P:
...@@ -726,8 +723,7 @@ data_desc: ...@@ -726,8 +723,7 @@ data_desc:
tail->u.real.e = -1; tail->u.real.e = -1;
/* Look for optional exponent */ /* Look for optional exponent */
t = format_lex (); t = format_lex ();
if (t != FMT_E) if (t != FMT_E)
saved_token = t; saved_token = t;
...@@ -822,8 +818,8 @@ data_desc: ...@@ -822,8 +818,8 @@ data_desc:
goto finished; goto finished;
} }
/* Between a descriptor and what comes next */ /* Between a descriptor and what comes next */
between_desc: between_desc:
t = format_lex (); t = format_lex ();
switch (t) switch (t)
{ {
...@@ -851,10 +847,9 @@ between_desc: ...@@ -851,10 +847,9 @@ between_desc:
goto finished; goto finished;
} }
/* Optional comma is a weird between state where we've just finished /* Optional comma is a weird between state where we've just finished
* reading a colon, slash or P descriptor. */ reading a colon, slash or P descriptor. */
optional_comma:
optional_comma:
t = format_lex (); t = format_lex ();
switch (t) switch (t)
{ {
...@@ -871,7 +866,7 @@ optional_comma: ...@@ -871,7 +866,7 @@ optional_comma:
goto format_item; goto format_item;
finished: finished:
return head; return head;
} }
...@@ -935,20 +930,19 @@ format_error (fnode * f, const char *message) ...@@ -935,20 +930,19 @@ format_error (fnode * f, const char *message)
void void
parse_format (void) parse_format (void)
{ {
format_string = ioparm.format; format_string = ioparm.format;
format_string_len = ioparm.format_len; format_string_len = ioparm.format_len;
saved_token = FMT_NONE; saved_token = FMT_NONE;
error = NULL; error = NULL;
/* Initialize variables used during traversal of the tree */ /* Initialize variables used during traversal of the tree */
reversion_ok = 0; reversion_ok = 0;
g.reversion_flag = 0; g.reversion_flag = 0;
saved_format = NULL; 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; avail = array;
...@@ -1082,8 +1076,7 @@ next_format (void) ...@@ -1082,8 +1076,7 @@ next_format (void)
} }
/* If this is a data edit descriptor, then reversion has become OK. */ /* If this is a data edit descriptor, then reversion has become OK. */
done:
done:
t = f->format; t = f->format;
if (!reversion_ok && if (!reversion_ok &&
...@@ -1105,7 +1098,6 @@ done: ...@@ -1105,7 +1098,6 @@ done:
void void
unget_format (fnode * f) unget_format (fnode * f)
{ {
saved_format = f; saved_format = f;
} }
...@@ -1248,7 +1240,6 @@ dump_format0 (fnode * f) ...@@ -1248,7 +1240,6 @@ dump_format0 (fnode * f)
static void static void
dump_format1 (fnode * f) dump_format1 (fnode * f)
{ {
for (; f; f = f->next) for (; f; f = f->next)
dump_format1 (f); dump_format1 (f);
} }
...@@ -1258,7 +1249,6 @@ dump_format1 (fnode * f) ...@@ -1258,7 +1249,6 @@ dump_format1 (fnode * f)
void void
dump_format (void) dump_format (void)
{ {
st_printf ("format = "); st_printf ("format = ");
dump_format0 (&array[0]); dump_format0 (&array[0]);
st_printf ("\n"); st_printf ("\n");
......
...@@ -107,7 +107,6 @@ push_char (char c) ...@@ -107,7 +107,6 @@ push_char (char c)
static void static void
free_saved (void) free_saved (void)
{ {
if (saved_string == NULL) if (saved_string == NULL)
return; return;
...@@ -165,7 +164,6 @@ done: ...@@ -165,7 +164,6 @@ done:
static void static void
unget_char (char c) unget_char (char c)
{ {
last_char = c; last_char = c;
} }
...@@ -253,7 +251,7 @@ finish_separator (void) ...@@ -253,7 +251,7 @@ finish_separator (void)
{ {
char c; char c;
restart: restart:
eat_spaces (); eat_spaces ();
c = next_char (); c = next_char ();
...@@ -354,7 +352,7 @@ convert_integer (int length, int negative) ...@@ -354,7 +352,7 @@ convert_integer (int length, int negative)
free_saved (); free_saved ();
return m; return m;
overflow: overflow:
if (length == -1) if (length == -1)
st_sprintf (message, "Repeat count overflow in item %d of list input", st_sprintf (message, "Repeat count overflow in item %d of list input",
g.item_count); g.item_count);
...@@ -434,11 +432,11 @@ parse_repeat (void) ...@@ -434,11 +432,11 @@ parse_repeat (void)
} }
} }
done: done:
repeat_count = repeat; repeat_count = repeat;
return 0; return 0;
bad_repeat: bad_repeat:
st_sprintf (message, "Bad repeat count in item %d of list input", st_sprintf (message, "Bad repeat count in item %d of list input",
g.item_count); g.item_count);
...@@ -514,7 +512,7 @@ read_logical (int length) ...@@ -514,7 +512,7 @@ read_logical (int length)
return; return;
bad_logical: bad_logical:
st_sprintf (message, "Bad logical value while reading item %d", st_sprintf (message, "Bad logical value while reading item %d",
g.item_count); g.item_count);
...@@ -582,7 +580,7 @@ read_integer (int length) ...@@ -582,7 +580,7 @@ read_integer (int length)
} }
} }
repeat: repeat:
if (convert_integer (-1, 0)) if (convert_integer (-1, 0))
return; return;
...@@ -608,7 +606,7 @@ repeat: ...@@ -608,7 +606,7 @@ repeat:
break; break;
} }
get_integer: get_integer:
if (!isdigit (c)) if (!isdigit (c))
goto bad_integer; goto bad_integer;
push_char (c); push_char (c);
...@@ -630,7 +628,7 @@ get_integer: ...@@ -630,7 +628,7 @@ get_integer:
} }
} }
bad_integer: bad_integer:
free_saved (); free_saved ();
st_sprintf (message, "Bad integer for item %d in list input", g.item_count); st_sprintf (message, "Bad integer for item %d in list input", g.item_count);
...@@ -638,7 +636,7 @@ bad_integer: ...@@ -638,7 +636,7 @@ bad_integer:
return; return;
done: done:
unget_char (c); unget_char (c);
eat_separator (); eat_separator ();
...@@ -710,7 +708,7 @@ read_character (int length) ...@@ -710,7 +708,7 @@ read_character (int length)
} }
} }
got_repeat: got_repeat:
if (convert_integer (-1, 0)) if (convert_integer (-1, 0))
return; return;
...@@ -734,7 +732,7 @@ got_repeat: ...@@ -734,7 +732,7 @@ got_repeat:
break; break;
} }
get_string: get_string:
for (;;) for (;;)
{ {
c = next_char (); c = next_char ();
...@@ -778,10 +776,9 @@ get_string: ...@@ -778,10 +776,9 @@ get_string:
} }
} }
/* At this point, we have to have a separator, or else the string is /* At this point, we have to have a separator, or else the string is
invalid. */ invalid. */
done:
done:
c = next_char (); c = next_char ();
if (is_separator (c)) if (is_separator (c))
{ {
...@@ -861,7 +858,7 @@ parse_real (void *buffer, int length) ...@@ -861,7 +858,7 @@ parse_real (void *buffer, int length)
} }
} }
exp1: exp1:
c = next_char (); c = next_char ();
if (c != '-' && c != '+') if (c != '-' && c != '+')
push_char ('+'); push_char ('+');
...@@ -871,7 +868,7 @@ exp1: ...@@ -871,7 +868,7 @@ exp1:
c = next_char (); c = next_char ();
} }
exp2: exp2:
if (!isdigit (c)) if (!isdigit (c))
goto bad; goto bad;
push_char (c); push_char (c);
...@@ -894,7 +891,7 @@ exp2: ...@@ -894,7 +891,7 @@ exp2:
} }
} }
done: done:
unget_char (c); unget_char (c);
push_char ('\0'); push_char ('\0');
...@@ -903,7 +900,7 @@ done: ...@@ -903,7 +900,7 @@ done:
return m; return m;
bad: bad:
free_saved (); free_saved ();
st_sprintf (message, "Bad floating point number for item %d", g.item_count); st_sprintf (message, "Bad floating point number for item %d", g.item_count);
generate_error (ERROR_READ_VALUE, message); generate_error (ERROR_READ_VALUE, message);
...@@ -966,7 +963,7 @@ read_complex (int length) ...@@ -966,7 +963,7 @@ read_complex (int length)
saved_type = BT_COMPLEX; saved_type = BT_COMPLEX;
return; return;
bad_complex: bad_complex:
st_sprintf (message, "Bad complex value in item %d of list input", st_sprintf (message, "Bad complex value in item %d of list input",
g.item_count); g.item_count);
...@@ -1055,7 +1052,7 @@ read_real (int length) ...@@ -1055,7 +1052,7 @@ read_real (int length)
} }
} }
got_repeat: got_repeat:
if (convert_integer (-1, 0)) if (convert_integer (-1, 0))
return; return;
...@@ -1091,7 +1088,7 @@ got_repeat: ...@@ -1091,7 +1088,7 @@ got_repeat:
push_char (c); push_char (c);
real_loop: real_loop:
for (;;) for (;;)
{ {
c = next_char (); c = next_char ();
...@@ -1130,7 +1127,7 @@ real_loop: ...@@ -1130,7 +1127,7 @@ real_loop:
} }
} }
exp1: exp1:
push_char ('e'); push_char ('e');
c = next_char (); c = next_char ();
...@@ -1142,7 +1139,7 @@ exp1: ...@@ -1142,7 +1139,7 @@ exp1:
c = next_char (); c = next_char ();
} }
exp2: exp2:
if (!isdigit (c)) if (!isdigit (c))
goto bad_real; goto bad_real;
push_char (c); push_char (c);
...@@ -1167,7 +1164,7 @@ exp2: ...@@ -1167,7 +1164,7 @@ exp2:
} }
} }
done: done:
push_char ('\0'); push_char ('\0');
if (convert_real (value, saved_string, length)) if (convert_real (value, saved_string, length))
return; return;
...@@ -1176,7 +1173,7 @@ done: ...@@ -1176,7 +1173,7 @@ done:
saved_type = BT_REAL; saved_type = BT_REAL;
return; return;
bad_real: bad_real:
st_sprintf (message, "Bad real number in item %d of list input", st_sprintf (message, "Bad real number in item %d of list input",
g.item_count); g.item_count);
...@@ -1281,7 +1278,6 @@ list_formatted_read (bt type, void *p, int len) ...@@ -1281,7 +1278,6 @@ list_formatted_read (bt type, void *p, int len)
repeat_count = 1; repeat_count = 1;
} }
switch (type) switch (type)
{ {
case BT_INTEGER: case BT_INTEGER:
...@@ -1309,7 +1305,7 @@ list_formatted_read (bt type, void *p, int len) ...@@ -1309,7 +1305,7 @@ list_formatted_read (bt type, void *p, int len)
if (ioparm.library_return != LIBRARY_OK) if (ioparm.library_return != LIBRARY_OK)
return; return;
set_value: set_value:
switch (saved_type) switch (saved_type)
{ {
case BT_COMPLEX: case BT_COMPLEX:
...@@ -1345,7 +1341,7 @@ set_value: ...@@ -1345,7 +1341,7 @@ set_value:
} }
void void
init_at_eol() init_at_eol(void)
{ {
at_eol = 0; at_eol = 0;
} }
...@@ -1365,7 +1361,6 @@ finish_list_read (void) ...@@ -1365,7 +1361,6 @@ finish_list_read (void)
return; return;
} }
do do
{ {
c = next_char (); c = next_char ();
...@@ -1440,7 +1435,7 @@ namelist_read (void) ...@@ -1440,7 +1435,7 @@ namelist_read (void)
return; return;
} }
restart: restart:
c = next_char (); c = next_char ();
switch (c) switch (c)
{ {
......
...@@ -34,7 +34,6 @@ global_t g; ...@@ -34,7 +34,6 @@ global_t g;
void void
library_start (void) library_start (void)
{ {
if (g.in_library) if (g.in_library)
internal_error ("Recursive library calls not allowed"); internal_error ("Recursive library calls not allowed");
...@@ -81,4 +80,3 @@ library_end (void) ...@@ -81,4 +80,3 @@ library_end (void)
memset (&ioparm, '\0', sizeof (ioparm)); memset (&ioparm, '\0', sizeof (ioparm));
ioparm.library_return = t; ioparm.library_return = t;
} }
...@@ -30,106 +30,61 @@ static st_option access_opt[] = { ...@@ -30,106 +30,61 @@ static st_option access_opt[] = {
{"sequential", ACCESS_SEQUENTIAL}, {"sequential", ACCESS_SEQUENTIAL},
{"direct", ACCESS_DIRECT}, {"direct", ACCESS_DIRECT},
{NULL} {NULL}
}, action_opt[] = };
static st_option action_opt[] =
{ {
{ { "read", ACTION_READ},
"read", ACTION_READ} { "write", ACTION_WRITE},
, { "readwrite", ACTION_READWRITE},
{ { NULL}
"write", ACTION_WRITE} };
,
{
"readwrite", ACTION_READWRITE}
,
{
NULL}
}
, blank_opt[] = static st_option blank_opt[] =
{ {
{ { "null", BLANK_NULL},
"null", BLANK_NULL} { "zero", BLANK_ZERO},
, { NULL}
{ };
"zero", BLANK_ZERO}
,
{
NULL}
}
, delim_opt[] = static st_option delim_opt[] =
{ {
{ { "none", DELIM_NONE},
"none", DELIM_NONE} { "apostrophe", DELIM_APOSTROPHE},
, { "quote", DELIM_QUOTE},
{ { NULL}
"apostrophe", DELIM_APOSTROPHE} };
,
{
"quote", DELIM_QUOTE}
,
{
NULL}
}
, form_opt[] = static st_option form_opt[] =
{ {
{ { "formatted", FORM_FORMATTED},
"formatted", FORM_FORMATTED} { "unformatted", FORM_UNFORMATTED},
, { NULL}
{ };
"unformatted", FORM_UNFORMATTED}
,
{
NULL}
}
, position_opt[] = static st_option position_opt[] =
{ {
{ { "asis", POSITION_ASIS},
"asis", POSITION_ASIS} { "rewind", POSITION_REWIND},
, { "append", POSITION_APPEND},
{ { NULL}
"rewind", POSITION_REWIND} };
,
{
"append", POSITION_APPEND}
,
{
NULL}
}
, status_opt[] = static st_option status_opt[] =
{ {
{ { "unknown", STATUS_UNKNOWN},
"unknown", STATUS_UNKNOWN} { "old", STATUS_OLD},
, { "new", STATUS_NEW},
{ { "replace", STATUS_REPLACE},
"old", STATUS_OLD} { "scratch", STATUS_SCRATCH},
, { NULL}
{ };
"new", STATUS_NEW}
,
{
"replace", STATUS_REPLACE}
,
{
"scratch", STATUS_SCRATCH}
,
{
NULL}
}
, pad_opt[] = static st_option pad_opt[] =
{ {
{ { "yes", PAD_YES},
"yes", PAD_YES} { "no", PAD_NO},
, { NULL}
{
"no", PAD_NO}
,
{
NULL}
}; };
...@@ -141,7 +96,6 @@ static st_option access_opt[] = { ...@@ -141,7 +96,6 @@ static st_option access_opt[] = {
void void
test_endfile (gfc_unit * u) test_endfile (gfc_unit * u)
{ {
if (u->endfile == NO_ENDFILE && file_length (u->s) == file_position (u->s)) if (u->endfile == NO_ENDFILE && file_length (u->s) == file_position (u->s))
u->endfile = AT_ENDFILE; u->endfile = AT_ENDFILE;
} }
...@@ -153,7 +107,6 @@ test_endfile (gfc_unit * u) ...@@ -153,7 +107,6 @@ test_endfile (gfc_unit * u)
static void static void
edit_modes (gfc_unit * u, unit_flags * flags) edit_modes (gfc_unit * u, unit_flags * flags)
{ {
/* Complain about attempts to change the unchangeable. */ /* Complain about attempts to change the unchangeable. */
if (flags->status != STATUS_UNSPECIFIED && if (flags->status != STATUS_UNSPECIFIED &&
...@@ -416,7 +369,7 @@ new_unit (unit_flags * flags) ...@@ -416,7 +369,7 @@ new_unit (unit_flags * flags)
test_endfile (u); test_endfile (u);
cleanup: cleanup:
/* Free memory associated with a temporary filename. */ /* Free memory associated with a temporary filename. */
...@@ -431,7 +384,6 @@ cleanup: ...@@ -431,7 +384,6 @@ cleanup:
static void static void
already_open (gfc_unit * u, unit_flags * flags) already_open (gfc_unit * u, unit_flags * flags)
{ {
if (ioparm.file == NULL) if (ioparm.file == NULL)
{ {
edit_modes (u, flags); edit_modes (u, flags);
......
...@@ -36,7 +36,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -36,7 +36,6 @@ Boston, MA 02111-1307, USA. */
void void
set_integer (void *dest, int64_t value, int length) set_integer (void *dest, int64_t value, int length)
{ {
switch (length) switch (length)
{ {
case 8: case 8:
...@@ -95,7 +94,6 @@ max_value (int length, int signed_flag) ...@@ -95,7 +94,6 @@ max_value (int length, int signed_flag)
int int
convert_real (void *dest, const char *buffer, int length) convert_real (void *dest, const char *buffer, int length)
{ {
errno = 0; errno = 0;
switch (length) switch (length)
...@@ -204,7 +202,6 @@ read_a (fnode * f, char *p, int length) ...@@ -204,7 +202,6 @@ read_a (fnode * f, char *p, int length)
static char * static char *
eat_leading_spaces (int *width, char *p) eat_leading_spaces (int *width, char *p)
{ {
for (;;) for (;;)
{ {
if (*width == 0 || *p != ' ') if (*width == 0 || *p != ' ')
...@@ -325,11 +322,11 @@ read_decimal (fnode * f, char *dest, int length) ...@@ -325,11 +322,11 @@ read_decimal (fnode * f, char *dest, int length)
set_integer (dest, v, length); set_integer (dest, v, length);
return; return;
bad: bad:
generate_error (ERROR_READ_VALUE, "Bad value during integer read"); generate_error (ERROR_READ_VALUE, "Bad value during integer read");
return; return;
overflow: overflow:
generate_error (ERROR_READ_OVERFLOW, generate_error (ERROR_READ_OVERFLOW,
"Value overflowed during integer read"); "Value overflowed during integer read");
return; return;
...@@ -461,11 +458,11 @@ read_radix (fnode * f, char *dest, int length, int radix) ...@@ -461,11 +458,11 @@ read_radix (fnode * f, char *dest, int length, int radix)
set_integer (dest, v, length); set_integer (dest, v, length);
return; return;
bad: bad:
generate_error (ERROR_READ_VALUE, "Bad value during integer read"); generate_error (ERROR_READ_VALUE, "Bad value during integer read");
return; return;
overflow: overflow:
generate_error (ERROR_READ_OVERFLOW, generate_error (ERROR_READ_OVERFLOW,
"Value overflowed during integer read"); "Value overflowed during integer read");
return; return;
...@@ -588,20 +585,18 @@ read_f (fnode * f, char *dest, int length) ...@@ -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; exponent = -g.scale_factor;
goto done; goto done;
bad_float: bad_float:
generate_error (ERROR_READ_VALUE, "Bad value during floating point read"); generate_error (ERROR_READ_VALUE, "Bad value during floating point read");
if (buffer != scratch) if (buffer != scratch)
free_mem (buffer); free_mem (buffer);
return; return;
/* At this point the start of an exponent has been found */ /* At this point the start of an exponent has been found */
exp1:
exp1:
while (w > 0 && *p == ' ') while (w > 0 && *p == ' ')
{ {
w--; w--;
...@@ -623,11 +618,10 @@ exp1: ...@@ -623,11 +618,10 @@ exp1:
if (w == 0) if (w == 0)
goto bad_float; goto bad_float;
/* At this point a digit string is required. We calculate the value /* 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 of the exponent in order to take account of the scale factor and
the d parameter before explict conversion takes place. */ the d parameter before explict conversion takes place. */
exp2:
exp2:
if (!isdigit (*p)) if (!isdigit (*p))
goto bad_float; goto bad_float;
...@@ -654,7 +648,7 @@ exp2: ...@@ -654,7 +648,7 @@ exp2:
exponent = exponent * exponent_sign; exponent = exponent * exponent_sign;
done: done:
/* Use the precision specified in the format if no decimal point has been /* Use the precision specified in the format if no decimal point has been
seen. */ seen. */
if (!seen_dp) if (!seen_dp)
......
...@@ -745,16 +745,14 @@ formatted_transfer (bt type, void *p, int len) ...@@ -745,16 +745,14 @@ formatted_transfer (bt type, void *p, int len)
return; return;
/* Come here when we need a data descriptor but don't have one. We /* 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 push the current format node back onto the input, then return and
let the user program call us back with the data. */ let the user program call us back with the data. */
need_data:
need_data:
unget_format (f); unget_format (f);
} }
/* Data transfer entry points. The type of the data entity is /* Data transfer entry points. The type of the data entity is
implicit in the subroutine call. This prevents us from having to implicit in the subroutine call. This prevents us from having to
share a common enum with the compiler. */ share a common enum with the compiler. */
...@@ -762,7 +760,6 @@ need_data: ...@@ -762,7 +760,6 @@ need_data:
void void
transfer_integer (void *p, int kind) transfer_integer (void *p, int kind)
{ {
g.item_count++; g.item_count++;
if (ioparm.library_return != LIBRARY_OK) if (ioparm.library_return != LIBRARY_OK)
return; return;
...@@ -773,7 +770,6 @@ transfer_integer (void *p, int kind) ...@@ -773,7 +770,6 @@ transfer_integer (void *p, int kind)
void void
transfer_real (void *p, int kind) transfer_real (void *p, int kind)
{ {
g.item_count++; g.item_count++;
if (ioparm.library_return != LIBRARY_OK) if (ioparm.library_return != LIBRARY_OK)
return; return;
...@@ -784,7 +780,6 @@ transfer_real (void *p, int kind) ...@@ -784,7 +780,6 @@ transfer_real (void *p, int kind)
void void
transfer_logical (void *p, int kind) transfer_logical (void *p, int kind)
{ {
g.item_count++; g.item_count++;
if (ioparm.library_return != LIBRARY_OK) if (ioparm.library_return != LIBRARY_OK)
return; return;
...@@ -795,7 +790,6 @@ transfer_logical (void *p, int kind) ...@@ -795,7 +790,6 @@ transfer_logical (void *p, int kind)
void void
transfer_character (void *p, int len) transfer_character (void *p, int len)
{ {
g.item_count++; g.item_count++;
if (ioparm.library_return != LIBRARY_OK) if (ioparm.library_return != LIBRARY_OK)
return; return;
...@@ -806,7 +800,6 @@ transfer_character (void *p, int len) ...@@ -806,7 +800,6 @@ transfer_character (void *p, int len)
void void
transfer_complex (void *p, int kind) transfer_complex (void *p, int kind)
{ {
g.item_count++; g.item_count++;
if (ioparm.library_return != LIBRARY_OK) if (ioparm.library_return != LIBRARY_OK)
return; return;
...@@ -873,7 +866,6 @@ us_write (void) ...@@ -873,7 +866,6 @@ us_write (void)
static void static void
pre_position (void) pre_position (void)
{ {
if (current_unit->current_record) if (current_unit->current_record)
return; /* Already positioned. */ return; /* Already positioned. */
...@@ -1140,9 +1132,7 @@ data_transfer_init (int read_flag) ...@@ -1140,9 +1132,7 @@ data_transfer_init (int read_flag)
/* Start the data transfer if we are doing a formatted transfer. */ /* Start the data transfer if we are doing a formatted transfer. */
if (current_unit->flags.form == FORM_FORMATTED && !ioparm.list_format if (current_unit->flags.form == FORM_FORMATTED && !ioparm.list_format
&& ioparm.namelist_name == NULL && ionml == NULL) && 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) ...@@ -1198,7 +1188,6 @@ next_record_r (int done)
current_unit->bytes_left -= length; current_unit->bytes_left -= length;
} }
} }
break; break;
case FORMATTED_SEQUENTIAL: case FORMATTED_SEQUENTIAL:
...@@ -1367,7 +1356,6 @@ next_record (int done) ...@@ -1367,7 +1356,6 @@ next_record (int done)
static void static void
finalize_transfer (void) finalize_transfer (void)
{ {
if ((ionml != NULL) && (ioparm.namelist_name != NULL)) if ((ionml != NULL) && (ioparm.namelist_name != NULL))
{ {
if (ioparm.namelist_read_mode) if (ioparm.namelist_read_mode)
...@@ -1429,7 +1417,6 @@ iolength_transfer (bt type, void *dest, int len) ...@@ -1429,7 +1417,6 @@ iolength_transfer (bt type, void *dest, int len)
static void static void
iolength_transfer_init (void) iolength_transfer_init (void)
{ {
if (ioparm.iolength != NULL) if (ioparm.iolength != NULL)
*ioparm.iolength = 0; *ioparm.iolength = 0;
...@@ -1438,7 +1425,6 @@ iolength_transfer_init (void) ...@@ -1438,7 +1425,6 @@ iolength_transfer_init (void)
/* Set up the subroutine that will handle the transfers. */ /* Set up the subroutine that will handle the transfers. */
transfer = iolength_transfer; transfer = iolength_transfer;
} }
...@@ -1451,7 +1437,6 @@ void ...@@ -1451,7 +1437,6 @@ void
st_iolength (void) st_iolength (void)
{ {
library_start (); library_start ();
iolength_transfer_init (); iolength_transfer_init ();
} }
...@@ -1467,7 +1452,6 @@ st_iolength_done (void) ...@@ -1467,7 +1452,6 @@ st_iolength_done (void)
void void
st_read (void) st_read (void)
{ {
library_start (); library_start ();
data_transfer_init (1); data_transfer_init (1);
...@@ -1502,7 +1486,6 @@ void ...@@ -1502,7 +1486,6 @@ void
st_read_done (void) st_read_done (void)
{ {
finalize_transfer (); finalize_transfer ();
library_end (); library_end ();
} }
...@@ -1510,7 +1493,6 @@ st_read_done (void) ...@@ -1510,7 +1493,6 @@ st_read_done (void)
void void
st_write (void) st_write (void)
{ {
library_start (); library_start ();
data_transfer_init (0); data_transfer_init (0);
} }
...@@ -1519,7 +1501,6 @@ st_write (void) ...@@ -1519,7 +1501,6 @@ st_write (void)
void void
st_write_done (void) st_write_done (void)
{ {
finalize_transfer (); finalize_transfer ();
/* Deal with endfile conditions associated with sequential files. */ /* Deal with endfile conditions associated with sequential files. */
...@@ -1590,7 +1571,6 @@ void ...@@ -1590,7 +1571,6 @@ void
st_set_nml_var_int (void * var_addr, char * var_name, int var_name_len, st_set_nml_var_int (void * var_addr, char * var_name, int var_name_len,
int kind) int kind)
{ {
st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_INTEGER, 0); st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_INTEGER, 0);
} }
...@@ -1598,7 +1578,6 @@ void ...@@ -1598,7 +1578,6 @@ void
st_set_nml_var_float (void * var_addr, char * var_name, int var_name_len, st_set_nml_var_float (void * var_addr, char * var_name, int var_name_len,
int kind) int kind)
{ {
st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_REAL, 0); st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_REAL, 0);
} }
...@@ -1606,7 +1585,6 @@ void ...@@ -1606,7 +1585,6 @@ void
st_set_nml_var_char (void * var_addr, char * var_name, int var_name_len, st_set_nml_var_char (void * var_addr, char * var_name, int var_name_len,
int kind, gfc_charlen_type string_length) int kind, gfc_charlen_type string_length)
{ {
st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_CHARACTER, st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_CHARACTER,
string_length); string_length);
} }
...@@ -1615,7 +1593,6 @@ void ...@@ -1615,7 +1593,6 @@ void
st_set_nml_var_complex (void * var_addr, char * var_name, int var_name_len, st_set_nml_var_complex (void * var_addr, char * var_name, int var_name_len,
int kind) int kind)
{ {
st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_COMPLEX, 0); st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_COMPLEX, 0);
} }
...@@ -1623,7 +1600,5 @@ void ...@@ -1623,7 +1600,5 @@ void
st_set_nml_var_log (void * var_addr, char * var_name, int var_name_len, st_set_nml_var_log (void * var_addr, char * var_name, int var_name_len,
int kind) int kind)
{ {
st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_LOGICAL, 0); st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_LOGICAL, 0);
} }
...@@ -181,8 +181,8 @@ fix_fd (int fd) ...@@ -181,8 +181,8 @@ fix_fd (int fd)
input = output = error = 0; input = output = error = 0;
/* Unix allocates the lowest descriptors first, so a loop is not /* Unix allocates the lowest descriptors first, so a loop is not
* required, but this order is. */ required, but this order is. */
if (fd == STDIN_FILENO) if (fd == STDIN_FILENO)
{ {
...@@ -271,7 +271,6 @@ readn (int fd, char *buffer, int len) ...@@ -271,7 +271,6 @@ readn (int fd, char *buffer, int len)
const char * const char *
get_oserror (void) get_oserror (void)
{ {
return strerror (errno); return strerror (errno);
} }
...@@ -281,7 +280,6 @@ get_oserror (void) ...@@ -281,7 +280,6 @@ get_oserror (void)
void void
sys_exit (int code) sys_exit (int code)
{ {
exit (code); exit (code);
} }
...@@ -295,7 +293,6 @@ sys_exit (int code) ...@@ -295,7 +293,6 @@ sys_exit (int code)
static try static try
fd_flush (unix_stream * s) fd_flush (unix_stream * s)
{ {
if (s->ndirty == 0) if (s->ndirty == 0)
return SUCCESS;; return SUCCESS;;
...@@ -476,7 +473,6 @@ fd_alloc_w_at (unix_stream * s, int *len, gfc_offset where) ...@@ -476,7 +473,6 @@ fd_alloc_w_at (unix_stream * s, int *len, gfc_offset where)
static try static try
fd_sfree (unix_stream * s) fd_sfree (unix_stream * s)
{ {
if (s->ndirty != 0 && if (s->ndirty != 0 &&
(s->buffer != s->small_buffer || options.all_unbuffered || (s->buffer != s->small_buffer || options.all_unbuffered ||
s->unbuffered)) s->unbuffered))
...@@ -489,7 +485,6 @@ fd_sfree (unix_stream * s) ...@@ -489,7 +485,6 @@ fd_sfree (unix_stream * s)
static int static int
fd_seek (unix_stream * s, gfc_offset offset) fd_seek (unix_stream * s, gfc_offset offset)
{ {
s->physical_offset = s->logical_offset = offset; s->physical_offset = s->logical_offset = offset;
return (lseek (s->fd, offset, SEEK_SET) < 0) ? FAILURE : SUCCESS; return (lseek (s->fd, offset, SEEK_SET) < 0) ? FAILURE : SUCCESS;
...@@ -503,7 +498,6 @@ fd_seek (unix_stream * s, gfc_offset offset) ...@@ -503,7 +498,6 @@ fd_seek (unix_stream * s, gfc_offset offset)
static try static try
fd_truncate (unix_stream * s) fd_truncate (unix_stream * s)
{ {
if (lseek (s->fd, s->logical_offset, SEEK_SET) == -1) if (lseek (s->fd, s->logical_offset, SEEK_SET) == -1)
return FAILURE; return FAILURE;
...@@ -511,9 +505,7 @@ fd_truncate (unix_stream * s) ...@@ -511,9 +505,7 @@ fd_truncate (unix_stream * s)
the fd is a regular file at this point */ the fd is a regular file at this point */
if (ftruncate (s->fd, s->logical_offset)) if (ftruncate (s->fd, s->logical_offset))
{
return FAILURE; return FAILURE;
}
s->physical_offset = s->file_length = s->logical_offset; s->physical_offset = s->file_length = s->logical_offset;
...@@ -524,7 +516,6 @@ fd_truncate (unix_stream * s) ...@@ -524,7 +516,6 @@ fd_truncate (unix_stream * s)
static try static try
fd_close (unix_stream * s) fd_close (unix_stream * s)
{ {
if (fd_flush (s) == FAILURE) if (fd_flush (s) == FAILURE)
return FAILURE; return FAILURE;
...@@ -543,7 +534,6 @@ fd_close (unix_stream * s) ...@@ -543,7 +534,6 @@ fd_close (unix_stream * s)
static void static void
fd_open (unix_stream * s) fd_open (unix_stream * s)
{ {
if (isatty (s->fd)) if (isatty (s->fd))
s->unbuffered = 1; s->unbuffered = 1;
...@@ -578,7 +568,6 @@ static int page_size, page_mask; ...@@ -578,7 +568,6 @@ static int page_size, page_mask;
static try static try
mmap_flush (unix_stream * s) mmap_flush (unix_stream * s)
{ {
if (!s->mmaped) if (!s->mmaped)
return fd_flush (s); return fd_flush (s);
...@@ -683,7 +672,6 @@ mmap_alloc_w_at (unix_stream * s, int *len, gfc_offset where) ...@@ -683,7 +672,6 @@ mmap_alloc_w_at (unix_stream * s, int *len, gfc_offset where)
static int static int
mmap_seek (unix_stream * s, gfc_offset offset) mmap_seek (unix_stream * s, gfc_offset offset)
{ {
s->logical_offset = offset; s->logical_offset = offset;
return SUCCESS; return SUCCESS;
} }
...@@ -707,7 +695,6 @@ mmap_close (unix_stream * s) ...@@ -707,7 +695,6 @@ mmap_close (unix_stream * s)
static try static try
mmap_sfree (unix_stream * s) mmap_sfree (unix_stream * s)
{ {
return SUCCESS; return SUCCESS;
} }
...@@ -810,7 +797,6 @@ mem_alloc_w_at (unix_stream * s, int *len, gfc_offset where) ...@@ -810,7 +797,6 @@ mem_alloc_w_at (unix_stream * s, int *len, gfc_offset where)
static int static int
mem_seek (unix_stream * s, gfc_offset offset) mem_seek (unix_stream * s, gfc_offset offset)
{ {
if (offset > s->file_length) if (offset > s->file_length)
{ {
errno = ESPIPE; errno = ESPIPE;
...@@ -825,7 +811,6 @@ mem_seek (unix_stream * s, gfc_offset offset) ...@@ -825,7 +811,6 @@ mem_seek (unix_stream * s, gfc_offset offset)
static int static int
mem_truncate (unix_stream * s) mem_truncate (unix_stream * s)
{ {
return SUCCESS; return SUCCESS;
} }
...@@ -842,7 +827,6 @@ mem_close (unix_stream * s) ...@@ -842,7 +827,6 @@ mem_close (unix_stream * s)
static try static try
mem_sfree (unix_stream * s) mem_sfree (unix_stream * s)
{ {
return SUCCESS; return SUCCESS;
} }
...@@ -858,8 +842,8 @@ mem_sfree (unix_stream * s) ...@@ -858,8 +842,8 @@ mem_sfree (unix_stream * s)
void void
empty_internal_buffer(stream *strm) empty_internal_buffer(stream *strm)
{ {
unix_stream * s = (unix_stream *) strm; unix_stream * s = (unix_stream *) strm;
memset(s->buffer, ' ', s->file_length); memset(s->buffer, ' ', s->file_length);
} }
/* open_internal()-- Returns a stream structure from an internal file */ /* open_internal()-- Returns a stream structure from an internal file */
...@@ -925,7 +909,6 @@ fd_to_stream (int fd, int prot) ...@@ -925,7 +909,6 @@ fd_to_stream (int fd, int prot)
int int
unit_to_fd(int unit) unit_to_fd(int unit)
{ {
gfc_unit *us; gfc_unit *us;
us = find_unit(unit); us = find_unit(unit);
...@@ -943,7 +926,6 @@ unit_to_fd(int unit) ...@@ -943,7 +926,6 @@ unit_to_fd(int unit)
static int static int
unpack_filename (char *cstring, const char *fstring, int len) unpack_filename (char *cstring, const char *fstring, int len)
{ {
len = fstrlen (fstring, len); len = fstrlen (fstring, len);
if (len >= PATH_MAX) if (len >= PATH_MAX)
return 1; return 1;
...@@ -1065,7 +1047,7 @@ regular_file (unit_action action, unit_status status) ...@@ -1065,7 +1047,7 @@ regular_file (unit_action action, unit_status status)
internal_error ("regular_file(): Bad status"); internal_error ("regular_file(): Bad status");
} }
// mode |= O_LARGEFILE; /* mode |= O_LARGEFILE; */
return open (path, mode, return open (path, mode,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
...@@ -1121,7 +1103,6 @@ open_external (unit_action action, unit_status status) ...@@ -1121,7 +1103,6 @@ open_external (unit_action action, unit_status status)
stream * stream *
input_stream (void) input_stream (void)
{ {
return fd_to_stream (STDIN_FILENO, PROT_READ); return fd_to_stream (STDIN_FILENO, PROT_READ);
} }
...@@ -1132,7 +1113,6 @@ input_stream (void) ...@@ -1132,7 +1113,6 @@ input_stream (void)
stream * stream *
output_stream (void) output_stream (void)
{ {
return fd_to_stream (STDOUT_FILENO, PROT_WRITE); return fd_to_stream (STDOUT_FILENO, PROT_WRITE);
} }
...@@ -1386,7 +1366,6 @@ inquire_formatted (const char *string, int len) ...@@ -1386,7 +1366,6 @@ inquire_formatted (const char *string, int len)
const char * const char *
inquire_unformatted (const char *string, int len) inquire_unformatted (const char *string, int len)
{ {
return inquire_formatted (string, len); return inquire_formatted (string, len);
} }
...@@ -1413,7 +1392,6 @@ inquire_access (const char *string, int len, int mode) ...@@ -1413,7 +1392,6 @@ inquire_access (const char *string, int len, int mode)
const char * const char *
inquire_read (const char *string, int len) inquire_read (const char *string, int len)
{ {
return inquire_access (string, len, R_OK); return inquire_access (string, len, R_OK);
} }
...@@ -1424,7 +1402,6 @@ inquire_read (const char *string, int len) ...@@ -1424,7 +1402,6 @@ inquire_read (const char *string, int len)
const char * const char *
inquire_write (const char *string, int len) inquire_write (const char *string, int len)
{ {
return inquire_access (string, len, W_OK); return inquire_access (string, len, W_OK);
} }
...@@ -1435,7 +1412,6 @@ inquire_write (const char *string, int len) ...@@ -1435,7 +1412,6 @@ inquire_write (const char *string, int len)
const char * const char *
inquire_readwrite (const char *string, int len) inquire_readwrite (const char *string, int len)
{ {
return inquire_access (string, len, R_OK | W_OK); return inquire_access (string, len, R_OK | W_OK);
} }
...@@ -1445,7 +1421,6 @@ inquire_readwrite (const char *string, int len) ...@@ -1445,7 +1421,6 @@ inquire_readwrite (const char *string, int len)
gfc_offset gfc_offset
file_length (stream * s) file_length (stream * s)
{ {
return ((unix_stream *) s)->file_length; return ((unix_stream *) s)->file_length;
} }
...@@ -1455,7 +1430,6 @@ file_length (stream * s) ...@@ -1455,7 +1430,6 @@ file_length (stream * s)
gfc_offset gfc_offset
file_position (stream * s) file_position (stream * s)
{ {
return ((unix_stream *) s)->logical_offset; return ((unix_stream *) s)->logical_offset;
} }
......
...@@ -780,7 +780,7 @@ write_int (fnode *f, const char *source, int len, char *(*conv) (uint64_t)) ...@@ -780,7 +780,7 @@ write_int (fnode *f, const char *source, int len, char *(*conv) (uint64_t))
memcpy (p, q, digits); memcpy (p, q, digits);
done: done:
return; return;
} }
...@@ -865,7 +865,7 @@ write_decimal (fnode *f, const char *source, int len, char *(*conv) (int64_t)) ...@@ -865,7 +865,7 @@ write_decimal (fnode *f, const char *source, int len, char *(*conv) (int64_t))
memcpy (p, q, digits); memcpy (p, q, digits);
done: done:
return; return;
} }
...@@ -928,7 +928,6 @@ btoa (uint64_t n) ...@@ -928,7 +928,6 @@ btoa (uint64_t n)
void void
write_i (fnode * f, const char *p, int len) write_i (fnode * f, const char *p, int len)
{ {
write_decimal (f, p, len, (void *) itoa); write_decimal (f, p, len, (void *) itoa);
} }
...@@ -936,7 +935,6 @@ write_i (fnode * f, const char *p, int len) ...@@ -936,7 +935,6 @@ write_i (fnode * f, const char *p, int len)
void void
write_b (fnode * f, const char *p, int len) write_b (fnode * f, const char *p, int len)
{ {
write_int (f, p, len, btoa); write_int (f, p, len, btoa);
} }
...@@ -944,14 +942,12 @@ write_b (fnode * f, const char *p, int len) ...@@ -944,14 +942,12 @@ write_b (fnode * f, const char *p, int len)
void void
write_o (fnode * f, const char *p, int len) write_o (fnode * f, const char *p, int len)
{ {
write_int (f, p, len, otoa); write_int (f, p, len, otoa);
} }
void void
write_z (fnode * f, const char *p, int len) write_z (fnode * f, const char *p, int len)
{ {
write_int (f, p, len, xtoa); write_int (f, p, len, xtoa);
} }
...@@ -959,7 +955,6 @@ write_z (fnode * f, const char *p, int len) ...@@ -959,7 +955,6 @@ write_z (fnode * f, const char *p, int len)
void void
write_d (fnode *f, const char *p, int len) write_d (fnode *f, const char *p, int len)
{ {
write_float (f, p, len); write_float (f, p, len);
} }
...@@ -967,7 +962,6 @@ write_d (fnode *f, const char *p, int len) ...@@ -967,7 +962,6 @@ write_d (fnode *f, const char *p, int len)
void void
write_e (fnode *f, const char *p, int len) write_e (fnode *f, const char *p, int len)
{ {
write_float (f, p, len); write_float (f, p, len);
} }
...@@ -975,7 +969,6 @@ write_e (fnode *f, const char *p, int len) ...@@ -975,7 +969,6 @@ write_e (fnode *f, const char *p, int len)
void void
write_f (fnode *f, const char *p, int len) write_f (fnode *f, const char *p, int len)
{ {
write_float (f, p, len); write_float (f, p, len);
} }
...@@ -983,7 +976,6 @@ write_f (fnode *f, const char *p, int len) ...@@ -983,7 +976,6 @@ write_f (fnode *f, const char *p, int len)
void void
write_en (fnode *f, const char *p, int len) write_en (fnode *f, const char *p, int len)
{ {
write_float (f, p, len); write_float (f, p, len);
} }
...@@ -991,7 +983,6 @@ write_en (fnode *f, const char *p, int len) ...@@ -991,7 +983,6 @@ write_en (fnode *f, const char *p, int len)
void void
write_es (fnode *f, const char *p, int len) write_es (fnode *f, const char *p, int len)
{ {
write_float (f, p, len); write_float (f, p, len);
} }
...@@ -1172,7 +1163,6 @@ write_real (const char *source, int length) ...@@ -1172,7 +1163,6 @@ write_real (const char *source, int length)
static void static void
write_complex (const char *source, int len) write_complex (const char *source, int len)
{ {
if (write_char ('(')) if (write_char ('('))
return; return;
write_real (source, len); write_real (source, len);
......
...@@ -79,7 +79,6 @@ print_spaces (int n) ...@@ -79,7 +79,6 @@ print_spaces (int n)
static const char * static const char *
var_source (variable * v) var_source (variable * v)
{ {
if (getenv (v->name) == NULL) if (getenv (v->name) == NULL)
return "Default"; return "Default";
...@@ -111,7 +110,7 @@ init_integer (variable * v) ...@@ -111,7 +110,7 @@ init_integer (variable * v)
*v->var = atoi (p); *v->var = atoi (p);
return; return;
set_default: set_default:
*v->var = v->value; *v->var = v->value;
return; return;
} }
...@@ -122,7 +121,6 @@ set_default: ...@@ -122,7 +121,6 @@ set_default:
static void static void
show_integer (variable * v) show_integer (variable * v)
{ {
st_printf ("%s %d\n", var_source (v), *v->var); st_printf ("%s %d\n", var_source (v), *v->var);
} }
...@@ -164,7 +162,6 @@ set_default: ...@@ -164,7 +162,6 @@ set_default:
static void static void
show_boolean (variable * v) show_boolean (variable * v)
{ {
st_printf ("%s %s\n", var_source (v), *v->var ? "Yes" : "No"); st_printf ("%s %s\n", var_source (v), *v->var ? "Yes" : "No");
} }
...@@ -288,7 +285,6 @@ set_default: ...@@ -288,7 +285,6 @@ set_default:
static void static void
show_sep (variable * v) show_sep (variable * v)
{ {
st_printf ("%s \"%s\"\n", var_source (v), options.separator); st_printf ("%s \"%s\"\n", var_source (v), options.separator);
} }
...@@ -330,31 +326,21 @@ static choice rounding[] = { ...@@ -330,31 +326,21 @@ static choice rounding[] = {
{"DOWN", FP_ROUND_DOWN}, {"DOWN", FP_ROUND_DOWN},
{"ZERO", FP_ROUND_ZERO}, {"ZERO", FP_ROUND_ZERO},
{NULL} {NULL}
}, precision[] = };
static choice precision[] =
{ {
{ { "24", 1},
"24", 1} { "53", 2},
, { "64", 0},
{ { NULL}
"53", 2} };
,
{
"64", 0}
,
{
NULL}
}
, signal_choices[] = static choice signal_choices[] =
{ {
{ { "IGNORE", 1},
"IGNORE", 1} { "ABORT", 0},
, { NULL}
{
"ABORT", 0}
,
{
NULL}
}; };
...@@ -380,7 +366,7 @@ init_choice (variable * v, choice * c) ...@@ -380,7 +366,7 @@ init_choice (variable * v, choice * c)
*v->var = c->value; *v->var = c->value;
return; return;
set_default: set_default:
*v->var = v->value; *v->var = v->value;
} }
...@@ -388,7 +374,6 @@ set_default: ...@@ -388,7 +374,6 @@ set_default:
static void static void
show_choice (variable * v, choice * c) show_choice (variable * v, choice * c)
{ {
st_printf ("%s ", var_source (v)); st_printf ("%s ", var_source (v));
for (; c->name; c++) for (; c->name; c++)
...@@ -399,7 +384,6 @@ show_choice (variable * v, choice * c) ...@@ -399,7 +384,6 @@ show_choice (variable * v, choice * c)
st_printf ("%s\n", c->name); st_printf ("%s\n", c->name);
else else
st_printf ("(Unknown)\n"); st_printf ("(Unknown)\n");
} }
...@@ -408,6 +392,7 @@ init_round (variable * v) ...@@ -408,6 +392,7 @@ init_round (variable * v)
{ {
init_choice (v, rounding); init_choice (v, rounding);
} }
static void static void
show_round (variable * v) show_round (variable * v)
{ {
...@@ -419,6 +404,7 @@ init_precision (variable * v) ...@@ -419,6 +404,7 @@ init_precision (variable * v)
{ {
init_choice (v, precision); init_choice (v, precision);
} }
static void static void
show_precision (variable * v) show_precision (variable * v)
{ {
...@@ -430,6 +416,7 @@ init_signal (variable * v) ...@@ -430,6 +416,7 @@ init_signal (variable * v)
{ {
init_choice (v, signal_choices); init_choice (v, signal_choices);
} }
static void static void
show_signal (variable * v) show_signal (variable * v)
{ {
...@@ -615,7 +602,8 @@ show_variables (void) ...@@ -615,7 +602,8 @@ show_variables (void)
char *p, **e; char *p, **e;
variable *v; variable *v;
int n; int n;
/* TODO: print version number. */
/* TODO: print version number. */
st_printf ("GNU Fortran 95 runtime library version " st_printf ("GNU Fortran 95 runtime library version "
"UNKNOWN" "\n\n"); "UNKNOWN" "\n\n");
......
...@@ -281,7 +281,6 @@ st_sprintf (char *buffer, const char *format, ...) ...@@ -281,7 +281,6 @@ st_sprintf (char *buffer, const char *format, ...)
void void
show_locus (void) show_locus (void)
{ {
if (!options.locus || filename == NULL) if (!options.locus || filename == NULL)
return; return;
...@@ -300,8 +299,9 @@ recursion_check (void) ...@@ -300,8 +299,9 @@ recursion_check (void)
{ {
static int magic = 0; static int magic = 0;
/* Don't even try to print something at this point */
if (magic == MAGIC) if (magic == MAGIC)
sys_exit (4); /* Don't even try to print something at this point */ sys_exit (4);
magic = MAGIC; magic = MAGIC;
} }
...@@ -314,12 +314,9 @@ recursion_check (void) ...@@ -314,12 +314,9 @@ recursion_check (void)
void void
os_error (const char *message) os_error (const char *message)
{ {
recursion_check (); recursion_check ();
show_locus (); show_locus ();
st_printf ("Operating system error: %s\n%s\n", get_oserror (), message); st_printf ("Operating system error: %s\n%s\n", get_oserror (), message);
sys_exit (1); sys_exit (1);
} }
...@@ -330,12 +327,9 @@ os_error (const char *message) ...@@ -330,12 +327,9 @@ os_error (const char *message)
void void
runtime_error (const char *message) runtime_error (const char *message)
{ {
recursion_check (); recursion_check ();
show_locus (); show_locus ();
st_printf ("Fortran runtime error: %s\n", message); st_printf ("Fortran runtime error: %s\n", message);
sys_exit (2); sys_exit (2);
} }
...@@ -346,9 +340,7 @@ runtime_error (const char *message) ...@@ -346,9 +340,7 @@ runtime_error (const char *message)
void void
internal_error (const char *message) internal_error (const char *message)
{ {
recursion_check (); recursion_check ();
show_locus (); show_locus ();
st_printf ("Internal Error: %s\n", message); st_printf ("Internal Error: %s\n", message);
sys_exit (3); sys_exit (3);
......
...@@ -120,4 +120,3 @@ internal_pack (gfc_array_char * source) ...@@ -120,4 +120,3 @@ internal_pack (gfc_array_char * source)
} }
return destptr; return destptr;
} }
...@@ -117,4 +117,3 @@ internal_unpack (gfc_array_char * d, const void * s) ...@@ -117,4 +117,3 @@ internal_unpack (gfc_array_char * d, const void * s)
} }
} }
} }
...@@ -71,7 +71,6 @@ set_args (int argc, char **argv) ...@@ -71,7 +71,6 @@ set_args (int argc, char **argv)
void void
get_args (int *argc, char ***argv) get_args (int *argc, char ***argv)
{ {
*argc = argc_save; *argc = argc_save;
*argv = argv_save; *argv = argv_save;
} }
...@@ -112,4 +111,3 @@ cleanup () ...@@ -112,4 +111,3 @@ cleanup ()
{ {
close_units (); close_units ();
} }
...@@ -65,7 +65,6 @@ static malloc_t mem_root; ...@@ -65,7 +65,6 @@ static malloc_t mem_root;
void void
memory_init (void) memory_init (void)
{ {
/* The root should never be used directly, so don't set the magic. */ /* The root should never be used directly, so don't set the magic. */
mem_root.magic = 0; mem_root.magic = 0;
mem_root.next = &mem_root; mem_root.next = &mem_root;
...@@ -111,7 +110,6 @@ get_mem (size_t n) ...@@ -111,7 +110,6 @@ get_mem (size_t n)
void void
free_mem (void *p) free_mem (void *p)
{ {
free (p); free (p);
} }
...@@ -250,7 +248,6 @@ allocate_size (void **mem, size_t size, GFC_INTEGER_4 * stat) ...@@ -250,7 +248,6 @@ allocate_size (void **mem, size_t size, GFC_INTEGER_4 * stat)
void void
allocate (void **mem, GFC_INTEGER_4 size, GFC_INTEGER_4 * stat) allocate (void **mem, GFC_INTEGER_4 size, GFC_INTEGER_4 * stat)
{ {
if (size < 0) if (size < 0)
{ {
runtime_error ("Attempt to allocate negative amount of memory. " runtime_error ("Attempt to allocate negative amount of memory. "
...@@ -265,7 +262,6 @@ allocate (void **mem, GFC_INTEGER_4 size, GFC_INTEGER_4 * stat) ...@@ -265,7 +262,6 @@ allocate (void **mem, GFC_INTEGER_4 size, GFC_INTEGER_4 * stat)
void void
allocate64 (void **mem, GFC_INTEGER_8 size, GFC_INTEGER_4 * stat) allocate64 (void **mem, GFC_INTEGER_8 size, GFC_INTEGER_4 * stat)
{ {
if (size < 0) if (size < 0)
{ {
runtime_error runtime_error
...@@ -283,7 +279,6 @@ allocate64 (void **mem, GFC_INTEGER_8 size, GFC_INTEGER_4 * stat) ...@@ -283,7 +279,6 @@ allocate64 (void **mem, GFC_INTEGER_8 size, GFC_INTEGER_4 * stat)
void void
deallocate (void **mem, GFC_INTEGER_4 * stat) deallocate (void **mem, GFC_INTEGER_4 * stat)
{ {
if (!mem) if (!mem)
runtime_error ("Internal: NULL mem pointer in ALLOCATE."); runtime_error ("Internal: NULL mem pointer in ALLOCATE.");
...@@ -309,4 +304,3 @@ deallocate (void **mem, GFC_INTEGER_4 * stat) ...@@ -309,4 +304,3 @@ deallocate (void **mem, GFC_INTEGER_4 * stat)
if (stat) if (stat)
*stat = 0; *stat = 0;
} }
...@@ -68,4 +68,3 @@ pause_string (char *string, GFC_INTEGER_4 len) ...@@ -68,4 +68,3 @@ pause_string (char *string, GFC_INTEGER_4 len)
do_pause (); do_pause ();
} }
...@@ -53,4 +53,3 @@ stop_string (const char *string, GFC_INTEGER_4 len) ...@@ -53,4 +53,3 @@ stop_string (const char *string, GFC_INTEGER_4 len)
sys_exit (0); sys_exit (0);
} }
...@@ -51,7 +51,6 @@ compare0 (const char *s1, int s1_len, const char *s2) ...@@ -51,7 +51,6 @@ compare0 (const char *s1, int s1_len, const char *s2)
int int
fstrlen (const char *string, int len) fstrlen (const char *string, int len)
{ {
for (len--; len >= 0; len--) for (len--; len >= 0; len--)
if (string[len] != ' ') if (string[len] != ' ')
break; break;
...@@ -60,11 +59,9 @@ fstrlen (const char *string, int len) ...@@ -60,11 +59,9 @@ fstrlen (const char *string, int len)
} }
void void
fstrcpy (char *dest, int destlen, const char *src, int srclen) fstrcpy (char *dest, int destlen, const char *src, int srclen)
{ {
if (srclen >= destlen) if (srclen >= destlen)
{ {
/* This will truncate if too long. */ /* This will truncate if too long. */
...@@ -108,7 +105,6 @@ int ...@@ -108,7 +105,6 @@ int
find_option (const char *s1, int s1_len, st_option * opts, find_option (const char *s1, int s1_len, st_option * opts,
const char *error_message) const char *error_message)
{ {
for (; opts->name; opts++) for (; opts->name; opts++)
if (compare0 (s1, s1_len, opts->name)) if (compare0 (s1, s1_len, opts->name))
return opts->value; return opts->value;
...@@ -117,4 +113,3 @@ find_option (const char *s1, int s1_len, st_option * opts, ...@@ -117,4 +113,3 @@ find_option (const char *s1, int s1_len, st_option * opts,
return -1; return -1;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment