diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2019-03-16 15:06:52 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2019-03-16 15:06:52 (GMT) |
commit | a98747c0f94386f7505210e78cd4b385682b0eba (patch) | |
tree | 003daa33b1f5101e9982c574eb5b16bdf3bdc3fe /src/H5Sselect.c | |
parent | d2591ce377bb027d210a100c5a738e3cdd82378e (diff) | |
download | hdf5-a98747c0f94386f7505210e78cd4b385682b0eba.zip hdf5-a98747c0f94386f7505210e78cd4b385682b0eba.tar.gz hdf5-a98747c0f94386f7505210e78cd4b385682b0eba.tar.bz2 |
Added an H5MM_memcpy call that checks for buffer overlap.
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r-- | src/H5Sselect.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 24586de..ef38746 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -114,7 +114,7 @@ H5S_select_offset(H5S_t *space, const hssize_t *offset) HDassert(offset); /* Copy the offset over */ - HDmemcpy(space->select.offset, offset, sizeof(hssize_t) * space->extent.rank); + H5MM_memcpy(space->select.offset, offset, sizeof(hssize_t) * space->extent.rank); /* Indicate that the offset was changed */ space->select.offset_changed = TRUE; @@ -1538,7 +1538,7 @@ H5S_select_iterate(void *buf, const H5T_t *type, const H5S_t *space, if(ndims > 0) { /* Copy the size of the space */ HDassert(space->extent.size); - HDmemcpy(space_size, space->extent.size, ndims * sizeof(hsize_t)); + H5MM_memcpy(space_size, space->extent.size, ndims * sizeof(hsize_t)); } /* end if */ space_size[ndims] = elmt_size; @@ -2192,16 +2192,16 @@ H5S_select_construct_projection(const H5S_t *base_space, H5S_t **new_space_ptr, rank_diff = new_space_rank - base_space_rank; H5VM_array_fill(new_space_dims, &tmp_dim_size, sizeof(tmp_dim_size), rank_diff); H5VM_array_fill(new_space_maxdims, &tmp_dim_size, sizeof(tmp_dim_size), rank_diff); - HDmemcpy(&new_space_dims[rank_diff], base_space_dims, sizeof(new_space_dims[0]) * base_space_rank); - HDmemcpy(&new_space_maxdims[rank_diff], base_space_maxdims, sizeof(new_space_maxdims[0]) * base_space_rank); + H5MM_memcpy(&new_space_dims[rank_diff], base_space_dims, sizeof(new_space_dims[0]) * base_space_rank); + H5MM_memcpy(&new_space_maxdims[rank_diff], base_space_maxdims, sizeof(new_space_maxdims[0]) * base_space_rank); } /* end if */ else { /* new_space_rank < base_space_rank */ /* we must copy the fastest changing dimension of the * base space into the dimensions of the new space. */ rank_diff = base_space_rank - new_space_rank; - HDmemcpy(new_space_dims, &base_space_dims[rank_diff], sizeof(new_space_dims[0]) * new_space_rank); - HDmemcpy(new_space_maxdims, &base_space_maxdims[rank_diff], sizeof(new_space_maxdims[0]) * new_space_rank); + H5MM_memcpy(new_space_dims, &base_space_dims[rank_diff], sizeof(new_space_dims[0]) * new_space_rank); + H5MM_memcpy(new_space_maxdims, &base_space_maxdims[rank_diff], sizeof(new_space_maxdims[0]) * new_space_rank); } /* end else */ /* now have the new space rank and dimensions set up -- @@ -2232,10 +2232,10 @@ H5S_select_construct_projection(const H5S_t *base_space, H5S_t **new_space_ptr, if(H5S_GET_EXTENT_TYPE(base_space) == H5S_SIMPLE && base_space->select.offset_changed) { if(new_space_rank > base_space_rank) { HDmemset(new_space->select.offset, 0, sizeof(new_space->select.offset[0]) * rank_diff); - HDmemcpy(&new_space->select.offset[rank_diff], base_space->select.offset, sizeof(new_space->select.offset[0]) * base_space_rank); + H5MM_memcpy(&new_space->select.offset[rank_diff], base_space->select.offset, sizeof(new_space->select.offset[0]) * base_space_rank); } /* end if */ else - HDmemcpy(new_space->select.offset, &base_space->select.offset[rank_diff], sizeof(new_space->select.offset[0]) * new_space_rank); + H5MM_memcpy(new_space->select.offset, &base_space->select.offset[rank_diff], sizeof(new_space->select.offset[0]) * new_space_rank); /* Propagate the offset changed flag into the new dataspace. */ new_space->select.offset_changed = TRUE; |