summaryrefslogtreecommitdiffstats
path: root/tools/src/h5repack/h5repack_verify.c
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2019-12-28 05:02:26 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2019-12-28 20:08:04 (GMT)
commit2cbf31cb3ad8032fb1915c783dc52a2050aaf7da (patch)
treed88ce3a7584792894bd073df1f2290f22eb69daa /tools/src/h5repack/h5repack_verify.c
parent34a68acc934800d6b8c9a51c2ce91155b3178111 (diff)
downloadhdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.zip
hdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.tar.gz
hdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.tar.bz2
Refactor tools library error handling macros
Diffstat (limited to 'tools/src/h5repack/h5repack_verify.c')
-rw-r--r--tools/src/h5repack/h5repack_verify.c114
1 files changed, 57 insertions, 57 deletions
diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c
index 29ce5bd..f874476 100644
--- a/tools/src/h5repack/h5repack_verify.c
+++ b/tools/src/h5repack/h5repack_verify.c
@@ -58,7 +58,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
/* open the output file */
if((fidout = H5Fopen(out_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 )
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fopen failed on <%s>", out_fname);
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Fopen failed on <%s>", out_fname);
for(i = 0; i < options->op_tbl->nelems; i++) {
char *name = options->op_tbl->objs[i].path;
@@ -69,13 +69,13 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
*-------------------------------------------------------------------------
*/
if((did = H5Dopen2(fidout, name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on <%s>", name);
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dopen2 failed on <%s>", name);
if((sid = H5Dget_space(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed");
if((pid = H5Dget_create_plist(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_create_plist failed");
if((tid = H5Dget_type(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_type failed");
/*-------------------------------------------------------------------------
* filter check
@@ -96,13 +96,13 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
*-------------------------------------------------------------------------
*/
if(H5Pclose(pid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
if (H5Sclose(sid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sclose failed");
if (H5Dclose(did) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dclose failed");
if (H5Tclose(tid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
}
/*-------------------------------------------------------------------------
@@ -118,7 +118,7 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
/* get the list of objects in the file */
if(h5trav_gettable(fidout, travt) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "h5trav_gettable failed");
for(i = 0; i < travt->nobjs; i++) {
char *name = travt->objs[i].name;
@@ -129,13 +129,13 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
*-------------------------------------------------------------------------
*/
if((did = H5Dopen2(fidout, name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on <%s>", name);
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dopen2 failed on <%s>", name);
if((sid = H5Dget_space(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed");
if((pid = H5Dget_create_plist(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_create_plist failed");
if((tid = H5Dget_type(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_type failed");
/*-------------------------------------------------------------------------
* filter check
@@ -165,13 +165,13 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
*-------------------------------------------------------------------------
*/
if (H5Pclose(pid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
if (H5Sclose(sid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sclose failed");
if (H5Dclose(did) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dclose failed");
if (H5Tclose(tid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
} /* if */
} /* i */
@@ -187,32 +187,32 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
/* open the input file */
if((fidin = H5Fopen(in_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fopen failed on file <%s>", in_fname);
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Fopen failed on file <%s>", in_fname);
/* Get file creation property list for input file */
if((fcpl_in = H5Fget_create_plist(fidin)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Fget_create_plist failed to retrieve file creation property list");
/* Get file space info for input file */
if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold");
/* Get file space page size for input file */
if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space page size");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pget_file_space_page_size failed to retrieve file space page size");
/* Output file is already opened */
/* Get file creation property list for output file */
if((fcpl_out = H5Fget_create_plist(fidout)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Fget_create_plist failed to retrieve file creation property list");
/* Get file space info for output file */
if(H5Pget_file_space_strategy(fcpl_out, &out_strategy, &out_persist, &out_threshold) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold");
/* Get file space page size for output file */
if(H5Pget_file_space_page_size(fcpl_out, &out_pagesize) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space page size");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pget_file_space_page_size failed to retrieve file space page size");
/*
* If -S option is set, the file space handling strategy should be set as specified.
@@ -221,11 +221,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
*/
if(options->fs_strategy) {
if(out_strategy != (options->fs_strategy == (H5F_fspace_strategy_t)-1 ? 0 : options->fs_strategy))
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected");
+ H5TOOLS_GOTO_ERROR(FAIL, "file space strategy not set as unexpected");
}
else {
if(out_strategy != in_strategy)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected");
+ H5TOOLS_GOTO_ERROR(FAIL, "file space strategy not set as unexpected");
}
/*
@@ -235,11 +235,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
*/
if(options->fs_persist) {
if(out_persist != (hbool_t)(options->fs_persist == (-1) ? FALSE : options->fs_persist))
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "free-space persist status not set as unexpected");
+ H5TOOLS_GOTO_ERROR(FAIL, "free-space persist status not set as unexpected");
}
else {
if(out_persist != in_persist)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "free-space persist status not set as unexpected");
+ H5TOOLS_GOTO_ERROR(FAIL, "free-space persist status not set as unexpected");
}
/*
@@ -249,11 +249,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
*/
if(options->fs_threshold) {
if(out_threshold != (hsize_t)(options->fs_threshold == (-1) ? 0 : options->fs_threshold))
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "threshold not set as unexpected");
+ H5TOOLS_GOTO_ERROR(FAIL, "threshold not set as unexpected");
}
else {
if(out_threshold != in_threshold)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "threshold not set as unexpected");
+ H5TOOLS_GOTO_ERROR(FAIL, "threshold not set as unexpected");
}
/*
@@ -263,11 +263,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
*/
if(options->fs_pagesize) {
if(out_pagesize != (hsize_t)(options->fs_pagesize == (-1) ? 0 : options->fs_pagesize))
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space page size not set as unexpected");
+ H5TOOLS_GOTO_ERROR(FAIL, "file space page size not set as unexpected");
}
else { /* "-G" is not set */
if(out_pagesize != in_pagesize)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space page size not set as unexpected");
+ H5TOOLS_GOTO_ERROR(FAIL, "file space page size not set as unexpected");
}
@@ -375,9 +375,9 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2)
*/
/* Open the files */
if ((fid1 = H5Fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR);
+ H5TOOLS_GOTO_ERROR(FAIL, "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR);
if ((fid2 = H5Fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname2, H5FOPENERROR);
+ H5TOOLS_GOTO_ERROR(FAIL, "h5tools_fopen failed <%s>: %s", fname2, H5FOPENERROR);
/*-------------------------------------------------------------------------
* get file table list of objects
@@ -388,7 +388,7 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2)
/* init table */
trav_table_init(&trav);
if(h5trav_gettable(fid1, trav) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "h5trav_gettable failed");
/*-------------------------------------------------------------------------
* traverse the suppplied object list
@@ -397,62 +397,62 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2)
for(i = 0; i < trav->nobjs; i++) {
if(trav->objs[i].type == H5TRAV_TYPE_GROUP) {
if ((gid = H5Gopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed on first <%s>", trav->objs[i].name);
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Gopen2 failed on first <%s>", trav->objs[i].name);
if ((gcplid = H5Gget_create_plist(gid)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gget_create_plist failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Gget_create_plist failed");
if (H5Pget_link_creation_order(gcplid, &crt_order_flag1) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_link_creation_order failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pget_link_creation_order failed");
if (H5Pclose(gcplid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
if (H5Gclose(gid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Gclose failed");
if ((gid = H5Gopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed on second <%s>", trav->objs[i].name);
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Gopen2 failed on second <%s>", trav->objs[i].name);
if ((gcplid = H5Gget_create_plist(gid)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gget_create_plist failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Gget_create_plist failed");
if (H5Pget_link_creation_order(gcplid, &crt_order_flag2) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_link_creation_order failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pget_link_creation_order failed");
if (H5Pclose(gcplid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
if (H5Gclose(gid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Gclose failed");
if (crt_order_flag1 != crt_order_flag2)
- H5TOOLS_GOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name);
+ H5TOOLS_GOTO_ERROR(0, "property lists failed for <%s> are different", trav->objs[i].name);
}
else if(trav->objs[i].type == H5TRAV_TYPE_DATASET) {
if((dset1 = H5Dopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on first <%s>", trav->objs[i].name);
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dopen2 failed on first <%s>", trav->objs[i].name);
if((dset2 = H5Dopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on second <%s>", trav->objs[i].name);
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dopen2 failed on second <%s>", trav->objs[i].name);
if((dcpl1 = H5Dget_create_plist(dset1)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_create_plist failed");
if((dcpl2 = H5Dget_create_plist(dset2)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_create_plist failed");
/*-------------------------------------------------------------------------
* compare the property lists
*-------------------------------------------------------------------------
*/
if((ret_value = H5Pequal(dcpl1, dcpl2)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pequal failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pequal failed");
if(ret_value == 0)
- H5TOOLS_GOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name);
+ H5TOOLS_GOTO_ERROR(0, "property lists failed for <%s> are different", trav->objs[i].name);
/*-------------------------------------------------------------------------
* close
*-------------------------------------------------------------------------
*/
if(H5Pclose(dcpl1) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
if(H5Pclose(dcpl2) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
if(H5Dclose(dset1) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dclose failed");
if(H5Dclose(dset2) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dclose failed");
} /*if*/
} /*for*/