summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_attr.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-07-27 20:43:30 (GMT)
committerGitHub <noreply@github.com>2023-07-27 20:43:30 (GMT)
commit1e91d96fa02466ffe451319bdac1005f84dc7993 (patch)
tree4de04ef502c313dfd766497b20235188761146c0 /tools/lib/h5diff_attr.c
parent95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82 (diff)
downloadhdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.zip
hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.gz
hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.bz2
Brings over most of the HD prefix removal (#3293)
Diffstat (limited to 'tools/lib/h5diff_attr.c')
-rw-r--r--tools/lib/h5diff_attr.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index aa64fa5..0dbaee1 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -45,7 +45,7 @@ typedef struct table_attrs_t {
static void
table_attrs_init(table_attrs_t **tbl)
{
- table_attrs_t *table_attrs = (table_attrs_t *)HDmalloc(sizeof(table_attrs_t));
+ table_attrs_t *table_attrs = (table_attrs_t *)malloc(sizeof(table_attrs_t));
table_attrs->size = 0;
table_attrs->nattrs = 0;
@@ -77,13 +77,13 @@ table_attrs_free(table_attrs_t *table)
if (table->attrs) {
for (i = 0; i < table->nattrs; i++) {
if (table->attrs[i].name) {
- HDfree(table->attrs[i].name);
+ free(table->attrs[i].name);
}
} /* end for */
- HDfree(table->attrs);
+ free(table->attrs);
table->attrs = NULL;
} /* end if */
- HDfree(table);
+ free(table);
table = NULL;
}
}
@@ -109,7 +109,7 @@ table_attr_mark_exist(const unsigned *exist, char *name, table_attrs_t *table)
match_attr_t *new_attrs;
table->size = MAX(1, table->size * 2);
- new_attrs = (match_attr_t *)HDrealloc(table->attrs, table->size * sizeof(match_attr_t));
+ new_attrs = (match_attr_t *)realloc(table->attrs, table->size * sizeof(match_attr_t));
if (new_attrs)
table->attrs = new_attrs;
} /* end if */
@@ -396,7 +396,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na
sz = HDstrlen(name1);
H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz);
if (sz > 0) {
- opts->obj_name[0] = (char *)HDmalloc(sz + 1);
+ opts->obj_name[0] = (char *)malloc(sz + 1);
HDstrncpy(opts->obj_name[0], name1, sz + 1);
}
}
@@ -404,7 +404,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na
sz = HDstrlen(name2);
H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz);
if (sz > 0) {
- opts->obj_name[1] = (char *)HDmalloc(sz + 1);
+ opts->obj_name[1] = (char *)malloc(sz + 1);
HDstrncpy(opts->obj_name[1], name2, sz + 1);
}
}
@@ -440,8 +440,8 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na
* read
*----------------------------------------------------------------------
*/
- buf1 = (void *)HDcalloc((size_t)(opts->nelmts), msize1);
- buf2 = (void *)HDcalloc((size_t)(opts->nelmts), msize2);
+ buf1 = (void *)calloc((size_t)(opts->nelmts), msize1);
+ buf2 = (void *)calloc((size_t)(opts->nelmts), msize2);
H5TOOLS_DEBUG("attr buffer size %ld * %ld", opts->nelmts, msize1);
if (buf1 == NULL || buf2 == NULL) {
parallel_print("cannot read into memory\n");
@@ -465,24 +465,24 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na
/* format output string */
if (opts->obj_name[0] != NULL)
- HDfree(opts->obj_name[0]);
+ free(opts->obj_name[0]);
opts->obj_name[0] = NULL;
if (opts->obj_name[1] != NULL)
- HDfree(opts->obj_name[1]);
+ free(opts->obj_name[1]);
opts->obj_name[1] = NULL;
H5TOOLS_DEBUG("attr_names: %s - %s : %s - %s", name1, name2, path1, path2);
if (name1) {
sz = HDstrlen(name1) + HDstrlen(path1) + 7;
H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz);
- opts->obj_name[0] = (char *)HDcalloc(sz + 1, sizeof(char));
+ opts->obj_name[0] = (char *)calloc(sz + 1, sizeof(char));
HDsnprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1);
opts->obj_name[0][sz] = '\0';
}
if (name2) {
sz = HDstrlen(name2) + HDstrlen(path2) + 7;
H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz);
- opts->obj_name[1] = (char *)HDcalloc(sz + 1, sizeof(char));
+ opts->obj_name[1] = (char *)calloc(sz + 1, sizeof(char));
HDsnprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2);
opts->obj_name[1][sz] = '\0';
}
@@ -531,22 +531,22 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na
*----------------------------------------------------------------------
*/
if (opts->obj_name[0] != NULL)
- HDfree(opts->obj_name[0]);
+ free(opts->obj_name[0]);
opts->obj_name[0] = NULL;
if (opts->obj_name[1] != NULL)
- HDfree(opts->obj_name[1]);
+ free(opts->obj_name[1]);
opts->obj_name[1] = NULL;
/* Free buf1 and buf2, check both VLEN-data VLEN-string to reclaim any
* VLEN memory first */
if (TRUE == h5tools_detect_vlen(mtype1_id))
H5Treclaim(mtype1_id, space1_id, H5P_DEFAULT, buf1);
- HDfree(buf1);
+ free(buf1);
buf1 = NULL;
if (TRUE == h5tools_detect_vlen(mtype2_id))
H5Treclaim(mtype2_id, space2_id, H5P_DEFAULT, buf2);
- HDfree(buf2);
+ free(buf2);
buf2 = NULL;
if (H5Tclose(ftype1_id) < 0)
@@ -570,12 +570,12 @@ done:
if (buf1) {
if (buf1hasdata && TRUE == h5tools_detect_vlen(mtype1_id))
H5Treclaim(mtype1_id, space1_id, H5P_DEFAULT, buf1);
- HDfree(buf1);
+ free(buf1);
} /* end if */
if (buf2) {
if (buf2hasdata && TRUE == h5tools_detect_vlen(mtype2_id))
H5Treclaim(mtype2_id, space2_id, H5P_DEFAULT, buf2);
- HDfree(buf2);
+ free(buf2);
} /* end if */
H5Tclose(ftype1_id);