diff options
Diffstat (limited to 'tools/src')
-rw-r--r-- | tools/src/h5copy/h5copy.c | 20 | ||||
-rw-r--r-- | tools/src/h5diff/h5diff_common.c | 4 | ||||
-rw-r--r-- | tools/src/h5diff/h5diff_main.c | 10 | ||||
-rw-r--r-- | tools/src/h5dump/h5dump.c | 44 | ||||
-rw-r--r-- | tools/src/h5dump/h5dump_ddl.c | 48 | ||||
-rw-r--r-- | tools/src/h5dump/h5dump_xml.c | 202 | ||||
-rw-r--r-- | tools/src/h5format_convert/h5format_convert.c | 4 | ||||
-rw-r--r-- | tools/src/h5import/h5import.c | 62 | ||||
-rw-r--r-- | tools/src/h5jam/h5jam.c | 6 | ||||
-rw-r--r-- | tools/src/h5jam/h5unjam.c | 12 | ||||
-rw-r--r-- | tools/src/h5ls/h5ls.c | 46 | ||||
-rw-r--r-- | tools/src/h5perf/pio_engine.c | 6 | ||||
-rw-r--r-- | tools/src/h5perf/pio_perf.c | 8 | ||||
-rw-r--r-- | tools/src/h5perf/sio_engine.c | 16 | ||||
-rw-r--r-- | tools/src/h5perf/sio_perf.c | 22 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack.c | 20 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_copy.c | 16 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_opttable.c | 12 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_parse.c | 50 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_refs.c | 95 | ||||
-rw-r--r-- | tools/src/h5stat/h5stat.c | 49 | ||||
-rw-r--r-- | tools/src/misc/h5clear.c | 4 | ||||
-rw-r--r-- | tools/src/misc/h5mkgrp.c | 8 | ||||
-rw-r--r-- | tools/src/misc/h5repart.c | 12 |
24 files changed, 387 insertions, 389 deletions
diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 62a3905..deae9a9 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -52,15 +52,15 @@ static void leave(int ret) { if (fname_src) - HDfree(fname_src); + free(fname_src); if (fname_dst) - HDfree(fname_dst); + free(fname_dst); if (oname_dst) - HDfree(oname_dst); + free(oname_dst); if (oname_src) - HDfree(oname_src); + free(oname_src); if (str_flag) - HDfree(str_flag); + free(str_flag); h5tools_close(); HDexit(ret); @@ -419,15 +419,15 @@ main(int argc, char *argv[]) if ('/' == oname_dst[i]) { char *str_ptr; - str_ptr = (char *)HDcalloc(i + 1, sizeof(char)); + str_ptr = (char *)calloc(i + 1, sizeof(char)); HDstrncpy(str_ptr, oname_dst, i); str_ptr[i] = '\0'; if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0) { error_msg("group <%s> doesn't exist. Use -p to create parent groups.\n", str_ptr); - HDfree(str_ptr); + free(str_ptr); H5TOOLS_GOTO_ERROR(EXIT_FAILURE, "H5Lexists failed"); } - HDfree(str_ptr); + free(str_ptr); } } } @@ -458,7 +458,7 @@ main(int argc, char *argv[]) /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + free(linkinfo.trg_path); /* close propertis */ if (H5Pclose(ocpl_id) < 0) @@ -479,7 +479,7 @@ done: /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + free(linkinfo.trg_path); H5E_BEGIN_TRY { diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 5ae2a37..c15603d 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -216,7 +216,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const opts->exclude_path = 1; /* create linked list of excluding objects */ - if ((exclude_node = (struct exclude_path_list *)HDmalloc(sizeof(struct exclude_path_list))) == + if ((exclude_node = (struct exclude_path_list *)malloc(sizeof(struct exclude_path_list))) == NULL) { printf("Error: lack of memory!\n"); h5diff_exit(EXIT_FAILURE); @@ -249,7 +249,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const /* create linked list of excluding objects */ if ((exclude_attr_node = - (struct exclude_path_list *)HDmalloc(sizeof(struct exclude_path_list))) == NULL) { + (struct exclude_path_list *)malloc(sizeof(struct exclude_path_list))) == NULL) { printf("Error: lack of memory!\n"); h5diff_exit(EXIT_FAILURE); } diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index 561f139..fd594db 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -89,15 +89,15 @@ main(int argc, char *argv[]) for (i = 0; i < 2; i++) { if (opts.sset[i]) { if (opts.sset[i]->start.data) - HDfree(opts.sset[i]->start.data); + free(opts.sset[i]->start.data); if (opts.sset[i]->stride.data) - HDfree(opts.sset[i]->stride.data); + free(opts.sset[i]->stride.data); if (opts.sset[i]->count.data) - HDfree(opts.sset[i]->count.data); + free(opts.sset[i]->count.data); if (opts.sset[i]->block.data) - HDfree(opts.sset[i]->block.data); + free(opts.sset[i]->block.data); - HDfree(opts.sset[i]); + free(opts.sset[i]); opts.sset[i] = NULL; } } 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); } diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index ac98b25..648b9a8 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -453,9 +453,9 @@ done: } /* end if */ if (fname_g) - HDfree(fname_g); + free(fname_g); if (dname_g) - HDfree(dname_g); + free(dname_g); leave(h5tools_getstatus()); diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 05f51e4..d6273e2 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -101,7 +101,7 @@ main(int argc, char *argv[]) (void)HDsetvbuf(stderr, (char *)NULL, _IOLBF, 0); (void)HDsetvbuf(stdout, (char *)NULL, _IOLBF, 0); - if ((opt = (struct Options *)HDcalloc(1, sizeof(struct Options))) == NULL) + if ((opt = (struct Options *)calloc(1, sizeof(struct Options))) == NULL) goto err; if (argv[1] && (HDstrcmp("-V", argv[1]) == 0)) { @@ -242,17 +242,17 @@ main(int argc, char *argv[]) for (i = 0; i < opt->fcount; i++) { in = &(opt->infiles[i].in); if (in->sizeOfDimension) - HDfree(in->sizeOfDimension); + free(in->sizeOfDimension); if (in->sizeOfChunk) - HDfree(in->sizeOfChunk); + free(in->sizeOfChunk); if (in->maxsizeOfDimension) - HDfree(in->maxsizeOfDimension); + free(in->maxsizeOfDimension); if (in->externFilename) - HDfree(in->externFilename); + free(in->externFilename); if (in->data) - HDfree(in->data); + free(in->data); } - HDfree(opt); + free(opt); return EXIT_SUCCESS; err: @@ -260,17 +260,17 @@ err: for (i = 0; i < opt->fcount; i++) { in = &(opt->infiles[i].in); if (in->sizeOfDimension) - HDfree(in->sizeOfDimension); + free(in->sizeOfDimension); if (in->sizeOfChunk) - HDfree(in->sizeOfChunk); + free(in->sizeOfChunk); if (in->maxsizeOfDimension) - HDfree(in->maxsizeOfDimension); + free(in->maxsizeOfDimension); if (in->externFilename) - HDfree(in->externFilename); + free(in->externFilename); if (in->data) - HDfree(in->data); + free(in->data); } - HDfree(opt); + free(opt); return EXIT_FAILURE; } @@ -1267,28 +1267,28 @@ allocateIntegerStorage(struct Input *in) switch (in->inputSize) { case 8: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_INT8))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_INT8))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 16: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_INT16))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_INT16))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 32: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_INT32))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_INT32))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 64: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_INT64))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_INT64))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -1314,28 +1314,28 @@ allocateUIntegerStorage(struct Input *in) switch (in->inputSize) { case 8: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_UINT8))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_UINT8))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 16: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_UINT16))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_UINT16))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 32: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_UINT32))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_UINT32))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 64: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_UINT64))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_UINT64))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -1361,14 +1361,14 @@ allocateFloatStorage(struct Input *in) switch (in->inputSize) { case 32: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_FLOAT32))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_FLOAT32))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 64: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_FLOAT64))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_FLOAT64))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -1691,7 +1691,7 @@ processConfigurationFile(char *infile, struct Input *in) } } /* while (get_next_dim) */ - if ((in->sizeOfDimension = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == + if ((in->sizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { goto error; } @@ -1723,7 +1723,7 @@ processConfigurationFile(char *infile, struct Input *in) #endif if (!HDstrcmp("/", temp)) { /* / max dims */ if ((in->maxsizeOfDimension = - (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { goto error; } if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ @@ -1821,7 +1821,7 @@ processConfigurationFile(char *infile, struct Input *in) printf("h5dump STORAGE_LAYOUT %s found\n", temp); #endif if (!HDstrcmp("CHUNKED", temp)) { /* CHUNKED */ - if ((in->sizeOfChunk = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + if ((in->sizeOfChunk = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "Unable to allocate dynamic memory.\n"); goto error; } @@ -2565,7 +2565,7 @@ parseDimensions(struct Input *in, char *strm) i++; } in->rank = i + 1; - if ((in->sizeOfDimension = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + if ((in->sizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3536,7 +3536,7 @@ getDimensionSizes(struct Input *in, FILE *strm) const char *err2 = "No. of dimensions for which dimension sizes provided is not equal to provided rank.\n"; - if ((in->sizeOfDimension = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + if ((in->sizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3562,7 +3562,7 @@ getChunkedDimensionSizes(struct Input *in, FILE *strm) "No. of dimensions for which chunked dimension sizes provided is not equal to provided rank.\n"; const char *err3 = "The CHUNKED-DIMENSION-SIZES cannot exceed the sizes of DIMENSION-SIZES\n"; - if ((in->sizeOfChunk = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + if ((in->sizeOfChunk = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3595,7 +3595,7 @@ getMaximumDimensionSizes(struct Input *in, FILE *strm) const char *err3 = "The MAXIMUM-DIMENSIONS cannot be less than the sizes of DIMENSION-SIZES. Exception: " "can be -1 to indicate unlimited size\n"; - if ((in->maxsizeOfDimension = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + if ((in->maxsizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3769,7 +3769,7 @@ getExternalFilename(struct Input *in, FILE *strm) } temp_len = HDstrlen(temp); - in->externFilename = (char *)HDmalloc((temp_len + 1) * sizeof(char)); + in->externFilename = (char *)malloc((temp_len + 1) * sizeof(char)); (void)HDstrcpy(in->externFilename, temp); in->externFilename[temp_len] = '\0'; return (0); diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 2da104e..91eb937 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -330,11 +330,11 @@ main(int argc, char *argv[]) done: if (ub_file) - HDfree(ub_file); + free(ub_file); if (input_file) - HDfree(input_file); + free(input_file); if (output_file) - HDfree(output_file); + free(output_file); if (plist >= 0) H5Pclose(plist); diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index 1cda5d4..34c817d 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -143,11 +143,11 @@ parse_command_line(int argc, const char *const *argv) done: if (input_file) - HDfree(input_file); + free(input_file); if (output_file) - HDfree(output_file); + free(output_file); if (ub_file) - HDfree(ub_file); + free(ub_file); return EXIT_FAILURE; } @@ -281,13 +281,13 @@ main(int argc, char *argv[]) done: if (input_file) - HDfree(input_file); + free(input_file); if (output_file) - HDfree(output_file); + free(output_file); if (ub_file) { - HDfree(ub_file); + free(ub_file); } leave(h5tools_getstatus()); diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 54c527a..219abfd 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -921,8 +921,8 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) dst_size = H5Tget_size(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 < (unsigned)nmembs; i++) { name[i] = H5Tget_member_name(type, i); H5Tget_member_value(type, i, value + i * H5Tget_size(type)); @@ -934,8 +934,8 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) /* Release resources */ for (i = 0; i < (unsigned)nmembs; i++) H5free_memory(name[i]); - HDfree(name); - HDfree(value); + free(name); + free(value); H5Tclose(super); return FALSE; @@ -976,8 +976,8 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) /* Release resources */ for (i = 0; i < (unsigned)nmembs; i++) H5free_memory(name[i]); - HDfree(name); - HDfree(value); + free(name); + free(value); } else h5tools_str_append(buffer, "\n%*s <empty>", ind + 4, ""); @@ -1183,7 +1183,7 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind) return FALSE; ndims = H5Tget_array_ndims(type); if (ndims) { - dims = (hsize_t *)HDmalloc((unsigned)ndims * sizeof(dims[0])); + dims = (hsize_t *)malloc((unsigned)ndims * sizeof(dims[0])); H5Tget_array_dims2(type, dims); /* Print dimensions */ @@ -1191,7 +1191,7 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind) h5tools_str_append(buffer, "%s%" PRIuHSIZE, i ? "," : "[", dims[i]); h5tools_str_append(buffer, "]"); - HDfree(dims); + free(dims); } else h5tools_str_append(buffer, " [SCALAR]\n"); @@ -1436,17 +1436,17 @@ dump_dataset_values(hid_t dset) ctx.need_prefix = TRUE; if (NULL != - (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { + (ref_buf = (H5R_ref_t *)calloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { H5TOOLS_DEBUG("H5Dread reference read"); if (H5Dread(dset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_buf) < 0) { - HDfree(ref_buf); + free(ref_buf); H5TOOLS_INFO("H5Dread reference failed"); H5TOOLS_GOTO_DONE_NO_RET(); } h5tools_dump_reference(rawoutstream, info, &ctx, dset, ref_buf, ndims); PRINTVALSTREAM(rawoutstream, "\n"); - HDfree(ref_buf); + free(ref_buf); } } else { @@ -1606,10 +1606,10 @@ dump_attribute_values(hid_t attr) ctx.need_prefix = TRUE; if (NULL != - (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { + (ref_buf = (H5R_ref_t *)calloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { H5TOOLS_DEBUG("H5Aread reference read"); if (H5Aread(attr, H5T_STD_REF, ref_buf) < 0) { - HDfree(ref_buf); + free(ref_buf); H5TOOLS_INFO("H5Aread reference failed"); H5TOOLS_GOTO_DONE_NO_RET(); } @@ -1618,7 +1618,7 @@ dump_attribute_values(hid_t attr) PRINTVALSTREAM(rawoutstream, "\n"); ctx.indent_level--; - HDfree(ref_buf); + free(ref_buf); } } else { @@ -2208,7 +2208,7 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi */ if (cmt_bufsize > 0) { comment = - (char *)HDmalloc((size_t)cmt_bufsize + 1); /* new_size including null terminator */ + (char *)malloc((size_t)cmt_bufsize + 1); /* new_size including null terminator */ if (comment) { cmt_bufsize = H5Oget_comment(obj_id, comment, (size_t)cmt_bufsize); if (cmt_bufsize > 0) { @@ -2220,7 +2220,7 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0); } /* end if */ - HDfree(comment); + free(comment); } } } @@ -2434,7 +2434,7 @@ done: h5tools_str_close(&buffer); if (buf) - HDfree(buf); + free(buf); return 0; } /* end list_lnk() */ @@ -3049,7 +3049,7 @@ main(int argc, char *argv[]) if (file_id < 0) { fprintf(rawerrorstream, "%s: unable to open file\n", argv[argno - 1]); - HDfree(fname); + free(fname); err_exit = 1; continue; } /* end if */ @@ -3126,17 +3126,17 @@ main(int argc, char *argv[]) list_lnk(oname, &li, &iter); } H5Fclose(file_id); - HDfree(fname); + free(fname); if (x) - HDfree(oname); + free(oname); for (u = 0; u < symlink_list.nused; u++) { if (symlink_list.objs[u].type == H5L_TYPE_EXTERNAL) - HDfree(symlink_list.objs[u].file); + free(symlink_list.objs[u].file); - HDfree(symlink_list.objs[u].path); + free(symlink_list.objs[u].path); } - HDfree(symlink_list.objs); + free(symlink_list.objs); /* if no-dangling-links option specified and dangling link found */ if (no_dangling_link_g && iter.symlink_list->dangle_link) diff --git a/tools/src/h5perf/pio_engine.c b/tools/src/h5perf/pio_engine.c index e6f0834..cbe9a17 100644 --- a/tools/src/h5perf/pio_engine.c +++ b/tools/src/h5perf/pio_engine.c @@ -166,7 +166,7 @@ do_pio(parameters param) /* IO type */ iot = param.io_type; - if (NULL == (fname = HDcalloc(FILENAME_MAX, sizeof(char)))) + if (NULL == (fname = calloc(FILENAME_MAX, sizeof(char)))) GOTOERROR(FAIL); switch (iot) { @@ -366,8 +366,8 @@ done: } /* release generic resources */ - HDfree(buffer); - HDfree(fname); + free(buffer); + free(fname); res.ret_code = ret_code; return res; } diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c index 393a250..3be19f8 100644 --- a/tools/src/h5perf/pio_perf.c +++ b/tools/src/h5perf/pio_perf.c @@ -763,7 +763,7 @@ h5_set_info_object(void) /* copy key/value pair into temporary buffer */ len = strcspn(valp, ";"); next = &valp[len]; - key_val = (char *)HDcalloc(1, len + 1); + key_val = (char *)calloc(1, len + 1); /* increment the next pointer past the terminating semicolon */ if (*next == ';') @@ -811,10 +811,10 @@ h5_set_info_object(void) } valp = next; - HDfree(key_val); + free(key_val); } while (next && *next); - HDfree(envp); + free(envp); } return ret_value; @@ -1432,7 +1432,7 @@ parse_command_line(int argc, const char *const *argv) case '?': default: usage(progname); - HDfree(cl_opts); + free(cl_opts); return NULL; } } diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c index 24c3f06..9fbe9eb 100644 --- a/tools/src/h5perf/sio_engine.c +++ b/tools/src/h5perf/sio_engine.c @@ -144,7 +144,7 @@ do_sio(parameters param, results *res) /* IO type */ iot = param.io_type; - if (NULL == (fname = HDcalloc(FILENAME_MAX, sizeof(char)))) + if (NULL == (fname = calloc(FILENAME_MAX, sizeof(char)))) GOTOERROR(FAIL); switch (iot) { @@ -268,8 +268,8 @@ done: } /* release generic resources */ - HDfree(buffer); - HDfree(fname); + free(buffer); + free(fname); res->ret_code = ret_code; } @@ -1169,7 +1169,7 @@ set_vfd(parameters *param) assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); - if (NULL == (sv = HDcalloc(1, sizeof(*sv)))) + if (NULL == (sv = calloc(1, sizeof(*sv)))) return -1; for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { memb_fapl[mt] = H5P_DEFAULT; @@ -1179,11 +1179,11 @@ set_vfd(parameters *param) } if (H5Pset_fapl_multi(my_fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0) { - HDfree(sv); + free(sv); return -1; } - HDfree(sv); + free(sv); } else if (vfd == family) { hsize_t fam_size = 1 * 1024 * 1024; /*100 MB*/ @@ -1271,7 +1271,7 @@ do_cleanupfile(iotype iot, char *filename) hid_t driver; temp_sz = (4096 + sizeof("-?.h5")) * sizeof(char); - if (NULL == (temp = HDcalloc(1, temp_sz))) + if (NULL == (temp = calloc(1, temp_sz))) goto done; if (clean_file_g == -1) @@ -1332,5 +1332,5 @@ do_cleanupfile(iotype iot, char *filename) } done: - HDfree(temp); + free(temp); } diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c index 5d88cd2..a991e19 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -214,7 +214,7 @@ main(int argc, char *argv[]) run_test_loop(opts); finish: - HDfree(opts); + free(opts); return exit_value; } @@ -500,16 +500,16 @@ run_test(iotype iot, parameters parms, struct options *opts) } /* clean up our mess */ - HDfree(write_sys_mm_table); - HDfree(write_mm_table); - HDfree(write_gross_mm_table); - HDfree(write_raw_mm_table); + free(write_sys_mm_table); + free(write_mm_table); + free(write_gross_mm_table); + free(write_raw_mm_table); if (!parms.h5_write_only) { - HDfree(read_sys_mm_table); - HDfree(read_mm_table); - HDfree(read_gross_mm_table); - HDfree(read_raw_mm_table); + free(read_sys_mm_table); + free(read_mm_table); + free(read_gross_mm_table); + free(read_raw_mm_table); } return ret_value; @@ -809,7 +809,7 @@ parse_command_line(int argc, const char *const *argv) struct options *cl_opts; int i, default_rank, actual_rank, ranks[4]; - cl_opts = (struct options *)HDmalloc(sizeof(struct options)); + cl_opts = (struct options *)malloc(sizeof(struct options)); cl_opts->page_buffer_size = 0; cl_opts->page_size = 0; @@ -1103,7 +1103,7 @@ parse_command_line(int argc, const char *const *argv) case '?': default: usage(progname); - HDfree(cl_opts); + free(cl_opts); return NULL; } } diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 5c95b06..a6d83ea 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -132,7 +132,7 @@ h5repack_addfilter(const char *str, pack_opt_t *options) n = options->n_filter_g++; /* increase # of global filters */ if (options->n_filter_g > H5_REPACK_MAX_NFILTERS) { error_msg("maximum number of filters exceeded for <%s>\n", str); - HDfree(obj_list); + free(obj_list); return -1; } @@ -141,7 +141,7 @@ h5repack_addfilter(const char *str, pack_opt_t *options) else options_add_filter(obj_list, n_objs, filter, options->op_tbl); - HDfree(obj_list); + free(obj_list); return 0; } /* end h5repack_addfilter() */ @@ -195,7 +195,7 @@ h5repack_addlayout(const char *str, pack_opt_t *options) if (options->all_layout == 0) ret_value = options_add_layout(obj_list, n_objs, &pack, options->op_tbl); - HDfree(obj_list); + free(obj_list); ret_value = 0; } /* end if obj_list exists */ @@ -253,7 +253,7 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t for (i = 0; i < travt->nobjs; i++) { if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { /* Push onto the stack */ - if (NULL == (dt = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) + if (NULL == (dt = (named_dt_t *)malloc(sizeof(named_dt_t)))) H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "buffer allocation failed failed"); dt->next = *named_dt_head_p; *named_dt_head_p = dt; @@ -276,7 +276,7 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t */ if (!dt_ret) { /* Push the new datatype onto the stack */ - if (NULL == (dt_ret = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) + if (NULL == (dt_ret = (named_dt_t *)malloc(sizeof(named_dt_t)))) H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "buffer allocation failed failed"); dt_ret->next = *named_dt_head_p; *named_dt_head_p = dt_ret; @@ -330,7 +330,7 @@ named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) if (H5Tclose(dt->id_out) < 0 && !ignore_err) H5TOOLS_GOTO_ERROR((-1), "H5Tclose failed"); dt = dt->next; - HDfree(*named_dt_head_p); + free(*named_dt_head_p); *named_dt_head_p = dt; } @@ -481,9 +481,9 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ *----------------------------------------------------------------- */ - buf = (void *)HDmalloc((size_t)(nelmts * msize)); + buf = (void *)malloc((size_t)(nelmts * msize)); if (buf == NULL) { - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); } /* end if */ if (options->verbose == 2) { H5_timer_init(&timer); @@ -526,7 +526,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ if (TRUE == h5tools_detect_vlen(wtype_id)) H5Treclaim(wtype_id, space_id, H5P_DEFAULT, buf); - HDfree(buf); + free(buf); buf = NULL; } /*H5T_REFERENCE*/ @@ -566,7 +566,7 @@ done: H5Treclaim(wtype_id, space_id, H5P_DEFAULT, buf); /* Free buf */ - HDfree(buf); + free(buf); } H5Aclose(attr_out); diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 8b11974..be3fddf 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -1012,7 +1012,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti /* have to read the whole dataset if there is only one element in the * dataset */ if (need < H5TOOLS_MALLOCSIZE) - buf = HDmalloc(need); + buf = malloc(need); /* Set up collective write if using filters in parallel */ { @@ -1061,7 +1061,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (buf != NULL) { /* TODO: is buf potentially released by H5Dvlen_reclaim()? */ - HDfree(buf); + free(buf); buf = NULL; } } @@ -1108,7 +1108,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti &hslab_nbytes) < 0) H5TOOLS_GOTO_ERROR((-1), "get_hyperslab failed"); - hslab_buf = HDmalloc((size_t)hslab_nbytes); + hslab_buf = malloc((size_t)hslab_nbytes); if (hslab_buf == NULL) H5TOOLS_GOTO_ERROR((-1), "can't allocate space for hyperslab"); @@ -1189,7 +1189,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5Sclose(hslab_space); if (hslab_buf != NULL) { - HDfree(hslab_buf); + free(hslab_buf); hslab_buf = NULL; } } /* end if reading/writing by hyperslab */ @@ -1421,7 +1421,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + free(linkinfo.trg_path); linkinfo.trg_path = NULL; } /* options->merge */ else { @@ -1460,7 +1460,7 @@ done: /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + free(linkinfo.trg_path); H5E_BEGIN_TRY { @@ -1484,9 +1484,9 @@ done: /* free */ if (buf != NULL) - HDfree(buf); + free(buf); if (hslab_buf != NULL) - HDfree(hslab_buf); + free(hslab_buf); return ret_value; } /* end do_copy_objects() */ diff --git a/tools/src/h5repack/h5repack_opttable.c b/tools/src/h5repack/h5repack_opttable.c index 4e6e0f4..64f3011 100644 --- a/tools/src/h5repack/h5repack_opttable.c +++ b/tools/src/h5repack/h5repack_opttable.c @@ -104,7 +104,7 @@ aux_inctable(pack_opttbl_t *table, unsigned n_objs) int ret_value = 0; table->size += n_objs; - table->objs = (pack_info_t *)HDrealloc(table->objs, table->size * sizeof(pack_info_t)); + table->objs = (pack_info_t *)realloc(table->objs, table->size * sizeof(pack_info_t)); if (table->objs == NULL) { H5TOOLS_INFO("not enough memory for options table"); ret_value = -1; @@ -132,14 +132,14 @@ options_table_init(pack_opttbl_t **tbl) pack_opttbl_t *table; int ret_value = 0; - if (NULL == (table = (pack_opttbl_t *)HDmalloc(sizeof(pack_opttbl_t)))) { + if (NULL == (table = (pack_opttbl_t *)malloc(sizeof(pack_opttbl_t)))) { H5TOOLS_GOTO_ERROR((-1), "not enough memory for options table"); } table->size = 30; table->nelems = 0; - if (NULL == (table->objs = (pack_info_t *)HDmalloc(table->size * sizeof(pack_info_t)))) { - HDfree(table); + if (NULL == (table->objs = (pack_info_t *)malloc(table->size * sizeof(pack_info_t)))) { + free(table); H5TOOLS_GOTO_ERROR((-1), "not enough memory for options table"); } @@ -163,8 +163,8 @@ done: int options_table_free(pack_opttbl_t *table) { - HDfree(table->objs); - HDfree(table); + free(table->objs); + free(table); return 0; } diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index cee85ac..d4fa990 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -77,7 +77,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t else *n_objs = n; - obj_list = (obj_list_t *)HDmalloc(n * sizeof(obj_list_t)); + obj_list = (obj_list_t *)malloc(n * sizeof(obj_list_t)); if (obj_list == NULL) { error_msg("could not allocate object list\n"); return NULL; @@ -103,7 +103,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t /* nothing after : */ if (end_obj + 1 == (int)len) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("input Error: Invalid compression type in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -134,7 +134,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t c = str[u]; if (!HDisdigit(c) && l == -1) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("compression parameter not digit in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -184,7 +184,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t c = str[u]; if (!HDisdigit(c) && l == -1) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("compression parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -244,13 +244,13 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t c = str[u]; if (!HDisdigit(c) && l == -1) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("filter number parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } else if (!HDisdigit(c) && f == -1) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("filter flag parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -269,7 +269,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t c = str[u]; if (!HDisdigit(c)) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("compression parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -312,7 +312,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 1; if (no_param) { /*no more parameters, GZIP must have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("missing compression parameter in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -327,7 +327,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 2; if (no_param) { /*no more parameters, SZIP must have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("missing compression parameter in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -342,7 +342,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 0; if (m > 0) { /*shuffle does not have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("extra parameter in SHUF <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -356,7 +356,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 0; if (m > 0) { /*shuffle does not have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("extra parameter in FLET <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -370,7 +370,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 0; if (m > 0) { /*nbit does not have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("extra parameter in NBIT <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -384,7 +384,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 2; if (no_param) { /*no more parameters, SOFF must have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("missing compression parameter in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -397,14 +397,14 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t /* parameters does not match count */ if (filt->cd_nelmts != j) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("incorrect number of compression parameters in <%s>\n", str); HDexit(EXIT_FAILURE); } } else { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("invalid filter type in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -425,7 +425,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t case H5Z_FILTER_DEFLATE: if (filt->cd_values[0] > 9) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("invalid compression parameter in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -438,19 +438,19 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t pixels_per_block = filt->cd_values[0]; if ((pixels_per_block % 2) == 1) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("pixels_per_block is not even in <%s>\n", str); HDexit(EXIT_FAILURE); } if (pixels_per_block > H5_SZIP_MAX_PIXELS_PER_BLOCK) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("pixels_per_block is too large in <%s>\n", str); HDexit(EXIT_FAILURE); } if ((HDstrcmp(smask, "NN") != 0) && (HDstrcmp(smask, "EC") != 0)) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("szip mask must be 'NN' or 'EC' \n"); HDexit(EXIT_FAILURE); } @@ -514,7 +514,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about } n++; - obj_list = (obj_list_t *)HDmalloc(n * sizeof(obj_list_t)); + obj_list = (obj_list_t *)malloc(n * sizeof(obj_list_t)); if (obj_list == NULL) { error_msg("could not allocate object list\n"); return NULL; @@ -541,7 +541,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about /* nothing after : */ if (end_obj + 1 == (int)len) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("in parse layout, no characters after : in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -575,7 +575,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about k = 0; if (j > len) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("in parse layout, <%s> Chunk dimensions missing\n", str); HDexit(EXIT_FAILURE); } @@ -587,7 +587,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about if (!HDisdigit(c) && c != 'x' && c != 'N' && c != 'O' && c != 'N' && c != 'E') { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("in parse layout, <%s> Not a valid character in <%s>\n", sdim, str); HDexit(EXIT_FAILURE); } @@ -599,7 +599,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about pack->chunk.chunk_lengths[c_index] = HDstrtoull(sdim, NULL, 0); if (pack->chunk.chunk_lengths[c_index] == 0) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim, str); HDexit(EXIT_FAILURE); } @@ -615,7 +615,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about pack->chunk.chunk_lengths[c_index] = HDstrtoull(sdim, NULL, 0); if (pack->chunk.chunk_lengths[c_index] == 0) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim, str); HDexit(EXIT_FAILURE); } diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index a9a5fd3..222447d 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -152,19 +152,19 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti *------------------------------------------------------------------------- */ if (nelmts) { - buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); + buf = (hobj_ref_t *)malloc((unsigned)(nelmts * msize)); if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Dread failed"); - refbuf = (hobj_ref_t *)HDcalloc((unsigned)nelmts, msize); + refbuf = (hobj_ref_t *)calloc((unsigned)nelmts, msize); if (refbuf == NULL) { printf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); + } for (u = 0; u < nelmts; u++) { H5E_BEGIN_TRY { @@ -207,9 +207,9 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5TOOLS_GOTO_ERROR((-1), "H5Dwrite failed"); if (buf) - HDfree(buf); + free(buf); if (refbuf) - HDfree(refbuf); + free(refbuf); /*------------------------------------------------------ * copy attrs @@ -234,11 +234,11 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti *------------------------------------------------------------------------- */ if (nelmts) { - buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); + buf = (hdset_reg_ref_t *)malloc((unsigned)(nelmts * msize)); if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Dread failed"); @@ -246,12 +246,12 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti * create output *------------------------------------------------------------------------- */ - refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), - (size_t)nelmts); /*init to zero */ + refbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), + (size_t)nelmts); /*init to zero */ if (refbuf == NULL) { printf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); + } for (u = 0; u < nelmts; u++) { H5E_BEGIN_TRY @@ -301,9 +301,9 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5TOOLS_GOTO_ERROR((-1), "H5Dwrite failed"); if (buf) - HDfree(buf); + free(buf); if (refbuf) - HDfree(refbuf); + free(refbuf); /*----------------------------------------------------- * copy attrs @@ -506,8 +506,8 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (nmembers < 1) H5TOOLS_GOTO_ERROR((-1), "H5Tget_nmembers failed"); - ref_comp_index = (unsigned *)HDmalloc((size_t)nmembers * sizeof(unsigned)); - ref_comp_size = (size_t *)HDmalloc((size_t)nmembers * sizeof(ref_comp_size)); + ref_comp_index = (unsigned *)malloc((size_t)nmembers * sizeof(unsigned)); + ref_comp_size = (size_t *)malloc((size_t)nmembers * sizeof(ref_comp_size)); ref_comp_field_n = 0; for (i = 0; i < (unsigned)nmembers; i++) { @@ -527,12 +527,12 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / * statement below. */ if (!ref_comp_field_n) { if (ref_comp_index) { - HDfree(ref_comp_index); + free(ref_comp_index); ref_comp_index = NULL; } if (ref_comp_size) { - HDfree(ref_comp_size); + free(ref_comp_size); ref_comp_size = NULL; } } @@ -598,19 +598,19 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (nelmts > 0) { /* handle object references */ if ((is_ref || is_ref_array) && (H5R_OBJ_REF_BUF_SIZE == msize)) { - buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); + buf = (hobj_ref_t *)malloc((unsigned)(nelmts * msize)); if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); - refbuf = (hobj_ref_t *)HDcalloc((unsigned)nelmts, msize); + refbuf = (hobj_ref_t *)calloc((unsigned)nelmts, msize); if (refbuf == NULL) { printf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); + } for (i = 0; i < (unsigned)nelmts; i++) if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, @@ -619,12 +619,12 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / } /* H5T_STD_REF_OBJ */ /* handle region references */ else if ((is_ref || is_ref_array) && (H5R_DSET_REG_REF_BUF_SIZE == msize)) { - buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); + buf = (hdset_reg_ref_t *)malloc((unsigned)(nelmts * msize)); if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -632,12 +632,11 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / * create output *------------------------------------------------------------------------- */ - refbuf = - (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ + refbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if (refbuf == NULL) { printf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); + } for (i = 0; i < (unsigned)nelmts; i++) if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, @@ -647,13 +646,13 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / else if (is_ref_vlen) { /* handle VLEN of references */ - buf = (hvl_t *)HDmalloc((unsigned)(nelmts * sizeof(hvl_t))); + buf = (hvl_t *)malloc((unsigned)(nelmts * sizeof(hvl_t))); refbuf = buf; /* reuse the read buffer for write */ if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -689,13 +688,13 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / else if (is_ref_comp) { /* handle ref fields in a compound */ - buf = HDmalloc((unsigned)(nelmts * msize)); + buf = malloc((unsigned)(nelmts * msize)); refbuf = buf; /* reuse the read buffer for write */ if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -739,22 +738,22 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / refbuf = NULL; /* set it to NULL to avoid double free since buf and refbuf are the same. */ if (buf) { - HDfree(buf); + free(buf); buf = NULL; } if (refbuf) { - HDfree(refbuf); + free(refbuf); refbuf = NULL; } if (ref_comp_index) { - HDfree(ref_comp_index); + free(ref_comp_index); ref_comp_index = NULL; } if (ref_comp_size) { - HDfree(ref_comp_size); + free(ref_comp_size); ref_comp_size = NULL; } @@ -777,15 +776,15 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / done: if (refbuf) - HDfree(refbuf); + free(refbuf); if (buf) - HDfree(buf); + free(buf); if (ref_comp_index) - HDfree(ref_comp_index); + free(ref_comp_index); if (ref_comp_size) - HDfree(ref_comp_size); + free(ref_comp_size); H5E_BEGIN_TRY { diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 9da6ba2..23bde1a 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -306,7 +306,7 @@ attribute_stats(iter_t *iter, const H5O_info2_t *oi, const H5O_native_info_t *na /* Add attribute count to proper bin */ bin = ceil_log10((unsigned long)oi->num_attrs); if ((bin + 1) > iter->attr_nbins) { - iter->attr_bins = (unsigned long *)HDrealloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long)); + iter->attr_bins = (unsigned long *)realloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long)); assert(iter->attr_bins); /* Initialize counts for intermediate bins */ @@ -367,7 +367,7 @@ group_stats(iter_t *iter, const char *name, const H5O_info2_t *oi, const H5O_nat if ((bin + 1) > iter->group_nbins) { /* Allocate more storage for info about dataset's datatype */ if ((iter->group_bins = - (unsigned long *)HDrealloc(iter->group_bins, (bin + 1) * sizeof(unsigned long))) == NULL) + (unsigned long *)realloc(iter->group_bins, (bin + 1) * sizeof(unsigned long))) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "H5Drealloc() failed"); /* Initialize counts for intermediate bins */ @@ -502,8 +502,8 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info2_t *oi, const H5O_n bin = ceil_log10((unsigned long)dims[0]); if ((bin + 1) > iter->dset_dim_nbins) { /* Allocate more storage for info about dataset's datatype */ - if ((iter->dset_dim_bins = (unsigned long *)HDrealloc(iter->dset_dim_bins, - (bin + 1) * sizeof(unsigned long))) == NULL) + if ((iter->dset_dim_bins = (unsigned long *)realloc(iter->dset_dim_bins, + (bin + 1) * sizeof(unsigned long))) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "H5Drealloc() failed"); /* Initialize counts for intermediate bins */ @@ -541,7 +541,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info2_t *oi, const H5O_n iter->dset_ntypes++; /* Allocate more storage for info about dataset's datatype */ - if ((iter->dset_type_info = (dtype_info_t *)HDrealloc( + if ((iter->dset_type_info = (dtype_info_t *)realloc( iter->dset_type_info, iter->dset_ntypes * sizeof(dtype_info_t))) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "H5Drealloc() failed"); @@ -738,7 +738,7 @@ freespace_stats(hid_t fid, iter_t *iter) if ((nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, 0, NULL)) < 0) return (FAIL); else if (nsects) { - if (NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)))) + if (NULL == (sect_info = (H5F_sect_info_t *)calloc((size_t)nsects, sizeof(H5F_sect_info_t)))) return (FAIL); nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); assert(nsects); @@ -754,7 +754,7 @@ freespace_stats(hid_t fid, iter_t *iter) bin = ceil_log10((unsigned long)sect_info[u].size); if (bin >= iter->sect_nbins) { /* Allocate more storage for section info */ - iter->sect_bins = (unsigned long *)HDrealloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long)); + iter->sect_bins = (unsigned long *)realloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long)); assert(iter->sect_bins); /* Initialize counts for intermediate bins */ @@ -770,7 +770,7 @@ freespace_stats(hid_t fid, iter_t *iter) } /* end for */ if (sect_info) - HDfree(sect_info); + free(sect_info); return 0; } /* end freespace_stats() */ @@ -794,12 +794,12 @@ hand_free(struct handler_t *hand) for (u = 0; u < hand->obj_count; u++) if (hand->obj[u]) { - HDfree(hand->obj[u]); + free(hand->obj[u]); hand->obj[u] = NULL; } /* end if */ hand->obj_count = 0; - HDfree(hand->obj); - HDfree(hand); + free(hand->obj); + free(hand); } /* end if */ } /* end hand_free() */ @@ -940,14 +940,14 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re display_object = TRUE; /* Allocate space to hold the command line info */ - if (NULL == (hand = (struct handler_t *)HDcalloc((size_t)1, sizeof(struct handler_t)))) { + if (NULL == (hand = (struct handler_t *)calloc((size_t)1, sizeof(struct handler_t)))) { error_msg("unable to allocate memory for object struct\n"); goto error; } /* end if */ /* Allocate space to hold the object strings */ hand->obj_count = (size_t)argc; - if (NULL == (hand->obj = (char **)HDcalloc((size_t)argc, sizeof(char *)))) { + if (NULL == (hand->obj = (char **)calloc((size_t)argc, sizeof(char *)))) { error_msg("unable to allocate memory for object array\n"); goto error; } /* end if */ @@ -1031,49 +1031,49 @@ iter_free(iter_t *iter) /* Clear array of bins for group counts */ if (iter->group_bins) { - HDfree(iter->group_bins); + free(iter->group_bins); iter->group_bins = NULL; } /* end if */ /* Clear array for tracking small groups */ if (iter->num_small_groups) { - HDfree(iter->num_small_groups); + free(iter->num_small_groups); iter->num_small_groups = NULL; } /* end if */ /* Clear array of bins for attribute counts */ if (iter->attr_bins) { - HDfree(iter->attr_bins); + free(iter->attr_bins); iter->attr_bins = NULL; } /* end if */ /* Clear array for tracking small attributes */ if (iter->num_small_attrs) { - HDfree(iter->num_small_attrs); + free(iter->num_small_attrs); iter->num_small_attrs = NULL; } /* end if */ /* Clear dataset datatype information found */ if (iter->dset_type_info) { - HDfree(iter->dset_type_info); + free(iter->dset_type_info); iter->dset_type_info = NULL; } /* end if */ /* Clear array of bins for dataset dimensions */ if (iter->dset_dim_bins) { - HDfree(iter->dset_dim_bins); + free(iter->dset_dim_bins); iter->dset_dim_bins = NULL; } /* end if */ /* Clear array of tracking 1-D small datasets */ if (iter->small_dset_dims) { - HDfree(iter->small_dset_dims); + free(iter->small_dset_dims); iter->small_dset_dims = NULL; } /* end if */ /* Clear array of bins for free-space section sizes */ if (iter->sect_bins) { - HDfree(iter->sect_bins); + free(iter->sect_bins); iter->sect_bins = NULL; } /* end if */ } /* end iter_free() */ @@ -1732,10 +1732,9 @@ main(int argc, char *argv[]) iter.free_hdr = finfo.free.meta_size; } /* end else */ - iter.num_small_groups = (unsigned long *)HDcalloc((size_t)sgroups_threshold, sizeof(unsigned long)); - iter.num_small_attrs = - (unsigned long *)HDcalloc((size_t)(sattrs_threshold + 1), sizeof(unsigned long)); - iter.small_dset_dims = (unsigned long *)HDcalloc((size_t)sdsets_threshold, sizeof(unsigned long)); + iter.num_small_groups = (unsigned long *)calloc((size_t)sgroups_threshold, sizeof(unsigned long)); + iter.num_small_attrs = (unsigned long *)calloc((size_t)(sattrs_threshold + 1), sizeof(unsigned long)); + iter.small_dset_dims = (unsigned long *)calloc((size_t)sdsets_threshold, sizeof(unsigned long)); if (iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) { error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n"); diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index 5f26ef4..4a6029c 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -353,9 +353,9 @@ main(int argc, char *argv[]) done: if (fname) - HDfree(fname); + free(fname); if (fname_g) - HDfree(fname_g); + free(fname_g); H5E_BEGIN_TRY { diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index 98b6b76..a359db6 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -58,11 +58,11 @@ leave(int ret) size_t curr_group; if (params_g.fname) - HDfree(params_g.fname); + free(params_g.fname); if (params_g.ngroups) { for (curr_group = 0; curr_group < params_g.ngroups; curr_group++) - HDfree(params_g.groups[curr_group]); - HDfree(params_g.groups); + free(params_g.groups[curr_group]); + free(params_g.groups); } if (H5I_INVALID_HID != params_g.fapl_id && H5P_DEFAULT != params_g.fapl_id) if (H5Pclose(params_g.fapl_id) < 0) @@ -246,7 +246,7 @@ parse_command_line(int argc, const char *const *argv, mkgrp_opt_t *options) /* Allocate space for the group name pointers */ options->ngroups = (size_t)(argc - H5_optind); - options->groups = (char **)HDmalloc(options->ngroups * sizeof(char *)); + options->groups = (char **)malloc(options->ngroups * sizeof(char *)); /* Retrieve the group names */ curr_group = 0; diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index c4ea0a6..843e9a3 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -226,9 +226,9 @@ main(int argc, char *argv[]) } /* end while */ /* allocate names */ - if (NULL == (src_name = (char *)HDcalloc((size_t)NAMELEN, sizeof(char)))) + if (NULL == (src_name = (char *)calloc((size_t)NAMELEN, sizeof(char)))) HDexit(EXIT_FAILURE); - if (NULL == (dst_name = (char *)HDcalloc((size_t)NAMELEN, sizeof(char)))) + if (NULL == (dst_name = (char *)calloc((size_t)NAMELEN, sizeof(char)))) HDexit(EXIT_FAILURE); /* @@ -275,7 +275,7 @@ main(int argc, char *argv[]) usage(prog_name); /* Now the real work, split the file */ - buf = (char *)HDmalloc(blk_size); + buf = (char *)malloc(blk_size); while (src_offset < src_size) { /* Read a block. The amount to read is the minimum of: @@ -498,9 +498,9 @@ main(int argc, char *argv[]) } /* end if */ /* Free resources and return */ - HDfree(src_name); - HDfree(dst_name); - HDfree(buf); + free(src_name); + free(dst_name); + free(buf); return EXIT_SUCCESS; } /* end main */ H5_GCC_CLANG_DIAG_ON("format-nonliteral") |