diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2021-11-20 14:34:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-20 14:34:50 (GMT) |
commit | 3a2b3bb0355424ee34b1e4ba9a76424470911676 (patch) | |
tree | c806c961a89a723d6de8fc4bb442e5cdd2f031ce /src/H5Pdxpl.c | |
parent | 49f7e00ebeb343ea3716836c3fe6c1f0f4568335 (diff) | |
download | hdf5-3a2b3bb0355424ee34b1e4ba9a76424470911676.zip hdf5-3a2b3bb0355424ee34b1e4ba9a76424470911676.tar.gz hdf5-3a2b3bb0355424ee34b1e4ba9a76424470911676.tar.bz2 |
Stop lying about H5S_t const-ness (#1209)
Hyperslabs can be reworked inside several H5S callbacks, making H5S_t
non-const in some places where it is marked const. This change switches
these incorrectly const H5S_t pointer parameters and variables to
non-const where appropriate.
Diffstat (limited to 'src/H5Pdxpl.c')
-rw-r--r-- | src/H5Pdxpl.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 46dc94c..42dd6e4 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -2213,10 +2213,18 @@ H5P__dxfr_dset_io_hyp_sel_cmp(const void *_space1, const void *_space2, size_t H if (TRUE != H5S_extent_equal(*space1, *space2)) HGOTO_DONE(-1); - /* Compare the selection "shape" of the dataspaces */ - /* (Error & not-equal count the same) */ - if (TRUE != H5S_select_shape_same(*space1, *space2)) + /* Compare the selection "shape" of the dataspaces + * (Error & not-equal count the same) + * + * Since H5S_select_shape_same() can result in the dataspaces being + * rebuilt, the parameters are not const which makes it impossible + * to match the cmp prototype. Since we need to compare them, + * we quiet the const warning. + */ + H5_GCC_CLANG_DIAG_OFF("cast-qual") + if (TRUE != H5S_select_shape_same((H5S_t *)*space1, (H5S_t *)*space2)) HGOTO_DONE(-1); + H5_GCC_CLANG_DIAG_ON("cast-qual") } /* end if */ done: |