summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_filters.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/lib/h5tools_filters.c
parent34a68acc934800d6b8c9a51c2ce91155b3178111 (diff)
downloadhdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.zip
hdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.tar.gz
hdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.tar.bz2
Refactor tools library error handling macros
Diffstat (limited to 'tools/lib/h5tools_filters.c')
-rw-r--r--tools/lib/h5tools_filters.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c
index acaf24a..13e075b 100644
--- a/tools/lib/h5tools_filters.c
+++ b/tools/lib/h5tools_filters.c
@@ -51,16 +51,16 @@ h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
/* get information about filters */
if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pget_nfilters failed");
/* if we do not have filters, we can read the dataset safely */
if (!nfilters)
- HGOTO_DONE(1);
+ H5TOOLS_GOTO_DONE(1);
/* check availability of filters */
for (i = 0; i < nfilters; i++) {
if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_filter2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pget_filter2 failed");
switch (filtn) {
/*-------------------------------------------------------------------------
@@ -69,7 +69,7 @@ h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
*/
default:
if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) {
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Zfilter_avail failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Zfilter_avail failed");
}
else if (!udfilter_avail) {
if (name)
@@ -149,41 +149,42 @@ h5tools_can_encode(H5Z_filter_t filtn)
switch (filtn) {
/* user defined filter */
default:
- HGOTO_DONE(0)
+ H5TOOLS_GOTO_DONE(0);
+ break;
case H5Z_FILTER_DEFLATE:
#ifndef H5_HAVE_FILTER_DEFLATE
- HGOTO_DONE(0)
+ H5TOOLS_GOTO_DONE(0);
#endif
break;
case H5Z_FILTER_SZIP:
#ifndef H5_HAVE_FILTER_SZIP
- HGOTO_DONE(0)
+ H5TOOLS_GOTO_DONE(0);
#else
{
unsigned int filter_config_flags;
if (H5Zget_filter_info(filtn, &filter_config_flags) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Zget_filter_info failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Zget_filter_info failed");
if ((filter_config_flags
& (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) {
/* filter present but neither encode nor decode is supported (???) */
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "neither encode nor decode is supported");
+ H5TOOLS_GOTO_ERROR(FAIL, "neither encode nor decode is supported");
}
else if ((filter_config_flags
& (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) {
/* decoder only: read but not write */
- HGOTO_DONE(0)
+ H5TOOLS_GOTO_DONE(0);
}
else if ((filter_config_flags
& (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) {
/* encoder only: write but not read (???) */
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "encoder only: write but not read");
+ H5TOOLS_GOTO_ERROR(FAIL, "encoder only: write but not read");
}
else if ((filter_config_flags
& (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED))
== (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) {
- HGOTO_DONE(1)
+ H5TOOLS_GOTO_DONE(1);
}
}
#endif