From 917666ee141bd2ee4d999f9ef3f6233a88c3703d Mon Sep 17 00:00:00 2001 From: Katherine Rasmussen Date: Wed, 13 Dec 2023 11:27:28 -0800 Subject: [PATCH] Update way to get a c_bool logical literal --- example/hello.f90 | 2 +- example/support-test/error_stop_character_code.f90 | 2 +- example/support-test/error_stop_integer_code.f90 | 2 +- example/support-test/stop_with_integer_code.f90 | 2 +- example/support-test/stop_with_no_code.f90 | 2 +- src/caffeine/assert/assert_s.f90 | 4 ++-- src/caffeine/assert/intrinsic_array_s.F90 | 10 +++++----- src/caffeine/collective_subroutines/co_max_s.f90 | 2 +- src/caffeine/collective_subroutines/co_min_s.f90 | 2 +- src/caffeine/collective_subroutines/co_reduce_s.f90 | 2 +- src/caffeine/program_startup_s.F90 | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/example/hello.f90 b/example/hello.f90 index fc179cb59..5b57a75b3 100644 --- a/example/hello.f90 +++ b/example/hello.f90 @@ -12,6 +12,6 @@ program hello_world call num_images(image_count=num_imgs) print *, "Hello from image", me, "of", num_imgs - call prif_stop(logical(.false., c_bool), stop_code_int=0) ! normal termination + call prif_stop(.false._c_bool, stop_code_int=0) ! normal termination end program diff --git a/example/support-test/error_stop_character_code.f90 b/example/support-test/error_stop_character_code.f90 index 75bdc4d43..2a28e3cb2 100644 --- a/example/support-test/error_stop_character_code.f90 +++ b/example/support-test/error_stop_character_code.f90 @@ -8,7 +8,7 @@ program error_stop_character_code call prif_init(init_exit_code) if (init_exit_code /= 0) error stop "caffeinate returned a non-zero exit_code" - call prif_error_stop(logical(.false., c_bool), stop_code_char="Oh snap!") + call prif_error_stop(.false._c_bool, stop_code_char="Oh snap!") stop 0 ! ../../test/caf_error_stop_test.f90 will report a test failure if this line runs end program diff --git a/example/support-test/error_stop_integer_code.f90 b/example/support-test/error_stop_integer_code.f90 index cc812aade..b602bd780 100644 --- a/example/support-test/error_stop_integer_code.f90 +++ b/example/support-test/error_stop_integer_code.f90 @@ -8,7 +8,7 @@ program error_stop_integer_code call prif_init(init_exit_code) if (init_exit_code /= 0) error stop "caffeinate returned a non-zero exit_code" - call prif_error_stop(logical(.false., c_bool), 1) + call prif_error_stop(.false._c_bool, 1) stop 0 ! caffeine/test/caf_error_stop_test.f90 reports a failure if this line runs end program diff --git a/example/support-test/stop_with_integer_code.f90 b/example/support-test/stop_with_integer_code.f90 index f931577d0..cf5d07c92 100644 --- a/example/support-test/stop_with_integer_code.f90 +++ b/example/support-test/stop_with_integer_code.f90 @@ -8,7 +8,7 @@ program stop_with_no_code call prif_init(init_exit_code) if (init_exit_code /= 0) error stop "caffeinate returned a non-zero exit_code" - call prif_stop(logical(.false., c_bool), 1) + call prif_stop(.false._c_bool, 1) stop 2 ! caffeine/test/zzz_finalization_test.f90 reports a failure if this line runs end program diff --git a/example/support-test/stop_with_no_code.f90 b/example/support-test/stop_with_no_code.f90 index da593d7c8..d21e49d04 100644 --- a/example/support-test/stop_with_no_code.f90 +++ b/example/support-test/stop_with_no_code.f90 @@ -8,7 +8,7 @@ program stop_with_no_code call prif_init(init_exit_code) if (init_exit_code /= 0) error stop "caffeinate returned a non-zero exit_code" - call prif_stop(logical(.false., c_bool)) + call prif_stop(.false._c_bool) stop 1 ! caffeine/test/zzz_finalization_test.f90 reports a failure if this line runs end program diff --git a/src/caffeine/assert/assert_s.f90 b/src/caffeine/assert/assert_s.f90 index 61a176c75..056c4b10c 100644 --- a/src/caffeine/assert/assert_s.f90 +++ b/src/caffeine/assert/assert_s.f90 @@ -53,7 +53,7 @@ end if represent_diagnostics_as_string - call prif_error_stop(logical(.false., c_bool), stop_code_char=header // ' with diagnostic data "' // trailer // '"') + call prif_error_stop(.false._c_bool, stop_code_char=header // ' with diagnostic data "' // trailer // '"') end if check_assertion @@ -78,7 +78,7 @@ pure function string(numeric) result(number_as_string) type is(real) write(untrimmed_string, *) numeric class default - call prif_error_stop(logical(.false., c_bool), & + call prif_error_stop(.false._c_bool, & stop_code_char="Internal error in subroutine 'assert': unsupported type in function 'string'.") end select diff --git a/src/caffeine/assert/intrinsic_array_s.F90 b/src/caffeine/assert/intrinsic_array_s.F90 index 2a8cf1382..6aae1ec44 100644 --- a/src/caffeine/assert/intrinsic_array_s.F90 +++ b/src/caffeine/assert/intrinsic_array_s.F90 @@ -23,7 +23,7 @@ type is(double precision) intrinsic_array%double_precision_1D = array class default - call prif_error_stop(logical(.false., c_bool), stop_code_char="intrinsic_array_t construct: unsupported rank-2 type") + call prif_error_stop(.false._c_bool, stop_code_char="intrinsic_array_t construct: unsupported rank-2 type") end select #ifndef NAGFOR rank(2) @@ -39,7 +39,7 @@ type is(double precision) intrinsic_array%double_precision_2D = array class default - call prif_error_stop(logical(.false., c_bool), stop_code_char="intrinsic_array_t construct: unsupported rank-2 type") + call prif_error_stop(.false._c_bool, stop_code_char="intrinsic_array_t construct: unsupported rank-2 type") end select rank(3) @@ -55,11 +55,11 @@ type is(double precision) intrinsic_array%double_precision_3D = array class default - call prif_error_stop(logical(.false., c_bool), stop_code_char="intrinsic_array_t construct: unsupported rank-3 type") + call prif_error_stop(.false._c_bool, stop_code_char="intrinsic_array_t construct: unsupported rank-3 type") end select rank default - call prif_error_stop(logical(.false., c_bool), stop_code_char="intrinsic_array_t construct: unsupported rank") + call prif_error_stop(.false._c_bool, stop_code_char="intrinsic_array_t construct: unsupported rank") end select #endif @@ -75,7 +75,7 @@ allocated(self%logical_2D), allocated(self%real_2D), & allocated(self%complex_3D), allocated(self%complex_double_3D), allocated(self%integer_3D), & allocated(self%logical_3D), allocated(self%real_3D) & - ])) call prif_error_stop(logical(.false., c_bool), & + ])) call prif_error_stop(.false._c_bool, & stop_code_char="intrinsic_array_t as_character: ambiguous component allocation status.") if (allocated(self%complex_1D)) then diff --git a/src/caffeine/collective_subroutines/co_max_s.f90 b/src/caffeine/collective_subroutines/co_max_s.f90 index dbe9fb41d..b83b0bfae 100644 --- a/src/caffeine/collective_subroutines/co_max_s.f90 +++ b/src/caffeine/collective_subroutines/co_max_s.f90 @@ -29,7 +29,7 @@ else if (caf_is_f_string(a)) then call prif_co_reduce(a, c_funloc(reverse_alphabetize), optional_value(result_image), stat, errmsg) else - call prif_error_stop(logical(.false., c_bool), stop_code_char="caf_co_max: unsupported type") + call prif_error_stop(.false._c_bool, stop_code_char="caf_co_max: unsupported type") end if contains diff --git a/src/caffeine/collective_subroutines/co_min_s.f90 b/src/caffeine/collective_subroutines/co_min_s.f90 index 0c11e50ac..527c9daae 100644 --- a/src/caffeine/collective_subroutines/co_min_s.f90 +++ b/src/caffeine/collective_subroutines/co_min_s.f90 @@ -29,7 +29,7 @@ else if (caf_is_f_string(a)) then call prif_co_reduce(a, c_funloc(alphabetize), optional_value(result_image), stat, errmsg) else - call prif_error_stop(logical(.false., c_bool), stop_code_char="prif_co_min: unsupported type") + call prif_error_stop(.false._c_bool, stop_code_char="prif_co_min: unsupported type") end if contains diff --git a/src/caffeine/collective_subroutines/co_reduce_s.f90 b/src/caffeine/collective_subroutines/co_reduce_s.f90 index 284f458d4..b2d4a3775 100644 --- a/src/caffeine/collective_subroutines/co_reduce_s.f90 +++ b/src/caffeine/collective_subroutines/co_reduce_s.f90 @@ -69,7 +69,7 @@ call caf_co_reduce(a, optional_value(result_image), stat_ptr, errmsg_ptr, & int(product(shape(a)), c_size_t), c_funloc(Coll_ReduceSub_c_double_complex), c_null_ptr) else - call prif_error_stop(logical(.false., c_bool), stop_code_char="caf_co_reduce: unsupported type") + call prif_error_stop(.false._c_bool, stop_code_char="caf_co_reduce: unsupported type") end if contains diff --git a/src/caffeine/program_startup_s.F90 b/src/caffeine/program_startup_s.F90 index 5a4b785d7..b2d08231d 100644 --- a/src/caffeine/program_startup_s.F90 +++ b/src/caffeine/program_startup_s.F90 @@ -39,7 +39,7 @@ function c_interop_arg(argnum) result(arg) arg => targ #endif call get_command_argument(argnum, arg, arglen) - if (arglen+1>max_arg_len) call prif_error_stop(logical(.false., c_bool), stop_code_char="maximum argument length exceeded") + if (arglen+1>max_arg_len) call prif_error_stop(.false._c_bool, stop_code_char="maximum argument length exceeded") arg(arglen+1:arglen+1) = c_null_char end function