summaryrefslogtreecommitdiffstats
path: root/src/H5HF.c
diff options
context:
space:
mode:
authorraylu-hdf <60487644+raylu-hdf@users.noreply.github.com>2022-04-07 21:03:05 (GMT)
committerGitHub <noreply@github.com>2022-04-07 21:03:05 (GMT)
commit43ab4e6db135f0d0bacda7d64257b9532381e24a (patch)
tree46e512e46b1f03ffb7a25a0aabb7be1f10e6d182 /src/H5HF.c
parent715cf1a29b14abd81b4a03421fc742d6f4542fd0 (diff)
parent33cfd642b55edd63f8c192b941e227b920149fdc (diff)
downloadhdf5-43ab4e6db135f0d0bacda7d64257b9532381e24a.zip
hdf5-43ab4e6db135f0d0bacda7d64257b9532381e24a.tar.gz
hdf5-43ab4e6db135f0d0bacda7d64257b9532381e24a.tar.bz2
Merge pull request #1601 from HDFGroup/raylu_onion_vfd_4
Sync with the develop branch
Diffstat (limited to 'src/H5HF.c')
-rw-r--r--src/H5HF.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/H5HF.c b/src/H5HF.c
index 1f4cc26..7904af9 100644
--- a/src/H5HF.c
+++ b/src/H5HF.c
@@ -63,9 +63,6 @@
/* Package Variables */
/*********************/
-/* Package initialization variable */
-hbool_t H5_PKG_INIT_VAR = FALSE;
-
/*****************************/
/* Library Private Variables */
/*****************************/
@@ -117,8 +114,14 @@ H5HF__op_write(const void *obj, size_t obj_len, void *op_data)
{
FUNC_ENTER_PACKAGE_NOERR
- /* Perform "write", using memcpy() */
- H5MM_memcpy((void *)obj, op_data, obj_len); /* Casting away const OK -QAK */
+ /* Perform "write", using memcpy()
+ *
+ * We cast away const here because no obj pointer that was originally
+ * const should ever arrive here.
+ */
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
+ H5MM_memcpy((void *)obj, op_data, obj_len);
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5HF__op_write() */
@@ -350,10 +353,15 @@ H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id /*out*/)
/* Check for 'huge' object */
if (size > hdr->max_man_size) {
- /* Store 'huge' object in heap */
- /* (Casting away const OK - QAK) */
+ /* Store 'huge' object in heap
+ *
+ * Although not ideal, we can quiet the const warning here because no
+ * obj pointer that was originally const should ever arrive here.
+ */
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
if (H5HF__huge_insert(hdr, size, (void *)obj, id) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't store 'huge' object in fractal heap")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
} /* end if */
/* Check for 'tiny' object */
else if (size <= hdr->tiny_max_len) {