summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c28
-rw-r--r--tools/lib/h5diff_array.c80
-rw-r--r--tools/lib/h5diff_dset.c22
-rw-r--r--tools/lib/h5tools.c14
-rw-r--r--tools/lib/h5tools_dump.c36
-rw-r--r--tools/lib/h5tools_ref.c6
-rw-r--r--tools/lib/h5tools_str.c46
-rw-r--r--tools/lib/h5tools_utils.c10
-rw-r--r--tools/lib/h5trav.c8
9 files changed, 125 insertions, 125 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 442fb3e..502b2ec 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -112,7 +112,7 @@ print_incoming_data(void)
do {
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &incomingMessage, &Status);
if (incomingMessage) {
- HDmemset(data, 0, PRINT_DATA_MAX_SIZE + 1);
+ memset(data, 0, PRINT_DATA_MAX_SIZE + 1);
MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA,
MPI_COMM_WORLD, &Status);
@@ -494,7 +494,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata)
H5TOOLS_START_DEBUG(" ");
/* init linkinfo struct */
- HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t));
+ memset(&lnk_info, 0, sizeof(h5tool_link_info_t));
if (!opts->follow_links) {
trav_info_visit_lnk(path, linfo, tinfo);
@@ -628,10 +628,10 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
H5TOOLS_START_DEBUG(" ");
/* init filenames */
- HDmemset(filenames, 0, MAX_FILENAME * 2);
+ memset(filenames, 0, MAX_FILENAME * 2);
/* init link info struct */
- HDmemset(&trg_linfo1, 0, sizeof(h5tool_link_info_t));
- HDmemset(&trg_linfo2, 0, sizeof(h5tool_link_info_t));
+ memset(&trg_linfo1, 0, sizeof(h5tool_link_info_t));
+ memset(&trg_linfo2, 0, sizeof(h5tool_link_info_t));
/*-------------------------------------------------------------------------
* check invalid combination of options
@@ -776,7 +776,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
obj1type = (h5trav_type_t)oinfo1.type;
trav_info_add(info1_obj, obj1fullname, obj1type);
idx = info1_obj->nused - 1;
- HDmemcpy(&info1_obj->paths[idx].obj_token, &oinfo1.token, sizeof(H5O_token_t));
+ memcpy(&info1_obj->paths[idx].obj_token, &oinfo1.token, sizeof(H5O_token_t));
info1_obj->paths[idx].fileno = oinfo1.fileno;
}
else if (src_linfo1.type == H5L_TYPE_SOFT) {
@@ -826,7 +826,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
obj2type = (h5trav_type_t)oinfo2.type;
trav_info_add(info2_obj, obj2fullname, obj2type);
idx = info2_obj->nused - 1;
- HDmemcpy(&info2_obj->paths[idx].obj_token, &oinfo2.token, sizeof(H5O_token_t));
+ memcpy(&info2_obj->paths[idx].obj_token, &oinfo2.token, sizeof(H5O_token_t));
info2_obj->paths[idx].fileno = oinfo2.fileno;
}
else if (src_linfo2.type == H5L_TYPE_SOFT) {
@@ -896,7 +896,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
size_t idx = info1_lp->nused - 1;
H5TOOLS_DEBUG("h5diff ... ... ... info1_obj not null");
- HDmemcpy(&info1_lp->paths[idx].obj_token, &trg_linfo1.obj_token, sizeof(H5O_token_t));
+ memcpy(&info1_lp->paths[idx].obj_token, &trg_linfo1.obj_token, sizeof(H5O_token_t));
info1_lp->paths[idx].type = (h5trav_type_t)trg_linfo1.trg_type;
info1_lp->paths[idx].fileno = trg_linfo1.fileno;
}
@@ -936,7 +936,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
size_t idx = info2_lp->nused - 1;
H5TOOLS_DEBUG("h5diff ... ... ... info2_obj not null");
- HDmemcpy(&info2_lp->paths[idx].obj_token, &trg_linfo2.obj_token, sizeof(H5O_token_t));
+ memcpy(&info2_lp->paths[idx].obj_token, &trg_linfo2.obj_token, sizeof(H5O_token_t));
info2_lp->paths[idx].type = (h5trav_type_t)trg_linfo2.trg_type;
info2_lp->paths[idx].fileno = trg_linfo2.fileno;
}
@@ -1173,7 +1173,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id,
MPI_Status Status;
/*set all tasks as free */
- HDmemset(workerTasks, 1, (size_t)(g_nTasks - 1) * sizeof(char));
+ memset(workerTasks, 1, (size_t)(g_nTasks - 1) * sizeof(char));
#endif
for (i = 0; i < table->nobjs; i++) {
@@ -1472,7 +1472,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id,
} /* end else-if */
else if (Status.MPI_TAG == MPI_TAG_PRINT_DATA) {
char data[PRINT_DATA_MAX_SIZE + 1];
- HDmemset(data, 0, PRINT_DATA_MAX_SIZE + 1);
+ memset(data, 0, PRINT_DATA_MAX_SIZE + 1);
MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA,
MPI_COMM_WORLD, &Status);
@@ -1548,8 +1548,8 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_
H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
/*init link info struct */
- HDmemset(&linkinfo1, 0, sizeof(h5tool_link_info_t));
- HDmemset(&linkinfo2, 0, sizeof(h5tool_link_info_t));
+ memset(&linkinfo1, 0, sizeof(h5tool_link_info_t));
+ memset(&linkinfo2, 0, sizeof(h5tool_link_info_t));
/* pass how to handle printing warnings to linkinfo option */
if (print_warn(opts))
@@ -1833,7 +1833,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_
if (linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) {
/* If the buffers are the same size, compare them */
if (linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) {
- status = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size);
+ status = memcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size);
}
else
status = 1;
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 37c17e5..edb0190 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -212,7 +212,7 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
* by the condition, but it gives more clarity for code planning
*/
if (type_class != H5T_REFERENCE && type_class != H5T_COMPOUND && type_class != H5T_STRING &&
- type_class != H5T_VLEN && HDmemcmp(mem1, mem2, size * opts->hs_nelmts) == 0) {
+ type_class != H5T_VLEN && memcmp(mem1, mem2, size * opts->hs_nelmts) == 0) {
H5TOOLS_ENDDEBUG(":Fast comparison - errstat:%d", opts->err_stat);
return 0;
}
@@ -381,7 +381,7 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
case H5T_VLEN:
case H5T_REFERENCE:
H5TOOLS_DEBUG("type_class:OTHER");
- HDmemset(&members, 0, sizeof(mcomp_t));
+ memset(&members, 0, sizeof(mcomp_t));
get_member_types(opts->m_tid, &members);
for (i = 0; i < opts->hs_nelmts; i++) {
H5TOOLS_DEBUG("opts->pos[%" PRIuHSIZE "]:%" PRIuHSIZE " - nelmts:%" PRIuHSIZE, i,
@@ -460,7 +460,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
* by the condition, but it gives more clarity for code planning
*/
if (type_class != H5T_REFERENCE && type_class != H5T_COMPOUND && type_class != H5T_STRING &&
- type_class != H5T_VLEN && HDmemcmp(mem1, mem2, type_size) == 0)
+ type_class != H5T_VLEN && memcmp(mem1, mem2, type_size) == 0)
H5TOOLS_GOTO_DONE(opts->err_stat);
switch (H5Tget_class(opts->m_tid)) {
@@ -590,7 +590,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
/* check for NULL pointer for string */
if (s != NULL) {
/* try fast compare first */
- if ((HDmemcmp(s, sx, size) == 0) && (size1 != size2)) {
+ if ((memcmp(s, sx, size) == 0) && (size1 != size2)) {
for (u = size; u < sizex; u++)
character_compare(s + u, sx + u, elemtno, u, opts);
}
@@ -1556,8 +1556,8 @@ character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t
char temp1_uchar;
char temp2_uchar;
- HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
+ memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
H5TOOLS_START_DEBUG(" %d=%d", temp1_uchar, temp2_uchar);
if (temp1_uchar != temp2_uchar) {
@@ -1598,8 +1598,8 @@ character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno,
/* both_zero is set in the PER_UNSIGN macro but not used in this function */
(void)both_zero;
- HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
+ memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
H5TOOLS_START_DEBUG(" %d=%d", temp1_uchar, temp2_uchar);
/* -d and !-p */
@@ -1673,8 +1673,8 @@ diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_float, mem1, sizeof(float));
- HDmemcpy(&temp2_float, mem2, sizeof(float));
+ memcpy(&temp1_float, mem1, sizeof(float));
+ memcpy(&temp2_float, mem2, sizeof(float));
/* logic for detecting NaNs is different with opts -d, -p and no opts */
@@ -1853,8 +1853,8 @@ diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_double, mem1, sizeof(double));
- HDmemcpy(&temp2_double, mem2, sizeof(double));
+ memcpy(&temp1_double, mem1, sizeof(double));
+ memcpy(&temp2_double, mem2, sizeof(double));
/*-------------------------------------------------------------------------
* -d and !-p
@@ -2026,8 +2026,8 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_double, mem1, sizeof(long double));
- HDmemcpy(&temp2_double, mem2, sizeof(long double));
+ memcpy(&temp1_double, mem1, sizeof(long double));
+ memcpy(&temp2_double, mem2, sizeof(long double));
/* logic for detecting NaNs is different with options -d, -p and no options */
@@ -2196,8 +2196,8 @@ diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
hbool_t both_zero = FALSE;
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_char, mem1, sizeof(char));
- HDmemcpy(&temp2_char, mem2, sizeof(char));
+ memcpy(&temp1_char, mem1, sizeof(char));
+ memcpy(&temp2_char, mem2, sizeof(char));
/* -d and !-p */
if (opts->delta_bool && !opts->percent_bool) {
@@ -2285,8 +2285,8 @@ diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
+ memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
/* -d and !-p */
if (opts->delta_bool && !opts->percent_bool) {
if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) {
@@ -2373,8 +2373,8 @@ diff_short_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_short, mem1, sizeof(short));
- HDmemcpy(&temp2_short, mem2, sizeof(short));
+ memcpy(&temp1_short, mem1, sizeof(short));
+ memcpy(&temp2_short, mem2, sizeof(short));
/* -d and !-p */
if (opts->delta_bool && !opts->percent_bool) {
if (ABS(temp1_short - temp2_short) > opts->delta) {
@@ -2461,8 +2461,8 @@ diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
- HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
+ memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
+ memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
/* -d and !-p */
if (opts->delta_bool && !opts->percent_bool) {
if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) {
@@ -2553,8 +2553,8 @@ diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, dif
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_int, mem1, sizeof(int));
- HDmemcpy(&temp2_int, mem2, sizeof(int));
+ memcpy(&temp1_int, mem1, sizeof(int));
+ memcpy(&temp2_int, mem2, sizeof(int));
/* -d and !-p */
if (opts->delta_bool && !opts->percent_bool) {
if (ABS(temp1_int - temp2_int) > opts->delta) {
@@ -2641,8 +2641,8 @@ diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, di
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
- HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
+ memcpy(&temp1_uint, mem1, sizeof(unsigned int));
+ memcpy(&temp2_uint, mem2, sizeof(unsigned int));
/* -d and !-p */
if (opts->delta_bool && !opts->percent_bool) {
if (PDIFF(temp1_uint, temp2_uint) > opts->delta) {
@@ -2729,8 +2729,8 @@ diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, di
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_long, mem1, sizeof(long));
- HDmemcpy(&temp2_long, mem2, sizeof(long));
+ memcpy(&temp1_long, mem1, sizeof(long));
+ memcpy(&temp2_long, mem2, sizeof(long));
/* -d and !-p */
if (opts->delta_bool && !opts->percent_bool) {
if (ABS(temp1_long - temp2_long) > (long)opts->delta) {
@@ -2817,8 +2817,8 @@ diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
- HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
+ memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
+ memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
/* -d and !-p */
if (opts->delta_bool && !opts->percent_bool) {
if (PDIFF(temp1_ulong, temp2_ulong) > (unsigned long)opts->delta) {
@@ -2907,8 +2907,8 @@ diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_llong, mem1, sizeof(long long));
- HDmemcpy(&temp2_llong, mem2, sizeof(long long));
+ memcpy(&temp1_llong, mem1, sizeof(long long));
+ memcpy(&temp2_llong, mem2, sizeof(long long));
/* -d and !-p */
if (opts->delta_bool && !opts->percent_bool) {
@@ -3001,8 +3001,8 @@ diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool);
- HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
- HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
+ memcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
+ memcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
/* -d and !-p */
if (opts->delta_bool && !opts->percent_bool) {
@@ -3104,13 +3104,13 @@ ull2float(unsigned long long ull_value, float *f_value)
if ((buf = (unsigned char *)calloc((size_t)1, MAX(src_size, dst_size))) == NULL)
H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for dims");
- HDmemcpy(buf, &ull_value, src_size);
+ memcpy(buf, &ull_value, src_size);
/* do conversion */
if (H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t)1, buf, NULL, dxpl_id) < 0)
H5TOOLS_GOTO_ERROR(FAIL, "H5Tconvert failed");
- HDmemcpy(f_value, buf, dst_size);
+ memcpy(f_value, buf, dst_size);
done:
H5E_BEGIN_TRY
@@ -3165,7 +3165,7 @@ equal_double(double value, double expected, diff_opt_t *opts)
}
else {
/* Check bits */
- if (!HDmemcmp(&value, &expected, sizeof(double)))
+ if (!memcmp(&value, &expected, sizeof(double)))
return TRUE;
}
@@ -3212,7 +3212,7 @@ equal_ldouble(long double value, long double expected, diff_opt_t *opts)
}
else {
/* Check bits */
- if (!HDmemcmp(&value, &expected, sizeof(long double)))
+ if (!memcmp(&value, &expected, sizeof(long double)))
return TRUE;
}
@@ -3258,7 +3258,7 @@ equal_float(float value, float expected, diff_opt_t *opts)
}
else {
/* Check bits */
- if (!HDmemcmp(&value, &expected, sizeof(float)))
+ if (!memcmp(&value, &expected, sizeof(float)))
return TRUE;
}
@@ -3501,7 +3501,7 @@ get_member_types(hid_t tid, mcomp_t *members)
members->ids[u] = H5Tget_member_type(tid, u);
members->offsets[u] = H5Tget_member_offset(tid, u);
members->m[u] = (mcomp_t *)malloc(sizeof(mcomp_t));
- HDmemset(members->m[u], 0, sizeof(mcomp_t));
+ memset(members->m[u], 0, sizeof(mcomp_t));
get_member_types(members->ids[u], members->m[u]);
}
}
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index c0c5ba1..78f52bc 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -532,17 +532,17 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n
}
/* the stripmine loop */
- HDmemset(hs_offset1, 0, sizeof hs_offset1);
- HDmemset(hs_stride1, 0, sizeof hs_stride1);
- HDmemset(hs_count1, 0, sizeof hs_count1);
- HDmemset(hs_block1, 0, sizeof hs_block1);
- HDmemset(hs_size1, 0, sizeof hs_size1);
- HDmemset(hs_offset2, 0, sizeof hs_offset2);
- HDmemset(hs_stride2, 0, sizeof hs_stride2);
- HDmemset(hs_count2, 0, sizeof hs_count2);
- HDmemset(hs_block2, 0, sizeof hs_block2);
- HDmemset(hs_size2, 0, sizeof hs_size2);
- HDmemset(zero, 0, sizeof zero);
+ memset(hs_offset1, 0, sizeof hs_offset1);
+ memset(hs_stride1, 0, sizeof hs_stride1);
+ memset(hs_count1, 0, sizeof hs_count1);
+ memset(hs_block1, 0, sizeof hs_block1);
+ memset(hs_size1, 0, sizeof hs_size1);
+ memset(hs_offset2, 0, sizeof hs_offset2);
+ memset(hs_stride2, 0, sizeof hs_stride2);
+ memset(hs_count2, 0, sizeof hs_count2);
+ memset(hs_block2, 0, sizeof hs_block2);
+ memset(hs_size2, 0, sizeof hs_size2);
+ memset(zero, 0, sizeof zero);
/* if subsetting was requested - initialize the subsetting variables */
H5TOOLS_DEBUG("compare by hyperslabs: opts->nelmts=%ld - opts->m_size=%ld", opts->nelmts,
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 30edd5f..5beffa4 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1229,8 +1229,8 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context
H5TOOLS_START_DEBUG(" ");
- HDmemset(&prefix, 0, sizeof(h5tools_str_t));
- HDmemset(&str, 0, sizeof(h5tools_str_t));
+ memset(&prefix, 0, sizeof(h5tools_str_t));
+ memset(&str, 0, sizeof(h5tools_str_t));
/* Terminate previous line, if any */
H5TOOLS_DEBUG("before CR elmtno=%ld, ctx->cur_column=%d, info->idx_fmt=%s, info->line_suf=%s", elmtno,
@@ -1324,8 +1324,8 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_
if (!ctx->need_prefix)
return;
- HDmemset(&prefix, 0, sizeof(h5tools_str_t));
- HDmemset(&str, 0, sizeof(h5tools_str_t));
+ memset(&prefix, 0, sizeof(h5tools_str_t));
+ memset(&str, 0, sizeof(h5tools_str_t));
/* Terminate previous line, if any */
if (ctx->cur_column) {
@@ -1842,7 +1842,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
s = (char *)mem;
}
for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) {
- HDmemcpy(&tempuchar, &s[i], sizeof(unsigned char));
+ memcpy(&tempuchar, &s[i], sizeof(unsigned char));
if (1 != fwrite(&tempuchar, sizeof(unsigned char), 1, stream))
H5TOOLS_THROW((-1), "fwrite failed");
} /* i */
@@ -1946,11 +1946,11 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
if (size > sizeof(tref))
H5TOOLS_THROW((-1), "unexpectedly large ref");
- HDmemset(&tref, 0, sizeof(tref));
+ memset(&tref, 0, sizeof(tref));
for (block_index = 0; block_index < block_nelmts; block_index++) {
mem = ((unsigned char *)_mem) + block_index * size;
- HDmemcpy(&tref, mem, size);
+ memcpy(&tref, mem, size);
if ((region_id = H5Ropen_object(&tref, H5P_DEFAULT, H5P_DEFAULT)) < 0)
H5TOOLS_INFO("H5Ropen_object H5T_STD_REF failed");
else {
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 4840def..d869907 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -264,7 +264,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_cont
} /* end if */
else {
/* setup */
- HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ memset(&buffer, 0, sizeof(h5tools_str_t));
size = H5Tget_size(type);
H5TOOLS_DEBUG("type size is %ld", size);
@@ -500,7 +500,7 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for
assert(buffer);
assert(ptdata);
- HDmemset(&ctx, 0, sizeof(ctx));
+ memset(&ctx, 0, sizeof(ctx));
H5TOOLS_START_DEBUG(" ");
@@ -899,7 +899,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre
H5TOOLS_START_DEBUG(" ");
- HDmemset(&ctx, 0, sizeof(ctx));
+ memset(&ctx, 0, sizeof(ctx));
/* Allocate space for the dimension array */
if ((dims1 = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL)
H5TOOLS_THROW((-1), "Could not allocate buffer for dims");
@@ -1702,8 +1702,8 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims);
/* The stripmine loop */
- HDmemset(hs_offset, 0, sizeof hs_offset);
- HDmemset(zero, 0, sizeof zero);
+ memset(hs_offset, 0, sizeof hs_offset);
+ memset(zero, 0, sizeof zero);
for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) {
H5TOOLS_DEBUG("stripmine read loop:%d", i);
@@ -1901,7 +1901,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
stream = rawoutstream;
if (!info) {
- HDmemset(&info_dflt, 0, sizeof info_dflt);
+ memset(&info_dflt, 0, sizeof info_dflt);
info = &info_dflt;
}
@@ -1977,7 +1977,7 @@ h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c
stream = rawoutstream;
if (!info) {
- HDmemset(&info_dflt, 0, sizeof(info_dflt));
+ memset(&info_dflt, 0, sizeof(info_dflt));
info = &info_dflt;
}
@@ -2812,13 +2812,13 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
else if (H5T_SGN_NONE == H5Tget_sign(native)) {
unsigned long long copy;
- HDmemcpy(&copy, value + i * dst_size, sizeof(copy));
+ memcpy(&copy, value + i * dst_size, sizeof(copy));
h5tools_str_append(buffer, "%llu", copy);
}
else {
long long copy;
- HDmemcpy(&copy, value + i * dst_size, sizeof(copy));
+ memcpy(&copy, value + i * dst_size, sizeof(copy));
h5tools_str_append(buffer, "%lld", copy);
}
@@ -2871,7 +2871,7 @@ h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, h5tools_context
*/
/* setup */
- HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ memset(&buffer, 0, sizeof(h5tools_str_t));
if (info->line_ncols > 0)
ncols = info->line_ncols;
@@ -2917,7 +2917,7 @@ h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, h5tools_contex
*/
/* setup */
- HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ memset(&buffer, 0, sizeof(h5tools_str_t));
if (info->line_ncols > 0)
ncols = info->line_ncols;
@@ -2964,7 +2964,7 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c
*/
/* setup */
- HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ memset(&buffer, 0, sizeof(h5tools_str_t));
if (info->line_ncols > 0)
ncols = info->line_ncols;
@@ -3122,7 +3122,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_str_t buffer; /* string into which to render */
/* setup */
- HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ memset(&buffer, 0, sizeof(h5tools_str_t));
if (info->line_ncols > 0)
ncols = info->line_ncols;
@@ -3765,7 +3765,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_
return;
/* setup */
- HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ memset(&buffer, 0, sizeof(h5tools_str_t));
if (info->line_ncols > 0)
ncols = info->line_ncols;
@@ -3817,7 +3817,7 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, h5tools_contex
*/
/* setup */
- HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ memset(&buffer, 0, sizeof(h5tools_str_t));
if (info->line_ncols > 0)
ncols = info->line_ncols;
@@ -3959,7 +3959,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tool
size_t ncols = 80; /* available output width */
/* setup */
- HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ memset(&buffer, 0, sizeof(h5tools_str_t));
if (info->line_ncols > 0)
ncols = info->line_ncols;
@@ -4054,7 +4054,7 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex
/* Assume entire data space to be printed */
datactx.need_prefix = TRUE;
- HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ memset(&buffer, 0, sizeof(h5tools_str_t));
for (i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) {
H5O_type_t obj_type = -1; /* Object type */
H5R_type_t ref_type; /* Reference type */
@@ -4287,7 +4287,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
H5TOOLS_START_DEBUG(" file=%p", (void *)stream);
H5TOOLS_DEBUG("rawdata file=%p", (void *)rawdatastream);
/* setup */
- HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+ memset(&buffer, 0, sizeof(h5tools_str_t));
if (info->line_ncols > 0)
ncols = info->line_ncols;
diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c
index e7858c8..d89c546 100644
--- a/tools/lib/h5tools_ref.c
+++ b/tools/lib/h5tools_ref.c
@@ -108,7 +108,7 @@ ref_path_table_cmp(const void *key1, const void *key2)
if (thefile > 0)
H5Otoken_cmp(thefile, token1, token2, &cmp_value);
else
- cmp_value = HDmemcmp(token1, token2, sizeof(H5O_token_t));
+ cmp_value = memcmp(token1, token2, sizeof(H5O_token_t));
return cmp_value;
}
@@ -201,7 +201,7 @@ ref_path_table_lookup(const char *thepath, H5O_token_t *token)
return -1;
/* Return object token through parameter */
- HDmemcpy(token, &oi.token, sizeof(H5O_token_t));
+ memcpy(token, &oi.token, sizeof(H5O_token_t));
return 0;
}
@@ -230,7 +230,7 @@ ref_path_table_put(const char *path, const H5O_token_t *token)
if ((new_node = (ref_path_node_t *)malloc(sizeof(ref_path_node_t))) == NULL)
return (-1);
- HDmemcpy(&new_node->obj_token, token, sizeof(H5O_token_t));
+ memcpy(&new_node->obj_token, token, sizeof(H5O_token_t));
new_node->path = HDstrdup(path);
return (H5SL_insert(ref_path_table, new_node, &(new_node->obj_token)));
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index d927820..5ae6838 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -63,7 +63,7 @@ h5tools_str_close(h5tools_str_t *str)
{
if (str && str->nalloc) {
free(str->s);
- HDmemset(str, 0, sizeof(h5tools_str_t));
+ memset(str, 0, sizeof(h5tools_str_t));
}
}
@@ -704,21 +704,21 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
/* if (H5Tequal(type, H5T_NATIVE_FLOAT)) */
float tempfloat;
- HDmemcpy(&tempfloat, vp, sizeof(float));
+ memcpy(&tempfloat, vp, sizeof(float));
h5tools_str_append(str, OPT(info->fmt_float, "%g"), (double)tempfloat);
}
else if (sizeof(double) == nsize) {
/* if (H5Tequal(type, H5T_NATIVE_DOUBLE)) */
double tempdouble;
- HDmemcpy(&tempdouble, vp, sizeof(double));
+ memcpy(&tempdouble, vp, sizeof(double));
h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble);
}
else if (sizeof(long double) == nsize) {
/* if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) */
long double templdouble;
- HDmemcpy(&templdouble, vp, sizeof(long double));
+ memcpy(&templdouble, vp, sizeof(long double));
h5tools_str_append(str, "%Lg", templdouble);
}
else {
@@ -818,7 +818,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
else if (H5T_SGN_NONE == nsign) {
unsigned char tempuchar;
- HDmemcpy(&tempuchar, ucp_vp, sizeof(unsigned char));
+ memcpy(&tempuchar, ucp_vp, sizeof(unsigned char));
if (packed_bits_num) {
if (packed_data_offset >= 8 * sizeof(unsigned char))
tempuchar = 0;
@@ -832,7 +832,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
else {
signed char tempchar;
- HDmemcpy(&tempchar, cp_vp, sizeof(char));
+ memcpy(&tempchar, cp_vp, sizeof(char));
if (packed_bits_num) {
if (packed_data_offset >= 8 * sizeof(char))
tempchar = 0;
@@ -848,7 +848,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
if (H5T_SGN_NONE == nsign) {
unsigned int tempuint;
- HDmemcpy(&tempuint, vp, sizeof(unsigned int));
+ memcpy(&tempuint, vp, sizeof(unsigned int));
if (packed_bits_num) {
if (packed_data_offset >= 8 * sizeof(unsigned int))
tempuint = 0;
@@ -860,7 +860,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
else {
int tempint;
- HDmemcpy(&tempint, vp, sizeof(int));
+ memcpy(&tempint, vp, sizeof(int));
if (packed_bits_num) {
if (packed_data_offset >= 8 * sizeof(int))
tempint = 0;
@@ -875,7 +875,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
if (H5T_SGN_NONE == nsign) {
unsigned short tempushort;
- HDmemcpy(&tempushort, vp, sizeof(unsigned short));
+ memcpy(&tempushort, vp, sizeof(unsigned short));
if (packed_bits_num) {
if (packed_data_offset >= 8 * sizeof(unsigned short))
tempushort = 0;
@@ -889,7 +889,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
else {
short tempshort;
- HDmemcpy(&tempshort, vp, sizeof(short));
+ memcpy(&tempshort, vp, sizeof(short));
if (packed_bits_num) {
if (packed_data_offset >= 8 * sizeof(short))
tempshort = 0;
@@ -904,7 +904,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
if (H5T_SGN_NONE == nsign) {
unsigned long tempulong;
- HDmemcpy(&tempulong, vp, sizeof(unsigned long));
+ memcpy(&tempulong, vp, sizeof(unsigned long));
if (packed_bits_num) {
if (packed_data_offset >= 8 * sizeof(unsigned long))
tempulong = 0;
@@ -916,7 +916,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
else {
long templong;
- HDmemcpy(&templong, vp, sizeof(long));
+ memcpy(&templong, vp, sizeof(long));
if (packed_bits_num) {
if (packed_data_offset >= 8 * sizeof(long))
templong = 0;
@@ -932,7 +932,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
if (H5T_SGN_NONE == nsign) {
unsigned long long tempullong;
- HDmemcpy(&tempullong, vp, sizeof(unsigned long long));
+ memcpy(&tempullong, vp, sizeof(unsigned long long));
if (packed_bits_num) {
if (packed_data_offset >= 8 * sizeof(unsigned long long))
tempullong = 0;
@@ -944,7 +944,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
else {
long long templlong;
- HDmemcpy(&templlong, vp, sizeof(long long));
+ memcpy(&templlong, vp, sizeof(long long));
if (packed_bits_num) {
if (packed_data_offset >= 8 * sizeof(long long))
templlong = 0;
@@ -1544,10 +1544,10 @@ h5tools_escape(char *s /*in,out*/, size_t size)
/*would overflow*/
return NULL;
- HDmemmove(s + i + esc_size, s + i + 1, n - i); /*make room*/
- HDmemcpy(s + i, escape, esc_size); /*insert*/
- n += esc_size - 1; /* adjust total string size */
- i += esc_size; /* adjust string position */
+ memmove(s + i + esc_size, s + i + 1, n - i); /*make room*/
+ memcpy(s + i, escape, esc_size); /*insert*/
+ n += esc_size - 1; /* adjust total string size */
+ i += esc_size; /* adjust string position */
}
}
@@ -1609,11 +1609,11 @@ h5tools_str_replace(const char *string, const char *substr, const char *replacem
free(oldstr);
return NULL;
}
- HDmemcpy(newstr, oldstr, (size_t)(tok - oldstr));
- HDmemcpy(newstr + (tok - oldstr), replacement, HDstrlen(replacement));
- HDmemcpy(newstr + (tok - oldstr) + HDstrlen(replacement), tok + HDstrlen(substr),
- HDstrlen(oldstr) - HDstrlen(substr) - (size_t)(tok - oldstr));
- HDmemset(newstr + HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement), 0, 1);
+ memcpy(newstr, oldstr, (size_t)(tok - oldstr));
+ memcpy(newstr + (tok - oldstr), replacement, HDstrlen(replacement));
+ memcpy(newstr + (tok - oldstr) + HDstrlen(replacement), tok + HDstrlen(substr),
+ HDstrlen(oldstr) - HDstrlen(substr) - (size_t)(tok - oldstr));
+ memset(newstr + HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement), 0, 1);
/* move back head right after the last replacement */
head = newstr + (tok - oldstr) + HDstrlen(replacement);
free(oldstr);
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 37a9568..baff559 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -784,7 +784,7 @@ add_obj(table_t *table, const H5O_token_t *obj_token, const char *objname, hbool
u = table->nobjs++;
/* Set information about object */
- HDmemcpy(&table->objs[u].obj_token, obj_token, sizeof(H5O_token_t));
+ memcpy(&table->objs[u].obj_token, obj_token, sizeof(H5O_token_t));
table->objs[u].objname = HDstrdup(objname);
table->objs[u].recorded = record;
table->objs[u].displayed = 0;
@@ -927,7 +927,7 @@ H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t
} /* end if */
/* set target obj type to return */
- HDmemcpy(&link_info->obj_token, &trg_oinfo.token, sizeof(H5O_token_t));
+ memcpy(&link_info->obj_token, &trg_oinfo.token, sizeof(H5O_token_t));
link_info->trg_type = trg_oinfo.type;
link_info->fileno = trg_oinfo.fileno;
} /* end if */
@@ -1180,7 +1180,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values)
ret_value = 0;
goto done;
}
- HDmemcpy(fa->aws_region, values[0], (HDstrlen(values[0]) + 1));
+ memcpy(fa->aws_region, values[0], (HDstrlen(values[0]) + 1));
if (show_progress) {
printf(" aws_region set\n");
}
@@ -1192,7 +1192,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values)
ret_value = 0;
goto done;
}
- HDmemcpy(fa->secret_id, values[1], (HDstrlen(values[1]) + 1));
+ memcpy(fa->secret_id, values[1], (HDstrlen(values[1]) + 1));
if (show_progress) {
printf(" secret_id set\n");
}
@@ -1204,7 +1204,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values)
ret_value = 0;
goto done;
}
- HDmemcpy(fa->secret_key, values[2], (HDstrlen(values[2]) + 1));
+ memcpy(fa->secret_key, values[2], (HDstrlen(values[2]) + 1));
if (show_progress) {
printf(" secret_key set\n");
}
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 060a33b..5ae379e 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -125,7 +125,7 @@ trav_token_add(trav_addr_t *visited, H5O_token_t *token, const char *path)
/* Append it */
idx = visited->nused++;
- HDmemcpy(&visited->objs[idx].token, token, sizeof(H5O_token_t));
+ memcpy(&visited->objs[idx].token, token, sizeof(H5O_token_t));
visited->objs[idx].path = HDstrdup(path);
} /* end trav_token_add() */
@@ -354,7 +354,7 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id)
else
H5Oget_info3(loc_id, &oinfo, H5O_INFO_BASIC);
- HDmemcpy(&info->paths[idx].obj_token, &oinfo.token, sizeof(H5O_token_t));
+ memcpy(&info->paths[idx].obj_token, &oinfo.token, sizeof(H5O_token_t));
info->paths[idx].fileno = oinfo.fileno;
} /* end trav_fileinfo_add() */
@@ -381,7 +381,7 @@ trav_info_visit_obj(const char *path, const H5O_info2_t *oinfo, const char H5_AT
/* set object addr and fileno. These are for checking same object */
info_p = (trav_info_t *)udata;
idx = info_p->nused - 1;
- HDmemcpy(&info_p->paths[idx].obj_token, &oinfo->token, sizeof(H5O_token_t));
+ memcpy(&info_p->paths[idx].obj_token, &oinfo->token, sizeof(H5O_token_t));
info_p->paths[idx].fileno = oinfo->fileno;
return (0);
@@ -658,7 +658,7 @@ trav_table_add(trav_table_t *table, const char *path, const H5O_info2_t *oinfo)
new_obj = table->nobjs++;
if (oinfo)
- HDmemcpy(&table->objs[new_obj].obj_token, &oinfo->token, sizeof(H5O_token_t));
+ memcpy(&table->objs[new_obj].obj_token, &oinfo->token, sizeof(H5O_token_t));
else
/* Set token to 'undefined' values */
table->objs[new_obj].obj_token = H5O_TOKEN_UNDEF;