summaryrefslogtreecommitdiffstats
path: root/tools/src/h5repack/h5repack_verify.c
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2019-12-28 08:16:44 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2019-12-31 00:02:06 (GMT)
commit1795aa660afe47adb28436b24eac64fa77f183fd (patch)
tree17cad54bdc89f8f095b72e0ff73ce9168215c0ee /tools/src/h5repack/h5repack_verify.c
parent2cbf31cb3ad8032fb1915c783dc52a2050aaf7da (diff)
downloadhdf5-1795aa660afe47adb28436b24eac64fa77f183fd.zip
hdf5-1795aa660afe47adb28436b24eac64fa77f183fd.tar.gz
hdf5-1795aa660afe47adb28436b24eac64fa77f183fd.tar.bz2
Clean up tools warnings introduced by H5TOOLS_ERR_INIT macro
Diffstat (limited to 'tools/src/h5repack/h5repack_verify.c')
-rw-r--r--tools/src/h5repack/h5repack_verify.c116
1 files changed, 58 insertions, 58 deletions
diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c
index f874476..d84766a 100644
--- a/tools/src/h5repack/h5repack_verify.c
+++ b/tools/src/h5repack/h5repack_verify.c
@@ -39,7 +39,6 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil
int
h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options)
{
- H5TOOLS_ERR_INIT(int, 0)
hid_t fidin = -1; /* file ID for input file*/
hid_t fidout = -1; /* file ID for output file*/
hid_t did = -1; /* dataset ID */
@@ -55,10 +54,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
hbool_t in_persist, out_persist; /* free-space persist status for in/output file */
hsize_t in_threshold, out_threshold; /* free-space section threshold for in/output file */
hsize_t in_pagesize, out_pagesize; /* file space page size for input/output file */
+ int ret_value = 0;
/* open the output file */
if((fidout = H5Fopen(out_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 )
- H5TOOLS_GOTO_ERROR(FAIL, "H5Fopen failed on <%s>", out_fname);
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Dopen2 failed on <%s>", name);
+ H5TOOLS_GOTO_ERROR((-1), "H5Dopen2 failed on <%s>", name);
if((sid = H5Dget_space(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dget_space failed");
if((pid = H5Dget_create_plist(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_create_plist failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dget_create_plist failed");
if((tid = H5Dget_type(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_type failed");
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed");
if (H5Sclose(sid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Sclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Sclose failed");
if (H5Dclose(did) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dclose failed");
if (H5Tclose(tid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "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, "h5trav_gettable failed");
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Dopen2 failed on <%s>", name);
+ H5TOOLS_GOTO_ERROR((-1), "H5Dopen2 failed on <%s>", name);
if((sid = H5Dget_space(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dget_space failed");
if((pid = H5Dget_create_plist(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_create_plist failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dget_create_plist failed");
if((tid = H5Dget_type(did)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_type failed");
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed");
if (H5Sclose(sid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Sclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Sclose failed");
if (H5Dclose(did) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dclose failed");
if (H5Tclose(tid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Fopen failed on file <%s>", in_fname);
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Fget_create_plist failed to retrieve file creation property list");
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold");
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Pget_file_space_page_size failed to retrieve file space page size");
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Fget_create_plist failed to retrieve file creation property list");
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold");
+ H5TOOLS_GOTO_ERROR((-1), "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, "H5Pget_file_space_page_size failed to retrieve file space page size");
+ H5TOOLS_GOTO_ERROR((-1), "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, "file space strategy not set as unexpected");
+ H5TOOLS_GOTO_ERROR((-1), "file space strategy not set as unexpected");
}
else {
if(out_strategy != in_strategy)
- H5TOOLS_GOTO_ERROR(FAIL, "file space strategy not set as unexpected");
+ H5TOOLS_GOTO_ERROR((-1), "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, "free-space persist status not set as unexpected");
+ H5TOOLS_GOTO_ERROR((-1), "free-space persist status not set as unexpected");
}
else {
if(out_persist != in_persist)
- H5TOOLS_GOTO_ERROR(FAIL, "free-space persist status not set as unexpected");
+ H5TOOLS_GOTO_ERROR((-1), "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, "threshold not set as unexpected");
+ H5TOOLS_GOTO_ERROR((-1), "threshold not set as unexpected");
}
else {
if(out_threshold != in_threshold)
- H5TOOLS_GOTO_ERROR(FAIL, "threshold not set as unexpected");
+ H5TOOLS_GOTO_ERROR((-1), "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, "file space page size not set as unexpected");
+ H5TOOLS_GOTO_ERROR((-1), "file space page size not set as unexpected");
}
else { /* "-G" is not set */
if(out_pagesize != in_pagesize)
- H5TOOLS_GOTO_ERROR(FAIL, "file space page size not set as unexpected");
+ H5TOOLS_GOTO_ERROR((-1), "file space page size not set as unexpected");
}
@@ -355,7 +355,6 @@ int verify_layout(hid_t pid, pack_info_t *obj)
int h5repack_cmp_pl(const char *fname1, const char *fname2)
{
- H5TOOLS_ERR_INIT(int, 1)
hid_t fid1 =-1; /* file ID */
hid_t fid2 =-1; /* file ID */
hid_t dset1 =-1; /* dataset ID */
@@ -366,8 +365,9 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2)
hid_t gcplid =-1; /* group creation property list */
unsigned crt_order_flag1; /* group creation order flag */
unsigned crt_order_flag2; /* group creation order flag */
- trav_table_t *trav = NULL;
+ trav_table_t *trav = NULL;
unsigned int i;
+ int ret_value = 1;
/*-------------------------------------------------------------------------
* open the files
@@ -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, "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR);
+ H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR);
if ((fid2 = H5Fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "h5tools_fopen failed <%s>: %s", fname2, H5FOPENERROR);
+ H5TOOLS_GOTO_ERROR((-1), "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, "h5trav_gettable failed");
+ H5TOOLS_GOTO_ERROR((-1), "h5trav_gettable failed");
/*-------------------------------------------------------------------------
* traverse the suppplied object list
@@ -397,46 +397,46 @@ 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, "H5Gopen2 failed on first <%s>", trav->objs[i].name);
+ H5TOOLS_GOTO_ERROR((-1), "H5Gopen2 failed on first <%s>", trav->objs[i].name);
if ((gcplid = H5Gget_create_plist(gid)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Gget_create_plist failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Gget_create_plist failed");
if (H5Pget_link_creation_order(gcplid, &crt_order_flag1) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pget_link_creation_order failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Pget_link_creation_order failed");
if (H5Pclose(gcplid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed");
if (H5Gclose(gid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Gclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Gclose failed");
if ((gid = H5Gopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Gopen2 failed on second <%s>", trav->objs[i].name);
+ H5TOOLS_GOTO_ERROR((-1), "H5Gopen2 failed on second <%s>", trav->objs[i].name);
if ((gcplid = H5Gget_create_plist(gid)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Gget_create_plist failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Gget_create_plist failed");
if (H5Pget_link_creation_order(gcplid, &crt_order_flag2) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pget_link_creation_order failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Pget_link_creation_order failed");
if (H5Pclose(gcplid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed");
if (H5Gclose(gid) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Gclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Gclose failed");
if (crt_order_flag1 != crt_order_flag2)
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, "H5Dopen2 failed on first <%s>", trav->objs[i].name);
+ H5TOOLS_GOTO_ERROR((-1), "H5Dopen2 failed on first <%s>", trav->objs[i].name);
if((dset2 = H5Dopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dopen2 failed on second <%s>", trav->objs[i].name);
+ H5TOOLS_GOTO_ERROR((-1), "H5Dopen2 failed on second <%s>", trav->objs[i].name);
if((dcpl1 = H5Dget_create_plist(dset1)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_create_plist failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dget_create_plist failed");
if((dcpl2 = H5Dget_create_plist(dset2)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_create_plist failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dget_create_plist failed");
/*-------------------------------------------------------------------------
* compare the property lists
*-------------------------------------------------------------------------
*/
if((ret_value = H5Pequal(dcpl1, dcpl2)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pequal failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Pequal failed");
if(ret_value == 0)
H5TOOLS_GOTO_ERROR(0, "property lists failed for <%s> are different", trav->objs[i].name);
@@ -446,13 +446,13 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2)
*-------------------------------------------------------------------------
*/
if(H5Pclose(dcpl1) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed");
if(H5Pclose(dcpl2) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed");
if(H5Dclose(dset1) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dclose failed");
if(H5Dclose(dset2) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dclose failed");
} /*if*/
} /*for*/