summaryrefslogtreecommitdiff
path: root/gcc/fortran/misc.c
diff options
context:
space:
mode:
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-20 22:01:41 +0000
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-20 22:01:41 +0000
commit1bcc6eb868641c9ec5b9172a08c3ae3cfb4b6a32 (patch)
treea5e1dd4c7002a6118aa4d0e313e2d22c3b3aa8ad /gcc/fortran/misc.c
parent9c0ec44ae572cfa18b218fff7359b63e4a97142a (diff)
downloadgcc-1bcc6eb868641c9ec5b9172a08c3ae3cfb4b6a32.tar.gz
* openmp.c, matchexp.c, module.c, scanner.c, resolve.c, st.c,
parse.c, primary.c, options.c, misc.c, simplify.c: Next installment in the massive whitespace patch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121012 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/misc.c')
-rw-r--r--gcc/fortran/misc.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/gcc/fortran/misc.c b/gcc/fortran/misc.c
index dbf27e2218a..bdc515c6094 100644
--- a/gcc/fortran/misc.c
+++ b/gcc/fortran/misc.c
@@ -1,6 +1,6 @@
/* Miscellaneous stuff that doesn't fit anywhere else.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
- Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -20,12 +20,10 @@ along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
-
#include "config.h"
#include "system.h"
#include "gfortran.h"
-
/* Get a block of memory. Many callers assume that the memory we
return is zeroed. */
@@ -54,7 +52,6 @@ gfc_getmem (size_t n)
void
gfc_free (void *p)
{
-
if (p != NULL)
free (p);
}
@@ -63,10 +60,10 @@ gfc_free (void *p)
#undef temp
-/* Get terminal width */
+/* Get terminal width. */
int
-gfc_terminal_width(void)
+gfc_terminal_width (void)
{
return 80;
}
@@ -75,9 +72,8 @@ gfc_terminal_width(void)
/* Initialize a typespec to unknown. */
void
-gfc_clear_ts (gfc_typespec * ts)
+gfc_clear_ts (gfc_typespec *ts)
{
-
ts->type = BT_UNKNOWN;
ts->kind = 0;
ts->derived = NULL;
@@ -154,9 +150,9 @@ gfc_basic_typename (bt type)
the argument list of a single statement. */
const char *
-gfc_typename (gfc_typespec * ts)
+gfc_typename (gfc_typespec *ts)
{
- static char buffer1[60], buffer2[60];
+ static char buffer1[60], buffer2[60]; /* FIXME: Buffer overflow. */
static int flag = 0;
char *buffer;
@@ -204,9 +200,8 @@ gfc_typename (gfc_typespec * ts)
returning a pointer to the string. */
const char *
-gfc_code2string (const mstring * m, int code)
+gfc_code2string (const mstring *m, int code)
{
-
while (m->string != NULL)
{
if (m->tag == code)
@@ -220,13 +215,11 @@ gfc_code2string (const mstring * m, int code)
/* Given an mstring array and a string, returns the value of the tag
- field. Returns the final tag if no matches to the string are
- found. */
+ field. Returns the final tag if no matches to the string are found. */
int
-gfc_string2code (const mstring * m, const char *string)
+gfc_string2code (const mstring *m, const char *string)
{
-
for (; m->string != NULL; m++)
if (strcmp (m->string, string) == 0)
return m->tag;
@@ -237,10 +230,10 @@ gfc_string2code (const mstring * m, const char *string)
/* Convert an intent code to a string. */
/* TODO: move to gfortran.h as define. */
+
const char *
gfc_intent_string (sym_intent i)
{
-
return gfc_code2string (intents, i);
}
@@ -265,7 +258,6 @@ gfc_init_1 (void)
void
gfc_init_2 (void)
{
-
gfc_symbol_init_2 ();
gfc_module_init_2 ();
}
@@ -289,7 +281,6 @@ gfc_done_1 (void)
void
gfc_done_2 (void)
{
-
gfc_symbol_done_2 ();
gfc_module_done_2 ();
}