diff options
author | kmu <kmu@hdfgroup.org> | 2019-12-11 16:44:56 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-20 14:20:25 (GMT) |
commit | 95e509db46c7007561a38fcfe76c38d91ea79e49 (patch) | |
tree | e3c7e721d6f15b3ac28c4d8e0db27e4fb95c0c6c /src | |
parent | 9281d24a5bd5cb3ee3cde77a7d1e5e69ef05aa62 (diff) | |
download | hdf5-95e509db46c7007561a38fcfe76c38d91ea79e49.zip hdf5-95e509db46c7007561a38fcfe76c38d91ea79e49.tar.gz hdf5-95e509db46c7007561a38fcfe76c38d91ea79e49.tar.bz2 |
fix and address comments
Diffstat (limited to 'src')
-rw-r--r-- | src/H5B2cache.c | 3 | ||||
-rw-r--r-- | src/H5C.c | 2 | ||||
-rw-r--r-- | src/H5Dchunk.c | 11 | ||||
-rw-r--r-- | src/H5EAcache.c | 4 | ||||
-rw-r--r-- | src/H5FAcache.c | 2 |
5 files changed, 15 insertions, 7 deletions
diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 2baac85..7ce4b99 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -401,6 +401,7 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le *image++ = H5B2_HDR_VERSION; /* B-tree type */ + HDassert(hdr->cls->id <= 255); *image++ = (uint8_t)hdr->cls->id; /* Node size (in bytes) */ @@ -821,6 +822,7 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le *image++ = H5B2_INT_VERSION; /* B-tree type */ + 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)); @@ -1222,6 +1224,7 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H *image++ = H5B2_LEAF_VERSION; /* B-tree type */ + 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)); @@ -4440,7 +4440,7 @@ H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_STATIC /* Sanity checking */ HDassert(cache_ptr); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index ff6bdab..0fdf1e7 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -2167,7 +2167,7 @@ H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm) /* Iterate over each chunk in the chunk list */ curr_node = H5SL_first(fm->sel_chunks); while(curr_node) { - hsize_t schunk_points; /* Number of elements in chunk selection */ + hsize_t chunk_points; /* Number of elements in chunk selection */ hsize_t tmp_count = 1; /* Get pointer to chunk's information */ @@ -2178,12 +2178,12 @@ H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm) if((chunk_info->mspace = H5S_copy(fm->mem_space, TRUE, FALSE)) == NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space") - schunk_points = H5S_GET_SELECT_NPOINTS(chunk_info->fspace); + chunk_points = (hsize_t)H5S_GET_SELECT_NPOINTS(chunk_info->fspace); - if(H5S_select_hyperslab(chunk_info->mspace, H5S_SELECT_SET, mem_sel_start, NULL, &tmp_count, &schunk_points) < 0) + if(H5S_select_hyperslab(chunk_info->mspace, H5S_SELECT_SET, mem_sel_start, NULL, &tmp_count, &chunk_points) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "can't create chunk memory selection") - mem_sel_start[0] += schunk_points; + mem_sel_start[0] += chunk_points; /* Get the next chunk node in the skip list */ curr_node = H5SL_next(curr_node); @@ -5692,7 +5692,6 @@ H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5D_chunk_it_ud2_t *udata = (H5D_chunk_it_ud2_t *)_udata; /* User data for callback */ unsigned rank = udata->common.layout->ndims - 1; /* # of dimensions of dataset */ hsize_t chunk_index; - int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -5702,7 +5701,7 @@ H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Set it in the userdata to return */ udata->chunk_addr[chunk_index] = chunk_rec->chunk_addr; - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(H5_ITER_CONT) } /* H5D__chunk_addrmap_cb() */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index d8e779a..f485ce1 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -492,6 +492,7 @@ H5EA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le *image++ = H5EA_HDR_VERSION; /* Extensible array type */ + HDassert(hdr->cparam.cls->id <= 255); *image++ = (uint8_t)hdr->cparam.cls->id; /* General array creation/configuration information */ @@ -880,6 +881,7 @@ H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5EA_IBLOCK_VERSION; /* Extensible array type */ + HDassert(iblock->hdr->cparam.cls->id <= 255); *image++ = (uint8_t)iblock->hdr->cparam.cls->id; /* Address of array header for array which owns this block */ @@ -1289,6 +1291,7 @@ H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5EA_SBLOCK_VERSION; /* Extensible array type */ + HDassert(sblock->hdr->cparam.cls->id <= 255); *image++ = (uint8_t)sblock->hdr->cparam.cls->id; /* Address of array header for array which owns this block */ @@ -1703,6 +1706,7 @@ H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5EA_DBLOCK_VERSION; /* Extensible array type */ + HDassert(dblock->hdr->cparam.cls->id <= 255); *image++ = (uint8_t)dblock->hdr->cparam.cls->id; /* Address of array header for array which owns this block */ diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 8ea5e8c..e715b1e 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -420,6 +420,7 @@ H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le *image++ = H5FA_HDR_VERSION; /* Fixed array type */ + HDassert(hdr->cparam.cls->id <= 255); *image++ = (uint8_t)hdr->cparam.cls->id; /* General array creation/configuration information */ @@ -808,6 +809,7 @@ H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5FA_DBLOCK_VERSION; /* Fixed array type */ + HDassert(dblock->hdr->cparam.cls->id <= 255); *image++ = (uint8_t)dblock->hdr->cparam.cls->id; /* Address of array header for array which owns this block */ |