aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/runtime
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-12-06 16:01:01 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-12-06 16:01:01 -0800
commitf21edfd62d267934ad7e9475976719bc41ee7dc3 (patch)
tree379c730c455320b1f8101e6a2c9d24435a6e33b3 /libgfortran/runtime
parent9f91e6cc1610417926374738af0e102187723d59 (diff)
downloadgcc-f21edfd62d267934ad7e9475976719bc41ee7dc3.zip
gcc-f21edfd62d267934ad7e9475976719bc41ee7dc3.tar.gz
gcc-f21edfd62d267934ad7e9475976719bc41ee7dc3.tar.bz2
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
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r--libgfortran/runtime/environ.c50
-rw-r--r--libgfortran/runtime/error.c12
-rw-r--r--libgfortran/runtime/in_pack_generic.c1
-rw-r--r--libgfortran/runtime/in_unpack_generic.c1
-rw-r--r--libgfortran/runtime/main.c2
-rw-r--r--libgfortran/runtime/memory.c6
-rw-r--r--libgfortran/runtime/pause.c1
-rw-r--r--libgfortran/runtime/stop.c1
-rw-r--r--libgfortran/runtime/string.c5
9 files changed, 21 insertions, 58 deletions
diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c
index 7141961..dc6e590 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 5eb5b0b..913812c 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 8af4f3f..fefac07 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 82a6771..d468e74 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 e3eaf2b..4e1f78c 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 5b14600..2280848 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 9b8447f..e2d08be 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 bc901bb..ef8741a 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 bcd6092..eade7c1 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;
}
-