summaryrefslogtreecommitdiffstats
path: root/src/H5Tref.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-07-27 00:42:40 (GMT)
committerGitHub <noreply@github.com>2022-07-27 00:42:40 (GMT)
commit21aca4f380ac47b0c19d1926b13eaab0750406d0 (patch)
tree9e0379550949b1679b3329813385aaa46610a3f3 /src/H5Tref.c
parentae414872f50187e64cbd6cc8f076c22cf5df2d53 (diff)
downloadhdf5-21aca4f380ac47b0c19d1926b13eaab0750406d0.zip
hdf5-21aca4f380ac47b0c19d1926b13eaab0750406d0.tar.gz
hdf5-21aca4f380ac47b0c19d1926b13eaab0750406d0.tar.bz2
Misc clang production warning fixes (#1932)
* Misc clang production warning fixes * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5Tref.c')
-rw-r--r--src/H5Tref.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/H5Tref.c b/src/H5Tref.c
index aea322a..f914b8d 100644
--- a/src/H5Tref.c
+++ b/src/H5Tref.c
@@ -961,13 +961,12 @@ done:
static herr_t
H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, size_t src_size,
H5R_type_t H5_ATTR_UNUSED src_type, H5VL_object_t *dst_file, void *dst_buf,
- size_t dst_size, void *bg_buf)
+ size_t H5_ATTR_NDEBUG_UNUSED dst_size, void *bg_buf)
{
- const uint8_t *p = (const uint8_t *)src_buf;
- uint8_t *q = (uint8_t *)dst_buf;
- size_t buf_size_left = dst_size;
- uint8_t *p_bg = (uint8_t *)bg_buf;
- herr_t ret_value = SUCCEED;
+ const uint8_t *p = (const uint8_t *)src_buf;
+ uint8_t *q = (uint8_t *)dst_buf;
+ uint8_t *p_bg = (uint8_t *)bg_buf;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_PACKAGE
H5T_REF_LOG_DEBUG("");
@@ -980,12 +979,14 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf,
/* TODO Should get rid of bg stuff */
if (p_bg) {
H5VL_blob_specific_args_t vol_cb_args; /* Arguments to VOL callback */
- size_t p_buf_size_left = dst_size;
/* Skip the size / header */
p_bg += (sizeof(uint32_t) + H5R_ENCODE_HEADER_SIZE);
+
+#ifndef NDEBUG
+ size_t p_buf_size_left = dst_size;
HDassert(p_buf_size_left > (sizeof(uint32_t) + H5R_ENCODE_HEADER_SIZE));
- p_buf_size_left -= (sizeof(uint32_t) + H5R_ENCODE_HEADER_SIZE);
+#endif
/* Set up VOL callback arguments */
vol_cb_args.op_type = H5VL_BLOB_DELETE;
@@ -1000,12 +1001,14 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf,
p += H5R_ENCODE_HEADER_SIZE;
q += H5R_ENCODE_HEADER_SIZE;
src_size -= H5R_ENCODE_HEADER_SIZE;
- buf_size_left -= sizeof(uint32_t);
+
+#ifndef NDEBUG
+ size_t buf_size_left = dst_size - sizeof(uint32_t);
+ HDassert(buf_size_left > sizeof(uint32_t));
+#endif
/* Set the size */
UINT32ENCODE(q, src_size);
- HDassert(buf_size_left > sizeof(uint32_t));
- buf_size_left -= sizeof(uint32_t);
/* Store blob */
if (H5VL_blob_put(dst_file, p, src_size, q, NULL) < 0)