summaryrefslogtreecommitdiffstats
path: root/tools/src/h5dump
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/h5dump')
-rw-r--r--tools/src/h5dump/h5dump.c44
-rw-r--r--tools/src/h5dump/h5dump_ddl.c48
-rw-r--r--tools/src/h5dump/h5dump_xml.c202
3 files changed, 147 insertions, 147 deletions
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index 62ba1c9..3b17a34 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -416,7 +416,7 @@ table_list_add(hid_t oid, unsigned long file_no)
h5dump_table_items_t *tmp_ptr;
table_list.nalloc = MAX(1, table_list.nalloc * 2);
- if (NULL == (tmp_ptr = (h5dump_table_items_t *)HDrealloc(
+ if (NULL == (tmp_ptr = (h5dump_table_items_t *)realloc(
table_list.tables, table_list.nalloc * sizeof(table_list.tables[0]))))
return -1;
table_list.tables = tmp_ptr;
@@ -493,7 +493,7 @@ table_list_free(void)
}
/* Free the table list */
- HDfree(table_list.tables);
+ free(table_list.tables);
table_list.tables = NULL;
table_list.nalloc = table_list.nused = 0;
} /* end table_list_free() */
@@ -708,26 +708,26 @@ free_handler(struct handler_t *hand, int len)
if (hand) {
for (i = 0; i < len; i++) {
if (hand[i].obj) {
- HDfree(hand[i].obj);
+ free(hand[i].obj);
hand[i].obj = NULL;
}
if (hand[i].subset_info) {
if (hand[i].subset_info->start.data)
- HDfree(hand[i].subset_info->start.data);
+ free(hand[i].subset_info->start.data);
if (hand[i].subset_info->stride.data)
- HDfree(hand[i].subset_info->stride.data);
+ free(hand[i].subset_info->stride.data);
if (hand[i].subset_info->count.data)
- HDfree(hand[i].subset_info->count.data);
+ free(hand[i].subset_info->count.data);
if (hand[i].subset_info->block.data)
- HDfree(hand[i].subset_info->block.data);
+ free(hand[i].subset_info->block.data);
- HDfree(hand[i].subset_info);
+ free(hand[i].subset_info);
hand[i].subset_info = NULL;
}
}
- HDfree(hand);
+ free(hand);
}
}
@@ -758,7 +758,7 @@ parse_command_line(int argc, const char *const *argv)
}
/* this will be plenty big enough to hold the info */
- if ((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t))) == NULL) {
+ if ((hand = (struct handler_t *)calloc((size_t)argc, sizeof(struct handler_t))) == NULL) {
goto error;
}
@@ -1078,7 +1078,7 @@ parse_start:
s = last_dset->subset_info;
}
else {
- last_dset->subset_info = s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t));
+ last_dset->subset_info = s = (struct subset_t *)calloc(1, sizeof(struct subset_t));
}
/*
@@ -1096,28 +1096,28 @@ parse_start:
switch ((char)opt) {
case 's':
if (s->start.data) {
- HDfree(s->start.data);
+ free(s->start.data);
s->start.data = NULL;
}
parse_hsize_list(H5_optarg, &s->start);
break;
case 'S':
if (s->stride.data) {
- HDfree(s->stride.data);
+ free(s->stride.data);
s->stride.data = NULL;
}
parse_hsize_list(H5_optarg, &s->stride);
break;
case 'c':
if (s->count.data) {
- HDfree(s->count.data);
+ free(s->count.data);
s->count.data = NULL;
}
parse_hsize_list(H5_optarg, &s->count);
break;
case 'k':
if (s->block.data) {
- HDfree(s->block.data);
+ free(s->block.data);
s->block.data = NULL;
}
parse_hsize_list(H5_optarg, &s->block);
@@ -1481,7 +1481,7 @@ main(int argc, char *argv[])
"xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File "
"http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",
xmlnsprefix, ns);
- HDfree(ns);
+ free(ns);
}
}
else {
@@ -1554,11 +1554,11 @@ main(int argc, char *argv[])
h5tools_setstatus(EXIT_FAILURE);
if (prefix) {
- HDfree(prefix);
+ free(prefix);
prefix = NULL;
}
if (fname) {
- HDfree(fname);
+ free(fname);
fname = NULL;
}
} /* end while */
@@ -1584,11 +1584,11 @@ done:
h5tools_setstatus(EXIT_FAILURE);
if (prefix) {
- HDfree(prefix);
+ free(prefix);
prefix = NULL;
}
if (fname) {
- HDfree(fname);
+ free(fname);
fname = NULL;
}
@@ -1613,7 +1613,7 @@ static void
init_prefix(char **prfx, size_t prfx_len)
{
if (prfx_len > 0)
- *prfx = (char *)HDcalloc(prfx_len, 1);
+ *prfx = (char *)calloc(prfx_len, 1);
else
error_msg("unable to allocate prefix buffer\n");
}
@@ -1635,7 +1635,7 @@ add_prefix(char **prfx, size_t *prfx_len, const char *name)
/* Check if we need more space */
if (*prfx_len <= new_len) {
*prfx_len = new_len + 1;
- *prfx = (char *)HDrealloc(*prfx, *prfx_len);
+ *prfx = (char *)realloc(*prfx, *prfx_len);
}
/* Append object name to prefix */
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c
index 9d59c95..c15bd26 100644
--- a/tools/src/h5dump/h5dump_ddl.c
+++ b/tools/src/h5dump/h5dump_ddl.c
@@ -187,7 +187,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT
outputformat = &string_dataformat;
/* Build the object's path name */
- obj_path = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ obj_path = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2);
if (!obj_path) {
ret = FAIL;
goto done;
@@ -229,7 +229,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT
/* Restore old prefix name */
HDstrcpy(prefix, old_prefix);
- HDfree(old_prefix);
+ free(old_prefix);
}
else
error_msg("warning: null prefix\n");
@@ -386,7 +386,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT
switch (linfo->type) {
case H5L_TYPE_SOFT:
- if ((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) {
+ if ((targbuf = (char *)malloc(linfo->u.val_size)) == NULL) {
error_msg("unable to allocate buffer\n");
h5tools_setstatus(EXIT_FAILURE);
ret = FAIL;
@@ -436,12 +436,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(targbuf);
+ free(targbuf);
}
break;
case H5L_TYPE_EXTERNAL:
- if ((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) {
+ if ((targbuf = (char *)malloc(linfo->u.val_size)) == NULL) {
error_msg("unable to allocate buffer\n");
h5tools_setstatus(EXIT_FAILURE);
ret = FAIL;
@@ -510,7 +510,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(targbuf);
+ free(targbuf);
}
break;
@@ -560,7 +560,7 @@ done:
h5tools_str_close(&buffer);
if (obj_path)
- HDfree(obj_path);
+ free(obj_path);
return ret;
}
@@ -1336,7 +1336,7 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a
u = HDstrlen(buf);
v = HDstrlen(op_name);
w = u + 1 + v + 1 + 2;
- obj_name = (char *)HDmalloc(w);
+ obj_name = (char *)malloc(w);
if (obj_name == NULL) {
h5tools_setstatus(EXIT_FAILURE);
ret = FAIL;
@@ -1359,10 +1359,10 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a
buffer_space -= MIN(buffer_space, v);
handle_attributes(oid, obj_name, NULL, 0, NULL);
- HDfree(obj_name);
+ free(obj_name);
}
}
- HDfree(obj_op_name);
+ free(obj_op_name);
}
return ret;
} /* end attr_search() */
@@ -1420,7 +1420,7 @@ lnk_search(const char *path, const H5L_info2_t *li, void *_op_data)
k = 2;
else
k = 1;
- search_name = (char *)HDmalloc(search_len + k);
+ search_name = (char *)malloc(search_len + k);
if (search_name == NULL) {
error_msg("creating temporary link\n");
h5tools_setstatus(EXIT_FAILURE);
@@ -1450,7 +1450,7 @@ lnk_search(const char *path, const H5L_info2_t *li, void *_op_data)
break;
} /* end switch() */
}
- HDfree(search_name);
+ free(search_name);
}
return 0;
} /* end lnk_search() */
@@ -1534,7 +1534,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5
hsize_t curr_pos = 0; /* total data element position */
j = (int)HDstrlen(attr) - 1;
- obj_name = (char *)HDmalloc((size_t)j + 2);
+ obj_name = (char *)malloc((size_t)j + 2);
if (obj_name == NULL)
goto error;
@@ -1631,18 +1631,18 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5
goto error;
} /* end if */
- HDfree(obj_name);
- HDfree(attr_name);
+ free(obj_name);
+ free(attr_name);
dump_indent -= COL;
return;
error:
h5tools_setstatus(EXIT_FAILURE);
if (obj_name)
- HDfree(obj_name);
+ free(obj_name);
if (attr_name)
- HDfree(attr_name);
+ free(attr_name);
H5E_BEGIN_TRY
{
@@ -1709,7 +1709,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis
if (!sset->start.data) {
/* default to (0, 0, ...) for the start coord */
if (ndims > 0)
- sset->start.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t));
+ sset->start.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t));
else
sset->start.data = NULL;
sset->start.len = ndims;
@@ -1717,7 +1717,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis
if (!sset->stride.data) {
if (ndims > 0)
- sset->stride.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t));
+ sset->stride.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t));
else
sset->stride.data = NULL;
sset->stride.len = ndims;
@@ -1727,7 +1727,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis
if (!sset->count.data) {
if (ndims > 0)
- sset->count.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t));
+ sset->count.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t));
else
sset->count.data = NULL;
sset->count.len = ndims;
@@ -1737,7 +1737,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis
if (!sset->block.data) {
if (ndims > 0)
- sset->block.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t));
+ sset->block.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t));
else
sset->block.data = NULL;
sset->block.len = ndims;
@@ -1856,7 +1856,7 @@ handle_groups(hid_t fid, const char *group, void H5_ATTR_UNUSED *data, int pe, c
if (prefix_len <= new_len) {
prefix_len = new_len;
- prefix = (char *)HDrealloc(prefix, prefix_len);
+ prefix = (char *)realloc(prefix, prefix_len);
} /* end if */
HDstrcpy(prefix, group);
@@ -1893,7 +1893,7 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED *data, int H5_ATT
h5tools_setstatus(EXIT_FAILURE);
}
else {
- char *buf = (char *)HDmalloc(linfo.u.val_size);
+ char *buf = (char *)malloc(linfo.u.val_size);
PRINTVALSTREAM(rawoutstream, "\n");
switch (linfo.type) {
@@ -1951,7 +1951,7 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED *data, int H5_ATT
end_obj(h5tools_dump_header_format->udlinkend, h5tools_dump_header_format->udlinkblockend);
break;
} /* end switch */
- HDfree(buf);
+ free(buf);
} /* end else */
}
diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c
index 80f9142..485d6f6 100644
--- a/tools/src/h5dump/h5dump_xml.c
+++ b/tools/src/h5dump/h5dump_xml.c
@@ -165,7 +165,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5
outputformat = &string_dataformat;
/* Build the object's path name */
- obj_path = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ obj_path = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2);
if (!obj_path) {
ret = FAIL;
goto done;
@@ -211,7 +211,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5
/* Restore old prefix name */
HDstrcpy(prefix, old_prefix);
- HDfree(old_prefix);
+ free(old_prefix);
}
/* Close group */
@@ -316,10 +316,10 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_name);
- HDfree(t_obj_path);
- HDfree(t_prefix);
- HDfree(t_objname);
+ free(t_name);
+ free(t_obj_path);
+ free(t_prefix);
+ free(t_objname);
H5Dclose(obj);
goto done;
@@ -364,7 +364,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5
switch (linfo->type) {
case H5L_TYPE_SOFT:
- if ((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) {
+ if ((targbuf = (char *)malloc(linfo->u.val_size)) == NULL) {
error_msg("unable to allocate buffer\n");
h5tools_setstatus(EXIT_FAILURE);
ret = FAIL;
@@ -388,7 +388,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5
char *t_link_path;
int res;
- t_link_path = (char *)HDmalloc(HDstrlen(prefix) + linfo->u.val_size + 1);
+ t_link_path = (char *)malloc(HDstrlen(prefix) + linfo->u.val_size + 1);
if (targbuf[0] == '/')
HDstrcpy(t_link_path, targbuf);
else {
@@ -446,19 +446,19 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
}
- HDfree(t_prefix);
- HDfree(t_name);
- HDfree(t_targbuf);
- HDfree(t_obj_path);
- HDfree(t_link_path);
+ free(t_prefix);
+ free(t_name);
+ free(t_targbuf);
+ free(t_obj_path);
+ free(t_link_path);
}
- HDfree(targbuf);
+ free(targbuf);
}
break;
case H5L_TYPE_EXTERNAL:
- if ((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) {
+ if ((targbuf = (char *)malloc(linfo->u.val_size)) == NULL) {
error_msg("unable to allocate buffer\n");
h5tools_setstatus(EXIT_FAILURE);
ret = FAIL;
@@ -512,14 +512,14 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_prefix);
- HDfree(t_name);
- HDfree(t_filename);
- HDfree(t_targname);
- HDfree(t_obj_path);
+ free(t_prefix);
+ free(t_name);
+ free(t_filename);
+ free(t_targname);
+ free(t_obj_path);
} /* end else */
} /* end else */
- HDfree(targbuf);
+ free(targbuf);
}
break;
@@ -556,9 +556,9 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_prefix);
- HDfree(t_name);
- HDfree(t_obj_path);
+ free(t_prefix);
+ free(t_name);
+ free(t_obj_path);
} break;
} /* end switch */
@@ -569,7 +569,7 @@ done:
h5tools_str_close(&buffer);
if (obj_path)
- HDfree(obj_path);
+ free(obj_path);
return ret;
}
@@ -689,7 +689,7 @@ xml_escape_the_name(const char *str)
cp = str;
ncp_len = len + extra + 1;
- rcp = ncp = (char *)HDmalloc(ncp_len);
+ rcp = ncp = (char *)malloc(ncp_len);
if (!ncp)
return NULL; /* ?? */
@@ -782,7 +782,7 @@ xml_escape_the_string(const char *str, int slen)
cp = str;
ncp_len = len + extra + 1;
- rcp = ncp = (char *)HDcalloc(ncp_len, sizeof(char));
+ rcp = ncp = (char *)calloc(ncp_len, sizeof(char));
if (ncp == NULL)
return NULL; /* ?? */
@@ -912,7 +912,7 @@ xml_print_datatype(hid_t type, unsigned in_group)
/* This should be defined somewhere else */
/* These 2 cases are handled the same right now, but
probably will have something different eventually */
- char *dtxid = (char *)HDmalloc((size_t)100);
+ char *dtxid = (char *)malloc((size_t)100);
xml_name_to_XID(type, found_obj->objname, dtxid, 100, 1);
if (!found_obj->recorded) {
@@ -939,9 +939,9 @@ xml_print_datatype(hid_t type, unsigned in_group)
dtxid, t_objname);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_objname);
+ free(t_objname);
}
- HDfree(dtxid);
+ free(dtxid);
}
else {
ctx.need_prefix = TRUE;
@@ -1286,7 +1286,7 @@ xml_print_datatype(hid_t type, unsigned in_group)
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
H5free_memory(mname);
- HDfree(t_fname);
+ free(t_fname);
dump_indent += COL;
ctx.indent_level++;
@@ -1612,7 +1612,7 @@ xml_dump_datatype(hid_t type)
if (found_obj) {
/* Shared datatype, must be entered as an object */
/* These 2 cases are the same now, but may change */
- char *dtxid = (char *)HDmalloc((size_t)100);
+ char *dtxid = (char *)malloc((size_t)100);
xml_name_to_XID(type, found_obj->objname, dtxid, 100, 1);
if (!found_obj->recorded) {
@@ -1642,9 +1642,9 @@ xml_dump_datatype(hid_t type)
xmlnsprefix, dtxid, t_objname);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_objname);
+ free(t_objname);
}
- HDfree(dtxid);
+ free(dtxid);
}
else {
ctx.need_prefix = TRUE;
@@ -2081,7 +2081,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED
h5tools_str_append(&buffer, "<%sAttribute Name=\"%s\">", xmlnsprefix, t_aname);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_aname);
+ free(t_aname);
if ((attr_id = H5Aopen(attr, attr_name, H5P_DEFAULT)) >= 0) {
type = H5Aget_type(attr_id);
@@ -2370,7 +2370,7 @@ xml_dump_named_datatype(hid_t type, const char *name)
char *t_prefix = NULL;
char *t_name = NULL;
- tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ tmp = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2);
if (tmp == NULL) {
indentation(dump_indent);
error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
@@ -2406,8 +2406,8 @@ xml_dump_named_datatype(hid_t type, const char *name)
string_dataformat.do_escape = dump_opts.display_escape;
outputformat = &string_dataformat;
- dtxid = (char *)HDmalloc((size_t)100);
- parentxid = (char *)HDmalloc((size_t)100);
+ dtxid = (char *)malloc((size_t)100);
+ parentxid = (char *)malloc((size_t)100);
t_tmp = xml_escape_the_name(tmp);
t_prefix = xml_escape_the_name(prefix);
t_name = xml_escape_the_name(name);
@@ -2493,7 +2493,7 @@ xml_dump_named_datatype(hid_t type, const char *name)
h5tools_str_append(&buffer, "</%sNamedDataType>", xmlnsprefix);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_objname);
+ free(t_objname);
goto done;
}
else
@@ -2541,12 +2541,12 @@ done:
h5tools_str_close(&buffer);
- HDfree(dtxid);
- HDfree(parentxid);
- HDfree(t_tmp);
- HDfree(t_prefix);
- HDfree(t_name);
- HDfree(tmp);
+ free(dtxid);
+ free(parentxid);
+ free(t_tmp);
+ free(t_prefix);
+ free(t_name);
+ free(tmp);
}
/*-------------------------------------------------------------------------
@@ -2631,7 +2631,7 @@ xml_dump_group(hid_t gid, const char *name)
tmp = HDstrdup("/");
}
else {
- tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ tmp = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2);
if (tmp == NULL) {
indentation(dump_indent);
error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
@@ -2665,11 +2665,11 @@ xml_dump_group(hid_t gid, const char *name)
}
else {
char *t_name = xml_escape_the_name(name);
- char *grpxid = (char *)HDmalloc((size_t)100);
- char *parentxid = (char *)HDmalloc((size_t)100);
+ char *grpxid = (char *)malloc((size_t)100);
+ char *parentxid = (char *)malloc((size_t)100);
if (found_obj->displayed) {
- char *ptrstr = (char *)HDmalloc((size_t)100);
+ char *ptrstr = (char *)malloc((size_t)100);
/* already seen: enter a groupptr */
if (isRoot) {
@@ -2702,8 +2702,8 @@ xml_dump_group(hid_t gid, const char *name)
par_name);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_objname);
- HDfree(par_name);
+ free(t_objname);
+ free(par_name);
ctx.indent_level++;
@@ -2725,10 +2725,10 @@ xml_dump_group(hid_t gid, const char *name)
ctx.indent_level--;
- HDfree(t_objname);
- HDfree(par_name);
+ free(t_objname);
+ free(par_name);
}
- HDfree(ptrstr);
+ free(ptrstr);
}
else {
@@ -2763,8 +2763,8 @@ xml_dump_group(hid_t gid, const char *name)
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_tmp);
- HDfree(par_name);
+ free(t_tmp);
+ free(par_name);
}
found_obj->displayed = TRUE;
@@ -2820,16 +2820,16 @@ xml_dump_group(hid_t gid, const char *name)
dump_indent -= COL;
ctx.indent_level--;
}
- HDfree(t_name);
- HDfree(grpxid);
- HDfree(parentxid);
+ free(t_name);
+ free(grpxid);
+ free(parentxid);
}
}
else {
/* only link -- must be first time! */
char *t_name = xml_escape_the_name(name);
- char *grpxid = (char *)HDmalloc((size_t)100);
- char *parentxid = (char *)HDmalloc((size_t)100);
+ char *grpxid = (char *)malloc((size_t)100);
+ char *parentxid = (char *)malloc((size_t)100);
ctx.need_prefix = TRUE;
@@ -2851,15 +2851,15 @@ xml_dump_group(hid_t gid, const char *name)
"<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" "
"Parents=\"%s\" H5ParentPaths=\"%s\" >",
xmlnsprefix, t_name, grpxid, t_tmp, parentxid, par_name);
- HDfree(t_tmp);
- HDfree(par_name);
+ free(t_tmp);
+ free(par_name);
}
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_name);
- HDfree(grpxid);
- HDfree(parentxid);
+ free(t_name);
+ free(grpxid);
+ free(parentxid);
/* 1. do all the attributes of the group */
@@ -2928,9 +2928,9 @@ xml_dump_group(hid_t gid, const char *name)
h5tools_str_close(&buffer);
if (par)
- HDfree(par);
+ free(par);
if (tmp)
- HDfree(tmp);
+ free(tmp);
}
/*-------------------------------------------------------------------------
@@ -2983,7 +2983,7 @@ xml_print_refs(hid_t did, int source)
if ((ssiz = H5Sget_simple_extent_npoints(space)) < 0)
goto error;
- buf = (char *)HDcalloc((size_t)ssiz, sizeof(H5R_ref_t));
+ buf = (char *)calloc((size_t)ssiz, sizeof(H5R_ref_t));
if (buf == NULL)
goto error;
e = H5Dread(did, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -2996,7 +2996,7 @@ xml_print_refs(hid_t did, int source)
if ((ssiz = H5Sget_simple_extent_npoints(space)) < 0)
goto error;
- buf = (char *)HDcalloc((size_t)ssiz, sizeof(H5R_ref_t));
+ buf = (char *)calloc((size_t)ssiz, sizeof(H5R_ref_t));
if (buf == NULL)
goto error;
e = H5Aread(did, H5T_STD_REF, buf);
@@ -3054,7 +3054,7 @@ xml_print_refs(hid_t did, int source)
h5tools_str_append(&buffer, "\"%s\"", t_path);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_path);
+ free(t_path);
}
ctx.indent_level--;
@@ -3065,14 +3065,14 @@ xml_print_refs(hid_t did, int source)
h5tools_str_close(&buffer);
- HDfree(buf);
+ free(buf);
H5Tclose(type);
H5Sclose(space);
return SUCCEED;
error:
if (buf)
- HDfree(buf);
+ free(buf);
H5E_BEGIN_TRY
{
@@ -3133,7 +3133,7 @@ xml_print_strs(hid_t did, int source)
if ((tsiz = H5Tget_size(type)) == 0)
goto error;
- buf = HDmalloc((size_t)ssiz * tsiz);
+ buf = malloc((size_t)ssiz * tsiz);
if (buf == NULL)
goto error;
@@ -3148,7 +3148,7 @@ xml_print_strs(hid_t did, int source)
if ((tsiz = H5Tget_size(type)) == 0)
goto error;
- buf = HDmalloc((size_t)ssiz * tsiz);
+ buf = malloc((size_t)ssiz * tsiz);
if (buf == NULL)
goto error;
@@ -3159,7 +3159,7 @@ xml_print_strs(hid_t did, int source)
bp = (char *)buf;
if (!is_vlstr) {
- onestring = (char *)HDcalloc(tsiz, sizeof(char));
+ onestring = (char *)calloc(tsiz, sizeof(char));
if (onestring == NULL)
goto error;
}
@@ -3219,7 +3219,7 @@ xml_print_strs(hid_t did, int source)
h5tools_str_append(&buffer, "\"%s\"", t_onestring);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_onestring);
+ free(t_onestring);
}
}
bp += tsiz;
@@ -3230,11 +3230,11 @@ xml_print_strs(hid_t did, int source)
/* Reclaim any VL memory, if necessary */
if (!is_vlstr)
if (onestring)
- HDfree(onestring);
+ free(onestring);
if (buf) {
if (is_vlstr)
H5Treclaim(type, space, H5P_DEFAULT, buf);
- HDfree(buf);
+ free(buf);
}
H5Tclose(type);
H5Sclose(space);
@@ -3242,7 +3242,7 @@ xml_print_strs(hid_t did, int source)
error:
if (buf)
- HDfree(buf);
+ free(buf);
H5E_BEGIN_TRY
{
@@ -3459,7 +3459,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
dump_indent += COL;
space = H5Tget_size(type);
- buf = HDmalloc((size_t)space);
+ buf = malloc((size_t)space);
H5Pget_fill_value(dcpl, type, buf);
@@ -3492,7 +3492,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_str_append(&buffer, "\"%s\"", t_path);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_path);
+ free(t_path);
}
ctx.need_prefix = TRUE;
@@ -3732,7 +3732,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
break;
}
}
- HDfree(buf);
+ free(buf);
ctx.indent_level--;
dump_indent -= COL;
@@ -3782,15 +3782,15 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss
h5tool_format_t string_dataformat;
hsize_t curr_pos = 0; /* total data element position */
- char *rstr = (char *)HDmalloc((size_t)100);
- char *pstr = (char *)HDmalloc((size_t)100);
+ char *rstr = (char *)malloc((size_t)100);
+ char *pstr = (char *)malloc((size_t)100);
- tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ tmp = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2);
if (tmp == NULL) {
error_msg("buffer allocation failed\n");
h5tools_setstatus(EXIT_FAILURE);
- HDfree(rstr);
- HDfree(pstr);
+ free(rstr);
+ free(pstr);
return;
}
@@ -3839,12 +3839,12 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_name);
- HDfree(t_tmp);
- HDfree(t_prefix);
- HDfree(rstr);
- HDfree(pstr);
- HDfree(tmp);
+ free(t_name);
+ free(t_tmp);
+ free(t_prefix);
+ free(rstr);
+ free(pstr);
+ free(tmp);
dcpl = H5Dget_create_plist(did);
type = H5Dget_type(did);
@@ -3860,7 +3860,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss
h5tools_setstatus(EXIT_FAILURE);
}
else {
- chsize = (hsize_t *)HDmalloc((size_t)maxdims * sizeof(hsize_t));
+ chsize = (hsize_t *)malloc((size_t)maxdims * sizeof(hsize_t));
ctx.indent_level++;
dump_indent += COL;
@@ -3943,7 +3943,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.indent_level--;
dump_indent -= COL;
- HDfree(chsize);
+ free(chsize);
}
}
else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl)) {
@@ -4457,8 +4457,8 @@ xml_print_enum(hid_t type)
}
/* Get the names and raw values of all members */
- name = (char **)HDcalloc((size_t)nmembs, sizeof(char *));
- value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size));
+ name = (char **)calloc((size_t)nmembs, sizeof(char *));
+ value = (unsigned char *)calloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size));
for (i = 0; i < nmembs; i++) {
name[i] = H5Tget_member_name(type, i);
@@ -4494,7 +4494,7 @@ xml_print_enum(hid_t type)
h5tools_str_append(&buffer, "%s", t_name);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
- HDfree(t_name);
+ free(t_name);
ctx.indent_level--;
ctx.need_prefix = TRUE;
@@ -4557,7 +4557,7 @@ xml_print_enum(hid_t type)
for (i = 0; i < nmembs; i++)
H5free_memory(name[i]);
- HDfree(name);
- HDfree(value);
+ free(name);
+ free(value);
H5Tclose(super);
}