From 7a28353e36d0c2b1dc81883437d2064a50c00e8e Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Tue, 13 Dec 2016 19:55:20 +0100 Subject: re PR fortran/78798 ([cleanup] some int-valued functions should be bool) 2016-12-13 Janus Weil PR fortran/78798 * gfortran.h (gfc_is_constant_expr, gfc_is_formal_arg, gfc_is_compile_time_shape): Return bool instead of int. * array.c (gfc_is_compile_time_shape): Ditto. * expr.c (gfc_is_constant_expr): Ditto. * resolve.c (gfc_is_formal_arg): Ditto. Make formal_arg_flag bool. From-SVN: r243621 --- gcc/fortran/array.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'gcc/fortran/array.c') diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index e6917a5..154b860 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -2581,18 +2581,16 @@ gfc_find_array_ref (gfc_expr *e) /* Find out if an array shape is known at compile time. */ -int +bool gfc_is_compile_time_shape (gfc_array_spec *as) { - int i; - if (as->type != AS_EXPLICIT) - return 0; + return false; - for (i = 0; i < as->rank; i++) + for (int i = 0; i < as->rank; i++) if (!gfc_is_constant_expr (as->lower[i]) || !gfc_is_constant_expr (as->upper[i])) - return 0; + return false; - return 1; + return true; } -- cgit v1.1