summaryrefslogtreecommitdiffstats
path: root/src/H5B2cache.c
diff options
context:
space:
mode:
authorkmu <kmu@hdfgroup.org>2020-01-06 19:04:23 (GMT)
committerkmu <kmu@hdfgroup.org>2020-01-06 19:04:23 (GMT)
commite938f4407eeea3f55dc5df291a2a83854f54404a (patch)
treecc3a3eef4845d8b6c134e15d60e97aece8a8455c /src/H5B2cache.c
parent7366709e4000a96a9942934da0d13474213567f3 (diff)
parent127f07d64affc285e729923b514b4d7f3c19ceeb (diff)
downloadhdf5-e938f4407eeea3f55dc5df291a2a83854f54404a.zip
hdf5-e938f4407eeea3f55dc5df291a2a83854f54404a.tar.gz
hdf5-e938f4407eeea3f55dc5df291a2a83854f54404a.tar.bz2
Merge branch 'develop' of https://git.hdfgroup.org/scm/hdffv/hdf5 into develop
Diffstat (limited to 'src/H5B2cache.c')
-rw-r--r--src/H5B2cache.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index 2a77bd5..65286e6 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -398,7 +398,8 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
*image++ = H5B2_HDR_VERSION;
/* B-tree type */
- *image++ = hdr->cls->id;
+ HDassert(hdr->cls->id <= 255);
+ *image++ = (uint8_t)hdr->cls->id;
/* Node size (in bytes) */
UINT32ENCODE(image, hdr->node_size);
@@ -818,7 +819,8 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
*image++ = H5B2_INT_VERSION;
/* B-tree type */
- *image++ = internal->hdr->cls->id;
+ HDassert(internal->hdr->cls->id <= 255);
+ *image++ = (uint8_t)internal->hdr->cls->id;
HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM));
/* Serialize records for internal node */
@@ -1219,7 +1221,8 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H
*image++ = H5B2_LEAF_VERSION;
/* B-tree type */
- *image++ = leaf->hdr->cls->id;
+ HDassert(leaf->hdr->cls->id <= 255);
+ *image++ = (uint8_t)leaf->hdr->cls->id;
HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM));
/* Serialize records for leaf node */