Skip to content

Commit 3f525f3

Browse files
committed
Fixed some error messages in ISO_Fortran_binding.c and removed superfluous print statements in the tests as well as added return values and made the test for CFI_select_part harder, still passed.
1 parent ba6b8b2 commit 3f525f3

File tree

2 files changed

+212
-307
lines changed

2 files changed

+212
-307
lines changed

src/iso-fortran-binding/ISO_Fortran_binding.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ int CFI_establish (CFI_cdesc_t *dv, void *base_addr, CFI_attribute_t attribute,
5353
if (rank < 0 || rank > CFI_MAX_RANK)
5454
{
5555
fprintf (stderr, "ISO_Fortran_binding.c: CFI_establish: Rank must be "
56-
"between 0 and CFI_MAX_RANK (= %d), 0 < rank (= %d) < "
57-
"%d. (Error No. %d).\n",
58-
CFI_INVALID_RANK, rank, CFI_MAX_RANK, CFI_INVALID_RANK);
56+
"between 0 and %d, 0 < rank (0 !< %d). (Error No. "
57+
"%d).\n",
58+
CFI_MAX_RANK, rank, CFI_INVALID_RANK);
5959
return CFI_INVALID_RANK;
6060
}
6161

@@ -552,7 +552,7 @@ int CFI_section (CFI_cdesc_t *result, const CFI_cdesc_t *source,
552552
if (source->rank <= 0)
553553
{
554554
fprintf (stderr, "ISO_Fortran_binding.c: CFI_section: Source must "
555-
"describe an array (0 < source->rank = %d). (Error No. "
555+
"describe an array (0 < source->rank, 0 !< %d). (Error No. "
556556
"%d).\n",
557557
source->rank, CFI_INVALID_RANK);
558558
return CFI_INVALID_RANK;
@@ -597,7 +597,7 @@ int CFI_section (CFI_cdesc_t *result, const CFI_cdesc_t *source,
597597
fprintf (stderr, "ISO_Fortran_binding.c: CFI_section: Rank of result "
598598
"must be equal to the rank of source minus the number "
599599
"of zeros in strides (result->rank = source->rank - "
600-
"zero_count, %d = %d - %d) (Error No. %d).\n",
600+
"zero_count, %d != %d - %d) (Error No. %d).\n",
601601
result->rank, source->rank, zero_count, CFI_INVALID_RANK);
602602
return CFI_INVALID_RANK;
603603
}
@@ -704,7 +704,7 @@ int CFI_section (CFI_cdesc_t *result, const CFI_cdesc_t *source,
704704
"must be within the bounds of the fortran array "
705705
"(source->dim[%d].lower_bound <= upper_bounds[%d] "
706706
"<= source->dim[%d].lower_bound + "
707-
"source->dim[%d].extent - 1, %ld <= %ld <= %ld). "
707+
"source->dim[%d].extent - 1, %ld !<= %ld !<= %ld). "
708708
"(Error No. %d).\n",
709709
i, i, i, i, source->dim[i].lower_bound, upper[i],
710710
source->dim[i].lower_bound + source->dim[i].extent - 1,

0 commit comments

Comments
 (0)