aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/scanner.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2013-04-11 00:36:58 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2013-04-11 00:36:58 +0300
commit524af0d6c72031c249aa737945fde6ac3d726ba2 (patch)
tree3848fcd998968ff83378e8ad827c05578ce1d1fb /gcc/fortran/scanner.c
parent0ea8a6f9c72e6e8bf22a0f6da9295aed27e1ca1e (diff)
downloadgcc-524af0d6c72031c249aa737945fde6ac3d726ba2.zip
gcc-524af0d6c72031c249aa737945fde6ac3d726ba2.tar.gz
gcc-524af0d6c72031c249aa737945fde6ac3d726ba2.tar.bz2
Replace enum gfc_try with bool type.
2013-04-11 Janne Blomqvist <jb@gcc.gnu.org> * gfortran.h: Remove enum gfc_try, replace gfc_try with bool type. * arith.c: Replace gfc_try with bool type. * array.c: Likewise. * check.c: Likewise. * class.c: Likewise. * cpp.c: Likewise. * cpp.h: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * f95-lang.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * io.c: Likewise. * match.c: Likewise. * match.h: Likewise. * module.c: Likewise. * openmp.c: Likewise. * parse.c: Likewise. * parse.h: Likewise. * primary.c: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * symbol.c: Likewise. * trans-intrinsic.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. From-SVN: r197682
Diffstat (limited to 'gcc/fortran/scanner.c')
-rw-r--r--gcc/fortran/scanner.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index f714ed0..fd8f284 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -326,7 +326,7 @@ add_path_to_list (gfc_directorylist **list, const char *path,
q = (char *) alloca (len + 1);
memcpy (q, p, len + 1);
i = len - 1;
- while (i >=0 && IS_DIR_SEPARATOR(q[i]))
+ while (i >=0 && IS_DIR_SEPARATOR (q[i]))
q[i--] = '\0';
if (stat (q, &st))
@@ -1123,7 +1123,7 @@ restart:
else
gfc_advance_line ();
- if (gfc_at_eof())
+ if (gfc_at_eof ())
goto not_continuation;
/* We've got a continuation line. If we are on the very next line after
@@ -1831,7 +1831,7 @@ preprocessor_line (gfc_char_t *c)
}
-static gfc_try load_file (const char *, const char *, bool);
+static bool load_file (const char *, const char *, bool);
/* include_line()-- Checks a line buffer to see if it is an include
line. If so, we call load_file() recursively to load the included
@@ -1902,7 +1902,7 @@ include_line (gfc_char_t *line)
read by anything else. */
filename = gfc_widechar_to_char (begin, -1);
- if (load_file (filename, NULL, false) == FAILURE)
+ if (!load_file (filename, NULL, false))
exit (FATAL_EXIT_CODE);
free (filename);
@@ -1912,7 +1912,7 @@ include_line (gfc_char_t *line)
/* Load a file into memory by calling load_line until the file ends. */
-static gfc_try
+static bool
load_file (const char *realfilename, const char *displayedname, bool initial)
{
gfc_char_t *line;
@@ -1936,7 +1936,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
fprintf (stderr, "%s:%d: Error: File '%s' is being included "
"recursively\n", current_file->filename, current_file->line,
filename);
- return FAILURE;
+ return false;
}
if (initial)
@@ -1951,7 +1951,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
if (input == NULL)
{
gfc_error_now ("Can't open file '%s'", filename);
- return FAILURE;
+ return false;
}
}
else
@@ -1961,7 +1961,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
{
fprintf (stderr, "%s:%d: Error: Can't open included file '%s'\n",
current_file->filename, current_file->line, filename);
- return FAILURE;
+ return false;
}
}
@@ -2096,19 +2096,19 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
add_file_change (NULL, current_file->inclusion_line + 1);
current_file = current_file->up;
linemap_add (line_table, LC_LEAVE, 0, NULL, 0);
- return SUCCESS;
+ return true;
}
-/* Open a new file and start scanning from that file. Returns SUCCESS
- if everything went OK, FAILURE otherwise. If form == FORM_UNKNOWN
+/* Open a new file and start scanning from that file. Returns true
+ if everything went OK, false otherwise. If form == FORM_UNKNOWN
it tries to determine the source form from the filename, defaulting
to free form. */
-gfc_try
+bool
gfc_new_file (void)
{
- gfc_try result;
+ bool result;
if (gfc_cpp_enabled ())
{