summaryrefslogtreecommitdiffstats
path: root/tools/h5repack
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-09-06 17:36:26 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-09-06 17:36:26 (GMT)
commit0b070ae114172588756d2c8732ccb7c89eb08ab6 (patch)
treebc63dbf62358e0f49460c59bf77e32a031045d3c /tools/h5repack
parenta57f039a6aae04b8f91955e92ddbaa74cc78fc2b (diff)
downloadhdf5-0b070ae114172588756d2c8732ccb7c89eb08ab6.zip
hdf5-0b070ae114172588756d2c8732ccb7c89eb08ab6.tar.gz
hdf5-0b070ae114172588756d2c8732ccb7c89eb08ab6.tar.bz2
HDFFV-10282 refactor out assert calls in tools
Diffstat (limited to 'tools/h5repack')
-rw-r--r--tools/h5repack/h5repack.c5
-rw-r--r--tools/h5repack/h5repack_copy.c3
-rw-r--r--tools/h5repack/h5repack_filters.c36
-rw-r--r--tools/h5repack/h5repack_refs.c8
4 files changed, 21 insertions, 31 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c
index 0ab5404..c8ff98e 100644
--- a/tools/h5repack/h5repack.c
+++ b/tools/h5repack/h5repack.c
@@ -11,10 +11,6 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
#include "H5private.h"
#include "h5repack.h"
#include "h5tools.h"
@@ -265,7 +261,6 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
/* Check if this type is the one requested */
if (oinfo.addr == dt->addr_in) {
- HDassert(!dt_ret);
dt_ret = dt;
} /* end if */
} /* end if */
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index b41f7be..93612e2 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -725,7 +725,6 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
switch (travt->objs[i].type) {
case H5TRAV_TYPE_UNKNOWN:
- HDassert(0);
break;
/*-------------------------------------------------------------------------
@@ -1429,7 +1428,6 @@ static int copy_user_block(const char *infile, const char *outfile, hsize_t size
int infid = -1, outfid = -1; /* File descriptors */
/* User block must be any power of 2 equal to 512 or greater (512, 1024, 2048, etc.) */
- HDassert(size > 0);
/* Open files */
if ((infid = HDopen(infile, O_RDONLY, 0)) < 0)
@@ -1527,6 +1525,7 @@ void print_user_block(const char *filename, hid_t fid)
/* open file */
if((fh = HDopen(filename, O_RDONLY, 0)) < 0) {
+ error_msg("failed to open file\n");
HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed");
}
diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c
index f265b8c..88178f6 100644
--- a/tools/h5repack/h5repack_filters.c
+++ b/tools/h5repack/h5repack_filters.c
@@ -32,11 +32,11 @@
*
*-------------------------------------------------------------------------
*/
-static int aux_find_obj(const char *name, /* object name from traverse list */
- pack_opt_t *options, /* repack options */
- pack_info_t *obj) /* (OUT) info about object to filter */
+static int aux_find_obj(const char* name, /* object name from traverse list */
+ pack_opt_t *options, /* repack options */
+ pack_info_t *obj /*OUT*/) /* info about object to filter */
{
- char *pdest;
+ char *pdest;
int result;
unsigned int i;
@@ -69,9 +69,9 @@ static int aux_find_obj(const char *name, /* object name from traverse list
*
*-------------------------------------------------------------------------
*/
-static int aux_assign_obj(const char *name, /* object name from traverse list */
- pack_opt_t *options, /* repack options */
- pack_info_t *obj) /* (OUT) info about object to filter */
+static int aux_assign_obj(const char* name, /* object name from traverse list */
+ pack_opt_t *options, /* repack options */
+ pack_info_t *obj /*OUT*/) /* info about object to filter */
{
int idx, i;
@@ -184,19 +184,19 @@ static int aux_assign_obj(const char *name, /* object name from traverse list
*-------------------------------------------------------------------------
*/
-int apply_filters(const char *name, /* object name from traverse list */
- int rank, /* rank of dataset */
- hsize_t *dims, /* dimensions of dataset */
- size_t msize, /* size of type */
- hid_t dcpl_id, /* dataset creation property list */
- pack_opt_t *options, /* repack options */
- int *has_filter) /* (OUT) object NAME has a filter */
+int apply_filters(const char* name, /* object name from traverse list */
+ int rank, /* rank of dataset */
+ hsize_t *dims, /* dimensions of dataset */
+ size_t msize, /* size of type */
+ hid_t dcpl_id, /* dataset creation property list */
+ pack_opt_t *options, /* repack options */
+ int *has_filter) /* (OUT) object NAME has a filter */
{
- int nfilters; /* number of filters in DCPL */
- hsize_t chsize[64]; /* chunk size in elements */
+ int nfilters; /* number of filters in DCPL */
+ hsize_t chsize[64]; /* chunk size in elements */
H5D_layout_t layout;
- int i;
- pack_info_t obj;
+ int i;
+ pack_info_t obj;
*has_filter = 0;
diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c
index 89d0f76..4220091 100644
--- a/tools/h5repack/h5repack_refs.c
+++ b/tools/h5repack/h5repack_refs.c
@@ -189,8 +189,7 @@ int do_copy_refobjs(hid_t fidin,
/* create the reference, -1 parameter for objects */
if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, (hid_t)-1) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed");
- if(options->verbose)
- {
+ if(options->verbose) {
printf(FORMAT_OBJ,"dset",travt->objs[i].name );
printf("object <%s> object reference created to <%s>\n",
travt->objs[i].name,
@@ -278,8 +277,7 @@ int do_copy_refobjs(hid_t fidin,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed");
if(H5Sclose(region_id) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
- if(options->verbose)
- {
+ if(options->verbose) {
printf(FORMAT_OBJ,"dset",travt->objs[i].name );
printf("object <%s> region reference created to <%s>\n",
travt->objs[i].name,
@@ -320,8 +318,6 @@ int do_copy_refobjs(hid_t fidin,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed");
} /* end else */
- HDassert(dset_out != FAIL);
-
/*-------------------------------------------------------------------------
* copy referenced objects in attributes
*-------------------------------------------------------------------------