diff options
Diffstat (limited to 'src/H5HFcache.c')
-rw-r--r-- | src/H5HFcache.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 5839b56..7e4d5de 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -741,7 +741,11 @@ H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN HDassert(len == hdr->heap_size); /* Set the shared heap header's file context for this operation */ + H5_GCC_DIAG_OFF("discarded-qualifiers") + H5_CLANG_DIAG_OFF("incompatible-pointer-types-discards-qualifiers") hdr->f = f; + H5_GCC_DIAG_ON("discarded-qualifiers") + H5_CLANG_DIAG_ON("incompatible-pointer-types-discards-qualifiers") /* Magic number */ H5MM_memcpy(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -1327,7 +1331,11 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG hdr = iblock->hdr; /* Set the shared heap header's file context for this operation */ + H5_GCC_DIAG_OFF("discarded-qualifiers") + H5_CLANG_DIAG_OFF("incompatible-pointer-types-discards-qualifiers") hdr->f = f; + H5_GCC_DIAG_ON("discarded-qualifiers") + H5_CLANG_DIAG_ON("incompatible-pointer-types-discards-qualifiers") /* Magic number */ H5MM_memcpy(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -1654,9 +1662,15 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) /* Update info about direct block */ udata->decompressed = TRUE; len = nbytes; - } /* end if */ - else - read_buf = (void *)image; /* Casting away const OK - QAK */ + } + else { + /* If the data are unfiltered, we just point to the image, which we + * never modify. Casting away const is okay here. + */ + H5_GCC_CLANG_DIAG_OFF("cast-qual") + read_buf = (void *)image; + H5_GCC_CLANG_DIAG_OFF("cast-qual") + } /* Decode checksum */ chk_size = (size_t)(H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr) - H5HF_SIZEOF_CHKSUM); @@ -1668,7 +1682,6 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) chk_p -= H5HF_SIZEOF_CHKSUM; /* Reset checksum field, for computing the checksum */ - /* (Casting away const OK - QAK) */ HDmemset(chk_p, 0, (size_t)H5HF_SIZEOF_CHKSUM); /* Compute checksum on entire direct block */ |