summaryrefslogtreecommitdiff
path: root/gcc/fortran/data.c
diff options
context:
space:
mode:
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-10 21:36:58 +0000
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-10 21:36:58 +0000
commit60e19868d71a7dc7681ebeb8e519ba65e6bdc919 (patch)
tree3848fcd998968ff83378e8ad827c05578ce1d1fb /gcc/fortran/data.c
parenta1adea345cf252d6240a4d29b0d47e592e610df9 (diff)
downloadgcc-60e19868d71a7dc7681ebeb8e519ba65e6bdc919.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197682 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/data.c')
-rw-r--r--gcc/fortran/data.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c
index 6aaa3157e32..f297ef56faf 100644
--- a/gcc/fortran/data.c
+++ b/gcc/fortran/data.c
@@ -129,8 +129,8 @@ create_character_initializer (gfc_expr *init, gfc_typespec *ts,
start_expr = gfc_copy_expr (ref->u.ss.start);
end_expr = gfc_copy_expr (ref->u.ss.end);
- if ((gfc_simplify_expr (start_expr, 1) == FAILURE)
- || (gfc_simplify_expr (end_expr, 1)) == FAILURE)
+ if ((!gfc_simplify_expr(start_expr, 1))
+ || !(gfc_simplify_expr(end_expr, 1)))
{
gfc_error ("failure to simplify substring reference in DATA "
"statement at %L", &ref->u.ss.start->where);
@@ -196,7 +196,7 @@ create_character_initializer (gfc_expr *init, gfc_typespec *ts,
consecutive values in LVALUE the same value in RVALUE. In that case,
LVALUE must refer to a full array, not an array section. */
-gfc_try
+bool
gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
mpz_t *repeat)
{
@@ -283,7 +283,7 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
&& ref->next == NULL);
mpz_init_set (end, offset);
mpz_add (end, end, *repeat);
- if (spec_size (ref->u.ar.as, &size) == SUCCESS)
+ if (spec_size (ref->u.ar.as, &size))
{
if (mpz_cmp (end, size) > 0)
{
@@ -319,8 +319,8 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
? con->expr : rvalue;
if (gfc_notify_std (GFC_STD_GNU,
"re-initialization of '%s' at %L",
- symbol->name, &exprd->where) == FAILURE)
- return FAILURE;
+ symbol->name, &exprd->where) == false)
+ return false;
}
while (con != NULL)
@@ -372,7 +372,7 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
else
{
mpz_t size;
- if (spec_size (ref->u.ar.as, &size) == SUCCESS)
+ if (spec_size (ref->u.ar.as, &size))
{
if (mpz_cmp (offset, size) >= 0)
{
@@ -468,7 +468,7 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
if (ref || last_ts->type == BT_CHARACTER)
{
if (lvalue->ts.u.cl->length == NULL && !(ref && ref->u.ss.length != NULL))
- return FAILURE;
+ return false;
expr = create_character_initializer (init, last_ts, ref, rvalue);
}
else
@@ -485,8 +485,8 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
? init : rvalue;
if (gfc_notify_std (GFC_STD_GNU,
"re-initialization of '%s' at %L",
- symbol->name, &expr->where) == FAILURE)
- return FAILURE;
+ symbol->name, &expr->where) == false)
+ return false;
}
expr = gfc_copy_expr (rvalue);
@@ -499,13 +499,13 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
else
last_con->expr = expr;
- return SUCCESS;
+ return true;
abort:
if (!init)
gfc_free_expr (expr);
mpz_clear (offset);
- return FAILURE;
+ return false;
}