aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2014-12-06 17:53:40 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2014-12-06 17:53:40 +0100
commitb5a9fd3e94138512e2f999316baff7790e971174 (patch)
tree8369147574da962e24299e1fff567fb21c97cfa5
parent0f447a6e33db466cb8b04fc3583ed76626ca8f3b (diff)
downloadgcc-b5a9fd3e94138512e2f999316baff7790e971174.zip
gcc-b5a9fd3e94138512e2f999316baff7790e971174.tar.gz
gcc-b5a9fd3e94138512e2f999316baff7790e971174.tar.bz2
error.c (gfc_error_check): Use bool not int.
2014-12-06 Tobias Burnus <burnus@net-b.de> * error.c (gfc_error_check): Use bool not int. * gfortran.h (gfc_error_check): Update prototype. * match.c (gfc_match_if): Update call. * parse.c (decode_statement, decode_omp_directive, decode_gcc_attribute): Ditto. From-SVN: r218450
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/error.c10
-rw-r--r--gcc/fortran/gfortran.h2
-rw-r--r--gcc/fortran/match.c2
-rw-r--r--gcc/fortran/parse.c6
5 files changed, 17 insertions, 11 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 137303c..f7afb17 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,4 +1,12 @@
2014-12-06 Tobias Burnus <burnus@net-b.de>
+
+ * error.c (gfc_error_check): Use bool not int.
+ * gfortran.h (gfc_error_check): Update prototype.
+ * match.c (gfc_match_if): Update call.
+ * parse.c (decode_statement, decode_omp_directive,
+ decode_gcc_attribute): Ditto.
+
+2014-12-06 Tobias Burnus <burnus@net-b.de>
Manuel López-Ibáñez <manu@gcc.gnu.org>
* error.c (gfc_buffer_error, gfc_error_flag_test): Use bool not int.
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index db4bcf3..a93c7f9 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -1440,14 +1440,12 @@ gfc_error_flag_test (void)
/* Check to see if any errors have been saved.
If so, print the error. Returns the state of error_flag. */
-int
+bool
gfc_error_check (void)
{
- int rc;
-
- rc = error_buffer.flag;
+ bool error_raised = (bool) error_buffer.flag;
- if (error_buffer.flag)
+ if (error_raised)
{
if (error_buffer.message != NULL)
fputs (error_buffer.message, stderr);
@@ -1459,7 +1457,7 @@ gfc_error_check (void)
exit (FATAL_EXIT_CODE);
}
- return rc;
+ return error_raised;
}
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 02e78f7..0ed42d0 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2688,7 +2688,7 @@ void gfc_error_now (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
void gfc_fatal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC(1,2);
void gfc_internal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC(1,2);
void gfc_clear_error (void);
-int gfc_error_check (void);
+bool gfc_error_check (void);
bool gfc_error_flag_test (void);
notification gfc_notification_std (int);
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 06f1e94..3b81a46 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -1497,7 +1497,7 @@ gfc_match_if (gfc_statement *if_type)
/* All else has failed, so give up. See if any of the matchers has
stored an error message of some sort. */
- if (gfc_error_check () == 0)
+ if (!gfc_error_check ())
gfc_error ("Unclassifiable statement in IF-clause at %C");
gfc_free_expr (expr);
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 1023037..e39a550 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -549,7 +549,7 @@ decode_statement (void)
/* All else has failed, so give up. See if any of the matchers has
stored an error message of some sort. */
- if (gfc_error_check () == 0)
+ if (!gfc_error_check ())
gfc_error_now ("Unclassifiable statement at %C");
reject_statement ();
@@ -769,7 +769,7 @@ decode_omp_directive (void)
if (gfc_option.gfc_flag_openmp || simd_matched)
{
- if (gfc_error_check () == 0)
+ if (!gfc_error_check ())
gfc_error_now ("Unclassifiable OpenMP directive at %C");
}
@@ -796,7 +796,7 @@ decode_gcc_attribute (void)
/* All else has failed, so give up. See if any of the matchers has
stored an error message of some sort. */
- if (gfc_error_check () == 0)
+ if (!gfc_error_check ())
gfc_error_now ("Unclassifiable GCC directive at %C");
reject_statement ();