Remove HD from HDmem* calls (#3211)

This commit is contained in:
Dana Robinson
2023-06-29 12:33:46 -07:00
committed by GitHub
parent fd933f30b1
commit 39e6bf48c9
320 changed files with 2914 additions and 2934 deletions
+4 -4
View File
@@ -726,8 +726,8 @@ test_nbit_compression(H5File &file)
SUBTEST("N-bit compression (setup)");
HDmemset(orig_data, 0, DIM1 * DIM2 * sizeof(s1_t));
HDmemset(new_data, 0, DIM1 * DIM2 * sizeof(s1_t));
memset(orig_data, 0, DIM1 * DIM2 * sizeof(s1_t));
memset(new_data, 0, DIM1 * DIM2 * sizeof(s1_t));
try {
// Define datatypes of members of compound datatype
@@ -1093,7 +1093,7 @@ test_getnativeinfo(H5File &file)
// Get dataset header info
H5O_native_info_t ninfo;
HDmemset(&ninfo, 0, sizeof(ninfo));
memset(&ninfo, 0, sizeof(ninfo));
dataset.getNativeObjinfo(ninfo, H5O_NATIVE_INFO_HDR);
verify_val(static_cast<long>(ninfo.hdr.nchunks), 1, "DataSet::getNativeObjinfo", __LINE__, __FILE__);
dataset.close();
@@ -1101,7 +1101,7 @@ test_getnativeinfo(H5File &file)
// Open the dataset we created above and then close it. This is one
// way to open an existing dataset for accessing.
dataset = file.openDataSet(DSET_DEFAULT_NAME);
HDmemset(&ninfo, 0, sizeof(ninfo));
memset(&ninfo, 0, sizeof(ninfo));
dataset.getNativeObjinfo(ninfo, H5O_NATIVE_INFO_ALL);
verify_val(static_cast<long>(ninfo.hdr.nchunks), 1, "DataSet::getNativeObjinfo", __LINE__, __FILE__);
dataset.close();
+1 -1
View File
@@ -239,7 +239,7 @@ test_array_compound_array()
verify_val(ndims, ARRAY1_RANK, "f2_atype_check.getArrayNDims", __LINE__, __FILE__);
// Get the array dimensions
HDmemset(rdims1, 0, sizeof(rdims1));
memset(rdims1, 0, sizeof(rdims1));
f2_atype_check.getArrayDims(rdims1);
// Check the array dimensions
+7 -7
View File
@@ -297,7 +297,7 @@ test_attr_getname(FileAccPropList &fapl)
// 1. With arbitrary buf_size that is larger than the name size
size_t buf_size = FATTR1_NAME.length() + 10;
char *fattr1_name = new char[buf_size + 1];
HDmemset(fattr1_name, 0, buf_size + 1);
memset(fattr1_name, 0, buf_size + 1);
ssize_t name_size = 0; // actual length of attribute name
name_size = fattr1.getName(fattr1_name, buf_size + 1);
CHECK(name_size, FAIL, "Attribute::getName", __LINE__, __FILE__);
@@ -312,7 +312,7 @@ test_attr_getname(FileAccPropList &fapl)
buf_size = 4;
char short_name[5] = "File"; // to verify the read name
fattr1_name = new char[buf_size + 1];
HDmemset(fattr1_name, 0, buf_size + 1);
memset(fattr1_name, 0, buf_size + 1);
name_size = fattr1.getName(fattr1_name, buf_size + 1);
CHECK(name_size, FAIL, "Attribute::getName", __LINE__, __FILE__);
verify_val(static_cast<size_t>(name_size), FATTR1_NAME.size(), "Attribute::getName", __LINE__,
@@ -324,7 +324,7 @@ test_attr_getname(FileAccPropList &fapl)
// 3. With a buf_size that equals the name's length.
buf_size = FATTR1_NAME.length();
fattr1_name = new char[buf_size + 1];
HDmemset(fattr1_name, 0, buf_size + 1);
memset(fattr1_name, 0, buf_size + 1);
name_size = fattr1.getName(fattr1_name, buf_size + 1);
CHECK(name_size, FAIL, "Attribute::getName", __LINE__, __FILE__);
verify_val(fattr1_name, FATTR1_NAME, "Attribute::getName", __LINE__, __FILE__);
@@ -531,7 +531,7 @@ test_attr_basic_read(FileAccPropList &fapl)
// Verify the correct number of attributes another way
H5O_info2_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
memset(&oinfo, 0, sizeof(oinfo));
dataset.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
verify_val(static_cast<long>(oinfo.num_attrs), 3, "DataSet::getObjinfo", __LINE__, __FILE__);
@@ -560,7 +560,7 @@ test_attr_basic_read(FileAccPropList &fapl)
verify_val(num_attrs, 1, "Group::getNumAttrs", __LINE__, __FILE__);
// Verify the correct number of attributes another way
HDmemset(&oinfo, 0, sizeof(oinfo));
memset(&oinfo, 0, sizeof(oinfo));
group.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
verify_val(static_cast<long>(oinfo.num_attrs), 1, "Group::getObjinfo", __LINE__, __FILE__);
@@ -686,7 +686,7 @@ test_attr_compound_read(FileAccPropList &fapl)
// Verify the correct number of attributes another way
H5O_info2_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
memset(&oinfo, 0, sizeof(oinfo));
dataset.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
verify_val(static_cast<long>(oinfo.num_attrs), 1, "DataSet::getObjinfo", __LINE__, __FILE__);
@@ -789,7 +789,7 @@ test_attr_compound_read(FileAccPropList &fapl)
hsize_t ii, jj;
for (ii = 0; ii < ATTR4_DIM1; ii++)
for (jj = 0; jj < ATTR4_DIM2; jj++)
if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct)) != 0) {
if (memcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct)) != 0) {
TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE
"].i=%d, "
"read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].i=%d\n",
+1 -1
View File
@@ -108,7 +108,7 @@ test_compound_2()
s_ptr->d = i * 8 + 6;
s_ptr->e = i * 8 + 7;
}
HDmemcpy(buf, orig, nelmts * sizeof(src_typ_t));
memcpy(buf, orig, nelmts * sizeof(src_typ_t));
// Build hdf5 datatypes
array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four);
+3 -3
View File
@@ -61,7 +61,7 @@ test_transfplist()
// for it, then read and verify the expression from the copied plist
size_t tran_len = static_cast<size_t>(dxpl_c_to_f_copy.getDataTransform(NULL));
char *c_to_f_read = static_cast<char *>(malloc(tran_len + 1));
HDmemset(c_to_f_read, 0, tran_len + 1);
memset(c_to_f_read, 0, tran_len + 1);
dxpl_c_to_f_copy.getDataTransform(c_to_f_read, tran_len + 1);
verify_val(const_cast<const char *>(c_to_f_read), const_cast<const char *>(c_to_f),
"DSetMemXferPropList::getDataTransform", __LINE__, __FILE__);
@@ -76,7 +76,7 @@ test_transfplist()
// ssize_t getDataTransform(char* exp, const size_t buf_size [default=0])
tran_len = static_cast<size_t>(dxpl_c_to_f.getDataTransform(NULL));
c_to_f_read = static_cast<char *>(malloc(tran_len + 1));
HDmemset(c_to_f_read, 0, tran_len + 1);
memset(c_to_f_read, 0, tran_len + 1);
dxpl_c_to_f.getDataTransform(c_to_f_read, tran_len + 1);
verify_val(const_cast<const char *>(c_to_f_read), const_cast<const char *>(c_to_f),
"DSetMemXferPropList::getDataTransform", __LINE__, __FILE__);
@@ -92,7 +92,7 @@ test_transfplist()
// ssize_t getDataTransform(char* exp, const size_t buf_size)
tran_len = static_cast<size_t>(dxpl_utrans_inv.getDataTransform(NULL, 0));
char *utrans_inv_read = static_cast<char *>(malloc(tran_len + 1));
HDmemset(utrans_inv_read, 0, tran_len + 1);
memset(utrans_inv_read, 0, tran_len + 1);
dxpl_utrans_inv.getDataTransform(utrans_inv_read, tran_len + 1);
verify_val(const_cast<const char *>(utrans_inv_read), const_cast<const char *>(utrans_inv),
"DSetMemXferPropList::getDataTransform", __LINE__, __FILE__);
+3 -3
View File
@@ -626,7 +626,7 @@ test_file_attribute()
verify_val(n_attrs, 1, "DataSet::getNumAttrs()", __LINE__, __FILE__);
// Read back attribute's data
HDmemset(rdata, 0, sizeof(rdata));
memset(rdata, 0, sizeof(rdata));
dattr.read(PredType::NATIVE_INT, rdata);
/* Check results */
for (i = 0; i < ATTR1_DIM1; i++) {
@@ -682,7 +682,7 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, H5F
// Verify object header version another way
H5O_native_info_t ninfo;
HDmemset(&ninfo, 0, sizeof(ninfo));
memset(&ninfo, 0, sizeof(ninfo));
file.getNativeObjinfo(ninfo, H5O_NATIVE_INFO_HDR);
verify_val(ninfo.hdr.version, oh_vers_create, "H5File::getNativeObjinfo", __LINE__, __FILE__);
@@ -709,7 +709,7 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, H5F
verify_val(obj_version, oh_vers_mod, "Group::objVersion", __LINE__, __FILE__);
// Verify object header version another way
HDmemset(&ninfo, 0, sizeof(ninfo));
memset(&ninfo, 0, sizeof(ninfo));
group.getNativeObjinfo(ninfo, H5O_NATIVE_INFO_HDR);
verify_val(ninfo.hdr.version, oh_vers_mod, "Group::getNativeObjinfo", __LINE__, __FILE__);
+6 -6
View File
@@ -116,8 +116,8 @@ test_h5s_basic()
hsize_t tdims[4]; // Dimension array to test with
ndims = sid1.getSimpleExtentDims(tdims);
verify_val(ndims, SPACE1_RANK, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
verify_val(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0,
"DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
verify_val(memcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0, "DataSpace::getSimpleExtentDims",
__LINE__, __FILE__);
// Create simple dataspace sid2
hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, SPACE2_MAX4};
@@ -135,9 +135,9 @@ test_h5s_basic()
// Retrieves dimension size and max size of dataspace sid2 and
// verify them
ndims = sid2.getSimpleExtentDims(tdims, tmax);
verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0,
"DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
verify_val(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0, "DataSpace::getSimpleExtentDims",
verify_val(memcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0, "DataSpace::getSimpleExtentDims",
__LINE__, __FILE__);
verify_val(memcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0, "DataSpace::getSimpleExtentDims",
__LINE__, __FILE__);
// Check to be sure we can't create a simple data space that has too
@@ -444,7 +444,7 @@ test_h5s_compound_scalar_read()
dataset.read(&rdata, type);
// Verify read data
if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct)) != 0) {
if (memcmp(&space4_data, &rdata, sizeof(struct space4_struct)) != 0) {
cerr << "scalar data different: space4_data.c1=" << space4_data.c1
<< ", read_data4.c1=" << rdata.c1 << endl;
cerr << "scalar data different: space4_data.u=" << space4_data.u << ", read_data4.u=" << rdata.u
+6 -6
View File
@@ -536,8 +536,8 @@ test_getobjectinfo_same_file()
Group grp2(file1.createGroup(GROUP2NAME));
// Reset object info
HDmemset(&oinfo1, 0, sizeof(oinfo1));
HDmemset(&oinfo2, 0, sizeof(oinfo2));
memset(&oinfo1, 0, sizeof(oinfo1));
memset(&oinfo2, 0, sizeof(oinfo2));
// Query the info of two groups and verify that they have the same
// file number
@@ -559,8 +559,8 @@ test_getobjectinfo_same_file()
grp2 = file2.openGroup(GROUP2NAME);
// Reset object info
HDmemset(&oinfo1, 0, sizeof(oinfo1));
HDmemset(&oinfo2, 0, sizeof(oinfo2));
memset(&oinfo1, 0, sizeof(oinfo1));
memset(&oinfo2, 0, sizeof(oinfo2));
// Query the info of two groups and verify that they have the same
// file number
@@ -569,8 +569,8 @@ test_getobjectinfo_same_file()
verify_val(oinfo1.fileno, oinfo2.fileno, "file number from getObjinfo", __LINE__, __FILE__);
// Reset object info
HDmemset(&oinfo1, 0, sizeof(oinfo1));
HDmemset(&oinfo2, 0, sizeof(oinfo2));
memset(&oinfo1, 0, sizeof(oinfo1));
memset(&oinfo2, 0, sizeof(oinfo2));
file1.getObjinfo(GROUP1NAME, oinfo1);
file1.getObjinfo(GROUP2NAME, oinfo2);
+2 -2
View File
@@ -488,14 +488,14 @@ test_reference_group()
// Check object type using Group::getObjinfo()
H5O_info2_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
memset(&oinfo, 0, sizeof(oinfo));
group.getObjinfo(".", H5_INDEX_NAME, H5_ITER_INC, 0, oinfo);
verify_val(static_cast<long>(oinfo.type), static_cast<long>(H5O_TYPE_DATASET), "Group::getObjinfo",
__LINE__, __FILE__);
// Check for out of bound query by index
try {
HDmemset(&oinfo, 0, sizeof(oinfo));
memset(&oinfo, 0, sizeof(oinfo));
group.getObjinfo(".", H5_INDEX_NAME, H5_ITER_INC, 9, oinfo);
// Should FAIL but didn't, so throw an invalid action exception
+3 -3
View File
@@ -179,7 +179,7 @@ test_vlstring_dataset()
dset1 = root.createDataSet("test_scalar_small", vlst, ds_space);
dynstring_ds_write = static_cast<char *>(calloc(2, sizeof(char)));
HDmemset(dynstring_ds_write, 'A', 1);
memset(dynstring_ds_write, 'A', 1);
// Write data to the dataset, then read it back.
dset1.write(&dynstring_ds_write, vlst);
@@ -277,7 +277,7 @@ test_vlstring_array_dataset()
// Create and write another dataset.
DataSet dataset2(file1->createDataSet("Dataset2", vlst, scalar_space));
char *wdata2 = static_cast<char *>(calloc(65534, sizeof(char)));
HDmemset(wdata2, 'A', 65533);
memset(wdata2, 'A', 65533);
dataset2.write(&wdata2, vlst);
char *rdata2;
@@ -654,7 +654,7 @@ test_vlstring_attribute()
gr_attr = root.createAttribute("test_scalar_large", vlst, att_space);
string_att_write = static_cast<char *>(calloc(8192, sizeof(char)));
HDmemset(string_att_write, 'A', 8191);
memset(string_att_write, 'A', 8191);
// Write data to the attribute, then read it back.
gr_attr.write(vlst, &string_att_write);
+1 -1
View File
@@ -685,7 +685,7 @@ TestHDFFV_9758()
ptable.ResetIndex();
for (size_t i = 0; i < NUM_PACKETS; i++) {
s1_t s2;
HDmemset(&s2, 0, sizeof(s1_t));
memset(&s2, 0, sizeof(s1_t));
err = ptable.GetNextPacket(&s2);
if (err < 0)
goto error;
+1 -1
View File
@@ -183,7 +183,7 @@ H5_init_library(void)
/*
* Make sure the package information is updated.
*/
HDmemset(&H5_debug_g, 0, sizeof H5_debug_g);
memset(&H5_debug_g, 0, sizeof H5_debug_g);
H5_debug_g.pkg[H5_PKG_A].name = "a";
H5_debug_g.pkg[H5_PKG_AC].name = "ac";
H5_debug_g.pkg[H5_PKG_B].name = "b";
+3 -3
View File
@@ -177,7 +177,7 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo)
/* Set fractal heap creation parameters */
/* XXX: Give some control of these to applications? */
HDmemset(&fheap_cparam, 0, sizeof(fheap_cparam));
memset(&fheap_cparam, 0, sizeof(fheap_cparam));
fheap_cparam.managed.width = H5O_FHEAP_MAN_WIDTH;
fheap_cparam.managed.start_block_size = H5O_FHEAP_MAN_START_BLOCK_SIZE;
fheap_cparam.managed.max_direct_size = H5O_FHEAP_MAN_MAX_DIRECT_SIZE;
@@ -206,7 +206,7 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo)
#endif /* NDEBUG */
/* Create the name index v2 B-tree */
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
memset(&bt2_cparam, 0, sizeof(bt2_cparam));
bt2_cparam.cls = H5A_BT2_NAME;
bt2_cparam.node_size = (size_t)H5A_NAME_BT2_NODE_SIZE;
bt2_cparam.rrec_size = 4 + /* Name's hash value */
@@ -225,7 +225,7 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo)
/* Check if we should create a creation order index v2 B-tree */
if (ainfo->index_corder) {
/* Create the creation order index v2 B-tree */
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
memset(&bt2_cparam, 0, sizeof(bt2_cparam));
bt2_cparam.cls = H5A_BT2_CORDER;
bt2_cparam.node_size = (size_t)H5A_CORDER_BT2_NODE_SIZE;
bt2_cparam.rrec_size = 4 + /* Creation order index */
+4 -4
View File
@@ -710,7 +710,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf)
/* Check if the attribute has any data yet, if not, fill with zeroes */
if (attr->obj_opened && !attr->shared->data)
HDmemset(buf, 0, (dst_type_size * nelmts));
memset(buf, 0, (dst_type_size * nelmts));
else { /* Attribute exists and has a value */
/* Convert memory buffer into disk buffer */
/* Set up type conversion function */
@@ -869,7 +869,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf)
/* Clear background buffer if it's not supposed to be initialized with file
* contents */
if (need_bkg == H5T_BKG_TEMP)
HDmemset(bkg_buf, 0, dst_type_size * nelmts);
memset(bkg_buf, 0, dst_type_size * nelmts);
}
else if (NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "memory allocation failed")
@@ -2281,7 +2281,7 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s
/* Set background buffer to all zeros */
if (bkg_buf)
HDmemset(bkg_buf, 0, buf_size);
memset(bkg_buf, 0, buf_size);
/* Convert from memory to destination file */
if (H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0)
@@ -2424,7 +2424,7 @@ H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, H5O_l
} /* end if */
else
/* Reset value to zero */
HDmemset(attr_dst->shared->data, 0, attr_dst->shared->data_size);
memset(attr_dst->shared->data, 0, attr_dst->shared->data_size);
} /* end if */
done:
+17 -18
View File
@@ -215,7 +215,7 @@ H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p /*out
*/
if (NULL == (bt = H5FL_MALLOC(H5B_t)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for B-tree root node")
HDmemset(&bt->cache_info, 0, sizeof(H5AC_info_t));
memset(&bt->cache_info, 0, sizeof(H5AC_info_t));
bt->level = 0;
bt->left = HADDR_UNDEF;
bt->right = HADDR_UNDEF;
@@ -703,7 +703,7 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5
} /* end if */
else {
/* Make room for the new key */
HDmemmove(base + shared->type->sizeof_nkey, base, (bt->nchildren - idx) * shared->type->sizeof_nkey);
memmove(base + shared->type->sizeof_nkey, base, (bt->nchildren - idx) * shared->type->sizeof_nkey);
H5MM_memcpy(base, md_key, shared->type->sizeof_nkey);
/* The MD_KEY is the left key of the new node */
@@ -711,7 +711,7 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5
idx++;
/* Make room for the new child address */
HDmemmove(bt->child + idx + 1, bt->child + idx, (bt->nchildren - idx) * sizeof(haddr_t));
memmove(bt->child + idx + 1, bt->child + idx, (bt->nchildren - idx) * sizeof(haddr_t));
} /* end if */
bt->child[idx] = child;
@@ -1401,8 +1401,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u
*/
if (type->critical_key == H5B_LEFT) {
/* Slide all keys down 1, update lt_key */
HDmemmove(H5B_NKEY(bt, shared, 0), H5B_NKEY(bt, shared, 1),
bt->nchildren * type->sizeof_nkey);
memmove(H5B_NKEY(bt, shared, 0), H5B_NKEY(bt, shared, 1), bt->nchildren * type->sizeof_nkey);
H5MM_memcpy(lt_key, H5B_NKEY(bt, shared, 0), type->sizeof_nkey);
*lt_key_changed = TRUE;
}
@@ -1410,10 +1409,10 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u
/* Slide all but the leftmost 2 keys down, leaving the leftmost
* key intact (the right key of the leftmost child is
* overwritten) */
HDmemmove(H5B_NKEY(bt, shared, 1), H5B_NKEY(bt, shared, 2),
(bt->nchildren - 1) * type->sizeof_nkey);
memmove(H5B_NKEY(bt, shared, 1), H5B_NKEY(bt, shared, 2),
(bt->nchildren - 1) * type->sizeof_nkey);
HDmemmove(bt->child, bt->child + 1, (bt->nchildren - 1) * sizeof(haddr_t));
memmove(bt->child, bt->child + 1, (bt->nchildren - 1) * sizeof(haddr_t));
bt->nchildren -= 1;
bt_flags |= H5AC__DIRTIED_FLAG;
@@ -1428,8 +1427,8 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u
if (type->critical_key == H5B_LEFT)
/* Slide the rightmost key down one, overwriting the left key of
* the deleted (rightmost) child */
HDmemmove(H5B_NKEY(bt, shared, bt->nchildren - 1), H5B_NKEY(bt, shared, bt->nchildren),
type->sizeof_nkey);
memmove(H5B_NKEY(bt, shared, bt->nchildren - 1), H5B_NKEY(bt, shared, bt->nchildren),
type->sizeof_nkey);
else {
/* Just update rt_key */
H5MM_memcpy(rt_key, H5B_NKEY(bt, shared, bt->nchildren - 1), type->sizeof_nkey);
@@ -1449,13 +1448,13 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u
* Return H5B_INS_NOOP.
*/
if (type->critical_key == H5B_LEFT)
HDmemmove(H5B_NKEY(bt, shared, idx), H5B_NKEY(bt, shared, idx + 1),
(bt->nchildren - idx) * type->sizeof_nkey);
memmove(H5B_NKEY(bt, shared, idx), H5B_NKEY(bt, shared, idx + 1),
(bt->nchildren - idx) * type->sizeof_nkey);
else
HDmemmove(H5B_NKEY(bt, shared, idx + 1), H5B_NKEY(bt, shared, idx + 2),
(bt->nchildren - 1 - idx) * type->sizeof_nkey);
memmove(H5B_NKEY(bt, shared, idx + 1), H5B_NKEY(bt, shared, idx + 2),
(bt->nchildren - 1 - idx) * type->sizeof_nkey);
HDmemmove(bt->child + idx, bt->child + idx + 1, (bt->nchildren - 1 - idx) * sizeof(haddr_t));
memmove(bt->child + idx, bt->child + idx + 1, (bt->nchildren - 1 - idx) * sizeof(haddr_t));
bt->nchildren -= 1;
bt_flags |= H5AC__DIRTIED_FLAG;
@@ -1662,7 +1661,7 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey)
/* Allocate and clear shared buffers */
if (NULL == (shared->page = H5FL_BLK_MALLOC(page, shared->sizeof_rnode)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for B-tree page")
HDmemset(shared->page, 0, shared->sizeof_rnode);
memset(shared->page, 0, shared->sizeof_rnode);
if (NULL == (shared->nkey = H5FL_SEQ_MALLOC(size_t, (size_t)(shared->two_k + 1))))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for B-tree native keys")
@@ -1750,7 +1749,7 @@ H5B__copy(const H5B_t *old_bt)
H5MM_memcpy(new_node, old_bt, sizeof(H5B_t));
/* Reset cache info */
HDmemset(&new_node->cache_info, 0, sizeof(H5AC_info_t));
memset(&new_node->cache_info, 0, sizeof(H5AC_info_t));
if (NULL == (new_node->native = H5FL_BLK_MALLOC(native_block, shared->sizeof_keys)) ||
NULL == (new_node->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k)))
@@ -1907,7 +1906,7 @@ H5B_get_info(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_info_t *bt_inf
assert(udata);
/* Portably initialize B-tree info struct */
HDmemset(bt_info, 0, sizeof(*bt_info));
memset(bt_info, 0, sizeof(*bt_info));
/* Set up internal user-data for the B-tree 'get info' helper routine */
info_udata.bt_info = bt_info;
+5 -5
View File
@@ -242,7 +242,7 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header")
/* Magic number */
if (HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree header signature")
image += H5_SIZEOF_MAGIC;
@@ -620,7 +620,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
internal->shadow_epoch = udata->hdr->shadow_epoch;
/* Magic number */
if (HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree internal node signature")
image += H5_SIZEOF_MAGIC;
@@ -800,7 +800,7 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
assert((size_t)(image - (uint8_t *)_image) <= len);
/* Clear rest of internal node */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
memset(image, 0, len - (size_t)(image - (uint8_t *)_image));
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1016,7 +1016,7 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
leaf->shadow_epoch = udata->hdr->shadow_epoch;
/* Magic number */
if (HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree leaf node signature")
image += H5_SIZEOF_MAGIC;
@@ -1159,7 +1159,7 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H
assert((size_t)(image - (uint8_t *)_image) <= len);
/* Clear rest of leaf node */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
memset(image, 0, len - (size_t)(image - (uint8_t *)_image));
done:
FUNC_LEAVE_NOAPI(ret_value)
+1 -1
View File
@@ -129,7 +129,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, ui
/* Allocate "page" for node I/O */
if (NULL == (hdr->page = H5FL_BLK_MALLOC(node_page, hdr->node_size)))
HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "memory allocation failed")
HDmemset(hdr->page, 0, hdr->node_size);
memset(hdr->page, 0, hdr->node_size);
/* Allocate array of node info structs */
if (NULL == (hdr->node_info = H5FL_SEQ_MALLOC(H5B2_node_info_t, (size_t)(hdr->depth + 1))))
+46 -46
View File
@@ -151,10 +151,10 @@ H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr,
/* Slide records in parent node up one space, to make room for promoted record */
if (idx < internal->nrec) {
HDmemmove(H5B2_INT_NREC(internal, hdr, idx + 1), H5B2_INT_NREC(internal, hdr, idx),
hdr->cls->nrec_size * (internal->nrec - idx));
HDmemmove(&(internal->node_ptrs[idx + 2]), &(internal->node_ptrs[idx + 1]),
sizeof(H5B2_node_ptr_t) * (internal->nrec - idx));
memmove(H5B2_INT_NREC(internal, hdr, idx + 1), H5B2_INT_NREC(internal, hdr, idx),
hdr->cls->nrec_size * (internal->nrec - idx));
memmove(&(internal->node_ptrs[idx + 2]), &(internal->node_ptrs[idx + 1]),
sizeof(H5B2_node_ptr_t) * (internal->nrec - idx));
} /* end if */
/* Check for the kind of B-tree node to split */
@@ -521,8 +521,8 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
hdr->cls->nrec_size);
/* Slide records in right node down */
HDmemmove(H5B2_NAT_NREC(right_native, hdr, 0), H5B2_NAT_NREC(right_native, hdr, move_nrec),
hdr->cls->nrec_size * new_right_nrec);
memmove(H5B2_NAT_NREC(right_native, hdr, 0), H5B2_NAT_NREC(right_native, hdr, move_nrec),
hdr->cls->nrec_size * new_right_nrec);
/* Handle node pointers, if we have an internal node */
if (depth > 1) {
@@ -540,8 +540,8 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
sizeof(H5B2_node_ptr_t) * move_nrec);
/* Slide node pointers in right node down */
HDmemmove(&(right_node_ptrs[0]), &(right_node_ptrs[move_nrec]),
sizeof(H5B2_node_ptr_t) * (new_right_nrec + (unsigned)1));
memmove(&(right_node_ptrs[0]), &(right_node_ptrs[move_nrec]),
sizeof(H5B2_node_ptr_t) * (new_right_nrec + (unsigned)1));
} /* end if */
/* Update flush dependencies for grandchildren, if using SWMR */
@@ -571,8 +571,8 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
assert(*left_nrec > *right_nrec);
/* Slide records in right node up */
HDmemmove(H5B2_NAT_NREC(right_native, hdr, move_nrec), H5B2_NAT_NREC(right_native, hdr, 0),
hdr->cls->nrec_size * (*right_nrec));
memmove(H5B2_NAT_NREC(right_native, hdr, move_nrec), H5B2_NAT_NREC(right_native, hdr, 0),
hdr->cls->nrec_size * (*right_nrec));
/* Copy record from parent node down into right child */
H5MM_memcpy(H5B2_NAT_NREC(right_native, hdr, (move_nrec - 1)), H5B2_INT_NREC(internal, hdr, idx),
@@ -594,8 +594,8 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
unsigned u; /* Local index variable */
/* Slide node pointers in right node up */
HDmemmove(&(right_node_ptrs[move_nrec]), &(right_node_ptrs[0]),
sizeof(H5B2_node_ptr_t) * (size_t)(*right_nrec + 1));
memmove(&(right_node_ptrs[move_nrec]), &(right_node_ptrs[0]),
sizeof(H5B2_node_ptr_t) * (size_t)(*right_nrec + 1));
/* Copy node pointers from left node to right */
H5MM_memcpy(&(right_node_ptrs[0]), &(left_node_ptrs[new_left_nrec + 1]),
@@ -813,9 +813,9 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
moved_middle_nrec++;
/* Slide records in middle node down */
HDmemmove(H5B2_NAT_NREC(middle_native, hdr, 0),
H5B2_NAT_NREC(middle_native, hdr, moved_middle_nrec),
hdr->cls->nrec_size * (size_t)(*middle_nrec - moved_middle_nrec));
memmove(H5B2_NAT_NREC(middle_native, hdr, 0),
H5B2_NAT_NREC(middle_native, hdr, moved_middle_nrec),
hdr->cls->nrec_size * (size_t)(*middle_nrec - moved_middle_nrec));
/* Move node pointers also if this is an internal node */
if (depth > 1) {
@@ -835,8 +835,8 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
middle_moved_nrec -= (hssize_t)(moved_nrec + move_nptrs);
/* Slide the node pointers in middle node down */
HDmemmove(&(middle_node_ptrs[0]), &(middle_node_ptrs[move_nptrs]),
sizeof(H5B2_node_ptr_t) * ((*middle_nrec - move_nptrs) + 1));
memmove(&(middle_node_ptrs[0]), &(middle_node_ptrs[move_nptrs]),
sizeof(H5B2_node_ptr_t) * ((*middle_nrec - move_nptrs) + 1));
} /* end if */
/* Update flush dependencies for grandchildren, if using SWMR */
@@ -860,8 +860,8 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
(unsigned)(new_right_nrec - *right_nrec); /* Number of records to move out of right node */
/* Slide records in right node up */
HDmemmove(H5B2_NAT_NREC(right_native, hdr, right_nrec_move), H5B2_NAT_NREC(right_native, hdr, 0),
hdr->cls->nrec_size * (*right_nrec));
memmove(H5B2_NAT_NREC(right_native, hdr, right_nrec_move), H5B2_NAT_NREC(right_native, hdr, 0),
hdr->cls->nrec_size * (*right_nrec));
/* Move right parent record down to right node */
H5MM_memcpy(H5B2_NAT_NREC(right_native, hdr, right_nrec_move - 1),
@@ -884,8 +884,8 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
unsigned u; /* Local index variable */
/* Slide the node pointers in right node up */
HDmemmove(&(right_node_ptrs[right_nrec_move]), &(right_node_ptrs[0]),
sizeof(H5B2_node_ptr_t) * (size_t)(*right_nrec + 1));
memmove(&(right_node_ptrs[right_nrec_move]), &(right_node_ptrs[0]),
sizeof(H5B2_node_ptr_t) * (size_t)(*right_nrec + 1));
/* Move middle node pointers into right node */
H5MM_memcpy(&(right_node_ptrs[0]),
@@ -920,8 +920,8 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
(unsigned)(*left_nrec - new_left_nrec); /* Number of records to move out of left node */
/* Slide middle records up */
HDmemmove(H5B2_NAT_NREC(middle_native, hdr, left_nrec_move), H5B2_NAT_NREC(middle_native, hdr, 0),
hdr->cls->nrec_size * curr_middle_nrec);
memmove(H5B2_NAT_NREC(middle_native, hdr, left_nrec_move), H5B2_NAT_NREC(middle_native, hdr, 0),
hdr->cls->nrec_size * curr_middle_nrec);
/* Move left parent record down to middle node */
H5MM_memcpy(H5B2_NAT_NREC(middle_native, hdr, left_nrec_move - 1),
@@ -929,9 +929,9 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
/* Move left records to middle node */
if (left_nrec_move > 1)
HDmemmove(H5B2_NAT_NREC(middle_native, hdr, 0),
H5B2_NAT_NREC(left_native, hdr, new_left_nrec + 1),
hdr->cls->nrec_size * (left_nrec_move - 1));
memmove(H5B2_NAT_NREC(middle_native, hdr, 0),
H5B2_NAT_NREC(left_native, hdr, new_left_nrec + 1),
hdr->cls->nrec_size * (left_nrec_move - 1));
/* Move left parent record up from left node */
H5MM_memcpy(H5B2_INT_NREC(internal, hdr, idx - 1), H5B2_NAT_NREC(left_native, hdr, new_left_nrec),
@@ -943,8 +943,8 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
unsigned u; /* Local index variable */
/* Slide the node pointers in middle node up */
HDmemmove(&(middle_node_ptrs[left_nrec_move]), &(middle_node_ptrs[0]),
sizeof(H5B2_node_ptr_t) * (size_t)(curr_middle_nrec + 1));
memmove(&(middle_node_ptrs[left_nrec_move]), &(middle_node_ptrs[0]),
sizeof(H5B2_node_ptr_t) * (size_t)(curr_middle_nrec + 1));
/* Move left node pointers into middle node */
H5MM_memcpy(&(middle_node_ptrs[0]), &(left_node_ptrs[new_left_nrec + 1]),
@@ -981,16 +981,16 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
H5B2_INT_NREC(internal, hdr, idx), hdr->cls->nrec_size);
/* Move right records to middle node */
HDmemmove(H5B2_NAT_NREC(middle_native, hdr, (curr_middle_nrec + 1)),
H5B2_NAT_NREC(right_native, hdr, 0), hdr->cls->nrec_size * (right_nrec_move - 1));
memmove(H5B2_NAT_NREC(middle_native, hdr, (curr_middle_nrec + 1)),
H5B2_NAT_NREC(right_native, hdr, 0), hdr->cls->nrec_size * (right_nrec_move - 1));
/* Move right parent record up from right node */
H5MM_memcpy(H5B2_INT_NREC(internal, hdr, idx),
H5B2_NAT_NREC(right_native, hdr, right_nrec_move - 1), hdr->cls->nrec_size);
/* Slide right records down */
HDmemmove(H5B2_NAT_NREC(right_native, hdr, 0), H5B2_NAT_NREC(right_native, hdr, right_nrec_move),
hdr->cls->nrec_size * new_right_nrec);
memmove(H5B2_NAT_NREC(right_native, hdr, 0), H5B2_NAT_NREC(right_native, hdr, right_nrec_move),
hdr->cls->nrec_size * new_right_nrec);
/* Move node pointers also if this is an internal node */
if (depth > 1) {
@@ -1008,8 +1008,8 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
middle_moved_nrec += (hssize_t)(moved_nrec + right_nrec_move);
/* Slide the node pointers in right node down */
HDmemmove(&(right_node_ptrs[0]), &(right_node_ptrs[right_nrec_move]),
sizeof(H5B2_node_ptr_t) * (size_t)(new_right_nrec + 1));
memmove(&(right_node_ptrs[0]), &(right_node_ptrs[right_nrec_move]),
sizeof(H5B2_node_ptr_t) * (size_t)(new_right_nrec + 1));
} /* end if */
/* Update flush dependencies for grandchildren, if using SWMR */
@@ -1218,10 +1218,10 @@ H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr,
/* Slide records in parent node down, to eliminate demoted record */
if ((idx + 1) < internal->nrec) {
HDmemmove(H5B2_INT_NREC(internal, hdr, idx), H5B2_INT_NREC(internal, hdr, idx + 1),
hdr->cls->nrec_size * (internal->nrec - (idx + 1)));
HDmemmove(&(internal->node_ptrs[idx + 1]), &(internal->node_ptrs[idx + 2]),
sizeof(H5B2_node_ptr_t) * (internal->nrec - (idx + 1)));
memmove(H5B2_INT_NREC(internal, hdr, idx), H5B2_INT_NREC(internal, hdr, idx + 1),
hdr->cls->nrec_size * (internal->nrec - (idx + 1)));
memmove(&(internal->node_ptrs[idx + 1]), &(internal->node_ptrs[idx + 2]),
sizeof(H5B2_node_ptr_t) * (internal->nrec - (idx + 1)));
} /* end if */
/* Update # of records in parent node */
@@ -1396,8 +1396,8 @@ H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr,
H5B2_NAT_NREC(middle_native, hdr, (middle_nrec_move - 1)), hdr->cls->nrec_size);
/* Slide records in middle node down */
HDmemmove(H5B2_NAT_NREC(middle_native, hdr, 0), H5B2_NAT_NREC(middle_native, hdr, middle_nrec_move),
hdr->cls->nrec_size * (*middle_nrec - middle_nrec_move));
memmove(H5B2_NAT_NREC(middle_native, hdr, 0), H5B2_NAT_NREC(middle_native, hdr, middle_nrec_move),
hdr->cls->nrec_size * (*middle_nrec - middle_nrec_move));
/* Move node pointers also if this is an internal node */
if (depth > 1) {
@@ -1412,8 +1412,8 @@ H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr,
middle_moved_nrec += middle_node_ptrs[u].all_nrec;
/* Slide the node pointers in middle node down */
HDmemmove(&(middle_node_ptrs[0]), &(middle_node_ptrs[middle_nrec_move]),
sizeof(H5B2_node_ptr_t) * (size_t)((unsigned)(*middle_nrec + 1) - middle_nrec_move));
memmove(&(middle_node_ptrs[0]), &(middle_node_ptrs[middle_nrec_move]),
sizeof(H5B2_node_ptr_t) * (size_t)((unsigned)(*middle_nrec + 1) - middle_nrec_move));
} /* end if */
/* Update flush dependencies for grandchildren, if using SWMR */
@@ -1475,10 +1475,10 @@ H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr,
/* Slide records in parent node down, to eliminate demoted record */
if ((idx + 1) < internal->nrec) {
HDmemmove(H5B2_INT_NREC(internal, hdr, idx), H5B2_INT_NREC(internal, hdr, idx + 1),
hdr->cls->nrec_size * (internal->nrec - (idx + 1)));
HDmemmove(&(internal->node_ptrs[idx + 1]), &(internal->node_ptrs[idx + 2]),
sizeof(H5B2_node_ptr_t) * (internal->nrec - (idx + 1)));
memmove(H5B2_INT_NREC(internal, hdr, idx), H5B2_INT_NREC(internal, hdr, idx + 1),
hdr->cls->nrec_size * (internal->nrec - (idx + 1)));
memmove(&(internal->node_ptrs[idx + 1]), &(internal->node_ptrs[idx + 2]),
sizeof(H5B2_node_ptr_t) * (internal->nrec - (idx + 1)));
} /* end if */
/* Update # of records in parent node */
+2 -2
View File
@@ -104,14 +104,14 @@ H5B2__create_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr,
if (NULL == (internal->int_native = (uint8_t *)H5FL_FAC_MALLOC(hdr->node_info[depth].nat_rec_fac)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for B-tree internal native keys")
HDmemset(internal->int_native, 0, hdr->cls->nrec_size * hdr->node_info[depth].max_nrec);
memset(internal->int_native, 0, hdr->cls->nrec_size * hdr->node_info[depth].max_nrec);
/* Allocate space for the node pointers in memory */
if (NULL ==
(internal->node_ptrs = (H5B2_node_ptr_t *)H5FL_FAC_MALLOC(hdr->node_info[depth].node_ptr_fac)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for B-tree internal node pointers")
HDmemset(internal->node_ptrs, 0, sizeof(H5B2_node_ptr_t) * (hdr->node_info[depth].max_nrec + 1));
memset(internal->node_ptrs, 0, sizeof(H5B2_node_ptr_t) * (hdr->node_info[depth].max_nrec + 1));
/* Set depth of the node */
internal->depth = depth;
+9 -9
View File
@@ -103,7 +103,7 @@ H5B2__create_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr)
/* Allocate space for the native keys in memory */
if (NULL == (leaf->leaf_native = (uint8_t *)H5FL_FAC_MALLOC(hdr->node_info[0].nat_rec_fac)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree leaf native keys")
HDmemset(leaf->leaf_native, 0, hdr->cls->nrec_size * hdr->node_info[0].max_nrec);
memset(leaf->leaf_native, 0, hdr->cls->nrec_size * hdr->node_info[0].max_nrec);
/* Set parent */
leaf->parent = parent;
@@ -360,8 +360,8 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_
/* Make room for new record */
if (idx < leaf->nrec)
HDmemmove(H5B2_LEAF_NREC(leaf, hdr, idx + 1), H5B2_LEAF_NREC(leaf, hdr, idx),
hdr->cls->nrec_size * (leaf->nrec - idx));
memmove(H5B2_LEAF_NREC(leaf, hdr, idx + 1), H5B2_LEAF_NREC(leaf, hdr, idx),
hdr->cls->nrec_size * (leaf->nrec - idx));
} /* end else */
/* Make callback to store record in native form */
@@ -479,8 +479,8 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_s
/* Make room for new record */
if (idx < leaf->nrec)
HDmemmove(H5B2_LEAF_NREC(leaf, hdr, idx + 1), H5B2_LEAF_NREC(leaf, hdr, idx),
hdr->cls->nrec_size * (leaf->nrec - idx));
memmove(H5B2_LEAF_NREC(leaf, hdr, idx + 1), H5B2_LEAF_NREC(leaf, hdr, idx),
hdr->cls->nrec_size * (leaf->nrec - idx));
} /* end if */
} /* end else */
@@ -801,8 +801,8 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_
/* Pack record out of leaf */
if (idx < leaf->nrec)
HDmemmove(H5B2_LEAF_NREC(leaf, hdr, idx), H5B2_LEAF_NREC(leaf, hdr, (idx + 1)),
hdr->cls->nrec_size * (leaf->nrec - idx));
memmove(H5B2_LEAF_NREC(leaf, hdr, idx), H5B2_LEAF_NREC(leaf, hdr, (idx + 1)),
hdr->cls->nrec_size * (leaf->nrec - idx));
/* Mark leaf node as dirty also */
leaf_flags |= H5AC__DIRTIED_FLAG;
@@ -899,8 +899,8 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_n
/* Pack record out of leaf */
if (idx < leaf->nrec)
HDmemmove(H5B2_LEAF_NREC(leaf, hdr, idx), H5B2_LEAF_NREC(leaf, hdr, (idx + 1)),
hdr->cls->nrec_size * (leaf->nrec - idx));
memmove(H5B2_LEAF_NREC(leaf, hdr, idx), H5B2_LEAF_NREC(leaf, hdr, (idx + 1)),
hdr->cls->nrec_size * (leaf->nrec - idx));
/* Mark leaf node as dirty also */
leaf_flags |= H5AC__DIRTIED_FLAG;
+3 -3
View File
@@ -138,7 +138,7 @@ H5B__cache_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_
/* Allocate the B-tree node in memory */
if (NULL == (bt = H5FL_MALLOC(H5B_t)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate B-tree struct")
HDmemset(&bt->cache_info, 0, sizeof(H5AC_info_t));
memset(&bt->cache_info, 0, sizeof(H5AC_info_t));
/* Set & increment the ref-counted "shared" B-tree information for the node */
bt->rc_shared = udata->rc_shared;
@@ -158,7 +158,7 @@ H5B__cache_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_
/* Magic number */
if (H5_IS_BUFFER_OVERFLOW(image, H5_SIZEOF_MAGIC, p_end))
HGOTO_ERROR(H5E_BTREE, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding");
if (HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree signature")
image += H5_SIZEOF_MAGIC;
@@ -325,7 +325,7 @@ H5B__cache_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, vo
assert((size_t)(image - (uint8_t *)_image) <= len);
/* Clear rest of node */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
memset(image, 0, len - (size_t)(image - (uint8_t *)_image));
done:
FUNC_LEAVE_NOAPI(ret_value)
+1 -1
View File
@@ -302,7 +302,7 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id,
cache_ptr->epoch_marker_ringbuf_size = 0;
/* Initialize all epoch marker entries' fields to zero/FALSE/NULL */
HDmemset(cache_ptr->epoch_markers, 0, sizeof(cache_ptr->epoch_markers));
memset(cache_ptr->epoch_markers, 0, sizeof(cache_ptr->epoch_markers));
/* Set non-zero/FALSE/NULL fields for epoch markers */
for (i = 0; i < H5C__MAX_EPOCH_MARKERS; i++) {
+1 -1
View File
@@ -248,7 +248,7 @@ H5CS_copy_stack(void)
/* Copy pointers on old stack to new one */
/* (Strings don't need to be duplicated, they are statically allocated) */
HDmemcpy(new_stack->rec, old_stack->rec, sizeof(char *) * old_stack->nused);
memcpy(new_stack->rec, old_stack->rec, sizeof(char *) * old_stack->nused);
new_stack->nused = new_stack->nalloc = old_stack->nused;
/* Set the return value */
+7 -7
View File
@@ -488,7 +488,7 @@ H5CX_init(void)
FUNC_ENTER_NOAPI(FAIL)
/* Reset the "default DXPL cache" information */
HDmemset(&H5CX_def_dxpl_cache, 0, sizeof(H5CX_dxpl_cache_t));
memset(&H5CX_def_dxpl_cache, 0, sizeof(H5CX_dxpl_cache_t));
/* Get the default DXPL cache information */
@@ -585,7 +585,7 @@ H5CX_init(void)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve modify write buffer property")
/* Reset the "default LCPL cache" information */
HDmemset(&H5CX_def_lcpl_cache, 0, sizeof(H5CX_lcpl_cache_t));
memset(&H5CX_def_lcpl_cache, 0, sizeof(H5CX_lcpl_cache_t));
/* Get the default LCPL cache information */
@@ -602,7 +602,7 @@ H5CX_init(void)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve intermediate group creation flag")
/* Reset the "default LAPL cache" information */
HDmemset(&H5CX_def_lapl_cache, 0, sizeof(H5CX_lapl_cache_t));
memset(&H5CX_def_lapl_cache, 0, sizeof(H5CX_lapl_cache_t));
/* Get the default LAPL cache information */
@@ -615,7 +615,7 @@ H5CX_init(void)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve number of soft / UD links to traverse")
/* Reset the "default DCPL cache" information */
HDmemset(&H5CX_def_dcpl_cache, 0, sizeof(H5CX_dcpl_cache_t));
memset(&H5CX_def_dcpl_cache, 0, sizeof(H5CX_dcpl_cache_t));
/* Get the default DCPL cache information */
@@ -632,7 +632,7 @@ H5CX_init(void)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve object header flags")
/* Reset the "default DAPL cache" information */
HDmemset(&H5CX_def_dapl_cache, 0, sizeof(H5CX_dapl_cache_t));
memset(&H5CX_def_dapl_cache, 0, sizeof(H5CX_dapl_cache_t));
/* Get the default DAPL cache information */
@@ -649,7 +649,7 @@ H5CX_init(void)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve prefix for VDS")
/* Reset the "default FAPL cache" information */
HDmemset(&H5CX_def_fapl_cache, 0, sizeof(H5CX_fapl_cache_t));
memset(&H5CX_def_fapl_cache, 0, sizeof(H5CX_fapl_cache_t));
/* Get the default FAPL cache information */
@@ -1629,7 +1629,7 @@ H5CX_get_vol_connector_prop(H5VL_connector_prop_t *vol_connector_prop)
/* Get the value */
H5MM_memcpy(vol_connector_prop, &(*head)->ctx.vol_connector_prop, sizeof(H5VL_connector_prop_t));
else
HDmemset(vol_connector_prop, 0, sizeof(H5VL_connector_prop_t));
memset(vol_connector_prop, 0, sizeof(H5VL_connector_prop_t));
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5CX_get_vol_connector_prop() */
+6 -6
View File
@@ -374,8 +374,8 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to serialize entry")
#if H5C_DO_MEMORY_SANITY_CHECKS
assert(0 == HDmemcmp(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE,
H5C_IMAGE_EXTRA_SPACE));
assert(0 == memcmp(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE,
H5C_IMAGE_EXTRA_SPACE));
#endif /* H5C_DO_MEMORY_SANITY_CHECKS */
entry_ptr->image_up_to_date = TRUE;
@@ -1076,7 +1076,7 @@ H5C__load_entry(H5F_t *f,
#ifdef H5_HAVE_PARALLEL
if (coll_access) {
/* Push an error, but still participate in following MPI_Bcast */
HDmemset(image, 0, len);
memset(image, 0, len);
HDONE_ERROR(H5E_CACHE, H5E_READERROR, NULL, "Can't read image*")
}
else
@@ -1134,7 +1134,7 @@ H5C__load_entry(H5F_t *f,
#ifdef H5_HAVE_PARALLEL
if (coll_access) {
/* Push an error, but still participate in following MPI_Bcast */
HDmemset(image + len, 0, actual_len - len);
memset(image + len, 0, actual_len - len);
HDONE_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't read image")
}
else
@@ -3954,8 +3954,8 @@ H5C_destroy_flush_dependency(void *parent_thing, void *child_thing)
/* Remove parent entry from child's parent array */
if (u < (child_entry->flush_dep_nparents - 1))
HDmemmove(&child_entry->flush_dep_parent[u], &child_entry->flush_dep_parent[u + 1],
(child_entry->flush_dep_nparents - u - 1) * sizeof(child_entry->flush_dep_parent[0]));
memmove(&child_entry->flush_dep_parent[u], &child_entry->flush_dep_parent[u + 1],
(child_entry->flush_dep_nparents - u - 1) * sizeof(child_entry->flush_dep_parent[0]));
child_entry->flush_dep_nparents--;
/* Adjust parent entry's nchildren and unpin parent if it goes to zero */
+3 -3
View File
@@ -351,8 +351,8 @@ H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr)
assert(cache_ptr->image_entries[u].image_ptr);
assert(fake_cache_ptr->image_entries[u].image_ptr);
assert(!HDmemcmp(cache_ptr->image_entries[u].image_ptr,
fake_cache_ptr->image_entries[u].image_ptr, cache_ptr->image_entries[u].size));
assert(!memcmp(cache_ptr->image_entries[u].image_ptr, fake_cache_ptr->image_entries[u].image_ptr,
cache_ptr->image_entries[u].size));
fake_cache_ptr->image_entries[u].image_ptr =
H5MM_xfree(fake_cache_ptr->image_entries[u].image_ptr);
@@ -1286,7 +1286,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, const uint8_t *
p = *buf;
/* Check signature */
if (HDmemcmp(p, H5C__MDCI_BLOCK_SIGNATURE, (size_t)H5C__MDCI_BLOCK_SIGNATURE_LEN) != 0)
if (memcmp(p, H5C__MDCI_BLOCK_SIGNATURE, (size_t)H5C__MDCI_BLOCK_SIGNATURE_LEN) != 0)
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad metadata cache image header signature")
p += H5C__MDCI_BLOCK_SIGNATURE_LEN;
+1 -1
View File
@@ -171,7 +171,7 @@ H5C__json_write_log_message(H5C_log_json_udata_t *json_udata)
n_chars = HDstrlen(json_udata->message);
if ((int)n_chars != fprintf(json_udata->outfile, "%s", json_udata->message))
HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message")
HDmemset((void *)(json_udata->message), 0, (size_t)(n_chars * sizeof(char)));
memset((void *)(json_udata->message), 0, (size_t)(n_chars * sizeof(char)));
done:
FUNC_LEAVE_NOAPI(ret_value)
+1 -1
View File
@@ -166,7 +166,7 @@ H5C__trace_write_log_message(H5C_log_trace_udata_t *trace_udata)
n_chars = HDstrlen(trace_udata->message);
if ((int)n_chars != fprintf(trace_udata->outfile, "%s", trace_udata->message))
HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message")
HDmemset((void *)(trace_udata->message), 0, (size_t)(n_chars * sizeof(char)));
memset((void *)(trace_udata->message), 0, (size_t)(n_chars * sizeof(char)));
done:
FUNC_LEAVE_NOAPI(ret_value)
+3 -3
View File
@@ -186,13 +186,13 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
assert(mpi_rank < mpi_size);
/* Initialize the entries_to_flush and entries_to_clear arrays */
HDmemset(entries_to_flush, 0, sizeof(entries_to_flush));
HDmemset(entries_to_clear, 0, sizeof(entries_to_clear));
memset(entries_to_flush, 0, sizeof(entries_to_flush));
memset(entries_to_clear, 0, sizeof(entries_to_clear));
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
fprintf(stdout, "%s:%d: setting up candidate assignment table.\n", __func__, mpi_rank);
HDmemset(tbl_buf, 0, sizeof(tbl_buf));
memset(tbl_buf, 0, sizeof(tbl_buf));
HDsnprintf(tbl_buf, sizeof(tbl_buf), "candidate list = ");
for (u = 0; u < num_candidates; u++)
+5 -5
View File
@@ -1028,7 +1028,7 @@ H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t c
assert(chunk_udata);
/* Initialize userdata */
HDmemset(&udata, 0, sizeof udata);
memset(&udata, 0, sizeof udata);
udata.common.layout = idx_info->layout;
udata.common.storage = idx_info->storage;
udata.cb = chunk_cb;
@@ -1114,7 +1114,7 @@ H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info")
/* Set up B-tree user data */
HDmemset(&udata, 0, sizeof udata);
memset(&udata, 0, sizeof udata);
udata.layout = idx_info->layout;
udata.storage = &tmp_storage;
@@ -1234,7 +1234,7 @@ H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
assert(index_size);
/* Initialize B-tree node user-data */
HDmemset(&udata, 0, sizeof udata);
memset(&udata, 0, sizeof udata);
udata.layout = idx_info->layout;
udata.storage = idx_info->storage;
@@ -1350,11 +1350,11 @@ H5D_btree_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, un
FUNC_ENTER_NOAPI(FAIL)
/* Reset "fake" storage info */
HDmemset(&storage, 0, sizeof(storage));
memset(&storage, 0, sizeof(storage));
storage.idx_type = H5D_CHUNK_IDX_BTREE;
/* Reset "fake" layout info */
HDmemset(&layout, 0, sizeof(layout));
memset(&layout, 0, sizeof(layout));
layout.ndims = ndims;
for (u = 0; u < ndims; u++)
layout.dim[u] = dim[u];
+26 -26
View File
@@ -1604,7 +1604,7 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info)
/* Set initial chunk location, partial dimensions, etc */
num_partial_dims = 0;
HDmemset(zeros, 0, sizeof(zeros));
memset(zeros, 0, sizeof(zeros));
for (u = 0; u < fm->f_ndims; u++) {
/* Validate this chunk dimension */
if (di->layout->u.chunk.dim[u] == 0)
@@ -2771,7 +2771,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info)
/* Set up contiguous I/O info object */
H5MM_memcpy(&ctg_io_info, io_info, sizeof(ctg_io_info));
HDmemcpy(&ctg_dset_info, dset_info, sizeof(ctg_dset_info));
memcpy(&ctg_dset_info, dset_info, sizeof(ctg_dset_info));
ctg_dset_info.store = &ctg_store;
ctg_dset_info.layout_ops = *H5D_LOPS_CONTIG;
ctg_io_info.dsets_info = &ctg_dset_info;
@@ -2783,7 +2783,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info)
/* Set up compact I/O info object */
H5MM_memcpy(&cpt_io_info, io_info, sizeof(cpt_io_info));
HDmemcpy(&cpt_dset_info, dset_info, sizeof(cpt_dset_info));
memcpy(&cpt_dset_info, dset_info, sizeof(cpt_dset_info));
cpt_dset_info.store = &cpt_store;
cpt_dset_info.layout_ops = *H5D_LOPS_COMPACT;
cpt_io_info.dsets_info = &cpt_dset_info;
@@ -2930,7 +2930,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info)
/* Set up contiguous I/O info object */
H5MM_memcpy(&ctg_io_info, io_info, sizeof(ctg_io_info));
HDmemcpy(&ctg_dset_info, dset_info, sizeof(ctg_dset_info));
memcpy(&ctg_dset_info, dset_info, sizeof(ctg_dset_info));
ctg_dset_info.store = &ctg_store;
ctg_dset_info.layout_ops = *H5D_LOPS_CONTIG;
ctg_io_info.dsets_info = &ctg_dset_info;
@@ -2942,7 +2942,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info)
/* Set up compact I/O info object */
H5MM_memcpy(&cpt_io_info, io_info, sizeof(cpt_io_info));
HDmemcpy(&cpt_dset_info, dset_info, sizeof(cpt_dset_info));
memcpy(&cpt_dset_info, dset_info, sizeof(cpt_dset_info));
cpt_dset_info.store = &cpt_store;
cpt_dset_info.layout_ops = *H5D_LOPS_COMPACT;
cpt_io_info.dsets_info = &cpt_dset_info;
@@ -3422,7 +3422,7 @@ H5D__chunk_dest(H5D_t *dset)
/* Release cache structures */
if (rdcc->slot)
rdcc->slot = H5FL_SEQ_FREE(H5D_rdcc_ent_ptr_t, rdcc->slot);
HDmemset(rdcc, 0, sizeof(H5D_rdcc_t));
memset(rdcc, 0, sizeof(H5D_rdcc_t));
/* Compose chunked index info struct */
idx_info.f = dset->oloc.file;
@@ -4398,7 +4398,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds
/* In the case that some dataset functions look through this data,
* clear it to all 0s. */
HDmemset(chunk, 0, chunk_size);
memset(chunk, 0, chunk_size);
} /* end if */
else {
/*
@@ -4490,7 +4490,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds
HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, NULL, "can't refill fill value buffer")
} /* end if */
else
HDmemset(chunk, 0, chunk_size);
memset(chunk, 0, chunk_size);
/* Increment # of creations */
rdcc->stats.ninits++;
@@ -4650,7 +4650,7 @@ H5D__chunk_unlock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_
if (dirty) {
H5D_rdcc_ent_t fake_ent; /* "fake" chunk cache entry */
HDmemset(&fake_ent, 0, sizeof(fake_ent));
memset(&fake_ent, 0, sizeof(fake_ent));
fake_ent.dirty = TRUE;
if (is_unfiltered_edge_chunk)
fake_ent.edge_chunk_state = H5D_RDCC_DISABLE_FILTERS;
@@ -4992,7 +4992,7 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old
continue;
else {
/* Reset the chunk offset indices */
HDmemset(scaled, 0, (space_ndims * sizeof(scaled[0])));
memset(scaled, 0, (space_ndims * sizeof(scaled[0])));
scaled[op_dim] = min_unalloc[op_dim];
if (has_unfilt_edge_chunks) {
@@ -5356,7 +5356,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[])
assert(max_edge_chunk_sc[op_dim] == old_edge_chunk_sc[op_dim]);
/* Reset the chunk offset indices */
HDmemset(chunk_sc, 0, (space_ndims * sizeof(chunk_sc[0])));
memset(chunk_sc, 0, (space_ndims * sizeof(chunk_sc[0])));
chunk_sc[op_dim] = old_edge_chunk_sc[op_dim];
carry = FALSE;
@@ -5985,7 +5985,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
/* Reset hyperslab start array */
/* (hyperslabs will always start from origin) */
HDmemset(hyper_start, 0, sizeof(hyper_start));
memset(hyper_start, 0, sizeof(hyper_start));
/* Set up chunked I/O info object, for operations on chunks (in callback)
* Note that we only need to set scaled once, as the array's address
@@ -6007,7 +6007,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
idx_info.storage = &dset->shared->layout.storage.u.chunk;
/* Initialize the user data for the iteration */
HDmemset(&udata, 0, sizeof udata);
memset(&udata, 0, sizeof udata);
udata.common.layout = &layout->u.chunk;
udata.common.storage = sc;
udata.common.scaled = scaled;
@@ -6032,8 +6032,8 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
/*
* Determine the chunks which need to be filled or removed
*/
HDmemset(min_mod_chunk_sc, 0, sizeof(min_mod_chunk_sc));
HDmemset(max_mod_chunk_sc, 0, sizeof(max_mod_chunk_sc));
memset(min_mod_chunk_sc, 0, sizeof(min_mod_chunk_sc));
memset(max_mod_chunk_sc, 0, sizeof(max_mod_chunk_sc));
for (op_dim = 0; op_dim < (unsigned)space_ndims; op_dim++) {
/* Validate this chunk dimension */
if (chunk_dim[op_dim] == 0)
@@ -6099,7 +6099,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
assert(max_mod_chunk_sc[op_dim] >= min_mod_chunk_sc[op_dim]);
/* Reset the chunk offset indices */
HDmemset(scaled, 0, (space_ndims * sizeof(scaled[0])));
memset(scaled, 0, (space_ndims * sizeof(scaled[0])));
scaled[op_dim] = min_mod_chunk_sc[op_dim];
/* Initialize "dims_outside_fill" array */
@@ -6302,7 +6302,7 @@ H5D__chunk_addrmap(const H5D_t *dset, haddr_t chunk_addr[])
assert(chunk_addr);
/* Set up user data for B-tree callback */
HDmemset(&udata, 0, sizeof(udata));
memset(&udata, 0, sizeof(udata));
udata.common.layout = &dset->shared->layout.u.chunk;
udata.common.storage = sc;
udata.chunk_addr = chunk_addr;
@@ -6360,7 +6360,7 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage)
pline_read = TRUE;
} /* end else if */
else
HDmemset(&pline, 0, sizeof(pline));
memset(&pline, 0, sizeof(pline));
/* Retrieve dataset layout message */
if ((exists = H5O_msg_exists_oh(oh, H5O_LAYOUT_ID)) < 0)
@@ -6425,7 +6425,7 @@ H5D__chunk_update_cache(H5D_t *dset)
assert((dset->shared->layout.u.chunk.ndims - 1) > 1);
/* Add temporary entry list to rdcc */
(void)HDmemset(&tmp_head, 0, sizeof(tmp_head));
(void)memset(&tmp_head, 0, sizeof(tmp_head));
rdcc->tmp_head = &tmp_head;
tmp_tail = &tmp_head;
@@ -6580,7 +6580,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
"memory allocation failed for raw data chunk")
udata->bkg = new_buf;
if (!udata->cpy_info->expand_ref)
HDmemset((uint8_t *)udata->bkg + buf_size, 0, (size_t)(nbytes - buf_size));
memset((uint8_t *)udata->bkg + buf_size, 0, (size_t)(nbytes - buf_size));
bkg = udata->bkg;
} /* end if */
@@ -6669,7 +6669,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
H5MM_memcpy(reclaim_buf, buf, reclaim_buf_size);
/* Set background buffer to all zeros */
HDmemset(bkg, 0, buf_size);
memset(bkg, 0, buf_size);
/* Convert from memory to destination file */
if (H5T_convert(tpath_mem_dst, tid_mem, tid_dst, udata->nelmts, (size_t)0, (size_t)0, buf, bkg) < 0)
@@ -6803,7 +6803,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk
/* Initialize the temporary pipeline info */
if (NULL == pline_src) {
HDmemset(&_pline, 0, sizeof(_pline));
memset(&_pline, 0, sizeof(_pline));
pline = &_pline;
} /* end if */
else
@@ -6940,7 +6940,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk
/* Check for reference datatype and no expanding references & clear background buffer */
if (!cpy_info->expand_ref && ((H5T_get_class(dt_src, FALSE) == H5T_REFERENCE) && (f_src != f_dst)))
/* Reset value to zero */
HDmemset(bkg, 0, buf_size);
memset(bkg, 0, buf_size);
} /* end if */
/* Allocate memory for copying the chunk */
@@ -6948,7 +6948,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for raw data chunk")
/* Initialize the callback structure for the source */
HDmemset(&udata, 0, sizeof udata);
memset(&udata, 0, sizeof udata);
udata.common.layout = layout_src;
udata.common.storage = storage_src;
udata.file_src = f_src;
@@ -7070,7 +7070,7 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_
pline_read = TRUE;
} /* end else if */
else
HDmemset(&pline, 0, sizeof(pline));
memset(&pline, 0, sizeof(pline));
/* Compose chunked index info struct */
idx_info.f = loc->file;
@@ -8216,7 +8216,7 @@ H5D__chunk_get_offset_copy(const H5D_t *dset, const hsize_t *offset, hsize_t *of
* So transfer the offset array to an internal offset array that we
* can properly terminate (handled via the memset call).
*/
HDmemset(offset_copy, 0, H5O_LAYOUT_NDIMS * sizeof(hsize_t));
memset(offset_copy, 0, H5O_LAYOUT_NDIMS * sizeof(hsize_t));
for (u = 0; u < dset->shared->ndims; u++) {
/* Make sure the offset doesn't exceed the dataset's dimensions */
+2 -2
View File
@@ -590,7 +590,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds
H5MM_memcpy(reclaim_buf, buf, buf_size);
/* Set background buffer to all zeros */
HDmemset(bkg, 0, buf_size);
memset(bkg, 0, buf_size);
/* Convert from memory to destination file */
if (H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0)
@@ -613,7 +613,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds
} /* end if */
else
/* Reset value to zero */
HDmemset(storage_dst->buf, 0, storage_src->size);
memset(storage_dst->buf, 0, storage_src->size);
} /* end if */
else
/* Type conversion not necessary */
+5 -5
View File
@@ -1267,7 +1267,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void
/* Clear memory */
if (dset_contig->sieve_size > len)
HDmemset(dset_contig->sieve_buf + len, 0, (dset_contig->sieve_size - len));
memset(dset_contig->sieve_buf + len, 0, (dset_contig->sieve_size - len));
/* Determine the new sieve buffer size & location */
dset_contig->sieve_loc = addr;
@@ -1352,8 +1352,8 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void
/* Prepend to existing sieve buffer */
if ((addr + len) == sieve_start) {
/* Move existing sieve information to correct location */
HDmemmove(dset_contig->sieve_buf + len, dset_contig->sieve_buf,
dset_contig->sieve_size);
memmove(dset_contig->sieve_buf + len, dset_contig->sieve_buf,
dset_contig->sieve_size);
/* Copy in new information (must be first in sieve buffer) */
H5MM_memcpy(dset_contig->sieve_buf, buf, len);
@@ -1798,7 +1798,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f
H5MM_memcpy(reclaim_buf, buf, mem_nbytes);
/* Set background buffer to all zeros */
HDmemset(bkg, 0, buf_size);
memset(bkg, 0, buf_size);
/* Convert from memory to destination file */
if (H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0)
@@ -1820,7 +1820,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f
} /* end if */
else
/* Reset value to zero */
HDmemset(buf, 0, src_nbytes);
memset(buf, 0, src_nbytes);
} /* end if */
/* Write raw data to destination file */
+2 -2
View File
@@ -1242,10 +1242,10 @@ H5D__earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t
H5D_earray_it_ud_t udata; /* User data for iteration callback */
/* Initialize userdata */
HDmemset(&udata, 0, sizeof udata);
memset(&udata, 0, sizeof udata);
udata.common.layout = idx_info->layout;
udata.common.storage = idx_info->storage;
HDmemset(&udata.chunk_rec, 0, sizeof(udata.chunk_rec));
memset(&udata.chunk_rec, 0, sizeof(udata.chunk_rec));
udata.filtered = (idx_info->pline->nused > 0);
if (!udata.filtered) {
udata.chunk_rec.nbytes = idx_info->layout->size;
+1 -1
View File
@@ -272,7 +272,7 @@ H5D__efl_read(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t size
if ((n = HDread(fd, buf, to_read)) < 0)
HGOTO_ERROR(H5E_EFL, H5E_READERROR, FAIL, "read error in external raw data file")
else if ((size_t)n < to_read)
HDmemset(buf + n, 0, to_read - (size_t)n);
memset(buf + n, 0, to_read - (size_t)n);
full_name = (char *)H5MM_xfree(full_name);
HDclose(fd);
fd = -1;
+2 -2
View File
@@ -1122,10 +1122,10 @@ H5D__farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t
H5D_farray_it_ud_t udata; /* User data for iteration callback */
/* Initialize userdata */
HDmemset(&udata, 0, sizeof udata);
memset(&udata, 0, sizeof udata);
udata.common.layout = idx_info->layout;
udata.common.storage = idx_info->storage;
HDmemset(&udata.chunk_rec, 0, sizeof(udata.chunk_rec));
memset(&udata.chunk_rec, 0, sizeof(udata.chunk_rec));
udata.filtered = (idx_info->pline->nused > 0);
if (!udata.filtered) {
udata.chunk_rec.nbytes = idx_info->layout->size;
+5 -5
View File
@@ -313,7 +313,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat
assert(dset_type_id > 0);
/* Reset fill buffer information */
HDmemset(fb_info, 0, sizeof(*fb_info));
memset(fb_info, 0, sizeof(*fb_info));
/* Cache constant information from the dataset */
fb_info->fill = fill;
@@ -451,13 +451,13 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat
fb_info->fill_buf = caller_fill_buf;
fb_info->use_caller_fill_buf = TRUE;
HDmemset(fb_info->fill_buf, 0, fb_info->fill_buf_size);
memset(fb_info->fill_buf, 0, fb_info->fill_buf_size);
} /* end if */
else {
if (alloc_func) {
fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info);
HDmemset(fb_info->fill_buf, 0, fb_info->fill_buf_size);
memset(fb_info->fill_buf, 0, fb_info->fill_buf_size);
} /* end if */
else {
htri_t buf_avail = H5FL_BLK_AVAIL(
@@ -512,7 +512,7 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts)
/* Reset first element of background buffer, if necessary */
if (H5T_path_bkg(fb_info->fill_to_mem_tpath))
HDmemset(fb_info->bkg_buf, 0, fb_info->max_elmt_size);
memset(fb_info->bkg_buf, 0, fb_info->max_elmt_size);
/* Type convert the dataset buffer, to copy any VL components */
if (H5T_convert(fb_info->fill_to_mem_tpath, fb_info->file_tid, fb_info->mem_tid, (size_t)1, (size_t)0,
@@ -526,7 +526,7 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts)
/* Reset the entire background buffer, if necessary */
if (H5T_path_bkg(fb_info->mem_to_dset_tpath))
HDmemset(fb_info->bkg_buf, 0, fb_info->bkg_buf_size);
memset(fb_info->bkg_buf, 0, fb_info->bkg_buf_size);
/* Make a copy of the fill buffer so we can free dynamic elements after conversion */
if (fb_info->fill_alloc_func)
+4 -4
View File
@@ -167,7 +167,7 @@ H5D_init(void)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize interface")
/* Reset the "default dataset" information */
HDmemset(&H5D_def_dset, 0, sizeof(H5D_shared_t));
memset(&H5D_def_dset, 0, sizeof(H5D_shared_t));
H5D_def_dset.type_id = H5I_INVALID_HID;
H5D_def_dset.dapl_id = H5I_INVALID_HID;
H5D_def_dset.dcpl_id = H5I_INVALID_HID;
@@ -1599,7 +1599,7 @@ H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id)
assert(dset->shared);
/* Set default append flush values */
HDmemset(&dset->shared->append_flush, 0, sizeof(dset->shared->append_flush));
memset(&dset->shared->append_flush, 0, sizeof(dset->shared->append_flush));
/* If the dataset is chunked and there is a non-default DAPL */
if (dapl_id != H5P_DATASET_ACCESS_DEFAULT && dset->shared->layout.type == H5D_CHUNKED) {
@@ -2303,7 +2303,7 @@ H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwr
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
"unable to allocate memory for compact dataset")
if (!full_overwrite)
HDmemset(layout->storage.u.compact.buf, 0, layout->storage.u.compact.size);
memset(layout->storage.u.compact.buf, 0, layout->storage.u.compact.size);
layout->storage.u.compact.dirty = TRUE;
/* Indicate that we should initialize storage space */
@@ -3573,7 +3573,7 @@ H5D_get_create_plist(const H5D_t *dset)
switch (copied_layout.type) {
case H5D_COMPACT:
copied_layout.storage.u.compact.buf = H5MM_xfree(copied_layout.storage.u.compact.buf);
HDmemset(&copied_layout.storage.u.compact, 0, sizeof(copied_layout.storage.u.compact));
memset(&copied_layout.storage.u.compact, 0, sizeof(copied_layout.storage.u.compact));
break;
case H5D_CONTIGUOUS:
+2 -2
View File
@@ -896,7 +896,7 @@ H5D__ioinfo_init(size_t count, H5D_io_op_type_t op_type, H5D_dset_io_info_t *dse
assert(io_info);
/* Zero out struct */
HDmemset(io_info, 0, sizeof(*io_info));
memset(io_info, 0, sizeof(*io_info));
/* Set up simple fields */
io_info->op_type = op_type;
@@ -1024,7 +1024,7 @@ H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hid_t
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch VL datatype file pointer")
/* Initialize type info safely */
HDmemset(type_info, 0, sizeof(*type_info));
memset(type_info, 0, sizeof(*type_info));
/* Get the memory & dataset datatypes */
if (NULL == (type_info->mem_type = (const H5T_t *)H5I_object_verify(mem_type_id, H5I_DATATYPE)))
+7 -7
View File
@@ -117,7 +117,7 @@
*/
#define H5D_MPIO_INIT_CHUNK_UD_INFO(chunk_ud, index_info_ptr) \
do { \
HDmemset(&chunk_ud, 0, sizeof(H5D_chunk_ud_t)); \
memset(&chunk_ud, 0, sizeof(H5D_chunk_ud_t)); \
chunk_ud.common.layout = (index_info_ptr)->layout; \
chunk_ud.common.storage = (index_info_ptr)->storage; \
} while (0)
@@ -541,7 +541,7 @@ H5D__mpio_debug_init(void)
assert(!H5D_mpio_debug_inited);
/* Clear the debug flag buffer */
HDmemset(H5D_mpio_debug_flags_s, 0, sizeof(H5D_mpio_debug_flags_s));
memset(H5D_mpio_debug_flags_s, 0, sizeof(H5D_mpio_debug_flags_s));
/* Retrieve and parse the H5Dmpio debug string */
debug_str = HDgetenv("H5D_mpio_Debug");
@@ -3487,7 +3487,7 @@ H5D__mpio_redistribute_shared_chunks_int(H5D_filtered_collective_io_info_t *chun
int new_chunk_owner;
/* Clear the mapping from rank value -> number of assigned chunks */
HDmemset(num_chunks_assigned_map, 0, (size_t)mpi_size * sizeof(*num_chunks_assigned_map));
memset(num_chunks_assigned_map, 0, (size_t)mpi_size * sizeof(*num_chunks_assigned_map));
/* Sort collective chunk list according to chunk index */
qsort(coll_chunk_list, coll_chunk_list_num_entries, sizeof(H5D_chunk_redistribute_info_t),
@@ -3838,7 +3838,7 @@ H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk
mod_data_p = msg_send_bufs[num_send_requests];
/* Store the chunk's index into the buffer */
HDmemcpy(mod_data_p, &chunk_entry->index_info.chunk_idx, sizeof(hsize_t));
memcpy(mod_data_p, &chunk_entry->index_info.chunk_idx, sizeof(hsize_t));
mod_data_p += sizeof(hsize_t);
/* Serialize the chunk's file dataspace into the buffer */
@@ -4691,7 +4691,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch
if (msg_ptr) {
/* Retrieve the chunk's index value */
HDmemcpy(&chunk_idx, msg_ptr, sizeof(hsize_t));
memcpy(&chunk_idx, msg_ptr, sizeof(hsize_t));
msg_ptr += sizeof(hsize_t);
/* Find the chunk entry according to its chunk index */
@@ -5153,8 +5153,8 @@ H5D__mpio_collective_filtered_chunk_reinsert(H5D_filtered_collective_io_info_t *
*/
for (size_t dbg_idx = 0; dbg_idx < chunk_list_num_entries; dbg_idx++) {
if (coll_entry->index_info.chunk_idx == chunk_list[dbg_idx].index_info.chunk_idx) {
hbool_t coords_match = !HDmemcmp(scaled_coords, chunk_list[dbg_idx].chunk_info->scaled,
di->dset->shared->ndims * sizeof(hsize_t));
hbool_t coords_match = !memcmp(scaled_coords, chunk_list[dbg_idx].chunk_info->scaled,
di->dset->shared->ndims * sizeof(hsize_t));
assert(coords_match && "Calculated scaled coordinates for chunk didn't match "
"chunk's actual scaled coordinates!");
+1 -1
View File
@@ -233,7 +233,7 @@ H5D__none_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t ch
assert(H5_addr_defined(idx_info->storage->idx_addr));
/* Initialize generic chunk record */
HDmemset(&chunk_rec, 0, sizeof(chunk_rec));
memset(&chunk_rec, 0, sizeof(chunk_rec));
chunk_rec.nbytes = idx_info->layout->size;
chunk_rec.filter_mask = 0;
+1 -1
View File
@@ -378,7 +378,7 @@ H5O__dset_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info)
if (exists && H5D__efl_is_space_alloc(&layout.storage)) {
/* Start with clean EFL info */
HDmemset(&efl, 0, sizeof(efl));
memset(&efl, 0, sizeof(efl));
/* Get External File List message from the object header */
if (NULL == H5O_msg_read_oh(loc->file, oh, H5O_EFL_ID, &efl))
+5 -5
View File
@@ -112,7 +112,7 @@ H5D__scatter_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset
/* Set up temporary I/O info object */
H5MM_memcpy(&tmp_io_info, _io_info, sizeof(*_io_info));
HDmemcpy(&tmp_dset_info, _dset_info, sizeof(*_dset_info));
memcpy(&tmp_dset_info, _dset_info, sizeof(*_dset_info));
tmp_io_info.op_type = H5D_IO_OP_WRITE;
tmp_dset_info.buf.cvp = _buf;
tmp_io_info.dsets_info = &tmp_dset_info;
@@ -213,7 +213,7 @@ H5D__gather_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset_
/* Set up temporary I/O info object */
H5MM_memcpy(&tmp_io_info, _io_info, sizeof(*_io_info));
HDmemcpy(&tmp_dset_info, _dset_info, sizeof(*_dset_info));
memcpy(&tmp_dset_info, _dset_info, sizeof(*_dset_info));
tmp_io_info.op_type = H5D_IO_OP_READ;
tmp_dset_info.buf.vp = _buf;
tmp_io_info.dsets_info = &tmp_dset_info;
@@ -776,7 +776,7 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info)
/* Create block memory space */
if (NULL ==
(tmp_mem_spaces[i] = H5S_create_simple(1, &io_info->sel_pieces[i]->piece_points, NULL))) {
HDmemset(&tmp_mem_spaces[i], 0, (io_info->pieces_added - i) * sizeof(tmp_mem_spaces[0]));
memset(&tmp_mem_spaces[i], 0, (io_info->pieces_added - i) * sizeof(tmp_mem_spaces[0]));
HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "unable to create simple memory dataspace")
}
@@ -1369,7 +1369,7 @@ H5D__compound_opt_read(size_t nelmts, H5S_sel_iter_t *iter, const H5D_type_info_
/* Copy the data into the right place. */
for (i = 0; i < curr_nelmts; i++) {
HDmemmove(xubuf, xdbuf, copy_size);
memmove(xubuf, xdbuf, copy_size);
/* Update pointers */
xdbuf += src_stride;
@@ -1442,7 +1442,7 @@ H5D__compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info, uint8_t
xsbuf = tconv_buf;
xdbuf = tconv_buf;
for (i = 0; i < nelmts; i++) {
HDmemmove(xdbuf, xsbuf, dst_stride);
memmove(xdbuf, xsbuf, dst_stride);
/* Update pointers */
xsbuf += src_stride;
+1 -1
View File
@@ -298,7 +298,7 @@ H5D__single_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t
assert(H5_addr_defined(idx_info->storage->idx_addr));
/* Initialize generic chunk record */
HDmemset(&chunk_rec, 0, sizeof(chunk_rec));
memset(&chunk_rec, 0, sizeof(chunk_rec));
chunk_rec.chunk_addr = idx_info->storage->idx_addr;
if (idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER) {
+8 -8
View File
@@ -735,7 +735,7 @@ H5D__virtual_reset_layout(H5O_layout_t *layout)
virt->list = H5MM_xfree(virt->list);
virt->list_nalloc = (size_t)0;
virt->list_nused = (size_t)0;
(void)HDmemset(virt->min_dims, 0, sizeof(virt->min_dims));
(void)memset(virt->min_dims, 0, sizeof(virt->min_dims));
/* Close access property lists */
if (virt->source_fapl >= 0) {
@@ -1548,9 +1548,9 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset)
storage->list[i].sub_dset = tmp_sub_dset;
/* Clear new space in sub_dset */
(void)HDmemset(&storage->list[i].sub_dset[storage->list[i].sub_dset_nalloc], 0,
storage->list[i].sub_dset_nalloc *
sizeof(H5O_storage_virtual_srcdset_t));
(void)memset(&storage->list[i].sub_dset[storage->list[i].sub_dset_nalloc], 0,
storage->list[i].sub_dset_nalloc *
sizeof(H5O_storage_virtual_srcdset_t));
/* Update sub_dset_nalloc */
storage->list[i].sub_dset_nalloc *= 2;
@@ -2016,9 +2016,9 @@ H5D__virtual_init_all(const H5D_t *dset)
storage->list[i].sub_dset = tmp_sub_dset;
/* Clear new space in sub_dset */
(void)HDmemset(&storage->list[i].sub_dset[storage->list[i].sub_dset_nalloc], 0,
(sub_dset_max - storage->list[i].sub_dset_nalloc) *
sizeof(H5O_storage_virtual_srcdset_t));
(void)memset(&storage->list[i].sub_dset[storage->list[i].sub_dset_nalloc], 0,
(sub_dset_max - storage->list[i].sub_dset_nalloc) *
sizeof(H5O_storage_virtual_srcdset_t));
/* Update sub_dset_nalloc */
storage->list[i].sub_dset_nalloc = sub_dset_max;
@@ -2457,7 +2457,7 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag
HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy virtual selection")
/* Clip virtual selection to real virtual extent */
(void)HDmemset(start, 0, sizeof(start));
(void)memset(start, 0, sizeof(start));
if (H5S_select_hyperslab(storage->list[i].sub_dset[j].clipped_virtual_select,
H5S_SELECT_AND, start, NULL, tmp_dims, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "unable to clip hyperslab")
+7 -7
View File
@@ -303,7 +303,7 @@ H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_
hdr->addr = udata->addr;
/* Magic number */
if (HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array header signature")
image += H5_SIZEOF_MAGIC;
@@ -611,7 +611,7 @@ H5EA__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len)
assert(image_len);
/* Set up fake index block for computing size on disk */
HDmemset(&iblock, 0, sizeof(iblock));
memset(&iblock, 0, sizeof(iblock));
iblock.hdr = (H5EA_hdr_t *)hdr;
iblock.nsblks = H5EA_SBLK_FIRST_IDX(hdr->cparam.sup_blk_min_data_ptrs);
iblock.ndblk_addrs = 2 * ((size_t)hdr->cparam.sup_blk_min_data_ptrs - 1);
@@ -692,7 +692,7 @@ H5EA__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, hbo
iblock->addr = hdr->idx_blk_addr;
/* Magic number */
if (HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array index block signature")
image += H5_SIZEOF_MAGIC;
@@ -996,7 +996,7 @@ H5EA__cache_sblock_get_initial_load_size(void *_udata, size_t *image_len)
/* Set up fake super block for computing size on disk */
/* (Note: extracted from H5EA__sblock_alloc) */
HDmemset(&sblock, 0, sizeof(sblock));
memset(&sblock, 0, sizeof(sblock));
sblock.hdr = udata->hdr;
sblock.ndblks = udata->hdr->sblk_info[udata->sblk_idx].ndblks;
sblock.dblk_nelmts = udata->hdr->sblk_info[udata->sblk_idx].dblk_nelmts;
@@ -1095,7 +1095,7 @@ H5EA__cache_sblock_deserialize(const void *_image, size_t len, void *_udata, hbo
sblock->addr = udata->sblk_addr;
/* Magic number */
if (HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array super block signature")
image += H5_SIZEOF_MAGIC;
@@ -1400,7 +1400,7 @@ H5EA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len)
/* Set up fake data block for computing size on disk */
/* (Note: extracted from H5EA__dblock_alloc) */
HDmemset(&dblock, 0, sizeof(dblock));
memset(&dblock, 0, sizeof(dblock));
/* need to set:
*
@@ -1504,7 +1504,7 @@ H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
dblock->addr = udata->dblk_addr;
/* Magic number */
if (HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array data block signature")
image += H5_SIZEOF_MAGIC;
+2 -2
View File
@@ -255,8 +255,8 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts)
"memory allocation failed for data block data element buffer factory array")
/* Zero out new elements allocated */
HDmemset(new_fac + hdr->elmt_fac.nalloc, 0,
(new_nalloc - hdr->elmt_fac.nalloc) * sizeof(H5FL_fac_head_ptr_t));
memset(new_fac + hdr->elmt_fac.nalloc, 0,
(new_nalloc - hdr->elmt_fac.nalloc) * sizeof(H5FL_fac_head_ptr_t));
/* Update information about element factories in header */
hdr->elmt_fac.nalloc = new_nalloc;
+1 -1
View File
@@ -414,7 +414,7 @@ H5E__print(const H5E_t *estack, FILE *stream, hbool_t bk_compatible)
eprint.stream = stream;
/* Reset the original error class information */
HDmemset(&eprint.cls, 0, sizeof(H5E_cls_t));
memset(&eprint.cls, 0, sizeof(H5E_cls_t));
/* Walk the error stack */
if (bk_compatible) {
+3 -3
View File
@@ -248,7 +248,7 @@ H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len
hdr->addr = udata->addr;
/* Magic number */
if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, NULL, "wrong fixed array header signature")
image += H5_SIZEOF_MAGIC;
@@ -537,7 +537,7 @@ H5FA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len)
/* Set up fake data block for computing size on disk */
/* (Note: extracted from H5FA__dblock_alloc) */
HDmemset(&dblock, 0, sizeof(dblock));
memset(&dblock, 0, sizeof(dblock));
/* Set up fake data block for computing size on disk
*
@@ -632,7 +632,7 @@ H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
dblock->addr = udata->dblk_addr;
/* Magic number */
if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, NULL, "wrong fixed array data block signature")
image += H5_SIZEOF_MAGIC;
+9 -9
View File
@@ -533,7 +533,7 @@ H5Pset_core_write_tracking(hid_t plist_id, hbool_t is_enabled, size_t page_size)
old_fa = H5FD__core_get_default_config();
/* Set VFD info values */
HDmemset(&fa, 0, sizeof(H5FD_core_fapl_t));
memset(&fa, 0, sizeof(H5FD_core_fapl_t));
fa.increment = old_fa->increment;
fa.backing_store = old_fa->backing_store;
fa.write_tracking = is_enabled;
@@ -611,7 +611,7 @@ H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
/* Set VFD info values */
HDmemset(&fa, 0, sizeof(H5FD_core_fapl_t));
memset(&fa, 0, sizeof(H5FD_core_fapl_t));
fa.increment = increment;
fa.backing_store = backing_store;
fa.write_tracking = H5FD_CORE_WRITE_TRACKING_FLAG;
@@ -752,7 +752,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
/* If the file image exists and this is an open, make sure the file doesn't exist */
assert(((file_image_info.buffer != NULL) && (file_image_info.size > 0)) ||
((file_image_info.buffer == NULL) && (file_image_info.size == 0)));
HDmemset(&sb, 0, sizeof(sb));
memset(&sb, 0, sizeof(sb));
if ((file_image_info.buffer != NULL) && !(H5F_ACC_CREAT & flags)) {
if (HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW) >= 0)
HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file already exists")
@@ -1000,7 +1000,7 @@ H5FD__core_close(H5FD_t *_file)
else
H5MM_xfree(file->mem);
} /* end if */
HDmemset(file, 0, sizeof(H5FD_core_t));
memset(file, 0, sizeof(H5FD_core_t));
H5MM_xfree(file);
done:
@@ -1059,9 +1059,9 @@ H5FD__core_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
* determine if the values are the same or not. The actual return value
* shouldn't really matter...
*/
if (HDmemcmp(&(f1->device), &(f2->device), sizeof(dev_t)) < 0)
if (memcmp(&(f1->device), &(f2->device), sizeof(dev_t)) < 0)
HGOTO_DONE(-1)
if (HDmemcmp(&(f1->device), &(f2->device), sizeof(dev_t)) > 0)
if (memcmp(&(f1->device), &(f2->device), sizeof(dev_t)) > 0)
HGOTO_DONE(1)
#endif /* H5_DEV_T_IS_SCALAR */
@@ -1312,7 +1312,7 @@ H5FD__core_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
/* Read zeros for the part which is after the EOF markers */
if (size > 0)
HDmemset(buf, 0, size);
memset(buf, 0, size);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1374,7 +1374,7 @@ H5FD__core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
"unable to allocate memory block of %llu bytes", (unsigned long long)new_eof)
} /* end else */
HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof));
memset(x + file->eof, 0, (size_t)(new_eof - file->eof));
file->mem = x;
file->eof = new_eof;
@@ -1532,7 +1532,7 @@ H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing
} /* end else */
if (file->eof < new_eof)
HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof));
memset(x + file->eof, 0, (size_t)(new_eof - file->eof));
file->mem = x;
/* Update backing store, if using it and if closing */
+6 -6
View File
@@ -336,7 +336,7 @@ H5FD__direct_populate_config(size_t boundary, size_t block_size, size_t cbuf_siz
assert(fa_out);
HDmemset(fa_out, 0, sizeof(H5FD_direct_fapl_t));
memset(fa_out, 0, sizeof(H5FD_direct_fapl_t));
if (boundary != 0)
fa_out->mboundary = boundary;
@@ -655,9 +655,9 @@ H5FD__direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
* determine if the values are the same or not. The actual return value
* shouldn't really matter...
*/
if (HDmemcmp(&(f1->device), &(f2->device), sizeof(dev_t)) < 0)
if (memcmp(&(f1->device), &(f2->device), sizeof(dev_t)) < 0)
HGOTO_DONE(-1)
if (HDmemcmp(&(f1->device), &(f2->device), sizeof(dev_t)) > 0)
if (memcmp(&(f1->device), &(f2->device), sizeof(dev_t)) > 0)
HGOTO_DONE(1)
#endif /* H5_DEV_T_IS_SCALAR */
@@ -873,7 +873,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U
HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed")
if (0 == nbytes) {
/* end of file but not end of format address space */
HDmemset(buf, 0, size);
memset(buf, 0, size);
break;
}
assert(nbytes >= 0);
@@ -915,7 +915,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U
* system calls and partial results like sec2 driver does because the
* data may no longer be aligned. It's especially true when the data in
* file is smaller than ALLOC_SIZE. */
HDmemset(copy_buf, 0, alloc_size);
memset(copy_buf, 0, alloc_size);
/* Calculate how much data we have to read in this iteration
* (including unused parts of blocks) */
@@ -1099,7 +1099,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_
* both ends are misaligned, otherwise only read the block on the
* misaligned end.
*/
HDmemset(copy_buf, 0, _fbsize);
memset(copy_buf, 0, _fbsize);
if (copy_offset > 0) {
if ((write_addr + write_size) > (addr + size)) {
+1 -1
View File
@@ -178,7 +178,7 @@ H5FD_locate_signature(H5FD_t *file, haddr_t *sig_addr)
HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to set EOA value for file signature")
if (H5FD_read(file, H5FD_MEM_SUPER, addr, (size_t)H5F_SIGNATURE_LEN, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to read file signature")
if (!HDmemcmp(buf, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN))
if (!memcmp(buf, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN))
break;
}
+9 -9
View File
@@ -304,7 +304,7 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, si
/* Do this first, so that we don't try to free a wild pointer if
* H5P_object_verify() fails.
*/
HDmemset(&fa, 0, sizeof(H5FD_log_fapl_t));
memset(&fa, 0, sizeof(H5FD_log_fapl_t));
/* Check arguments */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
@@ -830,9 +830,9 @@ H5FD__log_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
* determine if the values are the same or not. The actual return value
* shouldn't really matter...
*/
if (HDmemcmp(&(f1->device), &(f2->device), sizeof(dev_t)) < 0)
if (memcmp(&(f1->device), &(f2->device), sizeof(dev_t)) < 0)
HGOTO_DONE(-1)
if (HDmemcmp(&(f1->device), &(f2->device), sizeof(dev_t)) > 0)
if (memcmp(&(f1->device), &(f2->device), sizeof(dev_t)) > 0)
HGOTO_DONE(1)
#endif /* H5_DEV_T_IS_SCALAR */
@@ -916,7 +916,7 @@ H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hs
if (file->fa.flags & H5FD_LOG_FLAVOR) {
assert(addr < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[addr], (int)type, (size_t)size);
memset(&file->flavor[addr], (int)type, (size_t)size);
}
if (file->fa.flags & H5FD_LOG_ALLOC)
@@ -952,7 +952,7 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
if (file->fa.flags & H5FD_LOG_FLAVOR) {
assert(addr < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[addr], H5FD_MEM_DEFAULT, (size_t)size);
memset(&file->flavor[addr], H5FD_MEM_DEFAULT, (size_t)size);
}
/* Log the file memory freed */
@@ -1013,7 +1013,7 @@ H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
if (file->fa.flags & H5FD_LOG_FLAVOR) {
assert(addr < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[file->eoa], (int)type, (size_t)size);
memset(&file->flavor[file->eoa], (int)type, (size_t)size);
}
/* Log the extension like an allocation */
@@ -1031,7 +1031,7 @@ H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
if (file->fa.flags & H5FD_LOG_FLAVOR) {
assert((addr + size) < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[addr], H5FD_MEM_DEFAULT, (size_t)size);
memset(&file->flavor[addr], H5FD_MEM_DEFAULT, (size_t)size);
}
/* Log the shrink like a free */
@@ -1246,7 +1246,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
if (0 == bytes_read) {
/* End of file but not end of format address space */
HDmemset(buf, 0, size);
memset(buf, 0, size);
break;
}
@@ -1494,7 +1494,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha
* algorithm */
if (file->fa.flags & H5FD_LOG_FLAVOR) {
if ((H5FD_mem_t)file->flavor[orig_addr] == H5FD_MEM_DEFAULT) {
HDmemset(&file->flavor[orig_addr], (int)type, orig_size);
memset(&file->flavor[orig_addr], (int)type, orig_size);
fprintf(file->logfp, " (fresh)");
}
}
+3 -3
View File
@@ -818,7 +818,7 @@ H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t
assert(dest && x);
/* clear entire structure, but especially its filepath string area */
HDmemset(dest, 0, H5FD_MIRROR_XMIT_OPEN_SIZE);
memset(dest, 0, H5FD_MIRROR_XMIT_OPEN_SIZE);
n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->flags);
@@ -855,7 +855,7 @@ H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_
assert(dest && x);
/* clear entire structure, but especially its message string area */
HDmemset(dest, 0, H5FD_MIRROR_XMIT_REPLY_SIZE);
memset(dest, 0, H5FD_MIRROR_XMIT_REPLY_SIZE);
n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->status);
@@ -1385,7 +1385,7 @@ H5FD__mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
target_addr.sin_family = AF_INET;
target_addr.sin_port = htons((uint16_t)fa.handshake_port);
target_addr.sin_addr.s_addr = inet_addr(fa.remote_ip);
HDmemset(target_addr.sin_zero, '\0', sizeof target_addr.sin_zero);
memset(target_addr.sin_zero, '\0', sizeof target_addr.sin_zero);
addr_size = sizeof(target_addr);
if (connect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0)
+1 -1
View File
@@ -273,7 +273,7 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file)
assert(H5FD_MPIO == file->pub.driver_id);
/* Portably initialize MPI status variable */
HDmemset(&rcvstat, 0, sizeof(MPI_Status));
memset(&rcvstat, 0, sizeof(MPI_Status));
/* p0 has no left neighbor; all other procs wait for msg */
if (file->mpi_rank != 0) {
+10 -10
View File
@@ -285,7 +285,7 @@ H5FD_mpio_init(void)
#ifdef H5FDmpio_DEBUG
/* Clear the flag buffer */
HDmemset(H5FD_mpio_debug_flags_s, 0, sizeof(H5FD_mpio_debug_flags_s));
memset(H5FD_mpio_debug_flags_s, 0, sizeof(H5FD_mpio_debug_flags_s));
/* Retrieve MPI-IO debugging environment variable */
s = HDgetenv("H5FD_mpio_Debug");
@@ -1236,7 +1236,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
assert(buf);
/* Portably initialize MPI status variable */
HDmemset(&mpi_stat, 0, sizeof(MPI_Status));
memset(&mpi_stat, 0, sizeof(MPI_Status));
/* some numeric conversions */
if (H5FD_mpi_haddr_to_MPIOff(addr, &mpi_off /*out*/) < 0)
@@ -1430,7 +1430,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
* This gives us zeroes beyond end of physical MPI file.
*/
if ((n = (io_size - bytes_read)) > 0)
HDmemset((char *)buf + bytes_read, 0, (size_t)n);
memset((char *)buf + bytes_read, 0, (size_t)n);
done:
if (derived_type)
@@ -1506,7 +1506,7 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
assert(!H5CX_get_mpi_file_flushing());
/* Portably initialize MPI status variable */
HDmemset(&mpi_stat, 0, sizeof(MPI_Status));
memset(&mpi_stat, 0, sizeof(MPI_Status));
/* some numeric conversions */
if (H5FD_mpi_haddr_to_MPIOff(addr, &mpi_off) < 0)
@@ -2132,7 +2132,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
}
/* Portably initialize MPI status variable */
HDmemset(&mpi_stat, 0, sizeof(mpi_stat));
memset(&mpi_stat, 0, sizeof(mpi_stat));
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_r_flag)
@@ -2264,7 +2264,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
#endif
assert(bytes_read >= 0);
HDmemset((char *)s_bufs[i] + bytes_read, 0, (size_t)io_size);
memset((char *)s_bufs[i] + bytes_read, 0, (size_t)io_size);
n -= io_size;
i--;
@@ -2331,7 +2331,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
/* Check if we actually need to do I/O */
if (addrs[i] < max_addr) {
/* Portably initialize MPI status variable */
HDmemset(&mpi_stat, 0, sizeof(mpi_stat));
memset(&mpi_stat, 0, sizeof(mpi_stat));
/* Issue read */
if (MPI_SUCCESS !=
@@ -2364,13 +2364,13 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
* addresses.
*/
if ((n = (io_size - bytes_read)) > 0) {
HDmemset((char *)bufs[i] + bytes_read, 0, (size_t)n);
memset((char *)bufs[i] + bytes_read, 0, (size_t)n);
max_addr = addrs[i] + (haddr_t)bytes_read;
}
}
else {
/* Read is past the max address, fill in zeroes */
HDmemset((char *)bufs[i], 0, size);
memset((char *)bufs[i], 0, size);
}
}
}
@@ -2538,7 +2538,7 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co
}
/* Portably initialize MPI status variable */
HDmemset(&mpi_stat, 0, sizeof(MPI_Status));
memset(&mpi_stat, 0, sizeof(MPI_Status));
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_debug_w_flag)
+5 -5
View File
@@ -295,7 +295,7 @@ H5Pget_fapl_onion(hid_t fapl_id, H5FD_onion_fapl_info_t *fa_out)
if (NULL == (info_ptr = (const H5FD_onion_fapl_info_t *)H5P_peek_driver_info(plist)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad VFL driver info")
HDmemcpy(fa_out, info_ptr, sizeof(H5FD_onion_fapl_info_t));
memcpy(fa_out, info_ptr, sizeof(H5FD_onion_fapl_info_t));
done:
FUNC_LEAVE_API(ret_value)
@@ -514,7 +514,7 @@ H5FD__onion_commit_new_revision_record(H5FD_onion_t *file)
if (NULL == (new_list = H5MM_calloc((history->n_revisions + 1) * sizeof(H5FD_onion_record_loc_t))))
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to resize record pointer list")
HDmemcpy(new_list, history->record_locs, sizeof(H5FD_onion_record_loc_t) * history->n_revisions);
memcpy(new_list, history->record_locs, sizeof(H5FD_onion_record_loc_t) * history->n_revisions);
H5MM_xfree(history->record_locs);
history->record_locs = new_list;
new_list = NULL;
@@ -979,7 +979,7 @@ H5FD__onion_open(const char *filename, unsigned flags, hid_t fapl_id, haddr_t ma
/* Initialize file structure fields */
HDmemcpy(&(file->fa), fa, sizeof(H5FD_onion_fapl_info_t));
memcpy(&(file->fa), fa, sizeof(H5FD_onion_fapl_info_t));
file->header.version = H5FD_ONION_HEADER_VERSION_CURR;
file->header.page_size = file->fa.page_size; /* guarded on FAPL-set */
@@ -1522,7 +1522,7 @@ H5FD__onion_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
if (H5FD_read(file->onion_file, H5FD_MEM_DRAW, entry_out->phys_addr, page_size, page_buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "can't get working file data")
/* Overlay delta from input buffer onto page buffer. */
HDmemcpy(page_buf + page_gap_head, buf, page_n_used);
memcpy(page_buf + page_gap_head, buf, page_n_used);
write_buf = page_buf;
} /* end if partial page */
@@ -1570,7 +1570,7 @@ H5FD__onion_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
/* Copy input buffer to temporary page buffer */
assert((page_size - page_gap_head) >= page_n_used);
HDmemcpy(page_buf + page_gap_head, buf, page_n_used);
memcpy(page_buf + page_gap_head, buf, page_n_used);
write_buf = page_buf;
} /* end if data range does not span entire page */
+8 -8
View File
@@ -142,34 +142,34 @@ H5FD__onion_header_decode(unsigned char *buf, H5FD_onion_header_t *header)
ptr = buf + 5;
ui32 = 0;
HDmemcpy(&ui32, ptr, 3);
memcpy(&ui32, ptr, 3);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, header->flags);
ptr += 3;
HDmemcpy(&ui32, ptr, 4);
memcpy(&ui32, ptr, 4);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, header->page_size);
ptr += 4;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT32DECODE(ui8p, header->origin_eof);
ptr += 8;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT32DECODE(ui8p, header->history_addr);
ptr += 8;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT32DECODE(ui8p, header->history_size);
ptr += 8;
sum = H5_checksum_fletcher32(buf, (size_t)(ptr - buf));
HDmemcpy(&ui32, ptr, 4);
memcpy(&ui32, ptr, 4);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, header->checksum);
ptr += 4;
@@ -214,9 +214,9 @@ H5FD__onion_header_encode(H5FD_onion_header_t *header, unsigned char *buf, uint3
assert(H5FD_ONION_HEADER_VERSION_CURR == header->version);
assert(0 == (header->flags & 0xFF000000)); /* max three bits long */
HDmemcpy(ptr, H5FD_ONION_HEADER_SIGNATURE, 4);
memcpy(ptr, H5FD_ONION_HEADER_SIGNATURE, 4);
ptr += 4;
HDmemcpy(ptr, (unsigned char *)&header->version, 1);
memcpy(ptr, (unsigned char *)&header->version, 1);
ptr += 1;
UINT32ENCODE(ptr, header->flags);
ptr -= 1; /* truncate to three bytes */
+6 -6
View File
@@ -180,7 +180,7 @@ H5FD__onion_history_decode(unsigned char *buf, H5FD_onion_history_t *history)
ptr = buf + 8;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT64DECODE(ui8p, n_revisions);
ptr += 8;
@@ -207,19 +207,19 @@ H5FD__onion_history_decode(unsigned char *buf, H5FD_onion_history_t *history)
uint64_t record_size;
uint64_t phys_addr;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT64DECODE(ui8p, phys_addr);
H5_CHECKED_ASSIGN(rloc->phys_addr, haddr_t, phys_addr, uint64_t);
ptr += 8;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT64DECODE(ui8p, record_size);
H5_CHECKED_ASSIGN(rloc->record_size, hsize_t, record_size, uint64_t);
ptr += 8;
HDmemcpy(&ui32, ptr, 4);
memcpy(&ui32, ptr, 4);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, rloc->checksum);
ptr += 4;
@@ -228,7 +228,7 @@ H5FD__onion_history_decode(unsigned char *buf, H5FD_onion_history_t *history)
sum = H5_checksum_fletcher32(buf, (size_t)(ptr - buf));
HDmemcpy(&ui32, ptr, 4);
memcpy(&ui32, ptr, 4);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, history->checksum);
ptr += 4;
@@ -275,7 +275,7 @@ H5FD__onion_history_encode(H5FD_onion_history_t *history, unsigned char *buf, ui
assert(buf != NULL);
assert(checksum != NULL);
HDmemcpy(ptr, H5FD_ONION_HISTORY_SIGNATURE, 4);
memcpy(ptr, H5FD_ONION_HISTORY_SIGNATURE, 4);
ptr += 4;
UINT32ENCODE(ptr, vers_u32);
UINT64ENCODE(ptr, history->n_revisions);
+21 -21
View File
@@ -483,7 +483,7 @@ H5FD__onion_revision_index_insert(H5FD_onion_revision_index_t *rix, const H5FD_o
if (entry->phys_addr != node->entry_data.phys_addr) {
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "physical address mismatch");
}
HDmemcpy(&node->entry_data, entry, sizeof(H5FD_onion_index_entry_t));
memcpy(&node->entry_data, entry, sizeof(H5FD_onion_index_entry_t));
append_dest = NULL; /* Node updated, do not append */
break;
}
@@ -496,7 +496,7 @@ H5FD__onion_revision_index_insert(H5FD_onion_revision_index_t *rix, const H5FD_o
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "cannot allocate new ash chain node")
node->version = H5FD_ONION_REVISION_INDEX_HASH_CHAIN_NODE_VERSION_CURR;
node->next = NULL;
HDmemcpy(&node->entry_data, entry, sizeof(H5FD_onion_index_entry_t));
memcpy(&node->entry_data, entry, sizeof(H5FD_onion_index_entry_t));
*append_dest = node;
rix->n_entries++;
}
@@ -612,25 +612,25 @@ H5FD__onion_revision_record_decode(unsigned char *buf, H5FD_onion_revision_recor
ptr = buf + 8;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT64DECODE(ui8p, record->revision_num);
ptr += 8;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT64DECODE(ui8p, record->parent_revision_num);
ptr += 8;
HDmemcpy(record->time_of_creation, ptr, 16);
memcpy(record->time_of_creation, ptr, 16);
ptr += 16;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT64DECODE(ui8p, record->logical_eof);
ptr += 8;
HDmemcpy(&ui32, ptr, 4);
memcpy(&ui32, ptr, 4);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, page_size);
ptr += 4;
@@ -645,12 +645,12 @@ H5FD__onion_revision_record_decode(unsigned char *buf, H5FD_onion_revision_recor
record->archival_index.page_size_log2++)
;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT64DECODE(ui8p, n_entries);
ptr += 8;
HDmemcpy(&ui32, ptr, 4);
memcpy(&ui32, ptr, 4);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, comment_size);
ptr += 4;
@@ -671,7 +671,7 @@ H5FD__onion_revision_record_decode(unsigned char *buf, H5FD_onion_revision_recor
for (size_t i = 0; i < n_entries; i++) {
entry = &record->archival_index.list[i];
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT64DECODE(ui8p, entry->logical_page);
ptr += 8;
@@ -682,12 +682,12 @@ H5FD__onion_revision_record_decode(unsigned char *buf, H5FD_onion_revision_recor
entry->logical_page = entry->logical_page >> record->archival_index.page_size_log2;
HDmemcpy(&ui64, ptr, 8);
memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT64DECODE(ui8p, entry->phys_addr);
ptr += 8;
HDmemcpy(&ui32, ptr, 4);
memcpy(&ui32, ptr, 4);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, sum);
ptr += 4;
@@ -706,13 +706,13 @@ H5FD__onion_revision_record_decode(unsigned char *buf, H5FD_onion_revision_recor
else {
if (record->comment == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "no comment pointer")
HDmemcpy(record->comment, ptr, comment_size);
memcpy(record->comment, ptr, comment_size);
}
ptr += comment_size;
sum = H5_checksum_fletcher32(buf, (size_t)(ptr - buf));
HDmemcpy(&ui32, ptr, 4);
memcpy(&ui32, ptr, 4);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, record->checksum);
ptr += 4;
@@ -765,12 +765,12 @@ H5FD__onion_revision_record_encode(H5FD_onion_revision_record_t *record, unsigne
page_size = (uint32_t)(1 << record->archival_index.page_size_log2);
HDmemcpy(ptr, H5FD_ONION_REVISION_RECORD_SIGNATURE, 4);
memcpy(ptr, H5FD_ONION_REVISION_RECORD_SIGNATURE, 4);
ptr += 4;
UINT32ENCODE(ptr, vers_u32);
UINT64ENCODE(ptr, record->revision_num);
UINT64ENCODE(ptr, record->parent_revision_num);
HDmemcpy(ptr, record->time_of_creation, 16);
memcpy(ptr, record->time_of_creation, 16);
ptr += 16;
UINT64ENCODE(ptr, record->logical_eof);
UINT32ENCODE(ptr, page_size);
@@ -798,7 +798,7 @@ H5FD__onion_revision_record_encode(H5FD_onion_revision_record_t *record, unsigne
if (record->comment_size > 0) {
assert(record->comment != NULL && *record->comment != '\0');
HDmemcpy(ptr, record->comment, record->comment_size);
memcpy(ptr, record->comment, record->comment_size);
ptr += record->comment_size;
}
@@ -876,7 +876,7 @@ H5FD__onion_merge_revision_index_into_archival_index(const H5FD_onion_revision_i
const H5FD_onion_revision_index_hash_chain_node_t *node = NULL;
for (node = rix->_hash_table[i]; node != NULL; node = node->next) {
HDmemcpy(&new_aix.list[new_aix.n_entries], &node->entry_data, sizeof(H5FD_onion_index_entry_t));
memcpy(&new_aix.list[new_aix.n_entries], &node->entry_data, sizeof(H5FD_onion_index_entry_t));
new_aix.n_entries++;
}
}
@@ -901,7 +901,7 @@ H5FD__onion_merge_revision_index_into_archival_index(const H5FD_onion_revision_i
/* Add only if page not already added from revision index */
if (H5FD__onion_archival_index_find(&new_aix, aix->list[i].logical_page, &entry) == 0) {
HDmemcpy(&kept_list[n_kept], &aix->list[i], sizeof(H5FD_onion_index_entry_t));
memcpy(&kept_list[n_kept], &aix->list[i], sizeof(H5FD_onion_index_entry_t));
n_kept++;
}
}
@@ -914,12 +914,12 @@ H5FD__onion_merge_revision_index_into_archival_index(const H5FD_onion_revision_i
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate exact-size archival index list")
/* Copy (new) revision list entries to replacement list */
HDmemcpy(aix->list, new_aix.list, sizeof(H5FD_onion_index_entry_t) * new_aix.n_entries);
memcpy(aix->list, new_aix.list, sizeof(H5FD_onion_index_entry_t) * new_aix.n_entries);
aix->n_entries = new_aix.n_entries;
/* Copy (old) kept archival list entries to replacement list */
if (n_kept > 0) {
HDmemcpy(&aix->list[aix->n_entries], kept_list, sizeof(H5FD_onion_index_entry_t) * n_kept);
memcpy(&aix->list[aix->n_entries], kept_list, sizeof(H5FD_onion_index_entry_t) * n_kept);
aix->n_entries += n_kept;
}
+3 -3
View File
@@ -477,9 +477,9 @@ H5FD__sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
* determine if the values are the same or not. The actual return value
* shouldn't really matter...
*/
if (HDmemcmp(&(f1->device), &(f2->device), sizeof(dev_t)) < 0)
if (memcmp(&(f1->device), &(f2->device), sizeof(dev_t)) < 0)
HGOTO_DONE(-1)
if (HDmemcmp(&(f1->device), &(f2->device), sizeof(dev_t)) > 0)
if (memcmp(&(f1->device), &(f2->device), sizeof(dev_t)) > 0)
HGOTO_DONE(1)
#endif /* H5_DEV_T_IS_SCALAR */
if (f1->inode < f2->inode)
@@ -710,7 +710,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
if (0 == bytes_read) {
/* end of file but not end of format address space */
HDmemset(buf, 0, size);
memset(buf, 0, size);
break;
} /* end if */
+1 -1
View File
@@ -406,7 +406,7 @@ H5FD__splitter_populate_config(H5FD_splitter_vfd_config_t *vfd_config, H5FD_spli
assert(fapl_out);
HDmemset(fapl_out, 0, sizeof(H5FD_splitter_fapl_t));
memset(fapl_out, 0, sizeof(H5FD_splitter_fapl_t));
if (!vfd_config) {
vfd_config = H5MM_calloc(sizeof(H5FD_splitter_vfd_config_t));
+4 -4
View File
@@ -399,7 +399,7 @@ H5Pget_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *config_out)
}
else {
/* Copy the IOC fapl data out */
HDmemcpy(config_out, config_ptr, sizeof(H5FD_ioc_config_t));
memcpy(config_out, config_ptr, sizeof(H5FD_ioc_config_t));
}
done:
@@ -424,7 +424,7 @@ H5FD__ioc_get_default_config(H5FD_ioc_config_t *config_out)
assert(config_out);
HDmemset(config_out, 0, sizeof(*config_out));
memset(config_out, 0, sizeof(*config_out));
config_out->magic = H5FD_IOC_FAPL_MAGIC;
config_out->version = H5FD_IOC_CURR_FAPL_VERSION;
@@ -666,7 +666,7 @@ H5FD__ioc_fapl_copy(const void *_old_fa)
if (NULL == new_fa_ptr)
H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate log file FAPL");
HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_ioc_config_t));
memcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_ioc_config_t));
ret_value = (void *)new_fa_ptr;
@@ -790,7 +790,7 @@ H5FD__ioc_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
}
/* Fill in the file config values */
HDmemcpy(&file_ptr->fa, config_ptr, sizeof(H5FD_ioc_config_t));
memcpy(&file_ptr->fa, config_ptr, sizeof(H5FD_ioc_config_t));
/* Fully resolve the given filepath and get its dirname */
if (H5_resolve_pathname(name, file_ptr->comm, &file_ptr->file_path) < 0)
+3 -3
View File
@@ -389,7 +389,7 @@ ioc_main(ioc_data_t *ioc_data)
* Zero out work request, since the received message should
* be smaller than sizeof(sf_work_request_t)
*/
HDmemset(&wk_req, 0, sizeof(sf_work_request_t));
memset(&wk_req, 0, sizeof(sf_work_request_t));
if (MPI_SUCCESS != (mpi_code = MPI_Recv(&wk_req, count, MPI_BYTE, source, tag,
context->sf_msg_comm, MPI_STATUS_IGNORE)))
@@ -1086,7 +1086,7 @@ ioc_file_read_data(int fd, int64_t file_offset, void *data_buffer, int64_t data_
assert(bytes_remaining > 0);
/* end of file but not end of format address space */
HDmemset(this_buffer, 0, (size_t)bytes_remaining);
memset(this_buffer, 0, (size_t)bytes_remaining);
break;
}
else {
@@ -1304,7 +1304,7 @@ ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr)
assert(entry_ptr);
assert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC);
HDmemcpy((void *)(&(entry_ptr->wk_req)), (const void *)wk_req_ptr, sizeof(sf_work_request_t));
memcpy((void *)(&(entry_ptr->wk_req)), (const void *)wk_req_ptr, sizeof(sf_work_request_t));
/* must obtain io_queue mutex before appending */
hg_thread_mutex_lock(&ioc_data->io_queue.q_mutex);
+13 -13
View File
@@ -553,7 +553,7 @@ H5Pget_fapl_subfiling(hid_t fapl_id, H5FD_subfiling_config_t *config_out)
}
else {
/* Copy the subfiling fapl data out */
HDmemcpy(config_out, config_ptr, sizeof(H5FD_subfiling_config_t));
memcpy(config_out, config_ptr, sizeof(H5FD_subfiling_config_t));
/* Copy the driver info value */
if (H5FD__copy_plist(config_ptr->ioc_fapl_id, &(config_out->ioc_fapl_id)) < 0)
@@ -574,7 +574,7 @@ H5FD__subfiling_get_default_config(hid_t fapl_id, H5FD_subfiling_config_t *confi
assert(config_out);
HDmemset(config_out, 0, sizeof(*config_out));
memset(config_out, 0, sizeof(*config_out));
config_out->magic = H5FD_SUBFILING_FAPL_MAGIC;
config_out->version = H5FD_SUBFILING_CURR_FAPL_VERSION;
@@ -811,7 +811,7 @@ H5FD__subfiling_sb_encode(H5FD_t *_file, char *name, unsigned char *buf)
/* Encode config file prefix string */
if (sf_context->config_file_prefix) {
HDmemcpy(p, sf_context->config_file_prefix, prefix_len);
memcpy(p, sf_context->config_file_prefix, prefix_len);
p += prefix_len;
}
@@ -819,14 +819,14 @@ H5FD__subfiling_sb_encode(H5FD_t *_file, char *name, unsigned char *buf)
if (file->sf_file) {
char ioc_name[9];
HDmemset(ioc_name, 0, sizeof(ioc_name));
memset(ioc_name, 0, sizeof(ioc_name));
if (H5FD_sb_encode(file->sf_file, ioc_name, p + 9) < 0)
H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTENCODE, FAIL,
"unable to encode IOC VFD's superblock information");
/* Copy the IOC VFD's name into our buffer */
HDmemcpy(p, ioc_name, 9);
memcpy(p, ioc_name, 9);
}
done:
@@ -893,7 +893,7 @@ H5FD__subfiling_sb_decode(H5FD_t *_file, const char *name, const unsigned char *
H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"can't allocate space for config file prefix string");
HDmemcpy(sf_context->config_file_prefix, p, tmpu64);
memcpy(sf_context->config_file_prefix, p, tmpu64);
/* Just in case.. */
sf_context->config_file_prefix[tmpu64 - 1] = '\0';
@@ -905,7 +905,7 @@ H5FD__subfiling_sb_decode(H5FD_t *_file, const char *name, const unsigned char *
if (file->sf_file) {
char ioc_name[9];
HDmemcpy(ioc_name, p, 9);
memcpy(ioc_name, p, 9);
p += 9;
if (H5FD_sb_load(file->sf_file, ioc_name, p) < 0)
@@ -960,7 +960,7 @@ H5FD__subfiling_fapl_get(H5FD_t *_file)
}
/* Copy the fields of the structure */
HDmemcpy(fa, &(file->fa), sizeof(H5FD_subfiling_config_t));
memcpy(fa, &(file->fa), sizeof(H5FD_subfiling_config_t));
/* Copy the driver info value */
if (H5FD__copy_plist(file->fa.ioc_fapl_id, &(fa->ioc_fapl_id)) < 0)
@@ -1036,7 +1036,7 @@ H5FD__subfiling_fapl_copy(const void *_old_fa)
H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
}
HDmemcpy(new_fa, old_fa, sizeof(H5FD_subfiling_config_t));
memcpy(new_fa, old_fa, sizeof(H5FD_subfiling_config_t));
if (H5FD__copy_plist(old_fa->ioc_fapl_id, &(new_fa->ioc_fapl_id)) < 0)
H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy the IOC FAPL");
@@ -1169,7 +1169,7 @@ H5FD__subfiling_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t ma
config_ptr = &default_config;
}
HDmemcpy(&file_ptr->fa, config_ptr, sizeof(H5FD_subfiling_config_t));
memcpy(&file_ptr->fa, config_ptr, sizeof(H5FD_subfiling_config_t));
if (H5FD__copy_plist(config_ptr->ioc_fapl_id, &(file_ptr->fa.ioc_fapl_id)) < 0) {
file_ptr->fa.ioc_fapl_id = H5I_INVALID_HID;
H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy FAPL");
@@ -2844,9 +2844,9 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne
_target_file_offset = target_file_offset + output_offset;
_io_block_len = io_block_len + output_offset;
HDmemset(_mem_buf_offset, 0, (max_iovec_len * sizeof(*_mem_buf_offset)));
HDmemset(_target_file_offset, 0, (max_iovec_len * sizeof(*_target_file_offset)));
HDmemset(_io_block_len, 0, (max_iovec_len * sizeof(*_io_block_len)));
memset(_mem_buf_offset, 0, (max_iovec_len * sizeof(*_mem_buf_offset)));
memset(_target_file_offset, 0, (max_iovec_len * sizeof(*_target_file_offset)));
memset(_io_block_len, 0, (max_iovec_len * sizeof(*_io_block_len)));
if (total_bytes == data_size) {
*n_subfiles_used = i;
+4 -4
View File
@@ -179,8 +179,8 @@ H5_get_subfiling_object(int64_t object_id)
sf_context_cache_size = new_size;
/* Clear newly-allocated entries */
HDmemset(&sf_context_cache[old_num_entries], 0,
(sf_context_cache_size - old_num_entries) * sizeof(*sf_context_cache));
memset(&sf_context_cache[old_num_entries], 0,
(sf_context_cache_size - old_num_entries) * sizeof(*sf_context_cache));
/*
* If we had to make more space, the given object index
@@ -236,8 +236,8 @@ H5_get_subfiling_object(int64_t object_id)
sf_topology_cache_size = new_size;
/* Clear newly-allocated entries */
HDmemset(&sf_topology_cache[old_num_entries], 0,
(sf_topology_cache_size - old_num_entries) * sizeof(*sf_topology_cache));
memset(&sf_topology_cache[old_num_entries], 0,
(sf_topology_cache_size - old_num_entries) * sizeof(*sf_topology_cache));
/*
* If we had to make more space, the given object index
+15 -15
View File
@@ -337,7 +337,7 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj)
#endif /* H5FL_TRACK */
#ifdef H5FL_DEBUG
HDmemset(obj, 255, head->size);
memset(obj, 255, head->size);
#endif /* H5FL_DEBUG */
/* Make certain that the free list is initialized */
@@ -470,7 +470,7 @@ H5FL_reg_calloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS)
/* Clear to zeros */
/* (Accommodate tracking information, if present) */
HDmemset(ret_value, 0, head->size - H5FL_TRACK_SIZE);
memset(ret_value, 0, head->size - H5FL_TRACK_SIZE);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -917,7 +917,7 @@ H5FL_blk_calloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Clear the block to zeros */
HDmemset(ret_value, 0, size);
memset(ret_value, 0, size);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -957,7 +957,7 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block)
unsigned char *block_ptr = ((unsigned char *)block) - sizeof(H5FL_track_t);
H5FL_track_t trk;
HDmemcpy(&trk, block_ptr, sizeof(H5FL_track_t));
memcpy(&trk, block_ptr, sizeof(H5FL_track_t));
/* Free tracking information about the allocation location */
H5CS_close_stack(trk.stack);
@@ -979,7 +979,7 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block)
trk.next->prev = trk.prev;
} /* end else */
HDmemcpy(block_ptr, &trk, sizeof(H5FL_track_t));
memcpy(block_ptr, &trk, sizeof(H5FL_track_t));
}
#endif /* H5FL_TRACK */
@@ -993,7 +993,7 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block)
free_size = temp->size;
#ifdef H5FL_DEBUG
HDmemset(temp, 255, free_size + sizeof(H5FL_blk_list_t) + H5FL_TRACK_SIZE);
memset(temp, 255, free_size + sizeof(H5FL_blk_list_t) + H5FL_TRACK_SIZE);
#endif /* H5FL_DEBUG */
/* Check if there is a free list for native blocks of this size */
@@ -1079,7 +1079,7 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size H5FL_TRACK_
unsigned char *block_ptr = ((unsigned char *)block) - sizeof(H5FL_track_t);
H5FL_track_t trk;
HDmemcpy(&trk, block_ptr, sizeof(H5FL_track_t));
memcpy(&trk, block_ptr, sizeof(H5FL_track_t));
/* Release previous tracking information */
H5CS_close_stack(trk.stack);
@@ -1099,7 +1099,7 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size H5FL_TRACK_
trk.func = call_func;
trk.line = call_line;
HDmemcpy(block_ptr, &trk, sizeof(H5FL_track_t));
memcpy(block_ptr, &trk, sizeof(H5FL_track_t));
}
#endif /* H5FL_TRACK */
ret_value = block;
@@ -1380,7 +1380,7 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj)
unsigned char *block_ptr = ((unsigned char *)obj) - sizeof(H5FL_track_t);
H5FL_track_t trk;
HDmemcpy(&trk, block_ptr, sizeof(H5FL_track_t));
memcpy(&trk, block_ptr, sizeof(H5FL_track_t));
/* Free tracking information about the allocation location */
H5CS_close_stack(trk.stack);
@@ -1402,7 +1402,7 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj)
trk.next->prev = trk.prev;
} /* end else */
HDmemcpy(block_ptr, &trk, sizeof(H5FL_track_t));
memcpy(block_ptr, &trk, sizeof(H5FL_track_t));
}
#endif
@@ -1570,7 +1570,7 @@ H5FL_arr_calloc(H5FL_arr_head_t *head, size_t elem H5FL_TRACK_PARAMS)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Clear to zeros */
HDmemset(ret_value, 0, head->list_arr[elem].size);
memset(ret_value, 0, head->list_arr[elem].size);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1631,7 +1631,7 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void *obj, size_t new_elem H5FL_TRACK_PA
unsigned char *block_ptr = ((unsigned char *)obj) - sizeof(H5FL_track_t);
H5FL_track_t trk;
HDmemcpy(&trk, block_ptr, sizeof(H5FL_track_t));
memcpy(&trk, block_ptr, sizeof(H5FL_track_t));
/* Release previous tracking information */
H5CS_close_stack(trk.stack);
@@ -1651,7 +1651,7 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void *obj, size_t new_elem H5FL_TRACK_PA
trk.func = call_func;
trk.line = call_line;
HDmemcpy(block_ptr, &trk, sizeof(H5FL_track_t));
memcpy(block_ptr, &trk, sizeof(H5FL_track_t));
#endif
ret_value = obj;
}
@@ -2047,7 +2047,7 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj)
#endif /* H5FL_TRACK */
#ifdef H5FL_DEBUG
HDmemset(obj, 255, head->size);
memset(obj, 255, head->size);
#endif /* H5FL_DEBUG */
/* Make certain that the free list is initialized */
@@ -2178,7 +2178,7 @@ H5FL_fac_calloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS)
/* Clear to zeros */
/* (Accommodate tracking information, if present) */
HDmemset(ret_value, 0, head->size - H5FL_TRACK_SIZE);
memset(ret_value, 0, head->size - H5FL_TRACK_SIZE);
done:
FUNC_LEAVE_NOAPI(ret_value)
+2 -2
View File
@@ -237,7 +237,7 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len
fspace->addr = udata->addr;
/* Magic number */
if (HDmemcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space header signature")
image += H5_SIZEOF_MAGIC;
@@ -946,7 +946,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l
H5_CHECKED_ASSIGN(old_sect_size, size_t, fspace->sect_size, hsize_t);
/* Magic number */
if (HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space sections signature")
image += H5_SIZEOF_MAGIC;
+11 -11
View File
@@ -147,7 +147,7 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t si
accum->alloc_size = new_alloc_size;
/* Clear the memory */
HDmemset(accum->buf + accum->size, 0, (accum->alloc_size - accum->size));
memset(accum->buf + accum->size, 0, (accum->alloc_size - accum->size));
} /* end if */
/* Read the part before the metadata accumulator */
@@ -156,7 +156,7 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t si
H5_CHECKED_ASSIGN(amount_before, size_t, (accum->loc - addr), hsize_t);
/* Make room for the metadata to read in */
HDmemmove(accum->buf + amount_before, accum->buf, accum->size);
memmove(accum->buf + amount_before, accum->buf, accum->size);
/* Adjust dirty region tracking info, if present */
if (accum->dirty)
@@ -360,7 +360,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, H5F_accum_adjust_t adju
/* When appending, need to adjust location of accumulator */
if (H5F_ACCUM_APPEND == adjust) {
/* Move remnant of accumulator down */
HDmemmove(accum->buf, (accum->buf + shrink_size), remnant_size);
memmove(accum->buf, (accum->buf + shrink_size), remnant_size);
/* Adjust accumulator's location */
accum->loc += shrink_size;
@@ -380,7 +380,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, H5F_accum_adjust_t adju
accum->alloc_size = new_size;
/* Clear the memory */
HDmemset(accum->buf + accum->size, 0, (accum->alloc_size - (accum->size + size)));
memset(accum->buf + accum->size, 0, (accum->alloc_size - (accum->size + size)));
} /* end if */
} /* end if */
@@ -434,7 +434,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s
HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator")
/* Move the existing metadata to the proper location */
HDmemmove(accum->buf + size, accum->buf, accum->size);
memmove(accum->buf + size, accum->buf, accum->size);
/* Copy the new metadata at the front */
H5MM_memcpy(accum->buf, buf, size);
@@ -524,7 +524,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s
H5_CHECKED_ASSIGN(old_offset, size_t, (addr + size) - accum->loc, hsize_t);
/* Move the existing metadata to the proper location */
HDmemmove(accum->buf + size, accum->buf + old_offset, (accum->size - old_offset));
memmove(accum->buf + size, accum->buf + old_offset, (accum->size - old_offset));
/* Copy the new metadata at the front */
H5MM_memcpy(accum->buf, buf, size);
@@ -607,7 +607,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s
accum->alloc_size = new_alloc_size;
/* Clear the memory */
HDmemset(accum->buf + size, 0, (accum->alloc_size - size));
memset(accum->buf + size, 0, (accum->alloc_size - size));
} /* end if */
/* Copy the new metadata to the buffer */
@@ -654,7 +654,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s
/* Clear the memory */
clear_size = MAX(accum->size, size);
HDmemset(accum->buf + clear_size, 0, (accum->alloc_size - clear_size));
memset(accum->buf + clear_size, 0, (accum->alloc_size - clear_size));
} /* end if */
else {
/* Check if we should shrink the accumulator buffer */
@@ -704,7 +704,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s
accum->alloc_size = new_size;
/* Clear the memory */
HDmemset(accum->buf + size, 0, (accum->alloc_size - size));
memset(accum->buf + size, 0, (accum->alloc_size - size));
} /* end if */
/* Update the metadata accumulator information */
@@ -771,7 +771,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s
/* Trim bottom of accumulator off */
accum->loc += overlap_size;
accum->size -= overlap_size;
HDmemmove(accum->buf, accum->buf + overlap_size, accum->size);
memmove(accum->buf, accum->buf + overlap_size, accum->size);
} /* end if */
else { /* Access covers whole accumulator */
/* Reset accumulator, but don't flush */
@@ -881,7 +881,7 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr
new_accum_size = accum->size - overlap_size;
/* Move the accumulator buffer information to eliminate the freed block */
HDmemmove(accum->buf, accum->buf + overlap_size, new_accum_size);
memmove(accum->buf, accum->buf + overlap_size, new_accum_size);
/* Adjust the accumulator information */
accum->loc += overlap_size;
+3 -3
View File
@@ -113,13 +113,13 @@ H5F_cwfs_add(H5F_t *f, H5HG_heap_t *heap)
for (i = H5F_NCWFS - 1; i >= 0; --i)
if (H5HG_FREE_SIZE(f->shared->cwfs[i]) < H5HG_FREE_SIZE(heap)) {
HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, (size_t)i * sizeof(H5HG_heap_t *));
memmove(f->shared->cwfs + 1, f->shared->cwfs, (size_t)i * sizeof(H5HG_heap_t *));
f->shared->cwfs[0] = heap;
break;
} /* end if */
}
else {
HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, f->shared->ncwfs * sizeof(H5HG_heap_t *));
memmove(f->shared->cwfs + 1, f->shared->cwfs, f->shared->ncwfs * sizeof(H5HG_heap_t *));
f->shared->cwfs[0] = heap;
f->shared->ncwfs += 1;
} /* end else */
@@ -288,7 +288,7 @@ H5F_cwfs_remove_heap(H5F_shared_t *shared, H5HG_heap_t *heap)
for (u = 0; u < shared->ncwfs; u++) {
if (shared->cwfs[u] == heap) {
shared->ncwfs -= 1;
HDmemmove(shared->cwfs + u, shared->cwfs + u + 1, (shared->ncwfs - u) * sizeof(H5HG_heap_t *));
memmove(shared->cwfs + u, shared->cwfs + u + 1, (shared->ncwfs - u) * sizeof(H5HG_heap_t *));
break;
} /* end if */
} /* end for */
+4 -4
View File
@@ -3211,7 +3211,7 @@ H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, size_t *image_le
tmp_size = H5F_SUPER_STATUS_FLAGS_SIZE(file->shared->sblock->super_vers);
/* Clear "status_flags" */
HDmemset((uint8_t *)buf_ptr + tmp, 0, tmp_size);
memset((uint8_t *)buf_ptr + tmp, 0, tmp_size);
} /* end if */
/* Set *image_len = to EOA */
@@ -3243,7 +3243,7 @@ H5F__get_info(H5F_t *f, H5F_info2_t *finfo)
assert(finfo);
/* Reset file info struct */
HDmemset(finfo, 0, sizeof(*finfo));
memset(finfo, 0, sizeof(*finfo));
/* Get the size of the superblock and any superblock extensions */
if (H5F__super_size(f, &finfo->super.super_size, &finfo->super.super_ext_size) < 0)
@@ -3336,7 +3336,7 @@ H5F_set_retries(H5F_t *f)
assert(f);
/* Initialize the tracking for metadata read retries */
HDmemset(f->shared->retries, 0, sizeof(f->shared->retries));
memset(f->shared->retries, 0, sizeof(f->shared->retries));
/* Initialize the # of bins for retries */
f->shared->retries_nbins = 0;
@@ -3524,7 +3524,7 @@ H5F_get_metadata_read_retry_info(H5F_t *file, H5F_retry_info_t *info)
info->nbins = file->shared->retries_nbins;
/* Initialize the array of "retries" */
HDmemset(info->retries, 0, sizeof(info->retries));
memset(info->retries, 0, sizeof(info->retries));
/* Return if there are no bins -- no retries */
if (!info->nbins)
+8 -8
View File
@@ -65,8 +65,8 @@ H5F__close_mounts(H5F_t *f)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close child file")
/* Eliminate the mount point from the table */
HDmemmove(f->shared->mtab.child + u, f->shared->mtab.child + u + 1,
(f->shared->mtab.nmounts - u - 1) * sizeof(f->shared->mtab.child[0]));
memmove(f->shared->mtab.child + u, f->shared->mtab.child + u + 1,
(f->shared->mtab.nmounts - u - 1) * sizeof(f->shared->mtab.child[0]));
f->shared->mtab.nmounts--;
f->nmounts--;
}
@@ -195,8 +195,8 @@ H5F_mount(const H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UN
}
/* Insert into table */
HDmemmove(parent->shared->mtab.child + md + 1, parent->shared->mtab.child + md,
(parent->shared->mtab.nmounts - md) * sizeof(parent->shared->mtab.child[0]));
memmove(parent->shared->mtab.child + md + 1, parent->shared->mtab.child + md,
(parent->shared->mtab.nmounts - md) * sizeof(parent->shared->mtab.child[0]));
parent->shared->mtab.nmounts++;
parent->nmounts++;
parent->shared->mtab.child[md].group = mount_point;
@@ -356,10 +356,10 @@ H5F_unmount(const H5G_loc_t *loc, const char *name)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to replace name")
/* Eliminate the mount point from the table */
HDmemmove(parent->shared->mtab.child + (unsigned)child_idx,
(parent->shared->mtab.child + (unsigned)child_idx) + 1,
((parent->shared->mtab.nmounts - (unsigned)child_idx) - 1) *
sizeof(parent->shared->mtab.child[0]));
memmove(parent->shared->mtab.child + (unsigned)child_idx,
(parent->shared->mtab.child + (unsigned)child_idx) + 1,
((parent->shared->mtab.nmounts - (unsigned)child_idx) - 1) *
sizeof(parent->shared->mtab.child[0]));
parent->shared->mtab.nmounts -= 1;
parent->nmounts -= 1;
+1 -1
View File
@@ -1367,7 +1367,7 @@ H5F__super_init(H5F_t *f)
assert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE);
/* Encode driver-specific data */
HDmemset(dbuf, 0, sizeof(dbuf));
memset(dbuf, 0, sizeof(dbuf));
if (H5FD_sb_encode(f->shared->lf, info.name, dbuf) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information")
+2 -2
View File
@@ -164,7 +164,7 @@ H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, hbool_
/* Magic */
if (H5_IS_BUFFER_OVERFLOW(image, H5_SIZEOF_MAGIC, image_end))
HGOTO_ERROR(H5E_SYM, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding");
if (HDmemcmp(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, NULL, "bad symbol table node signature")
image += H5_SIZEOF_MAGIC;
@@ -268,7 +268,7 @@ H5G__cache_node_serialize(const H5F_t *f, void *_image, size_t len, void *_thing
HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't serialize")
/* Clear rest of symbol table node */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
memset(image, 0, len - (size_t)(image - (uint8_t *)_image));
done:
FUNC_LEAVE_NOAPI(ret_value)
+3 -3
View File
@@ -260,7 +260,7 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline)
/* Set fractal heap creation parameters */
/* XXX: Give some control of these to applications? */
HDmemset(&fheap_cparam, 0, sizeof(fheap_cparam));
memset(&fheap_cparam, 0, sizeof(fheap_cparam));
fheap_cparam.managed.width = H5G_FHEAP_MAN_WIDTH;
fheap_cparam.managed.start_block_size = H5G_FHEAP_MAN_START_BLOCK_SIZE;
fheap_cparam.managed.max_direct_size = H5G_FHEAP_MAN_MAX_DIRECT_SIZE;
@@ -285,7 +285,7 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline)
assert(fheap_id_len == H5G_DENSE_FHEAP_ID_LEN);
/* Create the name index v2 B-tree */
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
memset(&bt2_cparam, 0, sizeof(bt2_cparam));
bt2_cparam.cls = H5G_BT2_NAME;
bt2_cparam.node_size = (size_t)H5G_NAME_BT2_NODE_SIZE;
H5_CHECK_OVERFLOW(fheap_id_len, /* From: */ hsize_t, /* To: */ uint32_t);
@@ -303,7 +303,7 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline)
/* Check if we should create a creation order index v2 B-tree */
if (linfo->index_corder) {
/* Create the creation order index v2 B-tree */
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
memset(&bt2_cparam, 0, sizeof(bt2_cparam));
bt2_cparam.cls = H5G_BT2_CORDER;
bt2_cparam.node_size = (size_t)H5G_CORDER_BT2_NODE_SIZE;
H5_CHECK_OVERFLOW(fheap_id_len, /* From: */ hsize_t, /* To: */ uint32_t);
+1 -1
View File
@@ -1075,7 +1075,7 @@ H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, H5
/* Reset stat buffer */
if (statbuf)
HDmemset(statbuf, 0, sizeof(H5G_stat_t));
memset(statbuf, 0, sizeof(H5G_stat_t));
/* Set up user data for retrieving information */
udata.statbuf = statbuf;
+2 -2
View File
@@ -266,7 +266,7 @@ H5G_ent_encode(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent)
/* fill with zero */
if (*pp < p_ret)
HDmemset(*pp, 0, (size_t)(p_ret - *pp));
memset(*pp, 0, (size_t)(p_ret - *pp));
*pp = p_ret;
done:
@@ -336,7 +336,7 @@ H5G__ent_reset(H5G_entry_t *ent)
assert(ent);
/* Clear the symbol table entry to an empty state */
HDmemset(ent, 0, sizeof(H5G_entry_t));
memset(ent, 0, sizeof(H5G_entry_t));
ent->header = HADDR_UNDEF;
FUNC_LEAVE_NOAPI_VOID
+2 -2
View File
@@ -251,7 +251,7 @@ H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, hid_t g
/* Set up group creation info */
gcrt_info.gcpl_id = gcpl_id;
gcrt_info.cache_type = H5G_NOTHING_CACHED;
HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache));
memset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache));
/* Set up object creation information */
ocrt_info.obj_type = H5O_TYPE_GROUP;
@@ -1098,7 +1098,7 @@ H5G_visit(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_o
herr_t ret_value = FAIL; /* Return value */
/* Portably clear udata struct (before FUNC_ENTER) */
HDmemset(&udata, 0, sizeof(udata));
memset(&udata, 0, sizeof(udata));
FUNC_ENTER_NOAPI(FAIL)
+2 -2
View File
@@ -503,7 +503,7 @@ H5G_name_reset(H5G_name_t *name)
assert(name);
/* Clear the group hier. name to an empty state */
HDmemset(name, 0, sizeof(H5G_name_t));
memset(name, 0, sizeof(H5G_name_t));
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5G_name_reset() */
@@ -1111,7 +1111,7 @@ H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size, si
herr_t ret_value = SUCCEED; /* Return value */
/* Portably clear udata struct (before FUNC_ENTER) */
HDmemset(&udata, 0, sizeof(udata));
memset(&udata, 0, sizeof(udata));
FUNC_ENTER_NOAPI(FAIL)
+5 -5
View File
@@ -610,7 +610,7 @@ H5G__node_insert(H5F_t *f, haddr_t addr, void H5_ATTR_UNUSED *_lt_key, hbool_t H
snrt_flags |= H5AC__DIRTIED_FLAG;
/* The left node */
HDmemset(sn->entry + H5F_SYM_LEAF_K(f), 0, H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t));
memset(sn->entry + H5F_SYM_LEAF_K(f), 0, H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t));
sn->nsyms = H5F_SYM_LEAF_K(f);
sn_flags |= H5AC__DIRTIED_FLAG;
@@ -645,8 +645,8 @@ H5G__node_insert(H5F_t *f, haddr_t addr, void H5_ATTR_UNUSED *_lt_key, hbool_t H
/* Move entries down to make room for new entry */
assert(idx >= 0);
HDmemmove(insert_into->entry + idx + 1, insert_into->entry + idx,
(insert_into->nsyms - (unsigned)idx) * sizeof(H5G_entry_t));
memmove(insert_into->entry + idx + 1, insert_into->entry + idx,
(insert_into->nsyms - (unsigned)idx) * sizeof(H5G_entry_t));
/* Copy new entry into table */
H5G__ent_copy(&(insert_into->entry[idx]), &ent, H5_COPY_SHALLOW);
@@ -810,7 +810,7 @@ H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*i
*/
sn->nsyms -= 1;
sn_flags |= H5AC__DIRTIED_FLAG;
HDmemmove(sn->entry + idx, sn->entry + idx + 1, (sn->nsyms - idx) * sizeof(H5G_entry_t));
memmove(sn->entry + idx, sn->entry + idx + 1, (sn->nsyms - idx) * sizeof(H5G_entry_t));
ret_value = H5B_INS_NOOP;
}
else if (idx + 1 == sn->nsyms) {
@@ -832,7 +832,7 @@ H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*i
*/
sn->nsyms -= 1;
sn_flags |= H5AC__DIRTIED_FLAG;
HDmemmove(sn->entry + idx, sn->entry + idx + 1, (sn->nsyms - idx) * sizeof(H5G_entry_t));
memmove(sn->entry + idx, sn->entry + idx + 1, (sn->nsyms - idx) * sizeof(H5G_entry_t));
ret_value = H5B_INS_NOOP;
} /* end else */
} /* end if */
+1 -1
View File
@@ -681,7 +681,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t
herr_t ret_value = SUCCEED; /* Return value */
/* Portably clear udata struct (before FUNC_ENTER) */
HDmemset(&udata, 0, sizeof(udata));
memset(&udata, 0, sizeof(udata));
FUNC_ENTER_NOAPI(FAIL)
+1 -1
View File
@@ -669,7 +669,7 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G
/* XXX: Should we allow user to control the group creation params here? -QAK */
gcrt_info.gcpl_id = H5P_GROUP_CREATE_DEFAULT;
gcrt_info.cache_type = H5G_NOTHING_CACHED;
HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache));
memset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache));
if (H5G__obj_create_real(grp_oloc.file, ginfo, linfo, pline, &gcrt_info,
obj_loc.oloc /*out*/) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry")
+6 -6
View File
@@ -203,7 +203,7 @@ H5HF__hdr_prefix_decode(H5HF_hdr_t *hdr, const uint8_t **image_ref)
assert(image);
/* Magic number */
if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "wrong fractal heap header signature")
image += H5_SIZEOF_MAGIC;
@@ -945,7 +945,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
assert(iblock->size == len);
/* Magic number */
if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap indirect block signature")
image += H5_SIZEOF_MAGIC;
@@ -1602,7 +1602,7 @@ 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 */
HDmemset(chk_p, 0, (size_t)H5HF_SIZEOF_CHKSUM);
memset(chk_p, 0, (size_t)H5HF_SIZEOF_CHKSUM);
/* Compute checksum on entire direct block */
computed_chksum = H5_checksum_metadata(read_buf, len, 0);
@@ -1680,7 +1680,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo
/* Allocate space for the fractal heap direct block */
if (NULL == (dblock = H5FL_CALLOC(H5HF_direct_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
HDmemset(&dblock->cache_info, 0, sizeof(H5AC_info_t));
memset(&dblock->cache_info, 0, sizeof(H5AC_info_t));
/* Set the shared heap header's file context for this operation */
hdr->f = udata->f;
@@ -1759,7 +1759,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo
image = dblock->blk;
/* Magic number */
if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap direct block signature")
image += H5_SIZEOF_MAGIC;
@@ -2048,7 +2048,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le
uint32_t metadata_chksum; /* Computed metadata checksum value */
/* Clear the checksum field, to compute the checksum */
HDmemset(image, 0, (size_t)H5HF_SIZEOF_CHKSUM);
memset(image, 0, (size_t)H5HF_SIZEOF_CHKSUM);
/* Compute checksum on entire direct block */
metadata_chksum = H5_checksum_metadata(dblock->blk, dblock->size, 0);
+2 -2
View File
@@ -99,7 +99,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fractal heap direct block")
/* Reset the metadata cache info for the heap header */
HDmemset(&dblock->cache_info, 0, sizeof(H5AC_info_t));
memset(&dblock->cache_info, 0, sizeof(H5AC_info_t));
/* Share common heap information */
dblock->hdr = hdr;
@@ -129,7 +129,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
/* XXX: Change to using free-list factories */
if ((dblock->blk = H5FL_BLK_MALLOC(direct_block, dblock->size)) == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
HDmemset(dblock->blk, 0, dblock->size);
memset(dblock->blk, 0, dblock->size);
dblock->write_buf = NULL;
dblock->write_size = 0;
+1 -1
View File
@@ -945,7 +945,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
"memory allocation failed for fractal heap indirect block")
/* Reset the metadata cache info for the heap header */
HDmemset(&iblock->cache_info, 0, sizeof(H5AC_info_t));
memset(&iblock->cache_info, 0, sizeof(H5AC_info_t));
/* Share common heap information */
iblock->hdr = hdr;
+1 -1
View File
@@ -86,7 +86,7 @@ H5HF__man_iter_init(H5HF_block_iter_t *biter)
assert(biter);
/* Reset block iterator information */
HDmemset(biter, 0, sizeof(H5HF_block_iter_t));
memset(biter, 0, sizeof(H5HF_block_iter_t));
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5HF__man_iter_init() */
+6 -6
View File
@@ -2747,8 +2747,8 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h
/* Adjust direct row sections for indirect section */
if (sect->u.indirect.dir_nrows > 0) {
assert(sect->u.indirect.dir_rows);
HDmemmove(&sect->u.indirect.dir_rows[0], &sect->u.indirect.dir_rows[1],
sect->u.indirect.dir_nrows * sizeof(H5HF_free_section_t *));
memmove(&sect->u.indirect.dir_rows[0], &sect->u.indirect.dir_rows[1],
sect->u.indirect.dir_nrows * sizeof(H5HF_free_section_t *));
assert(sect->u.indirect.dir_rows[0]);
/* Make new "first row" in indirect section */
@@ -2841,8 +2841,8 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h
/* Transfer row sections between current & peer sections */
H5MM_memcpy(&peer_sect->u.indirect.dir_rows[0], &sect->u.indirect.dir_rows[0],
(sizeof(H5HF_free_section_t *) * peer_dir_nrows));
HDmemmove(&sect->u.indirect.dir_rows[0], &sect->u.indirect.dir_rows[peer_dir_nrows],
(sizeof(H5HF_free_section_t *) * (sect->u.indirect.dir_nrows - peer_dir_nrows)));
memmove(&sect->u.indirect.dir_rows[0], &sect->u.indirect.dir_rows[peer_dir_nrows],
(sizeof(H5HF_free_section_t *) * (sect->u.indirect.dir_nrows - peer_dir_nrows)));
sect->u.indirect.dir_nrows -= peer_dir_nrows;
assert(row_sect == sect->u.indirect.dir_rows[0]);
@@ -2991,8 +2991,8 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned
/* Adjust indirect entry information */
sect->u.indirect.indir_nents--;
HDmemmove(&sect->u.indirect.indir_ents[0], &sect->u.indirect.indir_ents[1],
sect->u.indirect.indir_nents * sizeof(H5HF_free_section_t *));
memmove(&sect->u.indirect.indir_ents[0], &sect->u.indirect.indir_ents[1],
sect->u.indirect.indir_nents * sizeof(H5HF_free_section_t *));
assert(sect->u.indirect.indir_ents[0]);
/* Make new "first row" in new first indirect child section */
+1 -1
View File
@@ -152,7 +152,7 @@ H5HF__tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id)
} /* end else */
H5MM_memcpy(id, obj, obj_size);
HDmemset(id + obj_size, 0, (hdr->id_len - ((size_t)1 + (size_t)hdr->tiny_len_extended + obj_size)));
memset(id + obj_size, 0, (hdr->id_len - ((size_t)1 + (size_t)hdr->tiny_len_extended + obj_size)));
/* Update statistics about heap */
hdr->tiny_size += obj_size;
+5 -5
View File
@@ -142,7 +142,7 @@ H5HG__create(H5F_t *f, size_t size)
if (NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed")
HDmemset(heap->chunk, 0, size);
memset(heap->chunk, 0, size);
heap->nalloc = H5HG_NOBJS(f, size);
heap->nused = 1; /* account for index 0, which is used for the free object */
if (NULL == (heap->obj = H5FL_SEQ_MALLOC(H5HG_obj_t, heap->nalloc)))
@@ -303,7 +303,7 @@ H5HG__alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr)
HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, 0, "memory allocation failed")
/* Clear newly allocated space */
HDmemset(&new_obj[heap->nalloc], 0, (new_alloc - heap->nalloc) * sizeof(heap->obj[0]));
memset(&new_obj[heap->nalloc], 0, (new_alloc - heap->nalloc) * sizeof(heap->obj[0]));
/* Update heap information */
heap->nalloc = new_alloc;
@@ -401,7 +401,7 @@ H5HG_extend(H5F_t *f, haddr_t addr, size_t need)
/* Re-allocate the heap information in memory */
if (NULL == (new_chunk = H5FL_BLK_REALLOC(gheap_chunk, heap->chunk, (heap->size + need))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "new heap allocation failed")
HDmemset(new_chunk + heap->size, 0, need);
memset(new_chunk + heap->size, 0, need);
/* Adjust the size of the heap */
old_size = heap->size;
@@ -745,7 +745,7 @@ H5HG_remove(H5F_t *f, H5HG_t *hobj)
} /* end if */
else
heap->obj[0].size += need;
HDmemmove(obj_start, obj_start + need, heap->size - (size_t)((obj_start + need) - heap->chunk));
memmove(obj_start, obj_start + need, heap->size - (size_t)((obj_start + need) - heap->chunk));
if (heap->obj[0].size >= H5HG_SIZEOF_OBJHDR(f)) {
p = heap->obj[0].begin;
UINT16ENCODE(p, 0); /*id*/
@@ -753,7 +753,7 @@ H5HG_remove(H5F_t *f, H5HG_t *hobj)
UINT32ENCODE(p, 0); /*reserved*/
H5F_ENCODE_LENGTH(f, p, heap->obj[0].size);
} /* end if */
HDmemset(heap->obj + hobj->idx, 0, sizeof(H5HG_obj_t));
memset(heap->obj + hobj->idx, 0, sizeof(H5HG_obj_t));
flags |= H5AC__DIRTIED_FLAG;
if ((heap->obj[0].size + H5HG_SIZEOF_HDR(f)) == heap->size) {
+2 -2
View File
@@ -116,7 +116,7 @@ H5HG__hdr_deserialize(H5HG_heap_t *heap, const uint8_t *image, size_t len, const
/* Magic number */
if (H5_IS_BUFFER_OVERFLOW(image, H5_SIZEOF_MAGIC, p_end))
HGOTO_ERROR(H5E_HEAP, H5E_OVERFLOW, FAIL, "ran off end of input buffer while decoding");
if (HDmemcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad global heap collection signature")
image += H5_SIZEOF_MAGIC;
@@ -312,7 +312,7 @@ H5HG__cache_heap_deserialize(const void *_image, size_t len, void *_udata, hbool
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Clear newly allocated space */
HDmemset(&new_obj[heap->nalloc], 0, (new_alloc - heap->nalloc) * sizeof(heap->obj[0]));
memset(&new_obj[heap->nalloc], 0, (new_alloc - heap->nalloc) * sizeof(heap->obj[0]));
/* Update heap information */
heap->nalloc = new_alloc;
+1 -1
View File
@@ -695,7 +695,7 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of
/* Clear new section so junk doesn't appear in the file */
/* (Avoid clearing section which will be overwritten with newly inserted data) */
HDmemset(heap->dblk_image + offset + buf_size, 0, (new_dblk_size - (offset + buf_size)));
memset(heap->dblk_image + offset + buf_size, 0, (new_dblk_size - (offset + buf_size)));
}
/* Copy the data into the heap */
+4 -4
View File
@@ -158,7 +158,7 @@ H5HL__hdr_deserialize(H5HL_t *heap, const uint8_t *image, size_t len, H5HL_cache
/* Magic number */
if (H5_IS_BUFFER_OVERFLOW(image, H5_SIZEOF_MAGIC, p_end))
HGOTO_ERROR(H5E_HEAP, H5E_OVERFLOW, FAIL, "ran off end of input buffer while decoding");
if (HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
if (memcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad local heap signature")
image += H5_SIZEOF_MAGIC;
@@ -355,7 +355,7 @@ H5HL__cache_prefix_get_final_load_size(const void *_image, size_t image_len, voi
assert(actual_len);
assert(*actual_len == image_len);
HDmemset(&heap, 0, sizeof(H5HL_t));
memset(&heap, 0, sizeof(H5HL_t));
/* Deserialize the heap's header */
if (H5HL__hdr_deserialize(&heap, (const uint8_t *)image, image_len, udata) < 0)
@@ -574,7 +574,7 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image,
* the prefix and the data block due to alignment constraints.
*/
gap = heap->prfx_size - (size_t)(image - (uint8_t *)_image);
HDmemset(image, 0, gap);
memset(image, 0, gap);
image += gap;
}
@@ -592,7 +592,7 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image,
assert((size_t)(image - (uint8_t *)_image) <= len);
/* Clear rest of local heap */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
memset(image, 0, len - (size_t)(image - (uint8_t *)_image));
}
FUNC_LEAVE_NOAPI(SUCCEED)
+2 -2
View File
@@ -379,7 +379,7 @@ H5L_unregister(H5L_type_t id)
/* Remove filter from table */
/* Don't worry about shrinking table size (for now) */
HDmemmove(&H5L_table_g[i], &H5L_table_g[i + 1], sizeof(H5L_class_t) * ((H5L_table_used_g - 1) - i));
memmove(&H5L_table_g[i], &H5L_table_g[i + 1], sizeof(H5L_class_t) * ((H5L_table_used_g - 1) - i));
H5L_table_used_g--;
done:
@@ -624,7 +624,7 @@ done:
H5O_loc_t oloc; /* Object location for created object */
/* Set up object location */
HDmemset(&oloc, 0, sizeof(oloc));
memset(&oloc, 0, sizeof(oloc));
oloc.file = grp_loc->oloc->file;
oloc.addr = udata->lnk->u.hard.addr;
+8 -8
View File
@@ -195,7 +195,7 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh)
switch (mapping_type) {
case H5MF_AGGR_MERGE_SEPARATE:
/* Don't merge any metadata together */
HDmemset(f_sh->fs_aggr_merge, 0, sizeof(f_sh->fs_aggr_merge));
memset(f_sh->fs_aggr_merge, 0, sizeof(f_sh->fs_aggr_merge));
/* Check if merging raw data should be allowed */
/* (treat global heaps as raw data) */
@@ -208,7 +208,7 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh)
case H5MF_AGGR_MERGE_DICHOTOMY:
/* Merge all metadata together (but not raw data) */
HDmemset(f_sh->fs_aggr_merge, H5F_FS_MERGE_METADATA, sizeof(f_sh->fs_aggr_merge));
memset(f_sh->fs_aggr_merge, H5F_FS_MERGE_METADATA, sizeof(f_sh->fs_aggr_merge));
/* Allow merging raw data allocations together */
/* (treat global heaps as raw data) */
@@ -218,8 +218,8 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh)
case H5MF_AGGR_MERGE_TOGETHER:
/* Merge all allocation types together */
HDmemset(f_sh->fs_aggr_merge, (H5F_FS_MERGE_METADATA | H5F_FS_MERGE_RAWDATA),
sizeof(f_sh->fs_aggr_merge));
memset(f_sh->fs_aggr_merge, (H5F_FS_MERGE_METADATA | H5F_FS_MERGE_RAWDATA),
sizeof(f_sh->fs_aggr_merge));
break;
default:
@@ -2568,8 +2568,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
assert(fsm_settled);
/* Initialize structs */
HDmemset(&fsinfo, 0, sizeof(fsinfo));
HDmemset(&fs_stat, 0, sizeof(fs_stat));
memset(&fsinfo, 0, sizeof(fsinfo));
memset(&fs_stat, 0, sizeof(fs_stat));
/*
* Only need to settle things if we are persisting free space and
@@ -2591,8 +2591,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
assert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2);
/* Initialize fsm_opened and fsm_visited */
HDmemset(fsm_opened, 0, sizeof(fsm_opened));
HDmemset(fsm_visited, 0, sizeof(fsm_visited));
memset(fsm_opened, 0, sizeof(fsm_opened));
memset(fsm_visited, 0, sizeof(fsm_visited));
/* 1) Reduce the EOA to the extent possible. */
+1 -1
View File
@@ -308,7 +308,7 @@ H5MM_memcpy(void *dest, const void *src, size_t n)
assert((char *)dest >= (const char *)src + n || (const char *)src >= (char *)dest + n);
/* Copy */
ret = HDmemcpy(dest, src, n);
ret = memcpy(dest, src, n);
FUNC_LEAVE_NOAPI(ret)
+36 -36
View File
@@ -149,9 +149,9 @@ H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_
oh->mesg[u].raw -= new_gap_size;
/* Slide raw message info forward in chunk image */
HDmemmove(new_gap_loc, new_gap_loc + new_gap_size,
(size_t)((oh->chunk[chunkno].image + (oh->chunk[chunkno].size - H5O_SIZEOF_CHKSUM_OH(oh))) -
(new_gap_loc + new_gap_size)));
memmove(new_gap_loc, new_gap_loc + new_gap_size,
(size_t)((oh->chunk[chunkno].image + (oh->chunk[chunkno].size - H5O_SIZEOF_CHKSUM_OH(oh))) -
(new_gap_loc + new_gap_size)));
/* Add existing gap size to new gap size */
new_gap_size += oh->chunk[chunkno].gap;
@@ -179,7 +179,7 @@ H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_
/* Zero out new null message's raw data */
if (null_msg->raw_size)
HDmemset(null_msg->raw, 0, null_msg->raw_size);
memset(null_msg->raw, 0, null_msg->raw_size);
/* Mark message as dirty */
null_msg->dirty = TRUE;
@@ -265,10 +265,10 @@ H5O__eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *g
/* Slide raw message info in chunk image */
if (null_before_gap)
/* Slide messages down */
HDmemmove(move_start + gap_size, move_start, (size_t)(move_end - move_start));
memmove(move_start + gap_size, move_start, (size_t)(move_end - move_start));
else {
/* Slide messages up */
HDmemmove(move_start - gap_size, move_start, (size_t)(move_end - move_start));
memmove(move_start - gap_size, move_start, (size_t)(move_end - move_start));
/* Adjust start of null message */
mesg->raw -= gap_size;
@@ -276,14 +276,14 @@ H5O__eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *g
}
else if (move_end == move_start && !null_before_gap) {
/* Slide null message up */
HDmemmove(move_start - gap_size, move_start, mesg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh));
memmove(move_start - gap_size, move_start, mesg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh));
/* Adjust start of null message */
mesg->raw -= gap_size;
} /* end if */
/* Zero out addition to null message */
HDmemset(mesg->raw + mesg->raw_size, 0, gap_size);
memset(mesg->raw + mesg->raw_size, 0, gap_size);
/* Adjust size of null message */
mesg->raw_size += gap_size;
@@ -440,7 +440,7 @@ H5O__alloc_msgs(H5O_t *oh, size_t min_alloc)
oh->mesg = new_mesg;
/* Set new object header info to zeros */
HDmemset(&oh->mesg[old_alloc], 0, (oh->alloc_nmesgs - old_alloc) * sizeof(H5O_mesg_t));
memset(&oh->mesg[old_alloc], 0, (oh->alloc_nmesgs - old_alloc) * sizeof(H5O_mesg_t));
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -615,13 +615,13 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size
oh->chunk[chunkno].gap = 0;
/* Wipe new space for chunk */
HDmemset(oh->chunk[chunkno].image + old_size, 0, oh->chunk[chunkno].size - old_size);
memset(oh->chunk[chunkno].image + old_size, 0, oh->chunk[chunkno].size - old_size);
/* Move chunk 0 data up if the size flags changed */
if (adjust_size_flags)
HDmemmove(oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh),
oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh) - extra_prfx_size,
old_size - (size_t)H5O_SIZEOF_HDR(oh) + extra_prfx_size);
memmove(oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh),
oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh) - extra_prfx_size,
old_size - (size_t)H5O_SIZEOF_HDR(oh) + extra_prfx_size);
/* Spin through existing messages, adjusting them */
for (u = 0; u < oh->nmesgs; u++) {
@@ -940,7 +940,7 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_
if (curr_msg->type->id == H5O_NULL_ID) {
/* Delete the null message */
if (u < oh->nmesgs - 1)
HDmemmove(curr_msg, curr_msg + 1, ((oh->nmesgs - 1) - u) * sizeof(H5O_mesg_t));
memmove(curr_msg, curr_msg + 1, ((oh->nmesgs - 1) - u) * sizeof(H5O_mesg_t));
oh->nmesgs--;
} /* end if */
else {
@@ -1036,8 +1036,8 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_
/* Remove null message from list of messages */
if (found_msg->null_msgno < (oh->nmesgs - 1))
HDmemmove(old_null_msg, old_null_msg + 1,
((oh->nmesgs - 1) - found_msg->null_msgno) * sizeof(H5O_mesg_t));
memmove(old_null_msg, old_null_msg + 1,
((oh->nmesgs - 1) - found_msg->null_msgno) * sizeof(H5O_mesg_t));
/* Decrement # of messages */
/* (Don't bother reducing size of message array for now -QAK) */
@@ -1347,7 +1347,7 @@ H5O__release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link)
mesg->type = H5O_MSG_NULL;
assert(mesg->raw + mesg->raw_size <= (oh->chunk[mesg->chunkno].image + oh->chunk[mesg->chunkno].size) -
(H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[mesg->chunkno].gap));
HDmemset(mesg->raw, 0, mesg->raw_size);
memset(mesg->raw, 0, mesg->raw_size);
/* Clear message flags */
mesg->flags = 0;
@@ -1498,8 +1498,8 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u)
/* Release any information/memory for continuation message */
H5O__msg_free_mesg(cont_msg);
if (cont_u < (oh->nmesgs - 1))
HDmemmove(&oh->mesg[cont_u], &oh->mesg[cont_u + 1],
((oh->nmesgs - 1) - cont_u) * sizeof(H5O_mesg_t));
memmove(&oh->mesg[cont_u], &oh->mesg[cont_u + 1],
((oh->nmesgs - 1) - cont_u) * sizeof(H5O_mesg_t));
oh->nmesgs--;
} /* end else */
@@ -1516,8 +1516,8 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u)
/* Remove from message list */
if (v < (oh->nmesgs - 1))
HDmemmove(&oh->mesg[v], &oh->mesg[v + 1],
((oh->nmesgs - 1) - v) * sizeof(H5O_mesg_t));
memmove(&oh->mesg[v], &oh->mesg[v + 1],
((oh->nmesgs - 1) - v) * sizeof(H5O_mesg_t));
oh->nmesgs--;
} /* end if */
} /* end if */
@@ -1606,9 +1606,9 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh)
"unable to load object header chunk")
/* Copy raw data for non-null message to new location */
HDmemmove(curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh),
nonnull_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh),
nonnull_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh));
memmove(curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh),
nonnull_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh),
nonnull_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh));
/* Adjust non-null message's offset in chunk */
nonnull_msg->raw = curr_msg->raw;
@@ -2009,8 +2009,8 @@ H5O__merge_null(H5F_t *f, H5O_t *oh)
/* Remove second message from list of messages */
if (v < (oh->nmesgs - 1))
HDmemmove(&oh->mesg[v], &oh->mesg[v + 1],
((oh->nmesgs - 1) - v) * sizeof(H5O_mesg_t));
memmove(&oh->mesg[v], &oh->mesg[v + 1],
((oh->nmesgs - 1) - v) * sizeof(H5O_mesg_t));
/* Decrement # of messages */
/* (Don't bother reducing size of message array for now -QAK) */
@@ -2148,8 +2148,8 @@ H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh)
/* Remove chunk from list of chunks */
if (null_msg->chunkno < (oh->nchunks - 1)) {
HDmemmove(&oh->chunk[null_msg->chunkno], &oh->chunk[null_msg->chunkno + 1],
((oh->nchunks - 1) - null_msg->chunkno) * sizeof(H5O_chunk_t));
memmove(&oh->chunk[null_msg->chunkno], &oh->chunk[null_msg->chunkno + 1],
((oh->nchunks - 1) - null_msg->chunkno) * sizeof(H5O_chunk_t));
/* Adjust chunk number for any chunk proxies that are in the cache */
for (u = null_msg->chunkno; u < (oh->nchunks - 1); u++) {
@@ -2182,8 +2182,8 @@ H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh)
/* Remove null message from list of messages */
if (null_msg_no < (oh->nmesgs - 1))
HDmemmove(&oh->mesg[null_msg_no], &oh->mesg[null_msg_no + 1],
((oh->nmesgs - 1) - null_msg_no) * sizeof(H5O_mesg_t));
memmove(&oh->mesg[null_msg_no], &oh->mesg[null_msg_no + 1],
((oh->nmesgs - 1) - null_msg_no) * sizeof(H5O_mesg_t));
/* Decrement # of messages */
/* (Don't bother reducing size of message array for now -QAK) */
@@ -2354,8 +2354,8 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno)
uint8_t *src = curr_msg->raw + curr_msg->raw_size; /* Source location */
/* Slide down the raw data */
HDmemmove(curr_msg->raw - sizeof_msghdr, src,
(size_t)(old_image + new_size - sizeof_chksum - src));
memmove(curr_msg->raw - sizeof_msghdr, src,
(size_t)(old_image + new_size - sizeof_chksum - src));
/* Update the raw data pointers for messages after this one */
for (v = 0, curr_msg2 = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg2++)
@@ -2371,7 +2371,7 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno)
/* Remove the deleted null message from list of messages */
if (u < (oh->nmesgs - 1))
HDmemmove(&oh->mesg[u], &oh->mesg[u + 1], ((oh->nmesgs - 1) - u) * sizeof(H5O_mesg_t));
memmove(&oh->mesg[u], &oh->mesg[u + 1], ((oh->nmesgs - 1) - u) * sizeof(H5O_mesg_t));
/* Decrement # of messages */
/* (Don't bother reducing size of message array for now) */
@@ -2430,9 +2430,9 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno)
oh->flags |= new_size_flags;
/* Slide chunk 0 data down */
HDmemmove(chunk->image + H5O_SIZEOF_HDR(oh) - sizeof_chksum,
chunk->image + H5O_SIZEOF_HDR(oh) - sizeof_chksum + less_prfx_size,
new_size - (size_t)H5O_SIZEOF_HDR(oh));
memmove(chunk->image + H5O_SIZEOF_HDR(oh) - sizeof_chksum,
chunk->image + H5O_SIZEOF_HDR(oh) - sizeof_chksum + less_prfx_size,
new_size - (size_t)H5O_SIZEOF_HDR(oh));
/* Adjust chunk size */
new_size -= less_prfx_size;
+4 -4
View File
@@ -373,7 +373,7 @@ H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
H5MM_memcpy(p, attr->shared->name, name_len);
if (attr->shared->version < H5O_ATTR_VERSION_2) {
/* Pad to the correct number of bytes */
HDmemset(p + name_len, 0, H5O_ALIGN_OLD(name_len) - name_len);
memset(p + name_len, 0, H5O_ALIGN_OLD(name_len) - name_len);
p += H5O_ALIGN_OLD(name_len);
} /* end if */
else
@@ -384,7 +384,7 @@ H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute datatype")
if (attr->shared->version < H5O_ATTR_VERSION_2) {
HDmemset(p + attr->shared->dt_size, 0, H5O_ALIGN_OLD(attr->shared->dt_size) - attr->shared->dt_size);
memset(p + attr->shared->dt_size, 0, H5O_ALIGN_OLD(attr->shared->dt_size) - attr->shared->dt_size);
p += H5O_ALIGN_OLD(attr->shared->dt_size);
} /* end if */
else
@@ -395,7 +395,7 @@ H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute dataspace")
if (attr->shared->version < H5O_ATTR_VERSION_2) {
HDmemset(p + attr->shared->ds_size, 0, H5O_ALIGN_OLD(attr->shared->ds_size) - attr->shared->ds_size);
memset(p + attr->shared->ds_size, 0, H5O_ALIGN_OLD(attr->shared->ds_size) - attr->shared->ds_size);
p += H5O_ALIGN_OLD(attr->shared->ds_size);
} /* end if */
else
@@ -405,7 +405,7 @@ H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
if (attr->shared->data)
H5MM_memcpy(p, attr->shared->data, attr->shared->data_size);
else
HDmemset(p, 0, attr->shared->data_size);
memset(p, 0, attr->shared->data_size);
done:
FUNC_LEAVE_NOAPI(ret_value)
+11 -11
View File
@@ -397,7 +397,7 @@ H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing)
chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh);
/* Verify magic number */
assert(!HDmemcmp(chunk_image, H5O_HDR_MAGIC, H5_SIZEOF_MAGIC));
assert(!memcmp(chunk_image, H5O_HDR_MAGIC, H5_SIZEOF_MAGIC));
chunk_image += H5_SIZEOF_MAGIC;
/* Version */
@@ -468,7 +468,7 @@ H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing)
UINT32ENCODE(chunk_image, (oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh)));
/* Zero to alignment */
HDmemset(chunk_image, 0, (size_t)(H5O_SIZEOF_HDR(oh) - 12));
memset(chunk_image, 0, (size_t)(H5O_SIZEOF_HDR(oh) - 12));
chunk_image += (size_t)(H5O_SIZEOF_HDR(oh) - 12);
}
@@ -705,8 +705,8 @@ H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, hbool_t
/* Sanity check that the chunk representation we have in memory is
* the same as the one being brought in from disk.
*/
assert(0 == HDmemcmp(image, udata->oh->chunk[chk_proxy->chunkno].image,
udata->oh->chunk[chk_proxy->chunkno].size));
assert(0 == memcmp(image, udata->oh->chunk[chk_proxy->chunkno].image,
udata->oh->chunk[chk_proxy->chunkno].size));
}
/* Increment reference count of object header */
@@ -1002,7 +1002,7 @@ H5O__prefix_deserialize(const uint8_t *_image, size_t len, H5O_cache_ud_t *udata
/* (indicates version 2 or later) */
if (H5_IS_BUFFER_OVERFLOW(image, H5_SIZEOF_MAGIC, p_end))
HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, FAIL, "ran off end of input buffer while decoding");
if (!HDmemcmp(image, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
if (!memcmp(image, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/* Magic number (bounds checked above) */
image += H5_SIZEOF_MAGIC;
@@ -1248,7 +1248,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t
/* Magic number */
if (H5_IS_BUFFER_OVERFLOW(chunk_image, H5_SIZEOF_MAGIC, p_end))
HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, FAIL, "ran off end of input buffer while decoding");
if (HDmemcmp(chunk_image, H5O_CHK_MAGIC, H5_SIZEOF_MAGIC) != 0)
if (memcmp(chunk_image, H5O_CHK_MAGIC, H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "wrong object header chunk signature")
chunk_image += H5_SIZEOF_MAGIC;
}
@@ -1573,8 +1573,8 @@ H5O__chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno)
/* Sanity checks */
if (oh->version > H5O_VERSION_1)
/* Make certain the magic # is present */
assert(!HDmemcmp(oh->chunk[chunkno].image, (chunkno == 0 ? H5O_HDR_MAGIC : H5O_CHK_MAGIC),
H5_SIZEOF_MAGIC));
assert(!memcmp(oh->chunk[chunkno].image, (chunkno == 0 ? H5O_HDR_MAGIC : H5O_CHK_MAGIC),
H5_SIZEOF_MAGIC));
else
/* Gaps should never occur in version 1 of the format */
assert(oh->chunk[chunkno].gap == 0);
@@ -1586,9 +1586,9 @@ H5O__chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno)
/* Check for gap in chunk & zero it out */
if (oh->chunk[chunkno].gap)
HDmemset((oh->chunk[chunkno].image + oh->chunk[chunkno].size) -
(H5O_SIZEOF_CHKSUM + oh->chunk[chunkno].gap),
0, oh->chunk[chunkno].gap);
memset((oh->chunk[chunkno].image + oh->chunk[chunkno].size) -
(H5O_SIZEOF_CHKSUM + oh->chunk[chunkno].gap),
0, oh->chunk[chunkno].gap);
/* Compute metadata checksum */
metadata_chksum =
+2 -2
View File
@@ -171,7 +171,7 @@ H5O__chunk_protect(H5F_t *f, H5O_t *oh, unsigned idx)
/* Construct the user data for protecting chunk proxy */
/* (and _not_ decoding it) */
HDmemset(&chk_udata, 0, sizeof(chk_udata));
memset(&chk_udata, 0, sizeof(chk_udata));
chk_udata.oh = oh;
chk_udata.chunkno = idx;
chk_udata.size = oh->chunk[idx].size;
@@ -307,7 +307,7 @@ H5O__chunk_update_idx(H5F_t *f, H5O_t *oh, unsigned idx)
/* Construct the user data for protecting chunk proxy */
/* (and _not_ decoding it) */
HDmemset(&chk_udata, 0, sizeof(chk_udata));
memset(&chk_udata, 0, sizeof(chk_udata));
chk_udata.oh = oh;
chk_udata.chunkno = idx;
chk_udata.size = oh->chunk[idx].size;
+2 -2
View File
@@ -344,7 +344,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
*/
if (NULL == (deleted = (hbool_t *)H5MM_malloc(sizeof(hbool_t) * oh_src->nmesgs)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
HDmemset(deleted, FALSE, sizeof(hbool_t) * oh_src->nmesgs);
memset(deleted, FALSE, sizeof(hbool_t) * oh_src->nmesgs);
/* "pre copy" pass over messages, to gather information for actual message copy operation
* (for messages which depend on information from other messages)
@@ -944,7 +944,7 @@ H5O__copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, hid_t
assert(oloc_dst->file);
/* Initialize copy info before errors can be thrown */
HDmemset(&cpy_info, 0, sizeof(H5O_copy_t));
memset(&cpy_info, 0, sizeof(H5O_copy_t));
/* Get the copy property list */
if (NULL == (ocpy_plist = (H5P_genplist_t *)H5I_object(ocpypl_id)))

Some files were not shown because too many files have changed in this diff Show More