diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-07-27 20:43:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 20:43:30 (GMT) |
commit | 1e91d96fa02466ffe451319bdac1005f84dc7993 (patch) | |
tree | 4de04ef502c313dfd766497b20235188761146c0 /tools | |
parent | 95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82 (diff) | |
download | hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.zip hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.gz hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.bz2 |
Brings over most of the HD prefix removal (#3293)
Diffstat (limited to 'tools')
67 files changed, 4413 insertions, 4427 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index ea268f3..7232ed0 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -112,11 +112,11 @@ print_incoming_data(void) do { MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &incomingMessage, &Status); if (incomingMessage) { - HDmemset(data, 0, PRINT_DATA_MAX_SIZE + 1); + memset(data, 0, PRINT_DATA_MAX_SIZE + 1); MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &Status); - HDprintf("%s", data); + printf("%s", data); } } while (incomingMessage); } @@ -297,7 +297,7 @@ free_exclude_path_list(diff_opt_t *opts) while (NULL != curr) { next = curr->next; - HDfree(curr); + free(curr); curr = next; } } @@ -315,7 +315,7 @@ free_exclude_attr_list(diff_opt_t *opts) while (NULL != curr) { next = curr->next; - HDfree(curr); + free(curr); curr = next; } } @@ -494,7 +494,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata) H5TOOLS_START_DEBUG(" "); /* init linkinfo struct */ - HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t)); + memset(&lnk_info, 0, sizeof(h5tool_link_info_t)); if (!opts->follow_links) { trav_info_visit_lnk(path, linfo, tinfo); @@ -575,7 +575,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata) done: if (lnk_info.trg_path) - HDfree(lnk_info.trg_path); + free(lnk_info.trg_path); H5TOOLS_ENDDEBUG(" "); return ret_value; } @@ -628,10 +628,10 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_START_DEBUG(" "); /* init filenames */ - HDmemset(filenames, 0, MAX_FILENAME * 2); + memset(filenames, 0, MAX_FILENAME * 2); /* init link info struct */ - HDmemset(&trg_linfo1, 0, sizeof(h5tool_link_info_t)); - HDmemset(&trg_linfo2, 0, sizeof(h5tool_link_info_t)); + memset(&trg_linfo1, 0, sizeof(h5tool_link_info_t)); + memset(&trg_linfo2, 0, sizeof(h5tool_link_info_t)); /*------------------------------------------------------------------------- * check invalid combination of options @@ -710,7 +710,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - if ((obj1fullname = (char *)HDmalloc(HDstrlen(objname1) + 2)) == NULL) + if ((obj1fullname = (char *)malloc(HDstrlen(objname1) + 2)) == NULL) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); HDstrcpy(obj1fullname, "/"); @@ -729,7 +729,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - if ((obj2fullname = (char *)HDmalloc(HDstrlen(objname2) + 2)) == NULL) + if ((obj2fullname = (char *)malloc(HDstrlen(objname2) + 2)) == NULL) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); HDstrcpy(obj2fullname, "/"); HDstrcat(obj2fullname, objname2); @@ -776,7 +776,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char obj1type = (h5trav_type_t)oinfo1.type; trav_info_add(info1_obj, obj1fullname, obj1type); idx = info1_obj->nused - 1; - HDmemcpy(&info1_obj->paths[idx].obj_token, &oinfo1.token, sizeof(H5O_token_t)); + memcpy(&info1_obj->paths[idx].obj_token, &oinfo1.token, sizeof(H5O_token_t)); info1_obj->paths[idx].fileno = oinfo1.fileno; } else if (src_linfo1.type == H5L_TYPE_SOFT) { @@ -826,7 +826,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char obj2type = (h5trav_type_t)oinfo2.type; trav_info_add(info2_obj, obj2fullname, obj2type); idx = info2_obj->nused - 1; - HDmemcpy(&info2_obj->paths[idx].obj_token, &oinfo2.token, sizeof(H5O_token_t)); + memcpy(&info2_obj->paths[idx].obj_token, &oinfo2.token, sizeof(H5O_token_t)); info2_obj->paths[idx].fileno = oinfo2.fileno; } else if (src_linfo2.type == H5L_TYPE_SOFT) { @@ -896,7 +896,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char size_t idx = info1_lp->nused - 1; H5TOOLS_DEBUG("h5diff ... ... ... info1_obj not null"); - HDmemcpy(&info1_lp->paths[idx].obj_token, &trg_linfo1.obj_token, sizeof(H5O_token_t)); + memcpy(&info1_lp->paths[idx].obj_token, &trg_linfo1.obj_token, sizeof(H5O_token_t)); info1_lp->paths[idx].type = (h5trav_type_t)trg_linfo1.trg_type; info1_lp->paths[idx].fileno = trg_linfo1.fileno; } @@ -936,7 +936,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char size_t idx = info2_lp->nused - 1; H5TOOLS_DEBUG("h5diff ... ... ... info2_obj not null"); - HDmemcpy(&info2_lp->paths[idx].obj_token, &trg_linfo2.obj_token, sizeof(H5O_token_t)); + memcpy(&info2_lp->paths[idx].obj_token, &trg_linfo2.obj_token, sizeof(H5O_token_t)); info2_lp->paths[idx].type = (h5trav_type_t)trg_linfo2.trg_type; info2_lp->paths[idx].fileno = trg_linfo2.fileno; } @@ -997,8 +997,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char int i; if ((HDstrlen(fname1) > MAX_FILENAME) || (HDstrlen(fname2) > MAX_FILENAME)) { - HDfprintf(stderr, "The parallel diff only supports path names up to %d characters\n", - MAX_FILENAME); + fprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ @@ -1068,15 +1067,15 @@ done: /* free buffers */ if (obj1fullname) - HDfree(obj1fullname); + free(obj1fullname); if (obj2fullname) - HDfree(obj2fullname); + free(obj2fullname); /* free link info buffer */ if (trg_linfo1.trg_path) - HDfree(trg_linfo1.trg_path); + free(trg_linfo1.trg_path); if (trg_linfo2.trg_path) - HDfree(trg_linfo2.trg_path); + free(trg_linfo2.trg_path); /* close */ H5E_BEGIN_TRY @@ -1165,7 +1164,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, */ #ifdef H5_HAVE_PARALLEL { - char *workerTasks = (char *)HDmalloc((size_t)(g_nTasks - 1) * sizeof(char)); + char *workerTasks = (char *)malloc((size_t)(g_nTasks - 1) * sizeof(char)); int n; int busyTasks = 0; struct diffs_found nFoundbyWorker; @@ -1174,7 +1173,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, MPI_Status Status; /*set all tasks as free */ - HDmemset(workerTasks, 1, (size_t)(g_nTasks - 1) * sizeof(char)); + memset(workerTasks, 1, (size_t)(g_nTasks - 1) * sizeof(char)); #endif for (i = 0; i < table->nobjs; i++) { @@ -1187,7 +1186,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ - if ((obj1_fullpath = (char *)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == + if ((obj1_fullpath = (char *)malloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } @@ -1205,7 +1204,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ - if ((obj2_fullpath = (char *)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == + if ((obj2_fullpath = (char *)malloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } @@ -1248,7 +1247,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, /*Set up args to pass to worker task. */ if (HDstrlen(obj1_fullpath) > 255 || HDstrlen(obj2_fullpath) > 255) { - HDprintf("The parallel diff only supports object names up to 255 characters\n"); + printf("The parallel diff only supports object names up to 255 characters\n"); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ @@ -1393,7 +1392,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, MPI_COMM_WORLD); } /* end else-if */ else { - HDprintf("ERROR: Invalid tag (%d) received \n", Status.MPI_TAG); + printf("ERROR: Invalid tag (%d) received \n", Status.MPI_TAG); MPI_Abort(MPI_COMM_WORLD, 0); MPI_Finalize(); } /* end else */ @@ -1402,9 +1401,9 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, } /* end else */ #endif /* H5_HAVE_PARALLEL */ if (obj1_fullpath) - HDfree(obj1_fullpath); + free(obj1_fullpath); if (obj2_fullpath) - HDfree(obj2_fullpath); + free(obj2_fullpath); } /* end if */ } /* end for */ H5TOOLS_DEBUG("done with for loop - errstat:%d", opts->err_stat); @@ -1473,15 +1472,15 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, } /* end else-if */ else if (Status.MPI_TAG == MPI_TAG_PRINT_DATA) { char data[PRINT_DATA_MAX_SIZE + 1]; - HDmemset(data, 0, PRINT_DATA_MAX_SIZE + 1); + memset(data, 0, PRINT_DATA_MAX_SIZE + 1); MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &Status); - HDprintf("%s", data); + printf("%s", data); } /* end else-if */ else { - HDprintf("ph5diff-manager: ERROR!! Invalid tag (%d) received \n", Status.MPI_TAG); + printf("ph5diff-manager: ERROR!! Invalid tag (%d) received \n", Status.MPI_TAG); MPI_Abort(MPI_COMM_WORLD, 0); } /* end else */ } /* end while */ @@ -1494,7 +1493,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, } /* end if */ H5TOOLS_DEBUG("done with if block"); - HDfree(workerTasks); + free(workerTasks); } #endif /* H5_HAVE_PARALLEL */ @@ -1549,8 +1548,8 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); /*init link info struct */ - HDmemset(&linkinfo1, 0, sizeof(h5tool_link_info_t)); - HDmemset(&linkinfo2, 0, sizeof(h5tool_link_info_t)); + memset(&linkinfo1, 0, sizeof(h5tool_link_info_t)); + memset(&linkinfo2, 0, sizeof(h5tool_link_info_t)); /* pass how to handle printing warnings to linkinfo option */ if (print_warn(opts)) @@ -1834,7 +1833,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ if (linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) { /* If the buffers are the same size, compare them */ if (linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) { - status = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size); + status = memcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size); } else status = 1; @@ -1913,9 +1912,9 @@ done: /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + free(linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + free(linkinfo2.trg_path); /* close */ /* disable error reporting */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 3f504eb..85defbe 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -212,7 +212,7 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_ * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && type_class != H5T_COMPOUND && type_class != H5T_STRING && - type_class != H5T_VLEN && HDmemcmp(mem1, mem2, size * opts->hs_nelmts) == 0) { + type_class != H5T_VLEN && memcmp(mem1, mem2, size * opts->hs_nelmts) == 0) { H5TOOLS_ENDDEBUG(":Fast comparison - errstat:%d", opts->err_stat); return 0; } @@ -224,7 +224,7 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_ case H5T_NCLASSES: default: H5TOOLS_DEBUG("type_class:INVALID"); - HDassert(0); + assert(0); break; /*------------------------------------------------------------------------- @@ -381,7 +381,7 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_ case H5T_VLEN: case H5T_REFERENCE: H5TOOLS_DEBUG("type_class:OTHER"); - HDmemset(&members, 0, sizeof(mcomp_t)); + memset(&members, 0, sizeof(mcomp_t)); get_member_types(opts->m_tid, &members); for (i = 0; i < opts->hs_nelmts; i++) { H5TOOLS_DEBUG("opts->pos[%" PRIuHSIZE "]:%" PRIuHSIZE " - nelmts:%" PRIuHSIZE, i, @@ -460,7 +460,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && type_class != H5T_COMPOUND && type_class != H5T_STRING && - type_class != H5T_VLEN && HDmemcmp(mem1, mem2, type_size) == 0) + type_class != H5T_VLEN && memcmp(mem1, mem2, type_size) == 0) H5TOOLS_GOTO_DONE(opts->err_stat); switch (H5Tget_class(opts->m_tid)) { @@ -590,7 +590,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co /* check for NULL pointer for string */ if (s != NULL) { /* try fast compare first */ - if ((HDmemcmp(s, sx, size) == 0) && (size1 != size2)) { + if ((memcmp(s, sx, size) == 0) && (size1 != size2)) { for (u = size; u < sizex; u++) character_compare(s + u, sx + u, elemtno, u, opts); } @@ -707,7 +707,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co size = H5Tget_size(arr_opts.m_tid); ndims = H5Tget_array_ndims(opts->m_tid); H5Tget_array_dims2(opts->m_tid, adims); - HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); + assert(ndims >= 1 && ndims <= H5S_MAX_RANK); H5TOOLS_DEBUG("attr ph=%d", arr_opts.print_header); /* calculate the number of array elements */ @@ -1386,11 +1386,11 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di */ if (nblocks1 > 0) { H5TOOLS_DEBUG("region compare blocks"); - HDassert(ndims1 > 0); + assert(ndims1 > 0); alloc_size = (hsize_t)nblocks1 * (unsigned)ndims1 * 2 * sizeof(ptdata1[0]); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - if ((ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) { + if ((ptdata1 = (hsize_t *)malloc((size_t)alloc_size)) == NULL) { opts->err_stat = H5DIFF_ERR; H5TOOLS_INFO("Buffer allocation failed"); } @@ -1398,7 +1398,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1); - if ((ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) { + if ((ptdata2 = (hsize_t *)malloc((size_t)alloc_size)) == NULL) { opts->err_stat = H5DIFF_ERR; H5TOOLS_INFO("Buffer allocation failed"); } @@ -1446,10 +1446,10 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di parallel_print("\n"); } } - HDfree(ptdata2); + free(ptdata2); } /* else ptdata2 */ - HDfree(ptdata1); + free(ptdata1); } /* else ptdata1 */ } @@ -1460,9 +1460,9 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di if (npoints1 > 0) { H5TOOLS_DEBUG("region compare points"); alloc_size = (hsize_t)npoints1 * (unsigned)ndims1 * sizeof(ptdata1[0]); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - if ((ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) { + if ((ptdata1 = (hsize_t *)malloc((size_t)alloc_size)) == NULL) { opts->err_stat = H5DIFF_ERR; H5TOOLS_INFO("Buffer allocation failed"); } @@ -1470,7 +1470,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1); - if ((ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) { + if ((ptdata2 = (hsize_t *)malloc((size_t)alloc_size)) == NULL) { opts->err_stat = H5DIFF_ERR; H5TOOLS_INFO("Buffer allocation failed"); } @@ -1511,7 +1511,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di } } } - HDfree(ptdata2); + free(ptdata2); } /* else ptdata2 */ #if defined(H5DIFF_DEBUG) @@ -1526,7 +1526,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di parallel_print("\n"); #endif - HDfree(ptdata1); + free(ptdata1); } /* else ptdata1 */ } @@ -1556,8 +1556,8 @@ character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t char temp1_uchar; char temp2_uchar; - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); H5TOOLS_START_DEBUG(" %d=%d", temp1_uchar, temp2_uchar); if (temp1_uchar != temp2_uchar) { @@ -1598,8 +1598,8 @@ character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno, /* both_zero is set in the PER_UNSIGN macro but not used in this function */ (void)both_zero; - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); H5TOOLS_START_DEBUG(" %d=%d", temp1_uchar, temp2_uchar); /* -d and !-p */ @@ -1673,8 +1673,8 @@ diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); + memcpy(&temp1_float, mem1, sizeof(float)); + memcpy(&temp2_float, mem2, sizeof(float)); /* logic for detecting NaNs is different with opts -d, -p and no opts */ @@ -1853,8 +1853,8 @@ diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); + memcpy(&temp1_double, mem1, sizeof(double)); + memcpy(&temp2_double, mem2, sizeof(double)); /*------------------------------------------------------------------------- * -d and !-p @@ -2026,8 +2026,8 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); + memcpy(&temp1_double, mem1, sizeof(long double)); + memcpy(&temp2_double, mem2, sizeof(long double)); /* logic for detecting NaNs is different with options -d, -p and no options */ @@ -2196,8 +2196,8 @@ diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d hbool_t both_zero = FALSE; H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); + memcpy(&temp1_char, mem1, sizeof(char)); + memcpy(&temp2_char, mem2, sizeof(char)); /* -d and !-p */ if (opts->delta_bool && !opts->percent_bool) { @@ -2285,8 +2285,8 @@ diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { @@ -2373,8 +2373,8 @@ diff_short_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); + memcpy(&temp1_short, mem1, sizeof(short)); + memcpy(&temp2_short, mem2, sizeof(short)); /* -d and !-p */ if (opts->delta_bool && !opts->percent_bool) { if (ABS(temp1_short - temp2_short) > opts->delta) { @@ -2461,8 +2461,8 @@ diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); /* -d and !-p */ if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { @@ -2553,8 +2553,8 @@ diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, dif H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); + memcpy(&temp1_int, mem1, sizeof(int)); + memcpy(&temp2_int, mem2, sizeof(int)); /* -d and !-p */ if (opts->delta_bool && !opts->percent_bool) { if (ABS(temp1_int - temp2_int) > opts->delta) { @@ -2641,8 +2641,8 @@ diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, di H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); + memcpy(&temp1_uint, mem1, sizeof(unsigned int)); + memcpy(&temp2_uint, mem2, sizeof(unsigned int)); /* -d and !-p */ if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_uint, temp2_uint) > opts->delta) { @@ -2729,8 +2729,8 @@ diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, di H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); + memcpy(&temp1_long, mem1, sizeof(long)); + memcpy(&temp2_long, mem2, sizeof(long)); /* -d and !-p */ if (opts->delta_bool && !opts->percent_bool) { if (ABS(temp1_long - temp2_long) > (long)opts->delta) { @@ -2817,8 +2817,8 @@ diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); /* -d and !-p */ if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_ulong, temp2_ulong) > (unsigned long)opts->delta) { @@ -2907,8 +2907,8 @@ diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_llong, mem1, sizeof(long long)); - HDmemcpy(&temp2_llong, mem2, sizeof(long long)); + memcpy(&temp1_llong, mem1, sizeof(long long)); + memcpy(&temp2_llong, mem2, sizeof(long long)); /* -d and !-p */ if (opts->delta_bool && !opts->percent_bool) { @@ -3001,8 +3001,8 @@ diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); /* -d and !-p */ if (opts->delta_bool && !opts->percent_bool) { @@ -3101,16 +3101,16 @@ ull2float(unsigned long long ull_value, float *f_value) src_size = H5Tget_size(H5T_NATIVE_ULLONG); dst_size = H5Tget_size(H5T_NATIVE_FLOAT); - if ((buf = (unsigned char *)HDcalloc((size_t)1, MAX(src_size, dst_size))) == NULL) + if ((buf = (unsigned char *)calloc((size_t)1, MAX(src_size, dst_size))) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for dims"); - HDmemcpy(buf, &ull_value, src_size); + memcpy(buf, &ull_value, src_size); /* do conversion */ if (H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t)1, buf, NULL, dxpl_id) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Tconvert failed"); - HDmemcpy(f_value, buf, dst_size); + memcpy(f_value, buf, dst_size); done: H5E_BEGIN_TRY @@ -3120,7 +3120,7 @@ done: H5E_END_TRY; if (buf) - HDfree(buf); + free(buf); H5TOOLS_ENDDEBUG(" "); return ret_value; @@ -3165,7 +3165,7 @@ equal_double(double value, double expected, diff_opt_t *opts) } else { /* Check bits */ - if (!HDmemcmp(&value, &expected, sizeof(double))) + if (!memcmp(&value, &expected, sizeof(double))) return TRUE; } @@ -3212,7 +3212,7 @@ equal_ldouble(long double value, long double expected, diff_opt_t *opts) } else { /* Check bits */ - if (!HDmemcmp(&value, &expected, sizeof(long double))) + if (!memcmp(&value, &expected, sizeof(long double))) return TRUE; } @@ -3258,7 +3258,7 @@ equal_float(float value, float expected, diff_opt_t *opts) } else { /* Check bits */ - if (!HDmemcmp(&value, &expected, sizeof(float))) + if (!memcmp(&value, &expected, sizeof(float))) return TRUE; } @@ -3493,15 +3493,15 @@ get_member_types(hid_t tid, mcomp_t *members) return; members->n = (unsigned)nmembs; - members->ids = (hid_t *)HDcalloc((size_t)members->n, sizeof(hid_t)); - members->offsets = (size_t *)HDcalloc((size_t)members->n, sizeof(size_t)); - members->m = (mcomp_t **)HDcalloc((size_t)members->n, sizeof(mcomp_t *)); + members->ids = (hid_t *)calloc((size_t)members->n, sizeof(hid_t)); + members->offsets = (size_t *)calloc((size_t)members->n, sizeof(size_t)); + members->m = (mcomp_t **)calloc((size_t)members->n, sizeof(mcomp_t *)); for (u = 0; u < members->n; u++) { members->ids[u] = H5Tget_member_type(tid, u); members->offsets[u] = H5Tget_member_offset(tid, u); - members->m[u] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); - HDmemset(members->m[u], 0, sizeof(mcomp_t)); + members->m[u] = (mcomp_t *)malloc(sizeof(mcomp_t)); + memset(members->m[u], 0, sizeof(mcomp_t)); get_member_types(members->ids[u], members->m[u]); } } @@ -3523,12 +3523,12 @@ close_member_types(mcomp_t *members) for (u = 0; u < members->n; u++) { if (members->m[u]) { close_member_types(members->m[u]); - HDfree(members->m[u]); + free(members->m[u]); } H5Tclose(members->ids[u]); } - HDfree(members->m); - HDfree(members->ids); - HDfree(members->offsets); + free(members->m); + free(members->ids); + free(members->offsets); } diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index aa64fa5..0dbaee1 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -45,7 +45,7 @@ typedef struct table_attrs_t { static void table_attrs_init(table_attrs_t **tbl) { - table_attrs_t *table_attrs = (table_attrs_t *)HDmalloc(sizeof(table_attrs_t)); + table_attrs_t *table_attrs = (table_attrs_t *)malloc(sizeof(table_attrs_t)); table_attrs->size = 0; table_attrs->nattrs = 0; @@ -77,13 +77,13 @@ table_attrs_free(table_attrs_t *table) if (table->attrs) { for (i = 0; i < table->nattrs; i++) { if (table->attrs[i].name) { - HDfree(table->attrs[i].name); + free(table->attrs[i].name); } } /* end for */ - HDfree(table->attrs); + free(table->attrs); table->attrs = NULL; } /* end if */ - HDfree(table); + free(table); table = NULL; } } @@ -109,7 +109,7 @@ table_attr_mark_exist(const unsigned *exist, char *name, table_attrs_t *table) match_attr_t *new_attrs; table->size = MAX(1, table->size * 2); - new_attrs = (match_attr_t *)HDrealloc(table->attrs, table->size * sizeof(match_attr_t)); + new_attrs = (match_attr_t *)realloc(table->attrs, table->size * sizeof(match_attr_t)); if (new_attrs) table->attrs = new_attrs; } /* end if */ @@ -396,7 +396,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na sz = HDstrlen(name1); H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); if (sz > 0) { - opts->obj_name[0] = (char *)HDmalloc(sz + 1); + opts->obj_name[0] = (char *)malloc(sz + 1); HDstrncpy(opts->obj_name[0], name1, sz + 1); } } @@ -404,7 +404,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na sz = HDstrlen(name2); H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); if (sz > 0) { - opts->obj_name[1] = (char *)HDmalloc(sz + 1); + opts->obj_name[1] = (char *)malloc(sz + 1); HDstrncpy(opts->obj_name[1], name2, sz + 1); } } @@ -440,8 +440,8 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na * read *---------------------------------------------------------------------- */ - buf1 = (void *)HDcalloc((size_t)(opts->nelmts), msize1); - buf2 = (void *)HDcalloc((size_t)(opts->nelmts), msize2); + buf1 = (void *)calloc((size_t)(opts->nelmts), msize1); + buf2 = (void *)calloc((size_t)(opts->nelmts), msize2); H5TOOLS_DEBUG("attr buffer size %ld * %ld", opts->nelmts, msize1); if (buf1 == NULL || buf2 == NULL) { parallel_print("cannot read into memory\n"); @@ -465,24 +465,24 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na /* format output string */ if (opts->obj_name[0] != NULL) - HDfree(opts->obj_name[0]); + free(opts->obj_name[0]); opts->obj_name[0] = NULL; if (opts->obj_name[1] != NULL) - HDfree(opts->obj_name[1]); + free(opts->obj_name[1]); opts->obj_name[1] = NULL; H5TOOLS_DEBUG("attr_names: %s - %s : %s - %s", name1, name2, path1, path2); if (name1) { sz = HDstrlen(name1) + HDstrlen(path1) + 7; H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); - opts->obj_name[0] = (char *)HDcalloc(sz + 1, sizeof(char)); + opts->obj_name[0] = (char *)calloc(sz + 1, sizeof(char)); HDsnprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1); opts->obj_name[0][sz] = '\0'; } if (name2) { sz = HDstrlen(name2) + HDstrlen(path2) + 7; H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); - opts->obj_name[1] = (char *)HDcalloc(sz + 1, sizeof(char)); + opts->obj_name[1] = (char *)calloc(sz + 1, sizeof(char)); HDsnprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2); opts->obj_name[1][sz] = '\0'; } @@ -531,22 +531,22 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na *---------------------------------------------------------------------- */ if (opts->obj_name[0] != NULL) - HDfree(opts->obj_name[0]); + free(opts->obj_name[0]); opts->obj_name[0] = NULL; if (opts->obj_name[1] != NULL) - HDfree(opts->obj_name[1]); + free(opts->obj_name[1]); opts->obj_name[1] = NULL; /* Free buf1 and buf2, check both VLEN-data VLEN-string to reclaim any * VLEN memory first */ if (TRUE == h5tools_detect_vlen(mtype1_id)) H5Treclaim(mtype1_id, space1_id, H5P_DEFAULT, buf1); - HDfree(buf1); + free(buf1); buf1 = NULL; if (TRUE == h5tools_detect_vlen(mtype2_id)) H5Treclaim(mtype2_id, space2_id, H5P_DEFAULT, buf2); - HDfree(buf2); + free(buf2); buf2 = NULL; if (H5Tclose(ftype1_id) < 0) @@ -570,12 +570,12 @@ done: if (buf1) { if (buf1hasdata && TRUE == h5tools_detect_vlen(mtype1_id)) H5Treclaim(mtype1_id, space1_id, H5P_DEFAULT, buf1); - HDfree(buf1); + free(buf1); } /* end if */ if (buf2) { if (buf2hasdata && TRUE == h5tools_detect_vlen(mtype2_id)) H5Treclaim(mtype2_id, space2_id, H5P_DEFAULT, buf2); - HDfree(buf2); + free(buf2); } /* end if */ H5Tclose(ftype1_id); diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index b5c3290..c30532b 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -277,7 +277,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n j = (int)HDstrlen(obj1_name); H5TOOLS_DEBUG("obj1_name: %s - %d", obj1_name, j); if (j > 0) { - opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1); + opts->obj_name[0] = (char *)malloc((size_t)j + 1); HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j + 1); } } @@ -287,7 +287,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n j = (int)HDstrlen(obj2_name); H5TOOLS_DEBUG("obj2_name: %s - %d", obj2_name, j); if (j > 0) { - opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1); + opts->obj_name[1] = (char *)malloc((size_t)j + 1); HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j + 1); } } @@ -424,10 +424,10 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n H5TOOLS_DEBUG("obj_names: %s - %s", obj1_name, obj2_name); if (opts->obj_name[0] != NULL) - HDfree(opts->obj_name[0]); + free(opts->obj_name[0]); opts->obj_name[0] = NULL; if (opts->obj_name[1] != NULL) - HDfree(opts->obj_name[1]); + free(opts->obj_name[1]); opts->obj_name[1] = NULL; if (obj1_name) @@ -442,8 +442,8 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n *----------------------------------------------------------------- */ if (need < H5TOOLS_MALLOCSIZE) { - buf1 = HDmalloc(need); - buf2 = HDmalloc(need); + buf1 = malloc(need); + buf2 = malloc(need); } /* end if */ /* Assume entire data space to be printed */ @@ -478,11 +478,11 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n if (vl_data2) H5Treclaim(m_tid2, sid2, H5P_DEFAULT, buf2); if (buf1 != NULL) { - HDfree(buf1); + free(buf1); buf1 = NULL; } if (buf2 != NULL) { - HDfree(buf2); + free(buf2); buf2 = NULL; } } /* end if */ @@ -520,29 +520,29 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n /* reclaim any VL memory, if necessary */ if (vl_data1) H5Treclaim(m_tid1, sid1, H5P_DEFAULT, buf1); - HDfree(buf1); + free(buf1); buf1 = NULL; } if (buf2 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data2) H5Treclaim(m_tid2, sid2, H5P_DEFAULT, buf2); - HDfree(buf2); + free(buf2); buf2 = NULL; } /* the stripmine loop */ - HDmemset(hs_offset1, 0, sizeof hs_offset1); - HDmemset(hs_stride1, 0, sizeof hs_stride1); - HDmemset(hs_count1, 0, sizeof hs_count1); - HDmemset(hs_block1, 0, sizeof hs_block1); - HDmemset(hs_size1, 0, sizeof hs_size1); - HDmemset(hs_offset2, 0, sizeof hs_offset2); - HDmemset(hs_stride2, 0, sizeof hs_stride2); - HDmemset(hs_count2, 0, sizeof hs_count2); - HDmemset(hs_block2, 0, sizeof hs_block2); - HDmemset(hs_size2, 0, sizeof hs_size2); - HDmemset(zero, 0, sizeof zero); + memset(hs_offset1, 0, sizeof hs_offset1); + memset(hs_stride1, 0, sizeof hs_stride1); + memset(hs_count1, 0, sizeof hs_count1); + memset(hs_block1, 0, sizeof hs_block1); + memset(hs_size1, 0, sizeof hs_size1); + memset(hs_offset2, 0, sizeof hs_offset2); + memset(hs_stride2, 0, sizeof hs_stride2); + memset(hs_count2, 0, sizeof hs_count2); + memset(hs_block2, 0, sizeof hs_block2); + memset(hs_size2, 0, sizeof hs_size2); + memset(zero, 0, sizeof zero); /* if subsetting was requested - initialize the subsetting variables */ H5TOOLS_DEBUG("compare by hyperslabs: opts->nelmts=%ld - opts->m_size=%ld", opts->nelmts, @@ -557,26 +557,26 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n * dimensions */ if (!opts->sset[0]->start.data) { /* default to (0, 0, ...) for the start coord */ - opts->sset[0]->start.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->start.data = (hsize_t *)calloc((size_t)rank1, sizeof(hsize_t)); opts->sset[0]->start.len = (unsigned)rank1; } if (!opts->sset[0]->stride.data) { - opts->sset[0]->stride.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->stride.data = (hsize_t *)calloc((size_t)rank1, sizeof(hsize_t)); opts->sset[0]->stride.len = (unsigned)rank1; for (i = 0; i < rank1; i++) opts->sset[0]->stride.data[i] = 1; } if (!opts->sset[0]->count.data) { - opts->sset[0]->count.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->count.data = (hsize_t *)calloc((size_t)rank1, sizeof(hsize_t)); opts->sset[0]->count.len = (unsigned)rank1; for (i = 0; i < rank1; i++) opts->sset[0]->count.data[i] = 1; } if (!opts->sset[0]->block.data) { - opts->sset[0]->block.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->block.data = (hsize_t *)calloc((size_t)rank1, sizeof(hsize_t)); opts->sset[0]->block.len = (unsigned)rank1; for (i = 0; i < rank1; i++) opts->sset[0]->block.data[i] = 1; @@ -618,26 +618,26 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n * dimensions */ if (!opts->sset[1]->start.data) { /* default to (0, 0, ...) for the start coord */ - opts->sset[1]->start.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->start.data = (hsize_t *)calloc((size_t)rank2, sizeof(hsize_t)); opts->sset[1]->start.len = (unsigned)rank2; } if (!opts->sset[1]->stride.data) { - opts->sset[1]->stride.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->stride.data = (hsize_t *)calloc((size_t)rank2, sizeof(hsize_t)); opts->sset[1]->stride.len = (unsigned)rank2; for (i = 0; i < rank2; i++) opts->sset[1]->stride.data[i] = 1; } if (!opts->sset[1]->count.data) { - opts->sset[1]->count.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->count.data = (hsize_t *)calloc((size_t)rank2, sizeof(hsize_t)); opts->sset[1]->count.len = (unsigned)rank2; for (i = 0; i < rank2; i++) opts->sset[1]->count.data[i] = 1; } if (!opts->sset[1]->block.data) { - opts->sset[1]->block.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->block.data = (hsize_t *)calloc((size_t)rank2, sizeof(hsize_t)); opts->sset[1]->block.len = (unsigned)rank2; for (i = 0; i < rank2; i++) opts->sset[1]->block.data[i] = 1; @@ -696,9 +696,9 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n for (elmtno = 0; elmtno < opts->nelmts; elmtno += opts->hs_nelmts) { H5TOOLS_DEBUG("elmtno: %ld - hs_nelmts1: %ld", elmtno, hs_nelmts1); - if (NULL == (sm_buf1 = (unsigned char *)HDmalloc((size_t)sm_nbytes))) + if (NULL == (sm_buf1 = (unsigned char *)malloc((size_t)sm_nbytes))) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Could not allocate buffer for strip-mine"); - if (NULL == (sm_buf2 = (unsigned char *)HDmalloc((size_t)sm_nbytes))) + if (NULL == (sm_buf2 = (unsigned char *)malloc((size_t)sm_nbytes))) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Could not allocate buffer for strip-mine"); /* calculate the hyperslab size */ @@ -809,14 +809,14 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n /* reclaim any VL memory, if necessary */ if (vl_data1) H5Treclaim(m_tid1, sm_space1, H5P_DEFAULT, sm_buf1); - HDfree(sm_buf1); + free(sm_buf1); sm_buf1 = NULL; } if (sm_buf2 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data2) H5Treclaim(m_tid2, sm_space2, H5P_DEFAULT, sm_buf2); - HDfree(sm_buf2); + free(sm_buf2); sm_buf2 = NULL; } @@ -878,10 +878,10 @@ done: H5TOOLS_DEBUG("free names - errstat:%d", opts->err_stat); /* free */ if (opts->obj_name[0] != NULL) - HDfree(opts->obj_name[0]); + free(opts->obj_name[0]); opts->obj_name[0] = NULL; if (opts->obj_name[1] != NULL) - HDfree(opts->obj_name[1]); + free(opts->obj_name[1]); opts->obj_name[1] = NULL; H5TOOLS_DEBUG("reclaim any VL memory"); @@ -889,14 +889,14 @@ done: /* reclaim any VL memory, if necessary */ if (vl_data1) H5Treclaim(m_tid1, sid1, H5P_DEFAULT, buf1); - HDfree(buf1); + free(buf1); buf1 = NULL; } if (buf2 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data2) H5Treclaim(m_tid2, sid2, H5P_DEFAULT, buf2); - HDfree(buf2); + free(buf2); buf2 = NULL; } H5TOOLS_DEBUG("reclaim any stripmine VL memory"); @@ -904,14 +904,14 @@ done: /* reclaim any VL memory, if necessary */ if (vl_data1) H5Treclaim(m_tid1, sm_space1, H5P_DEFAULT, sm_buf1); - HDfree(sm_buf1); + free(sm_buf1); sm_buf1 = NULL; } if (sm_buf2 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data2) H5Treclaim(m_tid2, sm_space2, H5P_DEFAULT, sm_buf2); - HDfree(sm_buf2); + free(sm_buf2); sm_buf2 = NULL; } diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 17b8d3c..fc74a39 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -321,7 +321,7 @@ print_found(hsize_t nfound) if (g_Parallel) parallel_print("%" PRIuHSIZE " differences found\n", nfound); else - HDfprintf(stdout, "%" PRIuHSIZE " differences found\n", nfound); + fprintf(stdout, "%" PRIuHSIZE " differences found\n", nfound); } /*----------------------------------------------------------------- diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 189aafd..58be037 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -176,7 +176,7 @@ h5tools_close(void) if (h5tools_init_g) { /* special case where only data is output to stdout */ if ((rawoutstream == NULL) && rawdatastream && (rawdatastream == stdout)) - HDfprintf(rawdatastream, "\n"); + fprintf(rawdatastream, "\n"); if (tools_func) H5Eprint2(H5tools_ERR_STACK_g, rawerrorstream); @@ -256,13 +256,13 @@ h5tools_set_data_output_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { + if ((f = fopen(fname, "wb")) != NULL) { rawdatastream = f; retvalue = SUCCEED; } } else { - if ((f = HDfopen(fname, "w")) != NULL) { + if ((f = fopen(fname, "w")) != NULL) { rawdatastream = f; retvalue = SUCCEED; } @@ -304,13 +304,13 @@ h5tools_set_attr_output_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { + if ((f = fopen(fname, "wb")) != NULL) { rawattrstream = f; retvalue = SUCCEED; } } else { - if ((f = HDfopen(fname, "w")) != NULL) { + if ((f = fopen(fname, "w")) != NULL) { rawattrstream = f; retvalue = SUCCEED; } @@ -352,13 +352,13 @@ h5tools_set_input_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "rb")) != NULL) { + if ((f = fopen(fname, "rb")) != NULL) { rawinstream = f; retvalue = SUCCEED; } } else { - if ((f = HDfopen(fname, "r")) != NULL) { + if ((f = fopen(fname, "r")) != NULL) { rawinstream = f; retvalue = SUCCEED; } @@ -400,13 +400,13 @@ h5tools_set_output_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { + if ((f = fopen(fname, "wb")) != NULL) { rawoutstream = f; retvalue = SUCCEED; } } else { - if ((f = HDfopen(fname, "w")) != NULL) { + if ((f = fopen(fname, "w")) != NULL) { rawoutstream = f; retvalue = SUCCEED; } @@ -448,13 +448,13 @@ h5tools_set_error_file(const char *fname, int is_bin) if (fname != NULL) { /* binary output */ if (is_bin) { - if ((f = HDfopen(fname, "wb")) != NULL) { + if ((f = fopen(fname, "wb")) != NULL) { rawerrorstream = f; retvalue = SUCCEED; } } else { - if ((f = HDfopen(fname, "w")) != NULL) { + if ((f = fopen(fname, "w")) != NULL) { rawerrorstream = f; retvalue = SUCCEED; } @@ -1230,8 +1230,8 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context H5TOOLS_START_DEBUG(" "); - HDmemset(&prefix, 0, sizeof(h5tools_str_t)); - HDmemset(&str, 0, sizeof(h5tools_str_t)); + memset(&prefix, 0, sizeof(h5tools_str_t)); + memset(&str, 0, sizeof(h5tools_str_t)); /* Terminate previous line, if any */ H5TOOLS_DEBUG("before CR elmtno=%ld, ctx->cur_column=%d, info->idx_fmt=%s, info->line_suf=%s", elmtno, @@ -1325,8 +1325,8 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_ if (!ctx->need_prefix) return; - HDmemset(&prefix, 0, sizeof(h5tools_str_t)); - HDmemset(&str, 0, sizeof(h5tools_str_t)); + memset(&prefix, 0, sizeof(h5tools_str_t)); + memset(&str, 0, sizeof(h5tools_str_t)); /* Terminate previous line, if any */ if (ctx->cur_column) { @@ -1843,7 +1843,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t s = (char *)mem; } for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) { - HDmemcpy(&tempuchar, &s[i], sizeof(unsigned char)); + memcpy(&tempuchar, &s[i], sizeof(unsigned char)); if (1 != HDfwrite(&tempuchar, sizeof(unsigned char), 1, stream)) H5TOOLS_THROW((-1), "fwrite failed"); } /* i */ @@ -1947,11 +1947,11 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t if (size > sizeof(tref)) H5TOOLS_THROW((-1), "unexpectedly large ref"); - HDmemset(&tref, 0, sizeof(tref)); + memset(&tref, 0, sizeof(tref)); for (block_index = 0; block_index < block_nelmts; block_index++) { mem = ((unsigned char *)_mem) + block_index * size; - HDmemcpy(&tref, mem, size); + memcpy(&tref, mem, size); if ((region_id = H5Ropen_object(&tref, H5P_DEFAULT, H5P_DEFAULT)) < 0) H5TOOLS_INFO("H5Ropen_object H5T_STD_REF failed"); else { @@ -2044,7 +2044,7 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t contai H5TOOLS_THROW((-1), "H5Dget_space failed"); /* Allocate space for the dimension array */ - if ((dims1 = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((dims1 = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_THROW((-1), "Could not allocate buffer for dims"); /* find the dimensions of each data space from the block coordinates */ @@ -2061,15 +2061,15 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t contai if ((type_size = H5Tget_size(type_id)) == 0) H5TOOLS_THROW((-1), "H5Tget_size failed"); - if ((region_buf = HDmalloc(type_size * (size_t)numelem)) == NULL) + if ((region_buf = malloc(type_size * (size_t)numelem)) == NULL) H5TOOLS_THROW((-1), "Could not allocate region buffer"); /* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */ /* 1 2 n 1 2 n */ - if ((start = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((start = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_THROW((-1), "Could not allocate buffer for start"); - if ((count = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((count = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_THROW((-1), "Could not allocate buffer for count"); for (blkndx = 0; blkndx < nblocks; blkndx++) { @@ -2094,10 +2094,10 @@ done:; } /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */ CATCH - HDfree(start); - HDfree(count); - HDfree(region_buf); - HDfree(dims1); + free(start); + free(count); + free(region_buf); + free(dims1); if (H5Sclose(mem_space) < 0) H5TOOLS_ERROR((-1), "H5Sclose failed"); @@ -2143,7 +2143,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *strea ndims = (unsigned)sndims; alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - if ((ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) + if ((ptdata = (hsize_t *)malloc((size_t)alloc_size)) == NULL) H5TOOLS_GOTO_ERROR(FALSE, "Could not allocate buffer for ptdata"); if (H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0) @@ -2157,7 +2157,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *strea render_bin_output_region_data_blocks(region_id, stream, container, ndims, type_id, nblocks, ptdata); done: - HDfree(ptdata); + free(ptdata); if (type_id > 0 && H5Tclose(type_id) < 0) H5TOOLS_ERROR(FALSE, "H5Tclose failed"); @@ -2203,11 +2203,11 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE * if ((type_size = H5Tget_size(type_id)) == 0) H5TOOLS_GOTO_ERROR((-1), "H5Tget_size failed"); - if ((region_buf = HDmalloc(type_size * (size_t)npoints)) == NULL) + if ((region_buf = malloc(type_size * (size_t)npoints)) == NULL) H5TOOLS_GOTO_ERROR((-1), "Could not allocate buffer for region"); /* Allocate space for the dimension array */ - if ((dims1 = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((dims1 = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_GOTO_ERROR((-1), "Could not allocate buffer for dims"); dims1[0] = npoints; @@ -2223,8 +2223,8 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE * H5TOOLS_GOTO_ERROR((-1), "render_bin_output of data points failed"); done: - HDfree(region_buf); - HDfree(dims1); + free(region_buf); + free(dims1); if (H5Sclose(mem_space) < 0) H5TOOLS_ERROR((-1), "H5Sclose failed"); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 57a1712..f7298cb 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -266,7 +266,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_cont } /* end if */ else { /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); size = H5Tget_size(type); H5TOOLS_DEBUG("type size is %ld", size); @@ -344,9 +344,9 @@ h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format hbool_t past_catch = FALSE; hbool_t ret_value = TRUE; - HDassert(info); - HDassert(ctx); - HDassert(buffer); + assert(info); + assert(ctx); + assert(buffer); outputformat = *info; outputformat.idx_fmt = ""; @@ -497,12 +497,12 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for void *region_buf = NULL; int ret_value = 0; - HDassert(info); - HDassert(cur_ctx); - HDassert(buffer); - HDassert(ptdata); + assert(info); + assert(cur_ctx); + assert(buffer); + assert(ptdata); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); H5TOOLS_START_DEBUG(" "); @@ -514,7 +514,7 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed"); /* Allocate space for the dimension array */ - if ((dims1 = (hsize_t *)HDmalloc((size_t)(sizeof(hsize_t) * ndims))) == NULL) + if ((dims1 = (hsize_t *)malloc((size_t)(sizeof(hsize_t) * ndims))) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for dims"); /* find the dimensions of each data space from the block coordinates */ @@ -528,15 +528,15 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for if ((mem_space = H5Screate_simple((int)ndims, dims1, NULL)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Screate_simple failed"); - if ((region_buf = HDmalloc(type_size * (size_t)numelem)) == NULL) + if ((region_buf = malloc(type_size * (size_t)numelem)) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate region buffer"); /* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */ /* 1 2 n 1 2 n */ - if ((start = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((start = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for start"); - if ((count = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((count = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for count"); curr_pos = 0; @@ -614,10 +614,10 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for } /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */ done: - HDfree(start); - HDfree(count); - HDfree(region_buf); - HDfree(dims1); + free(start); + free(count); + free(region_buf); + free(dims1); if (H5Sclose(mem_space) < 0) H5TOOLS_ERROR(FAIL, "H5Sclose failed"); @@ -674,9 +674,9 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea hbool_t past_catch = FALSE; hbool_t ret_value = TRUE; - HDassert(info); - HDassert(ctx); - HDassert(buffer); + assert(info); + assert(ctx); + assert(buffer); H5TOOLS_START_DEBUG(" "); outputformat = *info; @@ -712,8 +712,8 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea h5tools_str_append(buffer, "REGION_TYPE BLOCK "); alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - if ((ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) + assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + if ((ptdata = (hsize_t *)malloc((size_t)alloc_size)) == NULL) H5TOOLS_GOTO_ERROR(dimension_break, "Could not allocate buffer for ptdata"); if (H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0) @@ -809,7 +809,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea } done: - HDfree(ptdata); + free(ptdata); if (type_id > 0 && H5Tclose(type_id) < 0) H5TOOLS_ERROR(dimension_break, "H5Tclose failed"); @@ -893,17 +893,17 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre hbool_t past_catch = FALSE; int ret_value = 0; - HDassert(info); - HDassert(cur_ctx); - HDassert(buffer); - HDassert(ptdata); - HDassert(ndims > 0); + assert(info); + assert(cur_ctx); + assert(buffer); + assert(ptdata); + assert(ndims > 0); H5TOOLS_START_DEBUG(" "); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); /* Allocate space for the dimension array */ - if ((dims1 = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((dims1 = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_THROW((-1), "Could not allocate buffer for dims"); dims1[0] = npoints; @@ -915,7 +915,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre if ((type_size = H5Tget_size(type_id)) == 0) H5TOOLS_THROW((-1), "H5Tget_size failed"); - if ((region_buf = HDmalloc(type_size * (size_t)npoints)) == NULL) + if ((region_buf = malloc(type_size * (size_t)npoints)) == NULL) H5TOOLS_THROW((-1), "Could not allocate buffer for region"); curr_pos = 0; @@ -978,9 +978,9 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre } /* end for (jndx = 0; jndx < npoints; jndx++, elmtno++) */ done: - HDfree(region_buf); + free(region_buf); CATCH - HDfree(dims1); + free(dims1); if (H5Sclose(mem_space) < 0) H5TOOLS_ERROR((-1), "H5Sclose failed"); @@ -1033,9 +1033,9 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea hbool_t past_catch = FALSE; hbool_t ret_value = TRUE; - HDassert(info); - HDassert(ctx); - HDassert(buffer); + assert(info); + assert(ctx); + assert(buffer); H5TOOLS_START_DEBUG(" "); outputformat = *info; @@ -1071,8 +1071,8 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea h5tools_str_append(buffer, "REGION_TYPE POINT "); alloc_size = npoints * ndims * sizeof(ptdata[0]); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size))) + assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + if (NULL == (ptdata = (hsize_t *)malloc((size_t)alloc_size))) H5TOOLS_GOTO_ERROR(dimension_break, "Could not allocate buffer for ptdata"); if (H5Sget_select_elem_pointlist(region_space, (hsize_t)0, npoints, ptdata) < 0) @@ -1164,7 +1164,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea } done: - HDfree(ptdata); + free(ptdata); if (type_id > 0 && H5Tclose(type_id) < 0) H5TOOLS_ERROR(dimension_break, "H5Tclose failed"); @@ -1317,11 +1317,11 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c size = 1; sm_size[i - 1] = MIN(total_size[i - 1], size); sm_nbytes *= sm_size[i - 1]; - HDassert(sm_nbytes > 0); + assert(sm_nbytes > 0); } - HDassert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ - if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nelmts * p_type_nbytes))) + assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ + if (NULL == (sm_buf = (unsigned char *)malloc((size_t)sm_nelmts * p_type_nbytes))) H5TOOLS_THROW(FAIL, "Could not allocate buffer for strip-mine"); if ((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0) @@ -1370,7 +1370,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c if (H5Sclose(sm_space) < 0) H5TOOLS_THROW(FAIL, "H5Sclose failed"); if (sm_buf) - HDfree(sm_buf); + free(sm_buf); sm_buf = NULL; } else @@ -1382,7 +1382,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c CATCH if (sm_buf) - HDfree(sm_buf); + free(sm_buf); H5TOOLS_ENDDEBUG(" "); return ret_value; @@ -1699,8 +1699,8 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont if (!sm_nbytes) goto done; - HDassert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ - if (NULL != (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes))) { + assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ + if (NULL != (sm_buf = (unsigned char *)malloc((size_t)sm_nbytes))) { H5TOOLS_DEBUG("stripmine size:%ld", sm_nbytes); sm_nelmts = sm_nbytes / p_type_nbytes; @@ -1710,8 +1710,8 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims); /* The stripmine loop */ - HDmemset(hs_offset, 0, sizeof hs_offset); - HDmemset(zero, 0, sizeof zero); + memset(hs_offset, 0, sizeof hs_offset); + memset(zero, 0, sizeof zero); for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) { H5TOOLS_DEBUG("stripmine read loop:%d", i); @@ -1772,7 +1772,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont ctx->continuation++; H5TOOLS_DEBUG("stripmine read loop:%d complete", i); } - HDfree(sm_buf); + free(sm_buf); } /* if (NULL != (sm_buf...)) */ done: @@ -1848,8 +1848,8 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte vl_data = TRUE; alloc_size = p_nelmts * H5Tget_size(p_type); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - if (NULL != (buf = (unsigned char *)HDmalloc((size_t)alloc_size))) { + assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + if (NULL != (buf = (unsigned char *)malloc((size_t)alloc_size))) { H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims); H5TOOLS_DEBUG("Read the data"); @@ -1865,7 +1865,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte } else H5TOOLS_ERROR((-1), "H5Aread failed"); - HDfree(buf); + free(buf); } /* if (NULL != (buf...)) */ done: if (f_space >= 0 && H5Sclose(f_space) < 0) @@ -1909,7 +1909,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t * stream = rawoutstream; if (!info) { - HDmemset(&info_dflt, 0, sizeof info_dflt); + memset(&info_dflt, 0, sizeof info_dflt); info = &info_dflt; } @@ -1985,7 +1985,7 @@ h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c stream = rawoutstream; if (!info) { - HDmemset(&info_dflt, 0, sizeof(info_dflt)); + memset(&info_dflt, 0, sizeof(info_dflt)); info = &info_dflt; } @@ -2747,7 +2747,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i if ((snmembs = H5Tget_nmembers(type)) < 0) H5TOOLS_THROW((-1), "H5Tget_nmembers failed"); nmembs = (unsigned)snmembs; - HDassert(nmembs > 0); + assert(nmembs > 0); if ((super = H5Tget_super(type)) < 0) H5TOOLS_THROW((-1), "H5Tget_super failed"); @@ -2776,9 +2776,9 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i dst_size = type_size; /* Get the names and raw values of all members */ - if (NULL == (name = (char **)HDcalloc((size_t)nmembs, sizeof(char *)))) + if (NULL == (name = (char **)calloc((size_t)nmembs, sizeof(char *)))) H5TOOLS_THROW((-1), "Could not allocate buffer for member name"); - if (NULL == (value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(type_size, dst_size)))) + if (NULL == (value = (unsigned char *)calloc((size_t)nmembs, MAX(type_size, dst_size)))) H5TOOLS_THROW((-1), "Could not allocate buffer for member value"); for (i = 0; i < nmembs; i++) { @@ -2820,13 +2820,13 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i else if (H5T_SGN_NONE == H5Tget_sign(native)) { unsigned long long copy; - HDmemcpy(©, value + i * dst_size, sizeof(copy)); + memcpy(©, value + i * dst_size, sizeof(copy)); h5tools_str_append(buffer, "%llu", copy); } else { long long copy; - HDmemcpy(©, value + i * dst_size, sizeof(copy)); + memcpy(©, value + i * dst_size, sizeof(copy)); h5tools_str_append(buffer, "%lld", copy); } @@ -2840,11 +2840,11 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i for (i = 0; i < nmembs; i++) if (name[i]) H5free_memory(name[i]); - HDfree(name); + free(name); } /* end if */ if (value) - HDfree(value); + free(value); if (super >= 0 && H5Tclose(super) < 0) H5TOOLS_THROW((-1), "Could not close datatype's super class"); @@ -2879,7 +2879,7 @@ h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, h5tools_context */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); if (info->line_ncols > 0) ncols = info->line_ncols; @@ -2925,7 +2925,7 @@ h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, h5tools_contex */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); if (info->line_ncols > 0) ncols = info->line_ncols; @@ -2972,7 +2972,7 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); if (info->line_ncols > 0) ncols = info->line_ncols; @@ -3081,7 +3081,7 @@ h5tools_print_fill_value(h5tools_str_t *buffer /*in,out*/, const h5tool_format_t n_type = H5Tget_native_type(type_id, H5T_DIR_DEFAULT); size = H5Tget_size(n_type); - buf = HDmalloc(size); + buf = malloc(size); H5Pget_fill_value(dcpl, n_type, buf); @@ -3090,7 +3090,7 @@ h5tools_print_fill_value(h5tools_str_t *buffer /*in,out*/, const h5tool_format_t H5Tclose(n_type); if (buf) - HDfree(buf); + free(buf); } /*------------------------------------------------------------------------- @@ -3130,7 +3130,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * h5tools_str_t buffer; /* string into which to render */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); if (info->line_ncols > 0) ncols = info->line_ncols; @@ -3382,12 +3382,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level++; ssize_out = H5Pget_virtual_filename(dcpl_id, curr_vmap, NULL, 0); - HDassert(ssize_out > 0); - HDassert((size_t)ssize_out < sizeof(name)); + assert(ssize_out > 0); + assert((size_t)ssize_out < sizeof(name)); H5Pget_virtual_filename(dcpl_id, curr_vmap, name, sizeof(name)); ssize_out = H5Pget_virtual_dsetname(dcpl_id, curr_vmap, NULL, 0); - HDassert(ssize_out > 0); - HDassert((size_t)ssize_out < sizeof(name)); + assert(ssize_out > 0); + assert((size_t)ssize_out < sizeof(name)); H5Pget_virtual_dsetname(dcpl_id, curr_vmap, dsetname, sizeof(dsetname)); ctx->need_prefix = TRUE; @@ -3661,7 +3661,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * break; case H5D_FILL_TIME_ERROR: default: - HDassert(0); + assert(0); break; } h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3685,7 +3685,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * break; case H5D_FILL_VALUE_ERROR: default: - HDassert(0); + assert(0); break; } h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3727,7 +3727,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * case H5D_ALLOC_TIME_ERROR: case H5D_ALLOC_TIME_DEFAULT: default: - HDassert(0); + assert(0); break; } h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3774,7 +3774,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_ return; /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); if (info->line_ncols > 0) ncols = info->line_ncols; @@ -3783,7 +3783,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_ /* call H5Oget_comment again with the correct value */ if (cmt_bufsize > 0) { - comment = (char *)HDmalloc((size_t)(cmt_bufsize + 1)); /* new_size including null terminator */ + comment = (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) { @@ -3798,7 +3798,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_ h5tools_str_close(&buffer); } - HDfree(comment); + free(comment); } } } /* end dump_comment() */ @@ -3826,7 +3826,7 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, h5tools_contex */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); if (info->line_ncols > 0) ncols = info->line_ncols; @@ -3968,7 +3968,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tool size_t ncols = 80; /* available output width */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); if (info->line_ncols > 0) ncols = info->line_ncols; @@ -4063,7 +4063,7 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex /* Assume entire data space to be printed */ datactx.need_prefix = TRUE; - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); for (i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) { H5O_type_t obj_type = -1; /* Object type */ H5R_type_t ref_type; /* Reference type */ @@ -4296,7 +4296,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * H5TOOLS_START_DEBUG(" file=%p", (void *)stream); H5TOOLS_DEBUG("rawdata file=%p", (void *)rawdatastream); /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); if (info->line_ncols > 0) ncols = info->line_ncols; @@ -4357,23 +4357,23 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * datactx.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))) { if (obj_data) { if (H5Dread(obj_id, 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(); } } else { if (H5Aread(obj_id, H5T_STD_REF, ref_buf) < 0) { - HDfree(ref_buf); + free(ref_buf); H5TOOLS_INFO("H5Aread reference failed"); H5TOOLS_GOTO_DONE_NO_RET(); } } h5tools_dump_reference(stream, &outputformat, &datactx, obj_id, ref_buf, ndims); - HDfree(ref_buf); + free(ref_buf); } ctx->indent_level--; } diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 899b7be..58a71b3 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -20,7 +20,7 @@ static void print_filter_warning(const char *dname, const char *fname) { - HDfprintf(stderr, "Warning: dataset <%s> cannot be read, %s filter is not available\n", dname, fname); + fprintf(stderr, "Warning: dataset <%s> cannot be read, %s filter is not available\n", dname, fname); } /*------------------------------------------------------------------------- diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 9f12367..2d95732 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -58,8 +58,8 @@ free_ref_path_info(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op { ref_path_node_t *node = (ref_path_node_t *)item; - HDfree(node->path); - HDfree(node); + free(node->path); + free(node); return (0); } @@ -112,7 +112,7 @@ ref_path_table_cmp(const void *key1, const void *key2) if (thefile > 0) H5Otoken_cmp(thefile, token1, token2, &cmp_value); else - cmp_value = HDmemcmp(token1, token2, sizeof(H5O_token_t)); + cmp_value = memcmp(token1, token2, sizeof(H5O_token_t)); return cmp_value; } @@ -211,7 +211,7 @@ ref_path_table_lookup(const char *thepath, H5O_token_t *token) return -1; /* Return object token through parameter */ - HDmemcpy(token, &oi.token, sizeof(H5O_token_t)); + memcpy(token, &oi.token, sizeof(H5O_token_t)); return 0; } @@ -239,10 +239,10 @@ ref_path_table_put(const char *path, const H5O_token_t *token) ref_path_node_t *new_node; if (ref_path_table && path) { - if ((new_node = (ref_path_node_t *)HDmalloc(sizeof(ref_path_node_t))) == NULL) + if ((new_node = (ref_path_node_t *)malloc(sizeof(ref_path_node_t))) == NULL) return (-1); - HDmemcpy(&new_node->obj_token, token, sizeof(H5O_token_t)); + memcpy(&new_node->obj_token, token, sizeof(H5O_token_t)); new_node->path = HDstrdup(path); return (H5SL_insert(ref_path_table, new_node, &(new_node->obj_token))); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 208e33a..3f38805 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -64,8 +64,8 @@ void h5tools_str_close(h5tools_str_t *str) { if (str && str->nalloc) { - HDfree(str->s); - HDmemset(str, 0, sizeof(h5tools_str_t)); + free(str->s); + memset(str, 0, sizeof(h5tools_str_t)); } } @@ -122,9 +122,9 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...) int nchars = -1; size_t avail = str->nalloc - str->len; - HDva_start(ap, fmt); + va_start(ap, fmt); nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); - HDva_end(ap); + va_end(ap); /* Note: HDvsnprintf() behaves differently on Windows as Unix, when * buffer is smaller than source string. On Unix, this function @@ -149,9 +149,9 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...) * Allocate at least twice as much space and try again. */ size_t newsize = MAX(str->len + (size_t)nchars + 1, 2 * str->nalloc); - HDassert(newsize > str->nalloc); /*overflow*/ - str->s = (char *)HDrealloc(str->s, newsize); - HDassert(str->s); + assert(newsize > str->nalloc); /*overflow*/ + str->s = (char *)realloc(str->s, newsize); + assert(str->s); str->nalloc = newsize; } else { @@ -183,8 +183,8 @@ h5tools_str_reset(h5tools_str_t *str /*in,out*/) { if (!str->s || str->nalloc <= 0) { str->nalloc = STR_INIT_LEN; - str->s = (char *)HDmalloc(str->nalloc); - HDassert(str->s); + str->s = (char *)malloc(str->nalloc); + assert(str->s); } str->s[0] = '\0'; @@ -238,8 +238,8 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt) { char _temp[1024], *temp = _temp; - HDassert(str); - HDassert(fmt); + assert(str); + assert(fmt); /* If the format string is simply "%s" then don't bother doing anything */ if (!HDstrcmp(fmt, "%s")) @@ -253,8 +253,8 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt) size_t n = sizeof(_temp); if (str->len - start + 1 > n) { n = str->len - start + 1; - temp = (char *)HDmalloc(n); - HDassert(temp); + temp = (char *)malloc(n); + assert(temp); } HDstrncpy(temp, str->s + start, n - 1); @@ -269,7 +269,7 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt) /* Free the temp buffer if we allocated one */ if (temp != _temp) - HDfree(temp); + free(temp); return str->s; } @@ -471,8 +471,8 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, const h5tool_for nblocks = (hsize_t)snblocks; alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata = (hsize_t *)HDmalloc((size_t)alloc_size); + assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + ptdata = (hsize_t *)malloc((size_t)alloc_size); H5Sget_select_hyper_blocklist(rspace, (hsize_t)0, nblocks, ptdata); for (u = 0; u < nblocks; u++) { @@ -493,7 +493,7 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, const h5tool_for H5_GCC_CLANG_DIAG_ON("format-nonliteral") } - HDfree(ptdata); + free(ptdata); } /* end if (nblocks > 0) */ } @@ -532,8 +532,8 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, const h5tool_for npoints = (hsize_t)snpoints; alloc_size = npoints * ndims * sizeof(ptdata[0]); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata = (hsize_t *)HDmalloc((size_t)alloc_size); + assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + ptdata = (hsize_t *)malloc((size_t)alloc_size); H5Sget_select_elem_pointlist(rspace, (hsize_t)0, npoints, ptdata); for (u = 0; u < npoints; u++) { @@ -550,7 +550,7 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, const h5tool_for H5_GCC_CLANG_DIAG_ON("format-nonliteral") } - HDfree(ptdata); + free(ptdata); } /* end if (npoints > 0) */ } @@ -716,21 +716,21 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* if (H5Tequal(type, H5T_NATIVE_FLOAT)) */ float tempfloat; - HDmemcpy(&tempfloat, vp, sizeof(float)); + memcpy(&tempfloat, vp, sizeof(float)); h5tools_str_append(str, OPT(info->fmt_float, "%g"), (double)tempfloat); } else if (sizeof(double) == nsize) { /* if (H5Tequal(type, H5T_NATIVE_DOUBLE)) */ double tempdouble; - HDmemcpy(&tempdouble, vp, sizeof(double)); + memcpy(&tempdouble, vp, sizeof(double)); h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble); } else if (sizeof(long double) == nsize) { /* if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) */ long double templdouble; - HDmemcpy(&templdouble, vp, sizeof(long double)); + memcpy(&templdouble, vp, sizeof(long double)); h5tools_str_append(str, "%Lg", templdouble); } else { @@ -830,7 +830,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else if (H5T_SGN_NONE == nsign) { unsigned char tempuchar; - HDmemcpy(&tempuchar, ucp_vp, sizeof(unsigned char)); + memcpy(&tempuchar, ucp_vp, sizeof(unsigned char)); if (packed_bits_num) { if (packed_data_offset >= 8 * sizeof(unsigned char)) tempuchar = 0; @@ -844,7 +844,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else { signed char tempchar; - HDmemcpy(&tempchar, cp_vp, sizeof(char)); + memcpy(&tempchar, cp_vp, sizeof(char)); if (packed_bits_num) { if (packed_data_offset >= 8 * sizeof(char)) tempchar = 0; @@ -860,7 +860,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai if (H5T_SGN_NONE == nsign) { unsigned int tempuint; - HDmemcpy(&tempuint, vp, sizeof(unsigned int)); + memcpy(&tempuint, vp, sizeof(unsigned int)); if (packed_bits_num) { if (packed_data_offset >= 8 * sizeof(unsigned int)) tempuint = 0; @@ -872,7 +872,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else { int tempint; - HDmemcpy(&tempint, vp, sizeof(int)); + memcpy(&tempint, vp, sizeof(int)); if (packed_bits_num) { if (packed_data_offset >= 8 * sizeof(int)) tempint = 0; @@ -887,7 +887,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai if (H5T_SGN_NONE == nsign) { unsigned short tempushort; - HDmemcpy(&tempushort, vp, sizeof(unsigned short)); + memcpy(&tempushort, vp, sizeof(unsigned short)); if (packed_bits_num) { if (packed_data_offset >= 8 * sizeof(unsigned short)) tempushort = 0; @@ -901,7 +901,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else { short tempshort; - HDmemcpy(&tempshort, vp, sizeof(short)); + memcpy(&tempshort, vp, sizeof(short)); if (packed_bits_num) { if (packed_data_offset >= 8 * sizeof(short)) tempshort = 0; @@ -916,7 +916,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai if (H5T_SGN_NONE == nsign) { unsigned long tempulong; - HDmemcpy(&tempulong, vp, sizeof(unsigned long)); + memcpy(&tempulong, vp, sizeof(unsigned long)); if (packed_bits_num) { if (packed_data_offset >= 8 * sizeof(unsigned long)) tempulong = 0; @@ -928,7 +928,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else { long templong; - HDmemcpy(&templong, vp, sizeof(long)); + memcpy(&templong, vp, sizeof(long)); if (packed_bits_num) { if (packed_data_offset >= 8 * sizeof(long)) templong = 0; @@ -944,7 +944,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai if (H5T_SGN_NONE == nsign) { unsigned long long tempullong; - HDmemcpy(&tempullong, vp, sizeof(unsigned long long)); + memcpy(&tempullong, vp, sizeof(unsigned long long)); if (packed_bits_num) { if (packed_data_offset >= 8 * sizeof(unsigned long long)) tempullong = 0; @@ -956,7 +956,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else { long long templlong; - HDmemcpy(&templlong, vp, sizeof(long long)); + memcpy(&templlong, vp, sizeof(long long)); if (packed_bits_num) { if (packed_data_offset >= 8 * sizeof(long long)) templlong = 0; @@ -1271,13 +1271,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai size = H5Tget_size(memb); ndims = H5Tget_array_ndims(type); H5Tget_array_dims2(type, dims); - HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); + assert(ndims >= 1 && ndims <= H5S_MAX_RANK); /* Calculate the number of array elements */ for (k = 0, nelmts = 1; k < ndims; k++) { temp_nelmts = nelmts; temp_nelmts *= dims[k]; - HDassert(temp_nelmts == (hsize_t)((size_t)temp_nelmts)); + assert(temp_nelmts == (hsize_t)((size_t)temp_nelmts)); nelmts = (size_t)temp_nelmts; } /* Print the opening bracket */ @@ -1446,38 +1446,38 @@ h5tools_str_sprint_reference(h5tools_str_t *str, H5R_ref_t *ref_vp) buf_size = H5Rget_file_name(ref_vp, NULL, 0); H5TOOLS_DEBUG("buf_size=%ld", buf_size); if (buf_size) { - char *file_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1); + char *file_name = (char *)malloc(sizeof(char) * (size_t)buf_size + 1); if (H5Rget_file_name(ref_vp, file_name, (size_t)buf_size + 1) >= 0) { file_name[buf_size] = '\0'; H5TOOLS_DEBUG("name=%s", file_name); h5tools_str_append(str, "%s", file_name); } - HDfree(file_name); + free(file_name); } buf_size = H5Rget_obj_name(ref_vp, H5P_DEFAULT, NULL, 0); H5TOOLS_DEBUG("buf_size=%ld", buf_size); if (buf_size) { - char *obj_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1); + char *obj_name = (char *)malloc(sizeof(char) * (size_t)buf_size + 1); if (H5Rget_obj_name(ref_vp, H5P_DEFAULT, obj_name, (size_t)buf_size + 1) >= 0) { obj_name[buf_size] = '\0'; H5TOOLS_DEBUG("name=%s", obj_name); h5tools_str_append(str, "%s", obj_name); } - HDfree(obj_name); + free(obj_name); } if (H5Rget_type(ref_vp) == H5R_ATTR) { buf_size = H5Rget_attr_name(ref_vp, NULL, 0); H5TOOLS_DEBUG("buf_size=%ld", buf_size); if (buf_size) { - char *attr_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1); + char *attr_name = (char *)malloc(sizeof(char) * (size_t)buf_size + 1); if (H5Rget_attr_name(ref_vp, attr_name, (size_t)buf_size + 1) >= 0) { attr_name[buf_size] = '\0'; H5TOOLS_DEBUG("name=%s", attr_name); h5tools_str_append(str, "/%s", attr_name); } - HDfree(attr_name); + free(attr_name); } } h5tools_str_append(str, "\""); @@ -1563,7 +1563,7 @@ h5tools_escape(char *s /*in,out*/, size_t size) return NULL; HDmemmove(s + i + esc_size, s + i + 1, n - i); /*make room*/ - HDmemcpy(s + i, escape, esc_size); /*insert*/ + memcpy(s + i, escape, esc_size); /*insert*/ n += esc_size - 1; /* adjust total string size */ i += esc_size; /* adjust string position */ } @@ -1626,20 +1626,20 @@ h5tools_str_replace(const char *string, const char *substr, const char *replacem char *oldstr; oldstr = newstr; - newstr = (char *)HDmalloc(HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement) + 1); + newstr = (char *)malloc(HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement) + 1); if (newstr == NULL) { - HDfree(oldstr); + free(oldstr); return NULL; } - HDmemcpy(newstr, oldstr, (size_t)(tok - oldstr)); - HDmemcpy(newstr + (tok - oldstr), replacement, HDstrlen(replacement)); - HDmemcpy(newstr + (tok - oldstr) + HDstrlen(replacement), tok + HDstrlen(substr), - HDstrlen(oldstr) - HDstrlen(substr) - (size_t)(tok - oldstr)); - HDmemset(newstr + HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement), 0, 1); + memcpy(newstr, oldstr, (size_t)(tok - oldstr)); + memcpy(newstr + (tok - oldstr), replacement, HDstrlen(replacement)); + memcpy(newstr + (tok - oldstr) + HDstrlen(replacement), tok + HDstrlen(substr), + HDstrlen(oldstr) - HDstrlen(substr) - (size_t)(tok - oldstr)); + memset(newstr + HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement), 0, 1); /* move back head right after the last replacement */ head = newstr + (tok - oldstr) + HDstrlen(replacement); - HDfree(oldstr); + free(oldstr); } return newstr; diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 8a9d806..652dafa 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -65,15 +65,15 @@ parallel_print(const char *format, ...) int bytes_written; va_list ap; - HDva_start(ap, format); + va_start(ap, format); if (!g_Parallel) HDvprintf(format, ap); else { if (overflow_file == NULL) /*no overflow has occurred yet */ { bytes_written = HDvsnprintf(outBuff + outBuffOffset, OUTBUFF_SIZE - outBuffOffset, format, ap); - HDva_end(ap); - HDva_start(ap, format); + va_end(ap); + va_start(ap, format); if ((bytes_written < 0) || ((unsigned)bytes_written >= (OUTBUFF_SIZE - outBuffOffset))) { /* Terminate the outbuff at the end of the previous output */ @@ -81,8 +81,8 @@ parallel_print(const char *format, ...) overflow_file = HDtmpfile(); if (overflow_file == NULL) - HDfprintf(rawerrorstream, - "warning: could not create overflow file. Output may be truncated.\n"); + fprintf(rawerrorstream, + "warning: could not create overflow file. Output may be truncated.\n"); else bytes_written = HDvfprintf(overflow_file, format, ap); } @@ -92,7 +92,7 @@ parallel_print(const char *format, ...) else bytes_written = HDvfprintf(overflow_file, format, ap); } - HDva_end(ap); + va_end(ap); } /*------------------------------------------------------------------------- @@ -109,14 +109,14 @@ error_msg(const char *fmt, ...) { va_list ap; - HDva_start(ap, fmt); + va_start(ap, fmt); FLUSHSTREAM(rawattrstream); FLUSHSTREAM(rawdatastream); FLUSHSTREAM(rawoutstream); - HDfprintf(rawerrorstream, "%s error: ", h5tools_getprogname()); + fprintf(rawerrorstream, "%s error: ", h5tools_getprogname()); HDvfprintf(rawerrorstream, fmt, ap); - HDva_end(ap); + va_end(ap); } /*------------------------------------------------------------------------- @@ -133,13 +133,13 @@ warn_msg(const char *fmt, ...) { va_list ap; - HDva_start(ap, fmt); + va_start(ap, fmt); FLUSHSTREAM(rawattrstream); FLUSHSTREAM(rawdatastream); FLUSHSTREAM(rawoutstream); - HDfprintf(rawerrorstream, "%s warning: ", h5tools_getprogname()); + fprintf(rawerrorstream, "%s warning: ", h5tools_getprogname()); HDvfprintf(rawerrorstream, fmt, ap); - HDva_end(ap); + va_end(ap); } /*------------------------------------------------------------------------- @@ -153,8 +153,8 @@ warn_msg(const char *fmt, ...) void help_ref_msg(FILE *output) { - HDfprintf(output, "Try '-h' or '--help' for more information or "); - HDfprintf(output, "see the <%s> entry in the 'HDF5 Reference Manual'.\n", h5tools_getprogname()); + fprintf(output, "Try '-h' or '--help' for more information or "); + fprintf(output, "see the <%s> entry in the 'HDF5 Reference Manual'.\n", h5tools_getprogname()); } /*------------------------------------------------------------------------- @@ -205,7 +205,7 @@ parse_hsize_list(const char *h_list, subset_d *d) H5TOOLS_DEBUG("Number integers to read=%ld", size_count); /* allocate an array for the integers in the list */ - if ((p_list = (hsize_t *)HDcalloc(size_count, sizeof(hsize_t))) == NULL) + if ((p_list = (hsize_t *)calloc(size_count, sizeof(hsize_t))) == NULL) H5TOOLS_INFO("Unable to allocate space for subset data"); for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) @@ -247,7 +247,7 @@ parse_subset_params(const char *dset) if ((brace = HDstrrchr(q_dset, '[')) != NULL) { *brace++ = '\0'; - s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); + s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); parse_hsize_list(brace, &s->start); while (*brace && *brace != ';') @@ -383,7 +383,7 @@ parse_tuple(const char *start, int sep, char **cpy_out, unsigned *nelems, char * /* create list */ - elems = (char **)HDmalloc(sizeof(char *) * (init_slots + 1)); + elems = (char **)malloc(sizeof(char *) * (init_slots + 1)); if (elems == NULL) { ret_value = FAIL; goto done; @@ -391,8 +391,8 @@ parse_tuple(const char *start, int sep, char **cpy_out, unsigned *nelems, char * /* create destination string */ - start++; /* advance past opening paren '(' */ - cpy = (char *)HDmalloc(sizeof(char) * (HDstrlen(start))); /* no +1; less '(' */ + start++; /* advance past opening paren '(' */ + cpy = (char *)malloc(sizeof(char) * (HDstrlen(start))); /* no +1; less '(' */ if (cpy == NULL) { ret_value = FAIL; goto done; @@ -508,8 +508,8 @@ indentation(unsigned x) PRINTVALSTREAM(rawoutstream, " "); } else { - HDfprintf(rawerrorstream, "error: the indentation exceeds the number of cols.\n"); - HDexit(1); + fprintf(rawerrorstream, "error: the indentation exceeds the number of cols.\n"); + exit(1); } } @@ -541,12 +541,12 @@ print_version(const char *progname) static void init_table(hid_t fid, table_t **tbl) { - table_t *table = (table_t *)HDmalloc(sizeof(table_t)); + table_t *table = (table_t *)malloc(sizeof(table_t)); table->fid = fid; table->size = 20; table->nobjs = 0; - table->objs = (obj_t *)HDmalloc(table->size * sizeof(obj_t)); + table->objs = (obj_t *)malloc(table->size * sizeof(obj_t)); *tbl = table; } @@ -568,10 +568,10 @@ free_table(table_t *table) /* Free the names for the objects in the table */ for (u = 0; u < table->nobjs; u++) if (table->objs[u].objname) - HDfree(table->objs[u].objname); + free(table->objs[u].objname); - HDfree(table->objs); - HDfree(table); + free(table->objs); + free(table); } #ifdef H5DUMP_DEBUG @@ -701,7 +701,7 @@ find_objs_cb(const char *name, const H5O_info2_t *oinfo, const char *already_see add_obj(info->type_table, &oinfo->token, name, TRUE); else { /* Use latest version of name */ - HDfree(found_obj->objname); + free(found_obj->objname); found_obj->objname = HDstrdup(name); /* Mark named datatype as having valid name */ @@ -780,14 +780,14 @@ add_obj(table_t *table, const H5O_token_t *obj_token, const char *objname, hbool /* See if we need to make table larger */ if (table->nobjs == table->size) { table->size *= 2; - table->objs = (struct obj_t *)HDrealloc(table->objs, table->size * sizeof(table->objs[0])); + table->objs = (struct obj_t *)realloc(table->objs, table->size * sizeof(table->objs[0])); } /* end if */ /* Increment number of objects in table */ u = table->nobjs++; /* Set information about object */ - HDmemcpy(&table->objs[u].obj_token, obj_token, sizeof(H5O_token_t)); + memcpy(&table->objs[u].obj_token, obj_token, sizeof(H5O_token_t)); table->objs[u].objname = HDstrdup(objname); table->objs[u].recorded = record; table->objs[u].displayed = 0; @@ -870,7 +870,7 @@ H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t H5TOOLS_GOTO_DONE(2); /* trg_path must be freed out of this function when finished using */ - if ((link_info->trg_path = (char *)HDcalloc(link_info->linfo.u.val_size, sizeof(char))) == NULL) { + if ((link_info->trg_path = (char *)calloc(link_info->linfo.u.val_size, sizeof(char))) == NULL) { if (link_info->opt.msg_mode == 1) parallel_print("Warning: unable to allocate buffer for <%s>\n", linkpath); H5TOOLS_GOTO_DONE(FAIL); @@ -930,7 +930,7 @@ H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t } /* end if */ /* set target obj type to return */ - HDmemcpy(&link_info->obj_token, &trg_oinfo.token, sizeof(H5O_token_t)); + memcpy(&link_info->obj_token, &trg_oinfo.token, sizeof(H5O_token_t)); link_info->trg_type = trg_oinfo.type; link_info->fileno = trg_oinfo.fileno; } /* end if */ @@ -1053,9 +1053,9 @@ h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, H5FD_ros3_fapl_t done: if (s3cred) - HDfree(s3cred); + free(s3cred); if (s3cred_src) - HDfree(s3cred_src); + free(s3cred_src); return ret_value; } @@ -1130,19 +1130,19 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) /* e.g.? if (!populate()) { then failed } */ if (show_progress) { - HDprintf("called h5tools_populate_ros3_fapl\n"); + printf("called h5tools_populate_ros3_fapl\n"); } if (fa == NULL) { if (show_progress) { - HDprintf(" ERROR: null pointer to fapl_t\n"); + printf(" ERROR: null pointer to fapl_t\n"); } ret_value = 0; goto done; } if (show_progress) { - HDprintf(" preset fapl with default values\n"); + printf(" preset fapl with default values\n"); } fa->version = H5FD_CURR_ROS3_FAPL_T_VERSION; fa->authenticate = FALSE; @@ -1155,21 +1155,21 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) if (values != NULL) { if (values[0] == NULL) { if (show_progress) { - HDprintf(" ERROR: aws_region value cannot be NULL\n"); + printf(" ERROR: aws_region value cannot be NULL\n"); } ret_value = 0; goto done; } if (values[1] == NULL) { if (show_progress) { - HDprintf(" ERROR: secret_id value cannot be NULL\n"); + printf(" ERROR: secret_id value cannot be NULL\n"); } ret_value = 0; goto done; } if (values[2] == NULL) { if (show_progress) { - HDprintf(" ERROR: secret_key value cannot be NULL\n"); + printf(" ERROR: secret_key value cannot be NULL\n"); } ret_value = 0; goto done; @@ -1181,48 +1181,48 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) if (*values[0] != '\0' && *values[1] != '\0') { if (HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN) { if (show_progress) { - HDprintf(" ERROR: aws_region value too long\n"); + printf(" ERROR: aws_region value too long\n"); } ret_value = 0; goto done; } - HDmemcpy(fa->aws_region, values[0], (HDstrlen(values[0]) + 1)); + memcpy(fa->aws_region, values[0], (HDstrlen(values[0]) + 1)); if (show_progress) { - HDprintf(" aws_region set\n"); + printf(" aws_region set\n"); } if (HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN) { if (show_progress) { - HDprintf(" ERROR: secret_id value too long\n"); + printf(" ERROR: secret_id value too long\n"); } ret_value = 0; goto done; } - HDmemcpy(fa->secret_id, values[1], (HDstrlen(values[1]) + 1)); + memcpy(fa->secret_id, values[1], (HDstrlen(values[1]) + 1)); if (show_progress) { - HDprintf(" secret_id set\n"); + printf(" secret_id set\n"); } if (HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN) { if (show_progress) { - HDprintf(" ERROR: secret_key value too long\n"); + printf(" ERROR: secret_key value too long\n"); } ret_value = 0; goto done; } - HDmemcpy(fa->secret_key, values[2], (HDstrlen(values[2]) + 1)); + memcpy(fa->secret_key, values[2], (HDstrlen(values[2]) + 1)); if (show_progress) { - HDprintf(" secret_key set\n"); + printf(" secret_key set\n"); } fa->authenticate = TRUE; if (show_progress) { - HDprintf(" set to authenticate\n"); + printf(" set to authenticate\n"); } } else if (*values[0] != '\0' || *values[1] != '\0' || *values[2] != '\0') { if (show_progress) { - HDprintf(" ERROR: invalid assortment of empty/non-empty values\n"); + printf(" ERROR: invalid assortment of empty/non-empty values\n"); } ret_value = 0; goto done; @@ -1291,9 +1291,9 @@ h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int delim, H5FD_hdfs_fapl_t done: if (props) - HDfree(props); + free(props); if (props_src) - HDfree(props_src); + free(props_src); return ret_value; } diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 564dcba..6b3ad0a 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -121,12 +121,12 @@ trav_token_add(trav_addr_t *visited, H5O_token_t *token, const char *path) visited->nalloc = MAX(1, visited->nalloc * 2); ; visited->objs = - (trav_addr_path_t *)HDrealloc(visited->objs, visited->nalloc * sizeof(trav_addr_path_t)); + (trav_addr_path_t *)realloc(visited->objs, visited->nalloc * sizeof(trav_addr_path_t)); } /* end if */ /* Append it */ idx = visited->nused++; - HDmemcpy(&visited->objs[idx].token, token, sizeof(H5O_token_t)); + memcpy(&visited->objs[idx].token, token, sizeof(H5O_token_t)); visited->objs[idx].path = HDstrdup(path); } /* end trav_token_add() */ @@ -178,7 +178,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda size_t new_name_len = base_len + add_slash + HDstrlen(path) + 1 + 3; /* Extra "+3" to quiet GCC warning - 2019/07/05, QAK */ - if (NULL == (new_name = (char *)HDmalloc(new_name_len))) + if (NULL == (new_name = (char *)malloc(new_name_len))) return (H5_ITER_ERROR); if (add_slash) HDsnprintf(new_name, new_name_len, "%s/%s", udata->base_grp_name, path); @@ -196,7 +196,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda /* Get information about the object */ if (H5Oget_info_by_name3(loc_id, path, &oinfo, udata->fields, H5P_DEFAULT) < 0) { if (new_name) - HDfree(new_name); + free(new_name); return (H5_ITER_ERROR); } /* end if */ @@ -211,7 +211,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda if (udata->visitor->visit_obj) if ((*udata->visitor->visit_obj)(full_name, &oinfo, already_visited, udata->visitor->udata) < 0) { if (new_name) - HDfree(new_name); + free(new_name); return (H5_ITER_ERROR); } /* end if */ } /* end if */ @@ -220,13 +220,13 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda if (udata->visitor->visit_lnk) if ((*udata->visitor->visit_lnk)(full_name, linfo, udata->visitor->udata) < 0) { if (new_name) - HDfree(new_name); + free(new_name); return (H5_ITER_ERROR); } /* end if */ } /* end else */ if (new_name) - HDfree(new_name); + free(new_name); return (H5_ITER_CONT); } /* end traverse_cb() */ @@ -296,8 +296,8 @@ traverse(hid_t file_id, const char *grp_name, hbool_t visit_start, hbool_t recur /* Free paths to objects */ for (u = 0; u < seen.nused; u++) - HDfree(seen.objs[u].path); - HDfree(seen.objs); + free(seen.objs[u].path); + free(seen.objs); } /* end if */ } /* end if */ @@ -323,7 +323,7 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type) if (info->nused == info->nalloc) { info->nalloc = MAX(1, info->nalloc * 2); ; - info->paths = (trav_path_t *)HDrealloc(info->paths, info->nalloc * sizeof(trav_path_t)); + info->paths = (trav_path_t *)realloc(info->paths, info->nalloc * sizeof(trav_path_t)); } /* end if */ /* Append it */ @@ -356,7 +356,7 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id) else H5Oget_info3(loc_id, &oinfo, H5O_INFO_BASIC); - HDmemcpy(&info->paths[idx].obj_token, &oinfo.token, sizeof(H5O_token_t)); + memcpy(&info->paths[idx].obj_token, &oinfo.token, sizeof(H5O_token_t)); info->paths[idx].fileno = oinfo.fileno; } /* end trav_fileinfo_add() */ @@ -383,7 +383,7 @@ trav_info_visit_obj(const char *path, const H5O_info2_t *oinfo, const char H5_AT /* set object addr and fileno. These are for checking same object */ info_p = (trav_info_t *)udata; idx = info_p->nused - 1; - HDmemcpy(&info_p->paths[idx].obj_token, &oinfo->token, sizeof(H5O_token_t)); + memcpy(&info_p->paths[idx].obj_token, &oinfo->token, sizeof(H5O_token_t)); info_p->paths[idx].fileno = oinfo->fileno; return (0); @@ -476,7 +476,7 @@ h5trav_getindex(const trav_info_t *info, const char *obj) void trav_info_init(const char *filename, hid_t fileid, trav_info_t **_info) { - trav_info_t *info = (trav_info_t *)HDmalloc(sizeof(trav_info_t)); + trav_info_t *info = (trav_info_t *)malloc(sizeof(trav_info_t)); /* Init info structure */ info->nused = info->nalloc = 0; @@ -507,16 +507,16 @@ trav_info_free(trav_info_t *info) /* Free visited symbolic links path and file (if alloc) */ for (u = 0; u < info->symlink_visited.nused; u++) { if (info->symlink_visited.objs[u].file) - HDfree(info->symlink_visited.objs[u].file); - HDfree(info->symlink_visited.objs[u].path); + free(info->symlink_visited.objs[u].file); + free(info->symlink_visited.objs[u].path); } - HDfree(info->symlink_visited.objs); + free(info->symlink_visited.objs); /* Free path names */ for (u = 0; u < info->nused; u++) - HDfree(info->paths[u].path); - HDfree(info->paths); - HDfree(info); + free(info->paths[u].path); + free(info->paths); + free(info); } /* end if */ } /* end trav_info_free() */ @@ -655,12 +655,12 @@ trav_table_add(trav_table_t *table, const char *path, const H5O_info2_t *oinfo) if (table) { if (table->nobjs == table->size) { table->size = MAX(1, table->size * 2); - table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + table->objs = (trav_obj_t *)realloc(table->objs, table->size * sizeof(trav_obj_t)); } /* end if */ new_obj = table->nobjs++; if (oinfo) - HDmemcpy(&table->objs[new_obj].obj_token, &oinfo->token, sizeof(H5O_token_t)); + memcpy(&table->objs[new_obj].obj_token, &oinfo->token, sizeof(H5O_token_t)); else /* Set token to 'undefined' values */ table->objs[new_obj].obj_token = H5O_TOKEN_UNDEF; @@ -702,7 +702,7 @@ trav_table_addlink(trav_table_t *table, const H5O_token_t *obj_token, const char /* allocate space if necessary */ if (table->objs[i].nlinks == (unsigned)table->objs[i].sizelinks) { table->objs[i].sizelinks = MAX(1, table->objs[i].sizelinks * 2); - table->objs[i].links = (trav_link_t *)HDrealloc( + table->objs[i].links = (trav_link_t *)realloc( table->objs[i].links, table->objs[i].sizelinks * sizeof(trav_link_t)); } /* end if */ @@ -732,7 +732,7 @@ trav_table_addflags(const unsigned *flags, char *name, h5trav_type_t type, trav_ if (table) { if (table->nobjs == table->size) { table->size = MAX(1, table->size * 2); - table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + table->objs = (trav_obj_t *)realloc(table->objs, table->size * sizeof(trav_obj_t)); } /* end if */ new_obj = table->nobjs++; @@ -762,7 +762,7 @@ trav_table_addflags(const unsigned *flags, char *name, h5trav_type_t type, trav_ void trav_table_init(hid_t fid, trav_table_t **tbl) { - trav_table_t *table = (trav_table_t *)HDmalloc(sizeof(trav_table_t)); + trav_table_t *table = (trav_table_t *)malloc(sizeof(trav_table_t)); if (table) { table->fid = fid; table->size = 0; @@ -788,19 +788,19 @@ trav_table_free(trav_table_t *table) unsigned int i; for (i = 0; i < table->nobjs; i++) { - HDfree(table->objs[i].name); + free(table->objs[i].name); if (table->objs[i].nlinks) { unsigned int j; for (j = 0; j < table->objs[i].nlinks; j++) - HDfree(table->objs[i].links[j].new_name); + free(table->objs[i].links[j].new_name); - HDfree(table->objs[i].links); + free(table->objs[i].links); } /* end if */ } /* end for */ - HDfree(table->objs); + free(table->objs); } /* end if */ - HDfree(table); + free(table); } } @@ -816,14 +816,14 @@ trav_attr(hid_t const char *buf = op_data->path; if ((strlen(buf) == 1) && (*buf == '/')) - HDprintf(" %-10s %s%s", "attribute", buf, attr_name); + printf(" %-10s %s%s", "attribute", buf, attr_name); else - HDprintf(" %-10s %s/%s", "attribute", buf, attr_name); + printf(" %-10s %s/%s", "attribute", buf, attr_name); #ifdef H5TRAV_PRINT_SPACE if (trav_verbosity < 2) { #endif - HDprintf("\n"); + printf("\n"); #ifdef H5TRAV_PRINT_SPACE } else { @@ -843,26 +843,26 @@ trav_attr(hid_t switch (space_type) { case H5S_SCALAR: /* scalar dataspace */ - HDprintf(" scalar\n"); + printf(" scalar\n"); break; case H5S_SIMPLE: /* simple dataspace */ - HDprintf(" {"); + printf(" {"); for (i = 0; i < ndims; i++) { - HDprintf("%s%" PRIuHSIZE, i ? ", " : "", size[i]); + printf("%s%" PRIuHSIZE, i ? ", " : "", size[i]); } - HDprintf("}\n"); + printf("}\n"); break; case H5S_NULL: /* null dataspace */ - HDprintf(" null\n"); + printf(" null\n"); break; default: /* Unknown dataspace type */ - HDprintf(" unknown\n"); + printf(" unknown\n"); break; } /* end switch */ @@ -894,22 +894,22 @@ trav_print_visit_obj(const char *path, const H5O_info2_t *oinfo, const char *alr */ switch (oinfo->type) { case H5O_TYPE_GROUP: - HDprintf(" %-10s %s", "group", path); + printf(" %-10s %s", "group", path); break; case H5O_TYPE_DATASET: - HDprintf(" %-10s %s", "dataset", path); + printf(" %-10s %s", "dataset", path); break; case H5O_TYPE_NAMED_DATATYPE: - HDprintf(" %-10s %s", "datatype", path); + printf(" %-10s %s", "datatype", path); break; case H5O_TYPE_MAP: case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: - HDprintf(" %-10s %s", "unknown object type", path); + printf(" %-10s %s", "unknown object type", path); break; } /* end switch */ @@ -919,14 +919,14 @@ trav_print_visit_obj(const char *path, const H5O_info2_t *oinfo, const char *alr op_data.path = path; /* Finish printing line about object */ - HDprintf("\n"); + printf("\n"); if (trav_verbosity > 0) H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, &op_data, H5P_DEFAULT); } else /* Print the link's original name */ - HDprintf(" -> %s\n", already_visited); + printf(" -> %s\n", already_visited); return (0); } /* end trav_print_visit_obj() */ @@ -949,16 +949,16 @@ trav_print_visit_lnk(const char *path, const H5L_info2_t *linfo, void *udata) switch (linfo->type) { case H5L_TYPE_SOFT: if (linfo->u.val_size > 0) { - char *targbuf = (char *)HDmalloc(linfo->u.val_size + 1); + char *targbuf = (char *)malloc(linfo->u.val_size + 1); if (targbuf) { if (H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) targbuf[0] = 0; - HDprintf(" %-10s %s -> %s\n", "link", path, targbuf); - HDfree(targbuf); + printf(" %-10s %s -> %s\n", "link", path, targbuf); + free(targbuf); } } /* end if */ else - HDprintf(" %-10s %s ->\n", "link", path); + printf(" %-10s %s ->\n", "link", path); break; case H5L_TYPE_EXTERNAL: @@ -967,17 +967,17 @@ trav_print_visit_lnk(const char *path, const H5L_info2_t *linfo, void *udata) const char *filename = NULL; const char *objname = NULL; - targbuf = (char *)HDmalloc(linfo->u.val_size + 1); + targbuf = (char *)malloc(linfo->u.val_size + 1); if (targbuf) { if (H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) targbuf[0] = 0; if (H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0) - HDprintf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); - HDfree(targbuf); + printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); + free(targbuf); } } /* end if */ else - HDprintf(" %-10s %s ->\n", "ext link", path); + printf(" %-10s %s ->\n", "ext link", path); break; case H5L_TYPE_HARD: @@ -987,7 +987,7 @@ trav_print_visit_lnk(const char *path, const H5L_info2_t *linfo, void *udata) case H5L_TYPE_ERROR: case H5L_TYPE_MAX: default: - HDprintf(" %-10s %s -> ???\n", "unknown type of UD link", path); + printf(" %-10s %s -> ???\n", "unknown type of UD link", path); break; } /* end switch() */ @@ -1075,7 +1075,7 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co void *tmp_ptr; visited->nalloc = MAX(1, visited->nalloc * 2); - if (NULL == (tmp_ptr = HDrealloc(visited->objs, visited->nalloc * sizeof(symlink_trav_path_t)))) + if (NULL == (tmp_ptr = realloc(visited->objs, visited->nalloc * sizeof(symlink_trav_path_t)))) H5TOOLS_GOTO_ERROR(FAIL, "visited data structure realloc failed"); visited->objs = (symlink_trav_path_t *)tmp_ptr; } /* end if */ @@ -1097,7 +1097,7 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co if (NULL == (visited->objs[idx].path = HDstrdup(path))) { visited->nused--; if (visited->objs[idx].file) - HDfree(visited->objs[idx].file); + free(visited->objs[idx].file); H5TOOLS_GOTO_ERROR(FAIL, "visited data structure path allocation failed"); } /* end if */ diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index 49a4a20..455e28a 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -61,7 +61,7 @@ sub_time(struct timeval *a, struct timeval *b) io_time_t * io_time_new(clock_type type) { - io_time_t *pt = (io_time_t *)HDcalloc(1, sizeof(struct io_time_t)); + io_time_t *pt = (io_time_t *)calloc(1, sizeof(struct io_time_t)); /* set global timer variable */ timer_g = pt; @@ -81,7 +81,7 @@ io_time_new(clock_type type) void io_time_destroy(io_time_t *pt) { - HDfree(pt); + free(pt); /* reset the global timer pointer too. */ timer_g = NULL; } @@ -125,7 +125,7 @@ io_time_t * io_time_set(io_time_t *pt, timer_type t, int start_stop) { /* sanity check */ - HDassert(pt); + assert(pt); switch (pt->type) { #ifdef H5_HAVE_PARALLEL @@ -158,7 +158,7 @@ io_time_set(io_time_t *pt, timer_type t, int start_stop) break; #else case MPI_CLOCK: - HDfprintf(stderr, "MPI clock set in serial library\n"); + fprintf(stderr, "MPI clock set in serial library\n"); return NULL; #endif /* H5_HAVE_PARALLEL */ case SYS_CLOCK: @@ -192,7 +192,7 @@ io_time_set(io_time_t *pt, timer_type t, int start_stop) break; default: - HDfprintf(stderr, "Unknown time clock type (%d)\n", pt->type); + fprintf(stderr, "Unknown time clock type (%d)\n", pt->type); return NULL; } /* end switch */ @@ -214,7 +214,7 @@ H5_ATTR_PURE double io_time_get(io_time_t *pt, timer_type t) { /* sanity check */ - HDassert(pt); + assert(pt); return pt->total_time[t]; } diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index f060e2c..7f49f97 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -100,7 +100,7 @@ H5_GCC_CLANG_DIAG_OFF("format") */ #define JSFAILED_AT() \ { \ - HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \ + printf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \ } /*---------------------------------------------------------------------------- @@ -189,10 +189,10 @@ H5_GCC_CLANG_DIAG_OFF("format") { \ JSFAILED_AT() \ if (reason != NULL) { \ - HDprintf("%s\n", (reason)); \ + printf("%s\n", (reason)); \ } \ else { \ - HDprintf(" ! Expected %ld\n ! Actual %ld\n", (long)(expected), (long)(actual)); \ + printf(" ! Expected %ld\n ! Actual %ld\n", (long)(expected), (long)(actual)); \ } \ } @@ -228,10 +228,10 @@ H5_GCC_CLANG_DIAG_OFF("format") { \ JSFAILED_AT() \ if ((reason) != NULL) { \ - HDprintf("%s\n", (reason)); \ + printf("%s\n", (reason)); \ } \ else { \ - HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", (expected), (actual)); \ + printf("!!! Expected:\n%s\n!!!Actual:\n%s\n", (expected), (actual)); \ } \ } @@ -532,11 +532,11 @@ test_parse_tuple(void) /* SETUP */ - HDassert(parsed == NULL); - HDassert(cpy == NULL); + assert(parsed == NULL); + assert(cpy == NULL); tc = cases[i]; if (show_progress == TRUE) { - HDprintf("testing %d: %s...\n", i, tc.test_msg); + printf("testing %d: %s...\n", i, tc.test_msg); } /* VERIFY @@ -551,11 +551,11 @@ test_parse_tuple(void) JSVERIFY_STR(tc.exp_elems[elem_i], parsed[elem_i], NULL) } /* TEARDOWN */ - HDassert(parsed != NULL); - HDassert(cpy != NULL); - HDfree(parsed); + assert(parsed != NULL); + assert(cpy != NULL); + free(parsed); parsed = NULL; - HDfree(cpy); + free(cpy); cpy = NULL; } else { @@ -573,9 +573,9 @@ error: ***********/ if (parsed != NULL) - HDfree(parsed); + free(parsed); if (cpy != NULL) - HDfree(cpy); + free(cpy); return 1; @@ -616,14 +616,14 @@ test_populate_ros3_fa(void) #ifndef H5_HAVE_ROS3_VFD HDputs(" -SKIP-"); HDputs(" Read-Only S3 VFD not enabled"); - HDfflush(stdout); + fflush(stdout); return 0; #else #if H5TOOLS_UTILS_TEST_DEBUG > 0 show_progress = TRUE; #endif /* H5TOOLS_UTILS_TEST_DEBUG */ - HDassert(bad_version != H5FD_CURR_ROS3_FAPL_T_VERSION); + assert(bad_version != H5FD_CURR_ROS3_FAPL_T_VERSION); /********* * TESTS * @@ -635,7 +635,7 @@ test_populate_ros3_fa(void) const char *values[] = {"x", "y", "z"}; if (show_progress) { - HDprintf("NULL fapl pointer\n"); + printf("NULL fapl pointer\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(NULL, values), "fapl pointer cannot be null") @@ -647,7 +647,7 @@ test_populate_ros3_fa(void) H5FD_ros3_fapl_t fa = {bad_version, TRUE, "u", "v", "w"}; if (show_progress) { - HDprintf("NULL values pointer\n"); + printf("NULL values pointer\n"); } JSVERIFY(1, h5tools_populate_ros3_fapl(&fa, NULL), "NULL values pointer yields \"default\" fapl") @@ -666,7 +666,7 @@ test_populate_ros3_fa(void) const char *values[] = {"", "", ""}; if (show_progress) { - HDprintf("all empty values\n"); + printf("all empty values\n"); } JSVERIFY(1, h5tools_populate_ros3_fapl(&fa, values), "empty values yields \"default\" fapl") @@ -685,7 +685,7 @@ test_populate_ros3_fa(void) const char *values[] = {"x", "y", "z", "a"}; if (show_progress) { - HDprintf("successful full set\n"); + printf("successful full set\n"); } JSVERIFY(1, h5tools_populate_ros3_fapl(&fa, values), "four values") @@ -704,7 +704,7 @@ test_populate_ros3_fa(void) const char *values[] = {NULL, "y", "z", NULL}; if (show_progress) { - HDprintf("NULL region\n"); + printf("NULL region\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") @@ -723,7 +723,7 @@ test_populate_ros3_fa(void) const char *values[] = {"", "y", "z", NULL}; if (show_progress) { - HDprintf("empty region; non-empty id, key\n"); + printf("empty region; non-empty id, key\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") @@ -744,10 +744,10 @@ test_populate_ros3_fa(void) "y", "z"}; if (show_progress) { - HDprintf("region overflow\n"); + printf("region overflow\n"); } - HDassert(HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN); + assert(HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) @@ -765,7 +765,7 @@ test_populate_ros3_fa(void) const char *values[] = {"x", NULL, "z", NULL}; if (show_progress) { - HDprintf("NULL id\n"); + printf("NULL id\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") @@ -784,7 +784,7 @@ test_populate_ros3_fa(void) const char *values[] = {"x", "", "z", NULL}; if (show_progress) { - HDprintf("empty id; non-empty region and key\n"); + printf("empty id; non-empty region and key\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") @@ -814,10 +814,10 @@ test_populate_ros3_fa(void) "z"}; if (show_progress) { - HDprintf("id overflow\n"); + printf("id overflow\n"); } - HDassert(HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN); + assert(HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) @@ -835,7 +835,7 @@ test_populate_ros3_fa(void) const char *values[] = {"x", "y", NULL, NULL}; if (show_progress) { - HDprintf("NULL key\n"); + printf("NULL key\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") @@ -854,7 +854,7 @@ test_populate_ros3_fa(void) const char *values[] = {"x", "y", "", NULL}; if (show_progress) { - HDprintf("empty key; non-empty region and id\n"); + printf("empty key; non-empty region and id\n"); } JSVERIFY(1, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") @@ -873,7 +873,7 @@ test_populate_ros3_fa(void) const char *values[] = {"", "y", "", NULL}; if (show_progress) { - HDprintf("empty key and region; non-empty id\n"); + printf("empty key and region; non-empty id\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") @@ -892,7 +892,7 @@ test_populate_ros3_fa(void) const char *values[] = {"x", "", "", NULL}; if (show_progress) { - HDprintf("empty key and id; non-empty region\n"); + printf("empty key and id; non-empty region\n"); } JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") @@ -921,10 +921,10 @@ test_populate_ros3_fa(void) "Can you separate the various parts of the problem?"}; if (show_progress) { - HDprintf("key overflow\n"); + printf("key overflow\n"); } - HDassert(HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN); + assert(HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) @@ -1134,7 +1134,7 @@ test_set_configured_fapl(void) fapl_id = H5I_INVALID_HID; #if UTIL_TEST_DEBUG - HDfprintf(stderr, "setup test %d\t%s\n", i, C.message); + fprintf(stderr, "setup test %d\t%s\n", i, C.message); fflush(stderr); #endif /* UTIL_TEST_DEBUG */ @@ -1148,7 +1148,7 @@ test_set_configured_fapl(void) } #if UTIL_TEST_DEBUG - HDfprintf(stderr, "before test\n"); + fprintf(stderr, "before test\n"); fflush(stderr); #endif /* UTIL_TEST_DEBUG */ @@ -1165,7 +1165,7 @@ test_set_configured_fapl(void) } #if UTIL_TEST_DEBUG - HDfprintf(stderr, "after test\n"); + fprintf(stderr, "after test\n"); fflush(stderr); #endif /* UTIL_TEST_DEBUG */ @@ -1176,13 +1176,13 @@ test_set_configured_fapl(void) fapl_id = H5I_INVALID_HID; #if UTIL_TEST_DEBUG - HDfprintf(stderr, "after cleanup\n"); + fprintf(stderr, "after cleanup\n"); fflush(stderr); #endif /* UTIL_TEST_DEBUG */ } #if UTIL_TEST_DEBUG - HDfprintf(stderr, "after loop\n"); + fprintf(stderr, "after loop\n"); fflush(stderr); #endif /* UTIL_TEST_DEBUG */ @@ -1195,7 +1195,7 @@ error: ***********/ #if UTIL_TEST_DEBUG - HDfprintf(stderr, "ERROR\n"); + fprintf(stderr, "ERROR\n"); fflush(stderr); #endif /* UTIL_TEST_DEBUG */ @@ -1234,18 +1234,18 @@ main(void) h5reset(); /* h5test? */ #endif /* _H5TEST_ */ - HDfprintf(stdout, "Testing h5tools_utils corpus.\n"); + fprintf(stdout, "Testing h5tools_utils corpus.\n"); nerrors += test_parse_tuple(); nerrors += test_populate_ros3_fa(); nerrors += test_set_configured_fapl(); if (nerrors > 0) { - HDfprintf(stdout, "***** %d h5tools_utils TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : ""); + fprintf(stdout, "***** %d h5tools_utils TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : ""); nerrors = 1; } else { - HDfprintf(stdout, "All h5tools_utils tests passed\n"); + fprintf(stdout, "All h5tools_utils tests passed\n"); } return (int)nerrors; diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 9756d11..2deba02 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -52,18 +52,18 @@ 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); + exit(ret); } /*------------------------------------------------------------------------- @@ -226,7 +226,7 @@ main(int argc, char *argv[]) h5tools_init(); /* init linkinfo struct */ - HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); + memset(&linkinfo, 0, sizeof(h5tool_link_info_t)); /* Check for no command line parameters */ if (argc == 1) { @@ -282,7 +282,7 @@ main(int argc, char *argv[]) case 'E': if (H5_optarg != NULL) - enable_error_stack = HDatoi(H5_optarg); + enable_error_stack = atoi(H5_optarg); else enable_error_stack = 1; break; @@ -369,10 +369,10 @@ main(int argc, char *argv[]) *-------------------------------------------------------------------------*/ if (verbose) { - HDprintf("Copying file <%s> and object <%s> to file <%s> and object <%s>\n", fname_src, oname_src, - fname_dst, oname_dst); + printf("Copying file <%s> and object <%s> to file <%s> and object <%s>\n", fname_src, oname_src, + fname_dst, oname_dst); if (flag) { - HDprintf("Using %s flag\n", str_flag); + printf("Using %s flag\n", str_flag); } } @@ -406,7 +406,7 @@ main(int argc, char *argv[]) /* Display some output if requested */ if (verbose) - HDprintf("%s: Creating parent groups\n", h5tools_getprogname()); + printf("%s: Creating parent groups\n", h5tools_getprogname()); } /* end if */ else { /* error, if parent groups doesn't already exist in destination file */ @@ -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) @@ -475,11 +475,11 @@ main(int argc, char *argv[]) leave(EXIT_SUCCESS); done: - HDprintf("Error in copy...Exiting\n"); + printf("Error in copy...Exiting\n"); /* 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 a2fe5d9..51bc050 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -95,11 +95,11 @@ check_options(diff_opt_t *opts) * These options are mutually exclusive. */ if ((opts->delta_bool + opts->percent_bool + opts->use_system_epsilon) > 1) { - HDprintf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME); - HDprintf("use no more than one.\n"); - HDprintf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 " - "Reference Manual'.\n", - PROGRAMNAME); + printf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME); + printf("use no more than one.\n"); + printf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 " + "Reference Manual'.\n", + PROGRAMNAME); h5diff_exit(EXIT_FAILURE); } } @@ -122,7 +122,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const H5TOOLS_START_DEBUG(" "); /* process the command-line */ - HDmemset(opts, 0, sizeof(diff_opt_t)); + memset(opts, 0, sizeof(diff_opt_t)); /* assume equal contents initially */ opts->contents = 1; @@ -181,7 +181,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const } else { if (H5_optarg != NULL) - opts->mode_verbose_level = HDatoi(H5_optarg); + opts->mode_verbose_level = atoi(H5_optarg); else opts->mode_verbose_level = 0; } @@ -207,7 +207,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const case 'S': if (H5_optarg != NULL) - enable_error_stack = HDatoi(H5_optarg); + enable_error_stack = atoi(H5_optarg); else enable_error_stack = 1; break; @@ -216,9 +216,9 @@ 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) { - HDprintf("Error: lack of memory!\n"); + printf("Error: lack of memory!\n"); h5diff_exit(EXIT_FAILURE); } @@ -249,8 +249,8 @@ 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) { - HDprintf("Error: lack of memory!\n"); + (struct exclude_path_list *)malloc(sizeof(struct exclude_path_list))) == NULL) { + printf("Error: lack of memory!\n"); h5diff_exit(EXIT_FAILURE); } @@ -276,7 +276,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const opts->delta_bool = 1; if (check_d_input(H5_optarg) == -1) { - HDprintf("<-d %s> is not a valid option\n", H5_optarg); + printf("<-d %s> is not a valid option\n", H5_optarg); usage(); h5diff_exit(EXIT_FAILURE); } @@ -287,7 +287,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const case 'p': opts->percent_bool = 1; if (check_p_input(H5_optarg) == -1) { - HDprintf("<-p %s> is not a valid option\n", H5_optarg); + printf("<-p %s> is not a valid option\n", H5_optarg); usage(); h5diff_exit(EXIT_FAILURE); } @@ -301,7 +301,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const case 'n': opts->count_bool = 1; if (check_n_input(H5_optarg) == -1) { - HDprintf("<-n %s> is not a valid option\n", H5_optarg); + printf("<-n %s> is not a valid option\n", H5_optarg); usage(); h5diff_exit(EXIT_FAILURE); } @@ -322,7 +322,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const case '1': opts->vol_info[0].type = VOL_BY_VALUE; - opts->vol_info[0].u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + opts->vol_info[0].u.value = (H5VL_class_value_t)atoi(H5_optarg); opts->custom_vol[0] = TRUE; break; @@ -338,7 +338,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const case '4': opts->vol_info[1].type = VOL_BY_VALUE; - opts->vol_info[1].u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + opts->vol_info[1].u.value = (H5VL_class_value_t)atoi(H5_optarg); opts->custom_vol[1] = TRUE; break; @@ -354,7 +354,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const case '7': opts->vfd_info[0].type = VFD_BY_VALUE; - opts->vfd_info[0].u.value = (H5FD_class_value_t)HDatoi(H5_optarg); + opts->vfd_info[0].u.value = (H5FD_class_value_t)atoi(H5_optarg); opts->custom_vfd[0] = TRUE; break; @@ -370,7 +370,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const case '0': opts->vfd_info[1].type = VFD_BY_VALUE; - opts->vfd_info[1].u.value = (H5FD_class_value_t)HDatoi(H5_optarg); + opts->vfd_info[1].u.value = (H5FD_class_value_t)atoi(H5_optarg); opts->custom_vfd[1] = TRUE; break; @@ -392,7 +392,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const errno = 0; onion_fa_g_1.revision_num = HDstrtoull(opts->vfd_info[0].info, NULL, 10); if (errno == ERANGE) { - HDprintf("Invalid onion revision specified for file 1\n"); + printf("Invalid onion revision specified for file 1\n"); usage(); h5diff_exit(EXIT_FAILURE); } @@ -409,7 +409,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const errno = 0; onion_fa_g_2.revision_num = HDstrtoull(opts->vfd_info[1].info, NULL, 10); if (errno == ERANGE) { - HDprintf("Invalid onion revision specified for file 2\n"); + printf("Invalid onion revision specified for file 2\n"); usage(); h5diff_exit(EXIT_FAILURE); } @@ -480,20 +480,20 @@ print_info(diff_opt_t *opts) return; if (opts->cmn_objs == 0) { - HDprintf("No common objects found. Files are not comparable.\n"); + printf("No common objects found. Files are not comparable.\n"); if (!opts->mode_verbose) - HDprintf("Use -v for a list of objects.\n"); + printf("Use -v for a list of objects.\n"); } if (opts->not_cmp == 1) { if (opts->mode_list_not_cmp == 0) { - HDprintf("--------------------------------\n"); - HDprintf("Some objects are not comparable\n"); - HDprintf("--------------------------------\n"); + printf("--------------------------------\n"); + printf("Some objects are not comparable\n"); + printf("--------------------------------\n"); if (opts->mode_verbose) - HDprintf("Use -c for a list of objects without details of differences.\n"); + printf("Use -c for a list of objects without details of differences.\n"); else - HDprintf("Use -c for a list of objects.\n"); + printf("Use -c for a list of objects.\n"); } } } diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index 561f139..f2ab2f9 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; } } @@ -124,5 +124,5 @@ h5diff_exit(int status) { h5tools_close(); - HDexit(status); + exit(status); } diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index 64b1f28..82cb876 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -67,7 +67,7 @@ main(int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &g_nTasks); if (g_nTasks == 1) { - HDprintf("Only 1 task available...doing serial diff\n"); + printf("Only 1 task available...doing serial diff\n"); g_Parallel = 0; @@ -141,11 +141,11 @@ ph5diff_worker(int nID) { /* Open the files */ if ((file1_id = H5Fopen(filenames[0], H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) { - HDprintf("h5diff Task [%d]: <%s>: unable to open file\n", nID, filenames[0]); + printf("h5diff Task [%d]: <%s>: unable to open file\n", nID, filenames[0]); MPI_Abort(MPI_COMM_WORLD, 0); } if ((file2_id = H5Fopen(filenames[1], H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) { - HDprintf("h5diff Task [%d]: <%s>: unable to open file\n", nID, filenames[1]); + printf("h5diff Task [%d]: <%s>: unable to open file\n", nID, filenames[1]); MPI_Abort(MPI_COMM_WORLD, 0); } /* enable error reporting */ @@ -160,7 +160,7 @@ ph5diff_worker(int nID) /* Make certain we've received the filenames and opened the files already */ if (file1_id < 0 || file2_id < 0) { - HDprintf("ph5diff_worker: ERROR: work received before/without filenames\n"); + printf("ph5diff_worker: ERROR: work received before/without filenames\n"); break; } @@ -188,7 +188,7 @@ ph5diff_worker(int nID) char out_data[PRINT_DATA_MAX_SIZE]; int tmp; - HDmemset(out_data, 0, PRINT_DATA_MAX_SIZE); + memset(out_data, 0, PRINT_DATA_MAX_SIZE); i = 0; rewind(overflow_file); @@ -198,7 +198,7 @@ ph5diff_worker(int nID) MPI_Send(out_data, PRINT_DATA_MAX_SIZE, MPI_BYTE, 0, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD); i = 0; - HDmemset(out_data, 0, PRINT_DATA_MAX_SIZE); + memset(out_data, 0, PRINT_DATA_MAX_SIZE); } } @@ -210,8 +210,8 @@ ph5diff_worker(int nID) overflow_file = NULL; } - HDfflush(stdout); - HDmemset(outBuff, 0, OUTBUFF_SIZE); + fflush(stdout); + memset(outBuff, 0, OUTBUFF_SIZE); outBuffOffset = 0; MPI_Send(&diffs, sizeof(diffs), MPI_BYTE, 0, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD); @@ -225,7 +225,7 @@ ph5diff_worker(int nID) break; } else { - HDprintf("ph5diff_worker: ERROR: invalid tag (%d) received\n", Status.MPI_TAG); + printf("ph5diff_worker: ERROR: invalid tag (%d) received\n", Status.MPI_TAG); break; } } @@ -252,7 +252,7 @@ print_manager_output(void) { /* If there was something we buffered, let's print it now */ if ((outBuffOffset > 0) && g_Parallel) { - HDprintf("%s", outBuff); + printf("%s", outBuff); if (overflow_file) { int tmp; @@ -263,12 +263,12 @@ print_manager_output(void) overflow_file = NULL; } - HDfflush(stdout); - HDmemset(outBuff, 0, OUTBUFF_SIZE); + fflush(stdout); + memset(outBuff, 0, OUTBUFF_SIZE); outBuffOffset = 0; } else if ((outBuffOffset > 0) && !g_Parallel) { - HDfprintf(stderr, "h5diff error: outBuffOffset>0, but we're not in parallel!\n"); + fprintf(stderr, "h5diff error: outBuffOffset>0, but we're not in parallel!\n"); } } @@ -303,5 +303,5 @@ h5diff_exit(int status) /* Always exit(0), since MPI implementations do weird stuff when they * receive a non-zero exit value. - QAK */ - HDexit(status); + exit(status); } diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 2a5eeb7..73309cd 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -159,7 +159,7 @@ leave(int ret) { h5tools_close(); - HDexit(ret); + exit(ret); } /*------------------------------------------------------------------------- @@ -408,7 +408,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; @@ -485,7 +485,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() */ @@ -587,7 +587,7 @@ parse_mask_list(const char *h_list) /* sanity check */ if (h_list) { - HDmemset(packed_mask, 0, sizeof(packed_mask)); + memset(packed_mask, 0, sizeof(packed_mask)); packed_bits_num = 0; /* scan in pair of offset,length separated by commas. */ @@ -598,7 +598,7 @@ parse_mask_list(const char *h_list) error_msg("Bad mask list(%s)\n", h_list); return FAIL; } - soffset_value = HDatoi(ptr); + soffset_value = atoi(ptr); offset_value = (unsigned)soffset_value; if (soffset_value < 0 || offset_value >= PACKED_BITS_SIZE_MAX) { error_msg("Packed Bit offset value(%d) must be between 0 and %u\n", soffset_value, @@ -620,7 +620,7 @@ parse_mask_list(const char *h_list) error_msg("Bad mask list(%s)\n", h_list); return FAIL; } - slength_value = HDatoi(ptr); + slength_value = atoi(ptr); if (slength_value <= 0) { error_msg("Packed Bit length value(%d) must be positive.\n", slength_value); return FAIL; @@ -700,26 +700,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); } } @@ -750,7 +750,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; } @@ -770,7 +770,7 @@ parse_start: dump_opts.display_fi = TRUE; last_was_dset = FALSE; if (H5_optarg != NULL) - h5trav_set_verbose(HDatoi(H5_optarg)); + h5trav_set_verbose(atoi(H5_optarg)); break; case 'p': dump_opts.display_dcpl = TRUE; @@ -788,7 +788,7 @@ parse_start: break; case 'A': if (H5_optarg != NULL) { - if (0 == HDatoi(H5_optarg)) + if (0 == atoi(H5_optarg)) dump_opts.include_attrs = FALSE; } else { @@ -812,7 +812,7 @@ parse_start: goto done; break; case 'w': { - int sh5tools_nCols = HDatoi(H5_optarg); + int sh5tools_nCols = atoi(H5_optarg); if (sh5tools_nCols <= 0) h5tools_nCols = 65535; @@ -998,7 +998,7 @@ parse_start: dump_opts.display_vds_first = TRUE; break; case 'G': - dump_opts.vds_gap_size = HDatoi(H5_optarg); + dump_opts.vds_gap_size = atoi(H5_optarg); if (dump_opts.vds_gap_size < 0) { usage(h5tools_getprogname()); goto error; @@ -1070,7 +1070,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)); } /* @@ -1088,28 +1088,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); @@ -1131,7 +1131,7 @@ end_collect: case 'E': if (H5_optarg != NULL) - enable_error_stack = HDatoi(H5_optarg); + enable_error_stack = atoi(H5_optarg); else enable_error_stack = 1; break; @@ -1185,7 +1185,7 @@ end_collect: case '1': vol_info_g.type = VOL_BY_VALUE; - vol_info_g.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + vol_info_g.u.value = (H5VL_class_value_t)atoi(H5_optarg); use_custom_vol_g = TRUE; break; @@ -1201,7 +1201,7 @@ end_collect: case '4': vfd_info_g.type = VFD_BY_VALUE; - vfd_info_g.u.value = (H5FD_class_value_t)HDatoi(H5_optarg); + vfd_info_g.u.value = (H5FD_class_value_t)atoi(H5_optarg); use_custom_vfd_g = TRUE; break; @@ -1232,11 +1232,11 @@ end_collect: errno = 0; onion_fa_g.revision_num = HDstrtoull(vfd_info_g.info, NULL, 10); if (errno == ERANGE) { - HDprintf("Invalid onion revision specified\n"); + printf("Invalid onion revision specified\n"); goto error; } - HDprintf("Using revision %" PRIu64 "\n", onion_fa_g.revision_num); + printf("Using revision %" PRIu64 "\n", onion_fa_g.revision_num); } } else @@ -1374,7 +1374,7 @@ main(int argc, char *argv[]) goto done; } - HDprintf("The number of revisions for the onion file is %" PRIu64 "\n", revision_count); + printf("The number of revisions for the onion file is %" PRIu64 "\n", revision_count); goto done; } else @@ -1473,7 +1473,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 { @@ -1546,11 +1546,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 */ @@ -1576,11 +1576,11 @@ done: h5tools_setstatus(EXIT_FAILURE); if (prefix) { - HDfree(prefix); + free(prefix); prefix = NULL; } if (fname) { - HDfree(fname); + free(fname); fname = NULL; } @@ -1605,7 +1605,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"); } @@ -1627,7 +1627,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 3eaa2f9..a69aeac 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -48,7 +48,7 @@ dump_datatype(hid_t type) h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &h5tools_dataformat; - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -72,7 +72,7 @@ dump_dataspace(hid_t space) h5tools_context_t ctx; /* print context */ h5tool_format_t *outputformat = &h5tools_dataformat; - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -99,7 +99,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * hid_t attr_id; herr_t ret = SUCCEED; - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; ctx.display_index = dump_opts.display_ai; @@ -163,9 +163,9 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT hsize_t curr_pos = 0; /* total data element position */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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; } @@ -634,9 +634,9 @@ dump_named_datatype(hid_t tid, const char *name) h5tool_format_t string_dataformat; /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -790,9 +790,9 @@ dump_group(hid_t gid, const char *name) } /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -925,7 +925,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) h5tools_str_t buffer; /* string into which to render */ hsize_t curr_pos = 0; /* total data element position */ - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -958,7 +958,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) } /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1112,7 +1112,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; ctx.sset = sset; @@ -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; @@ -1344,7 +1344,7 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a else { size_t buffer_space = w - 1; - HDmemset(obj_name, '\0', w); + memset(obj_name, '\0', w); if (op_name[0] != '/') { HDstrncat(obj_name, buf, buffer_space); buffer_space -= MIN(buffer_space, u); @@ -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; @@ -1554,7 +1554,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 } /* end else */ dump_indent += COL; - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; ctx.display_index = dump_opts.display_ai; @@ -1582,7 +1582,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 /* handle error case: cannot open the object with the attribute */ if ((oid = H5Oopen(fid, obj_name, H5P_DEFAULT)) < 0) { /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); ctx.need_prefix = TRUE; @@ -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 d0bc7e4..6d3f6c8 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -141,9 +141,9 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 hsize_t curr_pos = 0; /* total data element position */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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; /* ?? */ @@ -877,9 +877,9 @@ xml_print_datatype(hid_t type, unsigned in_group) hsize_t curr_pos = 0; /* total data element position */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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++; @@ -1575,9 +1575,9 @@ xml_dump_datatype(hid_t type) hsize_t curr_pos = 0; /* total data element position */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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; @@ -1710,9 +1710,9 @@ xml_dump_dataspace(hid_t space) H5S_class_t space_type = H5Sget_simple_extent_type(space); /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -1881,13 +1881,13 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED *sset, h5tool_format_t *outputformat = &xml_dataformat; h5tool_format_t string_dataformat; - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; /* Print all the values. */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); string_dataformat = *outputformat; @@ -1941,7 +1941,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED *sset, status = xml_print_strs(obj_id, DATASET_DATA); else { h5tools_context_t datactx; - HDmemset(&datactx, 0, sizeof(datactx)); + memset(&datactx, 0, sizeof(datactx)); datactx.need_prefix = TRUE; datactx.indent_level = ctx.indent_level; datactx.cur_column = ctx.cur_column; @@ -1971,7 +1971,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED *sset, } else { h5tools_context_t datactx; - HDmemset(&datactx, 0, sizeof(datactx)); + memset(&datactx, 0, sizeof(datactx)); datactx.need_prefix = TRUE; datactx.indent_level = ctx.indent_level; datactx.cur_column = ctx.cur_column; @@ -2051,9 +2051,9 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED char *t_aname = xml_escape_the_name(attr_name); /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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__); @@ -2383,9 +2383,9 @@ xml_dump_named_datatype(hid_t type, const char *name) HDstrcat(tmp, name); /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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); } /*------------------------------------------------------------------------- @@ -2603,9 +2603,9 @@ xml_dump_group(hid_t gid, const char *name) } /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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); @@ -3008,9 +3008,9 @@ xml_print_refs(hid_t did, int source) refbuf = (H5R_ref_t *)((void *)buf); /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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,15 +3159,15 @@ 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; } /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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 { @@ -3281,9 +3281,9 @@ check_filters(hid_t dcpl) hsize_t curr_pos = 0; /* total data element position */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -3422,9 +3422,9 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) hsize_t curr_pos = 0; /* total data element position */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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; } @@ -3799,9 +3799,9 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss HDstrcat(tmp, name); /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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)) { @@ -4391,9 +4391,9 @@ xml_print_enum(hid_t type) hsize_t curr_pos = 0; /* total data element position */ /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&buffer, 0, sizeof(h5tools_str_t)); - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; @@ -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; @@ -4527,13 +4527,13 @@ xml_print_enum(hid_t type) else if (H5T_SGN_NONE == H5Tget_sign(native)) { unsigned long long copy; - HDmemcpy(©, value + i * dst_size, sizeof(copy)); + memcpy(©, value + i * dst_size, sizeof(copy)); h5tools_str_append(&buffer, "%llu", copy); } else { long long copy; - HDmemcpy(©, value + i * dst_size, sizeof(copy)); + memcpy(©, value + i * dst_size, sizeof(copy)); h5tools_str_append(&buffer, "%lld", copy); } h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, @@ -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 200f735..87e9acb 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -55,31 +55,31 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"version", static void usage(const char *prog) { - HDfprintf(stdout, "usage: %s [OPTIONS] file_name\n", prog); - HDfprintf(stdout, " OPTIONS\n"); - HDfprintf(stdout, " -h, --help Print a usage message and exit\n"); - HDfprintf(stdout, " -V, --version Print version number and exit\n"); - HDfprintf(stdout, " -v, --verbose Turn on verbose mode\n"); - HDfprintf(stdout, " -d dname, --dname=dataset_name Pathname for the dataset\n"); - HDfprintf(stdout, " -n, --noop Perform all the steps except the actual conversion\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "Examples of use:\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "h5format_convert -d /group/dataset file_name\n"); - HDfprintf(stdout, " Convert the dataset </group/dataset> in the HDF5 file <file_name>:\n"); - HDfprintf(stdout, " a. chunked dataset: convert the chunk indexing type to version 1 B-tree\n"); - HDfprintf(stdout, " b. compact/contiguous dataset: downgrade the layout version to 3\n"); - HDfprintf(stdout, " c. virtual dataset: no action\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "h5format_convert file_name\n"); - HDfprintf(stdout, " Convert all datasets in the HDF5 file <file_name>:\n"); - HDfprintf(stdout, " a. chunked dataset: convert the chunk indexing type to version 1 B-tree\n"); - HDfprintf(stdout, " b. compact/contiguous dataset: downgrade the layout version to 3\n"); - HDfprintf(stdout, " c. virtual dataset: no action\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "h5format_convert -n -d /group/dataset file_name\n"); - HDfprintf(stdout, " Go through all the steps except the actual conversion when \n"); - HDfprintf(stdout, " converting the dataset </group/dataset> in the HDF5 file <file_name>.\n"); + fprintf(stdout, "usage: %s [OPTIONS] file_name\n", prog); + fprintf(stdout, " OPTIONS\n"); + fprintf(stdout, " -h, --help Print a usage message and exit\n"); + fprintf(stdout, " -V, --version Print version number and exit\n"); + fprintf(stdout, " -v, --verbose Turn on verbose mode\n"); + fprintf(stdout, " -d dname, --dname=dataset_name Pathname for the dataset\n"); + fprintf(stdout, " -n, --noop Perform all the steps except the actual conversion\n"); + fprintf(stdout, "\n"); + fprintf(stdout, "Examples of use:\n"); + fprintf(stdout, "\n"); + fprintf(stdout, "h5format_convert -d /group/dataset file_name\n"); + fprintf(stdout, " Convert the dataset </group/dataset> in the HDF5 file <file_name>:\n"); + fprintf(stdout, " a. chunked dataset: convert the chunk indexing type to version 1 B-tree\n"); + fprintf(stdout, " b. compact/contiguous dataset: downgrade the layout version to 3\n"); + fprintf(stdout, " c. virtual dataset: no action\n"); + fprintf(stdout, "\n"); + fprintf(stdout, "h5format_convert file_name\n"); + fprintf(stdout, " Convert all datasets in the HDF5 file <file_name>:\n"); + fprintf(stdout, " a. chunked dataset: convert the chunk indexing type to version 1 B-tree\n"); + fprintf(stdout, " b. compact/contiguous dataset: downgrade the layout version to 3\n"); + fprintf(stdout, " c. virtual dataset: no action\n"); + fprintf(stdout, "\n"); + fprintf(stdout, "h5format_convert -n -d /group/dataset file_name\n"); + fprintf(stdout, " Go through all the steps except the actual conversion when \n"); + fprintf(stdout, " converting the dataset </group/dataset> in the HDF5 file <file_name>.\n"); } /* usage() */ /*------------------------------------------------------------------------- @@ -179,7 +179,7 @@ leave(int ret) { h5tools_close(); - HDexit(ret); + exit(ret); } /* leave() */ /*------------------------------------------------------------------------- @@ -215,7 +215,7 @@ convert(hid_t fid, const char *dname) goto error; } else if (verbose_g) - HDfprintf(stdout, "Open the dataset\n"); + fprintf(stdout, "Open the dataset\n"); /* Get the dataset's creation property list */ if ((dcpl = H5Dget_create_plist(did)) < 0) { @@ -231,12 +231,12 @@ convert(hid_t fid, const char *dname) goto error; } else if (verbose_g) - HDfprintf(stdout, "Retrieve the dataset's layout\n"); + fprintf(stdout, "Retrieve the dataset's layout\n"); switch (layout_type) { case H5D_CHUNKED: if (verbose_g) - HDfprintf(stdout, "Dataset is a chunked dataset\n"); + fprintf(stdout, "Dataset is a chunked dataset\n"); /* Get the dataset's chunk indexing type */ if (H5Dget_chunk_index_type(did, &idx_type) < 0) { @@ -245,34 +245,33 @@ convert(hid_t fid, const char *dname) goto error; } else if (verbose_g) - HDfprintf(stdout, "Retrieve the dataset's chunk indexing type\n"); + fprintf(stdout, "Retrieve the dataset's chunk indexing type\n"); if (idx_type == H5D_CHUNK_IDX_BTREE) { if (verbose_g) - HDfprintf( - stdout, - "Dataset's chunk indexing type is already version 1 B-tree: no further action\n"); + fprintf(stdout, + "Dataset's chunk indexing type is already version 1 B-tree: no further action\n"); h5tools_setstatus(EXIT_SUCCESS); goto done; } else if (verbose_g) - HDfprintf(stdout, "Dataset's chunk indexing type is not version 1 B-tree\n"); + fprintf(stdout, "Dataset's chunk indexing type is not version 1 B-tree\n"); break; case H5D_CONTIGUOUS: if (verbose_g) - HDfprintf(stdout, "Dataset is a contiguous dataset: downgrade layout version as needed\n"); + fprintf(stdout, "Dataset is a contiguous dataset: downgrade layout version as needed\n"); break; case H5D_COMPACT: if (verbose_g) - HDfprintf(stdout, "Dataset is a compact dataset: downgrade layout version as needed\n"); + fprintf(stdout, "Dataset is a compact dataset: downgrade layout version as needed\n"); break; case H5D_VIRTUAL: if (verbose_g) - HDfprintf(stdout, "No further action for virtual dataset\n"); + fprintf(stdout, "No further action for virtual dataset\n"); goto done; case H5D_NLAYOUTS: @@ -287,13 +286,13 @@ convert(hid_t fid, const char *dname) /* No further action if it is a noop */ if (noop_g) { if (verbose_g) - HDfprintf(stdout, "Not converting the dataset\n"); + fprintf(stdout, "Not converting the dataset\n"); h5tools_setstatus(EXIT_SUCCESS); goto done; } if (verbose_g) - HDfprintf(stdout, "Converting the dataset...\n"); + fprintf(stdout, "Converting the dataset...\n"); /* Downgrade the dataset */ if (H5Dformat_convert(did) < 0) { @@ -302,7 +301,7 @@ convert(hid_t fid, const char *dname) goto error; } else if (verbose_g) - HDfprintf(stdout, "Done\n"); + fprintf(stdout, "Done\n"); done: /* Close the dataset */ @@ -312,7 +311,7 @@ done: goto error; } else if (verbose_g) - HDfprintf(stdout, "Close the dataset\n"); + fprintf(stdout, "Close the dataset\n"); /* Close the dataset creation property list */ if (H5Pclose(dcpl) < 0) { @@ -321,13 +320,13 @@ done: goto error; } else if (verbose_g) - HDprintf("Close the dataset creation property list\n"); + printf("Close the dataset creation property list\n"); return 0; error: if (verbose_g) - HDfprintf(stdout, "Error encountered\n"); + fprintf(stdout, "Error encountered\n"); H5E_BEGIN_TRY { @@ -358,7 +357,7 @@ convert_dsets_cb(const char *path, const H5O_info2_t *oi, const char *already_vi if (NULL == already_visited) { if (oi->type == H5O_TYPE_DATASET) { if (verbose_g) - HDfprintf(stdout, "Going to process dataset:%s...\n", path); + fprintf(stdout, "Going to process dataset:%s...\n", path); if (convert(fid, path) < 0) goto error; } /* end if */ @@ -396,10 +395,10 @@ main(int argc, char *argv[]) if (parse_command_line(argc, (const char *const *)argv) < 0) goto done; else if (verbose_g) - HDfprintf(stdout, "Process command line options\n"); + fprintf(stdout, "Process command line options\n"); if (noop_g && verbose_g) - HDfprintf(stdout, "It is noop...\n"); + fprintf(stdout, "It is noop...\n"); /* enable error reporting if command line option */ h5tools_error_report(); @@ -411,28 +410,28 @@ main(int argc, char *argv[]) goto done; } else if (verbose_g) - HDfprintf(stdout, "Open the file %s\n", fname_g); + fprintf(stdout, "Open the file %s\n", fname_g); if (dset_g) { /* Convert a specified dataset in the file */ if (verbose_g) - HDfprintf(stdout, "Going to process dataset: %s...\n", dname_g); + fprintf(stdout, "Going to process dataset: %s...\n", dname_g); if (convert(fid, dname_g) < 0) goto done; } else { /* Convert all datasets in the file */ if (verbose_g) - HDfprintf(stdout, "Processing all datasets in the file...\n"); + fprintf(stdout, "Processing all datasets in the file...\n"); if (h5trav_visit(fid, "/", TRUE, TRUE, convert_dsets_cb, NULL, &fid, H5O_INFO_BASIC) < 0) goto done; } /* end else */ if (verbose_g) { if (noop_g) { - HDfprintf(stdout, "Not processing the file's superblock...\n"); + fprintf(stdout, "Not processing the file's superblock...\n"); h5tools_setstatus(EXIT_SUCCESS); goto done; } /* end if */ - HDfprintf(stdout, "Processing the file's superblock...\n"); + fprintf(stdout, "Processing the file's superblock...\n"); } /* end if */ /* Process superblock */ @@ -450,14 +449,14 @@ done: h5tools_setstatus(EXIT_FAILURE); } else if (verbose_g) { - HDfprintf(stdout, "Close the file\n"); + fprintf(stdout, "Close the file\n"); } } /* 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 5a2fae3..b7d18a1 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -101,19 +101,19 @@ 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)) { print_version(PROGRAMNAME); - HDexit(EXIT_SUCCESS); + exit(EXIT_SUCCESS); } /* * validate the number of command line arguments */ if (argc < 2) { - (void)HDfprintf(stderr, err1, argc); + (void)fprintf(stderr, err1, argc); usage(argv[0]); goto err; } @@ -140,7 +140,7 @@ main(int argc, char *argv[]) opt->fcount++; } else { - (void)HDfprintf(stderr, err9, argv[i]); + (void)fprintf(stderr, err9, argv[i]); goto err; } @@ -159,7 +159,7 @@ main(int argc, char *argv[]) case 5: /* get outfile found */ if (HDstrlen(argv[i]) > MAX_PATH_NAME_LENGTH) { - (void)HDfprintf(stderr, err10, argv[i]); + (void)fprintf(stderr, err10, argv[i]); goto err; } (void)HDstrcpy(opt->outfile, argv[i]); @@ -168,7 +168,7 @@ main(int argc, char *argv[]) case 6: /* -h found; help, then exit */ help(argv[0]); - HDexit(EXIT_SUCCESS); + exit(EXIT_SUCCESS); break; case 7: /* -d found; look for dimensions */ @@ -176,7 +176,7 @@ main(int argc, char *argv[]) case 8: /* read dimensions */ if (parseDimensions(in, argv[i]) == -1) { - (void)HDfprintf(stderr, err6, argv[i]); + (void)fprintf(stderr, err6, argv[i]); goto err; } break; @@ -186,7 +186,7 @@ main(int argc, char *argv[]) case 10: /* read path name */ if (parsePathInfo(&in->path, argv[i]) == -1) { - (void)HDfprintf(stderr, err5, argv[i]); + (void)fprintf(stderr, err5, argv[i]); goto err; } break; @@ -196,7 +196,7 @@ main(int argc, char *argv[]) case 12: /* read data type */ if (getInputClass(in, argv[i]) == -1) { - (void)HDfprintf(stderr, err7, argv[i]); + (void)fprintf(stderr, err7, argv[i]); goto err; } @@ -213,7 +213,7 @@ main(int argc, char *argv[]) case 14: /* read data size */ if (getInputSize(in, (int)HDstrtol(argv[i], NULL, BASE_10)) == -1) { - (void)HDfprintf(stderr, err8, argv[i]); + (void)fprintf(stderr, err8, argv[i]); goto err; } /*set default value for output-size */ @@ -222,14 +222,14 @@ main(int argc, char *argv[]) case ERR: /* command syntax error */ default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); usage(argv[0]); goto err; } } if (FALSE == outfile_named) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); usage(argv[0]); goto err; } @@ -242,35 +242,35 @@ 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: - (void)HDfprintf(stderr, "%s", err4); + (void)fprintf(stderr, "%s", err4); 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; } @@ -329,7 +329,7 @@ gtoken(char *s) } if (token == ERR) - (void)HDfprintf(stderr, err1, s); + (void)fprintf(stderr, err1, s); } else { /* filename */ token = FILNAME; @@ -375,8 +375,8 @@ processDataFile(char *infile, struct Input *in, hid_t file_id) */ if (in->inputClass == 4 /* "IN" */ || in->inputClass == 3 /* "FP" */ || in->inputClass == 7 /* "UIN" */) { - if ((strm = HDfopen(infile, READ_OPEN_FLAGS)) == NULL) { - (void)HDfprintf(stderr, err1, infile); + if ((strm = fopen(infile, READ_OPEN_FLAGS)) == NULL) { + (void)fprintf(stderr, err1, infile); goto error; } } @@ -385,8 +385,8 @@ processDataFile(char *infile, struct Input *in, hid_t file_id) *------------------------------------------------------------------------- */ else { - if ((strm = HDfopen(infile, "r")) == NULL) { - (void)HDfprintf(stderr, err1, infile); + if ((strm = fopen(infile, "r")) == NULL) { + (void)fprintf(stderr, err1, infile); goto error; } } @@ -395,12 +395,12 @@ processDataFile(char *infile, struct Input *in, hid_t file_id) case 0: /* TEXTIN */ case 4: /* IN */ if (allocateIntegerStorage(in) == -1) { - (void)HDfprintf(stderr, err2, infile); + (void)fprintf(stderr, err2, infile); goto error; } if (readIntegerData(strm, in) == -1) { - (void)HDfprintf(stderr, err4, infile); + (void)fprintf(stderr, err4, infile); goto error; } break; @@ -409,12 +409,12 @@ processDataFile(char *infile, struct Input *in, hid_t file_id) case 2: /* TEXTFPE */ case 3: /* FP */ if (allocateFloatStorage(in) == -1) { - (void)HDfprintf(stderr, err3, infile); + (void)fprintf(stderr, err3, infile); goto error; } if (readFloatData(strm, in) == -1) { - (void)HDfprintf(stderr, err5, infile); + (void)fprintf(stderr, err5, infile); goto error; } break; @@ -422,13 +422,13 @@ processDataFile(char *infile, struct Input *in, hid_t file_id) case 5: /* STR */ if (in->h5dumpInput) { if (processStrHDFData(strm, in, file_id) == -1) { - (void)HDfprintf(stderr, err11, infile); + (void)fprintf(stderr, err11, infile); goto error; } } else { if (processStrData(strm, in, file_id) == -1) { - (void)HDfprintf(stderr, err11, infile); + (void)fprintf(stderr, err11, infile); goto error; } } @@ -438,17 +438,17 @@ processDataFile(char *infile, struct Input *in, hid_t file_id) case 6: /* TEXTUIN */ case 7: /* UIN */ if (allocateUIntegerStorage(in) == -1) { - (void)HDfprintf(stderr, err6, infile); + (void)fprintf(stderr, err6, infile); goto error; } if (readUIntegerData(strm, in) == -1) { - (void)HDfprintf(stderr, err7, infile); + (void)fprintf(stderr, err7, infile); goto error; } break; default: - (void)HDfprintf(stderr, "%s", err10); + (void)fprintf(stderr, "%s", err10); goto error; } @@ -492,7 +492,7 @@ readIntegerData(FILE *strm, struct Input *in) in08 = (H5DT_INT8 *)in->data; for (i = 0; i < len; i++, in08++) { if (HDfscanf(strm, "%hd", &temp16) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } (*in08) = (H5DT_INT8)temp16; @@ -503,17 +503,17 @@ readIntegerData(FILE *strm, struct Input *in) in08 = (H5DT_INT8 *)in->data; for (i = 0; i < len; i++, in08++) { if (HDfread((char *)in08, sizeof(H5DT_INT8), 1, strm) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } #ifdef H5DEBUGIMPORT - HDprintf("readIntegerData %d (0x%.8X)\n", *in08, *in08); + printf("readIntegerData %d (0x%.8X)\n", *in08, *in08); #endif } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; @@ -524,7 +524,7 @@ readIntegerData(FILE *strm, struct Input *in) case 0: /* TEXTIN */ for (i = 0; i < len; i++, in16++) { if (HDfscanf(strm, "%hd", in16) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } @@ -534,7 +534,7 @@ readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in16++) { if (HDfread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } /* @@ -544,13 +544,13 @@ readIntegerData(FILE *strm, struct Input *in) */ *in16 = temp16; #ifdef H5DEBUGIMPORT - HDprintf("readIntegerData %d (0x%.8X)\n", *in16, temp16); + printf("readIntegerData %d (0x%.8X)\n", *in16, temp16); #endif } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; @@ -561,7 +561,7 @@ readIntegerData(FILE *strm, struct Input *in) case 0: /* TEXTIN */ for (i = 0; i < len; i++, in32++) { if (HDfscanf(strm, "%d", in32) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } @@ -570,7 +570,7 @@ readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in32++) { if (HDfread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } /* @@ -580,13 +580,13 @@ readIntegerData(FILE *strm, struct Input *in) */ *in32 = temp32; #ifdef H5DEBUGIMPORT - HDprintf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); + printf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); #endif } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; @@ -597,7 +597,7 @@ readIntegerData(FILE *strm, struct Input *in) case 0: /* TEXTIN */ for (i = 0; i < len; i++, in64++) { if (HDfscanf(strm, "%s", buffer) < 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } *in64 = (H5DT_INT64)HDstrtoll(buffer, NULL, 10); @@ -607,7 +607,7 @@ readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in64++) { if (HDfread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } /* @@ -617,19 +617,19 @@ readIntegerData(FILE *strm, struct Input *in) */ *in64 = temp64; #ifdef H5DEBUGIMPORT - HDprintf("readIntegerData %d (0x%.8X)\n", *in64, temp64); + printf("readIntegerData %d (0x%.8X)\n", *in64, temp64); #endif } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); break; } return (0); @@ -663,7 +663,7 @@ readUIntegerData(FILE *strm, struct Input *in) in08 = (H5DT_UINT8 *)in->data; for (i = 0; i < len; i++, in08++) { if (HDfscanf(strm, "%hu", &temp16) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } (*in08) = (H5DT_UINT8)temp16; @@ -674,14 +674,14 @@ readUIntegerData(FILE *strm, struct Input *in) in08 = (H5DT_UINT8 *)in->data; for (i = 0; i < len; i++, in08++) { if (HDfread((char *)in08, sizeof(H5DT_UINT8), 1, strm) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; @@ -692,7 +692,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in16++) { if (HDfscanf(strm, "%hu", in16) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } @@ -701,7 +701,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in16++) { if (HDfread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } /* @@ -711,13 +711,13 @@ readUIntegerData(FILE *strm, struct Input *in) */ *in16 = temp16; #ifdef H5DEBUGIMPORT - HDprintf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16); + printf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16); #endif } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; @@ -728,7 +728,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in32++) { if (HDfscanf(strm, "%u", in32) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } @@ -737,7 +737,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in32++) { if (HDfread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } /* @@ -747,13 +747,13 @@ readUIntegerData(FILE *strm, struct Input *in) */ *in32 = temp32; #ifdef H5DEBUGIMPORT - HDprintf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); + printf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); #endif } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; @@ -764,7 +764,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in64++) { if (HDfscanf(strm, "%s", buffer) < 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } *in64 = (H5DT_UINT64)HDstrtoll(buffer, NULL, 10); @@ -774,7 +774,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in64++) { if (HDfread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } /* @@ -784,19 +784,19 @@ readUIntegerData(FILE *strm, struct Input *in) */ *in64 = temp64; #ifdef H5DEBUGIMPORT - HDprintf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64); + printf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64); #endif } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); break; } return (0); @@ -829,7 +829,7 @@ readFloatData(FILE *strm, struct Input *in) case 1: /* TEXTFP */ for (i = 0; i < len; i++, fp32++) { if (HDfscanf(strm, "%f", fp32) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } @@ -842,7 +842,7 @@ readFloatData(FILE *strm, struct Input *in) for (i = 0; i < len; i++, fp32++) { if (HDfscanf(strm, "%f", fp32) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } @@ -854,7 +854,7 @@ readFloatData(FILE *strm, struct Input *in) bfp32 = (uint32_t *)in->data; for (i = 0; i < len; i++, bfp32++) { if (HDfread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } /* @@ -864,13 +864,13 @@ readFloatData(FILE *strm, struct Input *in) */ *bfp32 = temp32; #ifdef H5DEBUGIMPORT - HDprintf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32); + printf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32); #endif } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; @@ -881,7 +881,7 @@ readFloatData(FILE *strm, struct Input *in) case 1: /* TEXTFP */ for (i = 0; i < len; i++, fp64++) { if (HDfscanf(strm, "%lf", fp64) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } @@ -894,7 +894,7 @@ readFloatData(FILE *strm, struct Input *in) for (i = 0; i < len; i++, fp64++) { if (HDfscanf(strm, "%lf", fp64) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } @@ -906,7 +906,7 @@ readFloatData(FILE *strm, struct Input *in) bfp64 = (uint64_t *)in->data; for (i = 0; i < len; i++, bfp64++) { if (HDfread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } /* @@ -916,19 +916,19 @@ readFloatData(FILE *strm, struct Input *in) */ *bfp64 = temp64; #ifdef H5DEBUGIMPORT - HDprintf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64); + printf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64); #endif } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); break; } return (0); @@ -1111,7 +1111,7 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) *------------------------------------------------------------------------- */ #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING\n"); + printf("processStrHDFData DATATYPE STRING\n"); #endif if ((type_id = H5Tcopy(H5T_C_S1)) < 0) @@ -1149,7 +1149,7 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) } H5E_END_TRY; #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING groups created\n"); + printf("processStrHDFData DATATYPE STRING groups created\n"); #endif if ((space_id = H5Screate_simple(in->rank, in->sizeOfDimension, NULL)) < 0) @@ -1163,7 +1163,7 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) goto out; #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING ready to process strings\n"); + printf("processStrHDFData DATATYPE STRING ready to process strings\n"); #endif line = 0; j = 0; @@ -1173,27 +1173,27 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) str2 = NULL; str3 = NULL; #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING[%llu]={%s}\n", (unsigned long long)line, str1); + printf("processStrHDFData DATATYPE STRING[%llu]={%s}\n", (unsigned long long)line, str1); #endif /* process string to remove the first and last quote char */ str2 = strchr(str1, '"'); if (str2 != NULL) { #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2); + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2); #endif str2++; #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2); + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2); #endif str3 = strrchr(str2, '"'); if (str3 != NULL) { #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str3), str3); + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str3), str3); #endif *str3 = '\0'; #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2); + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2); #endif if (HDstrlen(str2) > 0) { @@ -1202,8 +1202,8 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) hsize_t count[1] = {1}; #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING[%llu] store %s\n", (unsigned long long)line, - str2); + printf("processStrHDFData DATATYPE STRING[%llu] store %s\n", (unsigned long long)line, + str2); #endif if ((fspace_id = H5Dget_space(dset_id)) < 0) goto out; @@ -1225,7 +1225,7 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) j++; } #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING eof reached\n"); + printf("processStrHDFData DATATYPE STRING eof reached\n"); #endif /* close */ @@ -1238,7 +1238,7 @@ processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) out: #ifdef H5DEBUGIMPORT - HDprintf("processStrHDFData DATATYPE STRING error exit\n"); + printf("processStrHDFData DATATYPE STRING error exit\n"); #endif /* disable error reporting */ H5E_BEGIN_TRY @@ -1267,35 +1267,35 @@ allocateIntegerStorage(struct Input *in) switch (in->inputSize) { case 8: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_INT8))) == NULL) { - (void)HDfprintf(stderr, "%s", err1); + 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) { - (void)HDfprintf(stderr, "%s", err1); + 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) { - (void)HDfprintf(stderr, "%s", err1); + 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) { - (void)HDfprintf(stderr, "%s", err1); + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_INT64))) == NULL) { + (void)fprintf(stderr, "%s", err1); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); break; } return (0); @@ -1314,35 +1314,35 @@ allocateUIntegerStorage(struct Input *in) switch (in->inputSize) { case 8: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_UINT8))) == NULL) { - (void)HDfprintf(stderr, "%s", err1); + 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) { - (void)HDfprintf(stderr, "%s", err1); + 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) { - (void)HDfprintf(stderr, "%s", err1); + 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) { - (void)HDfprintf(stderr, "%s", err1); + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_UINT64))) == NULL) { + (void)fprintf(stderr, "%s", err1); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); break; } return (0); @@ -1361,21 +1361,21 @@ allocateFloatStorage(struct Input *in) switch (in->inputSize) { case 32: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_FLOAT32))) == NULL) { - (void)HDfprintf(stderr, "%s", err1); + 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) { - (void)HDfprintf(stderr, "%s", err1); + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_FLOAT64))) == NULL) { + (void)fprintf(stderr, "%s", err1); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); break; } return (0); @@ -1446,24 +1446,24 @@ processConfigurationFile(char *infile, struct Input *in) /* 0 for big endian, 1 for little endian. */ if ((*((volatile uint8_t *)(&ibyte))) == 0x67) { if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err11e); + (void)fprintf(stderr, "%s", err11e); return (-1); } } else { if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err11e); + (void)fprintf(stderr, "%s", err11e); return (-1); } } in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif in->inputArchitecture = 0; /* default to NATIVE */ - if ((strm = HDfopen(infile, "r")) == NULL) { - (void)HDfprintf(stderr, err1, infile); + if ((strm = fopen(infile, "r")) == NULL) { + (void)fprintf(stderr, err1, infile); goto error; } @@ -1471,7 +1471,7 @@ processConfigurationFile(char *infile, struct Input *in) if ((scanret == 1) && !HDstrcmp("HDF5", key)) { #ifdef H5DEBUGIMPORT int pndx; - HDprintf("\nh5dump file\n"); + printf("\nh5dump file\n"); #endif in->h5dumpInput = 1; scanret = HDfscanf(strm, "%254s", temp); /* filename */ @@ -1480,51 +1480,51 @@ processConfigurationFile(char *infile, struct Input *in) while (scanret == 1) { if (!HDstrcmp("DATASET", key)) { /* PATH */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASET key\n"); + printf("h5dump DATASET key\n"); #endif if (in->configOptionVector[PATH] == 1) { - (void)HDfprintf(stderr, err3a, infile); + (void)fprintf(stderr, err3a, infile); goto error; } if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASET %s found\n", temp); + printf("h5dump DATASET %s found\n", temp); #endif if (parsePathInfo(&in->path, temp) == -1) { - (void)HDfprintf(stderr, err3b, infile); + (void)fprintf(stderr, err3b, infile); goto error; } in->configOptionVector[PATH] = 1; scanret = HDfscanf(strm, "%254s", temp); /* start bracket */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASET %s found\n", temp); + printf("h5dump DATASET %s found\n", temp); #endif } /* if(!HDstrcmp("DATASET", key)) PATH */ else if (!HDstrcmp("DATATYPE", key)) { /* INPUT-CLASS */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE key\n"); + printf("h5dump DATATYPE key\n"); #endif if (in->configOptionVector[INPUT_CLASS] == 1) { - (void)HDfprintf(stderr, err4a, infile); + (void)fprintf(stderr, err4a, infile); goto error; } if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE %s found\n", temp); + printf("h5dump DATATYPE %s found\n", temp); #endif if ((kindex = getInputClassType(in, temp)) == -1) { - (void)HDfprintf(stderr, err4b, infile); + (void)fprintf(stderr, err4b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE type %d inputClass\n", in->inputClass); + printf("h5dump DATATYPE type %d inputClass\n", in->inputClass); #endif in->configOptionVector[INPUT_CLASS] = 1; @@ -1539,80 +1539,80 @@ processConfigurationFile(char *infile, struct Input *in) in->outputClass = 2; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE type %d outputClass\n", in->outputClass); + printf("h5dump DATATYPE type %d outputClass\n", in->outputClass); #endif if (in->inputClass == 5) { /* STRING */ int get_next_prop = 1; in->outputClass = -1; #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE STRING found\n"); + printf("h5dump DATATYPE STRING found\n"); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE STRING %s found\n", temp); + printf("h5dump DATATYPE STRING %s found\n", temp); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* string properties */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } while (get_next_prop) { if (!HDstrcmp("STRSIZE", temp)) { /* STRSIZE */ if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err19); + (void)fprintf(stderr, "%s", err19); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE STRING STRSIZE %s found\n", temp); + printf("h5dump DATATYPE STRING STRSIZE %s found\n", temp); #endif if (HDstrcmp("H5T_VARIABLE;", temp) != 0) { char *more = temp; ival = (int)HDstrtol(more, &more, 10); if (getInputSize(in, ival) == -1) { - (void)HDfprintf(stderr, err5b, infile); + (void)fprintf(stderr, err5b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE STRING %d InputSize\n", in->inputSize); + printf("h5dump DATATYPE STRING %d InputSize\n", in->inputSize); #endif } } else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */ if (HDfscanf(strm, "%254s", temp) != 1) { /* STRPAD type */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE STRING STRPAD %s found\n", temp); + printf("h5dump DATATYPE STRING STRPAD %s found\n", temp); #endif } else if (!HDstrcmp("CSET", key)) { /* CSET */ if (HDfscanf(strm, "%254s", temp) != 1) { /* CSET type */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE STRING CSET %s found\n", temp); + printf("h5dump DATATYPE STRING CSET %s found\n", temp); #endif } else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */ if (HDfscanf(strm, "%254s", temp) != 1) { /* CTYPE type */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE STRING CTYPE %s found\n", temp); + printf("h5dump DATATYPE STRING CTYPE %s found\n", temp); #endif } /* if(!HDstrcmp("CSET", key)) */ if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE STRING %s found\n", temp); + printf("h5dump DATATYPE STRING %s found\n", temp); #endif if (!HDstrcmp("}", temp)) { /* end bracket */ get_next_prop = 0; @@ -1624,58 +1624,58 @@ processConfigurationFile(char *infile, struct Input *in) hsize_t temp_dims[MAX_NUM_DIMENSION]; #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE key\n"); + printf("h5dump DATASPACE key\n"); #endif if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } if (!HDstrcmp("SCALAR", temp)) { /* SCALAR */ in->rank = 0; } /* if(!HDstrcmp("SCALAR", key)) */ else if (!HDstrcmp("NULL", temp)) { /* NULL */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } /* else if(!HDstrcmp("NULL", key)) */ else if (!HDstrcmp("SIMPLE", temp)) { /* SIMPLE */ int icount = 0; #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE found\n"); + printf("h5dump DATASPACE SIMPLE found\n"); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); + printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); + printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif if (!HDstrcmp("(", temp)) { /* start paren */ int get_next_dim = 1; int i = 0; if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ - (void)HDfprintf(stderr, err16c, infile); + (void)fprintf(stderr, err16c, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); + printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif while (get_next_dim) { char *more = temp; temp_dims[icount] = HDstrtoull(more, &more, 10); if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); + printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif if (!HDstrcmp(")", temp)) { /* end paren */ in->rank = ++icount; @@ -1685,71 +1685,71 @@ processConfigurationFile(char *infile, struct Input *in) else { /* Dimension */ icount++; if (icount > MAX_NUM_DIMENSION) { - (void)HDfprintf(stderr, "Invalid value for rank.\n"); + (void)fprintf(stderr, "Invalid value for rank.\n"); goto error; } } } /* 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; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE %ld rank\n", in->rank); + printf("h5dump DATASPACE SIMPLE %ld rank\n", in->rank); #endif for (i = 0; i < in->rank; i++) { in->sizeOfDimension[i] = temp_dims[i]; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE dims[%ld]:", in->rank); + printf("h5dump DATASPACE SIMPLE dims[%ld]:", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - HDprintf(" %ld", in->sizeOfDimension[pndx]); + printf(" %ld", in->sizeOfDimension[pndx]); } - HDprintf("\n"); + printf("\n"); #endif in->configOptionVector[DIM] = 1; } /* if(!HDstrcmp("(", key)) start paren */ else { - (void)HDfprintf(stderr, err5b, infile); + (void)fprintf(stderr, err5b, infile); goto error; } if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); + printf("h5dump DATASPACE SIMPLE %s found\n", temp); #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 */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); + printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif if (!HDstrcmp("(", temp)) { /* start paren */ int get_next_dim = 1; int i = 0; #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE process max dim values\n"); + printf("h5dump DATASPACE SIMPLE process max dim values\n"); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */ - (void)HDfprintf(stderr, err16c, infile); + (void)fprintf(stderr, err16c, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); + printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif while (get_next_dim) { #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE get max dim value\n"); + printf("h5dump DATASPACE SIMPLE get max dim value\n"); #endif if (!HDstrcmp("H5S_UNLIMITED", temp) || !HDstrcmp("H5S_UNLIMITED,", temp)) { /* unlimited */ @@ -1761,11 +1761,11 @@ processConfigurationFile(char *infile, struct Input *in) in->maxsizeOfDimension[i] = HDstrtoull(more, &more, 10); } if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */ - (void)HDfprintf(stderr, err16c, infile); + (void)fprintf(stderr, err16c, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); + printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif if (!HDstrcmp(")", temp)) { /* end paren */ get_next_dim = 0; @@ -1773,85 +1773,85 @@ processConfigurationFile(char *infile, struct Input *in) else { /* comma */ i++; if (i >= MAX_NUM_DIMENSION) { - (void)HDfprintf(stderr, "Invalid value for rank.\n"); + (void)fprintf(stderr, "Invalid value for rank.\n"); goto error; } } } /* while (get_next_dim) */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE maxdims[%ld]:", in->rank); + printf("h5dump DATASPACE SIMPLE maxdims[%ld]:", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - HDprintf(" %ld", in->maxsizeOfDimension[pndx]); + printf(" %ld", in->maxsizeOfDimension[pndx]); } - HDprintf("\n"); - HDprintf("h5dump DATASPACE SIMPLE get max dim finished\n"); + printf("\n"); + printf("h5dump DATASPACE SIMPLE get max dim finished\n"); #endif } /* if(!HDstrcmp("(", key)) start paren */ else { - (void)HDfprintf(stderr, err16c, infile); + (void)fprintf(stderr, err16c, infile); goto error; } scanret = HDfscanf(strm, "%254s", temp); /* end bracket */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); + printf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif } /* if(!HDstrcmp("/", key)) max dims separator */ } /* else if(!HDstrcmp("SIMPLE", key)) */ else { - (void)HDfprintf(stderr, err5b, infile); + (void)fprintf(stderr, err5b, infile); goto error; } } /* else if(!HDstrcmp("DATASPACE", key)) RANK and DIMENSIONS */ else if (!HDstrcmp("STORAGE_LAYOUT", key)) { /* CHUNKED-DIMENSION-SIZES */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump STORAGE_LAYOUT key\n"); + printf("h5dump STORAGE_LAYOUT key\n"); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp); + printf("h5dump STORAGE_LAYOUT %s found\n", temp); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* CHUNKED */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp); + 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) { - (void)HDfprintf(stderr, "Unable to allocate dynamic memory.\n"); + 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; } if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); + printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); #endif if (!HDstrcmp("(", temp)) { /* start paren */ int get_next_dim = 1; int icount = 0; if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ - (void)HDfprintf(stderr, err16c, infile); + (void)fprintf(stderr, err16c, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); + printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); #endif while (get_next_dim) { char *more = temp; in->sizeOfChunk[icount] = HDstrtoull(more, &more, 10); if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); + printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); #endif if (!HDstrcmp(")", temp)) { /* end paren */ in->configOptionVector[RANK] = 1; @@ -1860,47 +1860,47 @@ processConfigurationFile(char *infile, struct Input *in) else { /* Dimension */ icount++; if (icount > MAX_NUM_DIMENSION) { - (void)HDfprintf(stderr, "Invalid value for rank.\n"); + (void)fprintf(stderr, "Invalid value for rank.\n"); goto error; } } } /* while (get_next_dim) */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump STORAGE_LAYOUT CHUNKED dims [%ld]:", in->rank); + printf("h5dump STORAGE_LAYOUT CHUNKED dims [%ld]:", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - HDprintf(" %ld", in->sizeOfChunk[pndx]); + printf(" %ld", in->sizeOfChunk[pndx]); } - HDprintf("\n"); + printf("\n"); #endif in->configOptionVector[DIM] = 1; } /* if(!HDstrcmp("(", key)) start paren */ else { - (void)HDfprintf(stderr, err5b, infile); + (void)fprintf(stderr, err5b, infile); goto error; } if (HDfscanf(strm, "%254s", temp) != 1) { /* SIZE */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); + printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); #endif if (!HDstrcmp("SIZE", temp)) { /* SIZE */ if (HDfscanf(strm, "%d", (&ival)) != 1) { - (void)HDfprintf(stderr, "%s", err19); + (void)fprintf(stderr, "%s", err19); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival); + printf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival); #endif } while (HDstrcmp("}", temp) != 0) { if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); + printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); #endif } in->configOptionVector[CHUNK] = 1; @@ -1908,135 +1908,135 @@ processConfigurationFile(char *infile, struct Input *in) } /* else if(!HDstrcmp("STORAGE_LAYOUT", key)) CHUNKED-DIMENSION-SIZES */ else if (!HDstrcmp("FILTERS", key)) { /* FILTERS */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS key\n"); + printf("h5dump FILTERS key\n"); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS %s found\n", temp); + printf("h5dump FILTERS %s found\n", temp); #endif if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS %s found\n", temp); + printf("h5dump FILTERS %s found\n", temp); #endif if (!HDstrcmp("COMPRESSION", temp)) { /* COMPRESSION */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS COMPRESSION found\n"); + printf("h5dump FILTERS COMPRESSION found\n"); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* DEFLATE */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp); + printf("h5dump FILTERS COMPRESSION %s found\n", temp); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* bgin bracket */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp); + printf("h5dump FILTERS COMPRESSION %s found\n", temp); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* LEVEL */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp); + printf("h5dump FILTERS COMPRESSION %s found\n", temp); #endif if (HDfscanf(strm, "%d", (&ival)) != 1) { - (void)HDfprintf(stderr, "%s", err19); + (void)fprintf(stderr, "%s", err19); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival); + printf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival); #endif in->compressionParam = ival; if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp); + printf("h5dump FILTERS COMPRESSION %s found\n", temp); #endif in->compressionType = 0; /* ONLY GZIP supported */ in->configOptionVector[COMPRESS] = 1; } else if (!HDstrcmp("CONTIGUOUS", temp)) { /* CONTIGUOUS */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS CONTIGUOUS found\n"); + printf("h5dump FILTERS CONTIGUOUS found\n"); #endif in->configOptionVector[COMPRESS] = 0; } else if (!HDstrcmp("NONE", temp)) { /* NONE */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS NONE found\n"); + printf("h5dump FILTERS NONE found\n"); #endif in->configOptionVector[COMPRESS] = 0; } if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump FILTERS %s found\n", temp); + printf("h5dump FILTERS %s found\n", temp); #endif } else if (!HDstrcmp("SUBSET", key)) { /* reduce dimensions */ hsize_t temp_dims[MAX_NUM_DIMENSION]; int get_next_prop = 1; #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET key\n"); + printf("h5dump SUBSET key\n"); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ - (void)HDfprintf(stderr, err20, infile); + (void)fprintf(stderr, err20, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET %s found\n", temp); + printf("h5dump SUBSET %s found\n", temp); #endif if (HDfscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */ - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET %s found\n", temp); + printf("h5dump SUBSET %s found\n", temp); #endif while (get_next_prop) { if (!HDstrcmp("COUNT", temp)) { /* COUNT */ int icount = 0; if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET %s found\n", temp); + printf("h5dump SUBSET %s found\n", temp); #endif if (!HDstrcmp("(", temp)) { /* start paren */ int get_next_dim = 1; int i = 0; if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ - (void)HDfprintf(stderr, err16c, infile); + (void)fprintf(stderr, err16c, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET COUNT [%s] found\n", temp); + printf("h5dump SUBSET COUNT [%s] found\n", temp); #endif while (get_next_dim) { char *more = temp; temp_dims[icount] = HDstrtoull(more, &more, 10); if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET COUNT %s found\n", temp); + printf("h5dump SUBSET COUNT %s found\n", temp); #endif if (!HDstrcmp(");", temp)) { /* end paren */ in->rank = ++icount; @@ -2046,7 +2046,7 @@ processConfigurationFile(char *infile, struct Input *in) else { /* Dimension */ icount++; if (icount >= MAX_NUM_DIMENSION) { - (void)HDfprintf(stderr, "Invalid value for rank.\n"); + (void)fprintf(stderr, "Invalid value for rank.\n"); goto error; } } @@ -2055,11 +2055,11 @@ processConfigurationFile(char *infile, struct Input *in) in->sizeOfDimension[i] = temp_dims[i]; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET COUNT dims: [%d]", in->rank); + printf("h5dump SUBSET COUNT dims: [%d]", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - HDprintf(" %ld", in->sizeOfDimension[pndx]); + printf(" %ld", in->sizeOfDimension[pndx]); } - HDprintf("\n"); + printf("\n"); #endif in->configOptionVector[DIM] = 1; } /* if(!HDstrcmp("(", key)) start paren */ @@ -2067,32 +2067,32 @@ processConfigurationFile(char *infile, struct Input *in) if (!HDstrcmp("BLOCK", temp)) { /* BLOCK */ int icount = 0; if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET %s found\n", temp); + printf("h5dump SUBSET %s found\n", temp); #endif if (!HDstrcmp("(", temp)) { /* start paren */ int get_next_dim = 1; int i = 0; if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ - (void)HDfprintf(stderr, err16c, infile); + (void)fprintf(stderr, err16c, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET BLOCK [%s] found\n", temp); + printf("h5dump SUBSET BLOCK [%s] found\n", temp); #endif while (get_next_dim) { char *more = temp; temp_dims[icount] = HDstrtoull(more, &more, 10); if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET BLOCK %s found\n", temp); + printf("h5dump SUBSET BLOCK %s found\n", temp); #endif if (!HDstrcmp(");", temp)) { /* end paren */ in->rank = ++icount; @@ -2102,7 +2102,7 @@ processConfigurationFile(char *infile, struct Input *in) else { /* Dimension */ icount++; if (icount > MAX_NUM_DIMENSION) { - (void)HDfprintf(stderr, "Invalid value for rank.\n"); + (void)fprintf(stderr, "Invalid value for rank.\n"); goto error; } } @@ -2111,21 +2111,21 @@ processConfigurationFile(char *infile, struct Input *in) in->sizeOfDimension[i] = in->sizeOfDimension[i] * temp_dims[i]; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET BLOCK dims: [%d]", in->rank); + printf("h5dump SUBSET BLOCK dims: [%d]", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - HDprintf(" %ld", in->sizeOfDimension[pndx]); + printf(" %ld", in->sizeOfDimension[pndx]); } - HDprintf("\n"); + printf("\n"); #endif in->configOptionVector[DIM] = 1; } /* if(!HDstrcmp("(", key)) start paren */ } /* if(!HDstrcmp("BLOCK", temp)) BLOCK */ if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT - HDprintf("h5dump SUBSET %s found\n", temp); + printf("h5dump SUBSET %s found\n", temp); #endif if (!HDstrcmp("}", temp)) { /* end bracket */ get_next_prop = 0; @@ -2134,7 +2134,7 @@ processConfigurationFile(char *infile, struct Input *in) } /* else if(!HDstrcmp("SUBSET", key)) */ else if (!HDstrcmp("DATA", key)) { /* FINISHED */ #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATA key\n"); + printf("h5dump DATA key\n"); #endif scanret = 0; break; @@ -2142,50 +2142,50 @@ processConfigurationFile(char *infile, struct Input *in) scanret = HDfscanf(strm, "%254s", key); } #ifdef H5DEBUGIMPORT - HDprintf("h5dump path"); + printf("h5dump path"); for (pndx = 0; pndx < in->path.count; pndx++) { - HDprintf(" : %s", in->path.group[pndx]); + printf(" : %s", in->path.group[pndx]); } - HDprintf("\n"); - HDprintf("h5dump inputClass=%d\n", in->inputClass); - HDprintf("h5dump inputSize=%d\n", in->inputSize); - HDprintf("h5dump inputArchitecture=%d\n", in->inputArchitecture); - HDprintf("h5dump inputByteOrder=%d\n", in->inputByteOrder); - HDprintf("h5dump rank=%d\n", in->rank); - HDprintf("h5dump outputClass=%d\n", in->outputClass); - HDprintf("h5dump outputSize=%d\n", in->outputSize); - HDprintf("h5dump outputArchitecture=%d\n", in->outputArchitecture); - HDprintf("h5dump outputByteOrder=%d\n", in->outputByteOrder); - HDprintf("h5dump compressionType=%d\n", in->compressionType); - HDprintf("h5dump compressionParam=%d\n", in->compressionParam); - HDprintf("h5dump externFilename=%s\n", in->externFilename); - HDprintf("h5dump sizeOfDimensions:\n"); + printf("\n"); + printf("h5dump inputClass=%d\n", in->inputClass); + printf("h5dump inputSize=%d\n", in->inputSize); + printf("h5dump inputArchitecture=%d\n", in->inputArchitecture); + printf("h5dump inputByteOrder=%d\n", in->inputByteOrder); + printf("h5dump rank=%d\n", in->rank); + printf("h5dump outputClass=%d\n", in->outputClass); + printf("h5dump outputSize=%d\n", in->outputSize); + printf("h5dump outputArchitecture=%d\n", in->outputArchitecture); + printf("h5dump outputByteOrder=%d\n", in->outputByteOrder); + printf("h5dump compressionType=%d\n", in->compressionType); + printf("h5dump compressionParam=%d\n", in->compressionParam); + printf("h5dump externFilename=%s\n", in->externFilename); + printf("h5dump sizeOfDimensions:\n"); for (pndx = 0; pndx < in->rank; pndx++) { - HDprintf(" %ld\n", in->sizeOfDimension[pndx]); + printf(" %ld\n", in->sizeOfDimension[pndx]); } #endif } else { #ifdef H5DEBUGIMPORT - HDprintf("original option keyword parsing\n"); + printf("original option keyword parsing\n"); #endif while (scanret == 1) { if ((kindex = mapKeywordToIndex(key)) == -1) { - (void)HDfprintf(stderr, err2, key, infile); + (void)fprintf(stderr, err2, key, infile); goto error; } switch (kindex) { case 0: /* PATH */ if (in->configOptionVector[PATH] == 1) { - (void)HDfprintf(stderr, err3a, infile); + (void)fprintf(stderr, err3a, infile); goto error; } if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } if (parsePathInfo(&in->path, temp) == -1) { - (void)HDfprintf(stderr, err3b, infile); + (void)fprintf(stderr, err3b, infile); goto error; } in->configOptionVector[PATH] = 1; @@ -2193,16 +2193,16 @@ processConfigurationFile(char *infile, struct Input *in) case 1: /* INPUT-CLASS */ if (in->configOptionVector[INPUT_CLASS] == 1) { - (void)HDfprintf(stderr, err4a, infile); + (void)fprintf(stderr, err4a, infile); goto error; } if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err18); + (void)fprintf(stderr, "%s", err18); goto error; } if (getInputClass(in, temp) == -1) { - (void)HDfprintf(stderr, err4b, infile); + (void)fprintf(stderr, err4b, infile); goto error; } @@ -2221,15 +2221,15 @@ processConfigurationFile(char *infile, struct Input *in) case 2: /* INPUT-SIZE */ if (in->configOptionVector[INPUT_SIZE] == 1) { - (void)HDfprintf(stderr, err5a, infile); + (void)fprintf(stderr, err5a, infile); goto error; } if (HDfscanf(strm, "%254d", (&ival)) != 1) { - (void)HDfprintf(stderr, "%s", err19); + (void)fprintf(stderr, "%s", err19); goto error; } if (getInputSize(in, ival) == -1) { - (void)HDfprintf(stderr, err5b, infile); + (void)fprintf(stderr, err5b, infile); goto error; } in->configOptionVector[INPUT_SIZE] = 1; @@ -2241,12 +2241,12 @@ processConfigurationFile(char *infile, struct Input *in) case 3: /* RANK */ if (in->configOptionVector[RANK] == 1) { - (void)HDfprintf(stderr, err6a, infile); + (void)fprintf(stderr, err6a, infile); goto error; } if (getRank(in, strm) == -1) { - (void)HDfprintf(stderr, err6b, infile); + (void)fprintf(stderr, err6b, infile); goto error; } in->configOptionVector[RANK] = 1; @@ -2254,16 +2254,16 @@ processConfigurationFile(char *infile, struct Input *in) case 4: /* DIMENSION-SIZES */ if (in->configOptionVector[DIM] == 1) { - (void)HDfprintf(stderr, err7a, infile); + (void)fprintf(stderr, err7a, infile); goto error; } if (in->configOptionVector[RANK] == 0) { - (void)HDfprintf(stderr, err7b, infile); + (void)fprintf(stderr, err7b, infile); goto error; } if (getDimensionSizes(in, strm) == -1) { - (void)HDfprintf(stderr, err7c, infile); + (void)fprintf(stderr, err7c, infile); goto error; } in->configOptionVector[DIM] = 1; @@ -2271,12 +2271,12 @@ processConfigurationFile(char *infile, struct Input *in) case 5: /* OUTPUT-CLASS */ if (in->configOptionVector[OUTPUT_CLASS] == 1) { - (void)HDfprintf(stderr, err8a, infile); + (void)fprintf(stderr, err8a, infile); goto error; } if (getOutputClass(in, strm) == -1) { - (void)HDfprintf(stderr, err8b, infile); + (void)fprintf(stderr, err8b, infile); goto error; } in->configOptionVector[OUTPUT_CLASS] = 1; @@ -2284,12 +2284,12 @@ processConfigurationFile(char *infile, struct Input *in) case 6: /* OUTPUT-SIZE */ if (in->configOptionVector[OUTPUT_SIZE] == 1) { - (void)HDfprintf(stderr, err9a, infile); + (void)fprintf(stderr, err9a, infile); goto error; } if (getOutputSize(in, strm) == -1) { - (void)HDfprintf(stderr, err9b, infile); + (void)fprintf(stderr, err9b, infile); goto error; } in->configOptionVector[OUTPUT_SIZE] = 1; @@ -2297,12 +2297,12 @@ processConfigurationFile(char *infile, struct Input *in) case 7: /* OUTPUT-ARCHITECTURE */ if (in->configOptionVector[OUTPUT_ARCH] == 1) { - (void)HDfprintf(stderr, err10a, infile); + (void)fprintf(stderr, err10a, infile); goto error; } if (getOutputArchitecture(in, strm) == -1) { - (void)HDfprintf(stderr, err10b, infile); + (void)fprintf(stderr, err10b, infile); goto error; } in->configOptionVector[OUTPUT_ARCH] = 1; @@ -2310,12 +2310,12 @@ processConfigurationFile(char *infile, struct Input *in) case 8: /* OUTPUT-BYTE-ORDER */ if (in->configOptionVector[OUTPUT_B_ORDER] == 1) { - (void)HDfprintf(stderr, err11a, infile); + (void)fprintf(stderr, err11a, infile); goto error; } if (getOutputByteOrder(in, strm) == -1) { - (void)HDfprintf(stderr, err11b, infile); + (void)fprintf(stderr, err11b, infile); goto error; } in->configOptionVector[OUTPUT_B_ORDER] = 1; @@ -2323,17 +2323,17 @@ processConfigurationFile(char *infile, struct Input *in) case 9: /* CHUNKED-DIMENSION-SIZES */ if (in->configOptionVector[CHUNK] == 1) { - (void)HDfprintf(stderr, err12a, infile); + (void)fprintf(stderr, err12a, infile); goto error; } /* can't appear before dimension sizes have been provided */ if (in->configOptionVector[DIM] == 0) { - (void)HDfprintf(stderr, err12b, infile); + (void)fprintf(stderr, err12b, infile); goto error; } if (getChunkedDimensionSizes(in, strm) == -1) { - (void)HDfprintf(stderr, err12c, infile); + (void)fprintf(stderr, err12c, infile); goto error; } in->configOptionVector[CHUNK] = 1; @@ -2341,12 +2341,12 @@ processConfigurationFile(char *infile, struct Input *in) case 10: /* COMPRESSION-TYPE */ if (in->configOptionVector[COMPRESS] == 1) { - (void)HDfprintf(stderr, err13a, infile); + (void)fprintf(stderr, err13a, infile); goto error; } if (getCompressionType(in, strm) == -1) { - (void)HDfprintf(stderr, err13b, infile); + (void)fprintf(stderr, err13b, infile); goto error; } in->configOptionVector[COMPRESS] = 1; @@ -2359,12 +2359,12 @@ processConfigurationFile(char *infile, struct Input *in) case 11: /* COMPRESSION-PARAM */ if (in->configOptionVector[COMPRESS_PARAM] == 1) { - (void)HDfprintf(stderr, err14a, infile); + (void)fprintf(stderr, err14a, infile); goto error; } if (getCompressionParameter(in, strm) == -1) { - (void)HDfprintf(stderr, err14b, infile); + (void)fprintf(stderr, err14b, infile); goto error; } @@ -2377,12 +2377,12 @@ processConfigurationFile(char *infile, struct Input *in) case 12: /* EXTERNAL-STORAGE */ if (in->configOptionVector[EXTERNALSTORE] == 1) { - (void)HDfprintf(stderr, err15a, infile); + (void)fprintf(stderr, err15a, infile); goto error; } if (getExternalFilename(in, strm) == -1) { - (void)HDfprintf(stderr, err15b, infile); + (void)fprintf(stderr, err15b, infile); goto error; } in->configOptionVector[EXTERNALSTORE] = 1; @@ -2390,16 +2390,16 @@ processConfigurationFile(char *infile, struct Input *in) case 13: /* MAXIMUM-DIMENSIONS */ if (in->configOptionVector[EXTEND] == 1) { - (void)HDfprintf(stderr, err16a, infile); + (void)fprintf(stderr, err16a, infile); goto error; } /* can't appear before dimension sizes have been provided */ if (in->configOptionVector[DIM] == 0) { - (void)HDfprintf(stderr, err16b, infile); + (void)fprintf(stderr, err16b, infile); goto error; } if (getMaximumDimensionSizes(in, strm) == -1) { - (void)HDfprintf(stderr, err16c, infile); + (void)fprintf(stderr, err16c, infile); goto error; } in->configOptionVector[EXTEND] = 1; @@ -2407,12 +2407,12 @@ processConfigurationFile(char *infile, struct Input *in) case 14: /* INPUT-BYTE-ORDER */ if (in->configOptionVector[INPUT_B_ORDER] == 1) { - (void)HDfprintf(stderr, err11c, infile); + (void)fprintf(stderr, err11c, infile); goto error; } if (getInputByteOrder(in, strm) == -1) { - (void)HDfprintf(stderr, err11d, infile); + (void)fprintf(stderr, err11d, infile); goto error; } in->configOptionVector[INPUT_B_ORDER] = 1; @@ -2430,7 +2430,7 @@ processConfigurationFile(char *infile, struct Input *in) */ if (validateConfigurationParameters(in) == -1) { - (void)HDfprintf(stderr, err17, infile); + (void)fprintf(stderr, err17, infile); goto error; } } @@ -2463,21 +2463,21 @@ validateConfigurationParameters(struct Input *in) return (0); if ((in->configOptionVector[DIM] != 1) || (in->configOptionVector[RANK] != 1)) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } if (in->configOptionVector[EXTERNALSTORE] == 1) { if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[CHUNK] == 1) || (in->configOptionVector[EXTEND] == 1)) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } } if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[EXTEND] == 1)) { if (in->configOptionVector[CHUNK] != 1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } } @@ -2485,20 +2485,20 @@ validateConfigurationParameters(struct Input *in) /* Arch can't be STD if O/p class is FP */ if (in->outputArchitecture == 1) if (in->outputClass == 1) { - (void)HDfprintf(stderr, "%s", err4a); + (void)fprintf(stderr, "%s", err4a); return (-1); } /* Arch can't be IEEE if O/p class is IN */ if (in->outputArchitecture == 2) if (in->outputClass == 0) { - (void)HDfprintf(stderr, "%s", err4b); + (void)fprintf(stderr, "%s", err4b); return (-1); } if (in->outputClass == 1) if (in->outputSize != 32 && in->outputSize != 64) { - (void)HDfprintf(stderr, "%s", err5); + (void)fprintf(stderr, "%s", err5); return (-1); } @@ -2526,7 +2526,7 @@ parsePathInfo(struct path_info *path, char *temp) token = HDstrtok(temp, delimiter); if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } HDstrcpy(path->group[i++], token); @@ -2536,7 +2536,7 @@ parsePathInfo(struct path_info *path, char *temp) if (token == NULL) break; if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } HDstrcpy(path->group[i++], token); @@ -2565,8 +2565,8 @@ 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) { - (void)HDfprintf(stderr, "%s", err1); + if ((in->sizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + (void)fprintf(stderr, "%s", err1); return (-1); } @@ -2593,12 +2593,12 @@ getOutputClass(struct Input *in, FILE *strm) const char *err2 = "Invalid value for output class.\n"; if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } if ((kindex = OutputClassStrToInt(temp)) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } @@ -2628,7 +2628,7 @@ getOutputSize(struct Input *in, FILE *strm) const char *err2 = "Invalid value for output size.\n"; if (HDfscanf(strm, "%d", (&ival)) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } @@ -2637,7 +2637,7 @@ getOutputSize(struct Input *in, FILE *strm) in->outputSize = ival; return (0); } - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } @@ -2648,7 +2648,7 @@ getInputClass(struct Input *in, char *temp) const char *err1 = "Invalid value for input class.\n"; if ((kindex = InputClassStrToInt(temp)) == -1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } @@ -2669,18 +2669,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 4; @@ -2690,18 +2690,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 4; @@ -2711,18 +2711,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 4; @@ -2732,18 +2732,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 4; @@ -2753,18 +2753,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 4; @@ -2774,18 +2774,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 4; @@ -2795,18 +2795,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 4; @@ -2816,18 +2816,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 4; @@ -2837,18 +2837,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 7; @@ -2858,18 +2858,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 7; @@ -2879,18 +2879,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 7; @@ -2900,18 +2900,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 7; @@ -2921,18 +2921,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 7; @@ -2942,18 +2942,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 7; @@ -2963,18 +2963,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 7; @@ -2984,18 +2984,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 7; @@ -3005,7 +3005,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3017,7 +3017,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3029,7 +3029,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3041,7 +3041,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3053,7 +3053,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3065,7 +3065,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3077,7 +3077,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3089,7 +3089,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3101,7 +3101,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3113,7 +3113,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3125,18 +3125,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("IEEE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 3; @@ -3146,18 +3146,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("IEEE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 3; @@ -3167,18 +3167,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("IEEE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 3; @@ -3188,18 +3188,18 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("IEEE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = 3; @@ -3221,7 +3221,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3233,7 +3233,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3245,7 +3245,7 @@ getInputClassType(struct Input *in, char *buffer) in->configOptionVector[INPUT_SIZE] = 1; if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; @@ -3262,18 +3262,18 @@ getInputClassType(struct Input *in, char *buffer) else if (!HDstrcmp(buffer, "H5T_STD_B8BE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = -1; @@ -3281,18 +3281,18 @@ getInputClassType(struct Input *in, char *buffer) else if (!HDstrcmp(buffer, "H5T_STD_B8LE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = -1; @@ -3300,18 +3300,18 @@ getInputClassType(struct Input *in, char *buffer) else if (!HDstrcmp(buffer, "H5T_STD_B16BE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = -1; @@ -3319,18 +3319,18 @@ getInputClassType(struct Input *in, char *buffer) else if (!HDstrcmp(buffer, "H5T_STD_B16LE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = -1; @@ -3338,18 +3338,18 @@ getInputClassType(struct Input *in, char *buffer) else if (!HDstrcmp(buffer, "H5T_STD_B32BE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = -1; @@ -3357,18 +3357,18 @@ getInputClassType(struct Input *in, char *buffer) else if (!HDstrcmp(buffer, "H5T_STD_B32LE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = -1; @@ -3376,18 +3376,18 @@ getInputClassType(struct Input *in, char *buffer) else if (!HDstrcmp(buffer, "H5T_STD_B64BE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = -1; @@ -3395,18 +3395,18 @@ getInputClassType(struct Input *in, char *buffer) else if (!HDstrcmp(buffer, "H5T_STD_B64LE")) { if ((kindex = OutputArchStrToInt("STD")) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->outputArchitecture = kindex; if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } in->outputByteOrder = kindex; #ifdef H5DEBUGIMPORT - HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder); + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif kindex = -1; @@ -3437,7 +3437,7 @@ getInputClassType(struct Input *in, char *buffer) } if (kindex == -1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3445,9 +3445,9 @@ getInputClassType(struct Input *in, char *buffer) if (in->configOptionVector[OUTPUT_SIZE] == 0) in->outputSize = in->inputSize; #ifdef H5DEBUGIMPORT - HDprintf("h5dump DATATYPE InClass %d inputSize\n", in->inputSize); - HDprintf("h5dump DATATYPE InClass %d outputSize\n", in->outputSize); - HDprintf("h5dump DATATYPE InClass %d outputArchitecture\n", in->outputArchitecture); + printf("h5dump DATATYPE InClass %d inputSize\n", in->inputSize); + printf("h5dump DATATYPE InClass %d outputSize\n", in->outputSize); + printf("h5dump DATATYPE InClass %d outputArchitecture\n", in->outputArchitecture); #endif in->inputClass = kindex; @@ -3478,7 +3478,7 @@ getInputSize(struct Input *in, int ival) in->inputSize = ival; return (0); } - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3491,12 +3491,12 @@ getInputByteOrder(struct Input *in, FILE *strm) const char *err2 = "Invalid value for input byte-order.\n"; if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } if ((kindex = OutputByteOrderStrToInt(temp)) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } @@ -3513,7 +3513,7 @@ getRank(struct Input *in, FILE *strm) const char *err2 = "Invalid value for rank.\n"; if (HDfscanf(strm, "%d", (&ival)) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } if (ival >= MIN_NUM_DIMENSION && ival <= MAX_NUM_DIMENSION) { @@ -3521,7 +3521,7 @@ getRank(struct Input *in, FILE *strm) return (0); } - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } @@ -3536,8 +3536,8 @@ 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) { - (void)HDfprintf(stderr, "%s", err1); + if ((in->sizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3545,7 +3545,7 @@ getDimensionSizes(struct Input *in, FILE *strm) in->sizeOfDimension[i++] = ullval; if (in->rank != i) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } return (0); @@ -3562,8 +3562,8 @@ 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) { - (void)HDfprintf(stderr, "%s", err1); + if ((in->sizeOfChunk = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3571,13 +3571,13 @@ getChunkedDimensionSizes(struct Input *in, FILE *strm) in->sizeOfChunk[i++] = ullval; if (in->rank != i) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } for (i = 0; i < in->rank; i++) if (in->sizeOfChunk[i] > in->sizeOfDimension[i]) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } return (0); @@ -3595,8 +3595,8 @@ 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) { - (void)HDfprintf(stderr, "%s", err1); + if ((in->maxsizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3608,14 +3608,14 @@ getMaximumDimensionSizes(struct Input *in, FILE *strm) } if (in->rank != i) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } for (i = 0; i < in->rank; i++) { if (in->maxsizeOfDimension[i] != H5S_UNLIMITED) if (in->maxsizeOfDimension[i] < in->sizeOfDimension[i]) { - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } } @@ -3631,12 +3631,12 @@ getOutputArchitecture(struct Input *in, FILE *strm) const char *err2 = "Invalid value for output architecture.\n"; if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } if ((kindex = OutputArchStrToInt(temp)) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } @@ -3664,12 +3664,12 @@ getOutputByteOrder(struct Input *in, FILE *strm) const char *err2 = "Invalid value for output byte-order.\n"; if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } if ((kindex = OutputByteOrderStrToInt(temp)) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } @@ -3697,12 +3697,12 @@ getCompressionType(struct Input *in, FILE *strm) const char *err2 = "Invalid value for compression.\n"; if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } if ((kindex = CompressionTypeStrToInt(temp)) == -1) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } @@ -3739,19 +3739,19 @@ getCompressionParameter(struct Input *in, FILE *strm) switch (in->compressionType) { case 0: /* GZIP */ if (HDfscanf(strm, "%d", (&ival)) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } if (ival < 0 || ival > 9) { - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } in->compressionParam = ival; return (0); default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } } @@ -3764,12 +3764,12 @@ getExternalFilename(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; if (HDfscanf(strm, "%254s", temp) != 1) { - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } 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); @@ -3836,7 +3836,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } switch (in->outputByteOrder) { @@ -3851,7 +3851,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -3870,7 +3870,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -3887,7 +3887,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -3904,7 +3904,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -3921,19 +3921,19 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err4); + (void)fprintf(stderr, "%s", err4); return (-1); } break; @@ -3951,7 +3951,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } switch (in->outputByteOrder) { @@ -3966,13 +3966,13 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; case 1: - (void)HDfprintf(stderr, "%s", err5); + (void)fprintf(stderr, "%s", err5); return (-1); case 2: @@ -3989,7 +3989,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4006,19 +4006,19 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err4); + (void)fprintf(stderr, "%s", err4); return (-1); } break; @@ -4044,7 +4044,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } switch (in->outputByteOrder) { @@ -4059,7 +4059,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4078,7 +4078,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4095,7 +4095,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4112,7 +4112,7 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4129,29 +4129,29 @@ createOutputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; case 2: - (void)HDfprintf(stderr, "%s", err6); + (void)fprintf(stderr, "%s", err6); return (-1); default: - (void)HDfprintf(stderr, "%s", err4); + (void)fprintf(stderr, "%s", err4); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } return new_type; @@ -4191,7 +4191,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } switch (in->inputByteOrder) { @@ -4206,7 +4206,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4225,7 +4225,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4242,7 +4242,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4259,7 +4259,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4276,19 +4276,19 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err4); + (void)fprintf(stderr, "%s", err4); return (-1); } break; @@ -4306,7 +4306,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } switch (in->inputByteOrder) { @@ -4321,13 +4321,13 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; case 1: - (void)HDfprintf(stderr, "%s", err5); + (void)fprintf(stderr, "%s", err5); return (-1); case 2: @@ -4344,7 +4344,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4361,19 +4361,19 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err4); + (void)fprintf(stderr, "%s", err4); return (-1); } break; @@ -4399,7 +4399,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } switch (in->inputByteOrder) { @@ -4414,7 +4414,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4433,7 +4433,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4450,7 +4450,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4467,7 +4467,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; @@ -4484,29 +4484,29 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err3); + (void)fprintf(stderr, "%s", err3); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; case 2: - (void)HDfprintf(stderr, "%s", err6); + (void)fprintf(stderr, "%s", err6); return (-1); default: - (void)HDfprintf(stderr, "%s", err4); + (void)fprintf(stderr, "%s", err4); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } @@ -4532,7 +4532,7 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; @@ -4550,13 +4550,13 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; case 5: - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); break; @@ -4580,13 +4580,13 @@ createInputDataType(struct Input *in) break; default: - (void)HDfprintf(stderr, "%s", err2); + (void)fprintf(stderr, "%s", err2); return (-1); } break; default: - (void)HDfprintf(stderr, "%s", err1); + (void)fprintf(stderr, "%s", err1); return (-1); } } @@ -4624,7 +4624,7 @@ process(struct Options *opt) { if ((file_id = H5Fopen(opt->outfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) { if ((file_id = H5Fcreate(opt->outfile, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == FAIL) { - (void)HDfprintf(stderr, err1, opt->outfile); + (void)fprintf(stderr, err1, opt->outfile); return (-1); } } @@ -4635,13 +4635,13 @@ process(struct Options *opt) in = &(opt->infiles[k].in); if (opt->infiles[k].config == 1) { if (processConfigurationFile(opt->infiles[k].configfile, in) == -1) { - (void)HDfprintf(stderr, err2, opt->infiles[k].configfile); + (void)fprintf(stderr, err2, opt->infiles[k].configfile); return (-1); } } if (processDataFile(opt->infiles[k].datafile, in, file_id) == -1) { - (void)HDfprintf(stderr, err3, opt->infiles[k].datafile); + (void)fprintf(stderr, err3, opt->infiles[k].datafile); return (-1); } @@ -4683,7 +4683,7 @@ process(struct Options *opt) intype = createInputDataType(in); outtype = createOutputDataType(in); #ifdef H5DEBUGIMPORT - HDprintf("process intype %ld outtype %ld\n", intype, outtype); + printf("process intype %ld outtype %ld\n", intype, outtype); #endif /* create property list */ @@ -4700,8 +4700,8 @@ process(struct Options *opt) if (in->configOptionVector[EXTERNALSTORE] == 1) { /* creating the external file if it doesn't exist */ - if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) { - (void)HDfprintf(stderr, "%s", err4); + if ((extfile = fopen(in->externFilename, "ab")) == NULL) { + (void)fprintf(stderr, "%s", err4); H5Pclose(proplist); H5Sclose(dataspace); H5Fclose(file_id); @@ -4724,7 +4724,7 @@ process(struct Options *opt) /* create data set */ if ((dataset = H5Dcreate2(handle, in->path.group[j], outtype, dataspace, H5P_DEFAULT, proplist, H5P_DEFAULT)) < 0) { - (void)HDfprintf(stderr, "%s", err5); + (void)fprintf(stderr, "%s", err5); H5Pclose(proplist); H5Sclose(dataspace); H5Fclose(file_id); @@ -4737,7 +4737,7 @@ process(struct Options *opt) /* write dataset */ if (H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0) { - (void)HDfprintf(stderr, "%s", err6); + (void)fprintf(stderr, "%s", err6); H5Dclose(dataset); H5Pclose(proplist); H5Sclose(dataspace); @@ -4813,292 +4813,292 @@ swap_uint64(uint64_t val) void help(char *name) { - (void)HDfprintf(stdout, "Name:\n\n"); - (void)HDfprintf(stdout, "\t%s\n\n", name); - (void)HDfprintf(stdout, "\t TOOL NAME:\n"); - (void)HDfprintf(stdout, "\t %s\n", name); - (void)HDfprintf(stdout, "\t SYNTAX:\n"); - (void)HDfprintf(stdout, "\t %s -h[elp], OR\n", name); - (void)HDfprintf(stdout, "\t %s <infile> -c[onfig] <configfile> [<infile> -c[config] <configfile>...]", - name); - (void)HDfprintf(stdout, "\t\t\t\t -o[utfile] <outfile>\n\n"); - (void)HDfprintf(stdout, "\t PURPOSE:\n"); - (void)HDfprintf(stdout, "\t To convert data stored in one or more ASCII or binary files\n"); - (void)HDfprintf(stdout, "\t into one or more datasets (in accordance with the \n"); - (void)HDfprintf(stdout, "\t user-specified type and storage properties) in an existing \n"); - (void)HDfprintf(stdout, "\t or new HDF5 file.\n\n"); - (void)HDfprintf(stdout, "\t DESCRIPTION:\n"); - (void)HDfprintf(stdout, "\t The primary objective of the utility is to convert floating\n"); - (void)HDfprintf(stdout, "\t point or integer data stored in ASCII text or binary form \n"); - (void)HDfprintf(stdout, "\t into a data-set according to the type and storage properties\n"); - (void)HDfprintf(stdout, "\t specified by the user. The utility can also accept ASCII\n"); - (void)HDfprintf(stdout, "\t text files and store the contents in a compact form as an\n"); - (void)HDfprintf(stdout, "\t array of one-dimensional strings.\n\n"); - (void)HDfprintf(stdout, "\t The input data to be written as a data-set can be provided\n"); - (void)HDfprintf(stdout, "\t to the utility in one of the following forms:\n"); - (void)HDfprintf(stdout, "\t 1. ASCII text file with numeric data (floating point or \n"); - (void)HDfprintf(stdout, "\t integer data). \n"); - (void)HDfprintf(stdout, "\t 2. Binary file with native floating point data (32-bit or \n"); - (void)HDfprintf(stdout, "\t 64-bit) \n"); - (void)HDfprintf(stdout, "\t 3. Binary file with native integer (signed or unsigned)\n"); - (void)HDfprintf(stdout, "\t data (8-bit or 16-bit or 32-bit or 64-bit). \n"); - (void)HDfprintf(stdout, "\t 4. ASCII text file containing strings (text data).\n"); - (void)HDfprintf(stdout, "\t \n"); - (void)HDfprintf(stdout, "\t Every input file is associated with a configuration file \n"); - (void)HDfprintf(stdout, "\t also provided as an input to the utility. (See Section \n"); - (void)HDfprintf(stdout, "\t \"CONFIGURATION FILE\" to know how it is to be organized).\n"); - (void)HDfprintf(stdout, "\t The class, size and dimensions of the input data is \n"); - (void)HDfprintf(stdout, "\t specified in this configuration file. A point to note is\n"); - (void)HDfprintf(stdout, "\t that the floating point data in the ASCII text file may be\n"); - (void)HDfprintf(stdout, "\t organized in the fixed floating form (for example 323.56)\n"); - (void)HDfprintf(stdout, "\t or in a scientific notation (for example 3.23E+02). A \n"); - (void)HDfprintf(stdout, "\t different input-class specification is to be used for both\n"); - (void)HDfprintf(stdout, "\t forms.\n\n"); - (void)HDfprintf(stdout, "\t The utility extracts the input data from the input file \n"); - (void)HDfprintf(stdout, "\t according to the specified parameters and saves it into \n"); - (void)HDfprintf(stdout, "\t an H5 dataset. \n\n"); - (void)HDfprintf(stdout, "\t The user can specify output type and storage properties in \n"); - (void)HDfprintf(stdout, "\t the configuration file. The user is required to specify the \n"); - (void)HDfprintf(stdout, "\t path of the dataset. If the groups in the path leading to \n"); - (void)HDfprintf(stdout, "\t the data-set do not exist, the groups will be created by the\n"); - (void)HDfprintf(stdout, "\t utility. If no group is specified, the dataset will be\n"); - (void)HDfprintf(stdout, "\t created under the root group.\n\n"); - (void)HDfprintf(stdout, "\t In addition to the name, the user is also required to \n"); - (void)HDfprintf(stdout, "\t provide the class and size of output data to be written to \n"); - (void)HDfprintf(stdout, "\t the dataset and may optionally specify the output-architecture,\n"); - (void)HDfprintf(stdout, "\t and the output-byte-order. If output-architecture is not \n"); - (void)HDfprintf(stdout, "\t specified the default is NATIVE. Output-byte-orders are fixed\n"); - (void)HDfprintf(stdout, "\t for some architectures and may be specified only if output-\n"); - (void)HDfprintf(stdout, "\t architecture is IEEE, UNIX or STD.\n\n"); - (void)HDfprintf(stdout, "\t Also, layout and other storage properties such as \n"); - (void)HDfprintf(stdout, "\t compression, external storage and extendible data-sets may be\n"); - (void)HDfprintf(stdout, "\t optionally specified. The layout and storage properties \n"); - (void)HDfprintf(stdout, "\t denote how raw data is to be organized on the disk. If these \n"); - (void)HDfprintf(stdout, "\t options are not specified the default is Contiguous layout \n"); - (void)HDfprintf(stdout, "\t and storage.\n\n"); - (void)HDfprintf(stdout, "\t The dataset can be organized in any of the following ways:\n"); - (void)HDfprintf(stdout, "\t 1. Contiguous.\n"); - (void)HDfprintf(stdout, "\t 2. Chunked.\n"); - (void)HDfprintf(stdout, "\t 3. External Storage File (has to be contiguous)\n"); - (void)HDfprintf(stdout, "\t 4. Extendible data sets (has to be chunked)\n"); - (void)HDfprintf(stdout, "\t 5. Compressed. (has to be chunked)\n"); - (void)HDfprintf(stdout, "\t 6. Compressed & Extendible (has to be chunked)\n\n"); - (void)HDfprintf(stdout, "\t If the user wants to store raw data in a non-HDF file then \n"); - (void)HDfprintf(stdout, "\t the external storage file option is to be used and the name \n"); - (void)HDfprintf(stdout, "\t of the file is to be specified. \n\n"); - (void)HDfprintf(stdout, "\t If the user wants the dimensions of the data-set to be\n"); - (void)HDfprintf(stdout, "\t unlimited, the extendible data set option can be chosen. \n\n"); - (void)HDfprintf(stdout, "\t The user may also specify the type of compression and the \n"); - (void)HDfprintf(stdout, "\t level to which the data set must be compresses by setting \n"); - (void)HDfprintf(stdout, "\t the compressed option.\n\n"); - (void)HDfprintf(stdout, "\t SYNOPSIS:\n"); - (void)HDfprintf(stdout, "\t h5import -h[elp], OR\n"); - (void)HDfprintf(stdout, "\t h5import <infile> -c[onfig] <configfile> \ + (void)fprintf(stdout, "Name:\n\n"); + (void)fprintf(stdout, "\t%s\n\n", name); + (void)fprintf(stdout, "\t TOOL NAME:\n"); + (void)fprintf(stdout, "\t %s\n", name); + (void)fprintf(stdout, "\t SYNTAX:\n"); + (void)fprintf(stdout, "\t %s -h[elp], OR\n", name); + (void)fprintf(stdout, "\t %s <infile> -c[onfig] <configfile> [<infile> -c[config] <configfile>...]", + name); + (void)fprintf(stdout, "\t\t\t\t -o[utfile] <outfile>\n\n"); + (void)fprintf(stdout, "\t PURPOSE:\n"); + (void)fprintf(stdout, "\t To convert data stored in one or more ASCII or binary files\n"); + (void)fprintf(stdout, "\t into one or more datasets (in accordance with the \n"); + (void)fprintf(stdout, "\t user-specified type and storage properties) in an existing \n"); + (void)fprintf(stdout, "\t or new HDF5 file.\n\n"); + (void)fprintf(stdout, "\t DESCRIPTION:\n"); + (void)fprintf(stdout, "\t The primary objective of the utility is to convert floating\n"); + (void)fprintf(stdout, "\t point or integer data stored in ASCII text or binary form \n"); + (void)fprintf(stdout, "\t into a data-set according to the type and storage properties\n"); + (void)fprintf(stdout, "\t specified by the user. The utility can also accept ASCII\n"); + (void)fprintf(stdout, "\t text files and store the contents in a compact form as an\n"); + (void)fprintf(stdout, "\t array of one-dimensional strings.\n\n"); + (void)fprintf(stdout, "\t The input data to be written as a data-set can be provided\n"); + (void)fprintf(stdout, "\t to the utility in one of the following forms:\n"); + (void)fprintf(stdout, "\t 1. ASCII text file with numeric data (floating point or \n"); + (void)fprintf(stdout, "\t integer data). \n"); + (void)fprintf(stdout, "\t 2. Binary file with native floating point data (32-bit or \n"); + (void)fprintf(stdout, "\t 64-bit) \n"); + (void)fprintf(stdout, "\t 3. Binary file with native integer (signed or unsigned)\n"); + (void)fprintf(stdout, "\t data (8-bit or 16-bit or 32-bit or 64-bit). \n"); + (void)fprintf(stdout, "\t 4. ASCII text file containing strings (text data).\n"); + (void)fprintf(stdout, "\t \n"); + (void)fprintf(stdout, "\t Every input file is associated with a configuration file \n"); + (void)fprintf(stdout, "\t also provided as an input to the utility. (See Section \n"); + (void)fprintf(stdout, "\t \"CONFIGURATION FILE\" to know how it is to be organized).\n"); + (void)fprintf(stdout, "\t The class, size and dimensions of the input data is \n"); + (void)fprintf(stdout, "\t specified in this configuration file. A point to note is\n"); + (void)fprintf(stdout, "\t that the floating point data in the ASCII text file may be\n"); + (void)fprintf(stdout, "\t organized in the fixed floating form (for example 323.56)\n"); + (void)fprintf(stdout, "\t or in a scientific notation (for example 3.23E+02). A \n"); + (void)fprintf(stdout, "\t different input-class specification is to be used for both\n"); + (void)fprintf(stdout, "\t forms.\n\n"); + (void)fprintf(stdout, "\t The utility extracts the input data from the input file \n"); + (void)fprintf(stdout, "\t according to the specified parameters and saves it into \n"); + (void)fprintf(stdout, "\t an H5 dataset. \n\n"); + (void)fprintf(stdout, "\t The user can specify output type and storage properties in \n"); + (void)fprintf(stdout, "\t the configuration file. The user is required to specify the \n"); + (void)fprintf(stdout, "\t path of the dataset. If the groups in the path leading to \n"); + (void)fprintf(stdout, "\t the data-set do not exist, the groups will be created by the\n"); + (void)fprintf(stdout, "\t utility. If no group is specified, the dataset will be\n"); + (void)fprintf(stdout, "\t created under the root group.\n\n"); + (void)fprintf(stdout, "\t In addition to the name, the user is also required to \n"); + (void)fprintf(stdout, "\t provide the class and size of output data to be written to \n"); + (void)fprintf(stdout, "\t the dataset and may optionally specify the output-architecture,\n"); + (void)fprintf(stdout, "\t and the output-byte-order. If output-architecture is not \n"); + (void)fprintf(stdout, "\t specified the default is NATIVE. Output-byte-orders are fixed\n"); + (void)fprintf(stdout, "\t for some architectures and may be specified only if output-\n"); + (void)fprintf(stdout, "\t architecture is IEEE, UNIX or STD.\n\n"); + (void)fprintf(stdout, "\t Also, layout and other storage properties such as \n"); + (void)fprintf(stdout, "\t compression, external storage and extendible data-sets may be\n"); + (void)fprintf(stdout, "\t optionally specified. The layout and storage properties \n"); + (void)fprintf(stdout, "\t denote how raw data is to be organized on the disk. If these \n"); + (void)fprintf(stdout, "\t options are not specified the default is Contiguous layout \n"); + (void)fprintf(stdout, "\t and storage.\n\n"); + (void)fprintf(stdout, "\t The dataset can be organized in any of the following ways:\n"); + (void)fprintf(stdout, "\t 1. Contiguous.\n"); + (void)fprintf(stdout, "\t 2. Chunked.\n"); + (void)fprintf(stdout, "\t 3. External Storage File (has to be contiguous)\n"); + (void)fprintf(stdout, "\t 4. Extendible data sets (has to be chunked)\n"); + (void)fprintf(stdout, "\t 5. Compressed. (has to be chunked)\n"); + (void)fprintf(stdout, "\t 6. Compressed & Extendible (has to be chunked)\n\n"); + (void)fprintf(stdout, "\t If the user wants to store raw data in a non-HDF file then \n"); + (void)fprintf(stdout, "\t the external storage file option is to be used and the name \n"); + (void)fprintf(stdout, "\t of the file is to be specified. \n\n"); + (void)fprintf(stdout, "\t If the user wants the dimensions of the data-set to be\n"); + (void)fprintf(stdout, "\t unlimited, the extendible data set option can be chosen. \n\n"); + (void)fprintf(stdout, "\t The user may also specify the type of compression and the \n"); + (void)fprintf(stdout, "\t level to which the data set must be compresses by setting \n"); + (void)fprintf(stdout, "\t the compressed option.\n\n"); + (void)fprintf(stdout, "\t SYNOPSIS:\n"); + (void)fprintf(stdout, "\t h5import -h[elp], OR\n"); + (void)fprintf(stdout, "\t h5import <infile> -c[onfig] <configfile> \ [<infile> -c[config] <confile2>...] -o[utfile] <outfile>\n\n"); - (void)HDfprintf(stdout, "\t -h[elp]:\n"); - (void)HDfprintf(stdout, "\t Prints this summary of usage, and exits.\n\n"); - (void)HDfprintf(stdout, "\t <infile(s)>:\n"); - (void)HDfprintf(stdout, "\t Name of the Input file(s), containing a \n"); - (void)HDfprintf(stdout, "\t single n-dimensional floating point or integer array \n"); - (void)HDfprintf(stdout, "\t in either ASCII text, native floating point(32-bit \n"); - (void)HDfprintf(stdout, "\t or 64-bit) or native integer(8-bit or 16-bit or \n"); - (void)HDfprintf(stdout, "\t 32-bit or 64-bit). Data to be specified in the order\n"); - (void)HDfprintf(stdout, "\t of fastest changing dimensions first.\n\n"); - (void)HDfprintf(stdout, "\t -c[config] <configfile>:\n"); - (void)HDfprintf(stdout, "\t Every input file should be associated with a \n"); - (void)HDfprintf(stdout, "\t configuration file and this is done by the -c option.\n"); - (void)HDfprintf(stdout, "\t <configfile> is the name of the configuration file.\n"); - (void)HDfprintf(stdout, "\t (See Section \"CONFIGURATION FILE\")\n\n"); - (void)HDfprintf(stdout, "\t -o[utfile] <outfile>:\n"); - (void)HDfprintf(stdout, "\t Name of the HDF5 output file. Data from one or more \n"); - (void)HDfprintf(stdout, "\t input files are stored as one or more data sets in \n"); - (void)HDfprintf(stdout, "\t <outfile>. The output file may be an existing file or \n"); - (void)HDfprintf(stdout, "\t it maybe new in which case it will be created.\n\n\n"); - (void)HDfprintf(stdout, "\t CONFIGURATION FILE:\n"); - (void)HDfprintf(stdout, "\t The configuration file is an ASCII text file and must be \n"); - (void)HDfprintf(stdout, "\t the ddl formatted file (without data values) produced by h5dump \n"); - (void)HDfprintf(stdout, "\t when used with the options '-o outfilename -b' of a single dataset (-d) \n"); - (void)HDfprintf(stdout, "\t OR organized as \"CONFIG-KEYWORD VALUE\" pairs, one pair on each \n"); - (void)HDfprintf(stdout, "\t line.\n\n"); - (void)HDfprintf(stdout, "\t The configuration file may have the following keywords each \n"); - (void)HDfprintf(stdout, "\t followed by an acceptable value.\n\n"); - (void)HDfprintf(stdout, "\t Required KEYWORDS:\n"); - (void)HDfprintf(stdout, "\t PATH\n"); - (void)HDfprintf(stdout, "\t INPUT-CLASS\n"); - (void)HDfprintf(stdout, "\t INPUT-SIZE\n"); - (void)HDfprintf(stdout, "\t INPUT-BYTE-ORDER\n"); - (void)HDfprintf(stdout, "\t RANK\n"); - (void)HDfprintf(stdout, "\t DIMENSION-SIZES\n"); - (void)HDfprintf(stdout, "\t OUTPUT-CLASS\n"); - (void)HDfprintf(stdout, "\t OUTPUT-SIZE\n\n"); - (void)HDfprintf(stdout, "\t Optional KEYWORDS:\n"); - (void)HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE\n"); - (void)HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER\n"); - (void)HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES\n"); - (void)HDfprintf(stdout, "\t COMPRESSION-TYPE\n"); - (void)HDfprintf(stdout, "\t COMPRESSION-PARAM\n"); - (void)HDfprintf(stdout, "\t EXTERNAL-STORAGE\n"); - (void)HDfprintf(stdout, "\t MAXIMUM-DIMENSIONS\n\n\n"); - (void)HDfprintf(stdout, "\t Values for keywords:\n"); - (void)HDfprintf(stdout, "\t PATH:\n"); - (void)HDfprintf(stdout, "\t Strings separated by spaces to represent\n"); - (void)HDfprintf(stdout, "\t the path of the data-set. If the groups in\n"); - (void)HDfprintf(stdout, "\t the path do not exist, they will be created. \n"); - (void)HDfprintf(stdout, "\t For example,\n"); - (void)HDfprintf(stdout, "\t PATH grp1/grp2/dataset1\n"); - (void)HDfprintf(stdout, "\t PATH: keyword\n"); - (void)HDfprintf(stdout, "\t grp1: group under the root. If\n"); - (void)HDfprintf(stdout, "\t non-existent will be created.\n"); - (void)HDfprintf(stdout, "\t grp2: group under grp1. If \n"); - (void)HDfprintf(stdout, "\t non-existent will be created \n"); - (void)HDfprintf(stdout, "\t under grp1.\n"); - (void)HDfprintf(stdout, "\t dataset1: the name of the data-set \n"); - (void)HDfprintf(stdout, "\t to be created.\n\n"); - (void)HDfprintf(stdout, "\t INPUT-CLASS:\n"); - (void)HDfprintf(stdout, "\t String denoting the type of input data.\n"); - (void)HDfprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"FP\", \"IN\", \n"); - (void)HDfprintf(stdout, "\t \"STR\", \"TEXTUIN\", \"UIN\"). \n"); - (void)HDfprintf(stdout, "\t INPUT-CLASS \"TEXTIN\" denotes an ASCII text \n"); - (void)HDfprintf(stdout, "\t file with signed integer data in ASCII form,\n"); - (void)HDfprintf(stdout, "\t INPUT-CLASS \"TEXTUIN\" denotes an ASCII text \n"); - (void)HDfprintf(stdout, "\t file with unsigned integer data in ASCII form,\n"); - (void)HDfprintf(stdout, "\t \"TEXTFP\" denotes an ASCII text file containing\n"); - (void)HDfprintf(stdout, "\t floating point data in the fixed notation\n"); - (void)HDfprintf(stdout, "\t (325.34),\n"); - (void)HDfprintf(stdout, "\t \"FP\" denotes a floating point binary file,\n"); - (void)HDfprintf(stdout, "\t \"IN\" denotes a signed integer binary file,\n"); - (void)HDfprintf(stdout, "\t \"UIN\" denotes an unsigned integer binary file,\n"); - (void)HDfprintf(stdout, "\t & \"STR\" denotes an ASCII text file the \n"); - (void)HDfprintf(stdout, "\t contents of which should be stored as an 1-D \n"); - (void)HDfprintf(stdout, "\t array of strings.\n"); - (void)HDfprintf(stdout, "\t If INPUT-CLASS is \"STR\", then RANK, \n"); - (void)HDfprintf(stdout, "\t DIMENSION-SIZES, OUTPUT-CLASS, OUTPUT-SIZE, \n"); - (void)HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE and OUTPUT-BYTE-ORDER \n"); - (void)HDfprintf(stdout, "\t will be ignored.\n\n\n"); - (void)HDfprintf(stdout, "\t INPUT-SIZE:\n"); - (void)HDfprintf(stdout, "\t Integer denoting the size of the input data \n"); - (void)HDfprintf(stdout, "\t (8, 16, 32, 64). \n\n"); - (void)HDfprintf(stdout, "\t For floating point,\n"); - (void)HDfprintf(stdout, "\t INPUT-SIZE can be 32 or 64.\n"); - (void)HDfprintf(stdout, "\t For integers (signed and unsigned)\n"); - (void)HDfprintf(stdout, "\t INPUT-SIZE can be 8, 16, 32 or 64.\n\n"); - (void)HDfprintf(stdout, "\t RANK:\n"); - (void)HDfprintf(stdout, "\t Integer denoting the number of dimensions.\n\n"); - (void)HDfprintf(stdout, "\t DIMENSION-SIZES:\n"); - (void)HDfprintf(stdout, "\t Integers separated by spaces to denote the \n"); - (void)HDfprintf(stdout, "\t dimension sizes for the no. of dimensions \n"); - (void)HDfprintf(stdout, "\t determined by rank.\n\n"); - (void)HDfprintf(stdout, "\t OUTPUT-CLASS:\n"); - (void)HDfprintf(stdout, "\t String dentoting data type of the dataset to \n"); - (void)HDfprintf(stdout, "\t be written (\"IN\",\"FP\", \"UIN\")\n\n"); - (void)HDfprintf(stdout, "\t OUTPUT-SIZE:\n"); - (void)HDfprintf(stdout, "\t Integer denoting the size of the data in the \n"); - (void)HDfprintf(stdout, "\t output dataset to be written.\n"); - (void)HDfprintf(stdout, "\t If OUTPUT-CLASS is \"FP\", OUTPUT-SIZE can be \n"); - (void)HDfprintf(stdout, "\t 32 or 64.\n"); - (void)HDfprintf(stdout, "\t If OUTPUT-CLASS is \"IN\" or \"UIN\", OUTPUT-SIZE\n"); - (void)HDfprintf(stdout, "\t can be 8, 16, 32 or 64.\n\n"); - (void)HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE:\n"); - (void)HDfprintf(stdout, "\t STRING denoting the type of output \n"); - (void)HDfprintf(stdout, "\t architecture. Can accept the following values\n"); - (void)HDfprintf(stdout, "\t STD\n"); - (void)HDfprintf(stdout, "\t IEEE\n"); - (void)HDfprintf(stdout, "\t INTEL\n"); - (void)HDfprintf(stdout, "\t CRAY\n"); - (void)HDfprintf(stdout, "\t MIPS\n"); - (void)HDfprintf(stdout, "\t ALPHA\n"); - (void)HDfprintf(stdout, "\t NATIVE (default)\n"); - (void)HDfprintf(stdout, "\t UNIX\n\n"); - (void)HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER:\n"); - (void)HDfprintf(stdout, "\t String denoting the output-byte-order. Ignored\n"); - (void)HDfprintf(stdout, "\t if the OUTPUT-ARCHITECTURE is not specified or\n"); - (void)HDfprintf(stdout, "\t if it is IEEE, UNIX or STD. Can accept the \n"); - (void)HDfprintf(stdout, "\t following values.\n"); - (void)HDfprintf(stdout, "\t BE (default)\n"); - (void)HDfprintf(stdout, "\t LE\n\n"); - (void)HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES:\n"); - (void)HDfprintf(stdout, "\t Integers separated by spaces to denote the \n"); - (void)HDfprintf(stdout, "\t dimension sizes of the chunk for the no. of \n"); - (void)HDfprintf(stdout, "\t dimensions determined by rank. Required field\n"); - (void)HDfprintf(stdout, "\t to denote that the dataset will be stored with\n"); - (void)HDfprintf(stdout, "\t chunked storage. If this field is absent the\n"); - (void)HDfprintf(stdout, "\t dataset will be stored with contiguous storage.\n\n"); - (void)HDfprintf(stdout, "\t COMPRESSION-TYPE:\n"); - (void)HDfprintf(stdout, "\t String denoting the type of compression to be\n"); - (void)HDfprintf(stdout, "\t used with the chunked storage. Requires the\n"); - (void)HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES to be specified. The only \n"); - (void)HDfprintf(stdout, "\t currently supported compression method is GZIP. \n"); - (void)HDfprintf(stdout, "\t Will accept the following value\n"); - (void)HDfprintf(stdout, "\t GZIP\n\n"); - (void)HDfprintf(stdout, "\t COMPRESSION-PARAM:\n"); - (void)HDfprintf(stdout, "\t Integer used to denote compression level and \n"); - (void)HDfprintf(stdout, "\t this option is to be always specified when \n"); - (void)HDfprintf(stdout, "\t the COMPRESSION-TYPE option is specified. The\n"); - (void)HDfprintf(stdout, "\t values are applicable only to GZIP \n"); - (void)HDfprintf(stdout, "\t compression.\n"); - (void)HDfprintf(stdout, "\t Value 1-9: The level of Compression. \n"); - (void)HDfprintf(stdout, "\t 1 will result in the fastest \n"); - (void)HDfprintf(stdout, "\t compression while 9 will result in \n"); - (void)HDfprintf(stdout, "\t the best compression ratio. The default\n"); - (void)HDfprintf(stdout, "\t level of compression is 6.\n\n"); - (void)HDfprintf(stdout, "\t EXTERNAL-STORAGE:\n"); - (void)HDfprintf(stdout, "\t String to denote the name of the non-HDF5 file \n"); - (void)HDfprintf(stdout, "\t to store data to. Cannot be used if CHUNKED-\n"); - (void)HDfprintf(stdout, "\t DIMENSIONS or COMPRESSION-TYPE or EXTENDIBLE-\n"); - (void)HDfprintf(stdout, "\t DATASET is specified.\n"); - (void)HDfprintf(stdout, "\t Value <external-filename>: the name of the \n"); - (void)HDfprintf(stdout, "\t external file as a string to be used.\n\n"); - (void)HDfprintf(stdout, "\t MAXIMUM-DIMENSIONS:\n"); - (void)HDfprintf(stdout, "\t Integers separated by spaces to denote the \n"); - (void)HDfprintf(stdout, "\t maximum dimension sizes of all the \n"); - (void)HDfprintf(stdout, "\t dimensions determined by rank. Requires the\n"); - (void)HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES to be specified. A value of \n"); - (void)HDfprintf(stdout, "\t -1 for any dimension implies UNLIMITED \n"); - (void)HDfprintf(stdout, "\t DIMENSION size for that particular dimension.\n\n"); - (void)HDfprintf(stdout, "\t EXAMPLES:\n"); - (void)HDfprintf(stdout, "\t 1. Configuration File may look like:\n\n"); - (void)HDfprintf(stdout, "\t PATH work h5 pkamat First-set\n"); - (void)HDfprintf(stdout, "\t INPUT-CLASS TEXTFP\n"); - (void)HDfprintf(stdout, "\t RANK 3\n"); - (void)HDfprintf(stdout, "\t DIMENSION-SIZES 5 2 4\n"); - (void)HDfprintf(stdout, "\t OUTPUT-CLASS FP\n"); - (void)HDfprintf(stdout, "\t OUTPUT-SIZE 64\n"); - (void)HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE IEEE\n"); - (void)HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER LE\n"); - (void)HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 \n\n"); - (void)HDfprintf(stdout, "\t The above configuration will accept a floating point array \n"); - (void)HDfprintf(stdout, "\t (5 x 2 x 4) in an ASCII file with the rank and dimension sizes \n"); - (void)HDfprintf(stdout, "\t specified and will save it in a chunked data-set (of pattern \n"); - (void)HDfprintf(stdout, "\t 2 X 2 X 2) of 64-bit floating point in the little-endian order \n"); - (void)HDfprintf(stdout, "\t and IEEE architecture. The dataset will be stored at\n"); - (void)HDfprintf(stdout, "\t \"/work/h5/pkamat/First-set\"\n\n"); - (void)HDfprintf(stdout, "\t 2. Another configuration could be:\n\n"); - (void)HDfprintf(stdout, "\t PATH Second-set\n"); - (void)HDfprintf(stdout, "\t INPUT-CLASS IN \n"); - (void)HDfprintf(stdout, "\t RANK 5\n"); - (void)HDfprintf(stdout, "\t DIMENSION-SIZES 6 3 5 2 4\n"); - (void)HDfprintf(stdout, "\t OUTPUT-CLASS IN\n"); - (void)HDfprintf(stdout, "\t OUTPUT-SIZE 32\n"); - (void)HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 2 2\n"); - (void)HDfprintf(stdout, "\t EXTENDIBLE-DATASET 1 3 \n"); - (void)HDfprintf(stdout, "\t COMPRESSION-TYPE GZIP\n"); - (void)HDfprintf(stdout, "\t COMPRESSION-PARAM 7\n\n\n"); - (void)HDfprintf(stdout, "\t The above configuration will accept an integer array \n"); - (void)HDfprintf(stdout, "\t (6 X 3 X 5 x 2 x 4) in a binary file with the rank and \n"); - (void)HDfprintf(stdout, "\t dimension sizes specified and will save it in a chunked data-set\n"); - (void)HDfprintf(stdout, "\t (of pattern 2 X 2 X 2 X 2 X 2) of 32-bit floating point in \n"); - (void)HDfprintf(stdout, "\t native format (as output-architecture is not specified). The \n"); - (void)HDfprintf(stdout, "\t first and the third dimension will be defined as unlimited. The \n"); - (void)HDfprintf(stdout, "\t data-set will be compressed using GZIP and a compression level \n"); - (void)HDfprintf(stdout, "\t of 7.\n"); - (void)HDfprintf(stdout, "\t The dataset will be stored at \"/Second-set\"\n\n"); + (void)fprintf(stdout, "\t -h[elp]:\n"); + (void)fprintf(stdout, "\t Prints this summary of usage, and exits.\n\n"); + (void)fprintf(stdout, "\t <infile(s)>:\n"); + (void)fprintf(stdout, "\t Name of the Input file(s), containing a \n"); + (void)fprintf(stdout, "\t single n-dimensional floating point or integer array \n"); + (void)fprintf(stdout, "\t in either ASCII text, native floating point(32-bit \n"); + (void)fprintf(stdout, "\t or 64-bit) or native integer(8-bit or 16-bit or \n"); + (void)fprintf(stdout, "\t 32-bit or 64-bit). Data to be specified in the order\n"); + (void)fprintf(stdout, "\t of fastest changing dimensions first.\n\n"); + (void)fprintf(stdout, "\t -c[config] <configfile>:\n"); + (void)fprintf(stdout, "\t Every input file should be associated with a \n"); + (void)fprintf(stdout, "\t configuration file and this is done by the -c option.\n"); + (void)fprintf(stdout, "\t <configfile> is the name of the configuration file.\n"); + (void)fprintf(stdout, "\t (See Section \"CONFIGURATION FILE\")\n\n"); + (void)fprintf(stdout, "\t -o[utfile] <outfile>:\n"); + (void)fprintf(stdout, "\t Name of the HDF5 output file. Data from one or more \n"); + (void)fprintf(stdout, "\t input files are stored as one or more data sets in \n"); + (void)fprintf(stdout, "\t <outfile>. The output file may be an existing file or \n"); + (void)fprintf(stdout, "\t it maybe new in which case it will be created.\n\n\n"); + (void)fprintf(stdout, "\t CONFIGURATION FILE:\n"); + (void)fprintf(stdout, "\t The configuration file is an ASCII text file and must be \n"); + (void)fprintf(stdout, "\t the ddl formatted file (without data values) produced by h5dump \n"); + (void)fprintf(stdout, "\t when used with the options '-o outfilename -b' of a single dataset (-d) \n"); + (void)fprintf(stdout, "\t OR organized as \"CONFIG-KEYWORD VALUE\" pairs, one pair on each \n"); + (void)fprintf(stdout, "\t line.\n\n"); + (void)fprintf(stdout, "\t The configuration file may have the following keywords each \n"); + (void)fprintf(stdout, "\t followed by an acceptable value.\n\n"); + (void)fprintf(stdout, "\t Required KEYWORDS:\n"); + (void)fprintf(stdout, "\t PATH\n"); + (void)fprintf(stdout, "\t INPUT-CLASS\n"); + (void)fprintf(stdout, "\t INPUT-SIZE\n"); + (void)fprintf(stdout, "\t INPUT-BYTE-ORDER\n"); + (void)fprintf(stdout, "\t RANK\n"); + (void)fprintf(stdout, "\t DIMENSION-SIZES\n"); + (void)fprintf(stdout, "\t OUTPUT-CLASS\n"); + (void)fprintf(stdout, "\t OUTPUT-SIZE\n\n"); + (void)fprintf(stdout, "\t Optional KEYWORDS:\n"); + (void)fprintf(stdout, "\t OUTPUT-ARCHITECTURE\n"); + (void)fprintf(stdout, "\t OUTPUT-BYTE-ORDER\n"); + (void)fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES\n"); + (void)fprintf(stdout, "\t COMPRESSION-TYPE\n"); + (void)fprintf(stdout, "\t COMPRESSION-PARAM\n"); + (void)fprintf(stdout, "\t EXTERNAL-STORAGE\n"); + (void)fprintf(stdout, "\t MAXIMUM-DIMENSIONS\n\n\n"); + (void)fprintf(stdout, "\t Values for keywords:\n"); + (void)fprintf(stdout, "\t PATH:\n"); + (void)fprintf(stdout, "\t Strings separated by spaces to represent\n"); + (void)fprintf(stdout, "\t the path of the data-set. If the groups in\n"); + (void)fprintf(stdout, "\t the path do not exist, they will be created. \n"); + (void)fprintf(stdout, "\t For example,\n"); + (void)fprintf(stdout, "\t PATH grp1/grp2/dataset1\n"); + (void)fprintf(stdout, "\t PATH: keyword\n"); + (void)fprintf(stdout, "\t grp1: group under the root. If\n"); + (void)fprintf(stdout, "\t non-existent will be created.\n"); + (void)fprintf(stdout, "\t grp2: group under grp1. If \n"); + (void)fprintf(stdout, "\t non-existent will be created \n"); + (void)fprintf(stdout, "\t under grp1.\n"); + (void)fprintf(stdout, "\t dataset1: the name of the data-set \n"); + (void)fprintf(stdout, "\t to be created.\n\n"); + (void)fprintf(stdout, "\t INPUT-CLASS:\n"); + (void)fprintf(stdout, "\t String denoting the type of input data.\n"); + (void)fprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"FP\", \"IN\", \n"); + (void)fprintf(stdout, "\t \"STR\", \"TEXTUIN\", \"UIN\"). \n"); + (void)fprintf(stdout, "\t INPUT-CLASS \"TEXTIN\" denotes an ASCII text \n"); + (void)fprintf(stdout, "\t file with signed integer data in ASCII form,\n"); + (void)fprintf(stdout, "\t INPUT-CLASS \"TEXTUIN\" denotes an ASCII text \n"); + (void)fprintf(stdout, "\t file with unsigned integer data in ASCII form,\n"); + (void)fprintf(stdout, "\t \"TEXTFP\" denotes an ASCII text file containing\n"); + (void)fprintf(stdout, "\t floating point data in the fixed notation\n"); + (void)fprintf(stdout, "\t (325.34),\n"); + (void)fprintf(stdout, "\t \"FP\" denotes a floating point binary file,\n"); + (void)fprintf(stdout, "\t \"IN\" denotes a signed integer binary file,\n"); + (void)fprintf(stdout, "\t \"UIN\" denotes an unsigned integer binary file,\n"); + (void)fprintf(stdout, "\t & \"STR\" denotes an ASCII text file the \n"); + (void)fprintf(stdout, "\t contents of which should be stored as an 1-D \n"); + (void)fprintf(stdout, "\t array of strings.\n"); + (void)fprintf(stdout, "\t If INPUT-CLASS is \"STR\", then RANK, \n"); + (void)fprintf(stdout, "\t DIMENSION-SIZES, OUTPUT-CLASS, OUTPUT-SIZE, \n"); + (void)fprintf(stdout, "\t OUTPUT-ARCHITECTURE and OUTPUT-BYTE-ORDER \n"); + (void)fprintf(stdout, "\t will be ignored.\n\n\n"); + (void)fprintf(stdout, "\t INPUT-SIZE:\n"); + (void)fprintf(stdout, "\t Integer denoting the size of the input data \n"); + (void)fprintf(stdout, "\t (8, 16, 32, 64). \n\n"); + (void)fprintf(stdout, "\t For floating point,\n"); + (void)fprintf(stdout, "\t INPUT-SIZE can be 32 or 64.\n"); + (void)fprintf(stdout, "\t For integers (signed and unsigned)\n"); + (void)fprintf(stdout, "\t INPUT-SIZE can be 8, 16, 32 or 64.\n\n"); + (void)fprintf(stdout, "\t RANK:\n"); + (void)fprintf(stdout, "\t Integer denoting the number of dimensions.\n\n"); + (void)fprintf(stdout, "\t DIMENSION-SIZES:\n"); + (void)fprintf(stdout, "\t Integers separated by spaces to denote the \n"); + (void)fprintf(stdout, "\t dimension sizes for the no. of dimensions \n"); + (void)fprintf(stdout, "\t determined by rank.\n\n"); + (void)fprintf(stdout, "\t OUTPUT-CLASS:\n"); + (void)fprintf(stdout, "\t String dentoting data type of the dataset to \n"); + (void)fprintf(stdout, "\t be written (\"IN\",\"FP\", \"UIN\")\n\n"); + (void)fprintf(stdout, "\t OUTPUT-SIZE:\n"); + (void)fprintf(stdout, "\t Integer denoting the size of the data in the \n"); + (void)fprintf(stdout, "\t output dataset to be written.\n"); + (void)fprintf(stdout, "\t If OUTPUT-CLASS is \"FP\", OUTPUT-SIZE can be \n"); + (void)fprintf(stdout, "\t 32 or 64.\n"); + (void)fprintf(stdout, "\t If OUTPUT-CLASS is \"IN\" or \"UIN\", OUTPUT-SIZE\n"); + (void)fprintf(stdout, "\t can be 8, 16, 32 or 64.\n\n"); + (void)fprintf(stdout, "\t OUTPUT-ARCHITECTURE:\n"); + (void)fprintf(stdout, "\t STRING denoting the type of output \n"); + (void)fprintf(stdout, "\t architecture. Can accept the following values\n"); + (void)fprintf(stdout, "\t STD\n"); + (void)fprintf(stdout, "\t IEEE\n"); + (void)fprintf(stdout, "\t INTEL\n"); + (void)fprintf(stdout, "\t CRAY\n"); + (void)fprintf(stdout, "\t MIPS\n"); + (void)fprintf(stdout, "\t ALPHA\n"); + (void)fprintf(stdout, "\t NATIVE (default)\n"); + (void)fprintf(stdout, "\t UNIX\n\n"); + (void)fprintf(stdout, "\t OUTPUT-BYTE-ORDER:\n"); + (void)fprintf(stdout, "\t String denoting the output-byte-order. Ignored\n"); + (void)fprintf(stdout, "\t if the OUTPUT-ARCHITECTURE is not specified or\n"); + (void)fprintf(stdout, "\t if it is IEEE, UNIX or STD. Can accept the \n"); + (void)fprintf(stdout, "\t following values.\n"); + (void)fprintf(stdout, "\t BE (default)\n"); + (void)fprintf(stdout, "\t LE\n\n"); + (void)fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES:\n"); + (void)fprintf(stdout, "\t Integers separated by spaces to denote the \n"); + (void)fprintf(stdout, "\t dimension sizes of the chunk for the no. of \n"); + (void)fprintf(stdout, "\t dimensions determined by rank. Required field\n"); + (void)fprintf(stdout, "\t to denote that the dataset will be stored with\n"); + (void)fprintf(stdout, "\t chunked storage. If this field is absent the\n"); + (void)fprintf(stdout, "\t dataset will be stored with contiguous storage.\n\n"); + (void)fprintf(stdout, "\t COMPRESSION-TYPE:\n"); + (void)fprintf(stdout, "\t String denoting the type of compression to be\n"); + (void)fprintf(stdout, "\t used with the chunked storage. Requires the\n"); + (void)fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES to be specified. The only \n"); + (void)fprintf(stdout, "\t currently supported compression method is GZIP. \n"); + (void)fprintf(stdout, "\t Will accept the following value\n"); + (void)fprintf(stdout, "\t GZIP\n\n"); + (void)fprintf(stdout, "\t COMPRESSION-PARAM:\n"); + (void)fprintf(stdout, "\t Integer used to denote compression level and \n"); + (void)fprintf(stdout, "\t this option is to be always specified when \n"); + (void)fprintf(stdout, "\t the COMPRESSION-TYPE option is specified. The\n"); + (void)fprintf(stdout, "\t values are applicable only to GZIP \n"); + (void)fprintf(stdout, "\t compression.\n"); + (void)fprintf(stdout, "\t Value 1-9: The level of Compression. \n"); + (void)fprintf(stdout, "\t 1 will result in the fastest \n"); + (void)fprintf(stdout, "\t compression while 9 will result in \n"); + (void)fprintf(stdout, "\t the best compression ratio. The default\n"); + (void)fprintf(stdout, "\t level of compression is 6.\n\n"); + (void)fprintf(stdout, "\t EXTERNAL-STORAGE:\n"); + (void)fprintf(stdout, "\t String to denote the name of the non-HDF5 file \n"); + (void)fprintf(stdout, "\t to store data to. Cannot be used if CHUNKED-\n"); + (void)fprintf(stdout, "\t DIMENSIONS or COMPRESSION-TYPE or EXTENDIBLE-\n"); + (void)fprintf(stdout, "\t DATASET is specified.\n"); + (void)fprintf(stdout, "\t Value <external-filename>: the name of the \n"); + (void)fprintf(stdout, "\t external file as a string to be used.\n\n"); + (void)fprintf(stdout, "\t MAXIMUM-DIMENSIONS:\n"); + (void)fprintf(stdout, "\t Integers separated by spaces to denote the \n"); + (void)fprintf(stdout, "\t maximum dimension sizes of all the \n"); + (void)fprintf(stdout, "\t dimensions determined by rank. Requires the\n"); + (void)fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES to be specified. A value of \n"); + (void)fprintf(stdout, "\t -1 for any dimension implies UNLIMITED \n"); + (void)fprintf(stdout, "\t DIMENSION size for that particular dimension.\n\n"); + (void)fprintf(stdout, "\t EXAMPLES:\n"); + (void)fprintf(stdout, "\t 1. Configuration File may look like:\n\n"); + (void)fprintf(stdout, "\t PATH work h5 pkamat First-set\n"); + (void)fprintf(stdout, "\t INPUT-CLASS TEXTFP\n"); + (void)fprintf(stdout, "\t RANK 3\n"); + (void)fprintf(stdout, "\t DIMENSION-SIZES 5 2 4\n"); + (void)fprintf(stdout, "\t OUTPUT-CLASS FP\n"); + (void)fprintf(stdout, "\t OUTPUT-SIZE 64\n"); + (void)fprintf(stdout, "\t OUTPUT-ARCHITECTURE IEEE\n"); + (void)fprintf(stdout, "\t OUTPUT-BYTE-ORDER LE\n"); + (void)fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 \n\n"); + (void)fprintf(stdout, "\t The above configuration will accept a floating point array \n"); + (void)fprintf(stdout, "\t (5 x 2 x 4) in an ASCII file with the rank and dimension sizes \n"); + (void)fprintf(stdout, "\t specified and will save it in a chunked data-set (of pattern \n"); + (void)fprintf(stdout, "\t 2 X 2 X 2) of 64-bit floating point in the little-endian order \n"); + (void)fprintf(stdout, "\t and IEEE architecture. The dataset will be stored at\n"); + (void)fprintf(stdout, "\t \"/work/h5/pkamat/First-set\"\n\n"); + (void)fprintf(stdout, "\t 2. Another configuration could be:\n\n"); + (void)fprintf(stdout, "\t PATH Second-set\n"); + (void)fprintf(stdout, "\t INPUT-CLASS IN \n"); + (void)fprintf(stdout, "\t RANK 5\n"); + (void)fprintf(stdout, "\t DIMENSION-SIZES 6 3 5 2 4\n"); + (void)fprintf(stdout, "\t OUTPUT-CLASS IN\n"); + (void)fprintf(stdout, "\t OUTPUT-SIZE 32\n"); + (void)fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 2 2\n"); + (void)fprintf(stdout, "\t EXTENDIBLE-DATASET 1 3 \n"); + (void)fprintf(stdout, "\t COMPRESSION-TYPE GZIP\n"); + (void)fprintf(stdout, "\t COMPRESSION-PARAM 7\n\n\n"); + (void)fprintf(stdout, "\t The above configuration will accept an integer array \n"); + (void)fprintf(stdout, "\t (6 X 3 X 5 x 2 x 4) in a binary file with the rank and \n"); + (void)fprintf(stdout, "\t dimension sizes specified and will save it in a chunked data-set\n"); + (void)fprintf(stdout, "\t (of pattern 2 X 2 X 2 X 2 X 2) of 32-bit floating point in \n"); + (void)fprintf(stdout, "\t native format (as output-architecture is not specified). The \n"); + (void)fprintf(stdout, "\t first and the third dimension will be defined as unlimited. The \n"); + (void)fprintf(stdout, "\t data-set will be compressed using GZIP and a compression level \n"); + (void)fprintf(stdout, "\t of 7.\n"); + (void)fprintf(stdout, "\t The dataset will be stored at \"/Second-set\"\n\n"); } void usage(char *name) { - (void)HDfprintf(stdout, "\nusage:\t%s -h[elp], OR\n", name); - (void)HDfprintf(stdout, "\t%s <infile> -c[onfig] <configfile> \ + (void)fprintf(stdout, "\nusage:\t%s -h[elp], OR\n", name); + (void)fprintf(stdout, "\t%s <infile> -c[onfig] <configfile> \ [<infile> -c[config] <configfile>...] -o[utfile] <outfile> \n\n", - name); + name); } diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index c7ede3c..4043c73 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -49,31 +49,31 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", requir static void usage(const char *prog) { - HDfflush(stdout); - HDfprintf(stdout, "usage: %s -i <in_file.h5> -u <in_user_file> [-o <out_file.h5>] [--clobber]\n", prog); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "Adds user block to front of an HDF5 file and creates a new concatenated file.\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "OPTIONS\n"); - HDfprintf(stdout, " -i in_file.h5 Specifies the input HDF5 file.\n"); - HDfprintf(stdout, " -u in_user_file Specifies the file to be inserted into the user block.\n"); - HDfprintf(stdout, " Can be any file format except an HDF5 format.\n"); - HDfprintf(stdout, " -o out_file.h5 Specifies the output HDF5 file.\n"); - HDfprintf(stdout, " If not specified, the user block will be concatenated in\n"); - HDfprintf(stdout, " place to the input HDF5 file.\n"); - HDfprintf(stdout, " --clobber Wipes out any existing user block before concatenating\n"); - HDfprintf(stdout, " the given user block.\n"); - HDfprintf(stdout, " The size of the new user block will be the larger of;\n"); - HDfprintf(stdout, " - the size of existing user block in the input HDF5 file\n"); - HDfprintf(stdout, " - the size of user block required by new input user file\n"); - HDfprintf(stdout, " (size = 512 x 2N, N is positive integer.)\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " -h Prints a usage message and exits.\n"); - HDfprintf(stdout, " -V Prints the HDF5 library version and exits.\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "Exit Status:\n"); - HDfprintf(stdout, " 0 Succeeded.\n"); - HDfprintf(stdout, " >0 An error occurred.\n"); + fflush(stdout); + fprintf(stdout, "usage: %s -i <in_file.h5> -u <in_user_file> [-o <out_file.h5>] [--clobber]\n", prog); + fprintf(stdout, "\n"); + fprintf(stdout, "Adds user block to front of an HDF5 file and creates a new concatenated file.\n"); + fprintf(stdout, "\n"); + fprintf(stdout, "OPTIONS\n"); + fprintf(stdout, " -i in_file.h5 Specifies the input HDF5 file.\n"); + fprintf(stdout, " -u in_user_file Specifies the file to be inserted into the user block.\n"); + fprintf(stdout, " Can be any file format except an HDF5 format.\n"); + fprintf(stdout, " -o out_file.h5 Specifies the output HDF5 file.\n"); + fprintf(stdout, " If not specified, the user block will be concatenated in\n"); + fprintf(stdout, " place to the input HDF5 file.\n"); + fprintf(stdout, " --clobber Wipes out any existing user block before concatenating\n"); + fprintf(stdout, " the given user block.\n"); + fprintf(stdout, " The size of the new user block will be the larger of;\n"); + fprintf(stdout, " - the size of existing user block in the input HDF5 file\n"); + fprintf(stdout, " - the size of user block required by new input user file\n"); + fprintf(stdout, " (size = 512 x 2N, N is positive integer.)\n"); + fprintf(stdout, "\n"); + fprintf(stdout, " -h Prints a usage message and exits.\n"); + fprintf(stdout, " -V Prints the HDF5 library version and exits.\n"); + fprintf(stdout, "\n"); + fprintf(stdout, "Exit Status:\n"); + fprintf(stdout, " 0 Succeeded.\n"); + fprintf(stdout, " >0 An error occurred.\n"); } /*------------------------------------------------------------------------- @@ -89,7 +89,7 @@ leave(int ret) { h5tools_close(); - HDexit(ret); + exit(ret); } /*------------------------------------------------------------------------- @@ -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); @@ -395,7 +395,7 @@ copy_some_to_file(int infid, int outfid, hsize_t starting, hsize_t startout, ssi res = HDfstat(infid, &sbuf); if (res < 0) { error_msg("Can't stat file \n"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* end if */ howmuch = (ssize_t)sbuf.st_size; @@ -432,12 +432,12 @@ copy_some_to_file(int infid, int outfid, hsize_t starting, hsize_t startout, ssi if (nchars <= 0) { error_msg("Read error \n"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* end if */ if (HDwrite(outfid, buf, (unsigned)nchars) < 0) { error_msg("Write error \n"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } tot += nchars; diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index d130b38..d606e94 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -50,35 +50,34 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", require static void usage(const char *prog) { - HDfflush(stdout); - HDfprintf(stdout, "usage: %s -i <in_file.h5> [-o <out_file.h5> ] [-u <out_user_file> | --delete]\n", - prog); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "Splits user file and HDF5 file into two files: user block data and HDF5 data.\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "OPTIONS\n"); - HDfprintf(stdout, " -i in_file.h5 Specifies the HDF5 as input. If the input HDF5 file\n"); - HDfprintf(stdout, " contains no user block, exit with an error message.\n"); - HDfprintf(stdout, " -o out_file.h5 Specifies output HDF5 file without a user block.\n"); - HDfprintf(stdout, " If not specified, the user block will be removed from the\n"); - HDfprintf(stdout, " input HDF5 file.\n"); - HDfprintf(stdout, " -u out_user_file\n"); - HDfprintf(stdout, " Specifies the output file containing the data from the\n"); - HDfprintf(stdout, " user block.\n"); - HDfprintf(stdout, " Cannot be used with --delete option.\n"); - HDfprintf(stdout, " --delete Remove the user block from the input HDF5 file. The content\n"); - HDfprintf(stdout, " of the user block is discarded.\n"); - HDfprintf(stdout, " Cannot be used with the -u option.\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " -h Prints a usage message and exits.\n"); - HDfprintf(stdout, " -V Prints the HDF5 library version and exits.\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " If neither --delete nor -u is specified, the user block from the input file\n"); - HDfprintf(stdout, " will be displayed to stdout.\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "Exit Status:\n"); - HDfprintf(stdout, " 0 Succeeded.\n"); - HDfprintf(stdout, " >0 An error occurred.\n"); + fflush(stdout); + fprintf(stdout, "usage: %s -i <in_file.h5> [-o <out_file.h5> ] [-u <out_user_file> | --delete]\n", prog); + fprintf(stdout, "\n"); + fprintf(stdout, "Splits user file and HDF5 file into two files: user block data and HDF5 data.\n"); + fprintf(stdout, "\n"); + fprintf(stdout, "OPTIONS\n"); + fprintf(stdout, " -i in_file.h5 Specifies the HDF5 as input. If the input HDF5 file\n"); + fprintf(stdout, " contains no user block, exit with an error message.\n"); + fprintf(stdout, " -o out_file.h5 Specifies output HDF5 file without a user block.\n"); + fprintf(stdout, " If not specified, the user block will be removed from the\n"); + fprintf(stdout, " input HDF5 file.\n"); + fprintf(stdout, " -u out_user_file\n"); + fprintf(stdout, " Specifies the output file containing the data from the\n"); + fprintf(stdout, " user block.\n"); + fprintf(stdout, " Cannot be used with --delete option.\n"); + fprintf(stdout, " --delete Remove the user block from the input HDF5 file. The content\n"); + fprintf(stdout, " of the user block is discarded.\n"); + fprintf(stdout, " Cannot be used with the -u option.\n"); + fprintf(stdout, "\n"); + fprintf(stdout, " -h Prints a usage message and exits.\n"); + fprintf(stdout, " -V Prints the HDF5 library version and exits.\n"); + fprintf(stdout, "\n"); + fprintf(stdout, " If neither --delete nor -u is specified, the user block from the input file\n"); + fprintf(stdout, " will be displayed to stdout.\n"); + fprintf(stdout, "\n"); + fprintf(stdout, "Exit Status:\n"); + fprintf(stdout, " 0 Succeeded.\n"); + fprintf(stdout, " >0 An error occurred.\n"); } /*------------------------------------------------------------------------- @@ -145,11 +144,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; } @@ -158,7 +157,7 @@ static void leave(int ret) { h5tools_close(); - HDexit(ret); + exit(ret); } /*------------------------------------------------------------------------- @@ -283,13 +282,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 5d9e184..719c296 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -916,8 +916,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)); @@ -929,8 +929,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; @@ -957,13 +957,13 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) else if (H5T_SGN_NONE == H5Tget_sign(native)) { unsigned long long copy; - HDmemcpy(©, value + i * dst_size, sizeof(copy)); + memcpy(©, value + i * dst_size, sizeof(copy)); h5tools_str_append(buffer, "%llu", copy); } else { long long copy; - HDmemcpy(©, value + i * dst_size, sizeof(copy)); + memcpy(©, value + i * dst_size, sizeof(copy)); h5tools_str_append(buffer, "%lld", copy); } } @@ -971,8 +971,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, ""); @@ -1178,7 +1178,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 */ @@ -1186,7 +1186,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"); @@ -1324,8 +1324,8 @@ dump_dataset_values(hid_t dset) f_type = H5Dget_type(dset); space = H5Dget_space(dset); - HDmemset(&ctx, 0, sizeof(ctx)); - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&ctx, 0, sizeof(ctx)); + memset(&buffer, 0, sizeof(h5tools_str_t)); outputformat = *info; outputformat.line_1st = NULL; @@ -1431,17 +1431,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 { @@ -1493,8 +1493,8 @@ dump_attribute_values(hid_t attr) f_type = H5Aget_type(attr); space = H5Aget_space(attr); - HDmemset(&ctx, 0, sizeof(ctx)); - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&ctx, 0, sizeof(ctx)); + memset(&buffer, 0, sizeof(h5tools_str_t)); outputformat = *info; outputformat.line_1st = NULL; @@ -1601,10 +1601,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(); } @@ -1613,7 +1613,7 @@ dump_attribute_values(hid_t attr) PRINTVALSTREAM(rawoutstream, "\n"); ctx.indent_level--; - HDfree(ref_buf); + free(ref_buf); } } else { @@ -1666,8 +1666,8 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain H5TOOLS_START_DEBUG(" "); - HDmemset(&ctx, 0, sizeof(ctx)); - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&ctx, 0, sizeof(ctx)); + memset(&buffer, 0, sizeof(h5tools_str_t)); ctx.indent_level = 2; ctx.cur_column = (size_t)curr_pos; @@ -1772,8 +1772,8 @@ dataset_list1(hid_t dset) h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - HDmemset(&ctx, 0, sizeof(ctx)); - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&ctx, 0, sizeof(ctx)); + memset(&buffer, 0, sizeof(h5tools_str_t)); h5tools_str_reset(&buffer); @@ -1844,8 +1844,8 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - HDmemset(&ctx, 0, sizeof(ctx)); - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&ctx, 0, sizeof(ctx)); + memset(&buffer, 0, sizeof(h5tools_str_t)); h5tools_str_reset(&buffer); @@ -2051,8 +2051,8 @@ datatype_list2(hid_t type, const char H5_ATTR_UNUSED *name) h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - HDmemset(&ctx, 0, sizeof(ctx)); - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&ctx, 0, sizeof(ctx)); + memset(&buffer, 0, sizeof(h5tools_str_t)); h5tools_str_reset(&buffer); @@ -2088,8 +2088,8 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi H5TOOLS_START_DEBUG(" "); - HDmemset(&ctx, 0, sizeof(ctx)); - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&ctx, 0, sizeof(ctx)); + memset(&buffer, 0, sizeof(h5tools_str_t)); h5tools_str_reset(&buffer); @@ -2203,7 +2203,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) { @@ -2215,7 +2215,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); } } } @@ -2266,13 +2266,13 @@ list_lnk(const char *name, const H5L_info2_t *linfo, void *_iter) h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - HDmemset(&ctx, 0, sizeof(ctx)); - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&ctx, 0, sizeof(ctx)); + memset(&buffer, 0, sizeof(h5tools_str_t)); h5tools_str_reset(&buffer); /* init linkinfo struct */ - HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t)); + memset(&lnk_info, 0, sizeof(h5tool_link_info_t)); /* if verbose, make H5tools_get_symlink_info() display more */ if (verbose_g) @@ -2429,7 +2429,7 @@ done: h5tools_str_close(&buffer); if (buf) - HDfree(buf); + free(buf); return 0; } /* end list_lnk() */ @@ -2452,8 +2452,8 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - HDmemset(&ctx, 0, sizeof(ctx)); - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&ctx, 0, sizeof(ctx)); + memset(&buffer, 0, sizeof(h5tools_str_t)); h5tools_str_reset(&buffer); @@ -2596,14 +2596,14 @@ is_valid_args(void) hbool_t ret = TRUE; if (recursive_g && grp_literal_g) { - HDfprintf(rawerrorstream, "Error: 'recursive' option not compatible with 'group info' option!\n\n"); + fprintf(rawerrorstream, "Error: 'recursive' option not compatible with 'group info' option!\n\n"); ret = FALSE; goto out; } if (no_dangling_link_g && !follow_symlink_g) { - HDfprintf(rawerrorstream, - "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n"); + fprintf(rawerrorstream, + "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n"); ret = FALSE; goto out; } @@ -2625,7 +2625,7 @@ leave(int ret) { h5tools_close(); - HDexit(ret); + exit(ret); } /*------------------------------------------------------------------------- @@ -2684,8 +2684,8 @@ main(int argc, char *argv[]) h5tools_init(); /* Initialize fapl info structs */ - HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t)); - HDmemset(&vfd_info, 0, sizeof(h5tools_vfd_info_t)); + memset(&vol_info, 0, sizeof(h5tools_vol_info_t)); + memset(&vfd_info, 0, sizeof(h5tools_vfd_info_t)); /* Build object display table */ DISPATCH(H5O_TYPE_GROUP, "Group", NULL, NULL); @@ -2749,7 +2749,7 @@ main(int argc, char *argv[]) } else if (!HDstrncmp(argv[argno], "--vol-value=", (size_t)12)) { vol_info.type = VOL_BY_VALUE; - vol_info.u.value = (H5VL_class_value_t)HDatoi(argv[argno] + 12); + vol_info.u.value = (H5VL_class_value_t)atoi(argv[argno] + 12); custom_vol_fapl = TRUE; } else if (!HDstrncmp(argv[argno], "--vol-name=", (size_t)11)) { @@ -2767,7 +2767,7 @@ main(int argc, char *argv[]) } else if (!HDstrncmp(argv[argno], "--vfd-value=", (size_t)12)) { vfd_info.type = VFD_BY_VALUE; - vfd_info.u.value = (H5FD_class_value_t)HDatoi(argv[argno] + 12); + vfd_info.u.value = (H5FD_class_value_t)atoi(argv[argno] + 12); custom_vfd_fapl = TRUE; } else if (!HDstrncmp(argv[argno], "--vfd-name=", (size_t)11)) { @@ -2839,23 +2839,23 @@ main(int argc, char *argv[]) start = strchr(argv[argno], '='); if (start == NULL) { - HDfprintf(rawerrorstream, - "Error: Unable to parse null credentials tuple\n" - " For anonymous access, omit \"--s3-cred\" and use only \"--vfd=ros3\"\n\n"); + fprintf(rawerrorstream, + "Error: Unable to parse null credentials tuple\n" + " For anonymous access, omit \"--s3-cred\" and use only \"--vfd=ros3\"\n\n"); usage(); leave(EXIT_FAILURE); } start++; if (h5tools_parse_ros3_fapl_tuple(start, ',', &ros3_fa) < 0) { - HDfprintf(rawerrorstream, "Error: failed to parse S3 VFD credential info\n\n"); + fprintf(rawerrorstream, "Error: failed to parse S3 VFD credential info\n\n"); usage(); leave(EXIT_FAILURE); } vfd_info.info = &ros3_fa; #else - HDfprintf(rawerrorstream, "Error: Read-Only S3 VFD is not enabled\n\n"); + fprintf(rawerrorstream, "Error: Read-Only S3 VFD is not enabled\n\n"); usage(); leave(EXIT_FAILURE); #endif @@ -2871,14 +2871,14 @@ main(int argc, char *argv[]) } if (h5tools_parse_hdfs_fapl_tuple(start, ',', &hdfs_fa) < 0) { - HDfprintf(rawerrorstream, "Error: failed to parse HDFS VFD configuration info\n\n"); + fprintf(rawerrorstream, "Error: failed to parse HDFS VFD configuration info\n\n"); usage(); leave(EXIT_FAILURE); } vfd_info.info = &hdfs_fa; #else - HDfprintf(rawerrorstream, "Error: The HDFS VFD is not enabled\n\n"); + fprintf(rawerrorstream, "Error: The HDFS VFD is not enabled\n\n"); usage(); leave(EXIT_FAILURE); #endif @@ -2955,7 +2955,7 @@ main(int argc, char *argv[]) } /* end for */ } else { - HDfprintf(stderr, "Unknown argument: %s\n", argv[argno]); + fprintf(stderr, "Unknown argument: %s\n", argv[argno]); usage(); leave(EXIT_FAILURE); } @@ -3043,8 +3043,8 @@ main(int argc, char *argv[]) } /* end while */ if (file_id < 0) { - HDfprintf(rawerrorstream, "%s: unable to open file\n", argv[argno - 1]); - HDfree(fname); + fprintf(rawerrorstream, "%s: unable to open file\n", argv[argno - 1]); + free(fname); err_exit = 1; continue; } /* end if */ @@ -3056,7 +3056,7 @@ main(int argc, char *argv[]) iter.base_len -= oname[iter.base_len - 1] == '/'; x = oname; if (NULL == (oname = HDstrdup(oname))) { - HDfprintf(rawerrorstream, "memory allocation failed\n"); + fprintf(rawerrorstream, "memory allocation failed\n"); leave(EXIT_FAILURE); } *x = '\0'; @@ -3095,8 +3095,8 @@ main(int argc, char *argv[]) h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - HDmemset(&ctx, 0, sizeof(ctx)); - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + memset(&ctx, 0, sizeof(ctx)); + memset(&buffer, 0, sizeof(h5tools_str_t)); h5tools_str_reset(&buffer); print_obj_name(&buffer, &iter, oname, "**NOT FOUND**"); @@ -3121,17 +3121,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) @@ -3140,7 +3140,7 @@ main(int argc, char *argv[]) if (fapl_id != H5P_DEFAULT) { if (0 < H5Pclose(fapl_id)) { - HDfprintf(rawerrorstream, "Error: Unable to set close fapl entry\n\n"); + fprintf(rawerrorstream, "Error: Unable to set close fapl entry\n\n"); leave(EXIT_FAILURE); } } diff --git a/tools/src/h5perf/pio_engine.c b/tools/src/h5perf/pio_engine.c index 2238aac..d6d075f 100644 --- a/tools/src/h5perf/pio_engine.c +++ b/tools/src/h5perf/pio_engine.c @@ -62,8 +62,8 @@ } #define ERRMSG(mesg) \ { \ - HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \ - HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", mesg, (int)__LINE__, __FILE__); \ + fprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \ + fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", mesg, (int)__LINE__, __FILE__); \ } /* verify: if val is false (0), print mesg. */ @@ -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) { @@ -184,7 +184,7 @@ do_pio(parameters param) break; default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", iot); + fprintf(stderr, "Unknown IO type request (%d)\n", iot); GOTOERROR(FAIL); } @@ -203,66 +203,66 @@ do_pio(parameters param) } if (param.num_files < 0) { - HDfprintf(stderr, "number of files must be >= 0 (%ld)\n", param.num_files); + fprintf(stderr, "number of files must be >= 0 (%ld)\n", param.num_files); GOTOERROR(FAIL); } if (ndsets < 0) { - HDfprintf(stderr, "number of datasets per file must be >= 0 (%ld)\n", ndsets); + fprintf(stderr, "number of datasets per file must be >= 0 (%ld)\n", ndsets); GOTOERROR(FAIL); } if (param.num_procs <= 0) { - HDfprintf(stderr, "maximum number of process to use must be > 0 (%d)\n", param.num_procs); + fprintf(stderr, "maximum number of process to use must be > 0 (%d)\n", param.num_procs); GOTOERROR(FAIL); } /* Validate transfer buffer size & block size*/ if (blk_size <= 0) { - HDfprintf(stderr, "Transfer block size (%zu) must be > 0\n", blk_size); + fprintf(stderr, "Transfer block size (%zu) must be > 0\n", blk_size); GOTOERROR(FAIL); } if (buf_size <= 0) { - HDfprintf(stderr, "Transfer buffer size (%zu) must be > 0\n", buf_size); + fprintf(stderr, "Transfer buffer size (%zu) must be > 0\n", buf_size); GOTOERROR(FAIL); } if ((buf_size % blk_size) != 0) { - HDfprintf(stderr, - "Transfer buffer size (%zu) must be a multiple of the " - "interleaved I/O block size (%zu)\n", - buf_size, blk_size); + fprintf(stderr, + "Transfer buffer size (%zu) must be a multiple of the " + "interleaved I/O block size (%zu)\n", + buf_size, blk_size); GOTOERROR(FAIL); } if ((snbytes % pio_mpi_nprocs_g) != 0) { - HDfprintf(stderr, - "Dataset size (%lld) must be a multiple of the " - "number of processes (%d)\n", - (long long)snbytes, pio_mpi_nprocs_g); + fprintf(stderr, + "Dataset size (%lld) must be a multiple of the " + "number of processes (%d)\n", + (long long)snbytes, pio_mpi_nprocs_g); GOTOERROR(FAIL); } if (!param.dim2d) { if (((size_t)(snbytes / pio_mpi_nprocs_g) % buf_size) != 0) { - HDfprintf(stderr, - "Dataset size/process (%lld) must be a multiple of the " - "transfer buffer size (%zu)\n", - (long long)(snbytes / pio_mpi_nprocs_g), buf_size); + fprintf(stderr, + "Dataset size/process (%lld) must be a multiple of the " + "transfer buffer size (%zu)\n", + (long long)(snbytes / pio_mpi_nprocs_g), buf_size); GOTOERROR(FAIL); } } else { if (((size_t)snbytes % buf_size) != 0) { - HDfprintf(stderr, - "Dataset side size (%lld) must be a multiple of the " - "transfer buffer size (%zu)\n", - (long long)snbytes, buf_size); + fprintf(stderr, + "Dataset side size (%lld) must be a multiple of the " + "transfer buffer size (%zu)\n", + (long long)snbytes, buf_size); GOTOERROR(FAIL); } } /* Allocate transfer buffer */ if ((buffer = malloc(bsize)) == NULL) { - HDfprintf(stderr, "malloc for transfer buffer size (%zu) failed\n", bsize); + fprintf(stderr, "malloc for transfer buffer size (%zu) failed\n", bsize); GOTOERROR(FAIL); } @@ -273,7 +273,7 @@ do_pio(parameters param) /* output all of the times for all iterations */ if (myrank == 0) - HDfprintf(output, "Timer details:\n"); + fprintf(output, "Timer details:\n"); } for (nf = 1; nf <= param.num_files; nf++) { @@ -286,7 +286,7 @@ do_pio(parameters param) HDsnprintf(base_name, sizeof(base_name), "#pio_tmp_%lu", nf); pio_create_filename(iot, base_name, fname, FILENAME_MAX); if (pio_debug_level > 0) - HDfprintf(output, "rank %d: data filename=%s\n", pio_mpi_rank_g, fname); + fprintf(output, "rank %d: data filename=%s\n", pio_mpi_rank_g, fname); /* Need barrier to make sure everyone starts at the same time */ MPI_Barrier(pio_comm_g); @@ -366,8 +366,8 @@ done: } /* release generic resources */ - HDfree(buffer); - HDfree(fname); + free(buffer); + free(fname); res.ret_code = ret_code; return res; } @@ -391,7 +391,7 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si if (!base_name || !fullname || size < 1) return NULL; - HDmemset(fullname, 0, size); + memset(fullname, 0, size); switch (iot) { case POSIXIO: @@ -601,7 +601,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby /* Prepare buffer for verifying data */ if (parms->verify) - HDmemset(buffer, pio_mpi_rank_g + 1, buf_size * blk_size); + memset(buffer, pio_mpi_rank_g + 1, buf_size * blk_size); } /* end else */ /* Calculate the total number of bytes (bytes_count) to be @@ -621,17 +621,17 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby if (pio_debug_level >= 4) { HDprint_rank(output); if (!parms->dim2d) { - HDfprintf(output, - "Debug(do_write): " - "buf_size=%zu, bytes_begin=%lld, bytes_count=%lld\n", - buf_size, (long long)bytes_begin[0], (long long)bytes_count); + fprintf(output, + "Debug(do_write): " + "buf_size=%zu, bytes_begin=%lld, bytes_count=%lld\n", + buf_size, (long long)bytes_begin[0], (long long)bytes_count); } else { - HDfprintf(output, - "Debug(do_write): " - "linear buf_size=%zu, bytes_begin=(%lld,%lld), bytes_count=%lld\n", - buf_size * blk_size, (long long)bytes_begin[0], (long long)bytes_begin[1], - (long long)bytes_count); + fprintf(output, + "Debug(do_write): " + "linear buf_size=%zu, bytes_begin=(%lld,%lld), bytes_count=%lld\n", + buf_size * blk_size, (long long)bytes_begin[0], (long long)bytes_begin[1], + (long long)bytes_count); } } @@ -831,7 +831,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby /* Create the dataset transfer property list */ h5dxpl = H5Pcreate(H5P_DATASET_XFER); if (h5dxpl < 0) { - HDfprintf(stderr, "HDF5 Property List Create failed\n"); + fprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } @@ -839,7 +839,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby if (parms->collective) { hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Property List Set failed\n"); + fprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* end if */ } /* end if */ @@ -864,7 +864,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby case PHDF5: h5dcpl = H5Pcreate(H5P_DATASET_CREATE); if (h5dcpl < 0) { - HDfprintf(stderr, "HDF5 Property List Create failed\n"); + fprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } /* 1D dataspace */ @@ -875,7 +875,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby h5dims[0] = blk_size; hrc = H5Pset_chunk(h5dcpl, 1, h5dims); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Property List Set failed\n"); + fprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* end if */ } /* end if */ @@ -888,7 +888,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby h5dims[1] = blk_size; hrc = H5Pset_chunk(h5dcpl, 2, h5dims); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Property List Set failed\n"); + fprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* end if */ } /* end if */ @@ -898,14 +898,14 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby h5ds_id = H5DCREATE(fd->h5fd, dname, ELMT_H5_TYPE, h5dset_space_id, h5dcpl); if (h5ds_id < 0) { - HDfprintf(stderr, "HDF5 Dataset Create failed\n"); + fprintf(stderr, "HDF5 Dataset Create failed\n"); GOTOERROR(FAIL); } hrc = H5Pclose(h5dcpl); /* verifying the close of the dcpl */ if (hrc < 0) { - HDfprintf(stderr, "HDF5 Property List Close failed\n"); + fprintf(stderr, "HDF5 Property List Close failed\n"); GOTOERROR(FAIL); } break; @@ -1407,7 +1407,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby hrc = H5Dclose(h5ds_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Close failed\n"); + fprintf(stderr, "HDF5 Dataset Close failed\n"); GOTOERROR(FAIL); } @@ -1464,7 +1464,7 @@ done: if (h5dset_space_id != -1) { hrc = H5Sclose(h5dset_space_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Space Close failed\n"); + fprintf(stderr, "HDF5 Dataset Space Close failed\n"); ret_code = FAIL; } else { @@ -1475,7 +1475,7 @@ done: if (h5mem_space_id != -1) { hrc = H5Sclose(h5mem_space_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Memory Space Close failed\n"); + fprintf(stderr, "HDF5 Memory Space Close failed\n"); ret_code = FAIL; } else { @@ -1486,7 +1486,7 @@ done: if (h5dxpl != -1) { hrc = H5Pclose(h5dxpl); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); + fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); ret_code = FAIL; } else { @@ -1631,17 +1631,17 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt if (pio_debug_level >= 4) { HDprint_rank(output); if (!parms->dim2d) { - HDfprintf(output, - "Debug(do_write): " - "buf_size=%zu, bytes_begin=%lld, bytes_count=%lld\n", - buf_size, (long long)bytes_begin[0], (long long)bytes_count); + fprintf(output, + "Debug(do_write): " + "buf_size=%zu, bytes_begin=%lld, bytes_count=%lld\n", + buf_size, (long long)bytes_begin[0], (long long)bytes_count); } else { - HDfprintf(output, - "Debug(do_write): " - "linear buf_size=%zu, bytes_begin=(%lld,%lld), bytes_count=%lld\n", - buf_size * blk_size, (long long)bytes_begin[0], (long long)bytes_begin[1], - (long long)bytes_count); + fprintf(output, + "Debug(do_write): " + "linear buf_size=%zu, bytes_begin=(%lld,%lld), bytes_count=%lld\n", + buf_size * blk_size, (long long)bytes_begin[0], (long long)bytes_begin[1], + (long long)bytes_count); } } @@ -1839,7 +1839,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt /* Create the dataset transfer property list */ h5dxpl = H5Pcreate(H5P_DATASET_XFER); if (h5dxpl < 0) { - HDfprintf(stderr, "HDF5 Property List Create failed\n"); + fprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } @@ -1847,7 +1847,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt if (parms->collective) { hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Property List Set failed\n"); + fprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* end if */ } /* end if */ @@ -1873,7 +1873,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt HDsnprintf(dname, sizeof(dname), "Dataset_%ld", ndset); h5ds_id = H5DOPEN(fd->h5fd, dname); if (h5ds_id < 0) { - HDfprintf(stderr, "HDF5 Dataset open failed\n"); + fprintf(stderr, "HDF5 Dataset open failed\n"); GOTOERROR(FAIL); } break; @@ -2369,17 +2369,17 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt if (++nerror < 20) { /* report at most 20 errors */ HDprint_rank(output); - HDfprintf(output, - "read data error, expected (%d), " - "got (%d)\n", - pio_mpi_rank_g + 1, (int)*(ucharptr - 1)); + fprintf(output, + "read data error, expected (%d), " + "got (%d)\n", + pio_mpi_rank_g + 1, (int)*(ucharptr - 1)); } /* end if */ } /* end if */ } /* end for */ if (nerror >= 20) { HDprint_rank(output); - HDfprintf(output, "..."); - HDfprintf(output, "total read data errors=%d\n", nerror); + fprintf(output, "..."); + fprintf(output, "total read data errors=%d\n", nerror); } /* end if */ } /* if (parms->verify) */ @@ -2395,7 +2395,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt hrc = H5Dclose(h5ds_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Close failed\n"); + fprintf(stderr, "HDF5 Dataset Close failed\n"); GOTOERROR(FAIL); } @@ -2452,7 +2452,7 @@ done: if (h5dset_space_id != -1) { hrc = H5Sclose(h5dset_space_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Space Close failed\n"); + fprintf(stderr, "HDF5 Dataset Space Close failed\n"); ret_code = FAIL; } else { @@ -2463,7 +2463,7 @@ done: if (h5mem_space_id != -1) { hrc = H5Sclose(h5mem_space_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Memory Space Close failed\n"); + fprintf(stderr, "HDF5 Memory Space Close failed\n"); ret_code = FAIL; } else { @@ -2474,7 +2474,7 @@ done: if (h5dxpl != -1) { hrc = H5Pclose(h5dxpl); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); + fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); ret_code = FAIL; } else { @@ -2505,7 +2505,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) fd->posixfd = POSIXOPEN(fname, O_RDONLY); if (fd->posixfd < 0) { - HDfprintf(stderr, "POSIX File Open failed(%s)\n", fname); + fprintf(stderr, "POSIX File Open failed(%s)\n", fname); GOTOERROR(FAIL); } @@ -2528,7 +2528,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) &fd->mpifd); if (mrc != MPI_SUCCESS) { - HDfprintf(stderr, "MPI File Open failed(%s)\n", fname); + fprintf(stderr, "MPI File Open failed(%s)\n", fname); GOTOERROR(FAIL); } @@ -2536,14 +2536,14 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) /*filesize , set size to 0 explicitedly. */ mrc = MPI_File_set_size(fd->mpifd, (MPI_Offset)0); if (mrc != MPI_SUCCESS) { - HDfprintf(stderr, "MPI_File_set_size failed\n"); + fprintf(stderr, "MPI_File_set_size failed\n"); GOTOERROR(FAIL); } } else { mrc = MPI_File_open(pio_comm_g, fname, MPI_MODE_RDONLY, h5_io_info_g, &fd->mpifd); if (mrc != MPI_SUCCESS) { - HDfprintf(stderr, "MPI File Open failed(%s)\n", fname); + fprintf(stderr, "MPI File Open failed(%s)\n", fname); GOTOERROR(FAIL); } } @@ -2552,19 +2552,19 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) case PHDF5: if ((acc_tpl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - HDfprintf(stderr, "HDF5 Property List Create failed\n"); + fprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } /* Set the file driver to the MPI-IO driver */ if (H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g) < 0) { - HDfprintf(stderr, "HDF5 Property List Set failed\n"); + fprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* Set the alignment of objects in HDF5 file */ if (H5Pset_alignment(acc_tpl, param->h5_thresh, param->h5_align) < 0) { - HDfprintf(stderr, "HDF5 Property List Set failed\n"); + fprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } @@ -2574,13 +2574,13 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) else fd->h5fd = H5Fopen(fname, H5F_ACC_RDONLY, acc_tpl); if (fd->h5fd < 0) { - HDfprintf(stderr, "HDF5 File Create failed(%s)\n", fname); + fprintf(stderr, "HDF5 File Create failed(%s)\n", fname); GOTOERROR(FAIL); } /* verifying the close of the acc_tpl */ if (H5Pclose(acc_tpl) < 0) { - HDfprintf(stderr, "HDF5 Property List Close failed\n"); + fprintf(stderr, "HDF5 Property List Close failed\n"); GOTOERROR(FAIL); } @@ -2611,7 +2611,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) rc = POSIXCLOSE(fd->posixfd); if (rc != 0) { - HDfprintf(stderr, "POSIX File Close failed\n"); + fprintf(stderr, "POSIX File Close failed\n"); GOTOERROR(FAIL); } @@ -2622,7 +2622,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) mrc = MPI_File_close(&fd->mpifd); if (mrc != MPI_SUCCESS) { - HDfprintf(stderr, "MPI File close failed\n"); + fprintf(stderr, "MPI File close failed\n"); GOTOERROR(FAIL); } @@ -2633,7 +2633,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) hrc = H5Fclose(fd->h5fd); if (hrc < 0) { - HDfprintf(stderr, "HDF5 File Close failed\n"); + fprintf(stderr, "HDF5 File Close failed\n"); GOTOERROR(FAIL); } diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c index d4b302e..fee0a61 100644 --- a/tools/src/h5perf/pio_perf.c +++ b/tools/src/h5perf/pio_perf.c @@ -224,12 +224,12 @@ main(int argc, char *argv[]) ret = MPI_Comm_size(MPI_COMM_WORLD, &comm_world_nprocs_g); if (ret != MPI_SUCCESS) { - HDfprintf(stderr, "%s: MPI_Comm_size call failed\n", progname); + fprintf(stderr, "%s: MPI_Comm_size call failed\n", progname); if (ret == MPI_ERR_COMM) - HDfprintf(stderr, "invalid MPI communicator\n"); + fprintf(stderr, "invalid MPI communicator\n"); else - HDfprintf(stderr, "invalid argument\n"); + fprintf(stderr, "invalid argument\n"); exit_value = EXIT_FAILURE; goto finish; @@ -238,12 +238,12 @@ main(int argc, char *argv[]) ret = MPI_Comm_rank(MPI_COMM_WORLD, &comm_world_rank_g); if (ret != MPI_SUCCESS) { - HDfprintf(stderr, "%s: MPI_Comm_rank call failed\n", progname); + fprintf(stderr, "%s: MPI_Comm_rank call failed\n", progname); if (ret == MPI_ERR_COMM) - HDfprintf(stderr, "invalid MPI communicator\n"); + fprintf(stderr, "invalid MPI communicator\n"); else - HDfprintf(stderr, "invalid argument\n"); + fprintf(stderr, "invalid argument\n"); exit_value = EXIT_FAILURE; goto finish; @@ -260,8 +260,8 @@ main(int argc, char *argv[]) } if (opts->output_file) { - if ((output = HDfopen(opts->output_file, "w")) == NULL) { - HDfprintf(stderr, "%s: cannot open output file\n", progname); + if ((output = fopen(opts->output_file, "w")) == NULL) { + fprintf(stderr, "%s: cannot open output file\n", progname); perror(opts->output_file); goto finish; } @@ -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 == ';') @@ -805,16 +805,16 @@ h5_set_info_object(void) /* actually set the darned thing */ if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) { - HDprintf("MPI_Info_set failed\n"); + printf("MPI_Info_set failed\n"); ret_value = -1; } } valp = next; - HDfree(key_val); + free(key_val); } while (next && *next); - HDfree(envp); + free(envp); } return ret_value; @@ -834,17 +834,17 @@ h5_dump_info_object(MPI_Info info) int flag; int i, nkeys; - HDprintf("Dumping MPI Info Object (up to %d bytes per item):\n", MPI_MAX_INFO_VAL); + printf("Dumping MPI Info Object (up to %d bytes per item):\n", MPI_MAX_INFO_VAL); if (info == MPI_INFO_NULL) { - HDprintf("object is MPI_INFO_NULL\n"); + printf("object is MPI_INFO_NULL\n"); } else { MPI_Info_get_nkeys(info, &nkeys); - HDprintf("object has %d items\n", nkeys); + printf("object has %d items\n", nkeys); for (i = 0; i < nkeys; i++) { MPI_Info_get_nthkey(info, i, key); MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag); - HDprintf("%s=%s\n", key, value); + printf("%s=%s\n", key, value); } } } @@ -926,8 +926,8 @@ create_comm_world(int num_procs, int *doing_pio) MPI_Comm_size(MPI_COMM_WORLD, &nprocs); if (num_procs > nprocs) { - HDfprintf(stderr, "number of process(%d) must be <= number of processes in MPI_COMM_WORLD(%d)\n", - num_procs, nprocs); + fprintf(stderr, "number of process(%d) must be <= number of processes in MPI_COMM_WORLD(%d)\n", + num_procs, nprocs); goto error_done; } @@ -936,7 +936,7 @@ create_comm_world(int num_procs, int *doing_pio) mrc = MPI_Comm_split(MPI_COMM_WORLD, color, myrank, &pio_comm_g); if (mrc != MPI_SUCCESS) { - HDfprintf(stderr, "MPI_Comm_split failed\n"); + fprintf(stderr, "MPI_Comm_split failed\n"); goto error_done; } @@ -1059,11 +1059,11 @@ output_report(const char *fmt, ...) if (myrank == 0) { va_list ap; - HDva_start(ap, fmt); + va_start(ap, fmt); H5_GCC_CLANG_DIAG_OFF("format-nonliteral") HDvfprintf(output, fmt, ap); H5_GCC_CLANG_DIAG_ON("format-nonliteral") - HDva_end(ap); + va_end(ap); } } @@ -1095,28 +1095,28 @@ recover_size_and_print(long long val, const char *end) if (val >= ONE_KB && (val % ONE_KB) == 0) { if (val >= ONE_MB && (val % ONE_MB) == 0) { if (val >= ONE_GB && (val % ONE_GB) == 0) - HDfprintf(output, - "%lld" - "GB%s", - val / ONE_GB, end); + fprintf(output, + "%lld" + "GB%s", + val / ONE_GB, end); else - HDfprintf(output, - "%lld" - "MB%s", - val / ONE_MB, end); + fprintf(output, + "%lld" + "MB%s", + val / ONE_MB, end); } else { - HDfprintf(output, - "%lld" - "KB%s", - val / ONE_KB, end); + fprintf(output, + "%lld" + "KB%s", + val / ONE_KB, end); } } else { - HDfprintf(output, - "%lld" - "%s", - val, end); + fprintf(output, + "%lld" + "%s", + val, end); } } @@ -1124,12 +1124,12 @@ static void print_io_api(long io_types) { if (io_types & PIO_POSIX) - HDfprintf(output, "posix "); + fprintf(output, "posix "); if (io_types & PIO_MPI) - HDfprintf(output, "mpiio "); + fprintf(output, "mpiio "); if (io_types & PIO_HDF5) - HDfprintf(output, "phdf5 "); - HDfprintf(output, "\n"); + fprintf(output, "phdf5 "); + fprintf(output, "\n"); } static void @@ -1138,34 +1138,34 @@ report_parameters(struct options *opts) int rank = comm_world_rank_g; print_version("HDF5 Library"); /* print library version */ - HDfprintf(output, "rank %d: ==== Parameters ====\n", rank); + fprintf(output, "rank %d: ==== Parameters ====\n", rank); - HDfprintf(output, "rank %d: IO API=", rank); + fprintf(output, "rank %d: IO API=", rank); print_io_api(opts->io_types); - HDfprintf(output, "rank %d: Number of files=%ld\n", rank, opts->num_files); - HDfprintf(output, "rank %d: Number of datasets=%ld\n", rank, opts->num_dsets); - HDfprintf(output, "rank %d: Number of iterations=%d\n", rank, opts->num_iters); - HDfprintf(output, "rank %d: Number of processes=%d:%d\n", rank, opts->min_num_procs, opts->max_num_procs); + fprintf(output, "rank %d: Number of files=%ld\n", rank, opts->num_files); + fprintf(output, "rank %d: Number of datasets=%ld\n", rank, opts->num_dsets); + fprintf(output, "rank %d: Number of iterations=%d\n", rank, opts->num_iters); + fprintf(output, "rank %d: Number of processes=%d:%d\n", rank, opts->min_num_procs, opts->max_num_procs); if (opts->dim2d) { - HDfprintf(output, "rank %d: Number of bytes per process per dataset=", rank); + fprintf(output, "rank %d: Number of bytes per process per dataset=", rank); recover_size_and_print((long long)(opts->num_bpp * opts->num_bpp * opts->min_num_procs), ":"); recover_size_and_print((long long)(opts->num_bpp * opts->num_bpp * opts->max_num_procs), "\n"); - HDfprintf(output, "rank %d: Size of dataset(s)=", rank); + fprintf(output, "rank %d: Size of dataset(s)=", rank); recover_size_and_print((long long)(opts->num_bpp * opts->min_num_procs), "x"); recover_size_and_print((long long)(opts->num_bpp * opts->min_num_procs), ":"); recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs), "x"); recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs), "\n"); - HDfprintf(output, "rank %d: File size=", rank); + fprintf(output, "rank %d: File size=", rank); recover_size_and_print((long long)(squareo(opts->num_bpp * opts->min_num_procs) * opts->num_dsets), ":"); recover_size_and_print((long long)(squareo(opts->num_bpp * opts->max_num_procs) * opts->num_dsets), "\n"); - HDfprintf(output, "rank %d: Transfer buffer size=", rank); + fprintf(output, "rank %d: Transfer buffer size=", rank); if (opts->interleaved) { recover_size_and_print((long long)opts->min_xfer_size, "x"); recover_size_and_print((long long)opts->blk_size, ":"); @@ -1178,66 +1178,66 @@ report_parameters(struct options *opts) recover_size_and_print((long long)opts->blk_size, "x"); recover_size_and_print((long long)opts->max_xfer_size, "\n"); } - HDfprintf(output, "rank %d: Block size=", rank); + fprintf(output, "rank %d: Block size=", rank); recover_size_and_print((long long)opts->blk_size, "x"); recover_size_and_print((long long)opts->blk_size, "\n"); } else { - HDfprintf(output, "rank %d: Number of bytes per process per dataset=", rank); + fprintf(output, "rank %d: Number of bytes per process per dataset=", rank); recover_size_and_print((long long)opts->num_bpp, "\n"); - HDfprintf(output, "rank %d: Size of dataset(s)=", rank); + fprintf(output, "rank %d: Size of dataset(s)=", rank); recover_size_and_print((long long)(opts->num_bpp * opts->min_num_procs), ":"); recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs), "\n"); - HDfprintf(output, "rank %d: File size=", rank); + fprintf(output, "rank %d: File size=", rank); recover_size_and_print((long long)(opts->num_bpp * opts->min_num_procs * opts->num_dsets), ":"); recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs * opts->num_dsets), "\n"); - HDfprintf(output, "rank %d: Transfer buffer size=", rank); + fprintf(output, "rank %d: Transfer buffer size=", rank); recover_size_and_print((long long)opts->min_xfer_size, ":"); recover_size_and_print((long long)opts->max_xfer_size, "\n"); - HDfprintf(output, "rank %d: Block size=", rank); + fprintf(output, "rank %d: Block size=", rank); recover_size_and_print((long long)opts->blk_size, "\n"); } - HDfprintf(output, "rank %d: Block Pattern in Dataset=", rank); + fprintf(output, "rank %d: Block Pattern in Dataset=", rank); if (opts->interleaved) - HDfprintf(output, "Interleaved\n"); + fprintf(output, "Interleaved\n"); else - HDfprintf(output, "Contiguous\n"); + fprintf(output, "Contiguous\n"); - HDfprintf(output, "rank %d: I/O Method for MPI and HDF5=", rank); + fprintf(output, "rank %d: I/O Method for MPI and HDF5=", rank); if (opts->collective) - HDfprintf(output, "Collective\n"); + fprintf(output, "Collective\n"); else - HDfprintf(output, "Independent\n"); + fprintf(output, "Independent\n"); - HDfprintf(output, "rank %d: Geometry=", rank); + fprintf(output, "rank %d: Geometry=", rank); if (opts->dim2d) - HDfprintf(output, "2D\n"); + fprintf(output, "2D\n"); else - HDfprintf(output, "1D\n"); + fprintf(output, "1D\n"); - HDfprintf(output, "rank %d: VFL used for HDF5 I/O=%s\n", rank, "MPI-IO driver"); + fprintf(output, "rank %d: VFL used for HDF5 I/O=%s\n", rank, "MPI-IO driver"); - HDfprintf(output, "rank %d: Data storage method in HDF5=", rank); + fprintf(output, "rank %d: Data storage method in HDF5=", rank); if (opts->h5_use_chunks) - HDfprintf(output, "Chunked\n"); + fprintf(output, "Chunked\n"); else - HDfprintf(output, "Contiguous\n"); + fprintf(output, "Contiguous\n"); { char *prefix = HDgetenv("HDF5_PARAPREFIX"); - HDfprintf(output, "rank %d: Env HDF5_PARAPREFIX=%s\n", rank, (prefix ? prefix : "not set")); + fprintf(output, "rank %d: Env HDF5_PARAPREFIX=%s\n", rank, (prefix ? prefix : "not set")); } - HDfprintf(output, "rank %d: ", rank); + fprintf(output, "rank %d: ", rank); h5_dump_info_object(h5_io_info_g); - HDfprintf(output, "rank %d: ==== End of Parameters ====\n", rank); - HDfprintf(output, "\n"); + fprintf(output, "rank %d: ==== End of Parameters ====\n", rank); + fprintf(output, "\n"); } /* @@ -1289,7 +1289,7 @@ parse_command_line(int argc, const char *const *argv) char buf[10]; int i; - HDmemset(buf, '\0', sizeof(buf)); + memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (isalnum(*end) && i < 10) @@ -1305,8 +1305,8 @@ parse_command_line(int argc, const char *const *argv) cl_opts->io_types |= PIO_POSIX; } else { - HDfprintf(stderr, "pio_perf: invalid --api option %s\n", buf); - HDexit(EXIT_FAILURE); + fprintf(stderr, "pio_perf: invalid --api option %s\n", buf); + exit(EXIT_FAILURE); } if (*end == '\0') @@ -1342,7 +1342,7 @@ parse_command_line(int argc, const char *const *argv) char buf[10]; int i; - HDmemset(buf, '\0', sizeof(buf)); + memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (HDisalnum(*end) && i < 10) @@ -1353,8 +1353,8 @@ parse_command_line(int argc, const char *const *argv) for (j = 0; j < 10 && buf[j] != '\0'; ++j) if (!isdigit(buf[j])) { - HDfprintf(stderr, "pio_perf: invalid --debug option %s\n", buf); - HDexit(EXIT_FAILURE); + fprintf(stderr, "pio_perf: invalid --debug option %s\n", buf); + exit(EXIT_FAILURE); } pio_debug_level = atoi(buf); @@ -1379,8 +1379,8 @@ parse_command_line(int argc, const char *const *argv) cl_opts->verify = TRUE; break; default: - HDfprintf(stderr, "pio_perf: invalid --debug option %s\n", buf); - HDexit(EXIT_FAILURE); + fprintf(stderr, "pio_perf: invalid --debug option %s\n", buf); + exit(EXIT_FAILURE); } } @@ -1396,13 +1396,13 @@ parse_command_line(int argc, const char *const *argv) cl_opts->num_bpp = parse_size_directive(H5_optarg); break; case 'F': - cl_opts->num_files = HDatoi(H5_optarg); + cl_opts->num_files = atoi(H5_optarg); break; case 'g': cl_opts->dim2d = 1; break; case 'i': - cl_opts->num_iters = HDatoi(H5_optarg); + cl_opts->num_iters = atoi(H5_optarg); break; case 'I': cl_opts->interleaved = 1; @@ -1411,10 +1411,10 @@ parse_command_line(int argc, const char *const *argv) cl_opts->output_file = H5_optarg; break; case 'p': - cl_opts->min_num_procs = HDatoi(H5_optarg); + cl_opts->min_num_procs = atoi(H5_optarg); break; case 'P': - cl_opts->max_num_procs = HDatoi(H5_optarg); + cl_opts->max_num_procs = atoi(H5_optarg); break; case 'T': cl_opts->h5_threshold = parse_size_directive(H5_optarg); @@ -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; } } @@ -1523,8 +1523,8 @@ parse_size_directive(const char *size) s *= ONE_GB; break; default: - HDfprintf(stderr, "Illegal size specifier '%c'\n", *endptr); - HDexit(EXIT_FAILURE); + fprintf(stderr, "Illegal size specifier '%c'\n", *endptr); + exit(EXIT_FAILURE); } } @@ -1546,124 +1546,124 @@ usage(const char *prog) if (myrank == 0) { print_version(prog); - HDprintf("usage: %s [OPTIONS]\n", prog); - HDprintf(" OPTIONS\n"); - HDprintf(" -h, --help Print a usage message and exit\n"); - HDprintf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n"); - HDprintf(" -A AL, --api=AL Which APIs to test [default: all of them]\n"); + printf("usage: %s [OPTIONS]\n", prog); + printf(" OPTIONS\n"); + printf(" -h, --help Print a usage message and exit\n"); + printf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n"); + printf(" -A AL, --api=AL Which APIs to test [default: all of them]\n"); #if 0 - HDprintf(" -b, --binary The elusive binary option\n"); + printf(" -b, --binary The elusive binary option\n"); #endif /* 0 */ - HDprintf(" -B S, --block-size=S Block size within transfer buffer\n"); - HDprintf(" (see below for description)\n"); - HDprintf(" [default: half the number of bytes per process\n"); - HDprintf(" per dataset]\n"); - HDprintf(" -c, --chunk Create HDF5 datasets using chunked storage\n"); - HDprintf(" [default: contiguous storage]\n"); - HDprintf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n"); - HDprintf(" [default: independent I/O)\n"); - HDprintf(" -d N, --num-dsets=N Number of datasets per file [default: 1]\n"); - HDprintf(" -D DL, --debug=DL Indicate the debugging level\n"); - HDprintf(" [default: no debugging]\n"); - HDprintf(" -e S, --num-bytes=S Number of bytes per process per dataset\n"); - HDprintf(" (see below for description)\n"); - HDprintf(" [default: 256K for 1D, 8K for 2D]\n"); - HDprintf(" -F N, --num-files=N Number of files [default: 1]\n"); - HDprintf(" -g, --geometry Use 2D geometry [default: 1D geometry]\n"); - HDprintf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n"); - HDprintf(" -I, --interleaved Interleaved access pattern\n"); - HDprintf(" (see below for example)\n"); - HDprintf(" [default: Contiguous access pattern]\n"); - HDprintf(" -o F, --output=F Output raw data into file F [default: none]\n"); - HDprintf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n"); - HDprintf(" -P N, --max-num-processes=N Maximum number of processes to use\n"); - HDprintf(" [default: all MPI_COMM_WORLD processes ]\n"); - HDprintf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n"); - HDprintf(" [default: 1]\n"); - HDprintf(" -w, --write-only Perform write tests not the read tests\n"); - HDprintf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n"); - HDprintf(" (see below for description)\n"); - HDprintf(" [default: half the number of bytes per process\n"); - HDprintf(" per dataset]\n"); - HDprintf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n"); - HDprintf(" [default: the number of bytes per process per\n"); - HDprintf(" dataset]\n"); - HDprintf("\n"); - HDprintf(" F - is a filename.\n"); - HDprintf(" N - is an integer >=0.\n"); - HDprintf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n"); - HDprintf(" K - Kilobyte (%d)\n", ONE_KB); - HDprintf(" M - Megabyte (%d)\n", ONE_MB); - HDprintf(" G - Gigabyte (%d)\n", ONE_GB); - HDprintf("\n"); - HDprintf(" Example: '37M' is 37 megabytes or %d bytes\n", 37 * ONE_MB); - HDprintf("\n"); - HDprintf(" AL - is an API list. Valid values are:\n"); - HDprintf(" phdf5 - Parallel HDF5\n"); - HDprintf(" mpiio - MPI-I/O\n"); - HDprintf(" posix - POSIX\n"); - HDprintf("\n"); - HDprintf(" Example: --api=mpiio,phdf5\n"); - HDprintf("\n"); - HDprintf(" Dataset size:\n"); - HDprintf(" Depending on the selected geometry, each test dataset is either a linear\n"); - HDprintf(" array of size bytes-per-process * num-processes, or a square array of size\n"); - HDprintf(" (bytes-per-process * num-processes) x (bytes-per-process * num-processes).\n"); - HDprintf("\n"); - HDprintf(" Block size vs. Transfer buffer size:\n"); - HDprintf(" buffer-size controls the size of the memory buffer, which is broken into\n"); - HDprintf(" blocks and written to the file. Depending on the selected geometry, each\n"); - HDprintf(" block can be a linear array of size block-size or a square array of size\n"); - HDprintf(" block-size x block-size. The arrangement in which blocks are written is\n"); - HDprintf(" determined by the access pattern.\n"); - HDprintf("\n"); - HDprintf(" In 1D geometry, the transfer buffer is a linear array of size buffer-size.\n"); - HDprintf(" In 2D geometry, it is a rectangular array of size block-size x buffer-size\n"); - HDprintf(" or buffer-size x block-size if interleaved pattern is selected.\n"); - HDprintf("\n"); - HDprintf(" Interleaved and Contiguous patterns in 1D geometry:\n"); - HDprintf(" When contiguous access pattern is chosen, the dataset is evenly divided\n"); - HDprintf(" into num-processes regions and each process writes data to its own region.\n"); - HDprintf(" When interleaved blocks are written to a dataset, space for the first\n"); - HDprintf(" block of the first process is allocated in the dataset, then space is\n"); - HDprintf(" allocated for the first block of the second process, etc. until space is\n"); - HDprintf(" allocated for the first block of each process, then space is allocated for\n"); - HDprintf(" the second block of the first process, the second block of the second\n"); - HDprintf(" process, etc.\n"); - HDprintf("\n"); - HDprintf(" For example, with a 3 process run, 512KB bytes-per-process, 256KB transfer\n"); - HDprintf(" buffer size, and 64KB block size, each process must issue 2 transfer\n"); - HDprintf(" requests to complete access to the dataset.\n"); - HDprintf(" Contiguous blocks of the first transfer request are written like so:\n"); - HDprintf(" 1111----2222----3333----\n"); - HDprintf(" Interleaved blocks of the first transfer request are written like so:\n"); - HDprintf(" 123123123123------------\n"); - HDprintf(" The actual number of I/O operations involved in a transfer request\n"); - HDprintf(" depends on the access pattern and communication mode.\n"); - HDprintf(" When using independent I/O with interleaved pattern, each process\n"); - HDprintf(" performs 4 small non-contiguous I/O operations per transfer request.\n"); - HDprintf(" If collective I/O is turned on, the combined content of the buffers of\n"); - HDprintf(" the 3 processes will be written using one collective I/O operation\n"); - HDprintf(" per transfer request.\n"); - HDprintf("\n"); - HDprintf(" For information about access patterns in 2D geometry, please refer to the\n"); - HDprintf(" HDF5 Reference Manual.\n"); - HDprintf("\n"); - HDprintf(" DL - is a list of debugging flags. Valid values are:\n"); - HDprintf(" 1 - Minimal\n"); - HDprintf(" 2 - Not quite everything\n"); - HDprintf(" 3 - Everything\n"); - HDprintf(" 4 - The kitchen sink\n"); - HDprintf(" r - Raw data I/O throughput information\n"); - HDprintf(" t - Times as well as throughputs\n"); - HDprintf(" v - Verify data correctness\n"); - HDprintf("\n"); - HDprintf(" Example: --debug=2,r,t\n"); - HDprintf("\n"); - HDprintf(" Environment variables:\n"); - HDprintf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n"); - HDprintf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n"); - HDprintf(" HDF5_PARAPREFIX Parallel data files prefix\n"); + printf(" -B S, --block-size=S Block size within transfer buffer\n"); + printf(" (see below for description)\n"); + printf(" [default: half the number of bytes per process\n"); + printf(" per dataset]\n"); + printf(" -c, --chunk Create HDF5 datasets using chunked storage\n"); + printf(" [default: contiguous storage]\n"); + printf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n"); + printf(" [default: independent I/O)\n"); + printf(" -d N, --num-dsets=N Number of datasets per file [default: 1]\n"); + printf(" -D DL, --debug=DL Indicate the debugging level\n"); + printf(" [default: no debugging]\n"); + printf(" -e S, --num-bytes=S Number of bytes per process per dataset\n"); + printf(" (see below for description)\n"); + printf(" [default: 256K for 1D, 8K for 2D]\n"); + printf(" -F N, --num-files=N Number of files [default: 1]\n"); + printf(" -g, --geometry Use 2D geometry [default: 1D geometry]\n"); + printf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n"); + printf(" -I, --interleaved Interleaved access pattern\n"); + printf(" (see below for example)\n"); + printf(" [default: Contiguous access pattern]\n"); + printf(" -o F, --output=F Output raw data into file F [default: none]\n"); + printf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n"); + printf(" -P N, --max-num-processes=N Maximum number of processes to use\n"); + printf(" [default: all MPI_COMM_WORLD processes ]\n"); + printf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n"); + printf(" [default: 1]\n"); + printf(" -w, --write-only Perform write tests not the read tests\n"); + printf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n"); + printf(" (see below for description)\n"); + printf(" [default: half the number of bytes per process\n"); + printf(" per dataset]\n"); + printf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n"); + printf(" [default: the number of bytes per process per\n"); + printf(" dataset]\n"); + printf("\n"); + printf(" F - is a filename.\n"); + printf(" N - is an integer >=0.\n"); + printf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n"); + printf(" K - Kilobyte (%d)\n", ONE_KB); + printf(" M - Megabyte (%d)\n", ONE_MB); + printf(" G - Gigabyte (%d)\n", ONE_GB); + printf("\n"); + printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37 * ONE_MB); + printf("\n"); + printf(" AL - is an API list. Valid values are:\n"); + printf(" phdf5 - Parallel HDF5\n"); + printf(" mpiio - MPI-I/O\n"); + printf(" posix - POSIX\n"); + printf("\n"); + printf(" Example: --api=mpiio,phdf5\n"); + printf("\n"); + printf(" Dataset size:\n"); + printf(" Depending on the selected geometry, each test dataset is either a linear\n"); + printf(" array of size bytes-per-process * num-processes, or a square array of size\n"); + printf(" (bytes-per-process * num-processes) x (bytes-per-process * num-processes).\n"); + printf("\n"); + printf(" Block size vs. Transfer buffer size:\n"); + printf(" buffer-size controls the size of the memory buffer, which is broken into\n"); + printf(" blocks and written to the file. Depending on the selected geometry, each\n"); + printf(" block can be a linear array of size block-size or a square array of size\n"); + printf(" block-size x block-size. The arrangement in which blocks are written is\n"); + printf(" determined by the access pattern.\n"); + printf("\n"); + printf(" In 1D geometry, the transfer buffer is a linear array of size buffer-size.\n"); + printf(" In 2D geometry, it is a rectangular array of size block-size x buffer-size\n"); + printf(" or buffer-size x block-size if interleaved pattern is selected.\n"); + printf("\n"); + printf(" Interleaved and Contiguous patterns in 1D geometry:\n"); + printf(" When contiguous access pattern is chosen, the dataset is evenly divided\n"); + printf(" into num-processes regions and each process writes data to its own region.\n"); + printf(" When interleaved blocks are written to a dataset, space for the first\n"); + printf(" block of the first process is allocated in the dataset, then space is\n"); + printf(" allocated for the first block of the second process, etc. until space is\n"); + printf(" allocated for the first block of each process, then space is allocated for\n"); + printf(" the second block of the first process, the second block of the second\n"); + printf(" process, etc.\n"); + printf("\n"); + printf(" For example, with a 3 process run, 512KB bytes-per-process, 256KB transfer\n"); + printf(" buffer size, and 64KB block size, each process must issue 2 transfer\n"); + printf(" requests to complete access to the dataset.\n"); + printf(" Contiguous blocks of the first transfer request are written like so:\n"); + printf(" 1111----2222----3333----\n"); + printf(" Interleaved blocks of the first transfer request are written like so:\n"); + printf(" 123123123123------------\n"); + printf(" The actual number of I/O operations involved in a transfer request\n"); + printf(" depends on the access pattern and communication mode.\n"); + printf(" When using independent I/O with interleaved pattern, each process\n"); + printf(" performs 4 small non-contiguous I/O operations per transfer request.\n"); + printf(" If collective I/O is turned on, the combined content of the buffers of\n"); + printf(" the 3 processes will be written using one collective I/O operation\n"); + printf(" per transfer request.\n"); + printf("\n"); + printf(" For information about access patterns in 2D geometry, please refer to the\n"); + printf(" HDF5 Reference Manual.\n"); + printf("\n"); + printf(" DL - is a list of debugging flags. Valid values are:\n"); + printf(" 1 - Minimal\n"); + printf(" 2 - Not quite everything\n"); + printf(" 3 - Everything\n"); + printf(" 4 - The kitchen sink\n"); + printf(" r - Raw data I/O throughput information\n"); + printf(" t - Times as well as throughputs\n"); + printf(" v - Verify data correctness\n"); + printf("\n"); + printf(" Example: --debug=2,r,t\n"); + printf("\n"); + printf(" Environment variables:\n"); + printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n"); + printf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n"); + printf(" HDF5_PARAPREFIX Parallel data files prefix\n"); fflush(stdout); } /* end if */ } /* end usage() */ @@ -1680,7 +1680,7 @@ usage(const char *prog) int main(void) { - HDprintf("No parallel IO performance because parallel is not configured\n"); + printf("No parallel IO performance because parallel is not configured\n"); return EXIT_SUCCESS; } /* end main */ diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c index b80189b..511957b 100644 --- a/tools/src/h5perf/sio_engine.c +++ b/tools/src/h5perf/sio_engine.c @@ -44,7 +44,7 @@ } #define ERRMSG(mesg) \ { \ - HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", mesg, (int)__LINE__, __FILE__); \ + fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", mesg, (int)__LINE__, __FILE__); \ } /* verify: if val is false (0), print mesg. */ @@ -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) { @@ -158,7 +158,7 @@ do_sio(parameters param, results *res) break; default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); GOTOERROR(FAIL); } @@ -173,29 +173,29 @@ do_sio(parameters param, results *res) /* Validate transfer buffer size */ if (param.buf_size[i] <= 0) { - HDfprintf(stderr, "Transfer buffer size[%d] (%zu) must be > 0\n", i, buf_size[i]); + fprintf(stderr, "Transfer buffer size[%d] (%zu) must be > 0\n", i, buf_size[i]); GOTOERROR(FAIL); } if ((param.dset_size[i] % param.buf_size[i]) != 0) { - HDfprintf(stderr, - "Dataset size[%d] (%lld) must be a multiple of the " - "transfer buffer size[%d] (%zu)\n", - param.rank, (long long)param.dset_size[i], param.rank, param.buf_size[i]); + fprintf(stderr, + "Dataset size[%d] (%lld) must be a multiple of the " + "transfer buffer size[%d] (%zu)\n", + param.rank, (long long)param.dset_size[i], param.rank, param.buf_size[i]); GOTOERROR(FAIL); } } /* Allocate transfer buffer */ if ((buffer = (char *)malloc(linear_buf_size)) == NULL) { - HDfprintf(stderr, "malloc for transfer buffer size (%zu) failed\n", linear_buf_size); + fprintf(stderr, "malloc for transfer buffer size (%zu) failed\n", linear_buf_size); GOTOERROR(FAIL); } if (sio_debug_level >= 4) /* output all of the times for all iterations */ - HDfprintf(output, "Timer details:\n"); + fprintf(output, "Timer details:\n"); /* * Write performance measurement @@ -206,7 +206,7 @@ do_sio(parameters param, results *res) sio_create_filename(iot, base_name, fname, FILENAME_MAX, ¶m); if (sio_debug_level > 0) - HDfprintf(output, "data filename=%s\n", fname); + fprintf(output, "data filename=%s\n", fname); io_time_set(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_CREATE | SIO_WRITE); @@ -263,13 +263,13 @@ done: break; default: /* unknown request */ - HDassert(0 && "Unknown IO type"); + assert(0 && "Unknown IO type"); break; } /* release generic resources */ - HDfree(buffer); - HDfree(fname); + free(buffer); + free(fname); res->ret_code = ret_code; } @@ -310,8 +310,8 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si break; default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); - HDassert(0 && "Unknown IO type"); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); + assert(0 && "Unknown IO type"); break; } @@ -486,14 +486,14 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) /* Create the dataset transfer property list */ h5dxpl = H5Pcreate(H5P_DATASET_XFER); if (h5dxpl < 0) { - HDfprintf(stderr, "HDF5 Property List Create failed\n"); + fprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } break; default: - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); GOTOERROR(FAIL); break; } /* end switch */ @@ -507,7 +507,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) h5dcpl = H5Pcreate(H5P_DATASET_CREATE); if (h5dcpl < 0) { - HDfprintf(stderr, "HDF5 Property List Create failed\n"); + fprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } @@ -515,7 +515,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) /* Set the chunk size to be the same as the buffer size */ hrc = H5Pset_chunk(h5dcpl, rank, h5chunk); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Property List Set failed\n"); + fprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* end if */ } /* end if */ @@ -525,21 +525,21 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE, h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT); if (h5ds_id < 0) { - HDfprintf(stderr, "HDF5 Dataset Create failed\n"); + fprintf(stderr, "HDF5 Dataset Create failed\n"); GOTOERROR(FAIL); } hrc = H5Pclose(h5dcpl); /* verifying the close of the dcpl */ if (hrc < 0) { - HDfprintf(stderr, "HDF5 Property List Close failed\n"); + fprintf(stderr, "HDF5 Property List Close failed\n"); GOTOERROR(FAIL); } break; default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); GOTOERROR(FAIL); break; } @@ -551,7 +551,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) hrc = dset_write(rank - 1, fd, parms, buffer); if (hrc < 0) { - HDfprintf(stderr, "Error in dataset write\n"); + fprintf(stderr, "Error in dataset write\n"); GOTOERROR(FAIL); } @@ -565,7 +565,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) hrc = H5Dclose(h5ds_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Close failed\n"); + fprintf(stderr, "HDF5 Dataset Close failed\n"); GOTOERROR(FAIL); } @@ -578,7 +578,7 @@ done: if (h5dset_space_id != -1) { hrc = H5Sclose(h5dset_space_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Space Close failed\n"); + fprintf(stderr, "HDF5 Dataset Space Close failed\n"); ret_code = FAIL; } else { @@ -589,7 +589,7 @@ done: if (h5mem_space_id != -1) { hrc = H5Sclose(h5mem_space_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Memory Space Close failed\n"); + fprintf(stderr, "HDF5 Memory Space Close failed\n"); ret_code = FAIL; } else { @@ -600,7 +600,7 @@ done: if (h5dxpl != -1) { hrc = H5Pclose(h5dxpl); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); + fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); ret_code = FAIL; } else { @@ -660,7 +660,7 @@ dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer) for (k = 0; k < parms->rank; k++) { - HDassert(h5offset[k] >= 0); + assert(h5offset[k] >= 0); if (dims[k] <= (hsize_t)h5offset[k]) { dims[k] = dims[k] + h5count[k]; hrc = H5Sset_extent_simple(h5dset_space_id, parms->rank, dims, maxdims); @@ -683,8 +683,8 @@ dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer) default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); - HDassert(0 && "Unknown IO type"); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); + assert(0 && "Unknown IO type"); break; } /* switch (parms->io_type) */ } @@ -777,7 +777,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) /* Allocate data verification buffer */ if (NULL == (buffer2 = (char *)malloc(linear_buf_size))) { - HDfprintf(stderr, "malloc for data verification buffer size (%zu) failed\n", linear_buf_size); + fprintf(stderr, "malloc for data verification buffer size (%zu) failed\n", linear_buf_size); GOTOERROR(FAIL); } /* end if */ @@ -828,14 +828,14 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) /* Create the dataset transfer property list */ h5dxpl = H5Pcreate(H5P_DATASET_XFER); if (h5dxpl < 0) { - HDfprintf(stderr, "HDF5 Property List Create failed\n"); + fprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } break; default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); GOTOERROR(FAIL); break; } /* end switch */ @@ -849,14 +849,14 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) HDsnprintf(dname, sizeof(dname), "Dataset_%ld", (long)parms->num_bytes); h5ds_id = H5Dopen2(fd->h5fd, dname, H5P_DEFAULT); if (h5ds_id < 0) { - HDfprintf(stderr, "HDF5 Dataset open failed\n"); + fprintf(stderr, "HDF5 Dataset open failed\n"); GOTOERROR(FAIL); } break; default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); GOTOERROR(FAIL); break; } /* end switch */ @@ -866,7 +866,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) hrc = dset_read(rank - 1, fd, parms, buffer, buffer2); if (hrc < 0) { - HDfprintf(stderr, "Error in dataset read\n"); + fprintf(stderr, "Error in dataset read\n"); GOTOERROR(FAIL); } @@ -880,7 +880,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) hrc = H5Dclose(h5ds_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Close failed\n"); + fprintf(stderr, "HDF5 Dataset Close failed\n"); GOTOERROR(FAIL); } @@ -893,7 +893,7 @@ done: if (h5dset_space_id != -1) { hrc = H5Sclose(h5dset_space_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Space Close failed\n"); + fprintf(stderr, "HDF5 Dataset Space Close failed\n"); ret_code = FAIL; } else { @@ -904,7 +904,7 @@ done: if (h5mem_space_id != -1) { hrc = H5Sclose(h5mem_space_id); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Memory Space Close failed\n"); + fprintf(stderr, "HDF5 Memory Space Close failed\n"); ret_code = FAIL; } else { @@ -915,7 +915,7 @@ done: if (h5dxpl != -1) { hrc = H5Pclose(h5dxpl); if (hrc < 0) { - HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); + fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); ret_code = FAIL; } else { @@ -981,8 +981,8 @@ dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer, const default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); - HDassert(0 && "Unknown IO type"); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); + assert(0 && "Unknown IO type"); break; } /* switch (parms->io_type) */ } @@ -1065,7 +1065,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) fd->posixfd = POSIXOPEN(fname, O_RDONLY); if (fd->posixfd < 0) { - HDfprintf(stderr, "POSIX File Open failed(%s)\n", fname); + fprintf(stderr, "POSIX File Open failed(%s)\n", fname); GOTOERROR(FAIL); } @@ -1076,7 +1076,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) fapl = set_vfd(param); if (fapl < 0) { - HDfprintf(stderr, "HDF5 Property List Create failed\n"); + fprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } @@ -1097,14 +1097,14 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) } if (fd->h5fd < 0) { - HDfprintf(stderr, "HDF5 File Create failed(%s)\n", fname); + fprintf(stderr, "HDF5 File Create failed(%s)\n", fname); GOTOERROR(FAIL); } break; default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)param->io_type); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)param->io_type); GOTOERROR(FAIL); break; } @@ -1162,14 +1162,14 @@ set_vfd(parameters *param) char arr[H5FD_MEM_NTYPES][1024]; } *sv = NULL; - HDmemset(memb_map, 0, sizeof memb_map); - HDmemset(memb_fapl, 0, sizeof memb_fapl); - HDmemset(memb_name, 0, sizeof memb_name); - HDmemset(memb_addr, 0, sizeof memb_addr); + memset(memb_map, 0, sizeof memb_map); + memset(memb_fapl, 0, sizeof memb_fapl); + memset(memb_name, 0, sizeof memb_name); + memset(memb_addr, 0, sizeof memb_addr); - HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + 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*/ @@ -1227,7 +1227,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) rc = POSIXCLOSE(fd->posixfd); if (rc != 0) { - HDfprintf(stderr, "POSIX File Close failed\n"); + fprintf(stderr, "POSIX File Close failed\n"); GOTOERROR(FAIL); } @@ -1238,7 +1238,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) hrc = H5Fclose(fd->h5fd); if (hrc < 0) { - HDfprintf(stderr, "HDF5 File Close failed\n"); + fprintf(stderr, "HDF5 File Close failed\n"); GOTOERROR(FAIL); } @@ -1247,7 +1247,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); GOTOERROR(FAIL); break; } @@ -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) @@ -1310,7 +1310,7 @@ do_cleanupfile(iotype iot, char *filename) } else if (driver == H5FD_MULTI) { H5FD_mem_t mt; - HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { HDsnprintf(temp, temp_sz, "%s-%c.h5", filename, multi_letters[mt]); @@ -1325,12 +1325,12 @@ do_cleanupfile(iotype iot, char *filename) default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); - HDassert(0 && "Unknown IO type"); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); + assert(0 && "Unknown IO type"); break; } } done: - HDfree(temp); + free(temp); } diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c index ef9e7db..a06e1fe 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -202,8 +202,8 @@ main(int argc, char *argv[]) } if (opts->output_file) { - if ((output = HDfopen(opts->output_file, "w")) == NULL) { - HDfprintf(stderr, "%s: cannot open output file\n", progname); + if ((output = fopen(opts->output_file, "w")) == NULL) { + fprintf(stderr, "%s: cannot open output file\n", progname); HDperror(opts->output_file); goto finish; } @@ -214,7 +214,7 @@ main(int argc, char *argv[]) run_test_loop(opts); finish: - HDfree(opts); + free(opts); return exit_value; } @@ -327,8 +327,8 @@ run_test(iotype iot, parameters parms, struct options *opts) break; default: /* unknown request */ - HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); - HDassert(0 && "Unknown IO tpe"); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); + assert(0 && "Unknown IO tpe"); break; } @@ -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; @@ -633,11 +633,11 @@ output_report(const char *fmt, ...) { va_list ap; - HDva_start(ap, fmt); + va_start(ap, fmt); H5_GCC_CLANG_DIAG_OFF("format-nonliteral") HDvfprintf(output, fmt, ap); H5_GCC_CLANG_DIAG_ON("format-nonliteral") - HDva_end(ap); + va_end(ap); } /* @@ -662,28 +662,28 @@ recover_size_and_print(long long val, const char *end) if (val >= ONE_KB && (val % ONE_KB) == 0) { if (val >= ONE_MB && (val % ONE_MB) == 0) { if (val >= ONE_GB && (val % ONE_GB) == 0) - HDfprintf(output, - "%lld" - "GB%s", - val / ONE_GB, end); + fprintf(output, + "%lld" + "GB%s", + val / ONE_GB, end); else - HDfprintf(output, - "%lld" - "MB%s", - val / ONE_MB, end); + fprintf(output, + "%lld" + "MB%s", + val / ONE_MB, end); } else { - HDfprintf(output, - "%lld" - "KB%s", - val / ONE_KB, end); + fprintf(output, + "%lld" + "KB%s", + val / ONE_KB, end); } } else { - HDfprintf(output, - "%lld" - "%s", - val, end); + fprintf(output, + "%lld" + "%s", + val, end); } } @@ -691,10 +691,10 @@ static void print_io_api(long io_types) { if (io_types & SIO_POSIX) - HDfprintf(output, "posix "); + fprintf(output, "posix "); if (io_types & SIO_HDF5) - HDfprintf(output, "hdf5 "); - HDfprintf(output, "\n"); + fprintf(output, "hdf5 "); + fprintf(output, "\n"); } static void @@ -704,95 +704,95 @@ report_parameters(struct options *opts) rank = opts->dset_rank; print_version("HDF5 Library"); /* print library version */ - HDfprintf(output, "==== Parameters ====\n"); + fprintf(output, "==== Parameters ====\n"); - HDfprintf(output, "IO API="); + fprintf(output, "IO API="); print_io_api(opts->io_types); - HDfprintf(output, "Number of iterations=%d\n", opts->num_iters); + fprintf(output, "Number of iterations=%d\n", opts->num_iters); - HDfprintf(output, "Dataset size="); + fprintf(output, "Dataset size="); for (i = 0; i < rank; i++) recover_size_and_print((long long)opts->dset_size[i], " "); - HDfprintf(output, "\n"); + fprintf(output, "\n"); - HDfprintf(output, "Transfer buffer size="); + fprintf(output, "Transfer buffer size="); for (i = 0; i < rank; i++) recover_size_and_print((long long)opts->buf_size[i], " "); - HDfprintf(output, "\n"); + fprintf(output, "\n"); if (opts->page_size) { - HDfprintf(output, "Page Aggregation Enabled. Page size = %zu\n", opts->page_size); + fprintf(output, "Page Aggregation Enabled. Page size = %zu\n", opts->page_size); if (opts->page_buffer_size) - HDfprintf(output, "Page Buffering Enabled. Page Buffer size = %zu\n", opts->page_buffer_size); + fprintf(output, "Page Buffering Enabled. Page Buffer size = %zu\n", opts->page_buffer_size); else - HDfprintf(output, "Page Buffering Disabled\n"); + fprintf(output, "Page Buffering Disabled\n"); } else - HDfprintf(output, "Page Aggregation Disabled\n"); + fprintf(output, "Page Aggregation Disabled\n"); - HDfprintf(output, "Dimension access order="); + fprintf(output, "Dimension access order="); for (i = 0; i < rank; i++) recover_size_and_print((long long)opts->order[i], " "); - HDfprintf(output, "\n"); + fprintf(output, "\n"); if (opts->io_types & SIO_HDF5) { - HDfprintf(output, "HDF5 data storage method="); + fprintf(output, "HDF5 data storage method="); if (opts->h5_use_chunks) { - HDfprintf(output, "Chunked\n"); - HDfprintf(output, "HDF5 chunk size="); + fprintf(output, "Chunked\n"); + fprintf(output, "HDF5 chunk size="); for (i = 0; i < rank; i++) recover_size_and_print((long long)opts->chk_size[i], " "); - HDfprintf(output, "\n"); + fprintf(output, "\n"); - HDfprintf(output, "HDF5 dataset dimensions="); + fprintf(output, "HDF5 dataset dimensions="); if (opts->h5_extendable) { - HDfprintf(output, "Extendable\n"); + fprintf(output, "Extendable\n"); } else { - HDfprintf(output, "Fixed\n"); + fprintf(output, "Fixed\n"); } } else { - HDfprintf(output, "Contiguous\n"); + fprintf(output, "Contiguous\n"); } - HDfprintf(output, "HDF5 file driver="); + fprintf(output, "HDF5 file driver="); if (opts->vfd == sec2) { - HDfprintf(output, "sec2\n"); + fprintf(output, "sec2\n"); } else if (opts->vfd == stdio) { - HDfprintf(output, "stdio\n"); + fprintf(output, "stdio\n"); } else if (opts->vfd == core) { - HDfprintf(output, "core\n"); + fprintf(output, "core\n"); } else if (opts->vfd == split) { - HDfprintf(output, "split\n"); + fprintf(output, "split\n"); } else if (opts->vfd == multi) { - HDfprintf(output, "multi\n"); + fprintf(output, "multi\n"); } else if (opts->vfd == family) { - HDfprintf(output, "family\n"); + fprintf(output, "family\n"); } else if (opts->vfd == direct) { - HDfprintf(output, "direct\n"); + fprintf(output, "direct\n"); } } { char *prefix = HDgetenv("HDF5_PREFIX"); - HDfprintf(output, "Env HDF5_PREFIX=%s\n", (prefix ? prefix : "not set")); + fprintf(output, "Env HDF5_PREFIX=%s\n", (prefix ? prefix : "not set")); } - HDfprintf(output, "==== End of Parameters ====\n"); - HDfprintf(output, "\n"); + fprintf(output, "==== End of Parameters ====\n"); + fprintf(output, "\n"); } /* @@ -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; @@ -859,7 +859,7 @@ parse_command_line(int argc, const char *const *argv) while (end && *end != '\0') { char buf[10]; - HDmemset(buf, '\0', sizeof(buf)); + memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (HDisalnum(*end) && i < 10) @@ -872,8 +872,8 @@ parse_command_line(int argc, const char *const *argv) cl_opts->io_types |= SIO_POSIX; } else { - HDfprintf(stderr, "sio_perf: invalid --api option %s\n", buf); - HDexit(EXIT_FAILURE); + fprintf(stderr, "sio_perf: invalid --api option %s\n", buf); + exit(EXIT_FAILURE); } if (*end == '\0') @@ -899,7 +899,7 @@ parse_command_line(int argc, const char *const *argv) while (end && *end != '\0') { char buf[10]; - HDmemset(buf, '\0', sizeof(buf)); + memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (HDisalnum(*end) && i < 10) @@ -925,7 +925,7 @@ parse_command_line(int argc, const char *const *argv) while (end && *end != '\0') { char buf[10]; - HDmemset(buf, '\0', sizeof(buf)); + memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (HDisalnum(*end) && i < 10) @@ -936,8 +936,8 @@ parse_command_line(int argc, const char *const *argv) for (j = 0; j < 10 && buf[j] != '\0'; ++j) if (!HDisdigit(buf[j])) { - HDfprintf(stderr, "sio_perf: invalid --debug option %s\n", buf); - HDexit(EXIT_FAILURE); + fprintf(stderr, "sio_perf: invalid --debug option %s\n", buf); + exit(EXIT_FAILURE); } sio_debug_level = atoi(buf); @@ -962,8 +962,8 @@ parse_command_line(int argc, const char *const *argv) cl_opts->verify = TRUE; break; default: - HDfprintf(stderr, "sio_perf: invalid --debug option %s\n", buf); - HDexit(EXIT_FAILURE); + fprintf(stderr, "sio_perf: invalid --debug option %s\n", buf); + exit(EXIT_FAILURE); } } @@ -982,7 +982,7 @@ parse_command_line(int argc, const char *const *argv) while (end && *end != '\0') { char buf[10]; - HDmemset(buf, '\0', sizeof(buf)); + memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (HDisalnum(*end) && i < 10) @@ -1003,7 +1003,7 @@ parse_command_line(int argc, const char *const *argv) break; case 'i': - cl_opts->num_iters = HDatoi(H5_optarg); + cl_opts->num_iters = atoi(H5_optarg); break; case 'o': cl_opts->output_file = H5_optarg; @@ -1034,8 +1034,8 @@ parse_command_line(int argc, const char *const *argv) cl_opts->vfd = direct; } else { - HDfprintf(stderr, "sio_perf: invalid --api option %s\n", H5_optarg); - HDexit(EXIT_FAILURE); + fprintf(stderr, "sio_perf: invalid --api option %s\n", H5_optarg); + exit(EXIT_FAILURE); } break; case 'w': @@ -1051,7 +1051,7 @@ parse_command_line(int argc, const char *const *argv) while (end && *end != '\0') { char buf[10]; - HDmemset(buf, '\0', sizeof(buf)); + memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (HDisalnum(*end) && i < 10) @@ -1078,7 +1078,7 @@ parse_command_line(int argc, const char *const *argv) while (end && *end != '\0') { char buf[10]; - HDmemset(buf, '\0', sizeof(buf)); + memset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (HDisalnum(*end) && i < 10) @@ -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; } } @@ -1198,8 +1198,8 @@ parse_size_directive(const char *size) break; default: - HDfprintf(stderr, "Illegal size specifier '%c'\n", *endptr); - HDexit(EXIT_FAILURE); + fprintf(stderr, "Illegal size specifier '%c'\n", *endptr); + exit(EXIT_FAILURE); } } @@ -1216,70 +1216,70 @@ static void usage(const char *prog) { print_version(prog); - HDprintf("usage: %s [OPTIONS]\n", prog); - HDprintf(" OPTIONS\n"); - HDprintf(" -h Print an usage message and exit\n"); - HDprintf(" -A AL Which APIs to test\n"); - HDprintf(" [default: all of them]\n"); - HDprintf(" -c SL Selects chunked storage and defines chunks dimensions\n"); - HDprintf(" and sizes\n"); - HDprintf(" [default: Off]\n"); - HDprintf(" -e SL Dimensions and sizes of dataset\n"); - HDprintf(" [default: 100,200]\n"); - HDprintf(" -i N Number of iterations to perform\n"); - HDprintf(" [default: 1]\n"); - HDprintf(" -r NL Dimension access order (see below for description)\n"); - HDprintf(" [default: 1,2]\n"); - HDprintf(" -t Selects extendable dimensions for HDF5 dataset\n"); - HDprintf(" [default: Off]\n"); - HDprintf(" -v VFD Selects file driver for HDF5 access\n"); - HDprintf(" [default: sec2]\n"); - HDprintf(" -w Perform write tests, not the read tests\n"); - HDprintf(" [default: Off]\n"); - HDprintf(" -x SL Dimensions and sizes of the transfer buffer\n"); - HDprintf(" [default: 10,20]\n"); - HDprintf("\n"); - HDprintf(" N - is an integer > 0.\n"); - HDprintf("\n"); - HDprintf(" S - is a size specifier, an integer > 0 followed by a size indicator:\n"); - HDprintf(" K - Kilobyte (%d)\n", ONE_KB); - HDprintf(" M - Megabyte (%d)\n", ONE_MB); - HDprintf(" G - Gigabyte (%d)\n", ONE_GB); - HDprintf("\n"); - HDprintf(" Example: '37M' is 37 megabytes or %d bytes\n", 37 * ONE_MB); - HDprintf("\n"); - HDprintf(" AL - is an API list. Valid values are:\n"); - HDprintf(" hdf5 - HDF5\n"); - HDprintf(" posix - POSIX\n"); - HDprintf("\n"); - HDprintf(" Example: -A posix,hdf5\n"); - HDprintf("\n"); - HDprintf(" NL - is list of integers (N) separated by commas.\n"); - HDprintf("\n"); - HDprintf(" Example: 1,2,3\n"); - HDprintf("\n"); - HDprintf(" SL - is list of size specifiers (S) separated by commas.\n"); - HDprintf("\n"); - HDprintf(" Example: 2K,2K,3K\n"); - HDprintf("\n"); - HDprintf(" The example defines an object (dataset, transfer buffer) with three\n"); - HDprintf(" dimensions. Be aware that as the number of dimensions increases, the\n"); - HDprintf(" the total size of the object increases exponentially.\n"); - HDprintf("\n"); - HDprintf(" VFD - is an HDF5 file driver specifier. Valid values are:\n"); - HDprintf(" sec2, stdio, core, split, multi, family, direct\n"); - HDprintf("\n"); - HDprintf(" Dimension access order:\n"); - HDprintf(" Data access starts at the cardinal origin of the dataset using the\n"); - HDprintf(" transfer buffer. The next access occurs on a dataset region next to\n"); - HDprintf(" the previous one. For a multidimensional dataset, there are several\n"); - HDprintf(" directions as to where to proceed. This can be specified in the dimension\n"); - HDprintf(" access order. For example, -r 1,2 states that the tool should traverse\n"); - HDprintf(" dimension 1 first, and then dimension 2.\n"); - HDprintf("\n"); - HDprintf(" Environment variables:\n"); - HDprintf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n"); - HDprintf(" HDF5_PREFIX Data file prefix\n"); - HDprintf("\n"); - HDfflush(stdout); + printf("usage: %s [OPTIONS]\n", prog); + printf(" OPTIONS\n"); + printf(" -h Print an usage message and exit\n"); + printf(" -A AL Which APIs to test\n"); + printf(" [default: all of them]\n"); + printf(" -c SL Selects chunked storage and defines chunks dimensions\n"); + printf(" and sizes\n"); + printf(" [default: Off]\n"); + printf(" -e SL Dimensions and sizes of dataset\n"); + printf(" [default: 100,200]\n"); + printf(" -i N Number of iterations to perform\n"); + printf(" [default: 1]\n"); + printf(" -r NL Dimension access order (see below for description)\n"); + printf(" [default: 1,2]\n"); + printf(" -t Selects extendable dimensions for HDF5 dataset\n"); + printf(" [default: Off]\n"); + printf(" -v VFD Selects file driver for HDF5 access\n"); + printf(" [default: sec2]\n"); + printf(" -w Perform write tests, not the read tests\n"); + printf(" [default: Off]\n"); + printf(" -x SL Dimensions and sizes of the transfer buffer\n"); + printf(" [default: 10,20]\n"); + printf("\n"); + printf(" N - is an integer > 0.\n"); + printf("\n"); + printf(" S - is a size specifier, an integer > 0 followed by a size indicator:\n"); + printf(" K - Kilobyte (%d)\n", ONE_KB); + printf(" M - Megabyte (%d)\n", ONE_MB); + printf(" G - Gigabyte (%d)\n", ONE_GB); + printf("\n"); + printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37 * ONE_MB); + printf("\n"); + printf(" AL - is an API list. Valid values are:\n"); + printf(" hdf5 - HDF5\n"); + printf(" posix - POSIX\n"); + printf("\n"); + printf(" Example: -A posix,hdf5\n"); + printf("\n"); + printf(" NL - is list of integers (N) separated by commas.\n"); + printf("\n"); + printf(" Example: 1,2,3\n"); + printf("\n"); + printf(" SL - is list of size specifiers (S) separated by commas.\n"); + printf("\n"); + printf(" Example: 2K,2K,3K\n"); + printf("\n"); + printf(" The example defines an object (dataset, transfer buffer) with three\n"); + printf(" dimensions. Be aware that as the number of dimensions increases, the\n"); + printf(" the total size of the object increases exponentially.\n"); + printf("\n"); + printf(" VFD - is an HDF5 file driver specifier. Valid values are:\n"); + printf(" sec2, stdio, core, split, multi, family, direct\n"); + printf("\n"); + printf(" Dimension access order:\n"); + printf(" Data access starts at the cardinal origin of the dataset using the\n"); + printf(" transfer buffer. The next access occurs on a dataset region next to\n"); + printf(" the previous one. For a multidimensional dataset, there are several\n"); + printf(" directions as to where to proceed. This can be specified in the dimension\n"); + printf(" access order. For example, -r 1,2 states that the tool should traverse\n"); + printf(" dimension 1 first, and then dimension 2.\n"); + printf("\n"); + printf(" Environment variables:\n"); + printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n"); + printf(" HDF5_PREFIX Data file prefix\n"); + printf("\n"); + fflush(stdout); } /* end usage() */ diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index c58943b..0ced980 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -71,7 +71,7 @@ h5repack_init(pack_opt_t *options, int verbose, hbool_t latest) { int k, n; - HDmemset(options, 0, sizeof(pack_opt_t)); + memset(options, 0, sizeof(pack_opt_t)); options->min_comp = 0; options->verbose = verbose; options->latest = latest; @@ -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,13 +253,13 @@ 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; /* Update the token/address and id */ - HDmemcpy(&dt->obj_token, &travt->objs[i].obj_token, sizeof(H5O_token_t)); + memcpy(&dt->obj_token, &travt->objs[i].obj_token, sizeof(H5O_token_t)); dt->id_out = H5I_INVALID_HID; /* Check if this type is the one requested */ @@ -276,13 +276,13 @@ 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; /* Update the token/address and id */ - HDmemcpy(&dt_ret->obj_token, &oinfo.token, sizeof(H5O_token_t)); + memcpy(&dt_ret->obj_token, &oinfo.token, sizeof(H5O_token_t)); dt_ret->id_out = H5I_INVALID_HID; } /* end if requested datatype not found */ @@ -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,15 +526,15 @@ 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*/ if (options->verbose > 0) { if (options->verbose == 2) - HDprintf(FORMAT_OBJ_ATTR_TIME, "attr", read_time, write_time, name); + printf(FORMAT_OBJ_ATTR_TIME, "attr", read_time, write_time, name); else - HDprintf(FORMAT_OBJ_ATTR, "attr", name); + printf(FORMAT_OBJ_ATTR, "attr", name); } /*--------------------------------------------------------------------- @@ -566,7 +566,7 @@ done: H5Treclaim(wtype_id, space_id, H5P_DEFAULT, buf); /* Free buf */ - HDfree(buf); + free(buf); } H5Aclose(attr_out); @@ -602,7 +602,7 @@ check_options(pack_opt_t *options) */ if (options->verbose > 0 && have_request(options)) { if (options->all_layout == 1) { - HDprintf("All objects to modify layout are...\n"); + printf("All objects to modify layout are...\n"); switch (options->layout_g) { case H5D_COMPACT: strcpy(slayout, "compact"); @@ -624,17 +624,17 @@ check_options(pack_opt_t *options) strcpy(slayout, "invalid layout\n"); H5TOOLS_GOTO_DONE((-1)); } - HDprintf(" Apply %s layout to all", slayout); + printf(" Apply %s layout to all", slayout); if (H5D_CHUNKED == options->layout_g) { - HDprintf("with dimension [ "); + printf("with dimension [ "); for (j = 0; j < options->chunk_g.rank; j++) - HDprintf("%d ", (int)options->chunk_g.chunk_lengths[j]); - HDprintf("]"); + printf("%d ", (int)options->chunk_g.chunk_lengths[j]); + printf("]"); } - HDprintf("\n"); + printf("\n"); } else - HDprintf("No all objects to modify layout\n"); + printf("No all objects to modify layout\n"); } /* end if verbose */ for (i = 0; i < options->op_tbl->nelems; i++) { @@ -642,16 +642,16 @@ check_options(pack_opt_t *options) if (options->op_tbl->objs[i].chunk.rank > 0) { if (options->verbose > 0) { - HDprintf(" <%s> with chunk size ", name); + printf(" <%s> with chunk size ", name); for (k = 0; k < options->op_tbl->objs[i].chunk.rank; k++) - HDprintf("%d ", (int)options->op_tbl->objs[i].chunk.chunk_lengths[k]); - HDprintf("\n"); + printf("%d ", (int)options->op_tbl->objs[i].chunk.chunk_lengths[k]); + printf("\n"); } has_ck = 1; } else if (options->op_tbl->objs[i].chunk.rank == -2) { /* TODO: replace 'magic number' */ if (options->verbose > 0) - HDprintf(" <%s> %s\n", name, "NONE (contiguous)"); + printf(" <%s> %s\n", name, "NONE (contiguous)"); has_ck = 1; } } /* end for each object in options */ @@ -666,34 +666,34 @@ check_options(pack_opt_t *options) if (options->verbose > 0 && have_request(options)) { if (options->all_filter == 1) { - HDprintf("All objects to apply filter are...\n"); + printf("All objects to apply filter are...\n"); for (k = 0; k < options->n_filter_g; k++) { H5Z_filter_t filtn = options->filter_g[k].filtn; if (filtn < 0) { - HDprintf(" Unknown\n"); + printf(" Unknown\n"); continue; } switch (filtn) { case H5Z_FILTER_NONE: - HDprintf(" Uncompress all\n"); + printf(" Uncompress all\n"); break; case H5Z_FILTER_SHUFFLE: case H5Z_FILTER_FLETCHER32: - HDprintf(" All with %s\n", get_sfilter(filtn)); + printf(" All with %s\n", get_sfilter(filtn)); break; case H5Z_FILTER_SZIP: case H5Z_FILTER_DEFLATE: - HDprintf(" All with %s, parameter %d\n", get_sfilter(filtn), - options->filter_g[k].cd_values[0]); + printf(" All with %s, parameter %d\n", get_sfilter(filtn), + options->filter_g[k].cd_values[0]); break; default: - HDprintf(" User Defined %d\n", filtn); + printf(" User Defined %d\n", filtn); break; } /* end switch */ } /* end for each filter */ } /* end if options->all_filter == 1 (TODO: meaning) */ else - HDprintf("No all objects to apply filter\n"); + printf("No all objects to apply filter\n"); } /* end if verbose */ for (i = 0; i < options->op_tbl->nelems; i++) { @@ -704,11 +704,11 @@ check_options(pack_opt_t *options) if (options->verbose > 0) { if (pack.filter[j].filtn >= 0) { if (pack.filter[j].filtn > H5Z_FILTER_SCALEOFFSET) { - HDprintf(" <%s> with %s filter %d\n", name, get_sfilter(pack.filter[j].filtn), - pack.filter[j].filtn); + printf(" <%s> with %s filter %d\n", name, get_sfilter(pack.filter[j].filtn), + pack.filter[j].filtn); } else { - HDprintf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn)); + printf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn)); } } } @@ -740,8 +740,8 @@ check_options(pack_opt_t *options) */ if (options->ublock_filename != NULL && options->ublock_size == 0) { if (options->verbose > 0) { - HDprintf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", - options->ublock_filename); + printf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", + options->ublock_filename); options->ublock_size = 1024; } } @@ -813,21 +813,21 @@ check_objects(const char *fname, pack_opt_t *options) */ if (options->verbose > 0) - HDprintf("Opening file. Searching %zu objects to modify ...\n", travt->nobjs); + printf("Opening file. Searching %zu objects to modify ...\n", travt->nobjs); for (i = 0; i < options->op_tbl->nelems; i++) { pack_info_t obj = options->op_tbl->objs[i]; char *name = obj.path; if (options->verbose > 0) - HDprintf(" <%s>", name); + printf(" <%s>", name); /* the input object names are present in the file and are valid */ if (h5trav_getindext(name, travt) < 0) H5TOOLS_GOTO_ERROR((-1), "%s Could not find <%s> in file <%s>. Exiting...\n", (options->verbose > 0 ? "\n" : ""), name, fname); if (options->verbose > 0) - HDprintf("...Found\n"); + printf("...Found\n"); for (ifil = 0; ifil < obj.nfilters; ifil++) { if (obj.filter[ifil].filtn < 0) @@ -854,7 +854,7 @@ check_objects(const char *fname, pack_opt_t *options) H5TOOLS_GOTO_ERROR((-1), "H5Dget_space failed"); if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Sget_simple_extent_ndims failed"); - HDmemset(dims, 0, sizeof dims); + memset(dims, 0, sizeof dims); if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Sget_simple_extent_dims failed"); for (j = 0; j < rank; j++) @@ -866,7 +866,7 @@ check_objects(const char *fname, pack_opt_t *options) } if (csize < ppb) { - HDprintf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n"); + printf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n"); H5TOOLS_GOTO_DONE(0); } } /* end case SZIP */ diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 42c393b..172ba26 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -299,7 +299,7 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options) *------------------------------------------------------------------------- */ if (options->verbose > 0) - HDprintf("Making new file ...\n"); + printf("Making new file ...\n"); if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, options->fout_fapl)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Fcreate could not create file <%s>:", fnameout); @@ -658,7 +658,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti int ret_value = 0; /* init linkinfo struct */ - HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); + memset(&linkinfo, 0, sizeof(h5tool_link_info_t)); /*------------------------------------------------------------------------- * copy the supplied object list @@ -667,14 +667,14 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (options->verbose > 0) { if (options->verbose == 2) { - HDprintf("-----------------------------------------------------------------\n"); - HDprintf(" Type Filter (Compression) Timing read/write Name\n"); - HDprintf("-----------------------------------------------------------------\n"); + printf("-----------------------------------------------------------------\n"); + printf(" Type Filter (Compression) Timing read/write Name\n"); + printf("-----------------------------------------------------------------\n"); } else { - HDprintf("-----------------------------------------\n"); - HDprintf(" Type Filter (Compression) Name\n"); - HDprintf("-----------------------------------------\n"); + printf("-----------------------------------------\n"); + printf(" Type Filter (Compression) Name\n"); + printf("-----------------------------------------\n"); } } @@ -695,9 +695,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti case H5TRAV_TYPE_GROUP: if (options->verbose > 0) { if (options->verbose == 2) - HDprintf(FORMAT_OBJ_NOTIME, "group", travt->objs[i].name); + printf(FORMAT_OBJ_NOTIME, "group", travt->objs[i].name); else - HDprintf(FORMAT_OBJ, "group", travt->objs[i].name); + printf(FORMAT_OBJ, "group", travt->objs[i].name); } /* open input group */ @@ -877,7 +877,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5TOOLS_GOTO_ERROR((-1), "H5Dget_create_plist failed"); if ((rank = H5Sget_simple_extent_ndims(f_space_id)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Sget_simple_extent_ndims failed"); - HDmemset(dims, 0, sizeof dims); + memset(dims, 0, sizeof dims); if (H5Sget_simple_extent_dims(f_space_id, dims, NULL) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Sget_simple_extent_dims failed"); if (H5Dget_space_status(dset_in, &space_status) < 0) @@ -991,9 +991,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (dset_out == H5I_INVALID_HID) { H5TOOLS_INFO("H5Dcreate2 failed"); if (options->verbose > 0) - HDprintf(" warning: could not create dataset <%s>. Applying original " - "settings\n", - travt->objs[i].name); + printf(" warning: could not create dataset <%s>. Applying original " + "settings\n", + travt->objs[i].name); if ((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, @@ -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"); @@ -1116,8 +1116,8 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti hslab_space = H5Screate_simple(1, &hslab_nelmts, NULL); /* the hyperslab selection loop */ - HDmemset(hs_sel_offset, 0, sizeof hs_sel_offset); - HDmemset(zero, 0, sizeof zero); + memset(hs_sel_offset, 0, sizeof hs_sel_offset); + memset(zero, 0, sizeof zero); for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_select_nelmts) { if (rank > 0) { @@ -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 */ @@ -1221,13 +1221,13 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti * (in case there was a filter) */ if (has_filter && apply_s == 0) - HDprintf(" <warning: filter not applied to %s. dataset smaller than " - "%d bytes>\n", - travt->objs[i].name, (int)options->min_comp); + printf(" <warning: filter not applied to %s. dataset smaller than " + "%d bytes>\n", + travt->objs[i].name, (int)options->min_comp); if (has_filter && apply_f == 0) - HDprintf(" <warning: could not apply the filter to %s>\n", - travt->objs[i].name); + printf(" <warning: could not apply the filter to %s>\n", + travt->objs[i].name); } /* end if verbose (print compression) */ /*------------------------------------------------------------------------- @@ -1310,9 +1310,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (options->verbose > 0) { if (options->verbose == 2) - HDprintf(FORMAT_OBJ_TIME, "dset", 0.0, write_time, travt->objs[i].name); + printf(FORMAT_OBJ_TIME, "dset", 0.0, write_time, travt->objs[i].name); else - HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name); + printf(FORMAT_OBJ, "dset", travt->objs[i].name); } } /* end whether we have request for filter/chunking */ @@ -1327,9 +1327,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti case H5TRAV_TYPE_NAMED_DATATYPE: if (options->verbose > 0) { if (options->verbose == 2) - HDprintf(FORMAT_OBJ_NOTIME, "type", travt->objs[i].name); + printf(FORMAT_OBJ_NOTIME, "type", travt->objs[i].name); else - HDprintf(FORMAT_OBJ, "type", travt->objs[i].name); + printf(FORMAT_OBJ, "type", travt->objs[i].name); } if ((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) @@ -1371,9 +1371,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti case H5TRAV_TYPE_UDLINK: if (options->verbose > 0) { if (options->verbose == 2) - HDprintf(FORMAT_OBJ_NOTIME, "link", travt->objs[i].name); + printf(FORMAT_OBJ_NOTIME, "link", travt->objs[i].name); else - HDprintf(FORMAT_OBJ, "link", travt->objs[i].name); + printf(FORMAT_OBJ, "link", travt->objs[i].name); } /* Check -X option. */ @@ -1381,7 +1381,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (H5tools_get_symlink_info(fidin, travt->objs[i].name, &linkinfo, 1) == 0) { /* dangling link */ if (options->prune) { - HDprintf("Pruned %s.\n", travt->objs[i].name); + printf("Pruned %s.\n", travt->objs[i].name); } else { if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, @@ -1421,12 +1421,12 @@ 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 { if (options->prune) { - HDprintf("Pruned %s.\n", travt->objs[i].name); + printf("Pruned %s.\n", travt->objs[i].name); } else { if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, @@ -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() */ @@ -1589,9 +1589,9 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr, pack_opt_ if (!pr) if (options->verbose == 2) - HDprintf(FORMAT_OBJ_TIME, "dset", read_time, write_time, objname); + printf(FORMAT_OBJ_TIME, "dset", read_time, write_time, objname); else - HDprintf(FORMAT_OBJ, "dset", objname); + printf(FORMAT_OBJ, "dset", objname); else { char str[512], temp[512]; @@ -1600,9 +1600,9 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr, pack_opt_ HDsnprintf(temp, sizeof(temp), " (%.3f:1)", ratio); HDstrcat(str, temp); if (options->verbose == 2) - HDprintf(FORMAT_OBJ_TIME, str, read_time, write_time, objname); + printf(FORMAT_OBJ_TIME, str, read_time, write_time, objname); else - HDprintf(FORMAT_OBJ, str, objname); + printf(FORMAT_OBJ, str, objname); } } /* end print_dataset_info() */ @@ -1654,13 +1654,13 @@ copy_user_block(const char *infile, const char *outfile, hsize_t size) } while (-1 == nwritten && EINTR == errno); if (-1 == nwritten) /* error */ H5TOOLS_GOTO_ERROR((-1), "HDwrite failed"); - HDassert(nwritten > 0); - HDassert(nwritten <= nbytes); + assert(nwritten > 0); + assert(nwritten <= nbytes); /* Update # of bytes left & offset in buffer */ nbytes -= nwritten; wbuf += nwritten; - HDassert(nbytes == 0 || wbuf < (rbuf + USERBLOCK_XFER_SIZE)); + assert(nbytes == 0 || wbuf < (rbuf + USERBLOCK_XFER_SIZE)); } /* end while */ /* Update size of userblock left to transfer */ @@ -1728,9 +1728,9 @@ print_user_block(const char *filename, hid_t fid) for (i = 0; i < nread; i++) { - HDprintf("%c ", rbuf[i]); + printf("%c ", rbuf[i]); } - HDprintf("\n"); + printf("\n"); if (nread < 0) { H5TOOLS_GOTO_ERROR((-1), "nread < 0"); diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 5ecb423..0621c7a 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -370,7 +370,7 @@ static void leave(int ret) { h5tools_close(); - HDexit(ret); + exit(ret); } /*------------------------------------------------------------------------- @@ -391,7 +391,7 @@ read_info(const char *filename, pack_opt_t *options) int i; int ret_value = EXIT_SUCCESS; - if (NULL == (fp = HDfopen(filename, "r"))) { + if (NULL == (fp = fopen(filename, "r"))) { error_msg("cannot open options file %s\n", filename); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; @@ -534,10 +534,10 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) int ret_value = 0; /* Initialize fapl info structs */ - HDmemset(&in_vol_info, 0, sizeof(h5tools_vol_info_t)); - HDmemset(&out_vol_info, 0, sizeof(h5tools_vol_info_t)); - HDmemset(&in_vfd_info, 0, sizeof(h5tools_vfd_info_t)); - HDmemset(&out_vfd_info, 0, sizeof(h5tools_vfd_info_t)); + memset(&in_vol_info, 0, sizeof(h5tools_vol_info_t)); + memset(&out_vol_info, 0, sizeof(h5tools_vol_info_t)); + memset(&in_vfd_info, 0, sizeof(h5tools_vfd_info_t)); + memset(&out_vfd_info, 0, sizeof(h5tools_vfd_info_t)); /* parse command line options */ while (EOF != (opt = H5_get_option(argc, argv, s_opts, l_opts))) { @@ -569,7 +569,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) case 'v': if (H5_optarg != NULL) { - if (2 == HDatoi(H5_optarg)) + if (2 == atoi(H5_optarg)) options->verbose = 2; } else @@ -624,7 +624,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) break; case 'j': - bound = HDatoi(H5_optarg); + bound = atoi(H5_optarg); if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) { error_msg("in parsing low bound\n"); h5tools_setstatus(EXIT_FAILURE); @@ -635,7 +635,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) break; case 'k': - bound = HDatoi(H5_optarg); + bound = atoi(H5_optarg); if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) { error_msg("in parsing high bound\n"); h5tools_setstatus(EXIT_FAILURE); @@ -654,13 +654,13 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) break; case 'c': - options->grp_compact = HDatoi(H5_optarg); + options->grp_compact = atoi(H5_optarg); if (options->grp_compact > 0) options->latest = TRUE; /* must use latest format */ break; case 'd': - options->grp_indexed = HDatoi(H5_optarg); + options->grp_indexed = atoi(H5_optarg); if (options->grp_indexed > 0) options->latest = TRUE; /* must use latest format */ break; @@ -671,7 +671,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) char *msgPtr = HDstrchr(H5_optarg, ':'); options->latest = TRUE; /* must use latest format */ if (msgPtr == NULL) { - ssize = HDatoi(H5_optarg); + ssize = atoi(H5_optarg); for (idx = 0; idx < 5; idx++) options->msg_size[idx] = ssize; } @@ -680,7 +680,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) HDstrcpy(msgType, msgPtr + 1); msgPtr[0] = '\0'; - ssize = HDatoi(H5_optarg); + ssize = atoi(H5_optarg); if (!HDstrncmp(msgType, "dspace", 6)) options->msg_size[0] = ssize; else if (!HDstrncmp(msgType, "dtype", 5)) @@ -744,7 +744,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) } break; case 'P': - options->fs_persist = HDatoi(H5_optarg); + options->fs_persist = atoi(H5_optarg); if (options->fs_persist == 0) /* To distinguish the "specified" zero value */ options->fs_persist = -1; @@ -784,14 +784,14 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) case 'E': if (H5_optarg != NULL) - enable_error_stack = HDatoi(H5_optarg); + enable_error_stack = atoi(H5_optarg); else enable_error_stack = 1; break; case '1': in_vol_info.type = VOL_BY_VALUE; - in_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + in_vol_info.u.value = (H5VL_class_value_t)atoi(H5_optarg); custom_in_vol = TRUE; break; @@ -807,7 +807,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) case '4': out_vol_info.type = VOL_BY_VALUE; - out_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + out_vol_info.u.value = (H5VL_class_value_t)atoi(H5_optarg); custom_out_vol = TRUE; break; @@ -823,7 +823,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) case '7': in_vfd_info.type = VFD_BY_VALUE; - in_vfd_info.u.value = (H5FD_class_value_t)HDatoi(H5_optarg); + in_vfd_info.u.value = (H5FD_class_value_t)atoi(H5_optarg); custom_in_vfd = TRUE; break; @@ -839,7 +839,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) case '0': out_vfd_info.type = VFD_BY_VALUE; - out_vfd_info.u.value = (H5FD_class_value_t)HDatoi(H5_optarg); + out_vfd_info.u.value = (H5FD_class_value_t)atoi(H5_optarg); custom_out_vfd = TRUE; break; @@ -891,7 +891,7 @@ parse_command_line(int argc, const char *const *argv, pack_opt_t *options) errno = 0; onion_fa_in_g.revision_num = HDstrtoull(in_vfd_info.info, NULL, 10); if (errno == ERANGE) { - HDprintf("Invalid onion revision specified for the input file\n"); + printf("Invalid onion revision specified for the input file\n"); usage(h5tools_getprogname()); exit(EXIT_FAILURE); } @@ -965,7 +965,7 @@ main(int argc, char **argv) pack_opt_t options; /*the global options */ int parse_ret; - HDmemset(&options, 0, sizeof(pack_opt_t)); + memset(&options, 0, sizeof(pack_opt_t)); /* Initialize h5tools lib */ h5tools_init(); @@ -975,14 +975,14 @@ main(int argc, char **argv) /* update hyperslab buffer size from H5TOOLS_BUFSIZE env if exist */ if (h5tools_getenv_update_hyperslab_bufsize() < 0) { - HDprintf("Error occurred while retrieving H5TOOLS_BUFSIZE value\n"); + printf("Error occurred while retrieving H5TOOLS_BUFSIZE value\n"); h5tools_setstatus(EXIT_FAILURE); goto done; } /* initialize options */ if (h5repack_init(&options, 0, FALSE) < 0) { - HDprintf("Error occurred while initializing repack options\n"); + printf("Error occurred while initializing repack options\n"); h5tools_setstatus(EXIT_FAILURE); goto done; } @@ -992,7 +992,7 @@ main(int argc, char **argv) parse_ret = parse_command_line(argc, (const char *const *)argv, &options); if (parse_ret < 0) { - HDprintf("Error occurred while parsing command-line options\n"); + printf("Error occurred while parsing command-line options\n"); h5tools_setstatus(EXIT_FAILURE); goto done; } @@ -1007,7 +1007,7 @@ main(int argc, char **argv) /* pack it */ if (h5repack(infile, outfile, &options) < 0) { - HDprintf("Error occurred while repacking\n"); + printf("Error occurred while repacking\n"); h5tools_setstatus(EXIT_FAILURE); goto done; } diff --git a/tools/src/h5repack/h5repack_opttable.c b/tools/src/h5repack/h5repack_opttable.c index 4e6e0f4..2018527 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; } @@ -200,7 +200,7 @@ options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, pac /* already chunk info inserted for this one; exit */ if (table->objs[i].chunk.rank > 0) { H5TOOLS_INFO("chunk information already inserted for <%s>\n", obj_list[j].obj); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* insert the layout info */ else { diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 9ffee0a..9ee4d07 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -52,7 +52,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t unsigned pixels_per_block; /* initialize compression info */ - HDmemset(filt, 0, sizeof(filter_info_t)); + memset(filt, 0, sizeof(filter_info_t)); *is_glb = 0; /* check for the end of object list and number of objects */ @@ -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; @@ -95,7 +95,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t sobj[k + 1] = '\0'; HDstrcpy(obj_list[n].obj, sobj); - HDmemset(sobj, 0, sizeof(sobj)); + memset(sobj, 0, sizeof(sobj)); n++; k = -1; } @@ -103,9 +103,9 @@ 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); + exit(EXIT_FAILURE); } /* get filter additional parameters */ @@ -134,9 +134,9 @@ 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); + exit(EXIT_FAILURE); } if (l == -1) stype[m] = c; @@ -152,7 +152,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_values[j++] = H5_SZIP_EC_OPTION_MASK; else { error_msg("szip mask must be 'NN' or 'EC' \n"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } } @@ -184,9 +184,9 @@ 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); + exit(EXIT_FAILURE); } if (l == -1) stype[m] = c; @@ -202,7 +202,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_values[j++] = H5Z_SO_FLOAT_DSCALE; else { error_msg("scale type must be 'IN' or 'DS' \n"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } } @@ -224,7 +224,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t if (str[u] == ',') { stype[q] = '\0'; /* end digit */ if (l == -1) { - filt->filtn = HDatoi(stype); + filt->filtn = atoi(stype); l = 0; } else if (f == -1) { @@ -244,15 +244,15 @@ 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); + exit(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); + exit(EXIT_FAILURE); } stype[q] = c; } /* for u */ @@ -269,9 +269,9 @@ 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); + exit(EXIT_FAILURE); } stype[m] = c; } /* u */ @@ -312,9 +312,9 @@ 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); + exit(EXIT_FAILURE); } } @@ -327,9 +327,9 @@ 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); + exit(EXIT_FAILURE); } } @@ -342,9 +342,9 @@ 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); + exit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -356,9 +356,9 @@ 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); + exit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -370,9 +370,9 @@ 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); + exit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -384,9 +384,9 @@ 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); + exit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -397,16 +397,16 @@ 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); + exit(EXIT_FAILURE); } } else { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("invalid filter type in <%s>\n", str); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } break; } @@ -425,9 +425,9 @@ 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); + exit(EXIT_FAILURE); } break; /*------------------------------------------------------------------------- @@ -438,21 +438,21 @@ 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); + exit(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); + exit(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); + exit(EXIT_FAILURE); } break; default: @@ -496,9 +496,9 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about char sdim[10]; char slayout[10]; - HDmemset(sdim, '\0', sizeof(sdim)); - HDmemset(sobj, '\0', sizeof(sobj)); - HDmemset(slayout, '\0', sizeof(slayout)); + memset(sdim, '\0', sizeof(sdim)); + memset(sobj, '\0', sizeof(sobj)); + memset(slayout, '\0', sizeof(slayout)); /* check for the end of object list and number of objects */ for (i = 0, n = 0; i < len; i++) { @@ -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; @@ -532,7 +532,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about else sobj[k + 1] = '\0'; HDstrcpy(obj_list[n].obj, sobj); - HDmemset(sobj, 0, sizeof(sobj)); + memset(sobj, 0, sizeof(sobj)); n++; k = -1; } @@ -541,9 +541,9 @@ 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); + exit(EXIT_FAILURE); } /* get layout info */ @@ -558,7 +558,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about pack->layout = H5D_CHUNKED; else { error_msg("in parse layout, not a valid layout in <%s>\n", str); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } else { @@ -575,9 +575,9 @@ 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); + exit(EXIT_FAILURE); } for (i = j, c_index = 0; i < len; i++) { @@ -587,9 +587,9 @@ 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); + exit(EXIT_FAILURE); } if (c == 'x' || i == len - 1) { @@ -599,9 +599,9 @@ 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); + exit(EXIT_FAILURE); } c_index++; } @@ -615,9 +615,9 @@ 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); + exit(EXIT_FAILURE); } pack->chunk.rank = c_index + 1; } diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 3c0be30..171b335 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -152,18 +152,18 @@ 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) { - HDprintf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); + printf("cannot read into memory\n"); + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); } /* end if */ 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) { - HDprintf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); + printf("cannot allocate memory\n"); + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); } /* end if */ for (u = 0; u < nelmts; u++) { H5E_BEGIN_TRY @@ -183,11 +183,11 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5TOOLS_GOTO_ERROR((-1), "H5Rcreate failed"); if (options->verbose > 0) { if (options->verbose == 2) - HDprintf(FORMAT_OBJ_NOTIME, "dset", travt->objs[i].name); + printf(FORMAT_OBJ_NOTIME, "dset", travt->objs[i].name); else - HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name); - HDprintf("object <%s> object reference created to <%s>\n", - travt->objs[i].name, refname); + printf(FORMAT_OBJ, "dset", travt->objs[i].name); + printf("object <%s> object reference created to <%s>\n", + travt->objs[i].name, refname); } } /*refname*/ if (H5Oclose(refobj_id) < 0) @@ -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,10 +234,10 @@ 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) { - HDprintf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); + printf("cannot read into memory\n"); + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); } /* end if */ if (H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Dread failed"); @@ -246,11 +246,11 @@ 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) { - HDprintf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); + printf("cannot allocate memory\n"); + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); } /* end if */ for (u = 0; u < nelmts; u++) { @@ -279,9 +279,9 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (H5Sclose(region_id) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Sclose failed"); if (options->verbose > 0) { - HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name); - HDprintf("object <%s> region reference created to <%s>\n", - travt->objs[i].name, refname); + printf(FORMAT_OBJ, "dset", travt->objs[i].name); + printf("object <%s> region reference created to <%s>\n", + travt->objs[i].name, refname); } } /*refname*/ if (H5Oclose(refobj_id) < 0) @@ -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,18 +598,18 @@ 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) { - HDprintf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); + printf("cannot read into memory\n"); + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); } /* end if */ 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) { - HDprintf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); + printf("cannot allocate memory\n"); + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); } /* end if */ for (i = 0; i < (unsigned)nelmts; i++) @@ -619,11 +619,11 @@ 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) { - HDprintf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); + printf("cannot read into memory\n"); + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); } /* end if */ if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -632,11 +632,10 @@ 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) { - HDprintf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); + printf("cannot allocate memory\n"); + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); } /* end if */ for (i = 0; i < (unsigned)nelmts; i++) @@ -647,12 +646,12 @@ 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) { - HDprintf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); + printf("cannot read into memory\n"); + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); } /* end if */ if (H5Aread(attr_id, mtype_id, buf) < 0) @@ -667,7 +666,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / for (j = 0; j < ((hvl_t *)buf)[i].len; j++) { if (update_ref_value(attr_id, H5R_OBJECT, &(ptr[j]), fidout, &ref_out, travt) < 0) continue; - HDmemcpy(&(ptr[j]), &ref_out, msize); + memcpy(&(ptr[j]), &ref_out, msize); } } /* for (i=0; i<nelems; i++) */ } @@ -681,7 +680,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (update_ref_value(attr_id, H5R_DATASET_REGION, &(ptr[j]), fidout, &ref_out, travt) < 0) continue; - HDmemcpy(&(ptr[j]), &ref_out, msize); + memcpy(&(ptr[j]), &ref_out, msize); } } /* for (i=0; i<nelems; i++) */ } @@ -689,12 +688,12 @@ 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) { - HDprintf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); + printf("cannot read into memory\n"); + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); } /* end if */ if (H5Aread(attr_id, mtype_id, buf) < 0) @@ -712,7 +711,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / travt) < 0) /* Extra (void *) cast to quiet "cast to create alignment" warning - 2019/07/05, QAK */ continue; - HDmemcpy(((char *)buf) + idx, &ref_out, ref_comp_size[j]); + memcpy(((char *)buf) + idx, &ref_out, ref_comp_size[j]); } /* if */ else if (ref_comp_size[j] == H5R_DSET_REG_REF_BUF_SIZE) { size_t idx = i * msize + H5Tget_member_offset(mtype_id, ref_comp_index[j]); @@ -722,7 +721,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / (hdset_reg_ref_t *)(((char *)buf) + idx), fidout, &ref_out, travt) < 0) continue; - HDmemcpy(((char *)buf) + idx, &ref_out, ref_comp_size[j]); + memcpy(((char *)buf) + idx, &ref_out, ref_comp_size[j]); } /* else if */ } /* j */ } /* i */ @@ -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 05e0be8..7916517 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -192,7 +192,7 @@ static void leave(int ret) { h5tools_close(); - HDexit(ret); + exit(ret); } /*------------------------------------------------------------------------- @@ -207,46 +207,45 @@ leave(int ret) static void usage(const char *prog) { - HDfflush(stdout); - HDfprintf(stdout, "usage: %s [OPTIONS] file\n", prog); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " ERROR\n"); - HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); - HDfprintf(stdout, " Optional value 2 also prints file open errors\n"); - HDfprintf(stdout, " OPTIONS\n"); - HDfprintf(stdout, " -h, --help Print a usage message and exit\n"); - HDfprintf(stdout, " -V, --version Print version number and exit\n"); - HDfprintf(stdout, " -f, --file Print file information\n"); - HDfprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n"); - HDfprintf(stdout, " -g, --group Print group information\n"); - HDfprintf(stdout, " -l N, --links=N Set the threshold for the # of links when printing\n"); - HDfprintf(stdout, " information for small groups. N is an integer greater\n"); - HDfprintf(stdout, " than 0. The default threshold is 10.\n"); - HDfprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n"); - HDfprintf(stdout, " -d, --dset Print dataset information\n"); - HDfprintf(stdout, " -m N, --dims=N Set the threshold for the dimension sizes when printing\n"); - HDfprintf(stdout, - " information for small datasets. N is an integer greater\n"); - HDfprintf(stdout, " than 0. The default threshold is 10.\n"); - HDfprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n"); - HDfprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n"); - HDfprintf(stdout, " -A, --attribute Print attribute information\n"); - HDfprintf(stdout, " -a N, --numattrs=N Set the threshold for the # of attributes when printing\n"); - HDfprintf(stdout, - " information for small # of attributes. N is an integer greater\n"); - HDfprintf(stdout, " than 0. The default threshold is 10.\n"); - HDfprintf(stdout, " -s, --freespace Print free space information\n"); - HDfprintf(stdout, " -S, --summary Print summary of file space information\n"); - HDfprintf(stdout, " --s3-cred=<cred> Access file on S3, using provided credential\n"); - HDfprintf(stdout, " <cred> :: (region,id,key)\n"); - HDfprintf(stdout, " If <cred> == \"(,,)\", no authentication is used.\n"); - HDfprintf(stdout, " --hdfs-attrs=<attrs> Access a file on HDFS with given configuration\n"); - HDfprintf(stdout, " attributes.\n"); - HDfprintf(stdout, " <attrs> :: (<namenode name>,<namenode port>,\n"); - HDfprintf(stdout, " <kerberos cache path>,<username>,\n"); - HDfprintf(stdout, " <buffer size>)\n"); - HDfprintf(stdout, " If an attribute is empty, a default value will be\n"); - HDfprintf(stdout, " used.\n"); + fflush(stdout); + fprintf(stdout, "usage: %s [OPTIONS] file\n", prog); + fprintf(stdout, "\n"); + fprintf(stdout, " ERROR\n"); + fprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n"); + fprintf(stdout, " Optional value 2 also prints file open errors\n"); + fprintf(stdout, " OPTIONS\n"); + fprintf(stdout, " -h, --help Print a usage message and exit\n"); + fprintf(stdout, " -V, --version Print version number and exit\n"); + fprintf(stdout, " -f, --file Print file information\n"); + fprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n"); + fprintf(stdout, " -g, --group Print group information\n"); + fprintf(stdout, " -l N, --links=N Set the threshold for the # of links when printing\n"); + fprintf(stdout, " information for small groups. N is an integer greater\n"); + fprintf(stdout, " than 0. The default threshold is 10.\n"); + fprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n"); + fprintf(stdout, " -d, --dset Print dataset information\n"); + fprintf(stdout, " -m N, --dims=N Set the threshold for the dimension sizes when printing\n"); + fprintf(stdout, " information for small datasets. N is an integer greater\n"); + fprintf(stdout, " than 0. The default threshold is 10.\n"); + fprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n"); + fprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n"); + fprintf(stdout, " -A, --attribute Print attribute information\n"); + fprintf(stdout, " -a N, --numattrs=N Set the threshold for the # of attributes when printing\n"); + fprintf(stdout, + " information for small # of attributes. N is an integer greater\n"); + fprintf(stdout, " than 0. The default threshold is 10.\n"); + fprintf(stdout, " -s, --freespace Print free space information\n"); + fprintf(stdout, " -S, --summary Print summary of file space information\n"); + fprintf(stdout, " --s3-cred=<cred> Access file on S3, using provided credential\n"); + fprintf(stdout, " <cred> :: (region,id,key)\n"); + fprintf(stdout, " If <cred> == \"(,,)\", no authentication is used.\n"); + fprintf(stdout, " --hdfs-attrs=<attrs> Access a file on HDFS with given configuration\n"); + fprintf(stdout, " attributes.\n"); + fprintf(stdout, " <attrs> :: (<namenode name>,<namenode port>,\n"); + fprintf(stdout, " <kerberos cache path>,<username>,\n"); + fprintf(stdout, " <buffer size>)\n"); + fprintf(stdout, " If an attribute is empty, a default value will be\n"); + fprintf(stdout, " used.\n"); } /*------------------------------------------------------------------------- @@ -307,8 +306,8 @@ 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)); - HDassert(iter->attr_bins); + iter->attr_bins = (unsigned long *)realloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long)); + assert(iter->attr_bins); /* Initialize counts for intermediate bins */ while (iter->attr_nbins < bin) @@ -368,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 */ @@ -503,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 */ @@ -542,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"); @@ -739,10 +738,10 @@ 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); - HDassert(nsects); + assert(nsects); } /* end else-if */ for (u = 0; u < (size_t)nsects; u++) { @@ -755,8 +754,8 @@ 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)); - HDassert(iter->sect_bins); + iter->sect_bins = (unsigned long *)realloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long)); + assert(iter->sect_bins); /* Initialize counts for intermediate bins */ while (iter->sect_nbins < bin) @@ -771,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() */ @@ -795,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() */ @@ -842,7 +841,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re case 'E': if (H5_optarg != NULL) - enable_error_stack = HDatoi(H5_optarg); + enable_error_stack = atoi(H5_optarg); else enable_error_stack = 1; break; @@ -869,7 +868,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re case 'l': if (H5_optarg) { - sgroups_threshold = HDatoi(H5_optarg); + sgroups_threshold = atoi(H5_optarg); if (sgroups_threshold < 1) { error_msg("Invalid threshold for small groups\n"); goto error; @@ -892,7 +891,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re case 'm': if (H5_optarg) { - sdsets_threshold = HDatoi(H5_optarg); + sdsets_threshold = atoi(H5_optarg); if (sdsets_threshold < 1) { error_msg("Invalid threshold for small datasets\n"); goto error; @@ -915,7 +914,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re case 'a': if (H5_optarg) { - sattrs_threshold = HDatoi(H5_optarg); + sattrs_threshold = atoi(H5_optarg); if (sattrs_threshold < 1) { error_msg("Invalid threshold for small # of attributes\n"); goto error; @@ -941,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 */ @@ -1032,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() */ @@ -1096,14 +1095,14 @@ iter_free(iter_t *iter) static herr_t print_file_info(const iter_t *iter) { - HDprintf("File information\n"); - HDprintf("\t# of unique groups: %lu\n", iter->uniq_groups); - HDprintf("\t# of unique datasets: %lu\n", iter->uniq_dsets); - HDprintf("\t# of unique named datatypes: %lu\n", iter->uniq_dtypes); - HDprintf("\t# of unique links: %lu\n", iter->uniq_links); - HDprintf("\t# of unique other: %lu\n", iter->uniq_others); - HDprintf("\tMax. # of links to object: %lu\n", iter->max_links); - HDfprintf(stdout, "\tMax. # of objects in group: %" PRIuHSIZE "\n", iter->max_fanout); + printf("File information\n"); + printf("\t# of unique groups: %lu\n", iter->uniq_groups); + printf("\t# of unique datasets: %lu\n", iter->uniq_dsets); + printf("\t# of unique named datatypes: %lu\n", iter->uniq_dtypes); + printf("\t# of unique links: %lu\n", iter->uniq_links); + printf("\t# of unique other: %lu\n", iter->uniq_others); + printf("\tMax. # of links to object: %lu\n", iter->max_links); + fprintf(stdout, "\tMax. # of objects in group: %" PRIuHSIZE "\n", iter->max_fanout); return 0; } /* print_file_info() */ @@ -1125,41 +1124,41 @@ print_file_info(const iter_t *iter) static herr_t print_file_metadata(const iter_t *iter) { - HDfprintf(stdout, "File space information for file metadata (in bytes):\n"); - HDfprintf(stdout, "\tSuperblock: %" PRIuHSIZE "\n", iter->super_size); - HDfprintf(stdout, "\tSuperblock extension: %" PRIuHSIZE "\n", iter->super_ext_size); - HDfprintf(stdout, "\tUser block: %" PRIuHSIZE "\n", iter->ublk_size); - - HDfprintf(stdout, "\tObject headers: (total/unused)\n"); - HDfprintf(stdout, "\t\tGroups: %" PRIuHSIZE "/%" PRIuHSIZE "\n", iter->group_ohdr_info.total_size, - iter->group_ohdr_info.free_size); - HDfprintf(stdout, "\t\tDatasets(exclude compact data): %" PRIuHSIZE "/%" PRIuHSIZE "\n", - iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); - HDfprintf(stdout, "\t\tDatatypes: %" PRIuHSIZE "/%" PRIuHSIZE "\n", iter->dtype_ohdr_info.total_size, - iter->dtype_ohdr_info.free_size); - - HDfprintf(stdout, "\tGroups:\n"); - HDfprintf(stdout, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->groups_btree_storage_size); - HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->groups_heap_storage_size); - - HDfprintf(stdout, "\tAttributes:\n"); - HDfprintf(stdout, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->attrs_btree_storage_size); - HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->attrs_heap_storage_size); - - HDfprintf(stdout, "\tChunked datasets:\n"); - HDfprintf(stdout, "\t\tIndex: %" PRIuHSIZE "\n", iter->datasets_index_storage_size); - - HDfprintf(stdout, "\tDatasets:\n"); - HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->datasets_heap_storage_size); - - HDfprintf(stdout, "\tShared Messages:\n"); - HDfprintf(stdout, "\t\tHeader: %" PRIuHSIZE "\n", iter->SM_hdr_storage_size); - HDfprintf(stdout, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->SM_index_storage_size); - HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->SM_heap_storage_size); - - HDfprintf(stdout, "\tFree-space managers:\n"); - HDfprintf(stdout, "\t\tHeader: %" PRIuHSIZE "\n", iter->free_hdr); - HDfprintf(stdout, "\t\tAmount of free space: %" PRIuHSIZE "\n", iter->free_space); + fprintf(stdout, "File space information for file metadata (in bytes):\n"); + fprintf(stdout, "\tSuperblock: %" PRIuHSIZE "\n", iter->super_size); + fprintf(stdout, "\tSuperblock extension: %" PRIuHSIZE "\n", iter->super_ext_size); + fprintf(stdout, "\tUser block: %" PRIuHSIZE "\n", iter->ublk_size); + + fprintf(stdout, "\tObject headers: (total/unused)\n"); + fprintf(stdout, "\t\tGroups: %" PRIuHSIZE "/%" PRIuHSIZE "\n", iter->group_ohdr_info.total_size, + iter->group_ohdr_info.free_size); + fprintf(stdout, "\t\tDatasets(exclude compact data): %" PRIuHSIZE "/%" PRIuHSIZE "\n", + iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); + fprintf(stdout, "\t\tDatatypes: %" PRIuHSIZE "/%" PRIuHSIZE "\n", iter->dtype_ohdr_info.total_size, + iter->dtype_ohdr_info.free_size); + + fprintf(stdout, "\tGroups:\n"); + fprintf(stdout, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->groups_btree_storage_size); + fprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->groups_heap_storage_size); + + fprintf(stdout, "\tAttributes:\n"); + fprintf(stdout, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->attrs_btree_storage_size); + fprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->attrs_heap_storage_size); + + fprintf(stdout, "\tChunked datasets:\n"); + fprintf(stdout, "\t\tIndex: %" PRIuHSIZE "\n", iter->datasets_index_storage_size); + + fprintf(stdout, "\tDatasets:\n"); + fprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->datasets_heap_storage_size); + + fprintf(stdout, "\tShared Messages:\n"); + fprintf(stdout, "\t\tHeader: %" PRIuHSIZE "\n", iter->SM_hdr_storage_size); + fprintf(stdout, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->SM_index_storage_size); + fprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->SM_heap_storage_size); + + fprintf(stdout, "\tFree-space managers:\n"); + fprintf(stdout, "\t\tHeader: %" PRIuHSIZE "\n", iter->free_hdr); + fprintf(stdout, "\t\tAmount of free space: %" PRIuHSIZE "\n", iter->free_space); return 0; } /* print_file_metadata() */ @@ -1185,32 +1184,31 @@ print_group_info(const iter_t *iter) unsigned long total; /* Total count for various statistics */ unsigned u; /* Local index variable */ - HDprintf("Small groups (with 0 to %u links):\n", sgroups_threshold - 1); + printf("Small groups (with 0 to %u links):\n", sgroups_threshold - 1); total = 0; for (u = 0; u < (unsigned)sgroups_threshold; u++) { if (iter->num_small_groups[u] > 0) { - HDprintf("\t# of groups with %u link(s): %lu\n", u, iter->num_small_groups[u]); + printf("\t# of groups with %u link(s): %lu\n", u, iter->num_small_groups[u]); total += iter->num_small_groups[u]; } /* end if */ } /* end for */ - HDprintf("\tTotal # of small groups: %lu\n", total); + printf("\tTotal # of small groups: %lu\n", total); - HDprintf("Group bins:\n"); + printf("Group bins:\n"); total = 0; if ((iter->group_nbins > 0) && (iter->group_bins[0] > 0)) { - HDprintf("\t# of groups with 0 link: %lu\n", iter->group_bins[0]); + printf("\t# of groups with 0 link: %lu\n", iter->group_bins[0]); total = iter->group_bins[0]; } /* end if */ power = 1; for (u = 1; u < iter->group_nbins; u++) { if (iter->group_bins[u] > 0) { - HDprintf("\t# of groups with %lu - %lu links: %lu\n", power, (power * 10) - 1, - iter->group_bins[u]); + printf("\t# of groups with %lu - %lu links: %lu\n", power, (power * 10) - 1, iter->group_bins[u]); total += iter->group_bins[u]; } /* end if */ power *= 10; } /* end for */ - HDprintf("\tTotal # of groups: %lu\n", total); + printf("\tTotal # of groups: %lu\n", total); return 0; } /* print_group_info() */ @@ -1230,13 +1228,13 @@ print_group_info(const iter_t *iter) static herr_t print_group_metadata(const iter_t *iter) { - HDprintf("File space information for groups' metadata (in bytes):\n"); + printf("File space information for groups' metadata (in bytes):\n"); - HDfprintf(stdout, "\tObject headers (total/unused): %" PRIuHSIZE "/%" PRIuHSIZE "\n", - iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_size); + fprintf(stdout, "\tObject headers (total/unused): %" PRIuHSIZE "/%" PRIuHSIZE "\n", + iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_size); - HDfprintf(stdout, "\tB-tree/List: %" PRIuHSIZE "\n", iter->groups_btree_storage_size); - HDfprintf(stdout, "\tHeap: %" PRIuHSIZE "\n", iter->groups_heap_storage_size); + fprintf(stdout, "\tB-tree/List: %" PRIuHSIZE "\n", iter->groups_btree_storage_size); + fprintf(stdout, "\tHeap: %" PRIuHSIZE "\n", iter->groups_heap_storage_size); return 0; } /* print_group_metadata() */ @@ -1262,69 +1260,68 @@ print_dataset_info(const iter_t *iter) unsigned u; /* Local index variable */ if (iter->uniq_dsets > 0) { - HDprintf("Dataset dimension information:\n"); - HDprintf("\tMax. rank of datasets: %u\n", iter->max_dset_rank); - HDprintf("\tDataset ranks:\n"); + printf("Dataset dimension information:\n"); + printf("\tMax. rank of datasets: %u\n", iter->max_dset_rank); + printf("\tDataset ranks:\n"); for (u = 0; u < H5S_MAX_RANK; u++) if (iter->dset_rank_count[u] > 0) - HDprintf("\t\t# of dataset with rank %u: %lu\n", u, iter->dset_rank_count[u]); + printf("\t\t# of dataset with rank %u: %lu\n", u, iter->dset_rank_count[u]); - HDprintf("1-D Dataset information:\n"); - HDfprintf(stdout, "\tMax. dimension size of 1-D datasets: %" PRIuHSIZE "\n", iter->max_dset_dims); - HDprintf("\tSmall 1-D datasets (with dimension sizes 0 to %u):\n", sdsets_threshold - 1); + printf("1-D Dataset information:\n"); + fprintf(stdout, "\tMax. dimension size of 1-D datasets: %" PRIuHSIZE "\n", iter->max_dset_dims); + printf("\tSmall 1-D datasets (with dimension sizes 0 to %u):\n", sdsets_threshold - 1); total = 0; for (u = 0; u < (unsigned)sdsets_threshold; u++) { if (iter->small_dset_dims[u] > 0) { - HDprintf("\t\t# of datasets with dimension sizes %u: %lu\n", u, iter->small_dset_dims[u]); + printf("\t\t# of datasets with dimension sizes %u: %lu\n", u, iter->small_dset_dims[u]); total += iter->small_dset_dims[u]; } /* end if */ } /* end for */ - HDprintf("\t\tTotal # of small datasets: %lu\n", total); + printf("\t\tTotal # of small datasets: %lu\n", total); /* Protect against no datasets in file */ if (iter->dset_dim_nbins > 0) { - HDprintf("\t1-D Dataset dimension bins:\n"); + printf("\t1-D Dataset dimension bins:\n"); total = 0; if (iter->dset_dim_bins[0] > 0) { - HDprintf("\t\t# of datasets with dimension size 0: %lu\n", iter->dset_dim_bins[0]); + printf("\t\t# of datasets with dimension size 0: %lu\n", iter->dset_dim_bins[0]); total = iter->dset_dim_bins[0]; } /* end if */ power = 1; for (u = 1; u < iter->dset_dim_nbins; u++) { if (iter->dset_dim_bins[u] > 0) { - HDprintf("\t\t# of datasets with dimension size %lu - %lu: %lu\n", power, - (power * 10) - 1, iter->dset_dim_bins[u]); + printf("\t\t# of datasets with dimension size %lu - %lu: %lu\n", power, (power * 10) - 1, + iter->dset_dim_bins[u]); total += iter->dset_dim_bins[u]; } /* end if */ power *= 10; } /* end for */ - HDprintf("\t\tTotal # of datasets: %lu\n", total); + printf("\t\tTotal # of datasets: %lu\n", total); } /* end if */ - HDprintf("Dataset storage information:\n"); - HDfprintf(stdout, "\tTotal raw data size: %" PRIuHSIZE "\n", iter->dset_storage_size); - HDfprintf(stdout, "\tTotal external raw data size: %" PRIuHSIZE "\n", - iter->dset_external_storage_size); + printf("Dataset storage information:\n"); + fprintf(stdout, "\tTotal raw data size: %" PRIuHSIZE "\n", iter->dset_storage_size); + fprintf(stdout, "\tTotal external raw data size: %" PRIuHSIZE "\n", iter->dset_external_storage_size); - HDprintf("Dataset layout information:\n"); + printf("Dataset layout information:\n"); for (u = 0; u < H5D_NLAYOUTS; u++) - HDprintf("\tDataset layout counts[%s]: %lu\n", - (u == H5D_COMPACT - ? "COMPACT" - : (u == H5D_CONTIGUOUS ? "CONTIG" : (u == H5D_CHUNKED ? "CHUNKED" : "VIRTUAL"))), - iter->dset_layouts[u]); - HDprintf("\tNumber of external files : %lu\n", iter->nexternal); - - HDprintf("Dataset filters information:\n"); - HDprintf("\tNumber of datasets with:\n"); - HDprintf("\t\tNO filter: %lu\n", iter->dset_comptype[H5Z_FILTER_ERROR + 1]); - HDprintf("\t\tGZIP filter: %lu\n", iter->dset_comptype[H5Z_FILTER_DEFLATE]); - HDprintf("\t\tSHUFFLE filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SHUFFLE]); - HDprintf("\t\tFLETCHER32 filter: %lu\n", iter->dset_comptype[H5Z_FILTER_FLETCHER32]); - HDprintf("\t\tSZIP filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SZIP]); - HDprintf("\t\tNBIT filter: %lu\n", iter->dset_comptype[H5Z_FILTER_NBIT]); - HDprintf("\t\tSCALEOFFSET filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SCALEOFFSET]); - HDprintf("\t\tUSER-DEFINED filter: %lu\n", iter->dset_comptype[H5_NFILTERS_IMPL - 1]); + printf("\tDataset layout counts[%s]: %lu\n", + (u == H5D_COMPACT + ? "COMPACT" + : (u == H5D_CONTIGUOUS ? "CONTIG" : (u == H5D_CHUNKED ? "CHUNKED" : "VIRTUAL"))), + iter->dset_layouts[u]); + printf("\tNumber of external files : %lu\n", iter->nexternal); + + printf("Dataset filters information:\n"); + printf("\tNumber of datasets with:\n"); + printf("\t\tNO filter: %lu\n", iter->dset_comptype[H5Z_FILTER_ERROR + 1]); + printf("\t\tGZIP filter: %lu\n", iter->dset_comptype[H5Z_FILTER_DEFLATE]); + printf("\t\tSHUFFLE filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SHUFFLE]); + printf("\t\tFLETCHER32 filter: %lu\n", iter->dset_comptype[H5Z_FILTER_FLETCHER32]); + printf("\t\tSZIP filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SZIP]); + printf("\t\tNBIT filter: %lu\n", iter->dset_comptype[H5Z_FILTER_NBIT]); + printf("\t\tSCALEOFFSET filter: %lu\n", iter->dset_comptype[H5Z_FILTER_SCALEOFFSET]); + printf("\t\tUSER-DEFINED filter: %lu\n", iter->dset_comptype[H5_NFILTERS_IMPL - 1]); } /* end if */ return 0; @@ -1346,13 +1343,13 @@ print_dataset_info(const iter_t *iter) static herr_t print_dset_metadata(const iter_t *iter) { - HDprintf("File space information for datasets' metadata (in bytes):\n"); + printf("File space information for datasets' metadata (in bytes):\n"); - HDfprintf(stdout, "\tObject headers (total/unused): %" PRIuHSIZE "/%" PRIuHSIZE "\n", - iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); + fprintf(stdout, "\tObject headers (total/unused): %" PRIuHSIZE "/%" PRIuHSIZE "\n", + iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); - HDfprintf(stdout, "\tIndex for Chunked datasets: %" PRIuHSIZE "\n", iter->datasets_index_storage_size); - HDfprintf(stdout, "\tHeap: %" PRIuHSIZE "\n", iter->datasets_heap_storage_size); + fprintf(stdout, "\tIndex for Chunked datasets: %" PRIuHSIZE "\n", iter->datasets_index_storage_size); + fprintf(stdout, "\tHeap: %" PRIuHSIZE "\n", iter->datasets_heap_storage_size); return 0; } /* print_dset_metadata() */ @@ -1378,20 +1375,20 @@ print_dset_dtype_meta(const iter_t *iter) unsigned u; /* Local index variable */ if (iter->dset_ntypes) { - HDprintf("Dataset datatype information:\n"); - HDprintf("\t# of unique datatypes used by datasets: %lu\n", iter->dset_ntypes); + printf("Dataset datatype information:\n"); + printf("\t# of unique datatypes used by datasets: %lu\n", iter->dset_ntypes); total = 0; for (u = 0; u < iter->dset_ntypes; u++) { H5Tencode(iter->dset_type_info[u].tid, NULL, &dtype_size); - HDprintf("\tDataset datatype #%u:\n", u); - HDprintf("\t\tCount (total/named) = (%lu/%lu)\n", iter->dset_type_info[u].count, - iter->dset_type_info[u].named); - HDprintf("\t\tSize (desc./elmt) = (%lu/%lu)\n", (unsigned long)dtype_size, - (unsigned long)H5Tget_size(iter->dset_type_info[u].tid)); + printf("\tDataset datatype #%u:\n", u); + printf("\t\tCount (total/named) = (%lu/%lu)\n", iter->dset_type_info[u].count, + iter->dset_type_info[u].named); + printf("\t\tSize (desc./elmt) = (%lu/%lu)\n", (unsigned long)dtype_size, + (unsigned long)H5Tget_size(iter->dset_type_info[u].tid)); H5Tclose(iter->dset_type_info[u].tid); total += iter->dset_type_info[u].count; } /* end for */ - HDprintf("\tTotal dataset datatype count: %lu\n", total); + printf("\tTotal dataset datatype count: %lu\n", total); } /* end if */ return 0; @@ -1418,29 +1415,29 @@ print_attr_info(const iter_t *iter) unsigned long total; /* Total count for various statistics */ unsigned u; /* Local index variable */ - HDprintf("Small # of attributes (objects with 1 to %u attributes):\n", sattrs_threshold); + printf("Small # of attributes (objects with 1 to %u attributes):\n", sattrs_threshold); total = 0; for (u = 1; u <= (unsigned)sattrs_threshold; u++) { if (iter->num_small_attrs[u] > 0) { - HDprintf("\t# of objects with %u attributes: %lu\n", u, iter->num_small_attrs[u]); + printf("\t# of objects with %u attributes: %lu\n", u, iter->num_small_attrs[u]); total += iter->num_small_attrs[u]; } /* end if */ } /* end for */ - HDprintf("\tTotal # of objects with small # of attributes: %lu\n", total); + printf("\tTotal # of objects with small # of attributes: %lu\n", total); - HDprintf("Attribute bins:\n"); + printf("Attribute bins:\n"); total = 0; power = 1; for (u = 1; u < iter->attr_nbins; u++) { if (iter->attr_bins[u] > 0) { - HDprintf("\t# of objects with %lu - %lu attributes: %lu\n", power, (power * 10) - 1, - iter->attr_bins[u]); + printf("\t# of objects with %lu - %lu attributes: %lu\n", power, (power * 10) - 1, + iter->attr_bins[u]); total += iter->attr_bins[u]; } /* end if */ power *= 10; } /* end for */ - HDprintf("\tTotal # of objects with attributes: %lu\n", total); - HDprintf("\tMax. # of attributes to objects: %lu\n", (unsigned long)iter->max_attrs); + printf("\tTotal # of objects with attributes: %lu\n", total); + printf("\tMax. # of attributes to objects: %lu\n", (unsigned long)iter->max_attrs); return 0; } /* print_attr_info() */ @@ -1465,30 +1462,30 @@ print_freespace_info(const iter_t *iter) unsigned long total; /* Total count for various statistics */ unsigned u; /* Local index variable */ - HDfprintf(stdout, "Free-space persist: %s\n", iter->fs_persist ? "TRUE" : "FALSE"); - HDfprintf(stdout, "Free-space section threshold: %" PRIuHSIZE " bytes\n", iter->fs_threshold); - HDprintf("Small size free-space sections (< %u bytes):\n", (unsigned)SIZE_SMALL_SECTS); + fprintf(stdout, "Free-space persist: %s\n", iter->fs_persist ? "TRUE" : "FALSE"); + fprintf(stdout, "Free-space section threshold: %" PRIuHSIZE " bytes\n", iter->fs_threshold); + printf("Small size free-space sections (< %u bytes):\n", (unsigned)SIZE_SMALL_SECTS); total = 0; for (u = 0; u < SIZE_SMALL_SECTS; u++) { if (iter->num_small_sects[u] > 0) { - HDprintf("\t# of sections of size %u: %lu\n", u, iter->num_small_sects[u]); + printf("\t# of sections of size %u: %lu\n", u, iter->num_small_sects[u]); total += iter->num_small_sects[u]; } /* end if */ } /* end for */ - HDprintf("\tTotal # of small size sections: %lu\n", total); + printf("\tTotal # of small size sections: %lu\n", total); - HDprintf("Free-space section bins:\n"); + printf("Free-space section bins:\n"); total = 0; power = 1; for (u = 1; u < iter->sect_nbins; u++) { if (iter->sect_bins[u] > 0) { - HDprintf("\t# of sections of size %lu - %lu: %lu\n", power, (power * 10) - 1, iter->sect_bins[u]); + printf("\t# of sections of size %lu - %lu: %lu\n", power, (power * 10) - 1, iter->sect_bins[u]); total += iter->sect_bins[u]; } /* end if */ power *= 10; } /* end for */ - HDprintf("\tTotal # of sections: %lu\n", total); + printf("\tTotal # of sections: %lu\n", total); return 0; } /* print_freespace_info() */ @@ -1513,9 +1510,9 @@ print_storage_summary(const iter_t *iter) hsize_t unaccount = 0; double percent = 0.0; - HDfprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]); - HDfprintf(stdout, "File space page size: %" PRIuHSIZE " bytes\n", iter->fsp_size); - HDprintf("Summary of file space information:\n"); + fprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]); + fprintf(stdout, "File space page size: %" PRIuHSIZE " bytes\n", iter->fsp_size); + printf("Summary of file space information:\n"); total_meta = iter->super_size + iter->super_ext_size + iter->ublk_size + iter->group_ohdr_info.total_size + iter->dset_ohdr_info.total_size + iter->dtype_ohdr_info.total_size + iter->groups_btree_storage_size + @@ -1523,28 +1520,28 @@ print_storage_summary(const iter_t *iter) iter->datasets_index_storage_size + iter->datasets_heap_storage_size + iter->SM_hdr_storage_size + iter->SM_index_storage_size + iter->SM_heap_storage_size + iter->free_hdr; - HDfprintf(stdout, " File metadata: %" PRIuHSIZE " bytes\n", total_meta); - HDfprintf(stdout, " Raw data: %" PRIuHSIZE " bytes\n", iter->dset_storage_size); + fprintf(stdout, " File metadata: %" PRIuHSIZE " bytes\n", total_meta); + fprintf(stdout, " Raw data: %" PRIuHSIZE " bytes\n", iter->dset_storage_size); percent = ((double)iter->free_space / (double)iter->filesize) * 100.0; - HDfprintf(stdout, " Amount/Percent of tracked free space: %" PRIuHSIZE " bytes/%3.1f%%\n", - iter->free_space, percent); + fprintf(stdout, " Amount/Percent of tracked free space: %" PRIuHSIZE " bytes/%3.1f%%\n", + iter->free_space, percent); if (iter->filesize < (total_meta + iter->dset_storage_size + iter->free_space)) { unaccount = (total_meta + iter->dset_storage_size + iter->free_space) - iter->filesize; - HDfprintf(stdout, " ??? File has %" PRIuHSIZE " more bytes accounted for than its size! ???\n", - unaccount); + fprintf(stdout, " ??? File has %" PRIuHSIZE " more bytes accounted for than its size! ???\n", + unaccount); } else { unaccount = iter->filesize - (total_meta + iter->dset_storage_size + iter->free_space); - HDfprintf(stdout, " Unaccounted space: %" PRIuHSIZE " bytes\n", unaccount); + fprintf(stdout, " Unaccounted space: %" PRIuHSIZE " bytes\n", unaccount); } - HDfprintf(stdout, "Total space: %" PRIuHSIZE " bytes\n", - total_meta + iter->dset_storage_size + iter->free_space + unaccount); + fprintf(stdout, "Total space: %" PRIuHSIZE " bytes\n", + total_meta + iter->dset_storage_size + iter->free_space + unaccount); if (iter->nexternal) - HDfprintf(stdout, "External raw data: %" PRIuHSIZE " bytes\n", iter->dset_external_storage_size); + fprintf(stdout, "External raw data: %" PRIuHSIZE " bytes\n", iter->dset_external_storage_size); return 0; } /* print_storage_summary() */ @@ -1622,7 +1619,7 @@ print_file_statistics(const iter_t *iter) static void print_object_statistics(const char *name) { - HDprintf("Object name %s\n", name); + printf("Object name %s\n", name); } /* print_object_statistics() */ /*------------------------------------------------------------------------- @@ -1668,7 +1665,7 @@ main(int argc, char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - HDmemset(&iter, 0, sizeof(iter)); + memset(&iter, 0, sizeof(iter)); if (parse_command_line(argc, (const char *const *)argv, &hand) < 0) goto done; @@ -1705,7 +1702,7 @@ main(int argc, char *argv[]) hid_t fcpl; H5F_info2_t finfo; - HDprintf("Filename: %s\n", fname); + printf("Filename: %s\n", fname); fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id != H5P_DEFAULT), NULL, 0); @@ -1720,7 +1717,7 @@ main(int argc, char *argv[]) if (H5Fget_filesize(fid, &iter.filesize) < 0) warn_msg("Unable to retrieve file size\n"); - HDassert(iter.filesize != 0); + assert(iter.filesize != 0); /* Get storage info for file-level structures */ if (H5Fget_info2(fid, &finfo) < 0) @@ -1735,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"); @@ -1754,7 +1750,7 @@ main(int argc, char *argv[]) if (H5Pget_file_space_strategy(fcpl, &iter.fs_strategy, &iter.fs_persist, &iter.fs_threshold) < 0) warn_msg("Unable to retrieve file space information\n"); - HDassert(iter.fs_strategy >= 0 && iter.fs_strategy < H5F_FSPACE_STRATEGY_NTYPES); + assert(iter.fs_strategy >= 0 && iter.fs_strategy < H5F_FSPACE_STRATEGY_NTYPES); if (H5Pget_file_space_page_size(fcpl, &iter.fsp_size) < 0) warn_msg("Unable to retrieve file space page size\n"); diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index 4a2b07d..2272626 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -144,11 +144,11 @@ parse_command_line(int argc, const char *const *argv) case 'i': increment_eoa_eof = TRUE; if (H5_optarg != NULL) { - if (HDatoi(H5_optarg) < 0) { + if (atoi(H5_optarg) < 0) { usage(h5tools_getprogname()); goto done; } - increment = (hsize_t)HDatoi(H5_optarg); + increment = (hsize_t)atoi(H5_optarg); } break; @@ -189,7 +189,7 @@ static void leave(int ret) { h5tools_close(); - HDexit(ret); + exit(ret); } /* leave() */ /*------------------------------------------------------------------------- @@ -325,7 +325,7 @@ main(int argc, char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } - HDfprintf(stdout, "EOA is %" PRIuHADDR "; EOF is %" PRIuHADDR " \n", eoa, (haddr_t)st.st_size); + fprintf(stdout, "EOA is %" PRIuHADDR "; EOF is %" PRIuHADDR " \n", eoa, (haddr_t)st.st_size); } /* --increment option */ @@ -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/h5debug.c b/tools/src/misc/h5debug.c index b15ae09..9bac669 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -131,7 +131,7 @@ get_H5B2_class(const uint8_t *sig) case H5B2_NUM_BTREE_ID: default: - HDfprintf(stderr, "Unknown v2 B-tree subtype %u\n", (unsigned)(subtype)); + fprintf(stderr, "Unknown v2 B-tree subtype %u\n", (unsigned)(subtype)); } /* end switch */ return (cls); @@ -172,7 +172,7 @@ get_H5EA_class(const uint8_t *sig) case H5EA_NUM_CLS_ID: default: - HDfprintf(stderr, "Unknown extensible array class %u\n", (unsigned)(clsid)); + fprintf(stderr, "Unknown extensible array class %u\n", (unsigned)(clsid)); } /* end switch */ return (cls); @@ -213,7 +213,7 @@ get_H5FA_class(const uint8_t *sig) case H5FA_NUM_CLS_ID: default: - HDfprintf(stderr, "Unknown fixed array class %u\n", (unsigned)(clsid)); + fprintf(stderr, "Unknown fixed array class %u\n", (unsigned)(clsid)); } /* end switch */ return (cls); @@ -252,14 +252,14 @@ main(int argc, char *argv[]) int exit_value = 0; if (argc == 1) { - HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]*]\n", argv[0]); + fprintf(stderr, "Usage: %s filename [signature-addr [extra]*]\n", argv[0]); exit_value = 1; goto done; } /* end if */ /* Initialize the library */ if (H5open() < 0) { - HDfprintf(stderr, "cannot initialize the library\n"); + fprintf(stderr, "cannot initialize the library\n"); exit_value = 1; goto done; } /* end if */ @@ -272,45 +272,45 @@ main(int argc, char *argv[]) * Open the file and get the file descriptor. */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - HDfprintf(stderr, "cannot create file access property list\n"); + fprintf(stderr, "cannot create file access property list\n"); exit_value = 1; goto done; } /* end if */ if (HDstrchr(argv[1], '%')) if (H5Pset_fapl_family(fapl, (hsize_t)0, H5P_DEFAULT) < 0) { - HDfprintf(stderr, "cannot set file access property list\n"); + fprintf(stderr, "cannot set file access property list\n"); exit_value = 1; goto done; } if ((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) { - HDfprintf(stderr, "cannot open file\n"); + fprintf(stderr, "cannot open file\n"); exit_value = 1; goto done; } /* end if */ /* Push API context */ if (H5CX_push() < 0) { - HDfprintf(stderr, "cannot set API context\n"); + fprintf(stderr, "cannot set API context\n"); exit_value = 1; goto done; } api_ctx_pushed = TRUE; if (NULL == (vol_obj = (H5VL_object_t *)H5VL_vol_object(fid))) { - HDfprintf(stderr, "cannot obtain vol_obj pointer\n"); + fprintf(stderr, "cannot obtain vol_obj pointer\n"); exit_value = 2; goto done; } /* end if */ if (NULL == (f = (H5F_t *)H5VL_object_data(vol_obj))) { - HDfprintf(stderr, "cannot obtain H5F_t pointer\n"); + fprintf(stderr, "cannot obtain H5F_t pointer\n"); exit_value = 2; goto done; } /* end if */ /* Ignore metadata tags while using h5debug */ if (H5AC_ignore_tags(f) < 0) { - HDfprintf(stderr, "cannot ignore metadata tags\n"); + fprintf(stderr, "cannot ignore metadata tags\n"); exit_value = 1; goto done; } @@ -324,15 +324,15 @@ main(int argc, char *argv[]) addr = (haddr_t)HDstrtoll(argv[2], NULL, 0); /* Extra arguments for primary data structure */ - HDmemset(extra, 0, sizeof(extra)); + memset(extra, 0, sizeof(extra)); if (argc > 3) { /* Number of extra arguments */ extra_count = argc - 3; /* Range check against 'extra' array size */ if (extra_count > (int)(sizeof(extra) / sizeof(haddr_t))) { - HDfprintf(stderr, "\nWARNING: Only using first %d extra parameters\n\n", - (int)(sizeof(extra) / sizeof(haddr_t))); + fprintf(stderr, "\nWARNING: Only using first %d extra parameters\n\n", + (int)(sizeof(extra) / sizeof(haddr_t))); extra_count = (int)(sizeof(extra) / sizeof(haddr_t)); } /* end if */ @@ -343,46 +343,46 @@ main(int argc, char *argv[]) /* * Read the signature at the specified file position. */ - HDfprintf(stdout, "Reading signature at address %" PRIuHADDR " (rel)\n", addr); + fprintf(stdout, "Reading signature at address %" PRIuHADDR " (rel)\n", addr); if (H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), sig) < 0) { - HDfprintf(stderr, "cannot read signature\n"); + fprintf(stderr, "cannot read signature\n"); exit_value = 3; goto done; } - if (!HDmemcmp(sig, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) { + if (!memcmp(sig, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) { /* * Debug the file's super block. */ status = H5F_debug(f, stdout, 0, VCOL); } - else if (!HDmemcmp(sig, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a local heap. */ status = H5HL_debug(f, addr, stdout, 0, VCOL); } - else if (!HDmemcmp(sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a global heap collection. */ status = H5HG_debug(f, addr, stdout, 0, VCOL); } - else if (!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a symbol table node. */ /* Check for extra parameters */ if (extra_count == 0 || extra[0] == 0) { - HDfprintf(stderr, - "\nWarning: Providing the group's local heap address will give more information\n"); - HDfprintf(stderr, "Symbol table node usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <Symbol table node address> <address of local heap>\n\n"); + fprintf(stderr, + "\nWarning: Providing the group's local heap address will give more information\n"); + fprintf(stderr, "Symbol table node usage:\n"); + fprintf(stderr, "\th5debug <filename> <Symbol table node address> <address of local heap>\n\n"); } /* end if */ status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra[0]); } - else if (!HDmemcmp(sig, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a B-tree. B-trees are debugged through the B-tree * subclass. The subclass identifier is the byte immediately @@ -396,12 +396,11 @@ main(int argc, char *argv[]) case H5B_SNODE_ID: /* Check for extra parameters */ if (extra_count == 0 || extra[0] == 0) { - HDfprintf( + fprintf( stderr, "\nWarning: Providing the group's local heap address will give more information\n"); - HDfprintf(stderr, "B-tree symbol table node usage:\n"); - HDfprintf(stderr, - "\th5debug <filename> <B-tree node address> <address of local heap>\n\n"); + fprintf(stderr, "B-tree symbol table node usage:\n"); + fprintf(stderr, "\th5debug <filename> <B-tree node address> <address of local heap>\n\n"); exit_value = 4; goto done; } /* end if */ @@ -412,12 +411,11 @@ main(int argc, char *argv[]) case H5B_CHUNK_ID: /* Check for extra parameters */ if (extra_count == 0 || extra[0] == 0) { - HDfprintf( - stderr, - "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n"); - HDfprintf(stderr, "B-tree chunked storage node usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> <slowest " - "chunk dim>...<fastest chunk dim>\n"); + fprintf(stderr, + "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n"); + fprintf(stderr, "B-tree chunked storage node usage:\n"); + fprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> <slowest " + "chunk dim>...<fastest chunk dim>\n"); exit_value = 4; goto done; } /* end if */ @@ -427,10 +425,10 @@ main(int argc, char *argv[]) /* Check for dimension error */ if (ndims > 9) { - HDfprintf(stderr, "ERROR: Only 9 dimensions support currently (fix h5debug)\n"); - HDfprintf(stderr, "B-tree chunked storage node usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> <slowest " - "chunk dim>...<fastest chunk dim>\n"); + fprintf(stderr, "ERROR: Only 9 dimensions support currently (fix h5debug)\n"); + fprintf(stderr, "B-tree chunked storage node usage:\n"); + fprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> <slowest " + "chunk dim>...<fastest chunk dim>\n"); exit_value = 4; goto done; } /* end for */ @@ -442,10 +440,10 @@ main(int argc, char *argv[]) /* Check for dimension error */ for (u = 0; u < ndims; u++) if (0 == dim[u]) { - HDfprintf(stderr, "ERROR: Chunk dimensions should be >0\n"); - HDfprintf(stderr, "B-tree chunked storage node usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> " - "<slowest chunk dim>...<fastest chunk dim>\n"); + fprintf(stderr, "ERROR: Chunk dimensions should be >0\n"); + fprintf(stderr, "B-tree chunked storage node usage:\n"); + fprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions> " + "<slowest chunk dim>...<fastest chunk dim>\n"); exit_value = 4; goto done; } /* end if */ @@ -458,58 +456,58 @@ main(int argc, char *argv[]) case H5B_NUM_BTREE_ID: default: - HDfprintf(stderr, "Unknown v1 B-tree subtype %u\n", (unsigned)(subtype)); + fprintf(stderr, "Unknown v1 B-tree subtype %u\n", (unsigned)(subtype)); exit_value = 4; goto done; } } - else if (!HDmemcmp(sig, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a v2 B-tree header. */ const H5B2_class_t *cls = get_H5B2_class(sig); - HDassert(cls); + assert(cls); if ((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra_count == 0 || extra[0] == 0)) { - HDfprintf(stderr, "ERROR: Need v2 B-tree header address and object header address containing the " - "layout message in order to dump header\n"); - HDfprintf(stderr, "v2 B-tree hdr usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <v2 B-tree header address> <object header address>\n"); + fprintf(stderr, "ERROR: Need v2 B-tree header address and object header address containing the " + "layout message in order to dump header\n"); + fprintf(stderr, "v2 B-tree hdr usage:\n"); + fprintf(stderr, "\th5debug <filename> <v2 B-tree header address> <object header address>\n"); exit_value = 4; goto done; } /* end if */ status = H5B2__hdr_debug(f, addr, stdout, 0, VCOL, cls, (haddr_t)extra[0]); } - else if (!HDmemcmp(sig, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a v2 B-tree internal node. */ const H5B2_class_t *cls = get_H5B2_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if ((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0 || extra[3] == 0)) { - HDfprintf(stderr, - "ERROR: Need v2 B-tree header address, the node's number of records, depth, and object " - "header address containing the layout message in order to dump internal node\n"); - HDfprintf(stderr, - "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); - HDfprintf(stderr, "v2 B-tree internal node usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> " - "<number of records> <depth> <object header address>\n"); + fprintf(stderr, + "ERROR: Need v2 B-tree header address, the node's number of records, depth, and object " + "header address containing the layout message in order to dump internal node\n"); + fprintf(stderr, + "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); + fprintf(stderr, "v2 B-tree internal node usage:\n"); + fprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> " + "<number of records> <depth> <object header address>\n"); exit_value = 4; goto done; } else if (extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0) { - HDfprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and " - "depth in order to dump internal node\n"); - HDfprintf(stderr, - "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); - HDfprintf(stderr, "v2 B-tree internal node usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> " - "<number of records> <depth>\n"); + fprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and " + "depth in order to dump internal node\n"); + fprintf(stderr, + "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); + fprintf(stderr, "v2 B-tree internal node usage:\n"); + fprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> " + "<number of records> <depth>\n"); exit_value = 4; goto done; } /* end if */ @@ -517,31 +515,31 @@ main(int argc, char *argv[]) status = H5B2__int_debug(f, addr, stdout, 0, VCOL, cls, extra[0], (unsigned)extra[1], (unsigned)extra[2], (haddr_t)extra[3]); } - else if (!HDmemcmp(sig, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a v2 B-tree leaf node. */ const H5B2_class_t *cls = get_H5B2_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if ((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0)) { - HDfprintf(stderr, "ERROR: Need v2 B-tree header address, number of records, and object header " - "address containing the layout message in order to dump leaf node\n"); - HDfprintf(stderr, "v2 B-tree leaf node usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number " - "of records> <object header address>\n"); + fprintf(stderr, "ERROR: Need v2 B-tree header address, number of records, and object header " + "address containing the layout message in order to dump leaf node\n"); + fprintf(stderr, "v2 B-tree leaf node usage:\n"); + fprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number " + "of records> <object header address>\n"); exit_value = 4; goto done; } else if (extra_count == 0 || extra[0] == 0 || extra[1] == 0) { - HDfprintf( + fprintf( stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n"); - HDfprintf(stderr, "v2 B-tree leaf node usage:\n"); - HDfprintf( + fprintf(stderr, "v2 B-tree leaf node usage:\n"); + fprintf( stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records>\n"); exit_value = 4; @@ -551,23 +549,23 @@ main(int argc, char *argv[]) status = H5B2__leaf_debug(f, addr, stdout, 0, VCOL, cls, extra[0], (unsigned)extra[1], (haddr_t)extra[2]); } - else if (!HDmemcmp(sig, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a fractal heap header. */ status = H5HF_hdr_debug(f, addr, stdout, 0, VCOL); } - else if (!HDmemcmp(sig, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a fractal heap direct block. */ /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0) { - HDfprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to " - "dump direct block\n"); - HDfprintf(stderr, "Fractal heap direct block usage:\n"); - HDfprintf( + fprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to " + "dump direct block\n"); + fprintf(stderr, "Fractal heap direct block usage:\n"); + fprintf( stderr, "\th5debug <filename> <direct block address> <heap header address> <size of direct block>\n"); exit_value = 4; @@ -576,108 +574,107 @@ main(int argc, char *argv[]) status = H5HF_dblock_debug(f, addr, stdout, 0, VCOL, extra[0], (size_t)extra[1]); } - else if (!HDmemcmp(sig, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a fractal heap indirect block. */ /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0) { - HDfprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump " - "indirect block\n"); - HDfprintf(stderr, "Fractal heap indirect block usage:\n"); - HDfprintf( - stderr, - "\th5debug <filename> <indirect block address> <heap header address> <number of rows>\n"); + fprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump " + "indirect block\n"); + fprintf(stderr, "Fractal heap indirect block usage:\n"); + fprintf(stderr, + "\th5debug <filename> <indirect block address> <heap header address> <number of rows>\n"); exit_value = 4; goto done; } /* end if */ status = H5HF_iblock_debug(f, addr, stdout, 0, VCOL, extra[0], (unsigned)extra[1]); } - else if (!HDmemcmp(sig, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a free space header. */ status = H5FS_debug(f, addr, stdout, 0, VCOL); } - else if (!HDmemcmp(sig, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug free space serialized sections. */ /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0) { - HDfprintf(stderr, "ERROR: Need free space header address and client address in order to dump " - "serialized sections\n"); - HDfprintf(stderr, "Free space serialized sections usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <serialized sections address> <free space header " - "address> <client address>\n"); + fprintf(stderr, "ERROR: Need free space header address and client address in order to dump " + "serialized sections\n"); + fprintf(stderr, "Free space serialized sections usage:\n"); + fprintf(stderr, "\th5debug <filename> <serialized sections address> <free space header " + "address> <client address>\n"); exit_value = 4; goto done; } /* end if */ status = H5FS_sects_debug(f, addr, stdout, 0, VCOL, extra[0], extra[1]); } - else if (!HDmemcmp(sig, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug shared message master table. */ status = H5SM_table_debug(f, addr, stdout, 0, VCOL, UINT_MAX, UINT_MAX); } - else if (!HDmemcmp(sig, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug shared message list index. */ /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0) { - HDfprintf(stderr, "ERROR: Need shared message header address in order to shared message list\n"); - HDfprintf(stderr, "Shared message list usage:\n"); - HDfprintf(stderr, - "\th5debug <filename> <shared message list address> <shared message header address>\n"); + fprintf(stderr, "ERROR: Need shared message header address in order to shared message list\n"); + fprintf(stderr, "Shared message list usage:\n"); + fprintf(stderr, + "\th5debug <filename> <shared message list address> <shared message header address>\n"); exit_value = 4; goto done; } /* end if */ status = H5SM_list_debug(f, addr, stdout, 0, VCOL, (haddr_t)extra[0]); } - else if (!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug an extensible array header. */ const H5EA_class_t *cls = get_H5EA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0) { - HDfprintf( + fprintf( stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); - HDfprintf(stderr, "Extensible array header block usage:\n"); - HDfprintf(stderr, - "\th5debug <filename> <Extensible Array header address> <object header address>\n"); + fprintf(stderr, "Extensible array header block usage:\n"); + fprintf(stderr, + "\th5debug <filename> <Extensible Array header address> <object header address>\n"); exit_value = 4; goto done; } /* end if */ status = H5EA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra[0]); } - else if (!HDmemcmp(sig, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug an extensible array index block. */ const H5EA_class_t *cls = get_H5EA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0) { - HDfprintf(stderr, "ERROR: Need extensible array header address and object header address " - "containing the layout message in order to dump index block\n"); - HDfprintf(stderr, "Extensible array index block usage:\n"); - HDfprintf( + fprintf(stderr, "ERROR: Need extensible array header address and object header address " + "containing the layout message in order to dump index block\n"); + fprintf(stderr, "Extensible array index block usage:\n"); + fprintf( stderr, "\th5debug <filename> <index block address> <array header address> <object header address\n"); exit_value = 4; @@ -686,80 +683,80 @@ main(int argc, char *argv[]) status = H5EA__iblock_debug(f, addr, stdout, 0, VCOL, cls, extra[0], extra[1]); } - else if (!HDmemcmp(sig, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug an extensible array super block. */ const H5EA_class_t *cls = get_H5EA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0) { - HDfprintf(stderr, "ERROR: Need extensible array header address, super block index and object " - "header address containing the layout message in order to dump super block\n"); - HDfprintf(stderr, "Extensible array super block usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <super block address> <array header address> <super " - "block index> <object header address>\n"); + fprintf(stderr, "ERROR: Need extensible array header address, super block index and object " + "header address containing the layout message in order to dump super block\n"); + fprintf(stderr, "Extensible array super block usage:\n"); + fprintf(stderr, "\th5debug <filename> <super block address> <array header address> <super " + "block index> <object header address>\n"); exit_value = 4; goto done; } /* end if */ status = H5EA__sblock_debug(f, addr, stdout, 0, VCOL, cls, extra[0], (unsigned)extra[1], extra[2]); } - else if (!HDmemcmp(sig, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug an extensible array data block. */ const H5EA_class_t *cls = get_H5EA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0) { - HDfprintf(stderr, - "ERROR: Need extensible array header address, # of elements in data block and object " - "header address containing the layout message in order to dump data block\n"); - HDfprintf(stderr, "Extensible array data block usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <data block address> <array header address> <# of " - "elements in data block> <object header address\n"); + fprintf(stderr, + "ERROR: Need extensible array header address, # of elements in data block and object " + "header address containing the layout message in order to dump data block\n"); + fprintf(stderr, "Extensible array data block usage:\n"); + fprintf(stderr, "\th5debug <filename> <data block address> <array header address> <# of " + "elements in data block> <object header address\n"); exit_value = 4; goto done; } /* end if */ status = H5EA__dblock_debug(f, addr, stdout, 0, VCOL, cls, extra[0], (size_t)extra[1], extra[2]); } - else if (!HDmemcmp(sig, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a fixed array header. */ const H5FA_class_t *cls = get_H5FA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0) { - HDfprintf( + fprintf( stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); - HDfprintf(stderr, "Fixed array header block usage:\n"); - HDfprintf(stderr, "\th5debug <filename> <Fixed Array header address> <object header address>\n"); + fprintf(stderr, "Fixed array header block usage:\n"); + fprintf(stderr, "\th5debug <filename> <Fixed Array header address> <object header address>\n"); exit_value = 4; goto done; } /* end if */ status = H5FA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra[0]); } - else if (!HDmemcmp(sig, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a fixed array data block. */ const H5FA_class_t *cls = get_H5FA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0) { - HDfprintf(stderr, "ERROR: Need fixed array header address and object header address containing " - "the layout message in order to dump data block\n"); - HDfprintf(stderr, "fixed array data block usage:\n"); - HDfprintf( + fprintf(stderr, "ERROR: Need fixed array header address and object header address containing " + "the layout message in order to dump data block\n"); + fprintf(stderr, "fixed array data block usage:\n"); + fprintf( stderr, "\th5debug <filename> <data block address> <array header address> <object header address>\n"); exit_value = 4; @@ -768,7 +765,7 @@ main(int argc, char *argv[]) status = H5FA__dblock_debug(f, addr, stdout, 0, VCOL, cls, extra[0], extra[1]); } - else if (!HDmemcmp(sig, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { + else if (!memcmp(sig, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug v2 object header (which have signatures). */ @@ -786,7 +783,7 @@ main(int argc, char *argv[]) /* * Got some other unrecognized signature. */ - HDprintf("%-*s ", VCOL, "Signature:"); + printf("%-*s ", VCOL, "Signature:"); for (u = 0; u < sizeof(sig); u++) { if (sig[u] > ' ' && sig[u] <= '~' && '\\' != sig[u]) HDputchar(sig[u]); @@ -795,18 +792,18 @@ main(int argc, char *argv[]) HDputchar('\\'); } else - HDprintf("\\%03o", sig[u]); + printf("\\%03o", sig[u]); } HDputchar('\n'); - HDfprintf(stderr, "unknown signature\n"); + fprintf(stderr, "unknown signature\n"); exit_value = 4; goto done; } /* end else */ /* Check for an error when dumping information */ if (status < 0) { - HDfprintf(stderr, "An error occurred!\n"); + fprintf(stderr, "An error occurred!\n"); H5Eprint2(H5E_DEFAULT, stderr); exit_value = 5; goto done; @@ -817,7 +814,7 @@ done: H5Pclose(fapl); if (fid > 0) { if (H5Fclose(fid) < 0) { - HDfprintf(stderr, "Error in closing file!\n"); + fprintf(stderr, "Error in closing file!\n"); exit_value = 1; } } diff --git a/tools/src/misc/h5delete.c b/tools/src/misc/h5delete.c index ef5b25f..3684365 100644 --- a/tools/src/misc/h5delete.c +++ b/tools/src/misc/h5delete.c @@ -25,7 +25,7 @@ static void usage(void); static void usage(void) { - HDfprintf(stderr, "usage: h5delete [-f] <filename>\n"); + fprintf(stderr, "usage: h5delete [-f] <filename>\n"); } int @@ -60,7 +60,7 @@ main(int argc, char *argv[]) H5E_END_TRY; if (ret < 0 && !quiet) - HDfprintf(stderr, "Unable to delete storage at: %s\n", name); + fprintf(stderr, "Unable to delete storage at: %s\n", name); return ret < 0 ? EXIT_FAILURE : EXIT_SUCCESS; } diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index fc7d5b6..36e6c15 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -58,18 +58,18 @@ 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) error_msg("Could not close file access property list\n"); h5tools_close(); - HDexit(ret); + exit(ret); } /* end leave() */ /*------------------------------------------------------------------------- @@ -147,8 +147,8 @@ parse_command_line(int argc, const char *const *argv, mkgrp_opt_t *options) } /* Initialize fapl info structs */ - HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t)); - HDmemset(&vfd_info, 0, sizeof(h5tools_vfd_info_t)); + memset(&vol_info, 0, sizeof(h5tools_vol_info_t)); + memset(&vfd_info, 0, sizeof(h5tools_vfd_info_t)); /* Parse command line options */ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { @@ -182,7 +182,7 @@ parse_command_line(int argc, const char *const *argv, mkgrp_opt_t *options) case '1': vol_info.type = VOL_BY_VALUE; - vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); + vol_info.u.value = (H5VL_class_value_t)atoi(H5_optarg); custom_vol = TRUE; break; @@ -198,7 +198,7 @@ parse_command_line(int argc, const char *const *argv, mkgrp_opt_t *options) case '4': vfd_info.type = VFD_BY_VALUE; - vfd_info.u.value = (H5FD_class_value_t)HDatoi(H5_optarg); + vfd_info.u.value = (H5FD_class_value_t)atoi(H5_optarg); custom_vfd = TRUE; break; @@ -239,7 +239,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; @@ -293,7 +293,7 @@ main(int argc, char *argv[]) h5tools_init(); /* Initialize the parameters */ - HDmemset(¶ms_g, 0, sizeof(params_g)); + memset(¶ms_g, 0, sizeof(params_g)); /* Create file access property list */ if ((params_g.fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) { @@ -320,7 +320,7 @@ main(int argc, char *argv[]) /* Display some output if requested */ if (params_g.verbose) - HDprintf("%s: Creating groups with latest version of the format\n", h5tools_getprogname()); + printf("%s: Creating groups with latest version of the format\n", h5tools_getprogname()); } /* Attempt to open an existing HDF5 file first */ @@ -354,7 +354,7 @@ main(int argc, char *argv[]) /* Display some output if requested */ if (params_g.verbose) - HDprintf("%s: Creating parent groups\n", h5tools_getprogname()); + printf("%s: Creating parent groups\n", h5tools_getprogname()); } /* Loop over creating requested groups */ @@ -375,7 +375,7 @@ main(int argc, char *argv[]) /* Display some output if requested */ if (params_g.verbose) - HDprintf("%s: created group '%s'\n", h5tools_getprogname(), params_g.groups[curr_group]); + printf("%s: created group '%s'\n", h5tools_getprogname(), params_g.groups[curr_group]); } /* end for */ /* Close link creation property list */ diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index c01ec0f..004241d 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -50,22 +50,22 @@ static void usage(const char *progname) { - HDfprintf(stderr, "usage: %s [-v] [-V] [-[b|m] N[g|m|k]] [-family_to_sec2|-family_to_single] SRC DST\n", - progname); - HDfprintf(stderr, " -v Produce verbose output\n"); - HDfprintf(stderr, " -V Print a version number and exit\n"); - HDfprintf(stderr, " -b N The I/O block size, defaults to 1kB\n"); - HDfprintf(stderr, " -m N The destination member size or 1GB\n"); - HDfprintf(stderr, " -family_to_sec2 Deprecated version of -family_to_single (below)\n"); - HDfprintf(stderr, " -family_to_single Change file driver from family to the default single-file VFD " - "(windows or sec2)\n"); - HDfprintf(stderr, " SRC The name of the source file\n"); - HDfprintf(stderr, " DST The name of the destination files\n"); - HDfprintf(stderr, "Sizes may be suffixed with 'g' for GB, 'm' for MB or " - "'k' for kB.\n"); - HDfprintf(stderr, "File family names include an integer printf " - "format such as '%%d'\n"); - HDexit(EXIT_FAILURE); + fprintf(stderr, "usage: %s [-v] [-V] [-[b|m] N[g|m|k]] [-family_to_sec2|-family_to_single] SRC DST\n", + progname); + fprintf(stderr, " -v Produce verbose output\n"); + fprintf(stderr, " -V Print a version number and exit\n"); + fprintf(stderr, " -b N The I/O block size, defaults to 1kB\n"); + fprintf(stderr, " -m N The destination member size or 1GB\n"); + fprintf(stderr, " -family_to_sec2 Deprecated version of -family_to_single (below)\n"); + fprintf(stderr, " -family_to_single Change file driver from family to the default single-file VFD " + "(windows or sec2)\n"); + fprintf(stderr, " SRC The name of the source file\n"); + fprintf(stderr, " DST The name of the destination files\n"); + fprintf(stderr, "Sizes may be suffixed with 'g' for GB, 'm' for MB or " + "'k' for kB.\n"); + fprintf(stderr, "File family names include an integer printf " + "format such as '%%d'\n"); + exit(EXIT_FAILURE); } /*------------------------------------------------------------------------- @@ -202,9 +202,9 @@ main(int argc, char *argv[]) argno++; } else if (!HDstrcmp(argv[argno], "-V")) { - HDprintf("This is %s version %u.%u release %u\n", prog_name, H5_VERS_MAJOR, H5_VERS_MINOR, - H5_VERS_RELEASE); - HDexit(EXIT_SUCCESS); + printf("This is %s version %u.%u release %u\n", prog_name, H5_VERS_MAJOR, H5_VERS_MINOR, + H5_VERS_RELEASE); + exit(EXIT_SUCCESS); } else if (!HDstrcmp(argv[argno], "-family_to_sec2")) { family_to_single = TRUE; @@ -226,10 +226,10 @@ main(int argc, char *argv[]) } /* end while */ /* allocate names */ - if (NULL == (src_name = (char *)HDcalloc((size_t)NAMELEN, sizeof(char)))) - HDexit(EXIT_FAILURE); - if (NULL == (dst_name = (char *)HDcalloc((size_t)NAMELEN, sizeof(char)))) - HDexit(EXIT_FAILURE); + if (NULL == (src_name = (char *)calloc((size_t)NAMELEN, sizeof(char)))) + exit(EXIT_FAILURE); + if (NULL == (dst_name = (char *)calloc((size_t)NAMELEN, sizeof(char)))) + exit(EXIT_FAILURE); /* * Get the name for the source file and open the first member. The size @@ -243,16 +243,16 @@ main(int argc, char *argv[]) if ((src = HDopen(src_name, O_RDONLY)) < 0) { HDperror(src_name); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (HDfstat(src, &sb) < 0) { HDperror("fstat"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } src_size = src_act_size = sb.st_size; if (verbose) - HDfprintf(stderr, "< %s\n", src_name); + fprintf(stderr, "< %s\n", src_name); /* * Get the name for the destination file and open the first member. @@ -265,17 +265,17 @@ main(int argc, char *argv[]) if ((dst = HDopen(dst_name, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) { HDperror(dst_name); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (verbose) - HDfprintf(stderr, "> %s\n", dst_name); + fprintf(stderr, "> %s\n", dst_name); /* No more arguments */ if (argno < argc) 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: @@ -295,11 +295,11 @@ main(int argc, char *argv[]) n = (size_t)MIN((off_t)n, src_act_size - src_offset); if ((nio = HDread(src, buf, n)) < 0) { HDperror("read"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } else if ((size_t)nio != n) { - HDfprintf(stderr, "%s: short read\n", src_name); - HDexit(EXIT_FAILURE); + fprintf(stderr, "%s: short read\n", src_name); + exit(EXIT_FAILURE); } for (i = 0; i < n; i++) { if (buf[i]) @@ -321,15 +321,15 @@ main(int argc, char *argv[]) if (need_write) { if (need_seek && HDlseek(dst, dst_offset, SEEK_SET) < 0) { HDperror("HDlseek"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if ((nio = HDwrite(dst, buf, n)) < 0) { HDperror("write"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } else if ((size_t)nio != n) { - HDfprintf(stderr, "%s: short write\n", dst_name); - HDexit(EXIT_FAILURE); + fprintf(stderr, "%s: short write\n", dst_name); + exit(EXIT_FAILURE); } need_seek = FALSE; } @@ -359,19 +359,19 @@ main(int argc, char *argv[]) } else if (src < 0) { HDperror(src_name); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (HDfstat(src, &sb) < 0) { HDperror("fstat"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } src_act_size = sb.st_size; if (src_act_size > src_size) { - HDfprintf(stderr, "%s: member truncated to %lu bytes\n", src_name, (unsigned long)src_size); + fprintf(stderr, "%s: member truncated to %lu bytes\n", src_name, (unsigned long)src_size); } src_offset = 0; if (verbose) - HDfprintf(stderr, "< %s\n", src_name); + fprintf(stderr, "< %s\n", src_name); } /* @@ -384,31 +384,31 @@ main(int argc, char *argv[]) if (0 == dst_membno) { if (HDlseek(dst, dst_size - 1, SEEK_SET) < 0) { HDperror("HDHDlseek"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (HDread(dst, buf, 1) < 0) { HDperror("read"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (HDlseek(dst, dst_size - 1, SEEK_SET) < 0) { HDperror("HDlseek"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (HDwrite(dst, buf, 1) < 0) { HDperror("write"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } HDclose(dst); HDsnprintf(dst_name, NAMELEN, dst_gen_name, ++dst_membno); if ((dst = HDopen(dst_name, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) { HDperror(dst_name); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } dst_offset = 0; need_seek = FALSE; if (verbose) - HDfprintf(stderr, "> %s\n", dst_name); + fprintf(stderr, "> %s\n", dst_name); } } @@ -420,19 +420,19 @@ main(int argc, char *argv[]) if (need_seek) { if (HDlseek(dst, dst_offset - 1, SEEK_SET) < 0) { HDperror("HDlseek"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (HDread(dst, buf, 1) < 0) { HDperror("read"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (HDlseek(dst, dst_offset - 1, SEEK_SET) < 0) { HDperror("HDlseek"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (HDwrite(dst, buf, 1) < 0) { HDperror("write"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } HDclose(dst); @@ -441,7 +441,7 @@ main(int argc, char *argv[]) * These private properties are for this tool only. */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { HDperror("H5Pcreate"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (family_to_single) { @@ -451,7 +451,7 @@ main(int argc, char *argv[]) */ if (H5Pset(fapl, H5F_ACS_FAMILY_TO_SINGLE_NAME, &family_to_single) < 0) { HDperror("H5Pset"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } else { @@ -460,14 +460,14 @@ main(int argc, char *argv[]) * This private property is for this tool only. */ if (H5Pset_fapl_family(fapl, H5F_FAMILY_DEFAULT, H5P_DEFAULT) < 0) { HDperror("H5Pset_fapl_family"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* Set the property of the new member size as hsize_t */ hdsize = (hsize_t)dst_size; if (H5Pset(fapl, H5F_ACS_FAMILY_NEWSIZE_NAME, &hdsize) < 0) { HDperror("H5Pset"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } @@ -488,19 +488,19 @@ main(int argc, char *argv[]) if (file >= 0) { if (H5Fclose(file) < 0) { HDperror("H5Fclose"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* end if */ } /* end if */ if (H5Pclose(fapl) < 0) { HDperror("H5Pclose"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* 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") diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 93289ad..899eaa7 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -238,10 +238,10 @@ gent_named_vl(hid_t loc_id) /* allocate and initialize VL dataset to write */ buf[0].len = 1; - buf[0].p = HDmalloc(1 * sizeof(int)); + buf[0].p = malloc(1 * sizeof(int)); ((int *)buf[0].p)[0] = 1; buf[1].len = 2; - buf[1].p = HDmalloc(2 * sizeof(int)); + buf[1].p = malloc(2 * sizeof(int)); ((int *)buf[1].p)[0] = 2; ((int *)buf[1].p)[1] = 3; @@ -284,16 +284,16 @@ gent_nested_vl(hid_t loc_id) /* allocate and initialize VL dataset to write */ buf[0].len = 1; - buf[0].p = HDmalloc(1 * sizeof(hvl_t)); + buf[0].p = malloc(1 * sizeof(hvl_t)); tvl = (hvl_t *)buf[0].p; - tvl->p = HDmalloc(1 * sizeof(int)); + tvl->p = malloc(1 * sizeof(int)); tvl->len = 1; ((int *)tvl->p)[0] = 1; buf[1].len = 1; - buf[1].p = HDmalloc(1 * sizeof(hvl_t)); + buf[1].p = malloc(1 * sizeof(hvl_t)); tvl = (hvl_t *)buf[1].p; - tvl->p = HDmalloc(2 * sizeof(int)); + tvl->p = malloc(2 * sizeof(int)); tvl->len = 2; ((int *)tvl->p)[0] = 2; ((int *)tvl->p)[1] = 3; @@ -512,21 +512,21 @@ gen_obj_ref(hid_t loc_id) * add dataset */ sid = H5Screate_simple(1, dims1, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } oid = H5Dcreate2(loc_id, OBJ_REF_DS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Dwrite(oid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -538,7 +538,7 @@ gen_obj_ref(hid_t loc_id) * add group */ oid = H5Gcreate2(loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -546,34 +546,34 @@ gen_obj_ref(hid_t loc_id) status = H5Rcreate(&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Rcreate(&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } sid = H5Screate_simple(1, dims2, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } oid = H5Dcreate2(loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, or_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -612,7 +612,7 @@ gen_region_ref(hid_t loc_id) sid = H5Screate_simple(2, dims2, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -620,7 +620,7 @@ gen_region_ref(hid_t loc_id) /* create normal dataset which is referred */ oid2 = H5Dcreate2(loc_id, REG_REF_DS2, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid2 < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -628,7 +628,7 @@ gen_region_ref(hid_t loc_id) /* write values to dataset */ status = H5Dwrite(oid2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -636,7 +636,7 @@ gen_region_ref(hid_t loc_id) /* select elements space for reference */ status = H5Sselect_elements(sid, H5S_SELECT_SET, 4, coords[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -644,7 +644,7 @@ gen_region_ref(hid_t loc_id) /* create region reference from elements space */ status = H5Rcreate(&rr_data[0], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -652,7 +652,7 @@ gen_region_ref(hid_t loc_id) /* select hyperslab space for reference */ status = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -660,7 +660,7 @@ gen_region_ref(hid_t loc_id) /* create region reference from hyperslab space */ status = H5Rcreate(&rr_data[1], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -670,7 +670,7 @@ gen_region_ref(hid_t loc_id) /* Create dataspace. */ sid = H5Screate_simple(1, dims1, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -678,7 +678,7 @@ gen_region_ref(hid_t loc_id) /* create region reference dataset */ oid1 = H5Dcreate2(loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid1 < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -686,7 +686,7 @@ gen_region_ref(hid_t loc_id) /* write data as region references */ status = H5Dwrite(oid1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -716,11 +716,11 @@ Test_Obj_Copy(void) unsigned new_format; /* New format or old format */ if ((fapl_new = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - HDfprintf(stderr, "Error: H5Pcreate failed.\n"); + fprintf(stderr, "Error: H5Pcreate failed.\n"); goto out; } if (H5Pset_libver_bounds(fapl_new, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { - HDfprintf(stderr, "Error: H5Pset_libver_bounds failed.\n"); + fprintf(stderr, "Error: H5Pset_libver_bounds failed.\n"); goto out; } @@ -734,7 +734,7 @@ Test_Obj_Copy(void) else fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid < 0) { - HDfprintf(stderr, "Error: H5Fcreate failed.\n"); + fprintf(stderr, "Error: H5Fcreate failed.\n"); goto out; } @@ -772,19 +772,19 @@ Test_Ref_Copy(void) fid = H5Fcreate(HDF_FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_FILE2); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_FILE2); goto out; } /* add object reference */ status = gen_obj_ref(fid); if (status < 0) - HDfprintf(stderr, "Failed to generate object reference.\n"); + fprintf(stderr, "Failed to generate object reference.\n"); /* add region reference */ status = gen_region_ref(fid); if (status < 0) - HDfprintf(stderr, "Failed to generate region reference.\n"); + fprintf(stderr, "Failed to generate region reference.\n"); out: /*----------------------------------------------------------------------- @@ -815,7 +815,7 @@ gen_extlink_trg(hid_t loc_id) * target file */ gid = H5Gcreate2(loc_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -830,7 +830,7 @@ gen_extlink_trg(hid_t loc_id) tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(loc_id, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -863,7 +863,7 @@ gen_extlink_src(hid_t loc_id) *------------------------------------------------------------------------*/ gid = H5Gcreate2(loc_id, "/group_ext", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -874,7 +874,7 @@ gen_extlink_src(hid_t loc_id) /* link to dataset */ status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/simple", gid, "extlink_dset", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -882,7 +882,7 @@ gen_extlink_src(hid_t loc_id) /* link to group */ status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/group", gid, "extlink_grp", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -891,7 +891,7 @@ gen_extlink_src(hid_t loc_id) status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/datatype", gid, "extlink_datatype", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -899,7 +899,7 @@ gen_extlink_src(hid_t loc_id) /* dangling link - no obj*/ status = H5Lcreate_external(HDF_EXT_TRG_FILE, "notyet", gid, "extlink_notyet1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -907,7 +907,7 @@ gen_extlink_src(hid_t loc_id) /* dangling link - no file */ status = H5Lcreate_external("notyet_file.h5", "notyet", gid, "extlink_notyet2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -934,25 +934,25 @@ Test_Extlink_Copy(void) fid1 = H5Fcreate(HDF_EXT_SRC_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_SRC_FILE); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_SRC_FILE); goto out; } fid2 = H5Fcreate(HDF_EXT_TRG_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_TRG_FILE); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_TRG_FILE); goto out; } /* add links to source external link file */ status = gen_extlink_src(fid1); if (status < 0) - HDfprintf(stderr, "Error: %s> gen_extlink_src failed.\n", HDF_EXT_SRC_FILE); + fprintf(stderr, "Error: %s> gen_extlink_src failed.\n", HDF_EXT_SRC_FILE); /* add objs to target external link file */ status = gen_extlink_trg(fid2); if (status < 0) - HDfprintf(stderr, "Error: %s> gen_extlink_trg failed.\n", HDF_EXT_TRG_FILE); + fprintf(stderr, "Error: %s> gen_extlink_trg failed.\n", HDF_EXT_TRG_FILE); out: /*----------------------------------------------------------------------- diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index c59d3b5..5749d29 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -120,7 +120,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define ONE_DIM_SIZE 16 /* Error macros */ -#define AT() HDprintf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); +#define AT() printf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); #define PROGRAM_ERROR \ do { \ AT(); \ @@ -334,17 +334,17 @@ onion_filepaths_init(const char *basename) { struct onion_filepaths *paths = NULL; - if (NULL == (paths = HDcalloc(1, sizeof(struct onion_filepaths)))) + if (NULL == (paths = calloc(1, sizeof(struct onion_filepaths)))) goto error; if (NULL == (paths->canon = HDstrdup(basename))) goto error; - if (NULL == (paths->onion = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->onion = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); - if (NULL == (paths->recovery = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->recovery = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); @@ -352,10 +352,10 @@ onion_filepaths_init(const char *basename) error: if (paths != NULL) { - HDfree(paths->canon); - HDfree(paths->onion); - HDfree(paths->recovery); - HDfree(paths); + free(paths->canon); + free(paths->onion); + free(paths->recovery); + free(paths); } return NULL; } @@ -364,10 +364,10 @@ static void onion_filepaths_destroy(struct onion_filepaths *s) { if (s) { - HDfree(s->canon); - HDfree(s->onion); - HDfree(s->recovery); - HDfree(s); + free(s->canon); + free(s->onion); + free(s->recovery); + free(s); } } @@ -1000,11 +1000,11 @@ test_basic(const char *fname1, const char *fname2, const char *fname3) /* create the empty file */ if ((fid1 = H5Fcreate(fname3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - HDfprintf(stderr, "empty file (%s) creation failed.\n", fname3); + fprintf(stderr, "empty file (%s) creation failed.\n", fname3); goto out; } if (H5Fclose(fid1) < 0) { - HDfprintf(stderr, "empty file (%s) close failed.\n", fname3); + fprintf(stderr, "empty file (%s) close failed.\n", fname3); goto out; } @@ -1734,7 +1734,7 @@ test_attributes_verbose_level(const char *fname1, const char *fname2) * Create file1 *-----------------------------------------------------------------------*/ if ((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -1744,28 +1744,28 @@ test_attributes_verbose_level(const char *fname1, const char *fname2) */ f1_gid = H5Gcreate2(fid1, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f1_gid < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid2 = H5Gcreate2(fid1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f1_gid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid3 = H5Gcreate2(fid1, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f1_gid3 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid4 = H5Gcreate2(fid1, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f1_gid4 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -1776,13 +1776,13 @@ test_attributes_verbose_level(const char *fname1, const char *fname2) f1_sid = H5Screate_simple(1, dset_dims, NULL); f1_did = H5Dcreate2(fid1, "dset", H5T_NATIVE_INT, f1_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f1_did == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = H5Dwrite(f1_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -1793,7 +1793,7 @@ test_attributes_verbose_level(const char *fname1, const char *fname2) f1_tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(fid1, "ntype", f1_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1); status = FAIL; goto out; } @@ -1802,7 +1802,7 @@ test_attributes_verbose_level(const char *fname1, const char *fname2) * Create file2 *-----------------------------------------------------------------------*/ if ((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -1812,28 +1812,28 @@ test_attributes_verbose_level(const char *fname1, const char *fname2) */ f2_gid = H5Gcreate2(fid2, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f2_gid < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid2 = H5Gcreate2(fid2, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f2_gid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid3 = H5Gcreate2(fid2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f2_gid3 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid4 = H5Gcreate2(fid2, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f2_gid4 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -1844,13 +1844,13 @@ test_attributes_verbose_level(const char *fname1, const char *fname2) f2_sid = H5Screate_simple(1, dset_dims, NULL); f2_did = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, f2_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f2_did == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = H5Dwrite(f2_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname2); status = FAIL; goto out; } @@ -1861,7 +1861,7 @@ test_attributes_verbose_level(const char *fname1, const char *fname2) f2_tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(fid2, "ntype", f2_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2); status = FAIL; goto out; } @@ -2093,7 +2093,7 @@ test_link_name(const char *fname1) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -2103,14 +2103,14 @@ test_link_name(const char *fname1) *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid2 = H5Gcreate2(fid1, "group_longname", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -2120,14 +2120,14 @@ test_link_name(const char *fname1) *------------------------------------------------------------------------*/ status = H5Lcreate_soft("group", fid1, "link_g1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("group_longname", fid1, "link_g2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } @@ -2168,7 +2168,7 @@ test_soft_links(const char *fname1) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -2178,7 +2178,7 @@ test_soft_links(const char *fname1) *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -2189,21 +2189,21 @@ test_soft_links(const char *fname1) /* file1 */ status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -2214,42 +2214,42 @@ test_soft_links(const char *fname1) /* file 1 */ status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset2", fid1, "softlink_dset2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_group", fid1, "softlink_group1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_group", fid1, "softlink_group2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/no_obj", fid1, "softlink_noexist", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } @@ -2290,7 +2290,7 @@ test_linked_softlinks(const char *fname1) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -2300,21 +2300,21 @@ test_linked_softlinks(const char *fname1) *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid2 = H5Gcreate2(fid1, "target_group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid3 = H5Gcreate2(fid1, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid3 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -2325,20 +2325,20 @@ test_linked_softlinks(const char *fname1) /* file1 */ status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -2350,84 +2350,84 @@ test_linked_softlinks(const char *fname1) * file 1 */ status = H5Lcreate_soft("/target_dset1", fid1, "softlink1_to_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink1_to_dset1", fid1, "softlink1_to_slink1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink1_to_slink1", fid1, "softlink1_to_slink2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset2", fid1, "softlink2_to_dset2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink2_to_dset2", fid1, "softlink2_to_slink1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink2_to_slink1", fid1, "softlink2_to_slink2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("target_group1", fid1, "softlink3_to_group1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink3_to_group1", fid1, "softlink3_to_slink1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink3_to_slink1", fid1, "softlink3_to_slink2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("target_group2", fid1, "softlink4_to_group2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink4_to_group2", fid1, "softlink4_to_slink1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink4_to_slink1", fid1, "softlink4_to_slink2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } @@ -2473,7 +2473,7 @@ test_external_links(const char *fname1, const char *fname2) /* source file */ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -2481,7 +2481,7 @@ test_external_links(const char *fname1, const char *fname2) /* target file */ fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -2493,14 +2493,14 @@ test_external_links(const char *fname1, const char *fname2) * target file */ gid1 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid2 = H5Gcreate2(fid2, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -2511,21 +2511,21 @@ test_external_links(const char *fname1, const char *fname2) * target file */ status = write_dset(fid2, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "x_dset", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2, 2, dims2, "x_dset", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -2538,7 +2538,7 @@ test_external_links(const char *fname1, const char *fname2) status = H5Lcreate_external(fname2, "/target_group/x_dset", fid1, "ext_link_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -2546,35 +2546,35 @@ test_external_links(const char *fname1, const char *fname2) status = H5Lcreate_external(fname2, "/target_group2/x_dset", fid1, "ext_link_dset2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group", fid1, "/ext_link_grp1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group2", fid1, "/ext_link_grp2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link_noexist1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link_noexist2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -2620,7 +2620,7 @@ test_ext2soft_links(const char *fname1, const char *fname2) /* source file */ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -2628,7 +2628,7 @@ test_ext2soft_links(const char *fname1, const char *fname2) /* target file */ fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -2639,7 +2639,7 @@ test_ext2soft_links(const char *fname1, const char *fname2) /* target file */ gid2 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -2651,14 +2651,14 @@ test_ext2soft_links(const char *fname1, const char *fname2) * target file */ status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -2670,14 +2670,14 @@ test_ext2soft_links(const char *fname1, const char *fname2) * target file */ status = H5Lcreate_soft("/dset1", fid2, "softlink_to_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/dset2", fid2, "softlink_to_dset2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } @@ -2689,7 +2689,7 @@ test_ext2soft_links(const char *fname1, const char *fname2) * source file */ status = H5Lcreate_external(fname2, "/target_group", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -2697,7 +2697,7 @@ test_ext2soft_links(const char *fname1, const char *fname2) status = H5Lcreate_external(fname2, "/softlink_to_dset1", fid1, "ext_link_to_slink1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -2705,7 +2705,7 @@ test_ext2soft_links(const char *fname1, const char *fname2) status = H5Lcreate_external(fname2, "/softlink_to_dset2", fid1, "ext_link_to_slink2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -2838,14 +2838,14 @@ test_dangle_links(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -2856,14 +2856,14 @@ test_dangle_links(const char *fname1, const char *fname2) /* file1 */ status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -2871,14 +2871,14 @@ test_dangle_links(const char *fname1, const char *fname2) /* file2 */ status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -2889,28 +2889,28 @@ test_dangle_links(const char *fname1, const char *fname2) /* file 1 */ status = H5Lcreate_soft("no_obj", fid1, "soft_link1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/dset1", fid1, "soft_link2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj", fid1, "soft_link3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj1", fid1, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } @@ -2918,28 +2918,28 @@ test_dangle_links(const char *fname1, const char *fname2) /* file 2 */ status = H5Lcreate_soft("no_obj", fid2, "soft_link1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj", fid2, "soft_link2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/dset2", fid2, "soft_link3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj2", fid2, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } @@ -2950,28 +2950,28 @@ test_dangle_links(const char *fname1, const char *fname2) /* file1 */ status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/dset1", fid1, "ext_link2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -2979,28 +2979,28 @@ test_dangle_links(const char *fname1, const char *fname2) /* file2 */ status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/dset2", fid2, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } @@ -3044,14 +3044,14 @@ test_group_recurse(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -3062,28 +3062,28 @@ test_group_recurse(const char *fname1, const char *fname2) /* file1 */ gid1_f1 = H5Gcreate2(fid1, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1_f1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid2_f1 = H5Gcreate2(fid1, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2_f1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid3_f1 = H5Gcreate2(fid1, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid3_f1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid10_f1 = H5Gcreate2(fid1, "/grp10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid10_f1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -3091,28 +3091,28 @@ test_group_recurse(const char *fname1, const char *fname2) /* file2 */ gid1_f2 = H5Gcreate2(fid2, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1_f2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid2_f2 = H5Gcreate2(fid2, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2_f2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid3_f2 = H5Gcreate2(fid2, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid3_f2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid11_f2 = H5Gcreate2(fid2, "/grp11", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid11_f2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -3123,21 +3123,21 @@ test_group_recurse(const char *fname1, const char *fname2) /* file1 */ status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "dset3", H5T_NATIVE_INT, data3); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -3145,21 +3145,21 @@ test_group_recurse(const char *fname1, const char *fname2) /* file2 */ status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(fid2, 2, dims2, "dset3", H5T_NATIVE_INT, data3); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -3170,54 +3170,54 @@ test_group_recurse(const char *fname1, const char *fname2) /* file1 */ status = write_dset(gid1_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid2_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid2_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid3_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid3_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid3_f1, 2, dims2, "dset3", H5T_NATIVE_INT, data3); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid10_f1, 2, dims2, "dset4", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid10_f1, 2, dims2, "dset5", H5T_NATIVE_INT, data3); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -3225,54 +3225,54 @@ test_group_recurse(const char *fname1, const char *fname2) /* file2 */ status = write_dset(gid1_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid3_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid3_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid3_f2, 2, dims2, "dset3", H5T_NATIVE_INT, data3); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid11_f2, 2, dims2, "dset4", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid11_f2, 2, dims2, "dset5", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -3283,28 +3283,28 @@ test_group_recurse(const char *fname1, const char *fname2) /* file 1 */ status = H5Lcreate_soft("/grp1", fid1, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2", fid1, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2/grp3", fid1, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp10", fid1, "slink_grp10", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } @@ -3312,28 +3312,28 @@ test_group_recurse(const char *fname1, const char *fname2) /* file 2 */ status = H5Lcreate_soft("/grp1", fid2, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2", fid2, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2/grp3", fid2, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp11", fid2, "slink_grp11", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } @@ -3344,21 +3344,21 @@ test_group_recurse(const char *fname1, const char *fname2) /* file1 */ status = H5Lcreate_external(fname2, "/grp1", fid1, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/grp1/grp2", fid1, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/grp1/grp2/grp3", fid1, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -3366,21 +3366,21 @@ test_group_recurse(const char *fname1, const char *fname2) /* file2 */ status = H5Lcreate_external(fname1, "/grp1", fid2, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/grp1/grp2", fid2, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/grp1/grp2/grp3", fid2, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } @@ -3392,14 +3392,14 @@ test_group_recurse(const char *fname1, const char *fname2) /* file1 */ status = H5Lcreate_external(fname2, "/grp11", gid10_f1, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } /* file2 */ status = H5Lcreate_external(fname1, "/grp10", gid11_f2, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } @@ -3474,28 +3474,28 @@ test_group_recurse2(void) *------------------------------------------------------------------------*/ grp1 = H5Gcreate2(fileid1, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp2 = H5Gcreate2(grp1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp3 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp4 = H5Gcreate2(grp3, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp4 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } @@ -3570,7 +3570,7 @@ test_group_recurse2(void) /* link to dset1 */ status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE1_EXT); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } @@ -3594,7 +3594,7 @@ test_group_recurse2(void) */ grp4 = H5Gcreate2(fileid4, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp4 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT3); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT3); status = FAIL; goto out; } @@ -3628,14 +3628,14 @@ test_group_recurse2(void) */ grp2 = H5Gcreate2(fileid3, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; } grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp3 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; } @@ -3659,7 +3659,7 @@ test_group_recurse2(void) */ status = H5Lcreate_external(GRP_RECURSE2_EXT3, "/g4", fileid3, "/g2/g3/g4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT2); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; } @@ -3680,7 +3680,7 @@ test_group_recurse2(void) */ grp1 = H5Gcreate2(fileid2, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } @@ -3704,7 +3704,7 @@ test_group_recurse2(void) /* link to dset1 */ status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid2, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE2_EXT1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE2_EXT1); status = FAIL; goto out; } @@ -3714,7 +3714,7 @@ test_group_recurse2(void) */ status = H5Lcreate_external(GRP_RECURSE2_EXT2, "/g2", fileid2, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT1); + fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT1); status = FAIL; goto out; } @@ -3768,14 +3768,14 @@ test_exclude_obj1(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -3786,7 +3786,7 @@ test_exclude_obj1(const char *fname1, const char *fname2) /* file1 */ gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -3795,7 +3795,7 @@ test_exclude_obj1(const char *fname1, const char *fname2) gid2 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -3806,21 +3806,21 @@ test_exclude_obj1(const char *fname1, const char *fname2) /* file1 */ status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset3", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -3828,21 +3828,21 @@ test_exclude_obj1(const char *fname1, const char *fname2) /* file2 */ status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2, 2, dims2, "dset3", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -3890,14 +3890,14 @@ test_exclude_obj2(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -3908,7 +3908,7 @@ test_exclude_obj2(const char *fname1, const char *fname2) /* file1 */ gid1 = H5Gcreate2(fid1, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -3916,7 +3916,7 @@ test_exclude_obj2(const char *fname1, const char *fname2) /* file2 */ gid2 = H5Gcreate2(fid2, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -3925,7 +3925,7 @@ test_exclude_obj2(const char *fname1, const char *fname2) gid3 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid3 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -3936,21 +3936,21 @@ test_exclude_obj2(const char *fname1, const char *fname2) /* file1 */ status = write_dset(fid1, 2, dims2, "dset10", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -3958,21 +3958,21 @@ test_exclude_obj2(const char *fname1, const char *fname2) /* file2 */ status = write_dset(fid2, 2, dims2, "dset10", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid3, 2, dims2, "dset3", H5T_NATIVE_INT, data2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -4019,14 +4019,14 @@ test_exclude_obj3(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -4037,7 +4037,7 @@ test_exclude_obj3(const char *fname1, const char *fname2) /* file1 */ gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -4048,14 +4048,14 @@ test_exclude_obj3(const char *fname1, const char *fname2) /* file1 */ status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -4063,7 +4063,7 @@ test_exclude_obj3(const char *fname1, const char *fname2) /* file2 */ status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -4374,7 +4374,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new if (is_file_new == 1) { fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -4382,7 +4382,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new else { fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1); status = FAIL; goto out; } @@ -4393,7 +4393,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new *------------------------------------------------------------------------*/ gid = H5Gcreate2(fid1, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -4403,7 +4403,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new *------------------------------------------------------------------------*/ sid_vlen_str = H5Screate_simple(STR_RANK, dims_vlen_str, NULL); if (sid_vlen_str < 0) { - HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } @@ -4411,7 +4411,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new tid_vlen_str = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_vlen_str, H5T_VARIABLE); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } @@ -4421,7 +4421,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new *------------------------------------------------------------------------*/ sid_fixlen_str = H5Screate_simple(STR_RANK, dims_fixlen_str, NULL); if (sid_fixlen_str < 0) { - HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } @@ -4429,7 +4429,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new tid_fixlen_str = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_fixlen_str, FIXLEN_STR_SIZE); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } @@ -4439,7 +4439,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new *------------------------------------------------------------------------*/ sid_vlen_str_array = H5Screate_simple(STR_RANK, dims_vlen_str_array, NULL); if (sid_vlen_str_array < 0) { - HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } @@ -4447,7 +4447,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new tid_vlen_str_array_pre = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_vlen_str_array_pre, H5T_VARIABLE); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } @@ -4455,7 +4455,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new /* Create the array data type for the string array */ tid_vlen_str_array = H5Tarray_create2(tid_vlen_str_array_pre, COMP_RANK, dims_vlen_str_array); if (tid_vlen_str_array < 0) { - HDfprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); status = FAIL; goto out; } @@ -4465,7 +4465,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new *------------------------------------------------------------------------*/ sid_fixlen_str_array = H5Screate_simple(STR_RANK, dims_fixlen_str_array, NULL); if (sid_fixlen_str_array < 0) { - HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } @@ -4473,14 +4473,14 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new tid_fixlen_str_array_pre = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_fixlen_str_array_pre, FIXLEN_STR_ARRY_SIZE); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } /* Create the array data type for the string array */ tid_fixlen_str_array = H5Tarray_create2(tid_fixlen_str_array_pre, COMP_RANK, dims_fixlen_str_array); if (tid_fixlen_str_array < 0) { - HDfprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); status = FAIL; goto out; } @@ -4490,7 +4490,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new *------------------------------------------------------------------------*/ sid_comp = H5Screate_simple(COMP_RANK, dims_comp, NULL); if (sid_comp < 0) { - HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } @@ -4604,7 +4604,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new did_comp = H5Dcreate2(gid, "Compound_dset1", tid1_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid1_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp1_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4614,7 +4614,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new did_comp = H5Dcreate2(gid, "Compound_dset2", tid2_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid2_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp2_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4624,7 +4624,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new did_comp = H5Dcreate2(gid, "Compound_dset3", tid3_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid3_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp3_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4634,7 +4634,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new did_comp = H5Dcreate2(gid, "Compound_dset4", tid4_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid4_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp4_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4644,7 +4644,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new did_comp = H5Dcreate2(gid, "Compound_dset5", tid5_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid5_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp5_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4654,7 +4654,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new did_comp = H5Dcreate2(gid, "Compound_dset6", tid6_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid6_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp6_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4664,7 +4664,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new did_comp = H5Dcreate2(gid, "Compound_dset7", tid7_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid7_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp7_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4674,7 +4674,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new did_comp = H5Dcreate2(gid, "Compound_dset8", tid8_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid8_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp8_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4690,7 +4690,7 @@ test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new status = H5Dwrite(did_comp, tid9_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp9_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4813,14 +4813,14 @@ test_enums(const char *fname) enum_val = 0; status = H5Tenum_insert(tid, "YIN", &enum_val); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); + fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); status = FAIL; goto out; } enum_val = 1; status = H5Tenum_insert(tid, "YANG", &enum_val); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); + fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); status = FAIL; goto out; } @@ -4831,13 +4831,13 @@ test_enums(const char *fname) status = write_dset(fid, 1, &dims, "dset1", tid, data1); if (status < 0) { - HDfprintf(stderr, "Error: %s> write_dset failed.\n", fname); + fprintf(stderr, "Error: %s> write_dset failed.\n", fname); status = FAIL; goto out; } status = write_dset(fid, 1, &dims, "dset2", tid, data2); if (status < 0) { - HDfprintf(stderr, "Error: %s> write_dset failed.\n", fname); + fprintf(stderr, "Error: %s> write_dset failed.\n", fname); status = FAIL; goto out; } @@ -5020,7 +5020,7 @@ test_comps_vlen(const char *fname, const char *dset, const char *attr, int diff, /* Allocate and initialize VL data to write */ for (i = 0; i < SDIM_DSET; i++) { wdata[i].i1 = (int)i; - wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); + wdata[i].vl.p = malloc((i + 1) * sizeof(cmpd2_t)); wdata[i].vl.len = i + 1; for (j = 0; j < (i + 1); j++) { ((cmpd2_t *)wdata[i].vl.p)[j].i2 = (int)(i * 10 + (unsigned)diff); @@ -5141,7 +5141,7 @@ test_comps_array_vlen(const char *fname, const char *dset, const char *attr, int /* Allocate and initialize VL data to write in compound2 */ for (j = 0; j < SDIM_CMPD_ARRAY; j++) { wdata[i].cmpd2[j].i2 = (int)(j * 10); - wdata[i].cmpd2[j].vl.p = HDmalloc((j + 1) * sizeof(cmpd3_t)); + wdata[i].cmpd2[j].vl.p = malloc((j + 1) * sizeof(cmpd3_t)); wdata[i].cmpd2[j].vl.len = j + 1; for (k = 0; k < (j + 1); k++) { /* Initialize data of compound3 */ @@ -5280,7 +5280,7 @@ test_comps_vlen_arry(const char *fname, const char *dset, const char *attr, int for (i = 0; i < SDIM_DSET; i++) { /* compound 1 data */ wdata[i].i1 = (int)i; - wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); + wdata[i].vl.p = malloc((i + 1) * sizeof(cmpd2_t)); wdata[i].vl.len = i + 1; for (j = 0; j < (i + 1); j++) { /* compound2 data */ @@ -5470,7 +5470,7 @@ test_data_nocomparables(const char *fname, int make_diffs) *------------------------------------------------------------------------*/ fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname); status = FAIL; goto out; } @@ -5480,14 +5480,14 @@ test_data_nocomparables(const char *fname, int make_diffs) *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); status = FAIL; goto out; } gid2 = H5Gcreate2(fid, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); status = FAIL; goto out; } @@ -5500,13 +5500,13 @@ test_data_nocomparables(const char *fname, int make_diffs) /* dset1 */ if ((did1 = H5Dcreate2(gid1, "dset1", tid_dset1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); + fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); status = FAIL; goto out; } if (H5Dwrite(did1, tid_dset1, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr1) < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); status = FAIL; goto out; } @@ -5515,7 +5515,7 @@ test_data_nocomparables(const char *fname, int make_diffs) /* dset2 */ status = write_dset(gid1, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr2); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname); + fprintf(stderr, "Error: %s> write_dset failed\n", fname); goto out; } @@ -5525,13 +5525,13 @@ test_data_nocomparables(const char *fname, int make_diffs) /* --------- * dset1 */ if ((did2 = H5Dcreate2(gid2, "dset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); + fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); status = FAIL; goto out; } if (H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr3) < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); status = FAIL; goto out; } @@ -5551,7 +5551,7 @@ test_data_nocomparables(const char *fname, int make_diffs) * dset2 */ status = write_dset(gid2, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr3); if (status == FAIL) { - HDfprintf(stderr, "Error: %s> write_dset failed\n", fname); + fprintf(stderr, "Error: %s> write_dset failed\n", fname); goto out; } @@ -5755,14 +5755,14 @@ test_objs_strings(const char *fname1, const char *fname2) /* file1 */ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); goto out; } /* file2 */ fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); goto out; } @@ -6088,10 +6088,10 @@ write_attr_strings(hid_t loc_id, const char *dset_name, hid_t fid, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -6349,7 +6349,7 @@ write_attr_strings(hid_t loc_id, const char *dset_name, hid_t fid, n = 0; for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -6748,7 +6748,7 @@ write_attr_strings(hid_t loc_id, const char *dset_name, hid_t fid, for (i = 0; i < 4; i++) for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -7074,10 +7074,10 @@ write_attr_in(hid_t loc_id, const char *dset_name, hid_t fid, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -7338,7 +7338,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, hid_t fid, n = 0; for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -7738,7 +7738,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, hid_t fid, for (i = 0; i < 4; i++) for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -8041,10 +8041,10 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -8058,9 +8058,9 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -8091,7 +8091,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, /* allocate and initialize array data to write */ size = (H5TOOLS_MALLOCSIZE / sizeof(double) + 1) * sizeof(double); - dbuf = (double *)HDmalloc(size); + dbuf = (double *)malloc(size); for (jj = 0; jj < (H5TOOLS_MALLOCSIZE / sizeof(double) + 1); jj++) dbuf[jj] = (double)jj; @@ -8114,7 +8114,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, H5Dclose(ldid); H5Tclose(ltid); H5Sclose(lsid); - HDfree(dbuf); + free(dbuf); } /*------------------------------------------------------------------------- @@ -8229,7 +8229,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, n = 0; for (i = 0; i < 3; i++) for (j = 0; j < 2; j++) { - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -8408,7 +8408,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, for (i = 0; i < 4; i++) for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -8500,10 +8500,10 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) int i; /* allocate the buffer for write the references */ - rbuf = (hdset_reg_ref_t *)HDcalloc((size_t)2, sizeof(hdset_reg_ref_t)); + rbuf = (hdset_reg_ref_t *)calloc((size_t)2, sizeof(hdset_reg_ref_t)); /* allocate the buffer for write the data dataset */ - buf = (int *)HDmalloc(10 * 10 * sizeof(int)); + buf = (int *)malloc(10 * 10 * sizeof(int)); for (i = 0; i < 10 * 10; i++) buf[i] = i; @@ -8512,7 +8512,7 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) sid1 = H5Screate_simple(2, dims1, NULL); did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - HDassert(status >= 0); + assert(status >= 0); /* create the reference dataset */ sid2 = H5Screate_simple(1, dims2, NULL); @@ -8533,12 +8533,12 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) } status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); - HDassert(status >= 0); + assert(status >= 0); H5Sget_select_npoints(sid1); /* store first dataset region */ status = H5Rcreate(&rbuf[0], fid, "dsetref", H5R_DATASET_REGION, sid1); - HDassert(status >= 0); + assert(status >= 0); /* select sequence of five points for second reference */ coord[0][0] = 6; @@ -8567,20 +8567,20 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) /* write */ status = H5Dwrite(did2, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf); - HDassert(status >= 0); + assert(status >= 0); /* close, free memory buffers */ status = H5Dclose(did1); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(sid1); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(did2); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(sid2); - HDassert(status >= 0); + assert(status >= 0); - HDfree(rbuf); - HDfree(buf); + free(rbuf); + free(buf); } /*------------------------------------------------------------------------- @@ -8631,7 +8631,7 @@ test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers goto out; /* create a evenly divided buffer from 0 to 127 */ - buf = (char *)HDmalloc((size_t)(nelmts * size)); + buf = (char *)malloc((size_t)(nelmts * size)); s = 1024 * 1024 / 127; for (i = 0, j = 0, c = 0; i < 1024 * 1024; j++, i++) { if (j == s) { @@ -8640,11 +8640,11 @@ test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers } /* set the hyperslab values */ - HDmemset(buf, c, nelmts); + memset(buf, c, nelmts); /* make a different hyperslab at this position */ if (make_diffs && i == 512 * 512) - HDmemset(buf, 0, nelmts); + memset(buf, 0, nelmts); hs_start[0] = (unsigned long long)i * GBLL / (1024 * 1024); if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, hs_start, NULL, hs_size, NULL) < 0) @@ -8656,7 +8656,7 @@ test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers goto out; } } - HDfree(buf); + free(buf); buf = NULL; /* close */ diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 1fd512c..3628a4a 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -470,13 +470,13 @@ gent_dataset(void) int i, j; /* Set up data arrays */ - dset1_data = (int *)HDcalloc(10 * 20, sizeof(int)); - dset1 = (int **)HDcalloc(10, sizeof(dset1_data)); + dset1_data = (int *)calloc(10 * 20, sizeof(int)); + dset1 = (int **)calloc(10, sizeof(dset1_data)); for (i = 0; i < 10; i++) dset1[i] = dset1_data + (i * 20); - dset2_data = (double *)HDcalloc(30 * 20, sizeof(double)); - dset2 = (double **)HDcalloc(30, sizeof(dset2_data)); + dset2_data = (double *)calloc(30 * 20, sizeof(double)); + dset2 = (double **)calloc(30, sizeof(dset2_data)); for (i = 0; i < 30; i++) dset2[i] = dset2_data + (i * 20); @@ -512,10 +512,10 @@ gent_dataset(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dset1); - HDfree(dset1_data); - HDfree(dset2); - HDfree(dset2_data); + free(dset1); + free(dset1_data); + free(dset2); + free(dset2_data); } static void @@ -683,7 +683,7 @@ gent_softlink2(void) /* Create a new file */ fileid1 = H5Fcreate(FILE4_1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fileid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", FILE4_1); status = FAIL; goto out; } @@ -693,14 +693,14 @@ gent_softlink2(void) *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fileid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", FILE4_1); status = FAIL; goto out; } gid2 = H5Gcreate2(fileid1, "group_empty", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", FILE4_1); status = FAIL; goto out; } @@ -711,7 +711,7 @@ gent_softlink2(void) datatype = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(fileid1, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", FILE4_1); status = FAIL; goto out; } @@ -737,14 +737,14 @@ gent_softlink2(void) /* Create a new dataset as sample object */ dset1 = H5Dcreate2(fileid1, "/dset1", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (dset1 < 0) { - HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); status = FAIL; goto out; } status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", FILE4_1); status = FAIL; goto out; } @@ -755,14 +755,14 @@ gent_softlink2(void) /* Create a new dataset as sample object */ dset2 = H5Dcreate2(fileid1, "/dset2", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (dset2 < 0) { - HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); status = FAIL; goto out; } status = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", FILE4_1); status = FAIL; goto out; } @@ -776,7 +776,7 @@ gent_softlink2(void) /* link to dset1 */ status = H5Lcreate_soft("/dset1", fileid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -784,7 +784,7 @@ gent_softlink2(void) /* link to data type */ status = H5Lcreate_soft("/dtype", fileid1, "soft_dtype", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -792,7 +792,7 @@ gent_softlink2(void) /* link to group1 */ status = H5Lcreate_soft("/group1", fileid1, "soft_group1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -800,7 +800,7 @@ gent_softlink2(void) /* link to empty group */ status = H5Lcreate_soft("/group_empty", fileid1, "soft_empty_grp", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -808,7 +808,7 @@ gent_softlink2(void) /* dangling link */ status = H5Lcreate_soft("not_yet", fileid1, "soft_dangle", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -819,7 +819,7 @@ gent_softlink2(void) /* link to dset1 */ status = H5Lcreate_soft("/dset1", gid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -827,7 +827,7 @@ gent_softlink2(void) /* link to dset2 */ status = H5Lcreate_soft("/dset2", gid1, "soft_dset2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -835,7 +835,7 @@ gent_softlink2(void) /* link to data type */ status = H5Lcreate_soft("/dtype", gid1, "soft_dtype", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -843,7 +843,7 @@ gent_softlink2(void) /* link to empty group */ status = H5Lcreate_soft("/group_empty", gid1, "soft_empty_grp", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -851,7 +851,7 @@ gent_softlink2(void) /* dangling link */ status = H5Lcreate_soft("not_yet", gid1, "soft_dangle", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); status = FAIL; goto out; } @@ -861,31 +861,31 @@ out: * Close/release resources. */ if (dataspace >= 0 && H5Sclose(dataspace) < 0) { - HDfprintf(stderr, "Error: %s> H5Sclose failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Sclose failed.\n", FILE4_1); status = FAIL; } if (gid1 >= 0 && H5Gclose(gid1) < 0) { - HDfprintf(stderr, "Error: %s> H5Gclose failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Gclose failed.\n", FILE4_1); status = FAIL; } if (gid2 >= 0 && H5Gclose(gid2) < 0) { - HDfprintf(stderr, "Error: %s> H5Gclose failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Gclose failed.\n", FILE4_1); status = FAIL; } if (datatype >= 0 && H5Tclose(datatype) < 0) { - HDfprintf(stderr, "Error: %s> H5Tclose failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Tclose failed.\n", FILE4_1); status = FAIL; } if (dset1 >= 0 && H5Dclose(dset1) < 0) { - HDfprintf(stderr, "Error: %s> H5Dclose failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Dclose failed.\n", FILE4_1); status = FAIL; } if (dset2 >= 0 && H5Dclose(dset2) < 0) { - HDfprintf(stderr, "Error: %s> H5Dclose failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Dclose failed.\n", FILE4_1); status = FAIL; } if (fileid1 >= 0 && H5Fclose(fileid1) < 0) { - HDfprintf(stderr, "Error: %s> H5Fclose failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Fclose failed.\n", FILE4_1); status = FAIL; } @@ -1750,9 +1750,9 @@ gent_many(void) /* Create links to external and UD links */ ret = H5Lcreate_soft("/g8/elink", fid, "/g7/slink5", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Lcreate_soft("/g8/udlink", fid, "/g7/slink6", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); H5Fclose(fid); } @@ -1808,8 +1808,8 @@ gent_str(void) hsize_t mdims[2]; /* Set up data array */ - comp1_data = (compound_t *)HDcalloc(3 * 6, sizeof(compound_t)); - comp1 = (compound_t **)HDcalloc(3, sizeof(comp1_data)); + comp1_data = (compound_t *)calloc(3 * 6, sizeof(compound_t)); + comp1 = (compound_t **)calloc(3, sizeof(comp1_data)); for (i = 0; i < 3; i++) comp1[i] = comp1_data + (i * 6); @@ -1909,8 +1909,8 @@ gent_str(void) H5Fclose(fid); - HDfree(comp1); - HDfree(comp1_data); + free(comp1); + free(comp1_data); } /* @@ -2126,9 +2126,9 @@ gent_objref(void) uint64_t supports_comments = 0; /* Allocate write & read buffers */ - wbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - rbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - tbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + wbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + rbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + tbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE16, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2211,9 +2211,9 @@ gent_objref(void) H5Fclose(fid1); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); + free(wbuf); + free(rbuf); + free(tbuf); } static void @@ -2240,10 +2240,10 @@ gent_datareg(void) int i; /* counting variables */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); /* Create file */ fid1 = H5Fcreate(FILE17, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2331,10 +2331,10 @@ gent_datareg(void) H5Fclose(fid1); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } static void @@ -2364,10 +2364,10 @@ gent_attrreg(void) int i; /* counting variables */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); /* Create file */ fid1 = H5Fcreate(FILE64, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2464,10 +2464,10 @@ gent_attrreg(void) H5Fclose(fid1); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } /*taken from Elena's compound test file*/ @@ -2560,7 +2560,7 @@ gent_nestcomp(void) */ status = H5Dwrite(dataset, s2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1); if (status < 0) - HDfprintf(stderr, "gent_nestcomp H5Dwrite failed\n"); + fprintf(stderr, "gent_nestcomp H5Dwrite failed\n"); /* * Release resources @@ -2695,7 +2695,7 @@ gent_vldatatypes(void) for (i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + wdata[i].p = malloc((size_t)(i + 1) * sizeof(int)); wdata[i].len = (size_t)(i + 1); for (j = 0; j < i + 1; j++) @@ -2707,22 +2707,22 @@ gent_vldatatypes(void) type = H5Tvlen_create(H5T_NATIVE_INT); dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Treclaim(type, space, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(space); - HDassert(ret >= 0); + assert(ret >= 0); /* Allocate and initialize VL dataset to write */ for (i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = HDmalloc((size_t)(i + 1) * sizeof(float)); + wdata[i].p = malloc((size_t)(i + 1) * sizeof(float)); wdata[i].len = (size_t)(i + 1); for (j = 0; j < i + 1; j++) @@ -2734,19 +2734,19 @@ gent_vldatatypes(void) type = H5Tvlen_create(H5T_NATIVE_FLOAT); dset = H5Dcreate2(file, "Dataset2.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Treclaim(type, space, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(space); - HDassert(ret >= 0); + assert(ret >= 0); /* Allocate and initialize a scalar VL dataset to write */ - adata.p = HDmalloc(37 * sizeof(int)); + adata.p = malloc(37 * sizeof(int)); adata.len = 37; for (i = 0; i < 37; i++) @@ -2757,18 +2757,18 @@ gent_vldatatypes(void) type = H5Tvlen_create(H5T_NATIVE_INT); dset = H5Dcreate2(file, "Dataset3.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &adata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Treclaim(type, space, H5P_DEFAULT, &adata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(space); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(file); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -2786,16 +2786,16 @@ gent_vldatatypes2(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = (hvl_t *)HDmalloc((i + 1) * sizeof(hvl_t)); + wdata[i].p = (hvl_t *)malloc((i + 1) * sizeof(hvl_t)); if (wdata[i].p == NULL) { - HDprintf("Cannot allocate memory for VL data! i=%u\n", i); + printf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + 1; for (t1 = (hvl_t *)wdata[i].p, j = 0; j < (i + 1); j++, t1++) { - t1->p = (unsigned *)HDmalloc((j + 1) * sizeof(unsigned)); + t1->p = (unsigned *)malloc((j + 1) * sizeof(unsigned)); if (t1->p == NULL) { - HDprintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); + printf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); return; } /* end if */ t1->len = j + 1; @@ -2821,23 +2821,23 @@ gent_vldatatypes2(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Reclaim the write VL data */ ret = H5Treclaim(tid2, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -2861,7 +2861,7 @@ gent_vldatatypes3(void) for (i = 0; i < SPACE1_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)((float)(i * 20) / 3.0F); - wdata[i].v.p = HDmalloc((size_t)(i + 1) * sizeof(unsigned int)); + wdata[i].v.p = malloc((size_t)(i + 1) * sizeof(unsigned int)); wdata[i].v.len = (size_t)(i + 1); for (j = 0; j < (i + 1); j++) ((unsigned int *)wdata[i].v.p)[j] = i * 10 + j; @@ -2881,34 +2881,34 @@ gent_vldatatypes3(void) /* Insert fields */ ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Reclaim the write VL data */ ret = H5Treclaim(tid2, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -2929,7 +2929,7 @@ gent_vldatatypes4(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(s1)); + wdata[i].p = malloc((i + 1) * sizeof(s1)); wdata[i].len = i + 1; for (j = 0; j < (i + 1); j++) { ((s1 *)wdata[i].p)[j].i = (int)(i * 10 + j); @@ -2948,9 +2948,9 @@ gent_vldatatypes4(void) /* Insert fields */ ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a datatype to refer to */ tid1 = H5Tvlen_create(tid2); @@ -2960,23 +2960,23 @@ gent_vldatatypes4(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Reclaim the write VL data */ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } /* Generate a variable-length dataset with NULL values in it */ @@ -3000,7 +3000,7 @@ gent_vldatatypes5(void) } /* end if */ else { wdata[i].len = (size_t)(i + 5); - wdata[i].p = HDmalloc(sizeof(unsigned) * (size_t)(i + 5)); + wdata[i].p = malloc(sizeof(unsigned) * (size_t)(i + 5)); for (j = 0; j < i + 5; j++) ((unsigned *)wdata[i].p)[j] = (unsigned)(j * 2); } /* end else */ @@ -3008,37 +3008,37 @@ gent_vldatatypes5(void) /* Create file */ fid1 = H5Fcreate(FILE43, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid1 > 0); + assert(fid1 > 0); /* Create dataspace for datasets */ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); - HDassert(sid1 > 0); + assert(sid1 > 0); /* Create a datatype to refer to */ tid1 = H5Tvlen_create(H5T_NATIVE_UINT); - HDassert(tid1 > 0); + assert(tid1 > 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, F43_DSETNAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(dataset > 0); + assert(dataset > 0); ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } /* This is big enough to make h5dump to use hyperslap to read @@ -3079,8 +3079,8 @@ gent_array1_big(void) block[0] = 1; /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - wdata = (int *)HDmalloc(sizeof(int) * (size_t)(SPACE_ARRAY1BIG_DIM * ARRAY1BIG_DIM)); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + wdata = (int *)malloc(sizeof(int) * (size_t)(SPACE_ARRAY1BIG_DIM * ARRAY1BIG_DIM)); /* Allocate and initialize array data to write */ for (i = 0; i < SPACE_ARRAY1BIG_DIM; i++) @@ -3104,7 +3104,7 @@ gent_array1_big(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /*--------------------------- * Region Reference dataset @@ -3128,17 +3128,17 @@ gent_array1_big(void) /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); /* Release memory */ - HDfree(wbuf); - HDfree(wdata); + free(wbuf); + free(wdata); } static void @@ -3173,17 +3173,17 @@ gent_array1(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3220,17 +3220,17 @@ gent_array2(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3272,19 +3272,19 @@ gent_array3(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3323,35 +3323,35 @@ gent_array4(void) /* Insert integer field */ ret = H5Tinsert(tid2, "i", HOFFSET(s2_t, i), H5T_NATIVE_INT); - HDassert(ret >= 0); + assert(ret >= 0); /* Insert float field */ ret = H5Tinsert(tid2, "f", HOFFSET(s2_t, f), H5T_NATIVE_FLOAT); - HDassert(ret >= 0); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close compound datatype */ ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3392,42 +3392,42 @@ gent_array5(void) /* Insert integer field */ ret = H5Tinsert(tid2, "i", HOFFSET(s2_t, i), H5T_NATIVE_INT); - HDassert(ret >= 0); + assert(ret >= 0); /* Create an array of floats datatype */ tid3 = H5Tarray_create2(H5T_NATIVE_FLOAT, ARRAY1_RANK, tdims1); /* Insert float array field */ ret = H5Tinsert(tid2, "f", HOFFSET(s2_t, f), tid3); - HDassert(ret >= 0); + assert(ret >= 0); /* Close array of floats field datatype */ ret = H5Tclose(tid3); - HDassert(ret >= 0); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close compound datatype */ ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3447,7 +3447,7 @@ gent_array6(void) /* Initialize array data to write */ for (i = 0; i < SPACE1_DIM1; i++) for (j = 0; j < ARRAY1_DIM1; j++) { - wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * sizeof(unsigned int)); + wdata[i][j].p = malloc((size_t)(i + j + 1) * sizeof(unsigned int)); wdata[i][j].len = (size_t)(i + j + 1); for (k = 0; k < (i + j + 1); k++) ((unsigned int *)wdata[i][j].p)[k] = (unsigned)(i * 100 + j * 10 + k); @@ -3467,28 +3467,28 @@ gent_array6(void) /* Close VL datatype */ ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Reclaim the write VL data */ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3509,7 +3509,7 @@ gent_array7(void) /* Initialize array data to write */ for (i = 0; i < SPACE1_DIM1; i++) for (j = 0; j < ARRAY1_DIM1; j++) { - wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * (sizeof(unsigned int) * ARRAY1_DIM1)); + wdata[i][j].p = malloc((size_t)(i + j + 1) * (sizeof(unsigned int) * ARRAY1_DIM1)); wdata[i][j].len = (size_t)(i + j + 1); for (k = 0; k < (i + j + 1); k++) for (l = 0; l < ARRAY1_DIM1; l++) @@ -3531,35 +3531,35 @@ gent_array7(void) /* Close nested array datatype */ ret = H5Tclose(tid3); - HDassert(ret >= 0); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close VL datatype */ ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Reclaim the write VL data */ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } /* Test the boundary of the display output buffer at the reallocation event */ @@ -3577,8 +3577,8 @@ gent_array8(void) unsigned int i; /* Allocate data buffer */ - wdata = (int *)HDmalloc(F64_DIM1 * sizeof(int)); - HDassert(wdata); + wdata = (int *)malloc(F64_DIM1 * sizeof(int)); + assert(wdata); /* * Initialize data. i is the element in the dataspace, j and k the @@ -3610,21 +3610,21 @@ gent_array8(void) dset = H5Dcreate2(file, F64_DATASET, filetype, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (dset >= 0) status = H5Dwrite(dset, filetype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(status >= 0); + assert(status >= 0); } /* * Close and release resources. */ status = H5Dclose(dset); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(filetype); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(file); - HDassert(status >= 0); - HDfree(wdata); + assert(status >= 0); + free(wdata); } static void @@ -3648,30 +3648,30 @@ gent_empty(void) dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); /* write out an empty native integer dataset dataset */ dset = H5Dcreate2(file, "Dataset2.0", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); /* write out an empty native floating-point dataset dataset */ dset = H5Dcreate2(file, "Dataset3.0", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); /* write out an empty array dataset */ type = H5Tarray_create2(H5T_NATIVE_INT, SPACE1_RANK, dims); dset = H5Dcreate2(file, "Dataset4.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); /* write out an empty compound dataset */ type = H5Tcreate(H5T_COMPOUND, sizeof(empty_struct)); @@ -3681,15 +3681,15 @@ gent_empty(void) dset = H5Dcreate2(file, "Dataset5.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(space); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(file); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3869,26 +3869,26 @@ gent_multi(void) char *sv_data = NULL; haddr_t memb_addr[H5FD_MEM_NTYPES]; - sv_data = (char *)HDcalloc(H5FD_MEM_NTYPES * 1024, sizeof(char)); - sv = (char **)HDcalloc(H5FD_MEM_NTYPES, sizeof(sv_data)); + sv_data = (char *)calloc(H5FD_MEM_NTYPES * 1024, sizeof(char)); + sv = (char **)calloc(H5FD_MEM_NTYPES, sizeof(sv_data)); for (i = 0; i < H5FD_MEM_NTYPES; i++) sv[i] = sv_data + (i * 1024); fapl = H5Pcreate(H5P_FILE_ACCESS); - HDmemset(memb_map, 0, sizeof memb_map); - HDmemset(memb_fapl, 0, sizeof memb_fapl); - HDmemset(memb_name, 0, sizeof memb_name); - HDmemset(memb_addr, 0, sizeof memb_addr); + memset(memb_map, 0, sizeof memb_map); + memset(memb_fapl, 0, sizeof memb_fapl); + memset(memb_name, 0, sizeof memb_name); + memset(memb_addr, 0, sizeof memb_addr); - HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { memb_fapl[mt] = H5P_DEFAULT; memb_map[mt] = mt; HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; - /*HDprintf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/ + /*printf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/ memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); } memb_map[H5FD_MEM_DEFAULT] = H5FD_MEM_SUPER; @@ -3914,8 +3914,8 @@ gent_multi(void) H5Fclose(fid); H5Pclose(fapl); - HDfree(sv); - HDfree(sv_data); + free(sv); + free(sv_data); } static void @@ -4157,10 +4157,10 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -4168,9 +4168,9 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4266,7 +4266,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { int l; - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf52[i][j].p)[l] = n++; @@ -4277,9 +4277,9 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf52); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52); - HDassert(status >= 0); + assert(status >= 0); status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4396,7 +4396,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { int l; - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf53[i][j][k].p)[l] = n++; @@ -4408,9 +4408,9 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf53); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53); - HDassert(status >= 0); + assert(status >= 0); status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4586,10 +4586,10 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -4597,9 +4597,9 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4695,7 +4695,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { int l; - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf52[i][j].p)[l] = n++; @@ -4705,9 +4705,9 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4832,7 +4832,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { int l; - buf53[i][j][k].p = HDmalloc(((size_t)i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc(((size_t)i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf53[i][j][k].p)[l] = n++; @@ -4842,9 +4842,9 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4915,7 +4915,7 @@ gent_attr_all(void) sid = H5Screate_simple(1, dims, NULL); did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Sclose(sid); - HDassert(status >= 0); + assert(status >= 0); /* Create groups */ group_id = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -4940,17 +4940,17 @@ gent_attr_all(void) /* Close */ status = H5Dclose(did); - HDassert(status >= 0); + assert(status >= 0); status = H5Gclose(group_id); - HDassert(status >= 0); + assert(status >= 0); status = H5Gclose(group2_id); - HDassert(status >= 0); + assert(status >= 0); status = H5Gclose(root_id); - HDassert(status >= 0); + assert(status >= 0); /* Close file */ status = H5Fclose(fid); - HDassert(status >= 0); + assert(status >= 0); } /*------------------------------------------------------------------------- @@ -5091,65 +5091,65 @@ gent_compound_complex(void) /* Create the dataspace */ dataspace = H5Screate_simple(F41_RANK, dim, NULL); - HDassert(dataspace >= 0); + assert(dataspace >= 0); /* Create the file */ datafile = H5Fcreate(FILE41, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(datafile >= 0); + assert(datafile >= 0); /* Copy the array data type for the string array */ array_tid = H5Tcopy(H5T_C_S1); - HDassert(array_tid >= 0); + assert(array_tid >= 0); /* Set the string array size to Variable */ status = H5Tset_size(array_tid, H5T_VARIABLE); - HDassert(status >= 0); + assert(status >= 0); /* Create the array data type for the string array */ str_array_id = H5Tarray_create2(array_tid, F41_ARRAY_RANK, array_dimb); - HDassert(str_array_id >= 0); + assert(str_array_id >= 0); /* Copy the array data type for the character array */ array1_tid = H5Tcopy(H5T_C_S1); - HDassert(array1_tid >= 0); + assert(array1_tid >= 0); /* Set the character array size */ status = H5Tset_size(array1_tid, F41_ARRAY_DIMc); - HDassert(status >= 0); + assert(status >= 0); /* Create the array data type for the character array */ array2_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F41_ARRAY_RANKd, array_dimd); - HDassert(array2_tid >= 0); + assert(array2_tid >= 0); /* Create the array data type for the character array */ array4_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F41_ARRAY_RANK, array_dimf); - HDassert(array4_tid >= 0); + assert(array4_tid >= 0); /* Create the memory data type */ Array1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Array1Struct)); - HDassert(Array1Structid >= 0); + assert(Array1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Array1Structid, "a_name", HOFFSET(Array1Struct, a), H5T_NATIVE_INT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "b_name", HOFFSET(Array1Struct, b), str_array_id); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "c_name", HOFFSET(Array1Struct, c), array1_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "d_name", HOFFSET(Array1Struct, d), array2_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "e_name", HOFFSET(Array1Struct, e), H5T_NATIVE_FLOAT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "f_name", HOFFSET(Array1Struct, f), array4_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "g_name", HOFFSET(Array1Struct, g), H5T_NATIVE_CHAR); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(datafile, F41_DATASETNAME, Array1Structid, dataspace, H5P_DEFAULT, H5P_DEFAULT, @@ -5157,35 +5157,35 @@ gent_compound_complex(void) /* Write data to the dataset */ status = H5Dwrite(dataset, Array1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Array1); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Array1Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array1_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array2_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array4_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(str_array_id); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(dataspace); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(datafile); - HDassert(status >= 0); + assert(status >= 0); } static void @@ -5202,7 +5202,7 @@ gent_named_dtype_attr(void) /* Create a file */ fid = H5Fcreate(FILE42, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid > 0); + assert(fid > 0); /*------------------------------------------------------------------------- * datatype @@ -5211,27 +5211,27 @@ gent_named_dtype_attr(void) /* Create a datatype to commit and use */ tid = H5Tcopy(H5T_NATIVE_INT); - HDassert(tid > 0); + assert(tid > 0); /* Commit datatype to file */ ret = H5Tcommit2(fid, F42_TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a hard link to the datatype */ ret = H5Lcreate_hard(fid, F42_TYPENAME, fid, F42_LINKNAME, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a scalar dataspace used for all objects */ sid = H5Screate(H5S_SCALAR); - HDassert(sid > 0); + assert(sid > 0); /* Create attribute on committed datatype */ aid = H5Acreate2(tid, F42_ATTRNAME, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT); - HDassert(aid > 0); + assert(aid > 0); /* Write data into the attribute */ ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset @@ -5240,15 +5240,15 @@ gent_named_dtype_attr(void) /* Create dataset */ did = H5Dcreate2(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(did > 0); + assert(did > 0); /* Create attribute on dataset */ aid = H5Acreate2(did, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - HDassert(aid > 0); + assert(aid > 0); /* Write data into the attribute */ ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * group @@ -5257,15 +5257,15 @@ gent_named_dtype_attr(void) /* Create a group */ gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(gid > 0); + assert(gid > 0); /* Create attribute on group */ aid = H5Acreate2(gid, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - HDassert(aid > 0); + assert(aid > 0); /* Write data into the attribute */ ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * close @@ -5274,23 +5274,23 @@ gent_named_dtype_attr(void) /* Close attribute */ ret = H5Aclose(aid); - HDassert(ret >= 0); + assert(ret >= 0); /* Close dataset */ ret = H5Dclose(did); - HDassert(ret >= 0); + assert(ret >= 0); /* Close dataspace */ ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); /* Close datatype */ ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); /* Close file */ ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5423,25 +5423,25 @@ make_external(hid_t fid) dcpl = H5Pcreate(H5P_DATASET_CREATE); ret = H5Pset_external(dcpl, "ext1.bin", (off_t)0, size); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_external(dcpl, "ext2.bin", (off_t)0, size); - HDassert(ret >= 0); + assert(ret >= 0); sid = H5Screate_simple(1, cur_size, max_size); - HDassert(ret >= 0); + assert(ret >= 0); dsid = H5Dcreate2(fid, "external", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); H5Dclose(dsid); - HDassert(ret >= 0); + assert(ret >= 0); H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5477,7 +5477,7 @@ gent_filters(void) /* create a file */ fid = H5Fcreate(FILE44, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Check if we support comments in the current VOL connector */ H5VLquery_optional(fid, H5VL_SUBCLS_OBJECT, H5VL_NATIVE_OBJECT_SET_COMMENT, &supports_comments); @@ -5494,40 +5494,40 @@ gent_filters(void) *------------------------------------------------------------------------- */ ret = H5Pset_layout(dcpl, H5D_COMPACT); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "compact", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) { ret = H5Oset_comment_by_name(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); } ret = H5Pset_layout(dcpl, H5D_CONTIGUOUS); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "contiguous", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) { ret = H5Oset_comment_by_name(fid, "contiguous", "This is a dataset with contiguous storage", H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); } ret = H5Pset_layout(dcpl, H5D_CHUNKED); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "chunked", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) { ret = H5Oset_comment_by_name(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5537,7 +5537,7 @@ gent_filters(void) /* set up chunk */ ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * SZIP @@ -5547,14 +5547,14 @@ gent_filters(void) if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set szip data */ ret = H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "szip", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); } #endif /* H5_HAVE_FILTER_SZIP */ @@ -5565,14 +5565,14 @@ gent_filters(void) #if defined(H5_HAVE_FILTER_DEFLATE) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set deflate data */ ret = H5Pset_deflate(dcpl, 9); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "deflate", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -5582,14 +5582,14 @@ gent_filters(void) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set the shuffle filter */ ret = H5Pset_shuffle(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "shuffle", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * checksum @@ -5598,14 +5598,14 @@ gent_filters(void) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set the checksum filter */ ret = H5Pset_fletcher32(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "fletcher32", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * nbit @@ -5614,16 +5614,16 @@ gent_filters(void) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set the checksum filter */ ret = H5Pset_nbit(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); tid = H5Tcopy(H5T_NATIVE_INT); H5Tset_precision(tid, H5Tget_size(tid) - 1); ret = make_dset(fid, "nbit", sid, tid, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * scaleoffset @@ -5632,14 +5632,14 @@ gent_filters(void) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set the scaleoffset filter */ ret = H5Pset_scaleoffset(dcpl, H5Z_SO_INT, (int)H5Tget_size(H5T_NATIVE_INT)); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "scaleoffset", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * all filters @@ -5647,37 +5647,37 @@ gent_filters(void) */ /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set the shuffle filter */ ret = H5Pset_shuffle(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); #ifdef H5_HAVE_FILTER_SZIP if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { szip_options_mask = H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK; /* set szip data */ ret = H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block); - HDassert(ret >= 0); + assert(ret >= 0); } #endif /* H5_HAVE_FILTER_SZIP */ #if defined(H5_HAVE_FILTER_DEFLATE) /* set deflate data */ ret = H5Pset_deflate(dcpl, 5); - HDassert(ret >= 0); + assert(ret >= 0); #endif /* set the checksum filter */ ret = H5Pset_fletcher32(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); /* set the nbit filter */ ret = H5Pset_nbit(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "all", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * user defined filter @@ -5685,20 +5685,20 @@ gent_filters(void) */ /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Zregister(H5Z_MYFILTER); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_filter(dcpl, MYFILTER_ID, 0, 0, NULL); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "myfilter", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * make an external dataset @@ -5711,27 +5711,27 @@ gent_filters(void) *------------------------------------------------------------------------- */ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "alloc_time_early", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_ALLOC_TIME_INCR *------------------------------------------------------------------------- */ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "alloc_time_incr", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_ALLOC_TIME_LATE *------------------------------------------------------------------------- */ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "alloc_time_late", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * commit a H5G_TYPE type with a comment @@ -5739,28 +5739,28 @@ gent_filters(void) */ tid = H5Tcopy(H5T_STD_B8LE); ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) { ret = H5Oset_comment_by_name(fid, "mytype", "This is a committed datatype", H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); } ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5825,7 +5825,7 @@ gent_fcontents(void) /* create a file */ fid = H5Fcreate(FILE46, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); write_dset(fid, 1, dims, "dset", H5T_NATIVE_INT, buf); @@ -5851,27 +5851,27 @@ gent_fcontents(void) /* hard link to "dset" */ ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* hard link to "dset" */ ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset4", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* soft link to itself */ ret = H5Lcreate_soft("mylink", fid, "mylink", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* soft link to "dset" */ ret = H5Lcreate_soft("/dset", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* dangling external link */ ret = H5Lcreate_external("fname", "oname", fid, "extlink", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* dangling udlink */ ret = H5Lcreate_ud(fid, "udlink", (H5L_type_t)MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * datatypes @@ -5879,19 +5879,19 @@ gent_fcontents(void) */ tid = H5Tcopy(H5T_NATIVE_INT); ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); /* no name datatype */ tid = H5Tcopy(H5T_NATIVE_INT); ret = H5Tcommit2(fid, "mytype2", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); write_dset(fid, 1, dims, "dsetmytype2", tid, buf); ret = H5Ldelete(fid, "mytype2", H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * close @@ -5899,14 +5899,14 @@ gent_fcontents(void) */ ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); /* create a file for the bootblock test */ fid = H5Fcreate(FILE47, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5943,7 +5943,7 @@ gent_fvalues(void) /* create a file */ fid = H5Fcreate(FILE48, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* create a space */ sid = H5Screate_simple(1, dims, NULL); @@ -5957,42 +5957,42 @@ gent_fvalues(void) *------------------------------------------------------------------------- */ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "fill_time_ifset", sid, H5T_NATIVE_INT, dcpl, buf); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_FILL_TIME_NEVER *------------------------------------------------------------------------- */ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "fill_time_never", sid, H5T_NATIVE_INT, dcpl, buf); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_FILL_TIME_ALLOC *------------------------------------------------------------------------- */ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "fill_time_alloc", sid, H5T_NATIVE_INT, dcpl, buf); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with no fill value @@ -6009,23 +6009,23 @@ gent_fvalues(void) H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(c_t, b), H5T_NATIVE_DOUBLE); ret = H5Pset_fill_value(dcpl, tid, &fillval2); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "fill_compound", sid, tid, dcpl, buf2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with a H5T_VLEN fill value *------------------------------------------------------------------------- */ buf3[0].len = 1; - buf3[0].p = HDmalloc(1 * sizeof(int)); + buf3[0].p = malloc(1 * sizeof(int)); ((int *)buf3[0].p)[0] = 1; buf3[1].len = 2; - buf3[1].p = HDmalloc(2 * sizeof(int)); + buf3[1].p = malloc(2 * sizeof(int)); ((int *)buf3[1].p)[0] = 2; ((int *)buf3[1].p)[1] = 3; @@ -6035,17 +6035,17 @@ gent_fvalues(void) fillval3.p = NULL; fillval3.len = 0; ret = H5Pset_fill_value(dcpl, tid, &fillval3); - HDassert(ret >= 0); + assert(ret >= 0); did = H5Dcreate2(fid, "fill_vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Treclaim(tid, sid, H5P_DEFAULT, buf3); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(did); ret = H5Tclose(tid); ret = H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with a H5T_ARRAY fill value @@ -6060,9 +6060,9 @@ gent_fvalues(void) *------------------------------------------------------------------------- */ ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -6105,7 +6105,7 @@ gent_string(void) /* create a file */ fid = H5Fcreate(FILE49, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /*------------------------------------------------------------------------- * str1 @@ -6114,11 +6114,11 @@ gent_string(void) tid = H5Tcopy(H5T_C_S1); ret = H5Tset_size(tid, sizeof(buf1)); - HDassert(ret >= 0); + assert(ret >= 0); write_dset(fid, 1, dims1, "str1", tid, buf1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * str2 @@ -6127,16 +6127,16 @@ gent_string(void) sid = H5Screate_simple(SPACE1_RANK, dims2, NULL); tid = H5Tcopy(H5T_C_S1); ret = H5Tset_size(tid, H5T_VARIABLE); - HDassert(ret >= 0); + assert(ret >= 0); did = H5Dcreate2(fid, "str2", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(did); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * str3 @@ -6149,13 +6149,13 @@ gent_string(void) H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_INT); H5Tinsert(tid, "str", HOFFSET(c_t, str), str_tid); ret = make_dset(fid, "str3", sid, tid, H5P_DEFAULT, &buf3); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(str_tid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * str4 @@ -6164,14 +6164,14 @@ gent_string(void) sid = H5Screate_simple(SPACE1_RANK, dims4, NULL); ret = make_dset(fid, "str4", sid, H5T_NATIVE_CHAR, H5P_DEFAULT, buf4); ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -6215,7 +6215,7 @@ gent_aindices(void) /* create a file */ fid = H5Fcreate(FILE50, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /*------------------------------------------------------------------------- * root datasets @@ -6248,7 +6248,7 @@ gent_aindices(void) *------------------------------------------------------------------------- */ ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -6269,37 +6269,37 @@ gent_longlinks(void) /* Create files */ fid = H5Fcreate(FILE51, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Create group with short name in file (used as target for hard links) */ gid = H5Gcreate2(fid, "grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(gid >= 0); + assert(gid >= 0); /* Construct very long file name */ - objname = (char *)HDmalloc((size_t)(F51_MAX_NAME_LEN + 1)); - HDassert(objname); + objname = (char *)malloc((size_t)(F51_MAX_NAME_LEN + 1)); + assert(objname); for (u = 0; u < F51_MAX_NAME_LEN; u++) objname[u] = 'a'; objname[F51_MAX_NAME_LEN] = '\0'; /* Create hard link to existing object */ - HDassert(H5Lcreate_hard(fid, "grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); + assert(H5Lcreate_hard(fid, "grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); /* Create soft link to existing object */ objname[0] = 'b'; - HDassert(H5Lcreate_soft("grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); + assert(H5Lcreate_soft("grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); /* Create group with long name in existing group */ gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(gid2 >= 0); + assert(gid2 >= 0); /* Close objects */ - HDassert(H5Gclose(gid2) >= 0); - HDassert(H5Gclose(gid) >= 0); - HDassert(H5Fclose(fid) >= 0); + assert(H5Gclose(gid2) >= 0); + assert(H5Gclose(gid) >= 0); + assert(H5Fclose(fid) >= 0); /* Release memory */ - HDfree(objname); + free(objname); } /*------------------------------------------------------------------------- @@ -6349,7 +6349,7 @@ gent_ldouble(void) return 0; error: - HDprintf("error !\n"); + printf("error !\n"); return -1; } @@ -6400,7 +6400,7 @@ gent_ldouble_scalar(void) return 0; error: - HDprintf("error !\n"); + printf("error !\n"); return -1; } @@ -6494,7 +6494,7 @@ gent_bigdims(void) /* create a file */ fid = H5Fcreate(FILE56, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* create dataset */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) @@ -6520,7 +6520,7 @@ gent_bigdims(void) if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) goto out; - buf = (char *)HDmalloc((unsigned)(nelmts * size)); + buf = (char *)malloc((unsigned)(nelmts * size)); for (i = 0, c = 0; i < nelmts; i++, c++) { buf[i] = c; @@ -6531,7 +6531,7 @@ gent_bigdims(void) if (H5Dwrite(did, H5T_NATIVE_SCHAR, m_sid, f_sid, H5P_DEFAULT, buf) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; /* close */ @@ -6552,12 +6552,12 @@ gent_bigdims(void) did = H5I_INVALID_HID; ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); return; out: - HDprintf("Error.....\n"); + printf("Error.....\n"); H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -6586,20 +6586,20 @@ gent_hyperslab(void) int i; int H5_ATTR_NDEBUG_UNUSED ret; - buf = (double *)HDmalloc(32 * 4097 * sizeof(double)); + buf = (double *)malloc(32 * 4097 * sizeof(double)); for (i = 0; i < 32 * 4097; i++) buf[i] = 1; /* create a file */ fid = H5Fcreate(FILE57, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); write_dset(fid, 2, dims, "stripmine", H5T_NATIVE_DOUBLE, buf); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); - HDfree(buf); + free(buf); } /*------------------------------------------------------------------------- @@ -6744,7 +6744,7 @@ gent_group_creation_order(void) return; out: - HDprintf("Error.....\n"); + printf("Error.....\n"); H5E_BEGIN_TRY { H5Gclose(gid); @@ -7000,7 +7000,7 @@ gent_attr_creation_order(void) return; out: - HDprintf("Error.....\n"); + printf("Error.....\n"); H5E_BEGIN_TRY { H5Gclose(gid); @@ -7479,15 +7479,15 @@ gent_packedbits(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -7733,15 +7733,15 @@ gent_attr_intsize(void) H5Gclose(root); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } static void @@ -7858,17 +7858,17 @@ gent_charsets(void) sid = H5Screate_simple(1, dim, NULL); fid = H5Fcreate(FILE68, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); status = H5Tset_cset(ascii_dtid, H5T_CSET_ASCII); - HDassert(status >= 0); + assert(status >= 0); H5Tinsert(charset_dtid, "ascii", HOFFSET(CharSetInfo, ascii_p_), ascii_dtid); status = H5Tset_cset(utf8_dtid, H5T_CSET_UTF8); - HDassert(status >= 0); + assert(status >= 0); H5Tinsert(charset_dtid, "utf8", HOFFSET(CharSetInfo, utf8_p_), utf8_dtid); did = H5Dcreate2(fid, "CharSets", charset_dtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, charset_dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, writeData); - HDassert(status >= 0); + assert(status >= 0); H5Tclose(charset_dtid); H5Tclose(ascii_dtid); @@ -7925,8 +7925,8 @@ gent_compound_intsizes(void) int m, n, o; /* Array init loop vars */ /* Allocate buffer */ - Array1 = (Array1Struct *)HDmalloc(sizeof(Array1Struct) * F70_LENGTH); - HDassert(Array1); + Array1 = (Array1Struct *)malloc(sizeof(Array1Struct) * F70_LENGTH); + assert(Array1); /* Initialize the data in the arrays/datastructure */ for (m = 0; m < F70_LENGTH; m++) { @@ -8038,128 +8038,128 @@ gent_compound_intsizes(void) /* Create the array data type for the 8 bits signed int array */ array8_tid = H5Tarray_create2(H5T_NATIVE_SCHAR, F70_ARRAY_RANK, array_dim8); - HDassert(array8_tid >= 0); + assert(array8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ array16_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F70_ARRAY_RANK, array_dim16); - HDassert(array16_tid >= 0); + assert(array16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ array32_tid = H5Tarray_create2(H5T_NATIVE_INT, F70_ARRAY_RANK, array_dim32); - HDassert(array32_tid >= 0); + assert(array32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ array64_tid = H5Tarray_create2(H5T_NATIVE_LONG, F70_ARRAY_RANK, array_dim64); - HDassert(array64_tid >= 0); + assert(array64_tid >= 0); /* Create the array data type for the 8 bits signed int array */ arrayu8_tid = H5Tarray_create2(H5T_NATIVE_UCHAR, F70_ARRAY_RANK, array_dim8); - HDassert(arrayu8_tid >= 0); + assert(arrayu8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ arrayu16_tid = H5Tarray_create2(H5T_NATIVE_USHORT, F70_ARRAY_RANK, array_dim16); - HDassert(arrayu16_tid >= 0); + assert(arrayu16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ arrayu32_tid = H5Tarray_create2(H5T_NATIVE_UINT, F70_ARRAY_RANK, array_dim32); - HDassert(arrayu32_tid >= 0); + assert(arrayu32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ arrayu64_tid = H5Tarray_create2(H5T_NATIVE_ULONG, F70_ARRAY_RANK, array_dim64); - HDassert(arrayu64_tid >= 0); + assert(arrayu64_tid >= 0); /* Create the array data type for the 32 bits double array */ arraydbl_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F70_ARRAY_RANK, array_dim8); - HDassert(arraydbl_tid >= 0); + assert(arraydbl_tid >= 0); /* Create the dataspace */ space = H5Screate_simple(F70_RANK, dim, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create the file */ fid = H5Fcreate(FILE70, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Create the memory data type */ Array1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Array1Struct)); - HDassert(Array1Structid >= 0); + assert(Array1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Array1Structid, F70_DATASETU08, HOFFSET(Array1Struct, dsetu8), arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU16, HOFFSET(Array1Struct, dsetu16), arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU32, HOFFSET(Array1Struct, dsetu32), arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU64, HOFFSET(Array1Struct, dsetu64), arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS08, HOFFSET(Array1Struct, dset8), array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS16, HOFFSET(Array1Struct, dset16), array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS32, HOFFSET(Array1Struct, dset32), array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS64, HOFFSET(Array1Struct, dset64), array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DUMMYDBL, HOFFSET(Array1Struct, dsetdbl), arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(fid, F70_DATASETNAME, Array1Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Array1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Array1); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Array1Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(fid); - HDassert(status >= 0); + assert(status >= 0); - HDfree(Array1); + free(Array1); } static void @@ -8208,7 +8208,7 @@ gent_compound_attr_intsizes(void) int m, n, o; /* Array init loop vars */ - Array1 = (Array1Struct *)HDcalloc(F70_LENGTH, sizeof(Array1Struct)); + Array1 = (Array1Struct *)calloc(F70_LENGTH, sizeof(Array1Struct)); /* Initialize the data in the arrays/datastructure */ for (m = 0; m < F70_LENGTH; m++) { @@ -8328,79 +8328,79 @@ gent_compound_attr_intsizes(void) /* Create the array data type for the 8 bits signed int array */ array8_tid = H5Tarray_create2(H5T_NATIVE_SCHAR, F70_ARRAY_RANK, array_dim8); - HDassert(array8_tid >= 0); + assert(array8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ array16_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F70_ARRAY_RANK, array_dim16); - HDassert(array16_tid >= 0); + assert(array16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ array32_tid = H5Tarray_create2(H5T_NATIVE_INT, F70_ARRAY_RANK, array_dim32); - HDassert(array32_tid >= 0); + assert(array32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ array64_tid = H5Tarray_create2(H5T_NATIVE_LONG, F70_ARRAY_RANK, array_dim64); - HDassert(array64_tid >= 0); + assert(array64_tid >= 0); /* Create the array data type for the 8 bits signed int array */ arrayu8_tid = H5Tarray_create2(H5T_NATIVE_UCHAR, F70_ARRAY_RANK, array_dim8); - HDassert(arrayu8_tid >= 0); + assert(arrayu8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ arrayu16_tid = H5Tarray_create2(H5T_NATIVE_USHORT, F70_ARRAY_RANK, array_dim16); - HDassert(arrayu16_tid >= 0); + assert(arrayu16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ arrayu32_tid = H5Tarray_create2(H5T_NATIVE_UINT, F70_ARRAY_RANK, array_dim32); - HDassert(arrayu32_tid >= 0); + assert(arrayu32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ arrayu64_tid = H5Tarray_create2(H5T_NATIVE_ULONG, F70_ARRAY_RANK, array_dim64); - HDassert(arrayu64_tid >= 0); + assert(arrayu64_tid >= 0); /* Create the array data type for the 32 bits double array */ arraydbl_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F70_ARRAY_RANK, array_dim8); - HDassert(arraydbl_tid >= 0); + assert(arraydbl_tid >= 0); /* Create the dataspace */ space = H5Screate_simple(F70_RANK, dim, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create the file */ fid = H5Fcreate(FILE71, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Create the memory data type */ Array1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Array1Struct)); - HDassert(Array1Structid >= 0); + assert(Array1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Array1Structid, F70_DATASETU08, HOFFSET(Array1Struct, dsetu8), arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU16, HOFFSET(Array1Struct, dsetu16), arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU32, HOFFSET(Array1Struct, dsetu32), arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU64, HOFFSET(Array1Struct, dsetu64), arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS08, HOFFSET(Array1Struct, dset8), array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS16, HOFFSET(Array1Struct, dset16), array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS32, HOFFSET(Array1Struct, dset32), array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS64, HOFFSET(Array1Struct, dset64), array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DUMMYDBL, HOFFSET(Array1Struct, dsetdbl), arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); root = H5Gopen2(fid, "/", H5P_DEFAULT); @@ -8409,49 +8409,49 @@ gent_compound_attr_intsizes(void) /* Write data to the attribute */ status = H5Awrite(attr, Array1Structid, Array1); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Array1Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Aclose(attr); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(fid); - HDassert(status >= 0); + assert(status >= 0); - HDfree(Array1); + free(Array1); } static void @@ -8854,15 +8854,15 @@ gent_intscalars(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -9118,15 +9118,15 @@ gent_attr_intscalars(void) H5Gclose(root); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -9229,8 +9229,8 @@ gent_compound_int_array(void) int m, n; /* Array init loop vars */ /* Allocate buffer */ - Cmpd1 = (Cmpd1Struct *)HDmalloc(sizeof(Cmpd1Struct) * F76_LENGTH); - HDassert(Cmpd1); + Cmpd1 = (Cmpd1Struct *)malloc(sizeof(Cmpd1Struct) * F76_LENGTH); + assert(Cmpd1); /* Initialize the data in the arrays/datastructure */ for (m = 0; m < F76_LENGTH; m++) { @@ -9316,128 +9316,128 @@ gent_compound_int_array(void) /* Create the array data type for the 8 bits signed int array */ array8_tid = H5Tarray_create2(H5T_NATIVE_SCHAR, F76_ARRAY_RANK, array_dim8); - HDassert(array8_tid >= 0); + assert(array8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ array16_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F76_ARRAY_RANK, array_dim16); - HDassert(array16_tid >= 0); + assert(array16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ array32_tid = H5Tarray_create2(H5T_NATIVE_INT, F76_ARRAY_RANK, array_dim32); - HDassert(array32_tid >= 0); + assert(array32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ array64_tid = H5Tarray_create2(H5T_NATIVE_LONG, F76_ARRAY_RANK, array_dim64); - HDassert(array64_tid >= 0); + assert(array64_tid >= 0); /* Create the array data type for the 8 bits signed int array */ arrayu8_tid = H5Tarray_create2(H5T_NATIVE_UCHAR, F76_ARRAY_RANK, array_dim8); - HDassert(arrayu8_tid >= 0); + assert(arrayu8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ arrayu16_tid = H5Tarray_create2(H5T_NATIVE_USHORT, F76_ARRAY_RANK, array_dim16); - HDassert(arrayu16_tid >= 0); + assert(arrayu16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ arrayu32_tid = H5Tarray_create2(H5T_NATIVE_UINT, F76_ARRAY_RANK, array_dim32); - HDassert(arrayu32_tid >= 0); + assert(arrayu32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ arrayu64_tid = H5Tarray_create2(H5T_NATIVE_ULONG, F76_ARRAY_RANK, array_dim64); - HDassert(arrayu64_tid >= 0); + assert(arrayu64_tid >= 0); /* Create the array data type for the 32 bits double array */ arraydbl_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F76_ARRAY_RANK, array_dim8); - HDassert(arraydbl_tid >= 0); + assert(arraydbl_tid >= 0); /* Create the dataspace */ space = H5Screate_simple(F76_RANK, dim, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create the file */ fid = H5Fcreate(FILE76, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Create the memory data type */ Cmpd1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Cmpd1Struct)); - HDassert(Cmpd1Structid >= 0); + assert(Cmpd1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Cmpd1Structid, F76_DATASETU08, HOFFSET(Cmpd1Struct, dsetu8), arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU16, HOFFSET(Cmpd1Struct, dsetu16), arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU32, HOFFSET(Cmpd1Struct, dsetu32), arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU64, HOFFSET(Cmpd1Struct, dsetu64), arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS08, HOFFSET(Cmpd1Struct, dset8), array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS16, HOFFSET(Cmpd1Struct, dset16), array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS32, HOFFSET(Cmpd1Struct, dset32), array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS64, HOFFSET(Cmpd1Struct, dset64), array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DUMMYDBL, HOFFSET(Cmpd1Struct, dsetdbl), arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(fid, F76_DATASETNAME, Cmpd1Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Cmpd1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Cmpd1); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Cmpd1Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(fid); - HDassert(status >= 0); + assert(status >= 0); - HDfree(Cmpd1); + free(Cmpd1); } static void @@ -9487,10 +9487,10 @@ gent_compound_ints(void) int m; /* Array init loop vars */ /* Allocate buffers */ - Cmpd1 = (Cmpd1Struct *)HDmalloc(sizeof(Cmpd1Struct) * F77_LENGTH); - HDassert(Cmpd1); - Cmpd2 = (Cmpd2Struct *)HDmalloc(sizeof(Cmpd2Struct) * F77_LENGTH); - HDassert(Cmpd2); + Cmpd1 = (Cmpd1Struct *)malloc(sizeof(Cmpd1Struct) * F77_LENGTH); + assert(Cmpd1); + Cmpd2 = (Cmpd2Struct *)malloc(sizeof(Cmpd2Struct) * F77_LENGTH); + assert(Cmpd2); /* Initialize the data in the arrays/datastructure */ for (m = 0; m < F77_LENGTH; m++) { @@ -9558,119 +9558,119 @@ gent_compound_ints(void) /* Create the dataspace */ space = H5Screate_simple(F76_RANK, dim, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create the file */ fid = H5Fcreate(FILE77, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Create the memory data type */ Cmpd1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Cmpd1Struct)); - HDassert(Cmpd1Structid >= 0); + assert(Cmpd1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Cmpd1Structid, F76_DATASETU08, HOFFSET(Cmpd1Struct, dsetu8), H5T_NATIVE_UCHAR); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU16, HOFFSET(Cmpd1Struct, dsetu16), H5T_NATIVE_USHORT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU32, HOFFSET(Cmpd1Struct, dsetu32), H5T_NATIVE_UINT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU64, HOFFSET(Cmpd1Struct, dsetu64), H5T_NATIVE_ULONG); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS08, HOFFSET(Cmpd1Struct, dset8), H5T_NATIVE_SCHAR); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS16, HOFFSET(Cmpd1Struct, dset16), H5T_NATIVE_SHORT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS32, HOFFSET(Cmpd1Struct, dset32), H5T_NATIVE_INT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS64, HOFFSET(Cmpd1Struct, dset64), H5T_NATIVE_LONG); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DUMMYDBL, HOFFSET(Cmpd1Struct, dsetdbl), H5T_NATIVE_DOUBLE); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(fid, F77_DATASETNAME1, Cmpd1Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Cmpd1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Cmpd1); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Cmpd1Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataspace */ space = H5Screate_simple(F76_RANK, dim, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create the memory data type */ Cmpd2Structid = H5Tcreate(H5T_COMPOUND, sizeof(Cmpd2Struct)); - HDassert(Cmpd2Structid >= 0); + assert(Cmpd2Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Cmpd2Structid, F76_DATASETU64, HOFFSET(Cmpd2Struct, dsetu64), H5T_NATIVE_ULONG); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETU32, HOFFSET(Cmpd2Struct, dsetu32), H5T_NATIVE_UINT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETU16, HOFFSET(Cmpd2Struct, dsetu16), H5T_NATIVE_USHORT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETU08, HOFFSET(Cmpd2Struct, dsetu8), H5T_NATIVE_UCHAR); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETS64, HOFFSET(Cmpd2Struct, dset64), H5T_NATIVE_LONG); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETS32, HOFFSET(Cmpd2Struct, dset32), H5T_NATIVE_INT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETS16, HOFFSET(Cmpd2Struct, dset16), H5T_NATIVE_SHORT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETS08, HOFFSET(Cmpd2Struct, dset8), H5T_NATIVE_SCHAR); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DUMMYDBL, HOFFSET(Cmpd2Struct, dsetdbl), H5T_NATIVE_DOUBLE); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(fid, F77_DATASETNAME2, Cmpd2Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Cmpd2Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Cmpd2); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Cmpd2Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(fid); - HDassert(status >= 0); + assert(status >= 0); - HDfree(Cmpd1); - HDfree(Cmpd2); + free(Cmpd1); + free(Cmpd2); } /*------------------------------------------------------------------------- @@ -9958,15 +9958,15 @@ gent_intattrscalars(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -10049,15 +10049,15 @@ gent_intsattrs(void) dset64 = malloc(sizeof(*dset64)); dsetdbl = malloc(sizeof(*dsetdbl)); - asetu8 = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(uint8_t)); - asetu16 = HDcalloc(F66_XDIM * F66_YDIM16, sizeof(uint16_t)); - asetu32 = HDcalloc(F66_XDIM * F66_YDIM32, sizeof(uint32_t)); - asetu64 = HDcalloc(F66_XDIM * F66_YDIM64, sizeof(uint64_t)); - aset8 = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(int8_t)); - aset16 = HDcalloc(F66_XDIM * F66_YDIM16, sizeof(int16_t)); - aset32 = HDcalloc(F66_XDIM * F66_YDIM32, sizeof(int32_t)); - aset64 = HDcalloc(F66_XDIM * F66_YDIM64, sizeof(int64_t)); - asetdbl = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(double)); + asetu8 = calloc(F66_XDIM * F66_YDIM8, sizeof(uint8_t)); + asetu16 = calloc(F66_XDIM * F66_YDIM16, sizeof(uint16_t)); + asetu32 = calloc(F66_XDIM * F66_YDIM32, sizeof(uint32_t)); + asetu64 = calloc(F66_XDIM * F66_YDIM64, sizeof(uint64_t)); + aset8 = calloc(F66_XDIM * F66_YDIM8, sizeof(int8_t)); + aset16 = calloc(F66_XDIM * F66_YDIM16, sizeof(int16_t)); + aset32 = calloc(F66_XDIM * F66_YDIM32, sizeof(int32_t)); + aset64 = calloc(F66_XDIM * F66_YDIM64, sizeof(int64_t)); + asetdbl = calloc(F66_XDIM * F66_YDIM8, sizeof(double)); fid = H5Fcreate(FILE79, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -10309,25 +10309,25 @@ gent_intsattrs(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); - - HDfree(asetu8); - HDfree(asetu16); - HDfree(asetu32); - HDfree(asetu64); - HDfree(aset8); - HDfree(aset16); - HDfree(aset32); - HDfree(aset64); - HDfree(asetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); + + free(asetu8); + free(asetu16); + free(asetu32); + free(asetu64); + free(aset8); + free(aset16); + free(aset32); + free(aset64); + free(asetdbl); } /*------------------------------------------------------------------------- @@ -10374,9 +10374,9 @@ gent_floatsattrs(void) dset64 = malloc(sizeof(*dset64)); dset128 = malloc(sizeof(*dset128)); - aset32 = HDcalloc(F89_XDIM * F89_YDIM32, sizeof(float)); - aset64 = HDcalloc(F89_XDIM * F89_YDIM64, sizeof(double)); - aset128 = HDcalloc(F89_XDIM * F89_YDIM128, sizeof(long double)); + aset32 = calloc(F89_XDIM * F89_YDIM32, sizeof(float)); + aset64 = calloc(F89_XDIM * F89_YDIM64, sizeof(double)); + aset128 = calloc(F89_XDIM * F89_YDIM128, sizeof(long double)); fid = H5Fcreate(FILE89, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -10473,13 +10473,13 @@ gent_floatsattrs(void) error: H5Fclose(fid); - HDfree(dset32); - HDfree(dset64); - HDfree(dset128); + free(dset32); + free(dset64); + free(dset128); - HDfree(aset32); - HDfree(aset64); - HDfree(aset128); + free(aset32); + free(aset64); + free(aset128); } static void @@ -10754,8 +10754,8 @@ gent_compound_complex2(void) hsize_t nelmts = F82_DIM32; /* Allocate buffer */ - buf = (compound *)HDmalloc(sizeof(compound) * F82_DIM32); - HDassert(buf); + buf = (compound *)malloc(sizeof(compound) * F82_DIM32); + assert(buf); file = H5Fcreate(FILE82, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -10930,7 +10930,7 @@ gent_compound_complex2(void) } if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - HDfprintf(stderr, "gent_tcompound_complex2 H5Dwrite failed\n"); + fprintf(stderr, "gent_tcompound_complex2 H5Dwrite failed\n"); H5Dclose(dset); } @@ -11010,7 +11010,7 @@ gent_compound_complex2(void) */ H5Fclose(file); - HDfree(buf); + free(buf); } /*------------------------------------------------------------------------- @@ -11061,7 +11061,7 @@ gent_vlenstr_array(void) if ((dset = H5Dcreate2(file, F83_DATASETNAME, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer) < 0) - HDfprintf(stderr, "gent_vlenstr_array H5Dwrite failed\n"); + fprintf(stderr, "gent_vlenstr_array H5Dwrite failed\n"); H5Dclose(dset); } @@ -11083,7 +11083,7 @@ gent_vlenstr_array(void) if ((dset = H5Dcreate2(file, F83_DATASETNAME2, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - HDfprintf(stderr, "gent_vlenstr_array H5Dwrite failed\n"); + fprintf(stderr, "gent_vlenstr_array H5Dwrite failed\n"); H5Dclose(dset); } @@ -11124,54 +11124,54 @@ gent_udfilter(void) /* create a file */ fid = H5Fcreate(FILE84, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* create a space */ sid = H5Screate_simple(SPACE2_RANK, dims1, NULL); dcpl = H5Pcreate(H5P_DATASET_CREATE); - HDassert(dcpl >= 0); + assert(dcpl >= 0); ret = H5Pset_layout(dcpl, H5D_CHUNKED); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Zregister(H5Z_DYNLIBUD); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_filter(dcpl, H5Z_FILTER_DYNLIBUD, H5Z_FLAG_MANDATORY, 0, NULL); - HDassert(ret >= 0); + assert(ret >= 0); /* create the dataset */ dsid = H5Dcreate2(fid, "dynlibud", H5T_STD_I32LE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - HDassert(dsid >= 0); + assert(dsid >= 0); /* write */ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /* close */ ret = H5Dclose(dsid); - HDassert(ret >= 0); + assert(ret >= 0); /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -11367,17 +11367,17 @@ onion_filepaths_init(const char *basename) { struct onion_filepaths *paths = NULL; - if (NULL == (paths = HDcalloc(1, sizeof(struct onion_filepaths)))) + if (NULL == (paths = calloc(1, sizeof(struct onion_filepaths)))) goto error; if (NULL == (paths->canon = HDstrdup(basename))) goto error; - if (NULL == (paths->onion = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->onion = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); - if (NULL == (paths->recovery = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->recovery = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); @@ -11385,10 +11385,10 @@ onion_filepaths_init(const char *basename) error: if (paths != NULL) { - HDfree(paths->canon); - HDfree(paths->onion); - HDfree(paths->recovery); - HDfree(paths); + free(paths->canon); + free(paths->onion); + free(paths->recovery); + free(paths); } return NULL; } @@ -11397,10 +11397,10 @@ static void onion_filepaths_destroy(struct onion_filepaths *s) { if (s) { - HDfree(s->canon); - HDfree(s->onion); - HDfree(s->recovery); - HDfree(s); + free(s->canon); + free(s->onion); + free(s->recovery); + free(s); } } diff --git a/tools/test/h5format_convert/h5fc_chk_idx.c b/tools/test/h5format_convert/h5fc_chk_idx.c index 97688ad..49fbbab 100644 --- a/tools/test/h5format_convert/h5fc_chk_idx.c +++ b/tools/test/h5format_convert/h5fc_chk_idx.c @@ -25,7 +25,7 @@ static void usage(void); static void usage(void) { - HDfprintf(stdout, "Usage: h5fc_chk_idx file_name dataset_pathname\n"); + fprintf(stdout, "Usage: h5fc_chk_idx file_name dataset_pathname\n"); } /* usage() */ /*------------------------------------------------------------------------- @@ -51,7 +51,7 @@ main(int argc, char *argv[]) /* h5fc_chk_idx fname dname */ if (argc != 3) { usage(); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* end if */ /* Duplicate the file name & dataset name */ @@ -60,40 +60,40 @@ main(int argc, char *argv[]) /* Try opening the file */ if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { - HDfprintf(stderr, "h5fc_chk_idx: unable to open the file\n"); - HDexit(EXIT_FAILURE); + fprintf(stderr, "h5fc_chk_idx: unable to open the file\n"); + exit(EXIT_FAILURE); } /* end if */ /* Open the dataset */ if ((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) { - HDfprintf(stderr, "h5fc_chk_idx: unable to open the dataset\n"); - HDexit(EXIT_FAILURE); + fprintf(stderr, "h5fc_chk_idx: unable to open the dataset\n"); + exit(EXIT_FAILURE); } /* end if */ /* Get the dataset's chunk indexing type */ if (H5Dget_chunk_index_type(did, &idx_type) < 0) { - HDfprintf(stderr, "h5fc_chk_idx: unable to get chunk index type for the dataset\n"); - HDexit(EXIT_FAILURE); + fprintf(stderr, "h5fc_chk_idx: unable to get chunk index type for the dataset\n"); + exit(EXIT_FAILURE); } /* end if */ /* Close the dataset */ if (H5Dclose(did) < 0) { - HDfprintf(stderr, "h5fc_chk_idx: unable to close the dataset\n"); - HDexit(EXIT_FAILURE); + fprintf(stderr, "h5fc_chk_idx: unable to close the dataset\n"); + exit(EXIT_FAILURE); } /* end if */ /* Close the file */ if (H5Fclose(fid) < 0) { - HDfprintf(stderr, "h5fc_chk_idx_type: cannot close the file\n"); - HDexit(EXIT_FAILURE); + fprintf(stderr, "h5fc_chk_idx_type: cannot close the file\n"); + exit(EXIT_FAILURE); } /* end if */ /* Return success when the chunk indexing type is version 1 B-tree */ if (idx_type == H5D_CHUNK_IDX_BTREE) - HDexit(EXIT_SUCCESS); + exit(EXIT_SUCCESS); else { - HDfprintf(stderr, "Error: chunk indexing type is %d\n", idx_type); - HDexit(EXIT_FAILURE); + fprintf(stderr, "Error: chunk indexing type is %d\n", idx_type); + exit(EXIT_FAILURE); } /* end if */ } /* main() */ diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c index 26ee4ca..56287cf 100644 --- a/tools/test/h5format_convert/h5fc_gentest.c +++ b/tools/test/h5format_convert/h5fc_gentest.c @@ -423,8 +423,8 @@ gen_err_level(const char *fname) goto error; /* Initialize data buffer */ - buf = (unsigned char *)HDmalloc(NUM * sizeof(unsigned char *)); - HDmemset(buf, 42, NUM * sizeof(unsigned char)); + buf = (unsigned char *)malloc(NUM * sizeof(unsigned char *)); + memset(buf, 42, NUM * sizeof(unsigned char)); /* Create the test file */ if ((fid = H5Fcreate(fname, H5F_ACC_TRUNC, fcpl, fapl)) < 0) @@ -797,7 +797,7 @@ main(void) for (i = 0; i < 8; i++) { char filename[50]; - HDmemset(filename, 0, sizeof(filename)); + memset(filename, 0, sizeof(filename)); if (!new_format) HDstrcat(filename, "old_"); HDstrcat(filename, FILENAME[i]); diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c index b05ea82..1919e5b 100644 --- a/tools/test/h5import/h5importtest.c +++ b/tools/test/h5import/h5importtest.c @@ -159,12 +159,12 @@ main(void) *------------------------------------------------------------------------- */ - sp = HDfopen("txtin8.txt", "w"); + sp = fopen("txtin8.txt", "w"); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) - (void)HDfprintf(sp, "%10u", b8i3[k][i][j]); - (void)HDfprintf(sp, "\n"); + (void)fprintf(sp, "%10u", b8i3[k][i][j]); + (void)fprintf(sp, "\n"); } } (void)HDfclose(sp); @@ -174,12 +174,12 @@ main(void) *------------------------------------------------------------------------- */ - sp = HDfopen("txtin16.txt", "w"); + sp = fopen("txtin16.txt", "w"); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) - (void)HDfprintf(sp, "%10u", b16i3[k][i][j]); - (void)HDfprintf(sp, "\n"); + (void)fprintf(sp, "%10u", b16i3[k][i][j]); + (void)fprintf(sp, "\n"); } } (void)HDfclose(sp); @@ -189,12 +189,12 @@ main(void) *------------------------------------------------------------------------- */ - sp = HDfopen("txtin32.txt", "w"); + sp = fopen("txtin32.txt", "w"); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) - (void)HDfprintf(sp, "%10d", b32i3[k][i][j]); - (void)HDfprintf(sp, "\n"); + (void)fprintf(sp, "%10d", b32i3[k][i][j]); + (void)fprintf(sp, "\n"); } } (void)HDfclose(sp); @@ -205,7 +205,7 @@ main(void) *------------------------------------------------------------------------- */ - sp = HDfopen("binin32.bin", OPEN_FLAGS); + sp = fopen("binin32.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { @@ -215,17 +215,17 @@ main(void) } (void)HDfclose(sp); - sp = HDfopen("binin32.conf", "w"); - (void)HDfprintf(sp, "PATH /int/bin/32-bit\n"); - (void)HDfprintf(sp, "INPUT-CLASS IN\n"); - (void)HDfprintf(sp, "INPUT-SIZE 32\n"); - (void)HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void)HDfprintf(sp, "RANK 3\n"); - (void)HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void)HDfprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); - (void)HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n"); - (void)HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n"); - (void)HDfprintf(sp, "\n"); + sp = fopen("binin32.conf", "w"); + (void)fprintf(sp, "PATH /int/bin/32-bit\n"); + (void)fprintf(sp, "INPUT-CLASS IN\n"); + (void)fprintf(sp, "INPUT-SIZE 32\n"); + (void)fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void)fprintf(sp, "RANK 3\n"); + (void)fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void)fprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); + (void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n"); + (void)fprintf(sp, "\n"); (void)HDfclose(sp); /*------------------------------------------------------------------------- @@ -233,7 +233,7 @@ main(void) *------------------------------------------------------------------------- */ - sp = HDfopen("binuin32.bin", OPEN_FLAGS); + sp = fopen("binuin32.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { @@ -243,16 +243,16 @@ main(void) } (void)HDfclose(sp); - sp = HDfopen("binuin32.conf", "w"); - (void)HDfprintf(sp, "PATH /int/buin/32-bit\n"); - (void)HDfprintf(sp, "INPUT-CLASS UIN\n"); - (void)HDfprintf(sp, "INPUT-SIZE 32\n"); - (void)HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void)HDfprintf(sp, "RANK 3\n"); - (void)HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void)HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); - (void)HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n"); - (void)HDfprintf(sp, "\n"); + sp = fopen("binuin32.conf", "w"); + (void)fprintf(sp, "PATH /int/buin/32-bit\n"); + (void)fprintf(sp, "INPUT-CLASS UIN\n"); + (void)fprintf(sp, "INPUT-SIZE 32\n"); + (void)fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void)fprintf(sp, "RANK 3\n"); + (void)fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void)fprintf(sp, "\n"); (void)HDfclose(sp); /*------------------------------------------------------------------------- @@ -260,7 +260,7 @@ main(void) *------------------------------------------------------------------------- */ - sp = HDfopen("binin16.bin", OPEN_FLAGS); + sp = fopen("binin16.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { @@ -270,25 +270,25 @@ main(void) } (void)HDfclose(sp); - sp = HDfopen("binin16.conf", "w"); - (void)HDfprintf(sp, "PATH /int/bin/16-bit\n"); - (void)HDfprintf(sp, "INPUT-CLASS IN\n"); - (void)HDfprintf(sp, "INPUT-SIZE 16\n"); - (void)HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void)HDfprintf(sp, "RANK 3\n"); - (void)HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void)HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); - (void)HDfprintf(sp, "DIMENSION-SIZES 2 3 4\n"); - (void)HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); - (void)HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); - (void)HDfprintf(sp, "\n"); + sp = fopen("binin16.conf", "w"); + (void)fprintf(sp, "PATH /int/bin/16-bit\n"); + (void)fprintf(sp, "INPUT-CLASS IN\n"); + (void)fprintf(sp, "INPUT-SIZE 16\n"); + (void)fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void)fprintf(sp, "RANK 3\n"); + (void)fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void)fprintf(sp, "DIMENSION-SIZES 2 3 4\n"); + (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); + (void)fprintf(sp, "\n"); (void)HDfclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binuin16.bin -c binuin16.conf -o binuin16.h5 *------------------------------------------------------------------------- */ - sp = HDfopen("binuin16.bin", OPEN_FLAGS); + sp = fopen("binuin16.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { @@ -298,18 +298,18 @@ main(void) } (void)HDfclose(sp); - sp = HDfopen("binuin16.conf", "w"); - (void)HDfprintf(sp, "PATH /int/buin/16-bit\n"); - (void)HDfprintf(sp, "INPUT-CLASS UIN\n"); - (void)HDfprintf(sp, "INPUT-SIZE 16\n"); - (void)HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void)HDfprintf(sp, "RANK 3\n"); - (void)HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void)HDfprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); - (void)HDfprintf(sp, "DIMENSION-SIZES 2 3 4\n"); - (void)HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); - (void)HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); - (void)HDfprintf(sp, "\n"); + sp = fopen("binuin16.conf", "w"); + (void)fprintf(sp, "PATH /int/buin/16-bit\n"); + (void)fprintf(sp, "INPUT-CLASS UIN\n"); + (void)fprintf(sp, "INPUT-SIZE 16\n"); + (void)fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void)fprintf(sp, "RANK 3\n"); + (void)fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void)fprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); + (void)fprintf(sp, "DIMENSION-SIZES 2 3 4\n"); + (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); + (void)fprintf(sp, "\n"); (void)HDfclose(sp); /*------------------------------------------------------------------------- @@ -317,7 +317,7 @@ main(void) *------------------------------------------------------------------------- */ - sp = HDfopen("binin8.bin", OPEN_FLAGS); + sp = fopen("binin8.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { @@ -327,21 +327,21 @@ main(void) } (void)HDfclose(sp); - sp = HDfopen("binin8.conf", "w"); - (void)HDfprintf(sp, "PATH /int/bin/8-bit\n"); - (void)HDfprintf(sp, "INPUT-CLASS IN\n"); - (void)HDfprintf(sp, "INPUT-SIZE 8\n"); - (void)HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void)HDfprintf(sp, "RANK 3\n"); - (void)HDfprintf(sp, "OUTPUT-CLASS IN\n"); - (void)HDfprintf(sp, "OUTPUT-SIZE 16\n"); - (void)HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void)HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); - (void)HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n"); - (void)HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); - (void)HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n"); - (void)HDfprintf(sp, "COMPRESSION-PARAM 3\n"); - (void)HDfprintf(sp, "\n"); + sp = fopen("binin8.conf", "w"); + (void)fprintf(sp, "PATH /int/bin/8-bit\n"); + (void)fprintf(sp, "INPUT-CLASS IN\n"); + (void)fprintf(sp, "INPUT-SIZE 8\n"); + (void)fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void)fprintf(sp, "RANK 3\n"); + (void)fprintf(sp, "OUTPUT-CLASS IN\n"); + (void)fprintf(sp, "OUTPUT-SIZE 16\n"); + (void)fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n"); + (void)fprintf(sp, "COMPRESSION-PARAM 3\n"); + (void)fprintf(sp, "\n"); (void)HDfclose(sp); #endif /* UNICOS */ @@ -355,7 +355,7 @@ main(void) * binary 64-bit file - rank 2 & 3 */ - sp = HDfopen("binfp64.bin", OPEN_FLAGS); + sp = fopen("binfp64.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { @@ -365,19 +365,19 @@ main(void) } (void)HDfclose(sp); - sp = HDfopen("binfp64.conf", "w"); - (void)HDfprintf(sp, "PATH /fp/bin/64-bit\n"); - (void)HDfprintf(sp, "INPUT-CLASS FP\n"); - (void)HDfprintf(sp, "INPUT-SIZE 64\n"); - (void)HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void)HDfprintf(sp, "RANK 3\n"); - (void)HDfprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n"); - (void)HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); - (void)HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n"); - (void)HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); - (void)HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n"); - (void)HDfprintf(sp, "COMPRESSION-PARAM 8\n"); - (void)HDfprintf(sp, "\n"); + sp = fopen("binfp64.conf", "w"); + (void)fprintf(sp, "PATH /fp/bin/64-bit\n"); + (void)fprintf(sp, "INPUT-CLASS FP\n"); + (void)fprintf(sp, "INPUT-SIZE 64\n"); + (void)fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void)fprintf(sp, "RANK 3\n"); + (void)fprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n"); + (void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void)fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void)fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void)fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n"); + (void)fprintf(sp, "COMPRESSION-PARAM 8\n"); + (void)fprintf(sp, "\n"); (void)HDfclose(sp); /*------------------------------------------------------------------------- @@ -389,25 +389,25 @@ main(void) /* test CR+LF (13,10) and EOF (26) in windows */ char bin8w[4] = {13, 10, 26, 0}; - sp = HDfopen("binin8w.bin", OPEN_FLAGS); + sp = fopen("binin8w.bin", OPEN_FLAGS); for (i = 0; i < 4; i++) { char c = bin8w[i]; if (HDfwrite(&c, sizeof(char), 1, sp) != 1) - HDprintf("error writing file\n"); + printf("error writing file\n"); } HDfclose(sp); - sp = HDfopen("binin8w.conf", "w"); - (void)HDfprintf(sp, "INPUT-CLASS IN\n"); - (void)HDfprintf(sp, "INPUT-SIZE 8\n"); - (void)HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void)HDfprintf(sp, "RANK 1\n"); - (void)HDfprintf(sp, "OUTPUT-CLASS IN\n"); - (void)HDfprintf(sp, "OUTPUT-SIZE 8\n"); - (void)HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void)HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); - (void)HDfprintf(sp, "DIMENSION-SIZES 4\n"); - (void)HDfprintf(sp, "\n"); + sp = fopen("binin8w.conf", "w"); + (void)fprintf(sp, "INPUT-CLASS IN\n"); + (void)fprintf(sp, "INPUT-SIZE 8\n"); + (void)fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void)fprintf(sp, "RANK 1\n"); + (void)fprintf(sp, "OUTPUT-CLASS IN\n"); + (void)fprintf(sp, "OUTPUT-SIZE 8\n"); + (void)fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void)fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void)fprintf(sp, "DIMENSION-SIZES 4\n"); + (void)fprintf(sp, "\n"); (void)HDfclose(sp); } return (EXIT_SUCCESS); diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index c01df38..96ee5cd 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -35,9 +35,9 @@ static struct h5_long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file static void usage(const char *prog) { - HDfflush(stdout); - HDfprintf(stdout, "usage: %s -c nb file] \n", prog); - HDfprintf(stdout, " print first 'nb' byts of file to stdoug.\n"); + fflush(stdout); + fprintf(stdout, "usage: %s -c nb file] \n", prog); + fprintf(stdout, " print first 'nb' byts of file to stdoug.\n"); } /*------------------------------------------------------------------------- @@ -64,14 +64,14 @@ parse_command_line(int argc, const char *const *argv) case '?': default: usage(h5tools_getprogname()); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* end switch */ } /* end while */ if (argc <= H5_optind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* end if */ } /* end parse_command_line() */ @@ -120,7 +120,7 @@ main(int argc, char *argv[]) goto error; } /* end if */ - if (NULL == (buf = (char *)HDmalloc((unsigned)(size + 1)))) { + if (NULL == (buf = (char *)malloc((unsigned)(size + 1)))) { error_msg("can't allocate buffer \n"); goto error; } /* end if */ @@ -137,15 +137,15 @@ main(int argc, char *argv[]) } /* end if */ /* close things and exit */ - HDfree(filename); - HDfree(buf); + free(filename); + free(buf); HDclose(fd); return EXIT_SUCCESS; error: - HDfree(filename); - HDfree(buf); + free(filename); + free(buf); if (fd >= 0) HDclose(fd); return EXIT_FAILURE; diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index bfeb92d..3bb332c 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -326,7 +326,7 @@ gent_ub(const char *filename, size_t ub_size, size_t ub_fill) goto error; /* Fill buf with pattern */ - HDmemset(buf, '\0', ub_size); + memset(buf, '\0', ub_size); bp = buf; for (u = 0; u < ub_fill; u++) *bp++ = pattern[u % 10]; @@ -369,7 +369,7 @@ create_textfile(const char *name, size_t size) if ((fd = HDcreat(name, 0777)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc(size, 1))) + if (NULL == (buf = (char *)calloc(size, 1))) goto error; /* Fill buf with pattern */ @@ -380,13 +380,13 @@ create_textfile(const char *name, size_t size) if (HDwrite(fd, buf, size) < 0) goto error; - HDfree(buf); + free(buf); HDclose(fd); return SUCCEED; error: - HDfree(buf); + free(buf); if (fd >= 0) HDclose(fd); @@ -420,6 +420,6 @@ main(void) return EXIT_SUCCESS; error: - HDfprintf(stderr, "h5jam test generator FAILED\n"); + fprintf(stderr, "h5jam test generator FAILED\n"); return EXIT_FAILURE; } diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index d0e717a..501ecc5 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -37,11 +37,11 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, static void usage(const char *prog) { - HDfflush(stdout); - HDfprintf(stdout, "usage: %s h5_file\n", prog); - HDfprintf(stdout, " Check that h5_fil is HDF5 file and print size of user block \n"); - HDfprintf(stdout, " %s -h\n", prog); - HDfprintf(stdout, " Print a usage message and exit\n"); + fflush(stdout); + fprintf(stdout, "usage: %s h5_file\n", prog); + fprintf(stdout, " Check that h5_fil is HDF5 file and print size of user block \n"); + fprintf(stdout, " %s -h\n", prog); + fprintf(stdout, " Print a usage message and exit\n"); } /* end usage() */ /*------------------------------------------------------------------------- @@ -85,7 +85,7 @@ static void leave(int ret) { h5tools_close(); - HDexit(ret); + exit(ret); } /*------------------------------------------------------------------------- @@ -156,7 +156,7 @@ main(int argc, char *argv[]) goto done; } - HDprintf("%ld\n", (long)usize); + printf("%ld\n", (long)usize); done: H5Pclose(plist); diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c index bc22e8d..8910abb 100644 --- a/tools/test/h5repack/h5repackgentest.c +++ b/tools/test/h5repack/h5repackgentest.c @@ -329,19 +329,19 @@ main(void) for (i = 0; i < 2; i++) { hbool_t external = (i & 1) ? TRUE : FALSE; if (generate_int32le_1d(external) < 0) - HDprintf("A generate_int32le_1d failed!\n"); + printf("A generate_int32le_1d failed!\n"); if (generate_int32le_2d(external) < 0) - HDprintf("A generate_int32le_2d failed!\n"); + printf("A generate_int32le_2d failed!\n"); if (generate_int32le_3d(external) < 0) - HDprintf("A generate_int32le_3d failed!\n"); + printf("A generate_int32le_3d failed!\n"); if (generate_uint8be(external) < 0) - HDprintf("A generate_uint8be failed!\n"); + printf("A generate_uint8be failed!\n"); if (generate_f32le(external) < 0) - HDprintf("A generate_f32le failed!\n"); + printf("A generate_f32le failed!\n"); } /* end for external data storage or not */ diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index d8a4732..1c47827 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -194,8 +194,8 @@ main(void) h5tools_init(); /* initialize */ - HDmemset(&diff_options, 0, sizeof(diff_opt_t)); - HDmemset(&pack_options, 0, sizeof(pack_opt_t)); + memset(&diff_options, 0, sizeof(diff_opt_t)); + memset(&pack_options, 0, sizeof(pack_opt_t)); /* run tests */ puts("Testing h5repack:"); @@ -222,7 +222,7 @@ main(void) */ TESTING(" files with file space info setting--no options (-S, -P, -T, -G) are set"); j = 0; /* #0 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; @@ -239,7 +239,7 @@ main(void) TESTING(" files with file space info setting--all options -S, -P, -T, -G are set"); ++j; /* #1 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; @@ -259,7 +259,7 @@ main(void) TESTING(" files with file space info setting--options -S and -T are set"); ++j; /* #2 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; @@ -278,7 +278,7 @@ main(void) if (h5_using_default_driver(NULL)) { TESTING(" files with file space info setting-- options -S and -P are set & -L"); ++j; /* #3 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; @@ -296,7 +296,7 @@ main(void) TESTING(" files with file space info setting-- options -P and -T are set & -L"); ++j; /* #4 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; @@ -314,7 +314,7 @@ main(void) TESTING(" files with file space info setting-- options -S and -G are set & -L"); ++j; /* #5 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; @@ -332,7 +332,7 @@ main(void) TESTING(" files with file space info setting-- options -S, -P, -T, -G are set"); ++j; /* #6 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; @@ -352,7 +352,7 @@ main(void) TESTING(" files with file space info setting-- options -S, -T, -G are set & -L"); ++j; /* #7 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; @@ -2040,7 +2040,7 @@ make_testfiles(void) * default: strategy=FSM_AGGR, persist=FALSE, threshold=1 * default: inpage=4096 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2061,7 +2061,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2080,7 +2080,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2103,7 +2103,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_page_size(fcpl, (hsize_t)8192) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2125,7 +2125,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_page_size(fcpl, (hsize_t)FS_PAGESIZE_DEF) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2145,7 +2145,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_AGGR, FALSE, (hsize_t)1) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2168,7 +2168,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_page_size(fcpl, (hsize_t)8192) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2505,7 +2505,7 @@ make_szip(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2517,7 +2517,7 @@ error: } H5E_END_TRY; - HDfree(buf); + free(buf); return -1; } @@ -2590,7 +2590,7 @@ make_deflate(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2602,7 +2602,7 @@ error: } H5E_END_TRY; - HDfree(buf); + free(buf); return -1; } @@ -2660,7 +2660,7 @@ make_shuffle(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2672,7 +2672,7 @@ error: } H5E_END_TRY; - HDfree(buf); + free(buf); return -1; } @@ -2733,7 +2733,7 @@ make_fletcher32(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2745,7 +2745,7 @@ error: } H5E_END_TRY; - HDfree(buf); + free(buf); return -1; } @@ -2838,7 +2838,7 @@ make_nbit(hid_t loc_id) if (H5Tclose(dtid) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2853,7 +2853,7 @@ error: } H5E_END_TRY; - HDfree(buf); + free(buf); return -1; } @@ -2940,7 +2940,7 @@ make_scaleoffset(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2955,7 +2955,7 @@ error: } H5E_END_TRY; - HDfree(buf); + free(buf); return -1; } @@ -3124,7 +3124,7 @@ make_all_filters(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -3139,7 +3139,7 @@ error: } H5E_END_TRY; - HDfree(buf); + free(buf); return -1; } @@ -3321,7 +3321,7 @@ make_layout(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -3333,7 +3333,7 @@ error: } H5E_END_TRY; - HDfree(buf); + free(buf); return -1; } @@ -3406,7 +3406,7 @@ error: } H5E_END_TRY; - HDfree(s_buf); + free(s_buf); return (ret_value); @@ -3533,8 +3533,8 @@ make_layout3(hid_t loc_id) if (H5Pclose(dcpl3) < 0) goto error; - HDfree(buf1); - HDfree(buf2); + free(buf1); + free(buf2); return 0; @@ -3549,8 +3549,8 @@ error: } H5E_END_TRY; - HDfree(buf1); - HDfree(buf2); + free(buf1); + free(buf2); return -1; } @@ -3656,14 +3656,14 @@ make_big(hid_t loc_id) goto out; /* initialize buffer to 0 */ - buf = (signed char *)HDcalloc(nelmts, size); + buf = (signed char *)calloc(nelmts, size); if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, hs_start, NULL, hs_size, NULL) < 0) goto out; if (H5Dwrite(did, H5T_NATIVE_SCHAR, m_sid, f_sid, H5P_DEFAULT, buf) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; /* close */ @@ -3787,7 +3787,7 @@ make_userblock(void) /* Write userblock data */ nwritten = HDwrite(fd, ub, (size_t)USERBLOCK_SIZE); - HDassert(nwritten == USERBLOCK_SIZE); + assert(nwritten == USERBLOCK_SIZE); /* Close file */ HDclose(fd); @@ -3852,7 +3852,7 @@ verify_userblock(const char *filename) /* Read userblock data */ nread = HDread(fd, ub, (size_t)USERBLOCK_SIZE); - HDassert(nread == USERBLOCK_SIZE); + assert(nread == USERBLOCK_SIZE); /* Verify userblock data */ for (u = 0; u < USERBLOCK_SIZE; u++) @@ -3902,7 +3902,7 @@ make_userblock_file(void) /* write userblock data */ nwritten = HDwrite(fd, ub, (size_t)USERBLOCK_SIZE); - HDassert(nwritten == USERBLOCK_SIZE); + assert(nwritten == USERBLOCK_SIZE); /* close file */ HDclose(fd); @@ -4116,10 +4116,10 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -4175,10 +4175,10 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* allocate and initialize array data to write */ size = (TEST_BUFSIZE / sizeof(double) + 1) * sizeof(double); - dbuf = (double *)HDmalloc(size); + dbuf = (double *)malloc(size); if (NULL == dbuf) { - HDprintf("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", - (int)size / 1000000); + printf("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", + (int)size / 1000000); goto out; } @@ -4192,16 +4192,16 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* create a type larger than TEST_BUFSIZE */ if ((tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims)) < 0) { - HDfree(dbuf); + free(dbuf); goto out; } size = H5Tget_size(tid); if ((sid = H5Screate_simple(1, sdims, NULL)) < 0) { - HDfree(dbuf); + free(dbuf); goto out; } if ((did = H5Dcreate2(loc_id, "arrayd", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - HDfree(dbuf); + free(dbuf); goto out; } #if defined(WRITE_ARRAY) @@ -4212,7 +4212,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da H5Dclose(did); H5Tclose(tid); H5Sclose(sid); - HDfree(dbuf); + free(dbuf); } /*------------------------------------------------------------------------- @@ -4243,7 +4243,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if (make_diffs) { - HDmemset(buf12, 'z', sizeof buf12); + memset(buf12, 'z', sizeof buf12); } if ((tid = H5Tcopy(H5T_C_S1)) < 0) @@ -4261,7 +4261,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if (make_diffs) { - HDmemset(buf22, 0, sizeof buf22); + memset(buf22, 0, sizeof buf22); } if ((tid = H5Tcopy(H5T_STD_B8LE)) < 0) @@ -4290,7 +4290,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if (make_diffs) { - HDmemset(buf32, 0, sizeof buf32); + memset(buf32, 0, sizeof buf32); } if ((tid = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) < 0) @@ -4343,7 +4343,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { unsigned l; - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -4377,7 +4377,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if (make_diffs) { - HDmemset(buf62, 0, sizeof buf62); + memset(buf62, 0, sizeof buf62); } if ((tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray)) < 0) @@ -4393,8 +4393,8 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if (make_diffs) { - HDmemset(buf72, 0, sizeof buf72); - HDmemset(buf82, 0, sizeof buf82); + memset(buf72, 0, sizeof buf72); + memset(buf82, 0, sizeof buf82); } if ((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) @@ -4431,7 +4431,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if (make_diffs) { - HDmemset(buf13, 'z', sizeof buf13); + memset(buf13, 'z', sizeof buf13); } if ((tid = H5Tcopy(H5T_C_S1)) < 0) @@ -4552,7 +4552,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { unsigned l; - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -4676,8 +4676,8 @@ make_dset_reg_ref(hid_t loc_id) int retval = -1; /* return value */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - dwbuf = (int *)HDmalloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + dwbuf = (int *)malloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2); /* Create dataspace for datasets */ if ((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0) @@ -4738,9 +4738,9 @@ make_dset_reg_ref(hid_t loc_id) out: if (wbuf) - HDfree(wbuf); + free(wbuf); if (dwbuf) - HDfree(dwbuf); + free(dwbuf); H5E_BEGIN_TRY { @@ -5008,10 +5008,10 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -5124,7 +5124,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da *------------------------------------------------------------------------- */ if (make_diffs) { - HDmemset(buf12, 'z', sizeof buf12); + memset(buf12, 'z', sizeof buf12); } /* @@ -5163,7 +5163,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if (make_diffs) { - HDmemset(buf22, 0, sizeof buf22); + memset(buf22, 0, sizeof buf22); } /* @@ -5221,7 +5221,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da *------------------------------------------------------------------------- */ if (make_diffs) { - HDmemset(buf32, 0, sizeof buf32); + memset(buf32, 0, sizeof buf32); } /* @@ -5314,7 +5314,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { unsigned l; - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -5366,7 +5366,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if (make_diffs) { - HDmemset(buf62, 0, sizeof buf62); + memset(buf62, 0, sizeof buf62); } /* buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; @@ -5408,8 +5408,8 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if (make_diffs) { - HDmemset(buf72, 0, sizeof buf72); - HDmemset(buf82, 0, sizeof buf82); + memset(buf72, 0, sizeof buf72); + memset(buf82, 0, sizeof buf82); } /* Attribute: <integer2D> and <integer2D> @@ -5449,7 +5449,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if (make_diffs) { - HDmemset(buf13, 'z', sizeof buf13); + memset(buf13, 'z', sizeof buf13); } /* @@ -5759,7 +5759,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { unsigned l; - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)i + 1; for (l = 0; l < i + 1; l++) if (make_diffs) @@ -6202,7 +6202,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id) /* ref to dset */ status = H5Rcreate(&data_attr_objref[0], file_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6210,7 +6210,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id) /* ref to group */ status = H5Rcreate(&data_attr_objref[1], file_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6218,7 +6218,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id) /* ref to datatype */ status = H5Rcreate(&data_attr_objref[2], file_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6226,7 +6226,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id) /* create attr with obj ref type */ status = make_attr(obj_id, 1, dim_attr_objref, "Attr_OBJREF", H5T_STD_REF_OBJ, data_attr_objref); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> make_attr failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6266,7 +6266,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id) */ sid_regrefed_dset = H5Screate_simple(2, dim_regrefed_dset, NULL); if (sid_regrefed_dset < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6274,7 +6274,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id) /* select elements space for reference */ status = H5Sselect_elements(sid_regrefed_dset, H5S_SELECT_SET, (size_t)3, coords_regrefed_dset[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6282,7 +6282,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id) /* create region reference from elements space */ status = H5Rcreate(&data_attr_regref[0], file_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_regrefed_dset); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6290,7 +6290,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id) /* create attr with region ref type */ status = make_attr(obj_id, 1, dim_attr_regref, "Attr_REGREF", H5T_STD_REF_DSETREG, data_attr_regref); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> make_attr failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6335,21 +6335,21 @@ gen_refered_objs(hid_t loc_id) */ sid = H5Screate_simple(1, dims1, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } did1 = H5Dcreate2(loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (did1 < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6360,7 +6360,7 @@ gen_refered_objs(hid_t loc_id) */ gid = H5Gcreate2(loc_id, NAME_OBJ_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6372,7 +6372,7 @@ gen_refered_objs(hid_t loc_id) tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6383,7 +6383,7 @@ gen_refered_objs(hid_t loc_id) */ sid2 = H5Screate_simple(2, dims2, NULL); if (sid2 < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6391,7 +6391,7 @@ gen_refered_objs(hid_t loc_id) /* create normal dataset which is referred */ did2 = H5Dcreate2(loc_id, NAME_OBJ_DS2, H5T_STD_I8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (did2 < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6399,7 +6399,7 @@ gen_refered_objs(hid_t loc_id) /* write values to dataset */ status = H5Dwrite(did2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6455,7 +6455,7 @@ gen_obj_ref(hid_t loc_id) /* obj ref to dataset */ status = H5Rcreate(&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6463,7 +6463,7 @@ gen_obj_ref(hid_t loc_id) /* obj ref to group */ status = H5Rcreate(&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6471,7 +6471,7 @@ gen_obj_ref(hid_t loc_id) /* obj ref to named-datatype */ status = H5Rcreate(&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6481,21 +6481,21 @@ gen_obj_ref(hid_t loc_id) */ sid = H5Screate_simple(1, dims_dset_objref, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } oid = H5Dcreate2(loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, objref_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6507,7 +6507,7 @@ gen_obj_ref(hid_t loc_id) /* add attribute with obj ref */ status = add_attr_with_objref(loc_id, oid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6515,7 +6515,7 @@ gen_obj_ref(hid_t loc_id) /* add attribute with region ref */ status = add_attr_with_regref(loc_id, oid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6567,7 +6567,7 @@ gen_region_ref(hid_t loc_id) sid_trg = H5Screate_simple(2, dims_trg, NULL); if (sid_trg < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6575,7 +6575,7 @@ gen_region_ref(hid_t loc_id) /* select elements space for reference */ status = H5Sselect_elements(sid_trg, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6583,7 +6583,7 @@ gen_region_ref(hid_t loc_id) /* create region reference from elements space */ status = H5Rcreate(&rr_data[0], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6591,7 +6591,7 @@ gen_region_ref(hid_t loc_id) /* select hyperslab space for reference */ status = H5Sselect_hyperslab(sid_trg, H5S_SELECT_SET, start, stride, count, block); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6599,7 +6599,7 @@ gen_region_ref(hid_t loc_id) /* create region reference from hyperslab space */ status = H5Rcreate(&rr_data[1], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6607,7 +6607,7 @@ gen_region_ref(hid_t loc_id) /* Create dataspace. */ sid_ref = H5Screate_simple(1, dims1, NULL); if (sid_ref < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6616,7 +6616,7 @@ gen_region_ref(hid_t loc_id) oid_ref = H5Dcreate2(loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid_ref, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid_ref < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6624,7 +6624,7 @@ gen_region_ref(hid_t loc_id) /* write data as region references */ status = H5Dwrite(oid_ref, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6636,7 +6636,7 @@ gen_region_ref(hid_t loc_id) /* add attribute with obj ref */ status = add_attr_with_objref(loc_id, oid_ref); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6644,7 +6644,7 @@ gen_region_ref(hid_t loc_id) /* add attribute with region ref */ status = add_attr_with_regref(loc_id, oid_ref); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6677,21 +6677,21 @@ make_references(hid_t loc_id) /* add target objects */ status = gen_refered_objs(loc_id); if (status == FAIL) { - HDfprintf(stderr, "Failed to generate referenced object.\n"); + fprintf(stderr, "Failed to generate referenced object.\n"); ret = FAIL; } /* add object reference */ status = gen_obj_ref(loc_id); if (status == FAIL) { - HDfprintf(stderr, "Failed to generate object reference.\n"); + fprintf(stderr, "Failed to generate object reference.\n"); ret = FAIL; } /* add region reference */ status = gen_region_ref(loc_id); if (status == FAIL) { - HDfprintf(stderr, "Failed to generate region reference.\n"); + fprintf(stderr, "Failed to generate region reference.\n"); ret = FAIL; } @@ -6811,7 +6811,7 @@ make_complex_attr_references(hid_t loc_id) objdid = H5Dcreate2(loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, objsid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(objdid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6820,7 +6820,7 @@ make_complex_attr_references(hid_t loc_id) objtid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, objtid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6831,7 +6831,7 @@ make_complex_attr_references(hid_t loc_id) * compound type which contain obj and region reference */ main_gid = H5Gcreate2(loc_id, "group_main", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (main_gid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6846,7 +6846,7 @@ make_complex_attr_references(hid_t loc_id) status = H5Dwrite(main_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6869,7 +6869,7 @@ make_complex_attr_references(hid_t loc_id) /* references to dataset */ status = H5Rcreate(&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6878,7 +6878,7 @@ make_complex_attr_references(hid_t loc_id) /* references to group */ status = H5Rcreate(&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6887,7 +6887,7 @@ make_complex_attr_references(hid_t loc_id) /* references to datatype */ status = H5Rcreate(&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6901,7 +6901,7 @@ make_complex_attr_references(hid_t loc_id) H5Acreate2(main_did, "Comp_OBJREF", comp_objref_tid, comp_objref_attr_sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(comp_objref_aid, comp_objref_tid, comp_objref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6922,13 +6922,13 @@ make_complex_attr_references(hid_t loc_id) */ status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Rcreate(&(comp_regref_data[0].val_regref), loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6942,7 +6942,7 @@ make_complex_attr_references(hid_t loc_id) H5Acreate2(main_did, "Comp_REGREF", comp_regref_tid, comp_regref_attr_sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(comp_regref_aid, comp_regref_tid, comp_regref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6954,11 +6954,11 @@ make_complex_attr_references(hid_t loc_id) * prepare vlen data */ vlen_objref_data[0].len = LEN0_VLEN_OBJREF; - vlen_objref_data[0].p = HDmalloc(vlen_objref_data[0].len * sizeof(hobj_ref_t)); + vlen_objref_data[0].p = malloc(vlen_objref_data[0].len * sizeof(hobj_ref_t)); vlen_objref_data[1].len = LEN1_VLEN_OBJREF; - vlen_objref_data[1].p = HDmalloc(vlen_objref_data[1].len * sizeof(hobj_ref_t)); + vlen_objref_data[1].p = malloc(vlen_objref_data[1].len * sizeof(hobj_ref_t)); vlen_objref_data[2].len = LEN2_VLEN_OBJREF; - vlen_objref_data[2].p = HDmalloc(vlen_objref_data[2].len * sizeof(hobj_ref_t)); + vlen_objref_data[2].p = malloc(vlen_objref_data[2].len * sizeof(hobj_ref_t)); /* * create obj references @@ -6967,7 +6967,7 @@ make_complex_attr_references(hid_t loc_id) status = H5Rcreate(&((hobj_ref_t *)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6975,7 +6975,7 @@ make_complex_attr_references(hid_t loc_id) status = H5Rcreate(&((hobj_ref_t *)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6983,7 +6983,7 @@ make_complex_attr_references(hid_t loc_id) status = H5Rcreate(&((hobj_ref_t *)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -7001,7 +7001,7 @@ make_complex_attr_references(hid_t loc_id) H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(vlen_objref_attr_id, vlen_objref_attr_tid, vlen_objref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -7009,7 +7009,7 @@ make_complex_attr_references(hid_t loc_id) /* close resource for vlen data */ status = H5Treclaim(vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, vlen_objref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -7022,21 +7022,21 @@ make_complex_attr_references(hid_t loc_id) * prepare vlen data */ vlen_regref_data[0].len = LEN0_VLEN_REGREF; - vlen_regref_data[0].p = HDmalloc(vlen_regref_data[0].len * sizeof(hdset_reg_ref_t)); + vlen_regref_data[0].p = malloc(vlen_regref_data[0].len * sizeof(hdset_reg_ref_t)); /* * create region reference */ status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Rcreate(&((hdset_reg_ref_t *)vlen_regref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -7054,7 +7054,7 @@ make_complex_attr_references(hid_t loc_id) H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(vlen_regref_attr_id, vlen_regref_attr_tid, vlen_regref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -7062,7 +7062,7 @@ make_complex_attr_references(hid_t loc_id) /* close resource for vlen data */ status = H5Treclaim(vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", __func__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", __func__, __LINE__); ret = FAIL; goto out; } diff --git a/tools/test/h5repack/testh5repack_detect_szip.c b/tools/test/h5repack/testh5repack_detect_szip.c index b2be484..02a6d2b 100644 --- a/tools/test/h5repack/testh5repack_detect_szip.c +++ b/tools/test/h5repack/testh5repack_detect_szip.c @@ -44,10 +44,10 @@ main(void) #ifdef H5_HAVE_FILTER_SZIP if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { - HDprintf("yes\n"); + printf("yes\n"); return (1); } #endif /* H5_HAVE_FILTER_SZIP */ - HDprintf("no\n"); + printf("no\n"); return (0); } diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c index a8aefba..acd3a03 100644 --- a/tools/test/h5stat/h5stat_gentest.c +++ b/tools/test/h5stat/h5stat_gentest.c @@ -626,6 +626,6 @@ main(void) return EXIT_SUCCESS; error: - HDfprintf(stderr, "h5stat test generator FAILED\n"); + fprintf(stderr, "h5stat test generator FAILED\n"); return EXIT_FAILURE; } diff --git a/tools/test/misc/clear_open_chk.c b/tools/test/misc/clear_open_chk.c index 37e7307..ec86ec4 100644 --- a/tools/test/misc/clear_open_chk.c +++ b/tools/test/misc/clear_open_chk.c @@ -18,9 +18,9 @@ static void usage(void); static void usage(void) { - HDfprintf(stdout, "\n"); - HDfprintf(stdout, "Usage error!\n"); - HDfprintf(stdout, "Usage: clear_open_chk filename\n"); + fprintf(stdout, "\n"); + fprintf(stdout, "Usage error!\n"); + fprintf(stdout, "Usage: clear_open_chk filename\n"); } /* usage() */ /*------------------------------------------------------------------------- @@ -45,7 +45,7 @@ main(int argc, char *argv[]) /* Check the # of arguments */ if (argc != 2) { usage(); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* Get the file name */ @@ -53,18 +53,18 @@ main(int argc, char *argv[]) /* Try opening the file */ if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { - HDfprintf(stderr, "clear_open_chk: unable to open the file\n"); - HDfree(fname); - HDexit(EXIT_FAILURE); + fprintf(stderr, "clear_open_chk: unable to open the file\n"); + free(fname); + exit(EXIT_FAILURE); } - HDfree(fname); + free(fname); /* Close the file */ if (H5Fclose(fid) < 0) { - HDfprintf(stderr, "clear_open_chk: cannot close the file\n"); - HDexit(EXIT_FAILURE); + fprintf(stderr, "clear_open_chk: cannot close the file\n"); + exit(EXIT_FAILURE); } /* Return success */ - HDexit(EXIT_SUCCESS); + exit(EXIT_SUCCESS); } /* main() */ diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 666a3f7..15804fe 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -124,7 +124,7 @@ gen_cache_image_file(const char *fname) if (H5Fclose(fid) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -140,7 +140,7 @@ error: } H5E_END_TRY; - HDfree(buf); + free(buf); return 1; } /* gen_cache_image_file() */ @@ -600,10 +600,10 @@ main(void) fflush(stderr); /* Not going through library closing by calling _exit(0) with success */ - HD_exit(0); + _exit(0); error: /* Exit with failure */ - HD_exit(1); + _exit(1); } diff --git a/tools/test/misc/h5perf_gentest.c b/tools/test/misc/h5perf_gentest.c index 5b898db..cf91c79 100644 --- a/tools/test/misc/h5perf_gentest.c +++ b/tools/test/misc/h5perf_gentest.c @@ -85,20 +85,20 @@ main(int argc, char *argv[]) else if (strcmp(argv[i], "-z") == 0) z = 1; else if (strcmp(argv[i], "-h") == 0) { - HDprintf("\nOPTONS:\n"); - HDprintf("\t-f F:\tname of the test file (default: %s).\n", FNAME); - HDprintf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS); - HDprintf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS); - HDprintf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS); - HDprintf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS); - HDprintf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0); - HDprintf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0 / 10 + 1)); - HDprintf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN); - HDprintf("\t-l:\tuse latest format (default: no).\n"); - HDprintf("\t-z:\tuse gzip compression (default: no).\n"); - HDprintf("\t-h:\tthis help information.\n"); - HDprintf("Example:\n"); - HDprintf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n"); + printf("\nOPTONS:\n"); + printf("\t-f F:\tname of the test file (default: %s).\n", FNAME); + printf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS); + printf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS); + printf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS); + printf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS); + printf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0); + printf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0 / 10 + 1)); + printf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN); + printf("\t-l:\tuse latest format (default: no).\n"); + printf("\t-z:\tuse gzip compression (default: no).\n"); + printf("\t-h:\tthis help information.\n"); + printf("Example:\n"); + printf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n"); exit(0); } } diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c index 04ac8e7..df1c312 100644 --- a/tools/test/misc/h5repart_gentest.c +++ b/tools/test/misc/h5repart_gentest.c @@ -36,13 +36,13 @@ main(void) hsize_t dims[2] = {FAMILY_NUMBER, FAMILY_SIZE}; /* Set up data array */ - if (NULL == (buf_data = (int *)HDcalloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) { - HDperror("HDcalloc"); - HDexit(EXIT_FAILURE); + if (NULL == (buf_data = (int *)calloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) { + HDperror("calloc"); + exit(EXIT_FAILURE); } - if (NULL == (buf = (int **)HDcalloc(FAMILY_NUMBER, sizeof(buf_data)))) { - HDperror("HDcalloc"); - HDexit(EXIT_FAILURE); + if (NULL == (buf = (int **)calloc(FAMILY_NUMBER, sizeof(buf_data)))) { + HDperror("calloc"); + exit(EXIT_FAILURE); } for (i = 0; i < FAMILY_NUMBER; i++) buf[i] = buf_data + (i * FAMILY_SIZE); @@ -50,28 +50,28 @@ main(void) /* Set property list and file name for FAMILY driver */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { HDperror("H5Pcreate"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) { HDperror("H5Pset_fapl_family"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if ((file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { HDperror("H5Fcreate"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* Create and write dataset */ if ((space = H5Screate_simple(2, dims, NULL)) < 0) { HDperror("H5Screate_simple"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if ((dset = H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { HDperror("H5Dcreate2"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } for (i = 0; i < FAMILY_NUMBER; i++) @@ -80,34 +80,34 @@ main(void) if (H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0) { HDperror("H5Dwrite"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (H5Sclose(space) < 0) { HDperror("H5Sclose"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (H5Dclose(dset) < 0) { HDperror("H5Dclose"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (H5Pclose(fapl) < 0) { HDperror("H5Pclose"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (H5Fclose(file) < 0) { HDperror("H5Fclose"); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); HDputs(" PASSED"); - HDfflush(stdout); + fflush(stdout); return EXIT_SUCCESS; } diff --git a/tools/test/misc/repart_test.c b/tools/test/misc/repart_test.c index 5c3ebf2..5951fd2 100644 --- a/tools/test/misc/repart_test.c +++ b/tools/test/misc/repart_test.c @@ -142,10 +142,10 @@ main(void) if (nerrors) goto error; - HDexit(EXIT_SUCCESS); + exit(EXIT_SUCCESS); error: nerrors = MAX(1, nerrors); - HDprintf("***** %d FAMILY FILE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - HDexit(EXIT_FAILURE); + printf("***** %d FAMILY FILE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); + exit(EXIT_FAILURE); } /* end main() */ diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index 7764e34..f8fe076 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -51,7 +51,7 @@ main(void) int result = 0; herr_t error = 1; - HDprintf("%-70s", "Testing alignment in compound datatypes"); + printf("%-70s", "Testing alignment in compound datatypes"); HDstrcpy(string5, "Hi!"); HDunlink(fname); @@ -122,7 +122,7 @@ main(void) H5Dclose(set); /* Now open the set, and read it back in */ - data = (char *)HDmalloc(H5Tget_size(fix)); + data = (char *)malloc(H5Tget_size(fix)); if (!data) { HDperror("malloc() failed"); @@ -146,39 +146,39 @@ out: result = 1; mname = H5Tget_member_name(fix, 0); - HDprintf("%14s (%2d) %6s = %s\n", mname ? mname : "(null)", (int)H5Tget_member_offset(fix, 0), - string5, (char *)(data + H5Tget_member_offset(fix, 0))); + printf("%14s (%2d) %6s = %s\n", mname ? mname : "(null)", (int)H5Tget_member_offset(fix, 0), string5, + (char *)(data + H5Tget_member_offset(fix, 0))); if (mname) H5free_memory(mname); fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 1))); mname = H5Tget_member_name(fix, 1); - HDprintf("Data comparison:\n" - "%14s (%2d) %6f = %f\n" - " %6f = %f\n", - mname ? mname : "(null)", (int)H5Tget_member_offset(fix, 1), (double)fok[0], (double)fptr[0], - (double)fok[1], (double)fptr[1]); + printf("Data comparison:\n" + "%14s (%2d) %6f = %f\n" + " %6f = %f\n", + mname ? mname : "(null)", (int)H5Tget_member_offset(fix, 1), (double)fok[0], (double)fptr[0], + (double)fok[1], (double)fptr[1]); if (mname) H5free_memory(mname); fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 2))); mname = H5Tget_member_name(fix, 2); - HDprintf("%14s (%2d) %6f = %f\n" - " %6f = %6f\n", - mname ? mname : "(null)", (int)H5Tget_member_offset(fix, 2), (double)fnok[0], - (double)fptr[0], (double)fnok[1], (double)fptr[1]); + printf("%14s (%2d) %6f = %f\n" + " %6f = %6f\n", + mname ? mname : "(null)", (int)H5Tget_member_offset(fix, 2), (double)fnok[0], (double)fptr[0], + (double)fnok[1], (double)fptr[1]); if (mname) H5free_memory(mname); fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 1))); - HDprintf("\n" - "Short circuit\n" - " %6f = %f\n" - " %6f = %f\n" - " %6f = %f\n" - " %6f = %f\n", - (double)fok[0], (double)fptr[0], (double)fok[1], (double)fptr[1], (double)fnok[0], - (double)fptr[2], (double)fnok[1], (double)fptr[3]); + printf("\n" + "Short circuit\n" + " %6f = %f\n" + " %6f = %f\n" + " %6f = %f\n" + " %6f = %f\n", + (double)fok[0], (double)fptr[0], (double)fok[1], (double)fptr[1], (double)fnok[0], + (double)fptr[2], (double)fnok[1], (double)fptr[3]); HDputs("*FAILED - compound type alignmnent problem*"); } else { @@ -186,7 +186,7 @@ out: } if (data) - HDfree(data); + free(data); H5Sclose(spc); H5Tclose(cs6); H5Tclose(cmp); @@ -197,6 +197,6 @@ out: H5Pclose(plist); H5Fclose(fil); HDunlink(fname); - HDfflush(stdout); + fflush(stdout); return result; } diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index 9f6554d..289d7c0 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -134,7 +134,7 @@ create_dset1(hid_t file) H5Dclose(dataset); H5Pclose(dcpl); H5Sclose(dataspace); - HDfree(data); + free(data); return 0; error: @@ -145,7 +145,7 @@ error: H5Sclose(dataspace); } H5E_END_TRY; - HDfree(data); + free(data); return 1; } @@ -198,7 +198,7 @@ create_dset2(hid_t file) H5Dclose(dataset); H5Pclose(dcpl); H5Sclose(dataspace); - HDfree(data); + free(data); return 0; @@ -210,7 +210,7 @@ error: H5Sclose(dataspace); } H5E_END_TRY; - HDfree(data); + free(data); return 1; } @@ -264,13 +264,12 @@ check_partial_chunks_perf(hid_t file) end_t = H5_get_time(); if ((end_t - start_t) > 0.0) - HDprintf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %zu\n", - (end_t - start_t), nbytes_global); + printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %zu\n", + (end_t - start_t), nbytes_global); else - HDprintf( - "1. Partial chunks: no total read time because timer is not available; number of bytes being " - "read from file is %zu\n", - nbytes_global); + printf("1. Partial chunks: no total read time because timer is not available; number of bytes being " + "read from file is %zu\n", + nbytes_global); H5Dclose(dataset); H5Sclose(filespace); @@ -343,13 +342,12 @@ check_hash_value_perf(hid_t file) end_t = H5_get_time(); if ((end_t - start_t) > 0.0) - HDprintf("2. Hash value: total read time is %lf; number of bytes being read from file is %zu\n", - (end_t - start_t), nbytes_global); + printf("2. Hash value: total read time is %lf; number of bytes being read from file is %zu\n", + (end_t - start_t), nbytes_global); else - HDprintf( - "2. Hash value: no total read time because timer is not available; number of bytes being read " - "from file is %zu\n", - nbytes_global); + printf("2. Hash value: no total read time because timer is not available; number of bytes being read " + "from file is %zu\n", + nbytes_global); H5Dclose(dataset); H5Sclose(filespace); @@ -407,6 +405,6 @@ main(void) return 0; error: - HDfprintf(stderr, "*** ERRORS DETECTED ***\n"); + fprintf(stderr, "*** ERRORS DETECTED ***\n"); return 1; } diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c index 0d94cf5..7772324 100644 --- a/tools/test/perform/direct_write_perf.c +++ b/tools/test/perform/direct_write_perf.c @@ -693,7 +693,7 @@ main(void) int main(void) { - HDfprintf(stdout, "No compression IO performance because zlib was not configured\n"); + fprintf(stdout, "No compression IO performance because zlib was not configured\n"); return EXIT_SUCCESS; } diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index c61e6a9..c184917 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -73,9 +73,9 @@ print_stats(const char *prefix, H5_bandwidth(bw, sizeof(bw), (double)nbytes, e_time); #ifdef H5_HAVE_GETRUSAGE - HDprintf(HEADING "%1.2fuser %1.2fsystem %1.2felapsed %s\n", prefix, u_time, s_time, e_time, bw); + printf(HEADING "%1.2fuser %1.2fsystem %1.2felapsed %s\n", prefix, u_time, s_time, e_time, bw); #else - HDprintf(HEADING "%1.2felapsed %s\n", prefix, e_time, bw); + printf(HEADING "%1.2felapsed %s\n", prefix, e_time, bw); #endif } @@ -100,10 +100,10 @@ synchronize(void) int H5_ATTR_NDEBUG_UNUSED status; status = HDsystem("sync"); - HDassert(status >= 0); + assert(status >= 0); status = HDsystem("df >/dev/null"); - HDassert(status >= 0); + assert(status >= 0); #endif } @@ -146,23 +146,23 @@ main(void) * Win32 version 5.0 compiler. * 1998-11-06 ptl */ - HDprintf("I/O request size is %1.1fMB\n", (double)(hssize_t)(size[0] * size[1]) / 1024.0 * 1024.0); + printf("I/O request size is %1.1fMB\n", (double)(hssize_t)(size[0] * size[1]) / 1024.0 * 1024.0); /* Open the files */ file = H5Fcreate(HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(file >= 0); + assert(file >= 0); fd = HDopen(RAW_FILE_NAME, O_RDWR | O_CREAT | O_TRUNC, 0666); - HDassert(fd >= 0); + assert(fd >= 0); /* Create the dataset */ file_space = H5Screate_simple(2, size, size); - HDassert(file_space >= 0); + assert(file_space >= 0); dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(dset >= 0); - the_data = (unsigned char *)HDmalloc((size_t)(size[0] * size[1])); + assert(dset >= 0); + the_data = (unsigned char *)malloc((size_t)(size[0] * size[1])); /* initial fill for lazy malloc */ - HDmemset(the_data, 0xAA, (size_t)(size[0] * size[1])); + memset(the_data, 0xAA, (size_t)(size[0] * size[1])); /* Fill raw */ synchronize(); @@ -170,11 +170,11 @@ main(void) HDgetrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); - HDfprintf(stderr, HEADING, "fill raw"); + fprintf(stderr, HEADING, "fill raw"); for (u = 0; u < nwrite; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); - HDmemset(the_data, 0xAA, (size_t)(size[0] * size[1])); + fflush(stderr); + memset(the_data, 0xAA, (size_t)(size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -193,12 +193,12 @@ main(void) HDgetrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); - HDfprintf(stderr, HEADING, "fill hdf5"); + fprintf(stderr, HEADING, "fill hdf5"); for (u = 0; u < nread; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); - HDassert(status >= 0); + assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -217,14 +217,14 @@ main(void) HDgetrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); - HDfprintf(stderr, HEADING, "out raw"); + fprintf(stderr, HEADING, "out raw"); for (u = 0; u < nwrite; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); offset = HDlseek(fd, (off_t)0, SEEK_SET); - HDassert(0 == offset); + assert(0 == offset); n = HDwrite(fd, the_data, (size_t)(size[0] * size[1])); - HDassert(n >= 0 && (size_t)n == (size[0] * size[1])); + assert(n >= 0 && (size_t)n == (size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -243,12 +243,12 @@ main(void) HDgetrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); - HDfprintf(stderr, HEADING, "out hdf5"); + fprintf(stderr, HEADING, "out hdf5"); for (u = 0; u < nwrite; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); status = H5Dwrite(dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, the_data); - HDassert(status >= 0); + assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -267,14 +267,14 @@ main(void) HDgetrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); - HDfprintf(stderr, HEADING, "in raw"); + fprintf(stderr, HEADING, "in raw"); for (u = 0; u < nread; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); offset = HDlseek(fd, (off_t)0, SEEK_SET); - HDassert(0 == offset); + assert(0 == offset); n = HDread(fd, the_data, (size_t)(size[0] * size[1])); - HDassert(n >= 0 && (size_t)n == (size[0] * size[1])); + assert(n >= 0 && (size_t)n == (size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -293,12 +293,12 @@ main(void) HDgetrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); - HDfprintf(stderr, HEADING, "in hdf5"); + fprintf(stderr, HEADING, "in hdf5"); for (u = 0; u < nread; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); - HDassert(status >= 0); + assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -312,22 +312,22 @@ main(void) t_start, t_stop, (size_t)(nread * size[0] * size[1])); /* Read hyperslab */ - HDassert(size[0] > 20 && size[1] > 20); + assert(size[0] > 20 && size[1] > 20); start[0] = start[1] = 10; count[0] = count[1] = size[0] - 20; status = H5Sselect_hyperslab(file_space, H5S_SELECT_SET, start, NULL, count, NULL); - HDassert(status >= 0); + assert(status >= 0); synchronize(); #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_start); #endif t_start = H5_get_time(); - HDfprintf(stderr, HEADING, "in hdf5 partial"); + fprintf(stderr, HEADING, "in hdf5 partial"); for (u = 0; u < nread; u++) { HDputc(PROGRESS, stderr); - HDfflush(stderr); + fflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); - HDassert(status >= 0); + assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -347,7 +347,7 @@ main(void) H5Sclose(file_space); H5Fclose(file); - HDfree(the_data); + free(the_data); return 0; } diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index 257d3ec..82c7131 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -67,8 +67,8 @@ typedef enum fill_t { FILL_ALL, FILL_FORWARD, FILL_REVERSE, FILL_INWARD, FILL_OU static void usage(const char *prog) { - HDfprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n", prog); - HDfprintf(stderr, "\ + fprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n", prog); + fprintf(stderr, "\ STYLE is the order that the dataset is filled and should be one of:\n\ forward -- Fill the dataset from lowest address to highest\n\ address. This style tests the right split ratio.\n\ @@ -230,7 +230,7 @@ test(fill_t fill_style, const double splits[], hbool_t verbose, hbool_t use_rdcc abort(); default: /* unknown request */ - HDfprintf(stderr, "Unknown fill style\n"); + fprintf(stderr, "Unknown fill style\n"); goto error; break; } @@ -286,7 +286,7 @@ test(fill_t fill_style, const double splits[], hbool_t verbose, hbool_t use_rdcc abort(); default: /* unknown request */ - HDfprintf(stderr, "Unknown fill style\n"); + fprintf(stderr, "Unknown fill style\n"); goto error; break; } @@ -394,6 +394,6 @@ main(int argc, char *argv[]) return 0; error: - HDfprintf(stderr, "*** ERRORS DETECTED ***\n"); + fprintf(stderr, "*** ERRORS DETECTED ***\n"); return 1; } diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index 6e62f6a..37a1ffd 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -399,8 +399,7 @@ create_attrs_1(void) attr_t.avg = attr_t.total / (NUM_ATTRS * NUM_DSETS); /* Print out the performance result */ - HDfprintf(stderr, "1. Create %d attributes for each of %d existing datasets\n", NUM_ATTRS, - NUM_DSETS); + fprintf(stderr, "1. Create %d attributes for each of %d existing datasets\n", NUM_ATTRS, NUM_DSETS); print_perf(open_t, close_t, attr_t); } @@ -500,7 +499,7 @@ create_attrs_2(void) attr_t.avg = attr_t.total / (NUM_ATTRS * NUM_DSETS); /* Print out the performance result */ - HDfprintf(stderr, "2. Create %d attributes for each of %d new datasets\n", NUM_ATTRS, NUM_DSETS); + fprintf(stderr, "2. Create %d attributes for each of %d new datasets\n", NUM_ATTRS, NUM_DSETS); print_perf(create_t, close_t, attr_t); } @@ -608,8 +607,8 @@ create_attrs_3(void) attr_t.avg = attr_t.total / (NUM_ATTRS * NUM_DSETS); /* Print out the performance result */ - HDfprintf(stderr, "3. Create %d attributes for each of %d existing datasets for %d times\n", - BATCH_ATTRS, NUM_DSETS, loop_num); + fprintf(stderr, "3. Create %d attributes for each of %d existing datasets for %d times\n", + BATCH_ATTRS, NUM_DSETS, loop_num); print_perf(open_t, close_t, attr_t); } @@ -715,13 +714,13 @@ perf(p_time *perf_t, double start_t, double end_t) void print_perf(p_time open_t, p_time close_t, p_time attr_t) { - HDfprintf(stderr, "\t%s:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", open_t.func, open_t.avg, open_t.max, - open_t.min); - HDfprintf(stderr, "\tH5Dclose:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", close_t.avg, close_t.max, - close_t.min); + fprintf(stderr, "\t%s:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", open_t.func, open_t.avg, open_t.max, + open_t.min); + fprintf(stderr, "\tH5Dclose:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", close_t.avg, close_t.max, + close_t.min); if (NUM_ATTRS) - HDfprintf(stderr, "\tH5A(create & close):\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", attr_t.avg, - attr_t.max, attr_t.min); + fprintf(stderr, "\tH5A(create & close):\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", attr_t.avg, attr_t.max, + attr_t.min); } /*------------------------------------------------------------------------- @@ -761,7 +760,7 @@ main(int argc, char **argv) #ifdef H5_HAVE_PARALLEL if (facc_type == FACC_DEFAULT || (facc_type != FACC_DEFAULT && MAINPROCESS)) #endif /*H5_HAVE_PARALLEL*/ - HDfprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n"); + fprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n"); fapl = H5Pcreate(H5P_FILE_ACCESS); #ifdef H5_HAVE_PARALLEL diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index 256289c..00b3140 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -84,13 +84,13 @@ error(const char *fmt, ...) va_list ap; va_start(ap, fmt); - HDfprintf(stderr, "%s: error: ", prog); + fprintf(stderr, "%s: error: ", prog); H5_GCC_CLANG_DIAG_OFF("format-nonliteral") HDvfprintf(stderr, fmt, ap); H5_GCC_CLANG_DIAG_ON("format-nonliteral") - HDfprintf(stderr, "\n"); + fprintf(stderr, "\n"); va_end(ap); - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* @@ -104,7 +104,7 @@ cleanup(void) { if (!HDgetenv(HDF5_NOCLEANUP)) HDunlink(filename); - HDfree(filename); + free(filename); } static void @@ -117,7 +117,7 @@ write_file(Bytef *source, uLongf sourceLen) /* destination buffer needs to be at least 0.1% larger than sourceLen * plus 12 bytes */ destLen = (uLongf)((double)sourceLen + ((double)sourceLen * 0.1)) + 12; - dest = (Bytef *)HDmalloc(destLen); + dest = (Bytef *)malloc(destLen); if (!dest) error("out of memory"); @@ -130,7 +130,7 @@ write_file(Bytef *source, uLongf sourceLen) ((double)timer_start.tv_sec + ((double)timer_start.tv_usec) / MICROSECOND); if (report_once_flag) { - HDfprintf(stdout, "\tCompression Ratio: %g\n", ((double)destLen) / (double)sourceLen); + fprintf(stdout, "\tCompression Ratio: %g\n", ((double)destLen) / (double)sourceLen); report_once_flag = 0; } @@ -151,7 +151,7 @@ write_file(Bytef *source, uLongf sourceLen) d_ptr += rc; } - HDfree(dest); + free(dest); } /* @@ -211,9 +211,9 @@ get_unique_name(void) if (prefix) /* 2 = 1 for '/' + 1 for null terminator */ - filename = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(ZIP_PERF_FILE) + 2); + filename = (char *)malloc(HDstrlen(prefix) + HDstrlen(ZIP_PERF_FILE) + 2); else - filename = (char *)HDmalloc(HDstrlen(ZIP_PERF_FILE) + 1); + filename = (char *)malloc(HDstrlen(ZIP_PERF_FILE) + 1); if (!filename) error("out of memory"); @@ -235,30 +235,30 @@ get_unique_name(void) static void usage(void) { - HDfprintf(stdout, "usage: %s [OPTIONS]\n", prog); - HDfprintf(stdout, " OPTIONS\n"); - HDfprintf(stdout, " -h, --help Print this usage message and exit\n"); - HDfprintf(stdout, " -1...-9 Level of compression, from 1 to 9\n"); - HDfprintf(stdout, " -c P, --compressability=P Percentage of compressability of the random\n"); - HDfprintf(stdout, " data you want [default: 0]"); - HDfprintf(stdout, " -s S, --file-size=S Maximum size of uncompressed file [default: 64M]\n"); - HDfprintf(stdout, " -B S, --max-buffer_size=S Maximum size of buffer [default: 1M]\n"); - HDfprintf(stdout, " -b S, --min-buffer_size=S Minimum size of buffer [default: 128K]\n"); - HDfprintf(stdout, " -p D, --prefix=D The directory prefix to place the file\n"); - HDfprintf(stdout, " -r, --random-test Use random data to write to the file\n"); - HDfprintf(stdout, " [default: no]\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " D - a directory which exists\n"); - HDfprintf(stdout, " P - a number between 0 and 100\n"); - HDfprintf(stdout, " S - is a size specifier, an integer >=0 followed by a size indicator:\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " K - Kilobyte (%d)\n", ONE_KB); - HDfprintf(stdout, " M - Megabyte (%d)\n", ONE_MB); - HDfprintf(stdout, " G - Gigabyte (%d)\n", ONE_GB); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " Example: 37M = 37 Megabytes = %d bytes\n", 37 * ONE_MB); - HDfprintf(stdout, "\n"); - HDfflush(stdout); + fprintf(stdout, "usage: %s [OPTIONS]\n", prog); + fprintf(stdout, " OPTIONS\n"); + fprintf(stdout, " -h, --help Print this usage message and exit\n"); + fprintf(stdout, " -1...-9 Level of compression, from 1 to 9\n"); + fprintf(stdout, " -c P, --compressability=P Percentage of compressability of the random\n"); + fprintf(stdout, " data you want [default: 0]"); + fprintf(stdout, " -s S, --file-size=S Maximum size of uncompressed file [default: 64M]\n"); + fprintf(stdout, " -B S, --max-buffer_size=S Maximum size of buffer [default: 1M]\n"); + fprintf(stdout, " -b S, --min-buffer_size=S Minimum size of buffer [default: 128K]\n"); + fprintf(stdout, " -p D, --prefix=D The directory prefix to place the file\n"); + fprintf(stdout, " -r, --random-test Use random data to write to the file\n"); + fprintf(stdout, " [default: no]\n"); + fprintf(stdout, "\n"); + fprintf(stdout, " D - a directory which exists\n"); + fprintf(stdout, " P - a number between 0 and 100\n"); + fprintf(stdout, " S - is a size specifier, an integer >=0 followed by a size indicator:\n"); + fprintf(stdout, "\n"); + fprintf(stdout, " K - Kilobyte (%d)\n", ONE_KB); + fprintf(stdout, " M - Megabyte (%d)\n", ONE_MB); + fprintf(stdout, " G - Gigabyte (%d)\n", ONE_GB); + fprintf(stdout, "\n"); + fprintf(stdout, " Example: 37M = 37 Megabytes = %d bytes\n", 37 * ONE_MB); + fprintf(stdout, "\n"); + fflush(stdout); } /* @@ -319,7 +319,7 @@ fill_with_random_data(Bytef *src, uLongf src_len) Bytef *buf = src; int fd = HDopen("/dev/urandom", O_RDONLY, 0); - HDfprintf(stdout, "Using /dev/urandom for random data\n"); + fprintf(stdout, "Using /dev/urandom for random data\n"); if (fd < 0) error(HDstrerror(errno)); @@ -339,7 +339,7 @@ fill_with_random_data(Bytef *src, uLongf src_len) HDclose(fd); } else { - HDfprintf(stdout, "Using random() for random data\n"); + fprintf(stdout, "Using random() for random data\n"); for (u = 0; u < src_len; ++u) src[u] = (Bytef)(0xff & HDrandom()); @@ -348,7 +348,7 @@ fill_with_random_data(Bytef *src, uLongf src_len) if (compress_percent) { size_t s = (size_t)((src_len * (uLongf)compress_percent) / 100); - HDmemset(src, '\0', s); + memset(src, '\0', s); } } @@ -364,7 +364,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long unsigned long i, iters; iters = file_size / src_len; - src = (Bytef *)HDcalloc(1, sizeof(Bytef) * src_len); + src = (Bytef *)calloc(1, sizeof(Bytef) * src_len); if (!src) { cleanup(); @@ -376,21 +376,21 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long if (random_test) fill_with_random_data(src, src_len); - HDfprintf(stdout, "Buffer size == "); + fprintf(stdout, "Buffer size == "); if (src_len >= ONE_KB && (src_len % ONE_KB) == 0) { if (src_len >= ONE_MB && (src_len % ONE_MB) == 0) { - HDfprintf(stdout, "%ldMB", src_len / ONE_MB); + fprintf(stdout, "%ldMB", src_len / ONE_MB); } else { - HDfprintf(stdout, "%ldKB", src_len / ONE_KB); + fprintf(stdout, "%ldKB", src_len / ONE_KB); } } else { - HDfprintf(stdout, "%ld", src_len); + fprintf(stdout, "%ld", src_len); } - HDfprintf(stdout, "\n"); + fprintf(stdout, "\n"); /* do uncompressed data write */ HDgettimeofday(&timer_start, NULL); @@ -424,8 +424,8 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long total_time = ((double)timer_stop.tv_sec + ((double)timer_stop.tv_usec) / (double)MICROSECOND) - ((double)timer_start.tv_sec + ((double)timer_start.tv_usec) / (double)MICROSECOND); - HDfprintf(stdout, "\tUncompressed Write Time: %.2fs\n", total_time); - HDfprintf(stdout, "\tUncompressed Write Throughput: %.2fMB/s\n", MB_PER_SEC(file_size, total_time)); + fprintf(stdout, "\tUncompressed Write Time: %.2fs\n", total_time); + fprintf(stdout, "\tUncompressed Write Throughput: %.2fMB/s\n", MB_PER_SEC(file_size, total_time)); HDunlink(filename); @@ -447,12 +447,12 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long total_time = ((double)timer_stop.tv_sec + ((double)timer_stop.tv_usec) / (double)MICROSECOND) - ((double)timer_start.tv_sec + ((double)timer_start.tv_usec) / (double)MICROSECOND); - HDfprintf(stdout, "\tCompressed Write Time: %.2fs\n", total_time); - HDfprintf(stdout, "\tCompressed Write Throughput: %.2fMB/s\n", MB_PER_SEC(file_size, total_time)); - HDfprintf(stdout, "\tCompression Time: %gs\n", compression_time); + fprintf(stdout, "\tCompressed Write Time: %.2fs\n", total_time); + fprintf(stdout, "\tCompressed Write Throughput: %.2fMB/s\n", MB_PER_SEC(file_size, total_time)); + fprintf(stdout, "\tCompression Time: %gs\n", compression_time); HDunlink(filename); - HDfree(src); + free(src); } } @@ -527,12 +527,12 @@ main(int argc, char *argv[]) if (min_buf_size > max_buf_size) error("minimum buffer size (%d) exceeds maximum buffer size (%d)", min_buf_size, max_buf_size); - HDfprintf(stdout, "Filesize: %ld\n", file_size); + fprintf(stdout, "Filesize: %ld\n", file_size); if (compress_level == Z_DEFAULT_COMPRESSION) - HDfprintf(stdout, "Compression Level: 6\n"); + fprintf(stdout, "Compression Level: 6\n"); else - HDfprintf(stdout, "Compression Level: %d\n", compress_level); + fprintf(stdout, "Compression Level: %d\n", compress_level); get_unique_name(); do_write_test(file_size, min_buf_size, max_buf_size); @@ -552,7 +552,7 @@ main(int argc, char *argv[]) int main(void) { - HDfprintf(stdout, "No compression IO performance because zlib was not configured\n"); + fprintf(stdout, "No compression IO performance because zlib was not configured\n"); return EXIT_SUCCESS; } |