summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2017-11-25 08:12:26 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2017-11-25 08:22:24 (GMT)
commit96784c9873433b57de813c5afadd5d9771103686 (patch)
treec180d5c2a0163c2c273cb72b7b7df006e7be7a3f /tools
parenta7ba8af0d145fee16a758ae4150316c7f2a38263 (diff)
parentf3fd3f293f2734fea98f508f190bf531edc72f7a (diff)
downloadhdf5-96784c9873433b57de813c5afadd5d9771103686.zip
hdf5-96784c9873433b57de813c5afadd5d9771103686.tar.gz
hdf5-96784c9873433b57de813c5afadd5d9771103686.tar.bz2
(1) Merge branch 'develop' into bugfix/version_bounds
(2) Add two new options to h5repack for low and high bounds as in H5Pset_libver_bounds. (3) Modify message pre_copy callbacks so that H5Ocopy can handle version bounds check. (4) Add version bounds check for cache image feature.
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5diff.c1093
-rw-r--r--tools/lib/h5diff.h22
-rw-r--r--tools/lib/h5diff_array.c1721
-rw-r--r--tools/lib/h5diff_attr.c260
-rw-r--r--tools/lib/h5diff_dset.c572
-rw-r--r--tools/lib/h5diff_util.c84
-rw-r--r--tools/lib/h5tools.c464
-rw-r--r--tools/lib/h5tools_dump.c191
-rw-r--r--tools/lib/h5tools_filters.c65
-rw-r--r--tools/lib/h5tools_str.c8
-rw-r--r--tools/lib/h5tools_type.c124
-rw-r--r--tools/lib/h5tools_utils.c224
-rw-r--r--tools/lib/h5trav.c533
-rw-r--r--tools/lib/ph5diff.h2
-rw-r--r--tools/src/h5diff/h5diff_common.c85
-rw-r--r--tools/src/h5diff/h5diff_common.h4
-rw-r--r--tools/src/h5diff/h5diff_main.c12
-rw-r--r--tools/src/h5diff/ph5diff_main.c18
-rw-r--r--tools/src/h5jam/h5jam.c6
-rw-r--r--tools/src/h5ls/h5ls.c2
-rw-r--r--tools/src/h5repack/h5repack.c60
-rw-r--r--tools/src/h5repack/h5repack.h30
-rw-r--r--tools/src/h5repack/h5repack_copy.c266
-rw-r--r--tools/src/h5repack/h5repack_filters.c4
-rw-r--r--tools/src/h5repack/h5repack_main.c23
-rw-r--r--tools/src/h5repack/h5repack_refs.c47
-rw-r--r--tools/src/misc/h5mkgrp.c2
-rw-r--r--tools/test/h5copy/CMakeLists.txt48
-rw-r--r--tools/test/h5copy/CMakeTests.cmake158
-rw-r--r--tools/test/h5copy/dynlib_copy.c89
-rw-r--r--tools/test/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt3
-rw-r--r--tools/test/h5copy/testfiles/h5copy_plugin_test.out.h5.txt3
-rw-r--r--tools/test/h5copy/testfiles/tudfilter.h5bin0 -> 4816 bytes
-rw-r--r--tools/test/h5copy/testfiles/tudfilter.h5.txt2
-rw-r--r--tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt2
-rw-r--r--tools/test/h5copy/testfiles/tudfilter2.h5bin0 -> 4816 bytes
-rw-r--r--tools/test/h5diff/CMakeTests.cmake4
-rw-r--r--tools/test/h5diff/Makefile.am5
-rw-r--r--tools/test/h5diff/testfiles/h5diff_454_ERR.err2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_454_ERR.txt2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_455_ERR.err2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_455_ERR.txt2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_457_ERR.err2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_457_ERR.txt2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_458_ERR.err2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_458_ERR.txt2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_459_ERR.err2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_459_ERR.txt2
-rw-r--r--tools/test/h5diff/testfiles/h5diff_60.txt4
-rw-r--r--tools/test/h5diff/testfiles/h5diff_61.txt48
-rw-r--r--tools/test/h5diff/testfiles/h5diff_62.txt62
-rw-r--r--tools/test/h5diff/testfiles/h5diff_63.txt8
-rw-r--r--tools/test/h5diff/testfiles/h5diff_70.txt756
-rw-r--r--tools/test/h5diff/testfiles/h5diff_700.txt756
-rw-r--r--tools/test/h5diff/testfiles/h5diff_701.txt756
-rw-r--r--tools/test/h5diff/testfiles/h5diff_702.txt756
-rw-r--r--tools/test/h5diff/testfiles/h5diff_703.txt756
-rw-r--r--tools/test/h5diff/testfiles/h5diff_80.txt252
-rw-r--r--tools/test/h5diff/testfiles/h5diff_udfail.txt2
-rw-r--r--tools/test/h5dump/Makefile.am5
-rw-r--r--tools/test/h5format_convert/CMakeTests.cmake59
-rw-r--r--tools/test/h5format_convert/testfiles/h5fc_v_err.ddl1
-rw-r--r--tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err8
-rw-r--r--tools/test/h5format_convert/testh5fc.sh.in136
-rw-r--r--tools/test/h5ls/Makefile.am5
-rw-r--r--tools/test/h5repack/CMakeTests.cmake4
-rw-r--r--tools/test/h5repack/Makefile.am9
-rw-r--r--tools/test/h5repack/h5repacktst.c6
-rw-r--r--tools/test/h5repack/testfiles/h5repack-help.txt3
-rw-r--r--tools/test/misc/CMakeTestsClear.cmake6
-rw-r--r--tools/test/perform/CMakeTests.cmake7
71 files changed, 5236 insertions, 5425 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 0be6f5c..94cca58 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -21,25 +21,25 @@
/*-------------------------------------------------------------------------
* Function: print_objname
*
- * Purpose: check if object name is to be printed, only when:
- * 1) verbose mode
- * 2) when diff was found (normal mode)
+ * Purpose: check if object name is to be printed, only when:
+ * 1) verbose mode
+ * 2) when diff was found (normal mode)
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE int
-print_objname (diff_opt_t * options, hsize_t nfound)
+print_objname (diff_opt_t * opts, hsize_t nfound)
{
- return ((options->m_verbose || nfound) && !options->m_quiet) ? 1 : 0;
+ return ((opts->m_verbose || nfound) && !opts->m_quiet) ? 1 : 0;
}
/*-------------------------------------------------------------------------
* Function: do_print_objname
*
- * Purpose: print object name
- *
+ * Purpose: print object name
*-------------------------------------------------------------------------
*/
-void do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts)
+void
+do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts)
{
/* if verbose level is higher than 0, put space line before
* displaying any object or symbolic links. This improves
@@ -53,8 +53,7 @@ void do_print_objname (const char *OBJ, const char *path1, const char *path2, di
/*-------------------------------------------------------------------------
* Function: do_print_attrname
*
- * Purpose: print attribute name
- *
+ * Purpose: print attribute name
*-------------------------------------------------------------------------
*/
void
@@ -66,17 +65,16 @@ do_print_attrname (const char *attr, const char *path1, const char *path2)
/*-------------------------------------------------------------------------
* Function: print_warn
*
- * Purpose: check print warning condition.
+ * Purpose: check print warning condition.
* Return:
- * 1 if verbose mode
- * 0 if not verbos mode
- * Programmer: Jonathan Kim
- * Date: Feb 4, 2010
+ * 1 if verbose mode
+ * 0 if not verbos mode
*-------------------------------------------------------------------------
*/
-static int print_warn(diff_opt_t *options)
+static int
+print_warn(diff_opt_t *opts)
{
- return ((options->m_verbose))?1:0;
+ return ((opts->m_verbose)) ? 1: 0;
}
@@ -84,20 +82,16 @@ static int print_warn(diff_opt_t *options)
/*-------------------------------------------------------------------------
* Function: phdiff_dismiss_workers
*
- * Purpose: tell all workers to end.
- *
- * Return: none
- *
- * Programmer: Albert Cheng
- *
- * Date: Feb 6, 2005
+ * Purpose: tell all workers to end.
*
+ * Return: none
*-------------------------------------------------------------------------
*/
-void phdiff_dismiss_workers(void)
+void
+phdiff_dismiss_workers(void)
{
int i;
- for(i=1; i<g_nTasks; i++)
+ for (i = 1; i < g_nTasks; i++)
MPI_Send(NULL, 0, MPI_BYTE, i, MPI_TAG_END, MPI_COMM_WORLD);
}
@@ -105,29 +99,23 @@ void phdiff_dismiss_workers(void)
/*-------------------------------------------------------------------------
* Function: print_incoming_data
*
- * Purpose: special function that prints any output that has been sent to the manager
- * and is currently sitting in the incoming message queue
- *
- * Return: none
- *
- * Programmer: Leon Arber
- *
- * Date: March 7, 2005
+ * Purpose: special function that prints any output that has been sent to the manager
+ * and is currently sitting in the incoming message queue
*
+ * Return: none
*-------------------------------------------------------------------------
*/
-static void print_incoming_data(void)
+static void
+print_incoming_data(void)
{
- char data[PRINT_DATA_MAX_SIZE+1];
+ char data[PRINT_DATA_MAX_SIZE + 1];
int incomingMessage;
MPI_Status Status;
- do
- {
+ do {
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &incomingMessage, &Status);
- if(incomingMessage)
- {
+ if(incomingMessage) {
HDmemset(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);
@@ -140,81 +128,68 @@ static void print_incoming_data(void)
/*-------------------------------------------------------------------------
* Function: is_valid_options
*
- * Purpose: check if options are valid
+ * Purpose: check if options are valid
*
* Return:
- * 1 : Valid
- * 0 : Not valid
- *
- * Programmer: Jonathan Kim
- *
- * Date: Feb 17, 2010
- *
+ * 1 : Valid
+ * 0 : Not valid
*------------------------------------------------------------------------*/
-static int is_valid_options(diff_opt_t *options)
+static int
+is_valid_options(diff_opt_t *opts)
{
- int ret=1; /* init to valid */
+ int ret_value = 1; /* init to valid */
/*-----------------------------------------------
* no -q(quiet) with -v (verbose) or -r (report) */
- if(options->m_quiet && (options->m_verbose || options->m_report))
- {
+ if(opts->m_quiet && (opts->m_verbose || opts->m_report)) {
parallel_print("Error: -q (quiet mode) cannot be added to verbose or report modes\n");
- options->err_stat=1;
- ret = 0;
- goto out;
+ opts->err_stat = 1;
+ HGOTO_DONE(0);
}
/* -------------------------------------------------------
* only allow --no-dangling-links along with --follow-symlinks */
- if(options->no_dangle_links && !options->follow_links)
- {
+ if(opts->no_dangle_links && !opts->follow_links) {
parallel_print("Error: --no-dangling-links must be used along with --follow-symlinks option.\n");
- options->err_stat=1;
- ret = 0;
- goto out;
+ opts->err_stat = 1;
+ HGOTO_DONE(0);
}
-out:
+done:
- return ret;
+ return ret_value;
}
/*-------------------------------------------------------------------------
* Function: is_exclude_path
*
- * Purpose: check if 'paths' are part of exclude path list
+ * Purpose: check if 'paths' are part of exclude path list
*
* Return:
- * 1 - excluded path
- * 0 - not excluded path
- *
- * Programmer: Jonathan Kim
- * Date: Aug 23, 2010
+ * 1 - excluded path
+ * 0 - not excluded path
*------------------------------------------------------------------------*/
-static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options)
+static int
+is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *opts)
{
struct exclude_path_list * exclude_path_ptr;
- int ret_cmp;
- int ret = 0;
+ int ret_cmp;
+ int ret_value = 0;
/* check if exclude path option is given */
- if (!options->exclude_path)
- goto out;
+ if (!opts->exclude_path)
+ HGOTO_DONE(0);
/* assign to local exclude list pointer */
- exclude_path_ptr = options->exclude;
+ exclude_path_ptr = opts->exclude;
/* search objects in exclude list */
- while (NULL != exclude_path_ptr)
- {
+ while (NULL != exclude_path_ptr) {
/* if exclude path is is group, exclude its members as well */
- if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP)
- {
+ if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) {
ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, path,
HDstrlen(exclude_path_ptr->obj_path));
- if (ret_cmp == 0) /* found matching members */
- {
+ if (ret_cmp == 0) { /* found matching members */
size_t len_grp;
/* check if given path belong to an excluding group, if so
@@ -223,22 +198,19 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options
* not under “/grp1xxx/” group.
*/
len_grp = HDstrlen(exclude_path_ptr->obj_path);
- if (path[len_grp] == '/')
- {
+ if (path[len_grp] == '/') {
/* belong to excluded group! */
- ret = 1;
+ ret_value = 1;
break; /* while */
}
}
}
/* exclude target is not group, just exclude the object */
- else
- {
+ else {
ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, path);
- if (ret_cmp == 0) /* found matching object */
- {
+ if (ret_cmp == 0) { /* found matching object */
/* excluded non-group object */
- ret = 1;
+ ret_value = 1;
/* remember the type of this maching object.
* if it's group, it can be used for excluding its member
* objects in this while() loop */
@@ -249,26 +221,23 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options
exclude_path_ptr = exclude_path_ptr->next;
}
-out:
- return ret;
+done:
+ return ret_value;
}
/*-------------------------------------------------------------------------
* Function: free_exclude_path_list
*
- * Purpose: free exclud object list from diff options
- *
- * Programmer: Jonathan Kim
- * Date: Aug 23, 2010
+ * Purpose: free exclude object list from diff options
*------------------------------------------------------------------------*/
-static void free_exclude_path_list(diff_opt_t *options)
+static void
+free_exclude_path_list(diff_opt_t *opts)
{
- struct exclude_path_list * curr = options->exclude;
- struct exclude_path_list * next;
+ struct exclude_path_list *curr = opts->exclude;
+ struct exclude_path_list *next;
- while (NULL != curr)
- {
+ while (NULL != curr) {
next = curr->next;
HDfree(curr);
curr = next;
@@ -278,44 +247,43 @@ static void free_exclude_path_list(diff_opt_t *options)
/*-------------------------------------------------------------------------
* Function: build_match_list
*
- * Purpose: get list of matching path_name from info1 and info2
+ * Purpose: get list of matching path_name from info1 and info2
*
* Note:
- * Find common objects; the algorithm used for this search is the
- * cosequential match algorithm and is described in
- * Folk, Michael; Zoellick, Bill. (1992). File Structures. Addison-Wesley.
- * Moved out from diff_match() to make code more flexible.
+ * Find common objects; the algorithm used for this search is the
+ * cosequential match algorithm and is described in
+ * Folk, Michael; Zoellick, Bill. (1992). File Structures. Addison-Wesley.
+ * Moved out from diff_match() to make code more flexible.
*
* Parameter:
- * table_out [OUT] : return the list
- *
- * Programmer: Jonathan Kim
- *
- * Date: Aug 18, 2010
+ * table_out [OUT] : return the list
*------------------------------------------------------------------------*/
-static void build_match_list (const char *objname1, trav_info_t *info1, const char *objname2, trav_info_t *info2, trav_table_t ** table_out, diff_opt_t *options)
+static void
+build_match_list (const char *objname1, trav_info_t *info1, const char *objname2, trav_info_t *info2,
+ trav_table_t ** table_out, diff_opt_t *opts)
{
- size_t curr1 = 0;
- size_t curr2 = 0;
+ size_t curr1 = 0;
+ size_t curr2 = 0;
unsigned infile[2];
- char * path1_lp;
- char * path2_lp;
+ char *path1_lp = NULL;
+ char *path2_lp = NULL;
h5trav_type_t type1_l;
h5trav_type_t type2_l;
- size_t path1_offset = 0;
- size_t path2_offset = 0;
- int cmp;
- trav_table_t *table;
- size_t idx;
+ size_t path1_offset = 0;
+ size_t path2_offset = 0;
+ int cmp;
+ trav_table_t *table = NULL;
+ size_t idx;
h5difftrace("build_match_list start\n");
/* init */
- trav_table_init( &table );
-
+ trav_table_init(&table);
+ if (table == NULL)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "Cannot create tarverse table");
/*
* This is necessary for the case that given objects are group and
* have different names (ex: obj1 is /grp1 and obj2 is /grp5).
- * All the objects belong to given groups are the cadidates.
+ * All the objects belong to given groups are the candidates.
* So prepare to compare paths without the group names.
*/
@@ -329,8 +297,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch
/*--------------------------------------------------
* build the list
*/
- while(curr1 < info1->nused && curr2 < info2->nused)
- {
+ while(curr1 < info1->nused && curr2 < info2->nused) {
path1_lp = (info1->paths[curr1].path) + path1_offset;
path2_lp = (info2->paths[curr2].path) + path2_offset;
type1_l = info1->paths[curr1].type;
@@ -338,19 +305,15 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch
/* criteria is string compare */
cmp = HDstrcmp(path1_lp, path2_lp);
-
- if(cmp == 0)
- {
- if(!is_exclude_path(path1_lp, type1_l, options))
- {
+ if(cmp == 0) {
+ if(!is_exclude_path(path1_lp, type1_l, opts)) {
infile[0] = 1;
infile[1] = 1;
trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table);
/* if the two point to the same target object,
* mark that in table */
if (info1->paths[curr1].fileno == info2->paths[curr2].fileno &&
- info1->paths[curr1].objno == info2->paths[curr2].objno )
- {
+ info1->paths[curr1].objno == info2->paths[curr2].objno) {
idx = table->nobjs - 1;
table->objs[idx].is_same_trgobj = 1;
}
@@ -358,20 +321,16 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch
curr1++;
curr2++;
} /* end if */
- else if(cmp < 0)
- {
- if(!is_exclude_path(path1_lp, type1_l, options))
- {
+ else if(cmp < 0) {
+ if(!is_exclude_path(path1_lp, type1_l, opts)) {
infile[0] = 1;
infile[1] = 0;
trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table);
}
curr1++;
} /* end else-if */
- else
- {
- if (!is_exclude_path(path2_lp, type2_l, options))
- {
+ else {
+ if (!is_exclude_path(path2_lp, type2_l, opts)) {
infile[0] = 0;
infile[1] = 1;
trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table);
@@ -383,13 +342,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch
/* list1 did not end */
infile[0] = 1;
infile[1] = 0;
- while(curr1 < info1->nused)
- {
+ while(curr1 < info1->nused) {
path1_lp = (info1->paths[curr1].path) + path1_offset;
type1_l = info1->paths[curr1].type;
- if(!is_exclude_path(path1_lp, type1_l, options))
- {
+ if(!is_exclude_path(path1_lp, type1_l, opts)) {
trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table);
}
curr1++;
@@ -398,19 +355,17 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch
/* list2 did not end */
infile[0] = 0;
infile[1] = 1;
- while(curr2 < info2->nused)
- {
+ while(curr2 < info2->nused) {
path2_lp = (info2->paths[curr2].path) + path2_offset;
type2_l = info2->paths[curr2].type;
- if (!is_exclude_path(path2_lp, type2_l, options))
- {
+ if (!is_exclude_path(path2_lp, type2_l, opts)) {
trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table);
}
curr2++;
} /* end while */
- free_exclude_path_list (options);
+ free_exclude_path_list (opts);
*table_out = table;
h5difftrace("build_match_list finish\n");
@@ -420,15 +375,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch
/*-------------------------------------------------------------------------
* Function: trav_grp_objs
*
- * Purpose:
- * Call back function from h5trav_visit().
- *
- * Programmer: Jonathan Kim
- *
- * Date: Aug 16, 2010
+ * Purpose: Call back function from h5trav_visit().
*------------------------------------------------------------------------*/
-static herr_t trav_grp_objs(const char *path, const H5O_info_t *oinfo,
- const char *already_visited, void *udata)
+static herr_t
+trav_grp_objs(const char *path, const H5O_info_t *oinfo,
+ const char *already_visited, void *udata)
{
trav_info_visit_obj(path, oinfo, already_visited, udata);
@@ -438,18 +389,13 @@ static herr_t trav_grp_objs(const char *path, const H5O_info_t *oinfo,
/*-------------------------------------------------------------------------
* Function: trav_grp_symlinks
*
- * Purpose:
- * Call back function from h5trav_visit().
- * Track and extra checkings while visiting all symbolic-links.
- *
- * Programmer: Jonathan Kim
- *
- * Date: Aug 16, 2010
+ * Purpose: Call back function from h5trav_visit().
+ * Track and extra checkings while visiting all symbolic-links.
*------------------------------------------------------------------------*/
-static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo,
- void *udata)
+static herr_t
+trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata)
{
- int ret_value = 0;
+ herr_t ret_value = 0;
trav_info_t *tinfo = (trav_info_t *)udata;
diff_opt_t *opts = (diff_opt_t *)tinfo->opts;
h5tool_link_info_t lnk_info;
@@ -461,66 +407,68 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo,
if (!opts->follow_links) {
trav_info_visit_lnk(path, linfo, tinfo);
- goto done;
+ HGOTO_DONE(0);
}
switch(linfo->type) {
case H5L_TYPE_SOFT:
- if((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0)
- goto done;
- /* no dangling link option given and detect dangling link */
+ if((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) {
+ HGOTO_DONE(FAIL);
+ }
else if (ret_value == 0) {
- tinfo->symlink_visited.dangle_link = TRUE;
+ /* no dangling link option given and detect dangling link */
+ tinfo->symlink_visited.dangle_link = TRUE;
trav_info_visit_lnk(path, linfo, tinfo);
if (opts->no_dangle_links)
opts->err_stat = 1; /* make dangling link is error */
- goto done;
+ HGOTO_DONE(0);
}
/* check if already visit the target object */
if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path))
- goto done;
+ HGOTO_DONE(0);
/* add this link as visited link */
if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path) < 0)
- goto done;
+ HGOTO_DONE(0);
if(h5trav_visit(tinfo->fid, path, TRUE, TRUE,
trav_grp_objs,trav_grp_symlinks, tinfo) < 0) {
parallel_print("Error: Could not get file contents\n");
opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Could not get file contents");
}
break;
case H5L_TYPE_EXTERNAL:
- if ((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0)
- goto done;
- /* no dangling link option given and detect dangling link */
+ if ((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) {
+ HGOTO_DONE(FAIL);
+ }
else if (ret_value == 0) {
+ /* no dangling link option given and detect dangling link */
tinfo->symlink_visited.dangle_link = TRUE;
trav_info_visit_lnk(path, linfo, tinfo);
if (opts->no_dangle_links)
opts->err_stat = 1; /* make dangling link is error */
- goto done;
+ HGOTO_DONE(0);
}
if(H5Lunpack_elink_val(lnk_info.trg_path, linfo->u.val_size, NULL, &ext_fname, &ext_path) < 0)
- goto done;
+ HGOTO_DONE(0);
/* check if already visit the target object */
if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path))
- goto done;
+ HGOTO_DONE(0);
/* add this link as visited link */
if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path) < 0)
- goto done;
+ HGOTO_DONE(0);
if(h5trav_visit(tinfo->fid, path, TRUE, TRUE,
trav_grp_objs,trav_grp_symlinks, tinfo) < 0) {
parallel_print("Error: Could not get file contents\n");
opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents\n");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Could not get file contents\n");
}
break;
@@ -530,52 +478,48 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo,
default:
parallel_print("Error: Invalid link type\n");
opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Invalid link type");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Invalid link type");
break;
} /* end of switch */
done:
if (lnk_info.trg_path)
HDfree(lnk_info.trg_path);
- return 0;
+ return ret_value;
}
/*-------------------------------------------------------------------------
* Function: h5diff
*
- * Purpose: public function, can be called in an application program.
- * return differences between 2 HDF5 files
- *
- * Return: Number of differences found.
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: October 22, 2003
+ * Purpose: public function, can be called in an application program.
+ * return differences between 2 HDF5 files
*
+ * Return: Number of differences found.
*-------------------------------------------------------------------------
*/
-hsize_t h5diff(const char *fname1,
+hsize_t
+h5diff(const char *fname1,
const char *fname2,
const char *objname1,
const char *objname2,
diff_opt_t *opts)
{
- int ret_value = 0;
- hid_t file1_id = (-1);
- hid_t file2_id = (-1);
- char filenames[2][MAX_FILENAME];
- hsize_t nfound = 0;
- int l_ret1 = -1;
- int l_ret2 = -1;
- char * obj1fullname = NULL;
- char * obj2fullname = NULL;
- int both_objs_grp = 0;
+ int ret_value = 0;
+ hid_t file1_id = -1;
+ hid_t file2_id = -1;
+ char filenames[2][MAX_FILENAME];
+ hsize_t nfound = 0;
+ int l_ret1 = -1;
+ int l_ret2 = -1;
+ char *obj1fullname = NULL;
+ char *obj2fullname = NULL;
+ int both_objs_grp = 0;
/* init to group type */
h5trav_type_t obj1type = H5TRAV_TYPE_GROUP;
h5trav_type_t obj2type = H5TRAV_TYPE_GROUP;
/* for single object */
- H5O_info_t oinfo1, oinfo2; /* object info */
+ H5O_info_t oinfo1, oinfo2; /* object info */
trav_info_t *info1_obj = NULL;
trav_info_t *info2_obj = NULL;
/* for group object */
@@ -585,8 +529,8 @@ hsize_t h5diff(const char *fname1,
trav_info_t *info1_lp = NULL;
trav_info_t *info2_lp = NULL;
/* link info from specified object */
- H5L_info_t src_linfo1;
- H5L_info_t src_linfo2;
+ H5L_info_t src_linfo1;
+ H5L_info_t src_linfo2;
/* link info from member object */
h5tool_link_info_t trg_linfo1;
h5tool_link_info_t trg_linfo2;
@@ -604,34 +548,27 @@ hsize_t h5diff(const char *fname1,
* check invalid combination of options
*-----------------------------------------------------------------------*/
if(!is_valid_options(opts))
- goto done;
+ HGOTO_DONE(0);
opts->cmn_objs = 1; /* eliminate warning */
+ opts->err_stat = 0; /* initialize error status */
/*-------------------------------------------------------------------------
* open the files first; if they are not valid, no point in continuing
*-------------------------------------------------------------------------
*/
-
- /* disable error reporting */
- H5E_BEGIN_TRY
- {
- /* open file 1 */
- if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) {
- parallel_print("h5diff: <%s>: unable to open file\n", fname1);
- opts->err_stat = 1;
- goto done;
- } /* end if */
+ /* open file 1 */
+ if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) {
+ parallel_print("h5diff: <%s>: unable to open file\n", fname1);
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname1);
+ } /* end if */
- /* open file 2 */
- if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) {
- parallel_print("h5diff: <%s>: unable to open file\n", fname2);
- opts->err_stat = 1;
- goto done;
- } /* end if */
- /* enable error reporting */
- } H5E_END_TRY;
+ /* open file 2 */
+ if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) {
+ parallel_print("h5diff: <%s>: unable to open file\n", fname2);
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname2);
+ } /* end if */
/*-------------------------------------------------------------------------
* Initialize the info structs
@@ -648,10 +585,12 @@ hsize_t h5diff(const char *fname1,
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if(HDasprintf(&obj1fullname, "/%s", objname1) < 0)
- goto done;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
#else /* H5_HAVE_ASPRINTF */
/* (malloc 2 more for "/" and end-of-line) */
- obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2);
+ if ((obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2)) == NULL)
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+
HDstrcpy(obj1fullname, "/");
HDstrcat(obj1fullname, objname1);
#endif /* H5_HAVE_ASPRINTF */
@@ -664,10 +603,11 @@ hsize_t h5diff(const char *fname1,
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if(HDasprintf(&obj2fullname, "/%s", objname2) < 0)
- goto done;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
#else /* H5_HAVE_ASPRINTF */
/* (malloc 2 more for "/" and end-of-line) */
- obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2);
+ if ((obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2)) == NULL)
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
HDstrcpy(obj2fullname, "/");
HDstrcat(obj2fullname, objname2);
#endif /* H5_HAVE_ASPRINTF */
@@ -686,14 +626,12 @@ hsize_t h5diff(const char *fname1,
/* check if link itself exist */
if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) {
parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1);
- opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Object could not be found");
}
/* get info from link */
if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) {
parallel_print("Unable to get link info from <%s>\n", obj1fullname);
- H5TOOLS_INFO(H5E_tools_min_id_g, "Unable to get link info\n");
- goto done;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Lget_info failed");
}
info1_lp = info1_obj;
@@ -709,8 +647,7 @@ hsize_t h5diff(const char *fname1,
if(H5Oget_info_by_name(file1_id, obj1fullname, &oinfo1, H5P_DEFAULT) < 0) {
parallel_print("Error: Could not get file contents\n");
- opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Could not get file contents");
}
obj1type = (h5trav_type_t)oinfo1.type;
trav_info_add(info1_obj, obj1fullname, obj1type);
@@ -739,13 +676,12 @@ hsize_t h5diff(const char *fname1,
/* check if link itself exist */
if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) {
parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2);
- opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Object could not be found");
}
/* get info from link */
if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) {
parallel_print("Unable to get link info from <%s>\n", obj2fullname);
- goto done;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Lget_info failed");
}
info2_lp = info2_obj;
@@ -761,8 +697,7 @@ hsize_t h5diff(const char *fname1,
if(H5Oget_info_by_name(file2_id, obj2fullname, &oinfo2, H5P_DEFAULT) < 0) {
parallel_print("Error: Could not get file contents\n");
- opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Could not get file contents");
}
obj2type = (h5trav_type_t)oinfo2.type;
trav_info_add(info2_obj, obj2fullname, obj2type);
@@ -790,7 +725,7 @@ hsize_t h5diff(const char *fname1,
obj2type = H5TRAV_TYPE_GROUP;
}
-
+ h5diffdebug2("get any symbolic links info - errstat:%d\n", opts->err_stat);
/* get any symbolic links info */
l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, opts->follow_links);
l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, opts->follow_links);
@@ -814,8 +749,7 @@ hsize_t h5diff(const char *fname1,
/* treat dangling link as error */
if(opts->m_verbose)
parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname);
- opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: treat dangling link as error");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "treat dangling link as error");
}
else {
if(opts->m_verbose)
@@ -823,14 +757,13 @@ hsize_t h5diff(const char *fname1,
if (l_ret1 != 0 || l_ret2 != 0) {
nfound++;
print_found(nfound);
- goto done;
+ HGOTO_DONE(0);
}
}
}
else if(l_ret1 < 0) { /* fail */
parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1);
- opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Object could not be found");
}
else if(l_ret1 != 2) { /* symbolic link */
obj1type = (h5trav_type_t)trg_linfo1.trg_type;
@@ -857,23 +790,21 @@ hsize_t h5diff(const char *fname1,
/* treat dangling link as error */
if(opts->m_verbose)
parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname);
- opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: treat dangling link as error");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "treat dangling link as error");
}
else {
if(opts->m_verbose)
parallel_print("obj2 <%s> is a dangling link.\n", obj2fullname);
- if (l_ret1 != 0 || l_ret2 != 0) {
+ if (l_ret1 != 0 || l_ret2 != 0) {
nfound++;
print_found(nfound);
- goto done;
+ HGOTO_DONE(0);
}
}
}
else if(l_ret2 < 0) { /* fail */
parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2);
- opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Object could not be found");
}
else if(l_ret2 != 2) { /* symbolic link */
obj2type = (h5trav_type_t)trg_linfo2.trg_type;
@@ -899,9 +830,9 @@ hsize_t h5diff(const char *fname1,
if(!(opts->m_verbose || opts->m_report)) {
h5difftrace("h5diff NOT (opts->m_verbose || opts->m_report)\n");
/* if no danglink links */
- if ( l_ret1 > 0 && l_ret2 > 0 )
- if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname)!=0)
- goto done;
+ if (l_ret1 > 0 && l_ret2 > 0)
+ if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname) != 0)
+ HGOTO_DONE(0);
}
both_objs_grp = (obj1type == H5TRAV_TYPE_GROUP && obj2type == H5TRAV_TYPE_GROUP);
@@ -917,8 +848,7 @@ hsize_t h5diff(const char *fname1,
if(h5trav_visit(file1_id, obj1fullname, TRUE, TRUE,
trav_grp_objs, trav_grp_symlinks, info1_grp) < 0) {
parallel_print("Error: Could not get file contents\n");
- opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Could not get file contents");
}
info1_lp = info1_grp;
@@ -932,11 +862,11 @@ hsize_t h5diff(const char *fname1,
if(h5trav_visit(file2_id, obj2fullname, TRUE, TRUE,
trav_grp_objs, trav_grp_symlinks, info2_grp) < 0) {
parallel_print("Error: Could not get file contents\n");
- opts->err_stat = 1;
- HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Could not get file contents");
} /* end if */
info2_lp = info2_grp;
}
+ h5diffdebug2("groups traversed - errstat:%d\n", opts->err_stat);
#ifdef H5_HAVE_PARALLEL
if(g_Parallel) {
@@ -957,14 +887,12 @@ hsize_t h5diff(const char *fname1,
#endif
/* process the objects */
- build_match_list (obj1fullname, info1_lp, obj2fullname, info2_lp,
- &match_list, opts);
+ build_match_list (obj1fullname, info1_lp, obj2fullname, info2_lp, &match_list, opts);
if (both_objs_grp) {
/*------------------------------------------------------
* print the list
*/
- if(opts->m_verbose)
- {
+ if(opts->m_verbose) {
unsigned u;
parallel_print("\n");
@@ -988,6 +916,8 @@ hsize_t h5diff(const char *fname1,
match_list, opts);
done:
+ opts->err_stat = opts->err_stat | ret_value;
+
#ifdef H5_HAVE_PARALLEL
if(g_Parallel)
/* All done at this point, let tasks know that they won't be needed */
@@ -1022,6 +952,7 @@ done:
H5Fclose(file1_id);
H5Fclose(file2_id);
} H5E_END_TRY;
+
h5difftrace("h5diff finish\n");
return nfound;
@@ -1032,43 +963,34 @@ done:
/*-------------------------------------------------------------------------
* Function: diff_match
*
- * Purpose:
- * Compare common objects in given groups according to table structure.
- * The table structure has flags which can be used to find common objects
- * and will be compared.
- * Common object means same name (absolute path) objects in both location.
- *
- * Return: Number of differences found
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Purpose: Compare common objects in given groups according to table structure.
+ * The table structure has flags which can be used to find common objects
+ * and will be compared.
+ * Common object means same name (absolute path) objects in both location.
*
- * Date: May 9, 2003
+ * Return: Number of differences found
*
- * Modifications: Jan 2005 Leon Arber, larber@uiuc.edu
- * Added support for parallel diffing
- *
- * Pedro Vicente, pvn@hdfgroup.org, Nov 4, 2008
- * Compare the graph and make h5diff return 1 for difference if
- * 1) the number of objects in file1 is not the same as in file2
- * 2) the graph does not match, i.e same names (absolute path)
- * 3) objects with the same name are not of the same type
+ * Modifications: Compare the graph and make h5diff return 1 for difference if
+ * 1) the number of objects in file1 is not the same as in file2
+ * 2) the graph does not match, i.e same names (absolute path)
+ * 3) objects with the same name are not of the same type
*-------------------------------------------------------------------------
*/
-hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
+hsize_t
+diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
hid_t file2_id, const char *grp2, trav_info_t *info2,
- trav_table_t *table, diff_opt_t *options)
+ trav_table_t *table, diff_opt_t *opts)
{
hsize_t nfound = 0;
unsigned i;
-
- const char * grp1_path = "";
- const char * grp2_path = "";
- char * obj1_fullpath = NULL;
- char * obj2_fullpath = NULL;
- diff_args_t argdata;
- size_t idx1 = 0;
- size_t idx2 = 0;
-
+ int ret_value = opts->err_stat;
+ const char *grp1_path = "";
+ const char *grp2_path = "";
+ char *obj1_fullpath = NULL;
+ char *obj2_fullpath = NULL;
+ diff_args_t argdata;
+ size_t idx1 = 0;
+ size_t idx2 = 0;
h5difftrace("diff_match start\n");
/*
@@ -1081,85 +1003,89 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
grp2_path = grp2;
/*-------------------------------------------------------------------------
- * regarding the return value of h5diff (0, no difference in files, 1 difference )
- * 1) the number of objects in file1 must be the same as in file2
- * 2) the graph must match, i.e same names (absolute path)
- * 3) objects with the same name must be of the same type
- *-------------------------------------------------------------------------
- */
+ * regarding the return value of h5diff (0, no difference in files, 1 difference )
+ * 1) the number of objects in file1 must be the same as in file2
+ * 2) the graph must match, i.e same names (absolute path)
+ * 3) objects with the same name must be of the same type
+ *-------------------------------------------------------------------------
+ */
/* not valid compare used when --exclude-path option is used */
- if (!options->exclude_path)
- {
+ if (!opts->exclude_path) {
/* number of different objects */
- if ( info1->nused != info2->nused )
- {
- options->contents = 0;
+ if (info1->nused != info2->nused) {
+ opts->contents = 0;
}
}
/* objects in one file and not the other */
- for( i = 0; i < table->nobjs; i++)
- {
- if( table->objs[i].flags[0] != table->objs[i].flags[1] )
- {
- options->contents = 0;
+ for(i = 0; i < table->nobjs; i++) {
+ if(table->objs[i].flags[0] != table->objs[i].flags[1]) {
+ opts->contents = 0;
break;
}
}
-
/*-------------------------------------------------------------------------
- * do the diff for common objects
- *-------------------------------------------------------------------------
- */
+ * do the diff for common objects
+ *-------------------------------------------------------------------------
+ */
#ifdef H5_HAVE_PARALLEL
{
- char *workerTasks = (char*)HDmalloc((g_nTasks - 1) * sizeof(char));
- int n;
- int busyTasks = 0;
- struct diffs_found nFoundbyWorker;
- struct diff_mpi_args args;
- int havePrintToken = 1;
- MPI_Status Status;
-
- /*set all tasks as free */
- HDmemset(workerTasks, 1, (g_nTasks - 1));
+ char *workerTasks = (char*)HDmalloc((g_nTasks - 1) * sizeof(char));
+ int n;
+ int busyTasks = 0;
+ struct diffs_found nFoundbyWorker;
+ struct diff_mpi_args args;
+ int havePrintToken = 1;
+ MPI_Status Status;
+
+ /*set all tasks as free */
+ HDmemset(workerTasks, 1, (g_nTasks - 1));
#endif
- for(i = 0; i < table->nobjs; i++)
- {
- if( table->objs[i].flags[0] && table->objs[i].flags[1])
- {
+ for(i = 0; i < table->nobjs; i++) {
+ h5diffdebug3("diff for common objects[%d] - errstat:%d\n", i, opts->err_stat);
+ if(table->objs[i].flags[0] && table->objs[i].flags[1]) {
/* make full path for obj1 */
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
- if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0)
- goto out;
+ if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) {
+ HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ }
#else /* H5_HAVE_ASPRINTF */
- obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1);
- HDstrcpy(obj1_fullpath, grp1_path);
- HDstrcat(obj1_fullpath, table->objs[i].name);
+ if((obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) {
+ HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ }
+ else {
+ HDstrcpy(obj1_fullpath, grp1_path);
+ HDstrcat(obj1_fullpath, table->objs[i].name);
+ }
#endif /* H5_HAVE_ASPRINTF */
+ h5diffdebug2("diff_match path1 - %s\n", obj1_fullpath);
/* make full path for obj2 */
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
- if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0)
- goto out;
+ if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) {
+ HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ }
#else /* H5_HAVE_ASPRINTF */
- obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1);
- HDstrcpy(obj2_fullpath, grp2_path);
- HDstrcat(obj2_fullpath, table->objs[i].name);
+ if((obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) {
+ HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ }
+ else {
+ HDstrcpy(obj2_fullpath, grp2_path);
+ HDstrcat(obj2_fullpath, table->objs[i].name);
+ }
#endif /* H5_HAVE_ASPRINTF */
+ h5diffdebug2("diff_match path2 - %s\n", obj2_fullpath);
/* get index to figure out type of the object in file1 */
- while(info1->paths[idx1].path &&
- (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0))
+ while(info1->paths[idx1].path && (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0))
idx1++;
/* get index to figure out type of the object in file2 */
- while(info2->paths[idx2].path &&
- (HDstrcmp(obj2_fullpath, info2->paths[idx2].path) != 0))
+ while(info2->paths[idx2].path && (HDstrcmp(obj2_fullpath, info2->paths[idx2].path) != 0))
idx2++;
/* Set argdata to pass other args into diff() */
@@ -1167,16 +1093,14 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
argdata.type[1] = info2->paths[idx2].type;
argdata.is_same_trgobj = table->objs[i].is_same_trgobj;
- options->cmn_objs = 1;
- if(!g_Parallel)
- {
+ opts->cmn_objs = 1;
+ if(!g_Parallel) {
nfound += diff(file1_id, obj1_fullpath,
file2_id, obj2_fullpath,
- options, &argdata);
+ opts, &argdata);
} /* end if */
#ifdef H5_HAVE_PARALLEL
- else
- {
+ else {
int workerFound = 0;
h5difftrace("Beginning of big else block\n");
@@ -1190,8 +1114,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
/*Set up args to pass to worker task. */
if(HDstrlen(obj1_fullpath) > 255 ||
- HDstrlen(obj2_fullpath) > 255)
- {
+ HDstrlen(obj2_fullpath) > 255) {
printf("The parallel diff only supports object names up to 255 characters\n");
MPI_Abort(MPI_COMM_WORLD, 0);
} /* end if */
@@ -1199,32 +1122,29 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
/* set args struct to pass */
HDstrcpy(args.name1, obj1_fullpath);
HDstrcpy(args.name2, obj2_fullpath);
- args.options = *options;
+ args.opts = *opts;
args.argdata.type[0] = info1->paths[idx1].type;
args.argdata.type[1] = info2->paths[idx2].type;
args.argdata.is_same_trgobj = table->objs[i].is_same_trgobj;
/* if there are any outstanding print requests, let's handle one. */
- if(busyTasks > 0)
- {
+ if(busyTasks > 0) {
int incomingMessage;
/* check if any tasks freed up, and didn't need to print. */
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &incomingMessage, &Status);
/* first block*/
- if(incomingMessage)
- {
+ if(incomingMessage) {
workerTasks[Status.MPI_SOURCE - 1] = 1;
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
- options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
+ opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp;
busyTasks--;
} /* end if */
/* check to see if the print token was returned. */
- if(!havePrintToken)
- {
+ if(!havePrintToken) {
/* If we don't have the token, someone is probably sending us output */
print_incoming_data();
@@ -1236,19 +1156,17 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
workerTasks[Status.MPI_SOURCE - 1] = 1;
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
- options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
+ opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp;
busyTasks--;
havePrintToken = 1;
} /* end if */
} /* end if */
/* check to see if anyone needs the print token. */
- if(havePrintToken)
- {
+ if(havePrintToken) {
/* check incoming queue for print token requests */
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &incomingMessage, &Status);
- if(incomingMessage)
- {
+ if(incomingMessage) {
MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status);
MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD);
havePrintToken = 0;
@@ -1259,10 +1177,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
/* check array of tasks to see which ones are free.
* Manager task never does work, so freeTasks[0] is really
* worker task 0. */
- for(n = 1; (n < g_nTasks) && !workerFound; n++)
- {
- if(workerTasks[n-1])
- {
+ for(n = 1; (n < g_nTasks) && !workerFound; n++) {
+ if(workerTasks[n-1]) {
/* send file id's and names to first free worker */
MPI_Send(&args, sizeof(args), MPI_BYTE, n, MPI_TAG_ARGS, MPI_COMM_WORLD);
@@ -1275,55 +1191,47 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
} /* end if */
} /* end for */
- if(!workerFound)
- {
+ if(!workerFound) {
/* if they were all busy, we've got to wait for one free up
* before we can move on. If we don't have the token, some
* task is currently printing so we'll wait for that task to
* return it.
*/
- if(!havePrintToken)
- {
- while(!havePrintToken)
- {
+ if(!havePrintToken) {
+ while(!havePrintToken) {
int incomingMessage;
print_incoming_data();
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status);
- if(incomingMessage)
- {
+ if(incomingMessage) {
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status);
havePrintToken = 1;
nfound += nFoundbyWorker.nfound;
- options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
+ opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp;
/* send this task the work unit. */
MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD);
} /* end if */
} /* end while */
} /* end if */
/* if we do have the token, check for task to free up, or wait for a task to request it */
- else
- {
+ else {
/* But first print all the data in our incoming queue */
print_incoming_data();
MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &Status);
- if(Status.MPI_TAG == MPI_TAG_DONE)
- {
+ if(Status.MPI_TAG == MPI_TAG_DONE) {
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
- options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
+ opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp;
MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD);
} /* end if */
- else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST)
- {
+ else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) {
int incomingMessage;
MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status);
MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD);
- do
- {
+ do {
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status);
print_incoming_data();
@@ -1331,11 +1239,10 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
- options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
+ opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp;
MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD);
} /* end else-if */
- else
- {
+ else {
printf("ERROR: Invalid tag (%d) received \n", Status.MPI_TAG);
MPI_Abort(MPI_COMM_WORLD, 0);
MPI_Finalize();
@@ -1350,27 +1257,22 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
HDfree(obj2_fullpath);
} /* end if */
} /* end for */
- h5difftrace("done with for loop\n");
+ h5diffdebug2("done with for loop - errstat:%d\n", opts->err_stat);
#ifdef H5_HAVE_PARALLEL
- if(g_Parallel)
- {
+ if(g_Parallel) {
/* make sure all tasks are done */
- while(busyTasks > 0)
- {
+ while(busyTasks > 0) {
MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &Status);
- if(Status.MPI_TAG == MPI_TAG_DONE)
- {
+ if(Status.MPI_TAG == MPI_TAG_DONE) {
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
- options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
+ opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp;
busyTasks--;
} /* end if */
- else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST)
- {
+ else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) {
MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status);
- if(havePrintToken)
- {
+ if(havePrintToken) {
int incomingMessage;
MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD);
@@ -1383,17 +1285,15 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
- options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
+ opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp;
busyTasks--;
} /* end if */
/* someone else must have it...wait for them to return it, then give it to the task that just asked for it. */
- else
- {
+ else {
int source = Status.MPI_SOURCE;
int incomingMessage;
- do
- {
+ do {
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status);
print_incoming_data();
@@ -1402,21 +1302,19 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
- options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
+ opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp;
busyTasks--;
MPI_Send(NULL, 0, MPI_BYTE, source, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD);
} /* end else */
} /* end else-if */
- else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN)
- {
+ else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN) {
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
- options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
+ opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp;
busyTasks--;
havePrintToken = 1;
} /* end else-if */
- else if(Status.MPI_TAG == MPI_TAG_PRINT_DATA)
- {
+ else if(Status.MPI_TAG == MPI_TAG_PRINT_DATA) {
char data[PRINT_DATA_MAX_SIZE + 1];
HDmemset(data, 0, PRINT_DATA_MAX_SIZE + 1);
@@ -1424,8 +1322,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
printf("%s", data);
} /* end else-if */
- else
- {
+ else {
printf("ph5diff-manager: ERROR!! Invalid tag (%d) received \n", Status.MPI_TAG);
MPI_Abort(MPI_COMM_WORLD, 0);
} /* end else */
@@ -1444,10 +1341,12 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
#endif /* H5_HAVE_PARALLEL */
out:
- /* free table */
+ opts->err_stat = opts->err_stat | ret_value;
+
+/* free table */
if (table)
trav_table_free(table);
- h5difftrace("diff_match finish\n");
+ h5diffdebug2("diff_match finish:%d\n", nfound);
return nfound;
}
@@ -1456,47 +1355,36 @@ out:
/*-------------------------------------------------------------------------
* Function: diff
*
- * Purpose: switch between types and choose the diff function
- * TYPE is either
- * H5G_GROUP Object is a group
- * H5G_DATASET Object is a dataset
- * H5G_TYPE Object is a named data type
- * H5G_LINK Object is a symbolic link
- *
- * Return: Number of differences found
+ * Purpose: switch between types and choose the diff function
+ * TYPE is either
+ * H5G_GROUP Object is a group
+ * H5G_DATASET Object is a dataset
+ * H5G_TYPE Object is a named data type
+ * H5G_LINK Object is a symbolic link
*
- * Programmer: Jonathan Kim
- * - Move follow symlinks code toward top. (March 2812)
- * - Add following symlinks feature (Feb 11,2010)
- * - Change to use diff_args_t to pass the rest of args.
- * Passing through it instead of individual args provides smoother
- * extensibility through its members along with MPI code update for ph5diff
- * as it doesn't require interface change.
- * (May 6,2011)
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- * Date: May 9, 2003
+ * Return: Number of differences found
*-------------------------------------------------------------------------
*/
-
-hsize_t diff(hid_t file1_id,
+hsize_t
+diff(hid_t file1_id,
const char *path1,
hid_t file2_id,
const char *path2,
- diff_opt_t * options,
+ diff_opt_t * opts,
diff_args_t *argdata)
{
- hid_t dset1_id = (-1);
- hid_t dset2_id = (-1);
- hid_t type1_id = (-1);
- hid_t type2_id = (-1);
- hid_t grp1_id = (-1);
- hid_t grp2_id = (-1);
- int ret;
- hbool_t is_dangle_link1 = FALSE;
- hbool_t is_dangle_link2 = FALSE;
- hbool_t is_hard_link = FALSE;
- hsize_t nfound = 0;
+ int ret_value = opts->err_stat;
+ int status = -1;
+ hid_t dset1_id = -1;
+ hid_t dset2_id = -1;
+ hid_t type1_id = -1;
+ hid_t type2_id = -1;
+ hid_t grp1_id = -1;
+ hid_t grp2_id = -1;
+ hbool_t is_dangle_link1 = FALSE;
+ hbool_t is_dangle_link2 = FALSE;
+ hbool_t is_hard_link = FALSE;
+ hsize_t nfound = 0;
h5trav_type_t object_type;
/* to get link info */
@@ -1506,11 +1394,11 @@ hsize_t diff(hid_t file1_id,
h5difftrace("diff start\n");
/*init link info struct */
- HDmemset(&linkinfo1,0,sizeof(h5tool_link_info_t));
- HDmemset(&linkinfo2,0,sizeof(h5tool_link_info_t));
+ HDmemset(&linkinfo1, 0, sizeof(h5tool_link_info_t));
+ HDmemset(&linkinfo2, 0, sizeof(h5tool_link_info_t));
/* pass how to handle printing warnings to linkinfo option */
- if(print_warn(options))
+ if(print_warn(opts))
linkinfo1.opt.msg_mode = linkinfo2.opt.msg_mode = 1;
/* for symbolic links, take care follow symlink and no dangling link
@@ -1518,78 +1406,69 @@ hsize_t diff(hid_t file1_id,
if (argdata->type[0] == H5TRAV_TYPE_LINK ||
argdata->type[0] == H5TRAV_TYPE_UDLINK ||
argdata->type[1] == H5TRAV_TYPE_LINK ||
- argdata->type[1] == H5TRAV_TYPE_UDLINK )
- {
+ argdata->type[1] == H5TRAV_TYPE_UDLINK) {
/*
* check dangling links for path1 and path2
*/
/* target object1 - get type and name */
- ret = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, options->follow_links);
+ if ((status = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, opts->follow_links)) < 0)
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5tools_get_symlink_info failed");
+
/* dangling link */
- if (ret == 0)
- {
- if (options->no_dangle_links)
- {
+ if (status == 0) {
+ if (opts->no_dangle_links) {
/* dangling link is error */
- if(options->m_verbose)
+ if(opts->m_verbose)
parallel_print("Warning: <%s> is a dangling link.\n", path1);
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "dangling link is error");
}
else
is_dangle_link1 = TRUE;
}
- else if (ret < 0)
- goto out;
/* target object2 - get type and name */
- ret = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, options->follow_links );
+ if ((status = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, opts->follow_links)) < 0)
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5tools_get_symlink_info failed");
/* dangling link */
- if (ret == 0)
- {
- if (options->no_dangle_links)
- {
+ if (status == 0) {
+ if (opts->no_dangle_links) {
/* dangling link is error */
- if(options->m_verbose)
+ if(opts->m_verbose)
parallel_print("Warning: <%s> is a dangling link.\n", path2);
- goto out;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "dangling link is error");
}
else
is_dangle_link2 = TRUE;
}
- else if (ret < 0)
- goto out;
/* found dangling link */
- if (is_dangle_link1 || is_dangle_link2)
- goto out2;
+ if (is_dangle_link1 || is_dangle_link2) {
+ HGOTO_DONE(0);
+ }
/* follow symbolic link option */
- if (options->follow_links)
- {
+ if (opts->follow_links) {
if (linkinfo1.linfo.type == H5L_TYPE_SOFT ||
linkinfo1.linfo.type == H5L_TYPE_EXTERNAL)
argdata->type[0] = (h5trav_type_t)linkinfo1.trg_type;
- if (linkinfo2.linfo.type == H5L_TYPE_SOFT ||
- linkinfo2.linfo.type == H5L_TYPE_EXTERNAL)
+ if (linkinfo2.linfo.type == H5L_TYPE_SOFT || linkinfo2.linfo.type == H5L_TYPE_EXTERNAL)
argdata->type[1] = (h5trav_type_t)linkinfo2.trg_type;
}
}
/* if objects are not the same type */
- if (argdata->type[0] != argdata->type[1])
- {
- if (options->m_verbose||options->m_list_not_cmp)
- {
+ if (argdata->type[0] != argdata->type[1]) {
+ if (opts->m_verbose||opts->m_list_not_cmp) {
parallel_print("Not comparable: <%s> is of type %s and <%s> is of type %s\n",
path1, get_type(argdata->type[0]),
path2, get_type(argdata->type[1]));
}
- options->not_cmp=1;
+ opts->not_cmp = 1;
/* TODO: will need to update non-comparable is different
- * options->contents = 0;
+ * opts->contents = 0;
*/
- goto out2;
+ HGOTO_DONE(0);
}
else /* now both object types are same */
object_type = argdata->type[0];
@@ -1602,88 +1481,79 @@ hsize_t diff(hid_t file1_id,
*
* Perform this to match the outputs as bypassing.
*/
- if (argdata->is_same_trgobj)
- {
+ if (argdata->is_same_trgobj) {
h5difftrace("argdata->is_same_trgobj\n");
is_hard_link = (object_type == H5TRAV_TYPE_DATASET ||
object_type == H5TRAV_TYPE_NAMED_DATATYPE ||
object_type == H5TRAV_TYPE_GROUP);
- if (options->follow_links || is_hard_link)
- {
+ if (opts->follow_links || is_hard_link) {
/* print information is only verbose option is used */
- if(options->m_verbose || options->m_report)
- {
- switch(object_type)
- {
+ if(opts->m_verbose || opts->m_report) {
+ switch(object_type) {
case H5TRAV_TYPE_DATASET:
- do_print_objname("dataset", path1, path2, options);
+ do_print_objname("dataset", path1, path2, opts);
break;
case H5TRAV_TYPE_NAMED_DATATYPE:
- do_print_objname("datatype", path1, path2, options);
+ do_print_objname("datatype", path1, path2, opts);
break;
case H5TRAV_TYPE_GROUP:
- do_print_objname("group", path1, path2, options);
+ do_print_objname("group", path1, path2, opts);
break;
case H5TRAV_TYPE_LINK:
- do_print_objname("link", path1, path2, options);
+ do_print_objname("link", path1, path2, opts);
break;
case H5TRAV_TYPE_UDLINK:
if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL)
- do_print_objname("external link", path1, path2, options);
+ do_print_objname("external link", path1, path2, opts);
else
- do_print_objname ("user defined link", path1, path2, options);
+ do_print_objname ("user defined link", path1, path2, opts);
break;
case H5TRAV_TYPE_UNKNOWN:
default:
parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n",
path1, path2, get_type(object_type) );
- options->not_cmp = 1;
+ opts->not_cmp = 1;
break;
} /* switch(type)*/
print_found(nfound);
- } /* if(options->m_verbose || options->m_report) */
+ } /* if(opts->m_verbose || opts->m_report) */
/* exact same, so comparison is done */
- goto out2;
+ HGOTO_DONE(0);
}
}
- switch(object_type)
- {
+ switch(object_type) {
/*----------------------------------------------------------------------
* H5TRAV_TYPE_DATASET
*----------------------------------------------------------------------
*/
case H5TRAV_TYPE_DATASET:
if((dset1_id = H5Dopen2(file1_id, path1, H5P_DEFAULT)) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 failed");
if((dset2_id = H5Dopen2(file2_id, path2, H5P_DEFAULT)) < 0)
- goto out;
- /* verbose (-v) and report (-r) mode */
- if(options->m_verbose || options->m_report)
- {
- do_print_objname("dataset", path1, path2, options);
- nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 failed");
+ /* verbose (-v) and report (-r) mode */
+ if(opts->m_verbose || opts->m_report) {
+ do_print_objname("dataset", path1, path2, opts);
+ nfound = diff_dataset(file1_id, file2_id, path1, path2, opts);
print_found(nfound);
}
/* quiet mode (-q), just count differences */
- else if(options->m_quiet)
- {
- nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
+ else if(opts->m_quiet) {
+ nfound = diff_dataset(file1_id, file2_id, path1, path2, opts);
}
- /* the rest (-c, none, ...) */
- else
- {
- nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
+ /* the rest (-c, none, ...) */
+ else {
+ nfound = diff_dataset(file1_id, file2_id, path1, path2, opts);
/* print info if difference found */
- if (nfound)
- {
- do_print_objname("dataset", path1, path2, options);
+ if (nfound) {
+ do_print_objname("dataset", path1, path2, opts);
print_found(nfound);
}
}
-
+ h5diffdebug2("diff after dataset:%d\n", nfound);
/*---------------------------------------------------------
* compare attributes
@@ -1692,13 +1562,13 @@ hsize_t diff(hid_t file1_id,
*---------------------------------------------------------
*/
if(path1)
- nfound += diff_attr(dset1_id, dset2_id, path1, path2, options);
+ nfound += diff_attr(dset1_id, dset2_id, path1, path2, opts);
if(H5Dclose(dset1_id) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dclose failed");
if(H5Dclose(dset2_id) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dclose failed");
break;
/*----------------------------------------------------------------------
@@ -1707,21 +1577,21 @@ hsize_t diff(hid_t file1_id,
*/
case H5TRAV_TYPE_NAMED_DATATYPE:
if((type1_id = H5Topen2(file1_id, path1, H5P_DEFAULT)) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Topen2 failed");
if((type2_id = H5Topen2(file2_id, path2, H5P_DEFAULT)) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Topen2 failed");
- if((ret = H5Tequal(type1_id, type2_id)) < 0)
- goto out;
+ if((status = H5Tequal(type1_id, type2_id)) < 0)
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tequal failed");
/* if H5Tequal is > 0 then the datatypes refer to the same datatype */
- nfound = (ret > 0) ? 0 : 1;
+ nfound = (status > 0) ? 0 : 1;
- if(print_objname(options,nfound))
- do_print_objname("datatype", path1, path2, options);
+ if(print_objname(opts, nfound))
+ do_print_objname("datatype", path1, path2, opts);
/* always print the number of differences found in verbose mode */
- if(options->m_verbose)
+ if(opts->m_verbose)
print_found(nfound);
/*-----------------------------------------------------------------
@@ -1731,12 +1601,12 @@ hsize_t diff(hid_t file1_id,
*-----------------------------------------------------------------
*/
if(path1)
- nfound += diff_attr(type1_id, type2_id, path1, path2, options);
+ nfound += diff_attr(type1_id, type2_id, path1, path2, opts);
if(H5Tclose(type1_id) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose failed");
if(H5Tclose(type2_id) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose failed");
break;
/*----------------------------------------------------------------------
@@ -1744,17 +1614,17 @@ hsize_t diff(hid_t file1_id,
*----------------------------------------------------------------------
*/
case H5TRAV_TYPE_GROUP:
- if(print_objname(options, nfound))
- do_print_objname("group", path1, path2, options);
+ if(print_objname(opts, nfound))
+ do_print_objname("group", path1, path2, opts);
/* always print the number of differences found in verbose mode */
- if(options->m_verbose)
+ if(opts->m_verbose)
print_found(nfound);
if((grp1_id = H5Gopen2(file1_id, path1, H5P_DEFAULT)) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
if((grp2_id = H5Gopen2(file2_id, path2, H5P_DEFAULT)) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
/*-----------------------------------------------------------------
* compare attributes
@@ -1763,12 +1633,12 @@ hsize_t diff(hid_t file1_id,
*-----------------------------------------------------------------
*/
if(path1)
- nfound += diff_attr(grp1_id, grp2_id, path1, path2, options);
+ nfound += diff_attr(grp1_id, grp2_id, path1, path2, opts);
if(H5Gclose(grp1_id) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
if(H5Gclose(grp2_id) < 0)
- goto out;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
break;
@@ -1778,19 +1648,19 @@ hsize_t diff(hid_t file1_id,
*/
case H5TRAV_TYPE_LINK:
{
- ret = HDstrcmp(linkinfo1.trg_path, linkinfo2.trg_path);
+ status = HDstrcmp(linkinfo1.trg_path, linkinfo2.trg_path);
- /* if the target link name is not same then the links are "different" */
- nfound = (ret != 0) ? 1 : 0;
+ /* if the target link name is not same then the links are "different" */
+ nfound = (status != 0) ? 1 : 0;
- if(print_objname(options, nfound))
- do_print_objname("link", path1, path2, options);
+ if(print_objname(opts, nfound))
+ do_print_objname("link", path1, path2, opts);
- /* always print the number of differences found in verbose mode */
- if(options->m_verbose)
- print_found(nfound);
+ /* always print the number of differences found in verbose mode */
+ if(opts->m_verbose)
+ print_found(nfound);
- }
+ }
break;
/*----------------------------------------------------------------------
@@ -1799,101 +1669,85 @@ hsize_t diff(hid_t file1_id,
*/
case H5TRAV_TYPE_UDLINK:
{
- /* Only external links will have a query function registered */
- 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)
- {
- ret = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size);
- }
- else
- ret = 1;
+ /* Only external links will have a query function registered */
+ 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);
+ }
+ else
+ status = 1;
- /* if "linkinfo1.trg_path" != "linkinfo2.trg_path" then the links
- * are "different" extlinkinfo#.path is combination string of
- * file_name and obj_name
- */
- nfound = (ret != 0) ? 1 : 0;
+ /* if "linkinfo1.trg_path" != "linkinfo2.trg_path" then the links
+ * are "different" extlinkinfo#.path is combination string of
+ * file_name and obj_name
+ */
+ nfound = (status != 0) ? 1 : 0;
- if(print_objname(options, nfound))
- do_print_objname("external link", path1, path2, options);
+ if(print_objname(opts, nfound))
+ do_print_objname("external link", path1, path2, opts);
- } /* end if */
- else
- {
- /* If one or both of these links isn't an external link, we can only
- * compare information from H5Lget_info since we don't have a query
- * function registered for them.
- *
- * If the link classes or the buffer length are not the
- * same, the links are "different"
- */
- if((linkinfo1.linfo.type != linkinfo2.linfo.type) ||
- (linkinfo1.linfo.u.val_size != linkinfo2.linfo.u.val_size))
- nfound = 1;
- else
- nfound = 0;
-
- if (print_objname (options, nfound))
- do_print_objname ("user defined link", path1, path2, options);
- } /* end else */
+ } /* end if */
+ else {
+ /* If one or both of these links isn't an external link, we can only
+ * compare information from H5Lget_info since we don't have a query
+ * function registered for them.
+ *
+ * If the link classes or the buffer length are not the
+ * same, the links are "different"
+ */
+ if((linkinfo1.linfo.type != linkinfo2.linfo.type) ||
+ (linkinfo1.linfo.u.val_size != linkinfo2.linfo.u.val_size))
+ nfound = 1;
+ else
+ nfound = 0;
- /* always print the number of differences found in verbose mode */
- if(options->m_verbose)
- print_found(nfound);
+ if (print_objname (opts, nfound))
+ do_print_objname ("user defined link", path1, path2, opts);
+ } /* end else */
+
+ /* always print the number of differences found in verbose mode */
+ if(opts->m_verbose)
+ print_found(nfound);
}
break;
case H5TRAV_TYPE_UNKNOWN:
default:
- if(options->m_verbose)
+ if(opts->m_verbose)
parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n",
path1, path2, get_type(object_type) );
- options->not_cmp = 1;
+ opts->not_cmp = 1;
break;
}
- /* free link info buffer */
- if (linkinfo1.trg_path)
- HDfree(linkinfo1.trg_path);
- if (linkinfo2.trg_path)
- HDfree(linkinfo2.trg_path);
-
- return nfound;
-
-out:
- options->err_stat = 1;
+done:
+ opts->err_stat = opts->err_stat | ret_value;
-out2:
/*-----------------------------------
* handle dangling link(s)
*/
/* both path1 and path2 are dangling links */
- if(is_dangle_link1 && is_dangle_link2)
- {
- if(print_objname(options, nfound))
- {
- do_print_objname("dangling link", path1, path2, options);
+ if(is_dangle_link1 && is_dangle_link2) {
+ if(print_objname(opts, nfound)) {
+ do_print_objname("dangling link", path1, path2, opts);
print_found(nfound);
}
}
/* path1 is dangling link */
- else if (is_dangle_link1)
- {
- if(options->m_verbose)
+ else if (is_dangle_link1) {
+ if(opts->m_verbose)
parallel_print("obj1 <%s> is a dangling link.\n", path1);
nfound++;
- if(print_objname(options, nfound))
+ if(print_objname(opts, nfound))
print_found(nfound);
}
/* path2 is dangling link */
- else if (is_dangle_link2)
- {
- if(options->m_verbose)
+ else if (is_dangle_link2) {
+ if(opts->m_verbose)
parallel_print("obj2 <%s> is a dangling link.\n", path2);
nfound++;
- if(print_objname(options, nfound))
+ if(print_objname(opts, nfound))
print_found(nfound);
}
@@ -1906,13 +1760,16 @@ out2:
/* close */
/* disable error reporting */
H5E_BEGIN_TRY {
+ H5Dclose(dset1_id);
+ H5Dclose(dset2_id);
H5Tclose(type1_id);
H5Tclose(type2_id);
H5Gclose(grp1_id);
- H5Tclose(grp2_id);
+ H5Gclose(grp2_id);
/* enable error reporting */
} H5E_END_TRY;
- h5difftrace("diff finish\n");
+
+ h5diffdebug3("diff finish:%d - errstat:%d\n", nfound, opts->err_stat);
return nfound;
}
diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h
index 0226e83..26bcd95 100644
--- a/tools/lib/h5diff.h
+++ b/tools/lib/h5diff.h
@@ -38,7 +38,7 @@
/*-------------------------------------------------------------------------
* This is used to pass multiple args into diff().
- * Passing this instead of several each arg provides smoother extensibility
+ * Passing this instead of several each arg provides smoother extensibility
* through its members along with MPI code for ph5diff
* as it doesn't require interface change.
*------------------------------------------------------------------------*/
@@ -95,13 +95,13 @@ H5TOOLS_DLL hsize_t h5diff(const char *fname1,
const char *fname2,
const char *objname1,
const char *objname2,
- diff_opt_t *options);
+ diff_opt_t *opts);
H5TOOLS_DLL hsize_t diff( hid_t file1_id,
const char *path1,
hid_t file2_id,
const char *path2,
- diff_opt_t *options,
+ diff_opt_t *opts,
diff_args_t *argdata);
#ifdef H5_HAVE_PARALLEL
@@ -125,18 +125,18 @@ hsize_t diff_dataset( hid_t file1_id,
hid_t file2_id,
const char *obj1_name,
const char *obj2_name,
- diff_opt_t *options);
+ diff_opt_t *opts);
hsize_t diff_datasetid( hid_t dset1_id,
hid_t dset2_id,
const char *obj1_name,
const char *obj2_name,
- diff_opt_t *options);
+ diff_opt_t *opts);
hsize_t diff_match( hid_t file1_id, const char *grp1, trav_info_t *info1,
hid_t file2_id, const char *grp2, trav_info_t *info2,
- trav_table_t *table, diff_opt_t *options );
+ trav_table_t *table, diff_opt_t *opts );
hsize_t diff_array( void *_mem1,
void *_mem2,
@@ -144,7 +144,7 @@ hsize_t diff_array( void *_mem1,
hsize_t hyper_start,
int rank,
hsize_t *dims,
- diff_opt_t *options,
+ diff_opt_t *opts,
const char *name1,
const char *name2,
hid_t m_type,
@@ -162,7 +162,7 @@ int diff_can_type( hid_t f_type1, /* file data type */
hsize_t *maxdim2,
const char *obj1_name,
const char *obj2_name,
- diff_opt_t *options,
+ diff_opt_t *opts,
int is_compound);
@@ -170,7 +170,7 @@ hsize_t diff_attr(hid_t loc1_id,
hid_t loc2_id,
const char *path1,
const char *path2,
- diff_opt_t *options);
+ diff_opt_t *opts);
/*-------------------------------------------------------------------------
@@ -187,10 +187,10 @@ const char* get_class(H5T_class_t tclass);
const char* get_sign(H5T_sign_t sign);
void print_dimensions (int rank, hsize_t *dims);
herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
- hid_t *m_tid1, hid_t *m_tid2,
+ hid_t *m_tid1, hid_t *m_tid2,
size_t *m_size1, size_t *m_size2);
/* in h5diff.c */
-int print_objname(diff_opt_t *options, hsize_t nfound);
+int print_objname(diff_opt_t *opts, hsize_t nfound);
void do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts);
void do_print_attrname (const char *attr, const char *path1, const char *path2);
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 09894e6..11f5e41 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -131,21 +131,21 @@ typedef struct mcomp_t {
*-------------------------------------------------------------------------
*/
static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id,
- hid_t region2_id, diff_opt_t *options);
+ hid_t region2_id, diff_opt_t *opts);
static hbool_t all_zero(const void *_mem, size_t size);
static int ull2float(unsigned long long ull_value, float *f_value);
static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u,
int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos,
- diff_opt_t *options, const char *obj1, const char *obj2, int *ph);
+ diff_opt_t *opts, const char *obj1, const char *obj2, int *ph);
static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2,
hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos,
- diff_opt_t *options, const char *obj1, const char *obj2, int *ph);
-static hbool_t equal_float(float value, float expected, diff_opt_t *options);
-static hbool_t equal_double(double value, double expected, diff_opt_t *options);
+ diff_opt_t *opts, const char *obj1, const char *obj2, int *ph);
+static hbool_t equal_float(float value, float expected, diff_opt_t *opts);
+static hbool_t equal_double(double value, double expected, diff_opt_t *opts);
#if H5_SIZEOF_LONG_DOUBLE !=0
-static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options);
+static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts);
#endif
-static int print_data(diff_opt_t *options);
+static int print_data(diff_opt_t *opts);
static void print_pos(int *ph, int pp, hsize_t curr_pos, hsize_t *acc,
hsize_t *pos, int rank, hsize_t *dims, const char *obj1,
const char *obj2);
@@ -155,17 +155,17 @@ static void print_char_pos(int *ph, int pp, hsize_t curr_pos, size_t u,
static void h5diff_print_char(char ch);
static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index,
int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos,
- diff_opt_t *options, const char *obj1, const char *obj2,
+ diff_opt_t *opts, const char *obj1, const char *obj2,
hid_t container1_id, hid_t container2_id, /*where the reference came from*/
int *ph, /*print header */
mcomp_t *members); /*compound members */
static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
#if H5_SIZEOF_LONG_DOUBLE !=0
static hsize_t diff_ldouble(unsigned char *mem1,
@@ -176,50 +176,50 @@ static hsize_t diff_ldouble(unsigned char *mem1,
hsize_t *dims,
hsize_t *acc,
hsize_t *pos,
- diff_opt_t *options,
+ diff_opt_t *opts,
const char *obj1,
const char *obj2,
int *ph);
#endif
static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph);
/*-------------------------------------------------------------------------
@@ -256,11 +256,6 @@ static void close_member_types(mcomp_t *members);
* Purpose: compare two memory buffers;
*
* Return: number of differences found
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: November 12, 2003
- *
*-------------------------------------------------------------------------
*/
@@ -271,7 +266,7 @@ hsize_t diff_array(
hsize_t hyper_start,
int rank,
hsize_t *dims,
- diff_opt_t *options,
+ diff_opt_t *opts,
const char *name1,
const char *name2,
hid_t m_type,
@@ -290,7 +285,7 @@ hsize_t diff_array(
mcomp_t members;
H5T_class_t type_class;
- h5difftrace("diff_array start\n");
+ h5diffdebug2("diff_array start - errstat:%d\n", opts->err_stat);
/* get the size. */
size = H5Tget_size(m_type);
type_class = H5Tget_class(m_type);
@@ -329,36 +324,36 @@ hsize_t diff_array(
*/
case H5T_FLOAT:
if (H5Tequal(m_type, H5T_NATIVE_FLOAT))
- nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE))
- nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
#if H5_SIZEOF_LONG_DOUBLE != 0
else if (H5Tequal(m_type, H5T_NATIVE_LDOUBLE))
- nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
#endif
break;
case H5T_INTEGER:
if (H5Tequal(m_type, H5T_NATIVE_SCHAR))
- nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
else if (H5Tequal(m_type, H5T_NATIVE_UCHAR))
- nfound = diff_uchar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_uchar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
else if (H5Tequal(m_type, H5T_NATIVE_SHORT))
- nfound = diff_short(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_short(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
else if (H5Tequal(m_type, H5T_NATIVE_USHORT))
- nfound = diff_ushort(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_ushort(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
else if (H5Tequal(m_type, H5T_NATIVE_INT))
- nfound = diff_int(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_int(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
else if (H5Tequal(m_type, H5T_NATIVE_UINT))
- nfound = diff_uint(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_uint(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
else if (H5Tequal(m_type, H5T_NATIVE_LONG))
- nfound = diff_long(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_long(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
else if (H5Tequal(m_type, H5T_NATIVE_ULONG))
- nfound = diff_ulong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_ulong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
else if (H5Tequal(m_type, H5T_NATIVE_LLONG))
- nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
else if (H5Tequal(m_type, H5T_NATIVE_ULLONG))
- nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph);
+ nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph);
break;
/*-------------------------------------------------------------------------
@@ -376,16 +371,14 @@ hsize_t diff_array(
HDmemset(&members, 0, sizeof(mcomp_t));
get_member_types(m_type, &members);
for (i = 0; i < nelmts; i++) {
- nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, options,
+ nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, opts,
name1, name2, container1_id, container2_id, &ph, &members);
- if (options->n && nfound >= options->count) {
- close_member_types(&members);
- return nfound;
- }
+ if (opts->n && nfound >= opts->count)
+ break;
} /* i */
close_member_types(&members);
} /* switch */
- h5difftrace("diff_array finish\n");
+ h5diffdebug3("diff_array finish:%d - errstat:%d\n", nfound, opts->err_stat);
return nfound;
}
@@ -397,10 +390,6 @@ hsize_t diff_array(
*
* Return: number of differences found
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: October 29, 2003
- *
* The comparison of the 2 buffers read from the files is made datum by datum.
*
* H5T_INTEGER and H5T_FLOAT
@@ -436,18 +425,17 @@ static hsize_t diff_datum(
hsize_t *dims,
hsize_t *acc,
hsize_t *pos,
- diff_opt_t *options,
+ diff_opt_t *opts,
const char *obj1,
const char *obj2,
hid_t container1_id,
hid_t container2_id, /*where the reference came from*/
- int *ph, /*print header */
- mcomp_t *members) /*compound members */
+ int *ph, /*print header */
+ mcomp_t *members) /*compound members */
{
unsigned char *mem1 = (unsigned char*) _mem1;
unsigned char *mem2 = (unsigned char*) _mem2;
size_t u;
- hid_t memb_type;
size_t type_size;
H5T_sign_t type_sign;
H5T_class_t type_class;
@@ -458,14 +446,13 @@ static hsize_t diff_datum(
size_t size = 0;
hbool_t iszero1;
hbool_t iszero2;
- hid_t obj1_id;
- hid_t obj2_id;
- hsize_t nfound = 0; /* differences found */
- int ret = 0; /* check return error */
+ hsize_t nfound = 0; /* differences found */
+ hsize_t ret_value = opts->err_stat;
double per;
hbool_t both_zero;
h5difftrace("diff_datum start\n");
+
type_size = H5Tget_size(m_type);
type_class = H5Tget_class(m_type);
@@ -478,14 +465,14 @@ static hsize_t diff_datum(
type_class != H5T_STRING &&
type_class != H5T_VLEN &&
HDmemcmp(mem1, mem2, type_size) == 0)
- return 0;
+ HGOTO_DONE(opts->err_stat);
switch (H5Tget_class(m_type)) {
case H5T_NO_CLASS:
case H5T_TIME:
case H5T_NCLASSES:
default:
- HDassert(0);
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Invalid type class");
break;
/*-------------------------------------------------------------------------
@@ -494,15 +481,17 @@ static hsize_t diff_datum(
*/
case H5T_COMPOUND:
h5difftrace("diff_datum H5T_COMPOUND\n");
+ {
+ hid_t memb_type = -1;
+ nmembs = members->n;
- nmembs = members->n;
-
- for (j = 0; j < nmembs; j++) {
- offset = members->offsets[j];
- memb_type = members->ids[j];
+ for (j = 0; j < nmembs; j++) {
+ offset = members->offsets[j];
+ memb_type = members->ids[j];
- nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, index,
- rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members->m[j]);
+ nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, index,
+ rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members->m[j]);
+ }
}
break;
@@ -532,6 +521,7 @@ static hsize_t diff_datum(
size1 = HDstrlen(s1);
else
size1 = 0;
+
/* Get pointer to second string */
s2 = *(char**) mem2;
if (s2)
@@ -547,14 +537,17 @@ static hsize_t diff_datum(
size1 = HDstrlen(s1);
else
size1 = 0;
+
if (size1 > size_mtype)
size1 = size_mtype;
+
/* Get pointer to second string */
s2 = (char*) mem2;
if (s2)
size2 = HDstrlen(s2);
else
size2 = 0;
+
if (size2 > size_mtype)
size2 = size_mtype;
}
@@ -562,6 +555,7 @@ static hsize_t diff_datum(
/* Get pointer to first string */
s1 = (char *) mem1;
size1 = size_mtype;
+
/* Get pointer to second string */
s2 = (char *) mem2;
size2 = size_mtype;
@@ -573,8 +567,8 @@ static hsize_t diff_datum(
* of length of strings.
* For now mimic the previous way.
*/
- h5diffdebug2("diff_datum string size:%d\n",size1);
- h5diffdebug2("diff_datum string size:%d\n",size2);
+ h5diffdebug2("diff_datum string size:%d\n", size1);
+ h5diffdebug2("diff_datum string size:%d\n", size2);
if (size1 != size2) {
h5difftrace("diff_datum string sizes\n");
nfound++;
@@ -595,15 +589,15 @@ static hsize_t diff_datum(
/* check for NULL pointer for string */
if (s != NULL) {
/* try fast compare first */
- if (HDmemcmp(s1, s2, size) == 0) {
+ if (HDmemcmp(s, sx, size) == 0) {
if (size1 != size2)
- if (print_data(options))
+ if (print_data(opts))
for (u = size; u < sizex; u++)
- character_compare(s1 + u, s2 + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph);
+ character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, opts, obj1, obj2, ph);
}
else
for (u = 0; u < size; u++)
- nfound += character_compare(s1 + u, s2 + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph);
+ nfound += character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, opts, obj1, obj2, ph);
} /* end check for NULL pointer for string */
}
break;
@@ -616,7 +610,7 @@ static hsize_t diff_datum(
h5difftrace("diff_datum H5T_BITFIELD\n");
/* byte-by-byte comparison */
for (u = 0; u < type_size; u++)
- nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph);
+ nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph);
break;
/*-------------------------------------------------------------------------
@@ -627,7 +621,7 @@ static hsize_t diff_datum(
h5difftrace("diff_datum H5T_OPAQUE\n");
/* byte-by-byte comparison */
for (u = 0; u < type_size; u++)
- nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph);
+ nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph);
break;
/*-------------------------------------------------------------------------
@@ -667,7 +661,7 @@ static hsize_t diff_datum(
* don't attempt to convert them - just report errors.
*/
nfound += 1;
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(S_FORMAT, enum_name1, enum_name2);
@@ -677,7 +671,7 @@ static hsize_t diff_datum(
/* Both enum values were valid */
if (HDstrcmp(enum_name1, enum_name2) != 0) {
nfound = 1;
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(S_FORMAT, enum_name1, enum_name2);
@@ -685,7 +679,7 @@ static hsize_t diff_datum(
}
else {
for (u = 0; u < type_size; u++)
- nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph);
+ nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph);
}
}
/* enable error reporting */
@@ -699,8 +693,9 @@ static hsize_t diff_datum(
*/
case H5T_ARRAY:
{
+ hid_t memb_type = -1;
hsize_t adims[H5S_MAX_RANK];
- int ndims;
+ int ndims;
/* get the array's base datatype for each element */
memb_type = H5Tget_super(m_type);
@@ -714,7 +709,7 @@ static hsize_t diff_datum(
nelmts *= adims[u];
for (u = 0; u < nelmts; u++) {
nfound += diff_datum(mem1 + u * size, mem2 + u * size, memb_type, index,
- rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members);
+ rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members);
}
H5Tclose(memb_type);
}
@@ -728,7 +723,8 @@ static hsize_t diff_datum(
iszero1 = all_zero(_mem1, H5Tget_size(m_type));
iszero2 = all_zero(_mem2, H5Tget_size(m_type));
if (iszero1 != iszero2) {
- return 1;
+ nfound++;
+ HGOTO_DONE (opts->err_stat);
}
else if (!iszero1 && !iszero2) {
/*-------------------------------------------------------------------------
@@ -736,25 +732,32 @@ static hsize_t diff_datum(
* Dataset region reference
*-------------------------------------------------------------------------
*/
- if (type_size == H5R_DSET_REG_REF_BUF_SIZE) {
- hid_t region1_id;
- hid_t region2_id;
+ hid_t obj1_id = -1;
+ hid_t obj2_id = -1;
- if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem1)) < 0)
- ret = -1;
- if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem2)) < 0)
- ret = -1;
- if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0)
- ret = -1;
- if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0)
- ret = -1;
+ if (type_size == H5R_DSET_REG_REF_BUF_SIZE) {
+ hid_t region1_id = -1;
+ hid_t region2_id = -1;
- if (ret == -1) {
- options->err_stat = 1;
- return 0;
+ if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem1)) < 0) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 1 failed");
+ }
+ if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem2)) < 0) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 2 failed");
+ }
+ if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_region object 1 failed");
}
+ if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_region object 2 failed");
+ }
+
+ nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts);
- nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, options);
H5Oclose(obj1_id);
H5Oclose(obj2_id);
H5Sclose(region1_id);
@@ -770,41 +773,41 @@ static hsize_t diff_datum(
H5O_type_t obj1_type;
H5O_type_t obj2_type;
- if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0)
- ret = -1;
- if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0)
- ret = -1;
- if (ret == -1) {
- options->err_stat = 1;
- return 0;
- } /* end if */
+ if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type2 object 1 failed");
+ }
+ if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type2 object 2 failed");
+ }
/* check object type */
- if (obj1_type != obj2_type) {
- parallel_print(
- "Different object types referenced: <%s> and <%s>", obj1, obj2);
- options->not_cmp = 1;
- return 0;
- }
+ if (ret_value >= 0)
+ if (obj1_type != obj2_type) {
+ parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2);
+ opts->not_cmp = 1;
+ HGOTO_DONE (opts->err_stat);
+ }
- if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0)
- ret = -1;
- if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_OBJECT, _mem2)) < 0)
- ret = -1;
- if (ret == -1) {
- options->err_stat = 1;
- return 0;
+ if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 1 failed");
+ }
+ if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_OBJECT, _mem2)) < 0) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference2 object 2 failed");
}
/* compare */
if (obj1_type == H5O_TYPE_DATASET)
- nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, options);
+ nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, opts);
else {
- if (options->m_verbose)
+ if (opts->m_verbose)
parallel_print(
"Warning: Comparison not possible of object types referenced: <%s> and <%s>\n",
obj1, obj2);
- options->not_cmp = 1;
+ opts->not_cmp = 1;
}
H5Oclose(obj1_id);
@@ -818,18 +821,22 @@ static hsize_t diff_datum(
*-------------------------------------------------------------------------
*/
case H5T_VLEN:
- /* get the VL sequences's base datatype for each element */
- memb_type = H5Tget_super(m_type);
- size = H5Tget_size(memb_type);
+ {
+ hid_t memb_type = -1;
- /* get the number of sequence elements */
- nelmts = ((hvl_t *) mem1)->len;
+ /* get the VL sequences's base datatype for each element */
+ memb_type = H5Tget_super(m_type);
+ size = H5Tget_size(memb_type);
- for (j = 0; j < nelmts; j++)
- nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index,
- rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members);
+ /* get the number of sequence elements */
+ nelmts = ((hvl_t *) mem1)->len;
- H5Tclose(memb_type);
+ for (j = 0; j < nelmts; j++)
+ nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index,
+ rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members);
+
+ H5Tclose(memb_type);
+ }
break;
/*-------------------------------------------------------------------------
@@ -845,13 +852,15 @@ static hsize_t diff_datum(
if (type_size == 1 && type_sign != H5T_SGN_NONE) {
char temp1_char;
char temp2_char;
- HDassert(type_size == sizeof(char));
+
+ if(type_size != sizeof(char))
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not char size");
HDmemcpy(&temp1_char, mem1, sizeof(char));
HDmemcpy(&temp2_char, mem2, sizeof(char));
/* -d and !-p */
- if (options->d && !options->p) {
- if (ABS(temp1_char-temp2_char) > options->delta) {
- if (print_data(options)) {
+ if (opts->d && !opts->p) {
+ if (ABS(temp1_char-temp2_char) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
@@ -860,19 +869,19 @@ static hsize_t diff_datum(
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
PER(temp1_char, temp2_char);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per);
@@ -881,19 +890,19 @@ static hsize_t diff_datum(
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
PER(temp1_char, temp2_char);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_char - temp2_char) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per);
@@ -902,7 +911,7 @@ static hsize_t diff_datum(
}
}
else if (temp1_char != temp2_char) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
@@ -918,14 +927,16 @@ static hsize_t diff_datum(
else if (type_size == 1 && type_sign == H5T_SGN_NONE) {
unsigned char temp1_uchar;
unsigned char temp2_uchar;
- HDassert(type_size == sizeof(unsigned char));
+
+ if(type_size != sizeof(unsigned char))
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned char size");
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
/* -d and !-p */
- if (options->d && !options->p) {
- if (PDIFF(temp1_uchar, temp2_uchar) > options->delta) {
- if (print_data(options)) {
+ if (opts->d && !opts->p) {
+ if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
@@ -934,19 +945,19 @@ static hsize_t diff_datum(
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
PER_UNSIGN(signed char, temp1_uchar, temp2_uchar);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per);
@@ -955,19 +966,19 @@ static hsize_t diff_datum(
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
PER_UNSIGN(signed char, temp1_uchar, temp2_uchar);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
}
nfound++;
}
- else if (per > options->percent && PDIFF(temp1_uchar, temp2_uchar) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per);
@@ -976,7 +987,7 @@ static hsize_t diff_datum(
}
}
else if (temp1_uchar != temp2_uchar) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
@@ -992,14 +1003,16 @@ static hsize_t diff_datum(
else if (type_size == 2 && type_sign != H5T_SGN_NONE) {
short temp1_short;
short temp2_short;
- HDassert(type_size == sizeof(short));
+
+ if(type_size != sizeof(short))
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not short size");
HDmemcpy(&temp1_short, mem1, sizeof(short));
HDmemcpy(&temp2_short, mem2, sizeof(short));
/* -d and !-p */
- if (options->d && !options->p) {
- if (ABS(temp1_short - temp2_short) > options->delta) {
- if (print_data(options)) {
+ if (opts->d && !opts->p) {
+ if (ABS(temp1_short - temp2_short) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
@@ -1008,19 +1021,19 @@ static hsize_t diff_datum(
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
PER(temp1_short, temp2_short);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per);
@@ -1029,19 +1042,19 @@ static hsize_t diff_datum(
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
PER(temp1_short, temp2_short);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_short - temp2_short) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per);
@@ -1050,7 +1063,7 @@ static hsize_t diff_datum(
}
}
else if (temp1_short != temp2_short) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
@@ -1066,14 +1079,16 @@ static hsize_t diff_datum(
else if (type_size == 2 && type_sign == H5T_SGN_NONE) {
unsigned short temp1_ushort;
unsigned short temp2_ushort;
- HDassert(type_size == sizeof(short));
+
+ if(type_size != sizeof(unsigned short))
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned short size");
HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
/* -d and !-p */
- if (options->d && !options->p) {
- if (PDIFF(temp1_ushort, temp2_ushort) > options->delta) {
- if (print_data(options)) {
+ if (opts->d && !opts->p) {
+ if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
@@ -1082,19 +1097,19 @@ static hsize_t diff_datum(
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
PER_UNSIGN(signed short, temp1_ushort, temp2_ushort);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per);
@@ -1103,19 +1118,19 @@ static hsize_t diff_datum(
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
PER_UNSIGN(signed short, temp1_ushort, temp2_ushort);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
}
nfound++;
}
- else if (per > options->percent && PDIFF(temp1_ushort, temp2_ushort) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per);
@@ -1124,7 +1139,7 @@ static hsize_t diff_datum(
}
}
else if (temp1_ushort != temp2_ushort) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
@@ -1140,14 +1155,16 @@ static hsize_t diff_datum(
else if (type_size == 4 && type_sign != H5T_SGN_NONE) {
int temp1_int;
int temp2_int;
- HDassert(type_size == sizeof(int));
+
+ if(type_size != sizeof(int))
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not int size");
HDmemcpy(&temp1_int, mem1, sizeof(int));
HDmemcpy(&temp2_int, mem2, sizeof(int));
/* -d and !-p */
- if (options->d && !options->p) {
- if (ABS(temp1_int-temp2_int) > options->delta) {
- if (print_data(options)) {
+ if (opts->d && !opts->p) {
+ if (ABS(temp1_int-temp2_int) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
@@ -1156,19 +1173,19 @@ static hsize_t diff_datum(
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
PER(temp1_int, temp2_int);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per);
@@ -1177,19 +1194,19 @@ static hsize_t diff_datum(
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
PER(temp1_int, temp2_int);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_int - temp2_int) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per);
@@ -1198,7 +1215,7 @@ static hsize_t diff_datum(
}
}
else if (temp1_int != temp2_int) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
@@ -1214,14 +1231,16 @@ static hsize_t diff_datum(
else if (type_size == 4 && type_sign == H5T_SGN_NONE) {
unsigned int temp1_uint;
unsigned int temp2_uint;
- HDassert(type_size == sizeof(int));
+
+ if(type_size != sizeof(unsigned int))
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned int size");
HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
/* -d and !-p */
- if (options->d && !options->p) {
- if (PDIFF(temp1_uint, temp2_uint) > options->delta) {
- if (print_data(options)) {
+ if (opts->d && !opts->p) {
+ if (PDIFF(temp1_uint, temp2_uint) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
@@ -1230,19 +1249,19 @@ static hsize_t diff_datum(
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
PER_UNSIGN(signed int, temp1_uint, temp2_uint);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per);
@@ -1251,19 +1270,19 @@ static hsize_t diff_datum(
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
PER_UNSIGN(signed int, temp1_uint, temp2_uint);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
}
nfound++;
}
- else if (per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && PDIFF(temp1_uint,temp2_uint) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per);
@@ -1272,7 +1291,7 @@ static hsize_t diff_datum(
}
}
else if (temp1_uint != temp2_uint) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
@@ -1288,14 +1307,16 @@ static hsize_t diff_datum(
else if (type_size == 8 && type_sign != H5T_SGN_NONE) {
long temp1_long;
long temp2_long;
- HDassert(type_size == sizeof(long));
+
+ if(type_size != sizeof(long))
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not long size");
HDmemcpy(&temp1_long, mem1, sizeof(long));
HDmemcpy(&temp2_long, mem2, sizeof(long));
/* -d and !-p */
- if (options->d && !options->p) {
- if (ABS(temp1_long-temp2_long) > options->delta) {
- if (print_data(options)) {
+ if (opts->d && !opts->p) {
+ if (ABS(temp1_long-temp2_long) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
@@ -1304,19 +1325,19 @@ static hsize_t diff_datum(
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
PER(temp1_long, temp2_long);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per);
@@ -1325,19 +1346,19 @@ static hsize_t diff_datum(
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
PER(temp1_long, temp2_long);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_long-temp2_long) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per);
@@ -1346,7 +1367,7 @@ static hsize_t diff_datum(
}
}
else if (temp1_long != temp2_long) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
@@ -1362,14 +1383,16 @@ static hsize_t diff_datum(
else if (type_size == 8 && type_sign == H5T_SGN_NONE) {
unsigned long temp1_ulong;
unsigned long temp2_ulong;
- HDassert(type_size == sizeof(unsigned long));
+
+ if(type_size != sizeof(unsigned long))
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned long size");
HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
/* -d and !-p */
- if (options->d && !options->p) {
- if (PDIFF(temp1_ulong, temp2_ulong) > options->delta) {
- if (print_data(options)) {
+ if (opts->d && !opts->p) {
+ if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
@@ -1378,19 +1401,19 @@ static hsize_t diff_datum(
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
PER_UNSIGN(signed long, temp1_ulong, temp2_ulong);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per);
@@ -1399,19 +1422,19 @@ static hsize_t diff_datum(
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
PER_UNSIGN(signed long, temp1_ulong, temp2_ulong);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
}
nfound++;
}
- else if (per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per);
@@ -1420,7 +1443,7 @@ static hsize_t diff_datum(
}
}
else if (temp1_ulong != temp2_ulong) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
@@ -1445,31 +1468,32 @@ static hsize_t diff_datum(
hbool_t isnan1 = FALSE;
hbool_t isnan2 = FALSE;
- HDassert(type_size == sizeof(float));
+ if(type_size != sizeof(float))
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not float size");
HDmemcpy(&temp1_float, mem1, sizeof(float));
HDmemcpy(&temp2_float, mem2, sizeof(float));
- /* logic for detecting NaNs is different with options -d, -p and no options */
+ /* logic for detecting NaNs is different with opts -d, -p and no opts */
/*-------------------------------------------------------------------------
* -d and !-p
*-------------------------------------------------------------------------
*/
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
}
/* both not NaN, do the comparison */
if (!isnan1 && !isnan2) {
- if (ABS(temp1_float-temp2_float) > (float) options->delta) {
- if (print_data(options)) {
+ if (ABS(temp1_float-temp2_float) > (float) opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
@@ -1479,7 +1503,7 @@ static hsize_t diff_datum(
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
@@ -1491,12 +1515,12 @@ static hsize_t diff_datum(
* !-d and -p
*-------------------------------------------------------------------------
*/
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
}
@@ -1506,15 +1530,15 @@ static hsize_t diff_datum(
PER(temp1_float, temp2_float);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
nfound++;
}
- else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float,
@@ -1525,7 +1549,7 @@ static hsize_t diff_datum(
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
@@ -1537,12 +1561,12 @@ static hsize_t diff_datum(
* -d and -p
*-------------------------------------------------------------------------
*/
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
}
@@ -1552,15 +1576,15 @@ static hsize_t diff_datum(
PER(temp1_float, temp2_float);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float,
@@ -1571,7 +1595,7 @@ static hsize_t diff_datum(
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
@@ -1583,8 +1607,8 @@ static hsize_t diff_datum(
* no -d and -p
*-------------------------------------------------------------------------
*/
- else if (equal_float(temp1_float, temp2_float, options) == FALSE) {
- if (print_data(options)) {
+ else if (equal_float(temp1_float, temp2_float, opts) == FALSE) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
@@ -1603,30 +1627,31 @@ static hsize_t diff_datum(
hbool_t isnan1 = FALSE;
hbool_t isnan2 = FALSE;
- HDassert(type_size == sizeof(double));
+ if(type_size != sizeof(double))
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not double size");
HDmemcpy(&temp1_double, mem1, sizeof(double));
HDmemcpy(&temp2_double, mem2, sizeof(double));
- /* logic for detecting NaNs is different with options -d, -p and no options */
+ /* logic for detecting NaNs is different with opts -d, -p and no opts */
/*-------------------------------------------------------------------------
* -d and !-p
*-------------------------------------------------------------------------
*/
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
}
/* both not NaN, do the comparison */
if (!isnan1 && !isnan2) {
- if (ABS(temp1_double-temp2_double) > options->delta) {
- if (print_data(options)) {
+ if (ABS(temp1_double-temp2_double) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -1636,24 +1661,24 @@ static hsize_t diff_datum(
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
- } /* options->d && !options->p */
+ } /* opts->d && !opts->p */
/*-------------------------------------------------------------------------
* !-d and -p
*-------------------------------------------------------------------------
*/
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
}
@@ -1663,15 +1688,15 @@ static hsize_t diff_datum(
PER(temp1_double, temp2_double);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double));
@@ -1681,7 +1706,7 @@ static hsize_t diff_datum(
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -1693,12 +1718,12 @@ static hsize_t diff_datum(
* -d and -p
*-------------------------------------------------------------------------
*/
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
}
@@ -1708,16 +1733,16 @@ static hsize_t diff_datum(
PER(temp1_double, temp2_double);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
- else if (per > options->percent &&
- ABS(temp1_double-temp2_double) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent &&
+ ABS(temp1_double-temp2_double) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double));
@@ -1727,7 +1752,7 @@ static hsize_t diff_datum(
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -1739,8 +1764,8 @@ static hsize_t diff_datum(
* no -d and -p
*-------------------------------------------------------------------------
*/
- else if (equal_double(temp1_double, temp2_double, options) == FALSE) {
- if (print_data(options)) {
+ else if (equal_double(temp1_double, temp2_double, opts) == FALSE) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -1761,7 +1786,9 @@ static hsize_t diff_datum(
hbool_t isnan1 = FALSE;
hbool_t isnan2 = FALSE;
- HDassert(type_size == sizeof(long double));
+ if(type_size != sizeof(long double)) {
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not long double size");
+ }
HDmemcpy(&temp1_double, mem1, sizeof(long double));
HDmemcpy(&temp2_double, mem2, sizeof(long double));
@@ -1772,20 +1799,20 @@ static hsize_t diff_datum(
* -d and !-p
*-------------------------------------------------------------------------
*/
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double);
isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double);
}
/* both not NaN, do the comparison */
if (!isnan1 && !isnan2) {
- if (ABS(temp1_double-temp2_double) > options->delta) {
- if (print_data(options)) {
+ if (ABS(temp1_double-temp2_double) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -1795,7 +1822,7 @@ static hsize_t diff_datum(
} /* NaN */
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -1807,12 +1834,12 @@ static hsize_t diff_datum(
* !-d and -p
*-------------------------------------------------------------------------
*/
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double);
isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double);
}
@@ -1822,15 +1849,15 @@ static hsize_t diff_datum(
PER(temp1_double,temp2_double);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double));
@@ -1840,7 +1867,7 @@ static hsize_t diff_datum(
} /* NaN */
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -1852,30 +1879,30 @@ static hsize_t diff_datum(
* -d and -p
*-------------------------------------------------------------------------
*/
- else if ( options->d && options->p) {
+ else if (opts->d && opts->p) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double);
isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double);
}
/* both not NaN, do the comparison */
- if ( !isnan1 && !isnan2) {
+ if (!isnan1 && !isnan2) {
PER(temp1_double,temp2_double);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_double-temp2_double) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double));
@@ -1885,7 +1912,7 @@ static hsize_t diff_datum(
} /* NaN */
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -1897,8 +1924,8 @@ static hsize_t diff_datum(
* no -d and -p
*-------------------------------------------------------------------------
*/
- else if (equal_ldouble(temp1_double, temp2_double, options) == FALSE) {
- if (print_data(options)) {
+ else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) {
+ if (print_data(opts)) {
print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -1911,7 +1938,11 @@ static hsize_t diff_datum(
break; /* H5T_FLOAT class */
} /* switch */
- h5difftrace("diff_datum finish\n");
+
+done:
+ opts->err_stat = opts->err_stat | ret_value;
+
+ h5diffdebug3("diff_datum finish:%d - errstat:%d\n", nfound, opts->err_stat);
return nfound;
}
@@ -1922,7 +1953,6 @@ static hsize_t diff_datum(
* Purpose: Determines if memory is initialized to all zero bytes.
*
* Return: TRUE if all bytes are zero; FALSE otherwise
- *
*-------------------------------------------------------------------------
*/
@@ -1942,7 +1972,6 @@ static hbool_t all_zero(const void *_mem, size_t size) {
* Purpose: print start coordinates and opposite corner of a region block
*
* Return: void
- *
*-------------------------------------------------------------------------
*/
@@ -1965,7 +1994,6 @@ void print_region_block(int i, hsize_t *ptdata, int ndims) {
* Purpose: print points of a region reference
*
* Return: void
- *
*-------------------------------------------------------------------------
*/
@@ -1986,18 +2014,18 @@ void print_points(int i, hsize_t *ptdata, int ndims) {
* Purpose: diff a dataspace region
*
* Return: number of differences
- *
*-------------------------------------------------------------------------
*/
-static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *options)
+static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *opts)
{
+ hsize_t ret_value = 0;
hssize_t nblocks1, npoints1;
hssize_t nblocks2, npoints2;
hsize_t alloc_size;
- hsize_t *ptdata1;
- hsize_t *ptdata2;
+ hsize_t *ptdata1 = NULL;
+ hsize_t *ptdata2 = NULL;
int ndims1;
int ndims2;
int i, j;
@@ -2012,18 +2040,17 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
* respectively. They do not currently know how to translate from one to
* the other.
*/
- H5E_BEGIN_TRY
- {
- nblocks1 = H5Sget_select_hyper_nblocks(region1_id);
- nblocks2 = H5Sget_select_hyper_nblocks(region2_id);
+ H5E_BEGIN_TRY {
+ nblocks1 = H5Sget_select_hyper_nblocks(region1_id);
+ nblocks2 = H5Sget_select_hyper_nblocks(region2_id);
- npoints1 = H5Sget_select_elem_npoints(region1_id);
- npoints2 = H5Sget_select_elem_npoints(region2_id);
- }H5E_END_TRY;
+ npoints1 = H5Sget_select_elem_npoints(region1_id);
+ npoints2 = H5Sget_select_elem_npoints(region2_id);
+ } H5E_END_TRY;
if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) {
- options->not_cmp = 1;
- return 0;
+ opts->not_cmp = 1;
+ HGOTO_DONE (0);
}
/*-------------------------------------------------------------------------
@@ -2032,57 +2059,62 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
*/
if (nblocks1 > 0) {
HDassert(ndims1 > 0);
- alloc_size = (hsize_t) nblocks1 * (unsigned) ndims1 * 2
- * sizeof(ptdata1[0]);
+ alloc_size = (hsize_t) nblocks1 * (unsigned) ndims1 * 2 * sizeof(ptdata1[0]);
HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/
- ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size);
- H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t);
- H5Sget_select_hyper_blocklist(region1_id, (hsize_t) 0,
- (hsize_t) nblocks1, ptdata1);
-
- ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size);
- H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t);
- H5Sget_select_hyper_blocklist(region2_id, (hsize_t) 0,
- (hsize_t) nblocks2, ptdata2);
-
- for (i = 0; i < nblocks1; i++) {
- /* start coordinates and opposite corner */
- for (j = 0; j < ndims1; j++) {
- hsize_t start1, start2, end1, end2;
+ if((ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed");
+ }
+ else {
+ H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t);
+ H5Sget_select_hyper_blocklist(region1_id, (hsize_t) 0, (hsize_t) nblocks1, ptdata1);
- start1 = ptdata1[i * 2 * ndims1 + j];
- start2 = ptdata2[i * 2 * ndims1 + j];
- end1 = ptdata1[i * 2 * ndims1 + j + ndims1];
- end2 = ptdata2[i * 2 * ndims1 + j + ndims1];
- if (start1 != start2 || end1 != end2)
- nfound_b++;
+ if((ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed");
}
- }
+ else {
+ H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t);
+ H5Sget_select_hyper_blocklist(region2_id, (hsize_t) 0, (hsize_t) nblocks2, ptdata2);
+
+ for (i = 0; i < nblocks1; i++) {
+ /* start coordinates and opposite corner */
+ for (j = 0; j < ndims1; j++) {
+ hsize_t start1, start2, end1, end2;
+
+ start1 = ptdata1[i * 2 * ndims1 + j];
+ start2 = ptdata2[i * 2 * ndims1 + j];
+ end1 = ptdata1[i * 2 * ndims1 + j + ndims1];
+ end2 = ptdata2[i * 2 * ndims1 + j + ndims1];
+ if (start1 != start2 || end1 != end2)
+ nfound_b++;
+ }
+ }
- /* print differences if found */
- if (nfound_b && options->m_verbose) {
- H5O_info_t oi1, oi2;
+ /* print differences if found */
+ if (nfound_b && opts->m_verbose) {
+ H5O_info_t oi1, oi2;
- H5Oget_info(obj1_id, &oi1);
- H5Oget_info(obj2_id, &oi2);
+ H5Oget_info(obj1_id, &oi1);
+ H5Oget_info(obj2_id, &oi2);
- parallel_print("Referenced dataset %lu %lu\n",
- (unsigned long) oi1.addr, (unsigned long) oi2.addr);
- parallel_print(
- "------------------------------------------------------------\n");
+ parallel_print("Referenced dataset %lu %lu\n", (unsigned long) oi1.addr, (unsigned long) oi2.addr);
+ parallel_print( "------------------------------------------------------------\n");
- parallel_print("Region blocks\n");
- for (i = 0; i < nblocks1; i++) {
- parallel_print("block #%d", i);
- print_region_block(i, ptdata1, ndims1);
- print_region_block(i, ptdata2, ndims1);
- parallel_print("\n");
- }
- }
+ parallel_print("Region blocks\n");
+ for (i = 0; i < nblocks1; i++) {
+ parallel_print("block #%d", i);
+ print_region_block(i, ptdata1, ndims1);
+ print_region_block(i, ptdata2, ndims1);
+ parallel_print("\n");
+ }
+ }
+ HDfree(ptdata2);
+ } /* else ptdata2 */
- HDfree(ptdata1);
- HDfree(ptdata2);
+ HDfree(ptdata1);
+ } /* else ptdata1 */
}
/*-------------------------------------------------------------------------
@@ -2090,98 +2122,107 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
*-------------------------------------------------------------------------
*/
if (npoints1 > 0) {
- alloc_size = (hsize_t) npoints1 * (unsigned) ndims1
- * sizeof(ptdata1[0]);
+ alloc_size = (hsize_t) npoints1 * (unsigned) ndims1 * sizeof(ptdata1[0]);
HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/
- ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size);
- H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t);
- H5Sget_select_elem_pointlist(region1_id, (hsize_t) 0,
- (hsize_t) npoints1, ptdata1);
-
- ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size);
- H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t);
- H5Sget_select_elem_pointlist(region2_id, (hsize_t) 0,
- (hsize_t) npoints2, ptdata2);
-
- for (i = 0; i < npoints1; i++) {
- hsize_t pt1, pt2;
+ if((ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed");
+ }
+ else {
+ H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t);
+ H5Sget_select_elem_pointlist(region1_id, (hsize_t) 0, (hsize_t) npoints1, ptdata1);
- for (j = 0; j < ndims1; j++) {
- pt1 = ptdata1[i * ndims1 + j];
- pt2 = ptdata2[i * ndims1 + j];
- if (pt1 != pt2)
- nfound_p++;
+ if((ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) {
+ opts->err_stat = 1;
+ H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed");
}
- }
+ else {
+ H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t);
+ H5Sget_select_elem_pointlist(region2_id, (hsize_t) 0, (hsize_t) npoints2, ptdata2);
- if (nfound_p && options->m_verbose) {
- parallel_print("Region points\n");
- for (i = 0; i < npoints1; i++) {
- hsize_t pt1, pt2;
- int diff_data = 0;
-
- for (j = 0; j < ndims1; j++) {
- pt1 = ptdata1[i * ndims1 + j];
- pt2 = ptdata2[i * ndims1 + j];
- if (pt1 != pt2) {
- diff_data = 1;
- break;
+ for (i = 0; i < npoints1; i++) {
+ hsize_t pt1, pt2;
+
+ for (j = 0; j < ndims1; j++) {
+ pt1 = ptdata1[i * ndims1 + j];
+ pt2 = ptdata2[i * ndims1 + j];
+ if (pt1 != pt2)
+ nfound_p++;
}
}
- if (diff_data) {
- parallel_print("point #%d", i);
- print_points(i, ptdata1, ndims1);
- print_points(i, ptdata2, ndims1);
- parallel_print("\n");
+
+ if (nfound_p && opts->m_verbose) {
+ parallel_print("Region points\n");
+ for (i = 0; i < npoints1; i++) {
+ hsize_t pt1, pt2;
+ int diff_data = 0;
+
+ for (j = 0; j < ndims1; j++) {
+ pt1 = ptdata1[i * ndims1 + j];
+ pt2 = ptdata2[i * ndims1 + j];
+ if (pt1 != pt2) {
+ diff_data = 1;
+ break;
+ }
+ }
+ if (diff_data) {
+ parallel_print("point #%d", i);
+ print_points(i, ptdata1, ndims1);
+ print_points(i, ptdata2, ndims1);
+ parallel_print("\n");
+ }
+ }
}
- }
- }
+ HDfree(ptdata2);
+ } /* else ptdata2 */
#if defined (H5DIFF_DEBUG)
- for (i = 0; i < npoints1; i++) {
- int j;
-
- parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i);
+ for (i = 0; i < npoints1; i++) {
+ parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i);
- for (j = 0; j < ndims1; j++)
- parallel_print("%s%lu", j ? "," : "(",
- (unsigned long)(ptdata1[i * ndims1 + j]));
+ for (j = 0; j < ndims1; j++)
+ parallel_print("%s%lu", j ? "," : "(", (unsigned long)(ptdata1[i * ndims1 + j]));
- parallel_print(")");
- }
+ parallel_print(")");
+ }
#endif
- HDfree(ptdata1);
- HDfree(ptdata2);
+ HDfree(ptdata1);
+ } /* else ptdata1 */
}
nfound_b = nfound_b / (unsigned) ndims1;
nfound_p = nfound_p / (unsigned) ndims1;
- return (nfound_p + nfound_b);
+
+ ret_value = nfound_p + nfound_b;
+
+done:
+ return ret_value;
}
/*-------------------------------------------------------------------------
* Function: character_compare
*
- * Purpose: do a byte-by-byte comparison and print in char format
- *
- * Return: number of differences found
+ * Purpose: do a byte-by-byte comparison and print in char format
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u,
- int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) {
+ int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph)
+{
hsize_t nfound = 0; /* differences found */
char temp1_uchar;
char temp2_uchar;
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar);
+ HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar);
if (temp1_uchar != temp2_uchar) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_char_pos(ph, 0, i, u, acc, pos, rank, dims, obj1, obj2);
parallel_print(" ");
h5diff_print_char(temp1_uchar);
@@ -2199,20 +2240,20 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u,
/*-------------------------------------------------------------------------
* Function: character_compare_opt
*
- * Purpose: do a byte-by-byte comparison and print in numerical format
- *
- * Return: number of differences found
+ * Purpose: do a byte-by-byte comparison and print in numerical format
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2,
- hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) {
- hsize_t nfound = 0; /* differences found */
+ hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph)
+{
+ hsize_t nfound = 0; /* differences found */
unsigned char temp1_uchar;
unsigned char temp2_uchar;
- double per;
- hbool_t both_zero;
+ double per;
+ hbool_t both_zero;
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
@@ -2220,9 +2261,9 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2,
h5difftrace("character_compare_opt start\n");
/* -d and !-p */
- if (options->d && !options->p) {
- if (PDIFF(temp1_uchar,temp2_uchar) > options->delta) {
- if (print_data(options)) {
+ if (opts->d && !opts->p) {
+ if (PDIFF(temp1_uchar,temp2_uchar) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
@@ -2231,10 +2272,10 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2,
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
PER_UNSIGN(signed char, temp1_uchar, temp2_uchar);
- if (per > options->percent) {
- if (print_data(options)) {
+ if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per);
@@ -2243,10 +2284,10 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2,
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
PER_UNSIGN(signed char, temp1_uchar, temp2_uchar);
- if (per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta) {
- if (print_data(options)) {
+ if (per > opts->percent && PDIFF(temp1_uchar,temp2_uchar) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per);
@@ -2255,7 +2296,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2,
}
}
else if (temp1_uchar != temp2_uchar) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
@@ -2269,14 +2310,14 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_float
*
- * Purpose: diff a H5T_NATIVE_FLOAT type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_FLOAT type
*
+ * Return: number of differences found
+*
*-------------------------------------------------------------------------
*/
static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
- hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
@@ -2296,7 +2337,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
*-------------------------------------------------------------------------
*/
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_float, mem1, sizeof(float));
HDmemcpy(&temp2_float, mem2, sizeof(float));
@@ -2305,15 +2346,15 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
}
/* both not NaN, do the comparison */
if (!isnan1 && !isnan2) {
- if ((double) ABS(temp1_float - temp2_float) > options->delta) {
- if (print_data(options)) {
+ if ((double) ABS(temp1_float - temp2_float) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
@@ -2323,7 +2364,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
@@ -2333,7 +2374,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(float);
mem2 += sizeof(float);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* i */
}
@@ -2341,7 +2382,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
* !-d and -p
*-------------------------------------------------------------------------
*/
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_float, mem1, sizeof(float));
HDmemcpy(&temp2_float, mem2, sizeof(float));
@@ -2350,7 +2391,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
}
@@ -2359,15 +2400,15 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
PER(temp1_float, temp2_float);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float,
@@ -2378,7 +2419,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
@@ -2388,7 +2429,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(float);
mem2 += sizeof(float);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* i */
}
@@ -2396,7 +2437,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
* -d and -p
*-------------------------------------------------------------------------
*/
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_float, mem1, sizeof(float));
HDmemcpy(&temp2_float, mem2, sizeof(float));
@@ -2405,7 +2446,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_FLOAT, &temp1_float);
isnan2 = my_isnan(FLT_FLOAT, &temp2_float);
}
@@ -2415,15 +2456,15 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
PER(temp1_float, temp2_float);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
nfound++;
}
- else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float,
@@ -2435,7 +2476,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
@@ -2445,7 +2486,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(float);
mem2 += sizeof(float);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* i */
}
@@ -2459,8 +2500,8 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp1_float, mem1, sizeof(float));
HDmemcpy(&temp2_float, mem2, sizeof(float));
- if (equal_float(temp1_float, temp2_float, options) == FALSE) {
- if (print_data(options)) {
+ if (equal_float(temp1_float, temp2_float, opts) == FALSE) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
@@ -2470,7 +2511,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(float);
mem2 += sizeof(float);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -2482,23 +2523,22 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_double
*
- * Purpose: diff a H5T_NATIVE_DOUBLE type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_DOUBLE type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
hsize_t nfound = 0; /* number of differences found */
- double temp1_double;
- double temp2_double;
+ double temp1_double;
+ double temp2_double;
hsize_t i;
- double per;
+ double per;
hbool_t both_zero;
hbool_t isnan1 = FALSE;
hbool_t isnan2 = FALSE;
@@ -2509,7 +2549,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
*-------------------------------------------------------------------------
*/
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_double, mem1, sizeof(double));
HDmemcpy(&temp2_double, mem2, sizeof(double));
@@ -2518,15 +2558,15 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
}
/* both not NaN, do the comparison */
if (!isnan1 && !isnan2) {
- if (ABS(temp1_double-temp2_double) > options->delta) {
- if (print_data(options)) {
+ if (ABS(temp1_double-temp2_double) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -2536,7 +2576,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -2546,7 +2586,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(double);
mem2 += sizeof(double);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* i */
}
@@ -2555,7 +2595,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
* !-d and -p
*-------------------------------------------------------------------------
*/
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_double, mem1, sizeof(double));
HDmemcpy(&temp2_double, mem2, sizeof(double));
@@ -2564,7 +2604,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
}
@@ -2573,15 +2613,15 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
PER(temp1_double, temp2_double);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P, temp1_double, temp2_double,
@@ -2592,7 +2632,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -2602,7 +2642,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(double);
mem2 += sizeof(double);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* i */
}
@@ -2610,7 +2650,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
* -d and -p
*-------------------------------------------------------------------------
*/
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_double, mem1, sizeof(double));
@@ -2620,7 +2660,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_DOUBLE, &temp1_double);
isnan2 = my_isnan(FLT_DOUBLE, &temp2_double);
}
@@ -2630,15 +2670,15 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
PER(temp1_double, temp2_double);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_double-temp2_double) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P, temp1_double, temp2_double,
@@ -2649,7 +2689,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -2658,7 +2698,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(double);
mem2 += sizeof(double);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* i */
}
@@ -2671,8 +2711,8 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp1_double, mem1, sizeof(double));
HDmemcpy(&temp2_double, mem2, sizeof(double));
- if (equal_double(temp1_double, temp2_double, options) == FALSE) {
- if (print_data(options)) {
+ if (equal_double(temp1_double, temp2_double, opts) == FALSE) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -2682,7 +2722,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(double);
mem2 += sizeof(double);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -2694,10 +2734,9 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_ldouble
*
- * Purpose: diff a H5T_NATIVE_LDOUBLE type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_LDOUBLE type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
#if H5_SIZEOF_LONG_DOUBLE !=0
@@ -2710,13 +2749,13 @@ static hsize_t diff_ldouble(unsigned char *mem1,
hsize_t *dims,
hsize_t *acc,
hsize_t *pos,
- diff_opt_t *options,
+ diff_opt_t *opts,
const char *obj1,
const char *obj2,
int *ph)
{
- hsize_t nfound=0; /* number of differences found */
+ hsize_t nfound = 0; /* number of differences found */
long double temp1_double;
long double temp2_double;
hsize_t i;
@@ -2732,7 +2771,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
*-------------------------------------------------------------------------
*/
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for ( i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_double, mem1, sizeof(long double));
HDmemcpy(&temp2_double, mem2, sizeof(long double));
@@ -2741,15 +2780,15 @@ static hsize_t diff_ldouble(unsigned char *mem1,
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double);
isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double);
}
/* both not NaN, do the comparison */
if (!isnan1 && !isnan2) {
- if (ABS(temp1_double-temp2_double) > options->delta) {
- if (print_data(options)) {
+ if (ABS(temp1_double-temp2_double) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -2759,7 +2798,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -2769,7 +2808,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
}
mem1 += sizeof(long double);
mem2 += sizeof(long double);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* i */
}
@@ -2778,7 +2817,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
* !-d and -p
*-------------------------------------------------------------------------
*/
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_double, mem1, sizeof(long double));
HDmemcpy(&temp2_double, mem2, sizeof(long double));
@@ -2787,7 +2826,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double);
isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double);
}
@@ -2796,15 +2835,15 @@ static hsize_t diff_ldouble(unsigned char *mem1,
PER(temp1_double, temp2_double);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P, temp1_double, temp2_double,
@@ -2815,7 +2854,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start+i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -2824,7 +2863,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
}
mem1 += sizeof(long double);
mem2 += sizeof(long double);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* i */
}
@@ -2832,7 +2871,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
* -d and -p
*-------------------------------------------------------------------------
*/
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_double, mem1, sizeof(long double));
HDmemcpy(&temp2_double, mem2, sizeof(long double));
@@ -2841,7 +2880,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
* detect NaNs
*-------------------------------------------------------------------------
*/
- if (options->do_nans) {
+ if (opts->do_nans) {
isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double);
isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double);
}
@@ -2851,15 +2890,15 @@ static hsize_t diff_ldouble(unsigned char *mem1,
PER(temp1_double, temp2_double);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_double - temp2_double) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_double - temp2_double) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1-temp2_double / temp1_double));
@@ -2869,7 +2908,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
}
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -2878,7 +2917,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
}
mem1 += sizeof(long double);
mem2 += sizeof(long double);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* i */
}
@@ -2891,8 +2930,8 @@ static hsize_t diff_ldouble(unsigned char *mem1,
HDmemcpy(&temp1_double, mem1, sizeof(long double));
HDmemcpy(&temp2_double, mem2, sizeof(long double));
- if (equal_ldouble(temp1_double, temp2_double, options) == FALSE) {
- if (print_data(options)) {
+ if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
@@ -2901,7 +2940,7 @@ static hsize_t diff_ldouble(unsigned char *mem1,
}
mem1 += sizeof(long double);
mem2 += sizeof(long double);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -2914,34 +2953,33 @@ static hsize_t diff_ldouble(unsigned char *mem1,
/*-------------------------------------------------------------------------
* Function: diff_schar
*
- * Purpose: diff a H5T_NATIVE_SCHAR type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_SCHAR type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
hsize_t nfound = 0; /* number of differences found */
- char temp1_char;
- char temp2_char;
+ char temp1_char;
+ char temp2_char;
hsize_t i;
- double per;
+ double per;
hbool_t both_zero;
h5difftrace("diff_schar start\n");
/* -d and !-p */
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_char, mem1, sizeof(char));
HDmemcpy(&temp2_char, mem2, sizeof(char));
- if (ABS(temp1_char-temp2_char) > options->delta) {
- if (print_data(options)) {
+ if (ABS(temp1_char-temp2_char) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
@@ -2950,12 +2988,12 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(char);
mem2 += sizeof(char);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_char, mem1, sizeof(char));
HDmemcpy(&temp2_char, mem2, sizeof(char));
@@ -2963,15 +3001,15 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2,
PER(temp1_char, temp2_char);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per);
@@ -2980,12 +3018,12 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(char);
mem2 += sizeof(char);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_char, mem1, sizeof(char));
HDmemcpy(&temp2_char, mem2, sizeof(char));
@@ -2993,15 +3031,15 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2,
PER(temp1_char, temp2_char);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_char-temp2_char) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_char-temp2_char) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per);
@@ -3010,7 +3048,7 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(char);
mem2 += sizeof(char);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
@@ -3020,7 +3058,7 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp2_char, mem2, sizeof(char));
if (temp1_char != temp2_char) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
@@ -3030,7 +3068,7 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(char);
mem2 += sizeof(char);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -3042,33 +3080,32 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_uchar
*
- * Purpose: diff a H5T_NATIVE_UCHAR type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_UCHAR type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
- hsize_t nfound = 0; /* number of differences found */
+ hsize_t nfound = 0; /* number of differences found */
unsigned char temp1_uchar;
unsigned char temp2_uchar;
- hsize_t i;
- double per;
- hbool_t both_zero;
+ hsize_t i;
+ double per;
+ hbool_t both_zero;
h5difftrace("diff_uchar start\n");
/* -d and !-p */
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
- if (PDIFF(temp1_uchar,temp2_uchar) > options->delta) {
- if (print_data(options)) {
+ if (PDIFF(temp1_uchar,temp2_uchar) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
@@ -3077,12 +3114,12 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned char);
mem2 += sizeof(unsigned char);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
@@ -3090,15 +3127,15 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2,
PER_UNSIGN(signed char, temp1_uchar, temp2_uchar);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per);
@@ -3107,12 +3144,12 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned char);
mem2 += sizeof(unsigned char);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
@@ -3120,15 +3157,15 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2,
PER_UNSIGN(signed char, temp1_uchar, temp2_uchar);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
}
nfound++;
}
- else if (per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && PDIFF(temp1_uchar,temp2_uchar) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per);
@@ -3137,7 +3174,7 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned char);
mem2 += sizeof(unsigned char);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
@@ -3147,7 +3184,7 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
if (temp1_uchar != temp2_uchar) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
@@ -3157,7 +3194,7 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(unsigned char);
mem2 += sizeof(unsigned char);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -3169,33 +3206,32 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_short
*
- * Purpose: diff a H5T_NATIVE_SHORT type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_SHORT type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
hsize_t nfound = 0; /* number of differences found */
- short temp1_short;
- short temp2_short;
+ short temp1_short;
+ short temp2_short;
hsize_t i;
- double per;
+ double per;
hbool_t both_zero;
h5difftrace("diff_short start\n");
/* -d and !-p */
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_short, mem1, sizeof(short));
HDmemcpy(&temp2_short, mem2, sizeof(short));
- if (ABS(temp1_short-temp2_short) > options->delta) {
- if (print_data(options)) {
+ if (ABS(temp1_short-temp2_short) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
@@ -3204,12 +3240,12 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(short);
mem2 += sizeof(short);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_short, mem1, sizeof(short));
HDmemcpy(&temp2_short, mem2, sizeof(short));
@@ -3217,15 +3253,15 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2,
PER(temp1_short, temp2_short);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per);
@@ -3234,12 +3270,12 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(short);
mem2 += sizeof(short);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_short, mem1, sizeof(short));
HDmemcpy(&temp2_short, mem2, sizeof(short));
@@ -3247,15 +3283,15 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2,
PER(temp1_short, temp2_short);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_short-temp2_short) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_short-temp2_short) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per);
@@ -3264,7 +3300,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(short);
mem2 += sizeof(short);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
@@ -3274,7 +3310,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp2_short, mem2, sizeof(short));
if (temp1_short != temp2_short) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
@@ -3284,7 +3320,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(short);
mem2 += sizeof(short);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -3296,34 +3332,33 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_ushort
*
- * Purpose: diff a H5T_NATIVE_USHORT type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_USHORT type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
- hsize_t nfound = 0; /* number of differences found */
+ hsize_t nfound = 0; /* number of differences found */
unsigned short temp1_ushort;
unsigned short temp2_ushort;
- hsize_t i;
- double per;
- hbool_t both_zero;
+ hsize_t i;
+ double per;
+ hbool_t both_zero;
h5difftrace("diff_ushort start\n");
/* -d and !-p */
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
- if (PDIFF(temp1_ushort,temp2_ushort) > options->delta) {
- if (print_data(options)) {
+ if (PDIFF(temp1_ushort,temp2_ushort) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
@@ -3332,12 +3367,12 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned short);
mem2 += sizeof(unsigned short);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
@@ -3345,15 +3380,15 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2,
PER_UNSIGN(signed short, temp1_ushort, temp2_ushort);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per);
@@ -3362,12 +3397,12 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned short);
mem2 += sizeof(unsigned short);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
@@ -3375,15 +3410,15 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2,
PER_UNSIGN(signed short, temp1_ushort, temp2_ushort);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
}
nfound++;
}
- else if (per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && PDIFF(temp1_ushort,temp2_ushort) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per);
@@ -3392,7 +3427,7 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned short);
mem2 += sizeof(unsigned short);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
@@ -3402,7 +3437,7 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
if (temp1_ushort != temp2_ushort) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
@@ -3412,7 +3447,7 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(unsigned short);
mem2 += sizeof(unsigned short);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -3422,35 +3457,34 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2,
}
/*-------------------------------------------------------------------------
- * Function: diff_int
- *
- * Purpose: diff a H5T_NATIVE_INT type
+ * Function: diff_int
*
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_INT type
*
- *-------------------------------------------------------------------------
+ * Return: number of differences found
+ *-------------------------------------------------------------------------
*/
static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
hsize_t nfound = 0; /* number of differences found */
- int temp1_int;
- int temp2_int;
+ int temp1_int;
+ int temp2_int;
hsize_t i;
- double per;
+ double per;
hbool_t both_zero;
h5difftrace("diff_int start\n");
/* -d and !-p */
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_int, mem1, sizeof(int));
HDmemcpy(&temp2_int, mem2, sizeof(int));
- if (ABS(temp1_int-temp2_int) > options->delta) {
- if (print_data(options)) {
+ if (ABS(temp1_int-temp2_int) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
@@ -3459,12 +3493,12 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(int);
mem2 += sizeof(int);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_int, mem1, sizeof(int));
HDmemcpy(&temp2_int, mem2, sizeof(int));
@@ -3472,15 +3506,15 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2,
PER(temp1_int, temp2_int);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per);
@@ -3489,12 +3523,12 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(int);
mem2 += sizeof(int);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_int, mem1, sizeof(int));
HDmemcpy(&temp2_int, mem2, sizeof(int));
@@ -3502,15 +3536,15 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2,
PER(temp1_int, temp2_int);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_int-temp2_int) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_int-temp2_int) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per);
@@ -3519,7 +3553,7 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(int);
mem2 += sizeof(int);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
@@ -3529,7 +3563,7 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp2_int, mem2, sizeof(int));
if (temp1_int != temp2_int) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
@@ -3539,7 +3573,7 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(int);
mem2 += sizeof(int);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
@@ -3551,15 +3585,14 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_uint
*
- * Purpose: diff a H5T_NATIVE_UINT type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_UINT type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
hsize_t nfound = 0; /* number of differences found */
@@ -3571,13 +3604,13 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
h5difftrace("diff_uint start\n");
/* -d and !-p */
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
- if (PDIFF(temp1_uint,temp2_uint) > options->delta) {
- if (print_data(options)) {
+ if (PDIFF(temp1_uint,temp2_uint) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
@@ -3586,12 +3619,12 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned int);
mem2 += sizeof(unsigned int);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
@@ -3599,15 +3632,15 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
PER_UNSIGN(signed int, temp1_uint, temp2_uint);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per);
@@ -3616,12 +3649,12 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned int);
mem2 += sizeof(unsigned int);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
@@ -3629,16 +3662,16 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
PER_UNSIGN(signed int, temp1_uint, temp2_uint);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
}
nfound++;
}
- else if (per > options->percent
- && PDIFF(temp1_uint,temp2_uint) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent
+ && PDIFF(temp1_uint,temp2_uint) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per);
@@ -3647,7 +3680,7 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned int);
mem2 += sizeof(unsigned int);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
@@ -3657,7 +3690,7 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
if (temp1_uint != temp2_uint) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
@@ -3667,7 +3700,7 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(unsigned int);
mem2 += sizeof(unsigned int);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -3679,15 +3712,14 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_long
*
- * Purpose: diff a H5T_NATIVE_LONG type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_LONG type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
hsize_t nfound = 0; /* number of differences found */
@@ -3699,14 +3731,14 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
h5difftrace("diff_long start\n");
/* -d and !-p */
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_long, mem1, sizeof(long));
HDmemcpy(&temp2_long, mem2, sizeof(long));
- if (ABS(temp1_long-temp2_long) > options->delta) {
- if (print_data(options)) {
+ if (ABS(temp1_long-temp2_long) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
@@ -3715,13 +3747,13 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(long);
mem2 += sizeof(long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_long, mem1, sizeof(long));
HDmemcpy(&temp2_long, mem2, sizeof(long));
@@ -3729,15 +3761,15 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
PER(temp1_long, temp2_long);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per);
@@ -3746,12 +3778,12 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(long);
mem2 += sizeof(long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_long, mem1, sizeof(long));
HDmemcpy(&temp2_long, mem2, sizeof(long));
@@ -3759,15 +3791,15 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
PER(temp1_long, temp2_long);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
}
nfound++;
}
- else if (per > options->percent && ABS(temp1_long-temp2_long) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per);
@@ -3776,7 +3808,7 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(long);
mem2 += sizeof(long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
@@ -3786,7 +3818,7 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp2_long, mem2, sizeof(long));
if (temp1_long != temp2_long) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
@@ -3796,7 +3828,7 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(long);
mem2 += sizeof(long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -3808,35 +3840,34 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_ulong
*
- * Purpose: diff a H5T_NATIVE_ULONG type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_ULONG type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
- hsize_t nfound = 0; /* number of differences found */
+ hsize_t nfound = 0; /* number of differences found */
unsigned long temp1_ulong;
unsigned long temp2_ulong;
- hsize_t i;
- double per;
- hbool_t both_zero;
+ hsize_t i;
+ double per;
+ hbool_t both_zero;
h5difftrace("diff_ulong start\n");
/* -d and !-p */
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
- if (PDIFF(temp1_ulong,temp2_ulong) > options->delta) {
- if (print_data(options)) {
+ if (PDIFF(temp1_ulong,temp2_ulong) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
@@ -3845,13 +3876,13 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned long);
mem2 += sizeof(unsigned long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
@@ -3859,15 +3890,15 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2,
PER_UNSIGN(signed long, temp1_ulong, temp2_ulong);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per);
@@ -3876,12 +3907,12 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned long);
mem2 += sizeof(unsigned long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
@@ -3889,16 +3920,16 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2,
PER_UNSIGN(signed long, temp1_ulong, temp2_ulong);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
}
nfound++;
}
- else if (per > options->percent
- && PDIFF(temp1_ulong,temp2_ulong) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent
+ && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per);
@@ -3907,7 +3938,7 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned long);
mem2 += sizeof(unsigned long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
@@ -3917,7 +3948,7 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
if (temp1_ulong != temp2_ulong) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
@@ -3927,7 +3958,7 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(unsigned long);
mem2 += sizeof(unsigned long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -3939,33 +3970,32 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_llong
*
- * Purpose: diff a H5T_NATIVE_LLONG type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_LLONG type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims,
- hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1,
+ hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1,
const char *obj2, int *ph)
{
- hsize_t nfound = 0; /* number of differences found */
+ hsize_t nfound = 0; /* number of differences found */
long long temp1_llong;
long long temp2_llong;
- hsize_t i;
- double per;
- hbool_t both_zero;
+ hsize_t i;
+ double per;
+ hbool_t both_zero;
h5difftrace("diff_llong start\n");
/* -d and !-p */
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_llong, mem1, sizeof(long long));
HDmemcpy(&temp2_llong, mem2, sizeof(long long));
- if (ABS( temp1_llong-temp2_llong) > options->delta) {
- if (print_data(options)) {
+ if (ABS( temp1_llong-temp2_llong) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong));
@@ -3974,12 +4004,12 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(long long);
mem2 += sizeof(long long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_llong, mem1, sizeof(long long));
HDmemcpy(&temp2_llong, mem2, sizeof(long long));
@@ -3987,15 +4017,15 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2,
PER(temp1_llong, temp2_llong);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per);
@@ -4004,12 +4034,12 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(long long);
mem2 += sizeof(long long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_llong, mem1, sizeof(long long));
HDmemcpy(&temp2_llong, mem2, sizeof(long long));
@@ -4017,16 +4047,16 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2,
PER(temp1_llong, temp2_llong);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong));
}
nfound++;
}
- else if (per > options->percent
- && ABS(temp1_llong-temp2_llong) > options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent
+ && ABS(temp1_llong-temp2_llong) > opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per);
@@ -4035,7 +4065,7 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(long long);
mem2 += sizeof(long long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
@@ -4045,7 +4075,7 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp2_llong, mem2, sizeof(long long));
if (temp1_llong != temp2_llong) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong));
@@ -4055,7 +4085,7 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(long long);
mem2 += sizeof(long long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -4067,34 +4097,33 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2,
/*-------------------------------------------------------------------------
* Function: diff_ullong
*
- * Purpose: diff a H5T_NATIVE_ULLONG type
- *
- * Return: number of differences found
+ * Purpose: diff a H5T_NATIVE_ULLONG type
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc,
- hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph)
+ hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph)
{
- hsize_t nfound = 0; /* number of differences found */
+ hsize_t nfound = 0; /* number of differences found */
unsigned long long temp1_ullong;
unsigned long long temp2_ullong;
- hsize_t i;
- float f1, f2;
- double per;
- hbool_t both_zero;
+ hsize_t i;
+ float f1, f2;
+ double per;
+ hbool_t both_zero;
h5difftrace("diff_ullong start\n");
/* -d and !-p */
- if (options->d && !options->p) {
+ if (opts->d && !opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
- if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) {
- if (print_data(options)) {
+ if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong));
@@ -4103,12 +4132,12 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned long long);
mem2 += sizeof(unsigned long long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* !-d and -p */
- else if (!options->d && options->p) {
+ else if (!opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
@@ -4118,15 +4147,15 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
PER(f1, f2);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong));
}
nfound++;
}
- else if (per > options->percent) {
- if (print_data(options)) {
+ else if (per > opts->percent) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per);
@@ -4135,12 +4164,12 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned long long);
mem2 += sizeof(unsigned long long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
/* -d and -p */
- else if (options->d && options->p) {
+ else if (opts->d && opts->p) {
for (i = 0; i < nelmts; i++) {
HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
@@ -4150,16 +4179,16 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
PER(f1, f2);
if (not_comparable && !both_zero) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong));
}
nfound++;
}
- else if (per > options->percent
- && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) {
- if (print_data(options)) {
+ else if (per > opts->percent
+ && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) {
+ if (print_data(opts)) {
print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per);
@@ -4168,7 +4197,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
}
mem1 += sizeof(unsigned long long);
mem2 += sizeof(unsigned long long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
}
}
@@ -4178,7 +4207,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
if (temp1_ullong != temp2_ullong) {
- if (print_data(options)) {
+ if (print_data(opts)) {
print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2);
parallel_print(SPACES);
parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong));
@@ -4188,7 +4217,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
mem1 += sizeof(unsigned long long);
mem2 += sizeof(unsigned long long);
- if (options->n && nfound >= options->count)
+ if (opts->n && nfound >= opts->count)
return nfound;
} /* nelmts */
}
@@ -4201,69 +4230,56 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
* Function: ull2float
*
* Purpose: convert unsigned long long to float
- *
- * Programmer: pvn
- * Mar 22, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static
-int ull2float(unsigned long long ull_value, float *f_value) {
- hid_t dxpl_id;
+int ull2float(unsigned long long ull_value, float *f_value)
+{
+ int ret_value = SUCCEED;
+ hid_t dxpl_id = -1;
unsigned char *buf = NULL;
- size_t src_size;
- size_t dst_size;
+ size_t src_size;
+ size_t dst_size;
h5difftrace("ull2float start\n");
if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed");
src_size = H5Tget_size(H5T_NATIVE_ULLONG);
dst_size = H5Tget_size(H5T_NATIVE_FLOAT);
- buf = (unsigned char*) HDcalloc((size_t )1, MAX(src_size, dst_size));
- if (!buf)
- goto error;
+ if((buf = (unsigned char*) HDcalloc((size_t )1, MAX(src_size, dst_size))) == NULL)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims");
HDmemcpy(buf, &ull_value, src_size);
/* do conversion */
if (H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t) 1, buf, NULL, dxpl_id) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tconvert failed");
HDmemcpy(f_value, buf, dst_size);
- if (buf)
- HDfree(buf);h5difftrace("ull2float finish\n");
-
- return 0;
-
-error:
- H5E_BEGIN_TRY
- {
+done:
+ H5E_BEGIN_TRY {
H5Pclose(dxpl_id);
- }H5E_END_TRY;
+ } H5E_END_TRY;
+
if (buf)
- HDfree(buf);h5difftrace("ull2float errored\n");
+ HDfree(buf);
- return -1;
+ h5difftrace("ull2float finish\n");
+
+ return ret_value;
}
/*-------------------------------------------------------------------------
* Function: equal_double
*
- * Purpose: use a absolute error formula to deal with floating point
- * uncertainty
- *
- * Modifications:
- * 8/1/2007. handle NaNs
- *
+ * Purpose: use a absolute error formula to deal with floating point uncertainty
*-------------------------------------------------------------------------
*/
-static hbool_t equal_double(double value, double expected, diff_opt_t *options) {
+static hbool_t equal_double(double value, double expected, diff_opt_t *opts) {
h5difftrace("equal_double start\n");
- if (options->do_nans) {
+ if (opts->do_nans) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
@@ -4275,26 +4291,24 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *options)
* we consider NaN == NaN to be true
*-------------------------------------------------------------------------
*/
- if (isnan1 && isnan2) {
+ if (isnan1 && isnan2)
return TRUE;
- }
/*-------------------------------------------------------------------------
* one is a NaN, do not compare but assume difference
*-------------------------------------------------------------------------
*/
- if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
+ if ((isnan1 && !isnan2) || (!isnan1 && isnan2))
return FALSE;
- }
}
if (value == expected)
return TRUE;
- if (options->use_system_epsilon) {
- if ( ABS( (value-expected) ) < DBL_EPSILON)
+ if (opts->use_system_epsilon)
+ if (ABS((value-expected)) < DBL_EPSILON)
return TRUE;
- }
+
h5difftrace("equal_double finish\n");
return FALSE;
@@ -4303,18 +4317,16 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *options)
/*-------------------------------------------------------------------------
* Function: equal_ldouble
*
- * Purpose: use a absolute error formula to deal with floating point
- * uncertainty
- *
+ * Purpose: use a absolute error formula to deal with floating point uncertainty
*-------------------------------------------------------------------------
*/
#if H5_SIZEOF_LONG_DOUBLE !=0
static
-hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options)
+hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts)
{
h5difftrace("equal_ldouble start\n");
- if (options->do_nans) {
+ if (opts->do_nans) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
@@ -4326,26 +4338,24 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio
* we consider NaN == NaN to be true
*-------------------------------------------------------------------------
*/
- if (isnan1 && isnan2) {
+ if (isnan1 && isnan2)
return TRUE;
- }
/*-------------------------------------------------------------------------
* one is a NaN, do not compare but assume difference
*-------------------------------------------------------------------------
*/
- if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
+ if ((isnan1 && !isnan2) || (!isnan1 && isnan2))
return FALSE;
- }
}
if (value == expected)
return TRUE;
- if (options->use_system_epsilon) {
+ if (opts->use_system_epsilon)
if (ABS((value-expected)) < DBL_EPSILON)
return TRUE;
- }
+
h5difftrace("equal_ldouble finish\n");
return FALSE;
@@ -4356,17 +4366,12 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio
/*-------------------------------------------------------------------------
* Function: equal_float
*
- * Purpose: use a absolute error formula to deal with floating point
- * uncertainty
- *
- * Modifications:
- * 8/1/2007. handle NaNs
- *
+ * Purpose: use a absolute error formula to deal with floating point uncertainty
*-------------------------------------------------------------------------
*/
-static hbool_t equal_float(float value, float expected, diff_opt_t *options) {
+static hbool_t equal_float(float value, float expected, diff_opt_t *opts) {
h5difftrace("equal_float start\n");
- if (options->do_nans) {
+ if (opts->do_nans) {
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
@@ -4378,46 +4383,35 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *options) {
* we consider NaN == NaN to be true
*-------------------------------------------------------------------------
*/
- if (isnan1 && isnan2) {
+ if (isnan1 && isnan2)
return TRUE;
- }
/*-------------------------------------------------------------------------
* one is a NaN, do not compare but assume difference
*-------------------------------------------------------------------------
*/
- if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
+ if ((isnan1 && !isnan2) || (!isnan1 && isnan2))
return FALSE;
- }
}
if (value == expected)
return TRUE;
- if (options->use_system_epsilon) {
- if ( ABS( (value-expected) ) < FLT_EPSILON)
+ if (opts->use_system_epsilon)
+ if (ABS( (value-expected) ) < FLT_EPSILON)
return TRUE;
- }
+
h5difftrace("equal_float finish\n");
return FALSE;
-
}
/*-------------------------------------------------------------------------
* Function: my_isnan
*
- * Purpose: Determines whether VAL points to NaN.
- *
- * Return: TRUE or FALSE
- *
- * Programmer: Robb Matzke
- * Monday, July 6, 1998
- *
- * Modifications:
- * Pedro Vicente, 12 October 2007.
- * Add a string detection type for WIN32
+ * Purpose: Determines whether VAL points to NaN.
*
+ * Return: TRUE or FALSE
*-------------------------------------------------------------------------
*/
static hbool_t my_isnan(dtype_t type, void *val) {
@@ -4445,9 +4439,8 @@ static hbool_t my_isnan(dtype_t type, void *val) {
retval = (x!=x);
}
#endif
- else {
+ else
return FALSE;
- }
/*
* Sometimes NaN==NaN (e.g., DEC Alpha) so we try to print it and see if
@@ -4474,9 +4467,8 @@ static hbool_t my_isnan(dtype_t type, void *val) {
HDsnprintf(s, sizeof(s), "%Lg", x);
}
#endif
- else {
+ else
return FALSE;
- }
if (HDstrstr(s, "NaN") ||
HDstrstr(s, "NAN") ||
@@ -4501,24 +4493,25 @@ static hbool_t my_isnan(dtype_t type, void *val) {
/*-------------------------------------------------------------------------
* Function: print_data
*
- * Purpose: print data only in report or verbose modes, and do not print in quiet mode
+ * Purpose: print data only in report or verbose modes, and do not print in quiet mode
*-------------------------------------------------------------------------
*/
static
-int print_data(diff_opt_t *options) {
- return ((options->m_report || options->m_verbose) && !options->m_quiet) ? 1 : 0;
+int print_data(diff_opt_t *opts)
+{
+ return ((opts->m_report || opts->m_verbose) && !opts->m_quiet) ? 1 : 0;
}
/*-------------------------------------------------------------------------
* Function: print_header
*
- * Purpose: print header for difference
- *
+ * Purpose: print header for difference
*-------------------------------------------------------------------------
*/
static
void print_header(int pp, /* print percentage */
- int rank, hsize_t *dims, const char *obj1, const char *obj2) {
+ int rank, hsize_t *dims, const char *obj1, const char *obj2)
+{
/* print header */
parallel_print("%-16s", "size:");
print_dimensions(rank, dims);
@@ -4528,8 +4521,7 @@ void print_header(int pp, /* print percentage */
if (pp) {
parallel_print("%-15s %-15s %-15s %-15s %-15s\n", "position",
- (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference",
- "relative");
+ (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference", "relative");
parallel_print(
"------------------------------------------------------------------------\n");
}
@@ -4544,15 +4536,15 @@ void print_header(int pp, /* print percentage */
/*-------------------------------------------------------------------------
* Function: print_pos
*
- * Purpose: print in matrix notation, converting from an array index position
- *
+ * Purpose: print in matrix notation, converting from an array index position
*-------------------------------------------------------------------------
*/
static
void print_pos(int *ph, /* print header */
int pp, /* print percentage */
hsize_t curr_pos, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims,
- const char *obj1, const char *obj2) {
+ const char *obj1, const char *obj2)
+{
int i;
/* print header */
@@ -4576,23 +4568,22 @@ void print_pos(int *ph, /* print header */
}
parallel_print("]");
}
- else {
+ else
parallel_print(" ");
- }
}
/*-------------------------------------------------------------------------
* Function: print_char_pos
*
- * Purpose: print character position in string
- *
+ * Purpose: print character position in string
*-------------------------------------------------------------------------
*/
static
void print_char_pos(int *ph, /* print header */
int pp, /* print percentage */
hsize_t curr_pos, size_t u, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims,
- const char *obj1, const char *obj2) {
+ const char *obj1, const char *obj2)
+{
int i;
/* print header */
@@ -4616,20 +4607,20 @@ void print_char_pos(int *ph, /* print header */
}
}
- else {
+ else
parallel_print("%zu", u);
- }
+
parallel_print("]");
}
/*-------------------------------------------------------------------------
- * Function: h5diff_print_char. Adapted from h5tools_print_char
- *
- * Purpose: Print a char
+ * Function: h5diff_print_char. Adapted from h5tools_print_char
*
+ * Purpose: Print a char
*-------------------------------------------------------------------------
*/
-static void h5diff_print_char(char ch) {
+static void h5diff_print_char(char ch)
+{
switch (ch) {
case '"':
parallel_print("\\\"");
@@ -4662,12 +4653,13 @@ static void h5diff_print_char(char ch) {
}
/*-------------------------------------------------------------------------
- * XCAO, 11/10/2010
* added to improve performance for compound datasets
* set up compound datatype structures.
+ *-------------------------------------------------------------------------
*/
-static void get_member_types(hid_t tid, mcomp_t *members) {
- int tclass;
+static void get_member_types(hid_t tid, mcomp_t *members)
+{
+ int tclass;
unsigned u;
if (tid <= 0 || !members)
@@ -4682,8 +4674,7 @@ static void get_member_types(hid_t tid, mcomp_t *members) {
else if (tclass == H5T_COMPOUND) {
int nmembs;
- nmembs = H5Tget_nmembers(tid);
- if (nmembs <= 0)
+ if ((nmembs = H5Tget_nmembers(tid)) <= 0)
return;
members->n = (unsigned) nmembs;
@@ -4701,15 +4692,15 @@ static void get_member_types(hid_t tid, mcomp_t *members) {
}
return;
-
}
/*-------------------------------------------------------------------------
- * XCAO, 11/10/2010
* added to improve performance for compound datasets
* clean and close compound members.
+ *-------------------------------------------------------------------------
*/
-static void close_member_types(mcomp_t *members) {
+static void close_member_types(mcomp_t *members)
+{
unsigned u;
if (!members || members->n <= 0 || !members->ids)
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 9bebcbe..6019738 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -136,54 +136,55 @@ static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *ta
*
* Parameter:
* table_out [OUT] : return the list
- *
- * Programmer: Jonathan Kim
- *
- * Date: March 15, 2011
*------------------------------------------------------------------------*/
-static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t ** table_out, diff_opt_t *options)
+static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t ** table_out, diff_opt_t *opts)
{
- H5O_info_t oinfo1, oinfo2; /* Object info */
- hid_t attr1_id=-1; /* attr ID */
- hid_t attr2_id=-1; /* attr ID */
- size_t curr1 = 0;
- size_t curr2 = 0;
- unsigned infile[2];
- char name1[ATTR_NAME_MAX];
- char name2[ATTR_NAME_MAX];
- int cmp;
- unsigned i;
+ int ret_value = 0;
+ H5O_info_t oinfo1, oinfo2; /* Object info */
+ hid_t attr1_id = -1; /* attr ID */
+ hid_t attr2_id = -1; /* attr ID */
+ size_t curr1 = 0;
+ size_t curr2 = 0;
+ unsigned infile[2];
+ char name1[ATTR_NAME_MAX];
+ char name2[ATTR_NAME_MAX];
+ int cmp;
+ unsigned i;
table_attrs_t *table_lp = NULL;
h5difftrace("build_match_list_attrs start\n");
+
if(H5Oget_info(loc1_id, &oinfo1) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info first object failed");
if(H5Oget_info(loc2_id, &oinfo2) < 0)
- goto error;
-
- table_attrs_init( &table_lp );
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info second object failed");
- h5diffdebug3("build_match_list_attrs: %ld - %ld\n", curr1 < oinfo1.num_attrs, curr2 < oinfo2.num_attrs);
+ table_attrs_init(&table_lp);
+ if (table_lp == NULL)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Table allocation failed");
/*--------------------------------------------------
* build the list
*/
while(curr1 < oinfo1.num_attrs && curr2 < oinfo2.num_attrs) {
+ h5diffdebug3("build_match_list_attrs 1: %ld - %ld\n", curr1, oinfo1.num_attrs);
+ h5diffdebug3("build_match_list_attrs 2: %ld - %ld\n", curr2, oinfo2.num_attrs);
+
/*------------------
* open attribute1 */
if((attr1_id = H5Aopen_by_idx(loc1_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr1, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx first attribute failed");
/* get name */
if(H5Aget_name(attr1_id, (size_t)ATTR_NAME_MAX, name1) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name first attribute failed");
/*------------------
* open attribute2 */
if((attr2_id = H5Aopen_by_idx(loc2_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr2, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx second attribute failed");
/* get name */
if(H5Aget_name(attr2_id, (size_t)ATTR_NAME_MAX, name2) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name second attribute failed");
/* criteria is string compare */
cmp = HDstrcmp(name1, name2);
@@ -221,13 +222,15 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t
infile[0] = 1;
infile[1] = 0;
while(curr1 < oinfo1.num_attrs) {
+ h5diffdebug3("build_match_list_attrs 1: %ld - %ld\n", curr1, oinfo1.num_attrs);
+
/*------------------
* open attribute1 */
if((attr1_id = H5Aopen_by_idx(loc1_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr1, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx first attribute failed");
/* get name */
if(H5Aget_name(attr1_id, (size_t)ATTR_NAME_MAX, name1) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name first attribute failed");
h5diffdebug2("build_match_list_attrs #1 name - %s\n", name1);
table_attr_mark_exist(infile, name1, table_lp);
@@ -243,13 +246,14 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t
infile[0] = 0;
infile[1] = 1;
while(curr2 < oinfo2.num_attrs) {
+ h5diffdebug3("build_match_list_attrs 2: %ld - %ld\n", curr2, oinfo2.num_attrs);
/*------------------
* open attribute2 */
if((attr2_id = H5Aopen_by_idx(loc2_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr2, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx second attribute failed");
/* get name */
if(H5Aget_name(attr2_id, (size_t)ATTR_NAME_MAX, name2) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name second attribute failed");
h5diffdebug2("build_match_list_attrs #2 name - %s\n", name2);
table_attr_mark_exist(infile, name2, table_lp);
@@ -258,12 +262,13 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t
/* close for next turn */
H5Aclose(attr2_id);
+ attr2_id = -1;
}
/*------------------------------------------------------
* print the list
*/
- if(options->m_verbose_level == 2) {
+ if(opts->m_verbose_level == 2) {
/* if '-v2' is detected */
parallel_print(" obj1 obj2\n");
parallel_print(" --------------------------------------\n");
@@ -275,44 +280,35 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t
} /* end for */
}
- if(options->m_verbose_level >= 1)
+ if(opts->m_verbose_level >= 1)
parallel_print("Attributes status: %d common, %d only in obj1, %d only in obj2\n",
table_lp->nattrs - table_lp->nattrs_only1 - table_lp->nattrs_only2,
table_lp->nattrs_only1, table_lp->nattrs_only2);
+done:
*table_out = table_lp;
- h5difftrace("build_match_list_attrs end\n");
- return 0;
-
-error:
- if (0 < attr1_id)
+ /* disable error reporting */
+ H5E_BEGIN_TRY {
H5Aclose(attr1_id);
- if (0 < attr2_id)
H5Aclose(attr2_id);
+ } H5E_END_TRY;
+
+ h5diffdebug2("build_match_list_attrs end - errstat:%d\n", opts->err_stat);
- h5difftrace("build_match_list_attrs end with error\n");
- return -1;
+ return ret_value;
}
/*-------------------------------------------------------------------------
* Function: diff_attr
*
- * Purpose: compare attributes located in LOC1_ID and LOC2_ID, which are
- * obtained either from
- * loc_id = H5Gopen2(fid, name, H5P_DEFAULT);
- * loc_id = H5Dopen2(fid, name);
- * loc_id = H5Topen2(fid, name, H5P_DEFAULT);
- *
- * Return: number of differences found
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: November, 03, 2003
- *
- * Modifications:
- * March, 02, 2007: return the number of differences found
+ * Purpose: compare attributes located in LOC1_ID and LOC2_ID, which are
+ * obtained either from
+ * loc_id = H5Gopen2(fid, name, H5P_DEFAULT);
+ * loc_id = H5Dopen2(fid, name);
+ * loc_id = H5Topen2(fid, name, H5P_DEFAULT);
*
+ * Return: number of differences found
*-------------------------------------------------------------------------
*/
@@ -320,34 +316,35 @@ hsize_t diff_attr(hid_t loc1_id,
hid_t loc2_id,
const char *path1,
const char *path2,
- diff_opt_t *options)
+ diff_opt_t *opts)
{
- hid_t attr1_id=-1; /* attr ID */
- hid_t attr2_id=-1; /* attr ID */
- hid_t space1_id=-1; /* space ID */
- hid_t space2_id=-1; /* space ID */
- hid_t ftype1_id=-1; /* file data type ID */
- hid_t ftype2_id=-1; /* file data type ID */
- int vstrtype1=0; /* ftype1 is a variable string */
- int vstrtype2=0; /* ftype2 is a variable string */
- hid_t mtype1_id=-1; /* memory data type ID */
- hid_t mtype2_id=-1; /* memory data type ID */
- size_t msize1; /* memory size of memory type */
- size_t msize2; /* memory size of memory type */
- void *buf1=NULL; /* data buffer */
- void *buf2=NULL; /* data buffer */
- hbool_t buf1hasdata=FALSE; /* buffer has data */
- hbool_t buf2hasdata=FALSE; /* buffer has data */
- hsize_t nelmts1; /* number of elements in dataset */
- int rank1; /* rank of dataset */
- int rank2; /* rank of dataset */
- hsize_t dims1[H5S_MAX_RANK];/* dimensions of dataset */
- hsize_t dims2[H5S_MAX_RANK];/* dimensions of dataset */
- char *name1;
- char *name2;
+ int ret_value = opts->err_stat;
+ hid_t attr1_id = -1; /* attr ID */
+ hid_t attr2_id = -1; /* attr ID */
+ hid_t space1_id = -1; /* space ID */
+ hid_t space2_id = -1; /* space ID */
+ hid_t ftype1_id = -1; /* file data type ID */
+ hid_t ftype2_id = -1; /* file data type ID */
+ int vstrtype1 = 0; /* ftype1 is a variable string */
+ int vstrtype2 = 0; /* ftype2 is a variable string */
+ hid_t mtype1_id = -1; /* memory data type ID */
+ hid_t mtype2_id = -1; /* memory data type ID */
+ size_t msize1; /* memory size of memory type */
+ size_t msize2; /* memory size of memory type */
+ void *buf1 = NULL; /* data buffer */
+ void *buf2 = NULL; /* data buffer */
+ hbool_t buf1hasdata = FALSE; /* buffer has data */
+ hbool_t buf2hasdata = FALSE; /* buffer has data */
+ hsize_t nelmts1; /* number of elements in dataset */
+ int rank1; /* rank of dataset */
+ int rank2; /* rank of dataset */
+ hsize_t dims1[H5S_MAX_RANK]; /* dimensions of dataset */
+ hsize_t dims2[H5S_MAX_RANK]; /* dimensions of dataset */
+ char *name1 = NULL;
+ char *name2 = NULL;
char np1[512];
char np2[512];
- unsigned u; /* Local index variable */
+ unsigned u; /* Local index variable */
hsize_t nfound = 0;
hsize_t nfound_total = 0;
int j;
@@ -355,17 +352,21 @@ hsize_t diff_attr(hid_t loc1_id,
table_attrs_t *match_list_attrs = NULL;
h5difftrace("diff_attr start\n");
- if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, options) < 0)
- goto error;
+ if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, opts) < 0) {
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "build_match_list_attrs failed");
+ }
+ h5diffdebug2("build_match_list_attrs - errstat:%d\n", opts->err_stat);
/* if detect any unique extra attr */
if(match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) {
h5difftrace("diff_attr attributes only in one file\n");
/* exit will be 1 */
- options->contents = 0;
+ opts->contents = 0;
}
+ h5diffdebug2("match_list_attrs info - errstat:%d\n", opts->err_stat);
for(u = 0; u < (unsigned)match_list_attrs->nattrs; u++) {
+ h5diffdebug3("match_list_attrs loop[%d] - errstat:%d\n", u, opts->err_stat);
if((match_list_attrs->attrs[u].exist[0]) && (match_list_attrs->attrs[u].exist[1])) {
name1 = name2 = match_list_attrs->attrs[u].name;
h5diffdebug2("diff_attr name - %s\n", name1);
@@ -373,59 +374,60 @@ hsize_t diff_attr(hid_t loc1_id,
/*--------------
* attribute 1 */
if((attr1_id = H5Aopen(loc1_id, name1, H5P_DEFAULT)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aopen first attribute failed");
/*--------------
* attribute 2 */
if((attr2_id = H5Aopen(loc2_id, name2, H5P_DEFAULT)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aopen second attribute failed");
h5difftrace("diff_attr got attributes\n");
/* get the datatypes */
if((ftype1_id = H5Aget_type(attr1_id)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed");
vstrtype1 = H5Tis_variable_str(ftype1_id);
if((ftype2_id = H5Aget_type(attr2_id)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed");
vstrtype2 = H5Tis_variable_str(ftype2_id);
+
/* no compare if either one but not both are variable string type */
if (vstrtype1 != vstrtype2) {
- if((options->m_verbose || options->m_list_not_cmp))
+ if((opts->m_verbose || opts->m_list_not_cmp))
parallel_print("Not comparable: one of attribute <%s/%s> or <%s/%s> is of variable length type\n",
path1, name1, path2, name2);
- options->not_cmp = 1;
+ opts->not_cmp = 1;
if (H5Tclose(ftype1_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed");
if (H5Tclose(ftype2_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed");
if (H5Aclose(attr1_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose first attribute failed");
if (H5Aclose(attr2_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose second attribute failed");
continue;
}
if((mtype1_id = H5Tget_native_type(ftype1_id, H5T_DIR_DEFAULT)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type first attribute ftype failed");
if((mtype2_id = H5Tget_native_type(ftype2_id, H5T_DIR_DEFAULT)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type second attribute ftype failed");
if((msize1 = H5Tget_size(mtype1_id)) == 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_size first attribute mtype failed");
if((msize2 = H5Tget_size(mtype2_id)) == 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_size second attribute mtype failed");
/* get the dataspace */
if((space1_id = H5Aget_space(attr1_id)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_space first attribute failed");
if((space2_id = H5Aget_space(attr2_id)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_space second attribute failed");
/* get dimensions */
if((rank1 = H5Sget_simple_extent_dims(space1_id, dims1, NULL)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_dims first attribute failed");
if((rank2 = H5Sget_simple_extent_dims(space2_id, dims2, NULL)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_dims second attribute failed");
/*----------------------------------------------------------------------
* check for comparable TYPE and SPACE
@@ -435,23 +437,23 @@ hsize_t diff_attr(hid_t loc1_id,
/* pass dims1 and dims2 for maxdims as well since attribute's maxdims
* are always same */
if(diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2,
- dims1, dims2, name1, name2, options, 0) != 1) {
+ dims1, dims2, name1, name2, opts, 0) != 1) {
if(H5Tclose(ftype1_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed");
if(H5Tclose(ftype2_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed");
if(H5Sclose(space1_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sclose first attribute failed");
if(H5Sclose(space2_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sclose second attribute failed");
if(H5Aclose(attr1_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose first attribute failed");
if(H5Aclose(attr2_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose second attribute failed");
if(H5Tclose(mtype1_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute mtype failed");
if(H5Tclose(mtype2_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute mtype failed");
continue;
}
@@ -462,7 +464,7 @@ hsize_t diff_attr(hid_t loc1_id,
*/
if(FAIL == match_up_memsize(ftype1_id, ftype2_id, &mtype1_id,
&mtype2_id, &msize1, &msize2))
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "match_up_memsize failed");
/*---------------------------------------------------------------------
* read
@@ -476,18 +478,18 @@ hsize_t diff_attr(hid_t loc1_id,
buf2 = (void *)HDcalloc((size_t)(nelmts1), msize2);
if(buf1 == NULL || buf2 == NULL) {
parallel_print("cannot read into memory\n");
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "buffer allocation failed");
}
if(H5Aread(attr1_id, mtype1_id, buf1) < 0) {
parallel_print("Failed reading attribute1 %s/%s\n", path1, name1);
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed");
}
else
buf1hasdata = TRUE;
if(H5Aread(attr2_id, mtype2_id, buf2) < 0) {
parallel_print("Failed reading attribute2 %s/%s\n", path2, name2);
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed");
}
else
buf2hasdata = TRUE;
@@ -503,22 +505,22 @@ hsize_t diff_attr(hid_t loc1_id,
/* always print name */
/* verbose (-v) and report (-r) mode */
- if(options->m_verbose || options->m_report) {
+ if(opts->m_verbose || opts->m_report) {
do_print_attrname("attribute", np1, np2);
nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1,
- dims1, options, np1, np2, mtype1_id, attr1_id, attr2_id);
+ dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id);
print_found(nfound);
}
/* quiet mode (-q), just count differences */
- else if(options->m_quiet) {
+ else if(opts->m_quiet) {
nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1,
- dims1, options, np1, np2, mtype1_id, attr1_id, attr2_id);
+ dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id);
}
/* the rest (-c, none, ...) */
else {
nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1,
- dims1, options, np1, np2, mtype1_id, attr1_id, attr2_id);
+ dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id);
/* print info if compatible and difference found */
if (nfound) {
@@ -545,32 +547,29 @@ hsize_t diff_attr(hid_t loc1_id,
buf2 = NULL;
if(H5Tclose(ftype1_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed");
if(H5Tclose(ftype2_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed");
if(H5Sclose(space1_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed");
if(H5Sclose(space2_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed");
if(H5Aclose(attr1_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed");
if(H5Aclose(attr2_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed");
if(H5Tclose(mtype1_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute mtype failed");
if(H5Tclose(mtype2_id) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute mtype failed");
nfound_total += nfound;
}
} /* u */
- table_attrs_free(match_list_attrs);
-
- h5difftrace("diff_attr end\n");
- return nfound_total;
+done:
+ opts->err_stat = opts->err_stat | ret_value;
-error:
H5E_BEGIN_TRY {
if(buf1) {
if(buf1hasdata && TRUE == h5tools_detect_vlen(mtype1_id))
@@ -595,8 +594,7 @@ error:
H5Aclose(attr2_id);
} H5E_END_TRY;
- options->err_stat = 1;
- h5difftrace("diff_attr end with error\n");
+ h5diffdebug2("diff_attr end - errstat:%d\n", opts->err_stat);
return nfound_total;
}
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index 998a8ca..ee42b99 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -1,15 +1,15 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-* Copyright by The HDF Group. *
-* Copyright by the Board of Trustees of the University of Illinois. *
-* All rights reserved. *
-* *
-* This file is part of HDF5. The full HDF5 copyright notice, including *
-* terms governing use, modification, and redistribution, is contained in *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "H5private.h"
#include "h5tools.h"
@@ -19,25 +19,22 @@
/*-------------------------------------------------------------------------
-* Function: diff_dataset
-*
-* Purpose: check for comparable datasets and read into a compatible
-* memory type
-*
-* Return: Number of differences found
-*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
-*
-* Date: May 9, 2003
-*
-*-------------------------------------------------------------------------
-*/
-hsize_t diff_dataset( hid_t file1_id,
- hid_t file2_id,
- const char *obj1_name,
- const char *obj2_name,
- diff_opt_t *options)
+ * Function: diff_dataset
+ *
+ * Purpose: check for comparable datasets and read into a compatible
+ * memory type
+ *
+ * Return: Number of differences found
+ *-------------------------------------------------------------------------
+ */
+hsize_t diff_dataset(hid_t file1_id,
+ hid_t file2_id,
+ const char *obj1_name,
+ const char *obj2_name,
+ diff_opt_t *opts)
{
+ int ret_value = opts->err_stat;
+ int status = -1;
hid_t did1 = -1;
hid_t did2 = -1;
hid_t dcpl1 = -1;
@@ -46,53 +43,45 @@ hsize_t diff_dataset( hid_t file1_id,
h5difftrace("diff_dataset start\n");
/*-------------------------------------------------------------------------
- * open the handles
- *-------------------------------------------------------------------------
- */
- /* disable error reporting */
- H5E_BEGIN_TRY
- {
- /* Open the datasets */
- if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) {
- parallel_print("Cannot open dataset <%s>\n", obj1_name);
- goto error;
- }
- if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) {
- parallel_print("Cannot open dataset <%s>\n", obj2_name);
- goto error;
- }
- /* enable error reporting */
- } H5E_END_TRY;
-
+ * open the handles
+ *-------------------------------------------------------------------------
+ */
+ /* Open the datasets */
+ if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) {
+ parallel_print("Cannot open dataset <%s>\n", obj1_name);
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 first dataset failed");
+ }
+ if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) {
+ parallel_print("Cannot open dataset <%s>\n", obj2_name);
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 second dataset failed");
+ }
if((dcpl1 = H5Dget_create_plist(did1)) < 0)
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist first dataset failed");
if((dcpl2 = H5Dget_create_plist(did2)) < 0)
- goto error;
-
- /*-------------------------------------------------------------------------
- * check if the dataset creation property list has filters that
- * are not registered in the current configuration
- * 1) the external filters GZIP and SZIP might not be available
- * 2) the internal filters might be turned off
- *-------------------------------------------------------------------------
- */
- if ((h5tools_canreadf((options->m_verbose ? obj1_name : NULL), dcpl1) == 1) &&
- (h5tools_canreadf((options->m_verbose ? obj2_name : NULL), dcpl2) == 1))
- nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, options);
- else
- goto error;
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist second dataset failed");
/*-------------------------------------------------------------------------
- * close
- *-------------------------------------------------------------------------
- */
- goto done;
-
-error:
- options->err_stat = 1;
+ * check if the dataset creation property list has filters that
+ * are not registered in the current configuration
+ * 1) the external filters GZIP and SZIP might not be available
+ * 2) the internal filters might be turned off
+ *-------------------------------------------------------------------------
+ */
+ if ((status = h5tools_canreadf((opts->m_verbose ? obj1_name : NULL), dcpl1) == 1) &&
+ (status = h5tools_canreadf((opts->m_verbose ? obj2_name : NULL), dcpl2) == 1))
+ nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, opts);
+ else if (status < 0) {
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "h5tools_canreadf failed");
+ }
+ else {
+ ret_value = 1;
+ opts->not_cmp = 1;
+ }
done:
+ opts->err_stat = opts->err_stat | ret_value;
+
/* disable error reporting */
H5E_BEGIN_TRY {
H5Pclose(dcpl1);
@@ -102,82 +91,75 @@ done:
/* enable error reporting */
} H5E_END_TRY;
- h5difftrace("diff_dataset end\n");
+ h5diffdebug3("diff_dataset finish:%d - errstat:%d\n", nfound, opts->err_stat);
return nfound;
}
/*-------------------------------------------------------------------------
-* Function: diff_datasetid
-*
-* Purpose: check for comparable datasets and read into a compatible
-* memory type
-*
-* Return: Number of differences found
-*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
-*
-* Date: May 9, 2003
-*
-* Modifications:
-*
-*
-* October 2006: Read by hyperslabs for big datasets.
-*
-* A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done
-* i.e., if the memory needed to read a dataset is greater than this limit,
-* then hyperslab I/O is done instead of one operation I/O
-* For each dataset, the memory needed is calculated according to
-*
-* memory needed = number of elements * size of each element
-*
-* if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations
-* are done
-*
-* H5Dread( input_dataset1 )
-* H5Dread( input_dataset2 )
-*
-* with all elements in the datasets selected. If the memory needed is greater than
-* H5TOOLS_MALLOCSIZE, then the following operations are done instead:
-*
-* a strip mine is defined for each dimension k (a strip mine is defined as a
-* hyperslab whose size is memory manageable) according to the formula
-*
-* (1) strip_mine_size[k ] = MIN(dimension[k ], H5TOOLS_BUFSIZE / size of memory type)
-*
-* where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures
-* that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip
-* mine size k is simply defined as its dimension k, but for larger datasets the
-* hyperslab size is still memory manageable.
-* a cycle is done until the number of elements in the dataset is reached. In each
-* iteration, two parameters are defined for the function H5Sselect_hyperslab,
-* the start and size of each hyperslab, according to
-*
-* (2) hyperslab_size [k] = MIN(dimension[k] - hyperslab_offset[k], strip_mine_size [k])
-*
-* where hyperslab_offset [k] is initially set to zero, and later incremented in
-* hyperslab_size[k] offsets. The reason for the operation
-*
-* dimension[k] - hyperslab_offset[k]
-*
-* in (2) is that, when using the strip mine size, it assures that the "remaining" part
-* of the dataset that does not fill an entire strip mine is processed.
-*
-*-------------------------------------------------------------------------
-*/
-hsize_t diff_datasetid( hid_t did1,
- hid_t did2,
- const char *obj1_name,
- const char *obj2_name,
- diff_opt_t *options)
+ * Function: diff_datasetid
+ *
+ * Purpose: check for comparable datasets and read into a compatible
+ * memory type
+ *
+ * Return: Number of differences found
+ *
+ * October 2006: Read by hyperslabs for big datasets.
+ *
+ * A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done
+ * i.e., if the memory needed to read a dataset is greater than this limit,
+ * then hyperslab I/O is done instead of one operation I/O
+ * For each dataset, the memory needed is calculated according to
+ *
+ * memory needed = number of elements * size of each element
+ *
+ * if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations
+ * are done
+ *
+ * H5Dread( input_dataset1 )
+ * H5Dread( input_dataset2 )
+ *
+ * with all elements in the datasets selected. If the memory needed is greater than
+ * H5TOOLS_MALLOCSIZE, then the following operations are done instead:
+ *
+ * a strip mine is defined for each dimension k (a strip mine is defined as a
+ * hyperslab whose size is memory manageable) according to the formula
+ *
+ * (1) strip_mine_size[k ] = MIN(dimension[k ], H5TOOLS_BUFSIZE / size of memory type)
+ *
+ * where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures
+ * that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip
+ * mine size k is simply defined as its dimension k, but for larger datasets the
+ * hyperslab size is still memory manageable.
+ * a cycle is done until the number of elements in the dataset is reached. In each
+ * iteration, two parameters are defined for the function H5Sselect_hyperslab,
+ * the start and size of each hyperslab, according to
+ *
+ * (2) hyperslab_size [k] = MIN(dimension[k] - hyperslab_offset[k], strip_mine_size [k])
+ *
+ * where hyperslab_offset [k] is initially set to zero, and later incremented in
+ * hyperslab_size[k] offsets. The reason for the operation
+ *
+ * dimension[k] - hyperslab_offset[k]
+ *
+ * in (2) is that, when using the strip mine size, it assures that the "remaining" part
+ * of the dataset that does not fill an entire strip mine is processed.
+ *
+ *-------------------------------------------------------------------------
+ */
+hsize_t diff_datasetid(hid_t did1,
+ hid_t did2,
+ const char *obj1_name,
+ const char *obj2_name,
+ diff_opt_t *opts)
{
- int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
- hid_t sid1=-1;
- hid_t sid2=-1;
- hid_t f_tid1=-1;
- hid_t f_tid2=-1;
- hid_t dam_tid=-1; /* m_tid for diff_array function */
- hid_t m_tid1=-1;
- hid_t m_tid2=-1;
+ int ret_value = opts->err_stat;
+ hid_t sid1 = -1;
+ hid_t sid2 = -1;
+ hid_t f_tid1 = -1;
+ hid_t f_tid2 = -1;
+ hid_t dam_tid = -1; /* m_tid for diff_array function */
+ hid_t m_tid1 = -1;
+ hid_t m_tid2 = -1;
hid_t dcpl1 = -1;
hid_t dcpl2 = -1;
H5D_layout_t stl1 = -1;
@@ -197,42 +179,41 @@ hsize_t diff_datasetid( hid_t did1,
hsize_t dims2[H5S_MAX_RANK];
hsize_t maxdim1[H5S_MAX_RANK];
hsize_t maxdim2[H5S_MAX_RANK];
- const char *name1=NULL; /* relative names */
- const char *name2=NULL;
+ const char *name1 = NULL; /* relative names */
+ const char *name2 = NULL;
hsize_t storage_size1;
hsize_t storage_size2;
- hsize_t nfound=0; /* number of differences found */
- int can_compare=1; /* do diff or not */
- void *buf1=NULL;
- void *buf2=NULL;
- void *sm_buf1=NULL;
- void *sm_buf2=NULL;
- hid_t sm_space; /*stripmine data space */
- size_t need; /* bytes needed for malloc */
+ hsize_t nfound = 0; /* number of differences found */
+ int can_compare = 1; /* do diff or not */
+ void *buf1 = NULL;
+ void *buf2 = NULL;
+ void *sm_buf1 = NULL;
+ void *sm_buf2 = NULL;
+ hid_t sm_space = -1; /*stripmine data space */
+ size_t need; /* bytes needed for malloc */
int i;
- unsigned int vl_data = 0; /*contains VL datatypes */
+ unsigned int vl_data = 0; /*contains VL datatypes */
- options->err_stat = 1;
h5difftrace("diff_datasetid start\n");
/* Get the dataspace handle */
if((sid1 = H5Dget_space(did1)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_space failed");
/* Get rank */
if((rank1 = H5Sget_simple_extent_ndims(sid1)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
/* Get the dataspace handle */
if((sid2 = H5Dget_space(did2)) < 0 )
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_space failed");
/* Get rank */
if((rank2 = H5Sget_simple_extent_ndims(sid2)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
/* Get dimensions */
if(H5Sget_simple_extent_dims(sid1, dims1, maxdim1) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
/* Get dimensions */
if(H5Sget_simple_extent_dims(sid2, dims2, maxdim2) < 0)
@@ -240,36 +221,36 @@ hsize_t diff_datasetid( hid_t did1,
h5diffdebug3("rank: %ld - %ld\n", rank1, rank2);
/*-------------------------------------------------------------------------
- * get the file data type
- *-------------------------------------------------------------------------
- */
+ * get the file data type
+ *-------------------------------------------------------------------------
+ */
/* Get the data type */
if((f_tid1 = H5Dget_type(did1)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_type failed");
/* Get the data type */
if((f_tid2 = H5Dget_type(did2)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_type failed");
/*-------------------------------------------------------------------------
- * get the storage layout type
- *-------------------------------------------------------------------------
- */
+ * get the storage layout type
+ *-------------------------------------------------------------------------
+ */
if((dcpl1 = H5Dget_create_plist(did1)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist failed");
if((dcpl2 = H5Dget_create_plist(did2)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist failed");
if((stl1 = H5Pget_layout(dcpl1)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Pget_layout failed");
if((stl2 = H5Pget_layout(dcpl2)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Pget_layout failed");
/*-------------------------------------------------------------------------
- * check for empty datasets
- *-------------------------------------------------------------------------
- */
+ * check for empty datasets
+ *-------------------------------------------------------------------------
+ */
h5difftrace("check for empty datasets\n");
storage_size1 = H5Dget_storage_size(did1);
@@ -278,71 +259,74 @@ hsize_t diff_datasetid( hid_t did1,
if(storage_size1 == 0 || storage_size2 == 0) {
if(stl1 == H5D_VIRTUAL || stl2 == H5D_VIRTUAL) {
- if((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name)
+ if((opts->m_verbose||opts->m_list_not_cmp) && obj1_name && obj2_name)
parallel_print("Warning: <%s> or <%s> is a virtual dataset\n", obj1_name, obj2_name);
}
else {
- if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name)
+ if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name)
parallel_print("Not comparable: <%s> or <%s> is an empty dataset\n", obj1_name, obj2_name);
can_compare = 0;
- options->not_cmp = 1;
+ opts->not_cmp = 1;
}
}
/*-------------------------------------------------------------------------
- * check for comparable TYPE and SPACE
- *-------------------------------------------------------------------------
- */
+ * check for comparable TYPE and SPACE
+ *-------------------------------------------------------------------------
+ */
if (diff_can_type(f_tid1, f_tid2, rank1, rank2,
dims1, dims2, maxdim1, maxdim2,
obj1_name, obj2_name,
- options, 0) != 1)
+ opts, 0) != 1)
can_compare = 0;
+ h5diffdebug2("diff_can_type - errstat:%d\n", opts->err_stat);
/*-------------------------------------------------------------------------
- * memory type and sizes
- *-------------------------------------------------------------------------
- */
+ * memory type and sizes
+ *-------------------------------------------------------------------------
+ */
h5difftrace("check for memory type and sizes\n");
if((m_tid1 = H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type failed");
if((m_tid2 = H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type failed");
m_size1 = H5Tget_size(m_tid1);
m_size2 = H5Tget_size(m_tid2);
h5diffdebug3("type size: %ld - %ld\n", m_size1, m_size2);
/*-------------------------------------------------------------------------
- * check for different signed/unsigned types
- *-------------------------------------------------------------------------
- */
+ * check for different signed/unsigned types
+ *-------------------------------------------------------------------------
+ */
if(can_compare) {
h5difftrace("can_compare for sign\n");
sign1 = H5Tget_sign(m_tid1);
sign2 = H5Tget_sign(m_tid2);
if(sign1 != sign2) {
h5difftrace("sign1 != sign2\n");
- if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) {
+ if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) {
parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1));
parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2));
}
can_compare = 0;
- options->not_cmp = 1;
+ opts->not_cmp = 1;
}
}
/* Check if type is either VLEN-data or VLEN-string to reclaim any
- * VLEN memory buffer later */
+ * VLEN memory buffer later
+ */
if(TRUE == h5tools_detect_vlen(m_tid1))
vl_data = TRUE;
+ h5diffdebug2("h5tools_detect_vlen - errstat:%d\n", opts->err_stat);
/*------------------------------------------------------------------------
- * only attempt to compare if possible
- *-------------------------------------------------------------------------
- */
+ * only attempt to compare if possible
+ *-------------------------------------------------------------------------
+ */
if(can_compare) { /* it is possible to compare */
H5T_class_t tclass = H5Tget_class(f_tid1);
h5difftrace("can_compare attempt\n");
@@ -363,14 +347,14 @@ hsize_t diff_datasetid( hid_t did1,
if(tclass != H5T_ARRAY) {
/*-----------------------------------------------------------------
- * "upgrade" the smaller memory size
- *------------------------------------------------------------------
- */
+ * "upgrade" the smaller memory size
+ *------------------------------------------------------------------
+ */
h5difftrace("upgrade the smaller memory size?\n");
if (FAIL == match_up_memsize (f_tid1, f_tid2,
&m_tid1, &m_tid2,
&m_size1, &m_size2))
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "match_up_memsize failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "match_up_memsize failed");
h5diffdebug3("m_size: %ld - %ld\n", m_size1, m_size2);
dadims = dims1;
dam_size = m_size1;
@@ -405,9 +389,9 @@ hsize_t diff_datasetid( hid_t did1,
/*----------------------------------------------------------------
- * read/compare
- *-----------------------------------------------------------------
- */
+ * read/compare
+ *-----------------------------------------------------------------
+ */
if(need < H5TOOLS_MALLOCSIZE) {
buf1 = HDmalloc(need);
buf2 = HDmalloc(need);
@@ -416,14 +400,14 @@ hsize_t diff_datasetid( hid_t did1,
if(buf1 != NULL && buf2 != NULL) {
h5difftrace("buf1 != NULL && buf2 != NULL\n");
if(H5Dread(did1, m_tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed");
h5difftrace("H5Dread did2\n");
if(H5Dread(did2, m_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed");
/* array diff */
nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims,
- options, name1, name2, dam_tid, did1, did2);
+ opts, name1, name2, dam_tid, did1, did2);
h5diffdebug2("diff_array nfound:%d\n", nfound);
/* reclaim any VL memory, if necessary */
@@ -482,9 +466,9 @@ hsize_t diff_datasetid( hid_t did1,
* E.g., sm_space.
*/
if((sm_buf1 = HDmalloc((size_t)sm_nbytes)) == NULL)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "HDmalloc failed");
if((sm_buf2 = HDmalloc((size_t)sm_nbytes)) == NULL)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "HDmalloc failed");
sm_nelmts = sm_nbytes / p_type_nbytes;
sm_space = H5Screate_simple(1, &sm_nelmts, NULL);
@@ -501,24 +485,24 @@ hsize_t diff_datasetid( hid_t did1,
hs_nelmts *= hs_size[i];
} /* end for */
if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
if(H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
} /* end if */
else
hs_nelmts = 1;
if(H5Dread(did1, m_tid1, sm_space, sid1, H5P_DEFAULT, sm_buf1) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed");
if(H5Dread(did2, m_tid2, sm_space, sid2, H5P_DEFAULT, sm_buf2) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
+ HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed");
/* get array differences. in the case of hyperslab read, increment the number of differences
found in each hyperslab and pass the position at the beginning for printing */
nfound += diff_array(sm_buf1, sm_buf2, hs_nelmts, elmtno, rank1,
- dadims, options, name1, name2, dam_tid, did1, did2);
+ dadims, opts, name1, name2, dam_tid, did1, did2);
/* reclaim any VL memory, if necessary */
if(vl_data) {
@@ -553,11 +537,10 @@ hsize_t diff_datasetid( hid_t did1,
* close
*-------------------------------------------------------------------------
*/
- h5difftrace("reclaim any VL memory\n");
+ h5diffdebug2("reclaim any VL memory - errstat:%d\n", opts->err_stat);
done:
-
- options->err_stat = ret_value;
+ opts->err_stat = opts->err_stat | ret_value;
/* free */
if(buf1 != NULL) {
@@ -599,60 +582,55 @@ done:
H5Tclose(m_tid2);
/* enable error reporting */
} H5E_END_TRY;
- h5diffdebug3("diff_datasetid return:%d with nfound:%d\n", ret_value, nfound);
+ h5diffdebug3("diff_datasetid return:%d with nfound:%d\n", ret_value, nfound);
return nfound;
}
/*-------------------------------------------------------------------------
-* Function: diff_can_type
-*
-* Purpose: check for comparable TYPE and SPACE
-*
-* Return:
-* 1, can compare
-* 0, cannot compare
-* -1, error
-*
-* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
-*
-* Date: November 3, 2003
-*
-*-------------------------------------------------------------------------
-*/
-
-int diff_can_type( hid_t f_tid1, /* file data type */
- hid_t f_tid2, /* file data type */
- int rank1,
- int rank2,
- hsize_t *dims1,
- hsize_t *dims2,
- hsize_t *maxdim1,
- hsize_t *maxdim2,
- const char *obj1_name,
- const char *obj2_name,
- diff_opt_t *options,
- int is_compound)
+ * Function: diff_can_type
+ *
+ * Purpose: check for comparable TYPE and SPACE
+ *
+ * Return:
+ * 1, can compare
+ * 0, cannot compare
+ * -1, error
+ *-------------------------------------------------------------------------
+ */
+
+int diff_can_type(hid_t f_tid1, /* file data type */
+ hid_t f_tid2, /* file data type */
+ int rank1,
+ int rank2,
+ hsize_t *dims1,
+ hsize_t *dims2,
+ hsize_t *maxdim1,
+ hsize_t *maxdim2,
+ const char *obj1_name,
+ const char *obj2_name,
+ diff_opt_t *opts,
+ int is_compound)
{
+ int ret_value = 1; /* can_compare value */
H5T_class_t tclass1;
H5T_class_t tclass2;
int maxdim_diff = 0; /* maximum dimensions are different */
int dim_diff = 0; /* current dimensions are different */
int i;
- int can_compare = 1; /* return value */
h5difftrace("diff_can_type start\n");
/*-------------------------------------------------------------------------
- * check for the same class
- *-------------------------------------------------------------------------
- */
+ * check for the same class
+ *-------------------------------------------------------------------------
+ */
if((tclass1 = H5Tget_class(f_tid1)) < 0)
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_class first object failed");
if((tclass2 = H5Tget_class(f_tid2)) < 0)
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_class second object failed");
if(tclass1 != tclass2) {
- if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) {
+ if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) {
if(is_compound) {
parallel_print("Not comparable: <%s> has a class %s and <%s> has a class %s\n",
obj1_name, get_class(tclass1),
@@ -664,24 +642,22 @@ int diff_can_type( hid_t f_tid1, /* file data type */
obj2_name, get_class(tclass2));
}
}
- can_compare = 0;
- options->not_cmp = 1;
- goto done;
+ opts->not_cmp = 1;
+ HGOTO_DONE(0);
}
/*-------------------------------------------------------------------------
- * check for non supported classes
- *-------------------------------------------------------------------------
- */
+ * check for non supported classes
+ *-------------------------------------------------------------------------
+ */
switch (tclass1) {
case H5T_TIME:
- if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) {
+ if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) {
parallel_print("Not comparable: <%s> and <%s> are of class %s\n",
obj1_name, obj2_name, get_class(tclass2));
} /* end if */
- can_compare = 0;
- options->not_cmp = 1;
- goto done;
+ opts->not_cmp = 1;
+ HGOTO_DONE(0);
case H5T_INTEGER:
case H5T_FLOAT:
@@ -701,10 +677,10 @@ int diff_can_type( hid_t f_tid1, /* file data type */
} /* end switch */
/*-------------------------------------------------------------------------
- * check for equal file datatype; warning only
- *-------------------------------------------------------------------------
- */
- if((H5Tequal(f_tid1, f_tid2) == 0) && (options->m_verbose) && obj1_name && obj2_name) {
+ * check for equal file datatype; warning only
+ *-------------------------------------------------------------------------
+ */
+ if((H5Tequal(f_tid1, f_tid2) == 0) && (opts->m_verbose) && obj1_name && obj2_name) {
H5T_class_t cl = H5Tget_class(f_tid1);
parallel_print("Warning: different storage datatype\n");
@@ -719,11 +695,11 @@ int diff_can_type( hid_t f_tid1, /* file data type */
}
/*-------------------------------------------------------------------------
- * check for the same rank
- *-------------------------------------------------------------------------
- */
+ * check for the same rank
+ *-------------------------------------------------------------------------
+ */
if(rank1 != rank2) {
- if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) {
+ if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) {
parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1);
print_dimensions(rank1, dims1);
parallel_print(", max dimensions ");
@@ -735,15 +711,14 @@ int diff_can_type( hid_t f_tid1, /* file data type */
print_dimensions(rank2, maxdim2);
parallel_print("\n");
}
- can_compare = 0;
- options->not_cmp = 1;
- goto done;
+ opts->not_cmp = 1;
+ HGOTO_DONE(0);
}
/*-------------------------------------------------------------------------
- * check for different dimensions
- *-------------------------------------------------------------------------
- */
+ * check for different dimensions
+ *-------------------------------------------------------------------------
+ */
for(i = 0; i<rank1; i++) {
if(maxdim1 && maxdim2) {
if(maxdim1[i] != maxdim2[i])
@@ -754,11 +729,11 @@ int diff_can_type( hid_t f_tid1, /* file data type */
}
/*-------------------------------------------------------------------------
- * current dimensions
- *-------------------------------------------------------------------------
- */
+ * current dimensions
+ *-------------------------------------------------------------------------
+ */
if(dim_diff == 1) {
- if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) {
+ if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) {
parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1);
print_dimensions(rank1, dims1);
if(maxdim1 && maxdim2) {
@@ -772,17 +747,16 @@ int diff_can_type( hid_t f_tid1, /* file data type */
parallel_print("\n");
}
}
- can_compare = 0;
- options->not_cmp = 1;
- goto done;
+ opts->not_cmp = 1;
+ HGOTO_DONE(0);
}
/*-------------------------------------------------------------------------
- * maximum dimensions; just give a warning
- *-------------------------------------------------------------------------
- */
+ * maximum dimensions; just give a warning
+ *-------------------------------------------------------------------------
+ */
if(maxdim1 && maxdim2 && maxdim_diff == 1 && obj1_name) {
- if(options->m_verbose) {
+ if(opts->m_verbose) {
parallel_print( "Warning: different maximum dimensions\n");
parallel_print("<%s> has max dimensions ", obj1_name);
print_dimensions(rank1, maxdim1);
@@ -797,21 +771,20 @@ int diff_can_type( hid_t f_tid1, /* file data type */
int nmembs1;
int nmembs2;
int j;
- hid_t memb_type1;
- hid_t memb_type2;
+ hid_t memb_type1 = -1;
+ hid_t memb_type2 = -1;
nmembs1 = H5Tget_nmembers(f_tid1);
nmembs2 = H5Tget_nmembers(f_tid2);
if(nmembs1 != nmembs2) {
- if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) {
+ if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) {
parallel_print("Not comparable: <%s> has %d members ", obj1_name, nmembs1);
parallel_print("<%s> has %d members ", obj2_name, nmembs2);
parallel_print("\n");
}
- can_compare = 0;
- options->not_cmp = 1;
- goto done;
+ opts->not_cmp = 1;
+ HGOTO_DONE(0);
}
for (j = 0; j < nmembs1; j++) {
@@ -820,30 +793,31 @@ int diff_can_type( hid_t f_tid1, /* file data type */
if (diff_can_type(memb_type1, memb_type2, rank1, rank2,
dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name,
- options, 1) != 1) {
- can_compare = 0;
- options->not_cmp = 1;
+ opts, 1) != 1) {
+ opts->not_cmp = 1;
H5Tclose(memb_type1);
H5Tclose(memb_type2);
- goto done;
+ HGOTO_DONE(0);
}
H5Tclose(memb_type1);
H5Tclose(memb_type2);
}
}
done:
- h5diffdebug2("diff_can_type end - %d\n", can_compare);
- return can_compare;
+ if (ret_value < 0)
+ opts->err_stat = 1;
+
+ h5diffdebug2("diff_can_type end - %d\n", ret_value);
+ return ret_value;
}
/*-------------------------------------------------------------------------
-* Function: print_sizes
-*
-* Purpose: Print datatype sizes
-*
-*-------------------------------------------------------------------------
-*/
+ * Function: print_sizes
+ *
+ * Purpose: Print datatype sizes
+ *-------------------------------------------------------------------------
+ */
#if defined (H5DIFF_DEBUG)
void print_sizes( const char *obj1,
const char *obj2,
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index ad23ccf..d4fc3a2 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -24,8 +24,7 @@ int g_nTasks = 1;
/*-------------------------------------------------------------------------
* Function: print_dimensions
*
- * Purpose: print dimensions
- *
+ * Purpose: print dimensions
*-------------------------------------------------------------------------
*/
void
@@ -33,14 +32,14 @@ print_dimensions (int rank, hsize_t *dims)
{
int i;
- if( rank <= 0 )
+ if(rank <= 0)
parallel_print("H5S_SCALAR" );
else {
if (!dims)
parallel_print("dimension is NULL");
else {
parallel_print("[");
- for ( i = 0; i < rank-1; i++) {
+ for (i = 0; i < rank-1; i++) {
parallel_print(HSIZE_T_FORMAT, dims[i]);
parallel_print("x");
}
@@ -55,16 +54,11 @@ print_dimensions (int rank, hsize_t *dims)
/*-------------------------------------------------------------------------
* Function: print_type
*
- * Purpose: Print name of datatype
- *
- * Return: void
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Purpose: Print name of datatype
*
- * Date: May 9, 2003
- *
- * Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only
+ * Return: void
*
+ * Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only
*-------------------------------------------------------------------------
*/
void print_type(hid_t type)
@@ -188,12 +182,7 @@ void print_type(hid_t type)
/*-------------------------------------------------------------------------
* Function: diff_basename
*
- * Purpose: Returns a pointer to the last component absolute name
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: May 9, 2003
- *
+ * Purpose: Returns a pointer to the last component absolute name
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE const char*
@@ -219,12 +208,7 @@ diff_basename(const char *name)
/*-------------------------------------------------------------------------
* Function: get_type
*
- * Purpose: Returns the type as a string
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: May 9, 2003
- *
+ * Purpose: Returns the type as a string
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE H5_ATTR_CONST const char*
@@ -255,21 +239,13 @@ get_type(h5trav_type_t type)
/*-------------------------------------------------------------------------
* Function: get_sign
*
- * Purpose: Returns the sign as a string
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: May 9, 2003
- *
- * Comments:
- *
+ * Purpose: Returns the sign as a string
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE const char*
get_sign(H5T_sign_t sign)
{
- switch(sign)
- {
+ switch(sign) {
case H5T_SGN_NONE:
return "H5T_SGN_NONE";
@@ -291,12 +267,7 @@ get_sign(H5T_sign_t sign)
/*-------------------------------------------------------------------------
* Function: get_class
*
- * Purpose: Returns the class as a string
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: May 9, 2003
- *
+ * Purpose: Returns the class as a string
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE const char*
@@ -346,8 +317,7 @@ get_class(H5T_class_t tclass)
/*-------------------------------------------------------------------------
* Function: print_found
*
- * Purpose: print number of differences found
- *
+ * Purpose: print number of differences found
*-------------------------------------------------------------------------
*/
void print_found(hsize_t nfound)
@@ -362,43 +332,37 @@ void print_found(hsize_t nfound)
/*-----------------------------------------------------------------
* Function: match_up_memsize
*
- * Purpose: match smaller memory size up to bigger memory size
+ * Purpose: match smaller memory size up to bigger memory size
*------------------------------------------------------------------
*/
herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
hid_t *m_tid1, hid_t *m_tid2,
size_t *m_size1, size_t *m_size2)
{
- herr_t ret = SUCCEED;
+ herr_t ret_value = SUCCEED;
if((*m_size1) != (*m_size2)) {
if((*m_size1) < (*m_size2)) {
- H5Tclose( *m_tid1 );
+ H5Tclose(*m_tid1);
- if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) {
- ret = FAIL;
- goto out;
- }
+ if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
- *m_size1 = H5Tget_size( *m_tid1 );
+ *m_size1 = H5Tget_size(*m_tid1);
} /* end if */
else {
H5Tclose(*m_tid2);
- if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) {
- ret = FAIL;
- goto out;
- }
+ if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
*m_size2 = H5Tget_size(*m_tid2);
} /* end else */
} /* end if */
- if((*m_size1) != (*m_size2)) {
- ret = FAIL;
- goto out;
- }
+ if((*m_size1) != (*m_size2))
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "native type sizes do not compare");
-out:
- return ret;
+done:
+ return ret_value;
}
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 344913a..89cb524 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -23,10 +23,10 @@
#include "H5private.h"
/* global variables */
-hid_t H5tools_ERR_STACK_g = 0;
-hid_t H5tools_ERR_CLS_g = -1;
-hid_t H5E_tools_g = -1;
-hid_t H5E_tools_min_id_g = -1;
+hid_t H5tools_ERR_STACK_g = 0;
+hid_t H5tools_ERR_CLS_g = -1;
+hid_t H5E_tools_g = -1;
+hid_t H5E_tools_min_id_g = -1;
int compound_data;
FILE *rawattrstream = NULL; /* should initialize to stdout but gcc moans about it */
FILE *rawdatastream = NULL; /* should initialize to stdout but gcc moans about it */
@@ -77,18 +77,13 @@ typedef enum {
#define NUM_DRIVERS (sizeof(drivernames) / sizeof(drivernames[0]))
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Initialize the H5 Tools library
- * Description:
- * This should be called before any other h5tools function is called.
- * Effect of any h5tools function called before this has been called is
- * undetermined.
- * Return:
- * None
- * Programmer:
- * Albert Cheng, 2000-10-31
- * Modifications:
+ * Function: h5tools_init
+ *
+ * Purpose: This should be called before any other h5tools function is called.
+ * Effect of any h5tools function called before this has been called is
+ * undetermined.
+ *
+ * Return None
*-------------------------------------------------------------------------
*/
void
@@ -121,19 +116,14 @@ h5tools_init(void)
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Close the H5 Tools library
- * Description:
- * Close or release resources such as files opened by the library. This
- * should be called after all other h5tools functions have been called.
- * Effect of any h5tools function called after this has been called is
- * undetermined.
- * Return:
- * None
- * Programmer:
- * Albert Cheng, 2000-10-31
- * Modifications:
+ * Function: h5tools_close
+ *
+ * Purpose: Close or release resources such as files opened by the library. This
+ * should be called after all other h5tools functions have been called.
+ * Effect of any h5tools function called after this has been called is
+ * undetermined.
+ *
+ * Return: None
*-------------------------------------------------------------------------
*/
void
@@ -193,19 +183,13 @@ h5tools_close(void)
}
/*-------------------------------------------------------------------------
- * Function: h5tools_set_data_output_file
- *
- * Purpose: Open fname as the output file for dataset raw data.
- * Set rawdatastream as its file stream.
+ * Function: h5tools_set_data_output_file
*
- * Return: 0 -- succeeded
- * negative -- failed
- *
- * Programmer: Albert Cheng, 2000/09/30
- *
- * Modifications:
- * pvn June, 1, 2006. Add a switch for binary output
+ * Purpose: Open fname as the output file for dataset raw data.
+ * Set rawdatastream as its file stream.
*
+ * Return: 0 -- succeeded
+ * negative -- failed
*-------------------------------------------------------------------------
*/
int
@@ -247,14 +231,13 @@ h5tools_set_data_output_file(const char *fname, int is_bin)
}
/*-------------------------------------------------------------------------
- * Function: h5tools_set_attr_output_file
+ * Function: h5tools_set_attr_output_file
*
- * Purpose: Open fname as the output file for attribute raw data.
- * Set rawattrstream as its file stream.
- *
- * Return: 0 -- succeeded
- * negative -- failed
+ * Purpose: Open fname as the output file for attribute raw data.
+ * Set rawattrstream as its file stream.
*
+ * Return: 0 -- succeeded
+ * negative -- failed
*-------------------------------------------------------------------------
*/
int
@@ -296,13 +279,13 @@ h5tools_set_attr_output_file(const char *fname, int is_bin)
}
/*-------------------------------------------------------------------------
- * Function: h5tools_set_input_file
+ * Function: h5tools_set_input_file
*
- * Purpose: Open fname as the input file for raw input.
- * Set rawinstream as its file stream.
+ * Purpose: Open fname as the input file for raw input.
+ * Set rawinstream as its file stream.
*
- * Return: 0 -- succeeded
- * negative -- failed
+ * Return: 0 -- succeeded
+ * negative -- failed
*
*-------------------------------------------------------------------------
*/
@@ -344,13 +327,13 @@ h5tools_set_input_file(const char *fname, int is_bin)
}
/*-------------------------------------------------------------------------
- * Function: h5tools_set_output_file
+ * Function: h5tools_set_output_file
*
- * Purpose: Open fname as the output file for raw output.
- * Set rawoutstream as its file stream.
+ * Purpose: Open fname as the output file for raw output.
+ * Set rawoutstream as its file stream.
*
- * Return: 0 -- succeeded
- * negative -- failed
+ * Return: 0 -- succeeded
+ * negative -- failed
*
*-------------------------------------------------------------------------
*/
@@ -392,14 +375,13 @@ h5tools_set_output_file(const char *fname, int is_bin)
}
/*-------------------------------------------------------------------------
- * Function: h5tools_set_error_file
- *
- * Purpose: Open fname as the error output file for dataset raw error.
- * Set rawerrorstream as its file stream.
+ * Function: h5tools_set_error_file
*
- * Return: 0 -- succeeded
- * negative -- failed
+ * Purpose: Open fname as the error output file for dataset raw error.
+ * Set rawerrorstream as its file stream.
*
+ * Return: 0 -- succeeded
+ * negative -- failed
*-------------------------------------------------------------------------
*/
int
@@ -441,33 +423,28 @@ h5tools_set_error_file(const char *fname, int is_bin)
}
/*-------------------------------------------------------------------------
- * Audience: Private
- * Chapter: H5Tools Library
- * Purpose: Get a FAPL for a driver
- * Description:
- * Get a FAPL for a given VFL driver name.
- * Return:
- * None
- * Programmer:
- * Quincey Koziol, 2004-02-04
- * Modifications:
- * Pedro Vicente Nunes, Thursday, July 27, 2006
- * Added error return conditions for the H5Pset_fapl calls
+ * Function: h5tools_get_fapl
+ *
+ * Purpose: Get a FAPL for a given VFL driver name.
+ *
+ * Return: positive - succeeded
+ * negative - failed
*-------------------------------------------------------------------------
*/
static hid_t
h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum)
{
- hid_t new_fapl; /* Copy of file access property list passed in, or new property list */
+ hid_t new_fapl = -1; /* Copy of file access property list passed in, or new property list */
+ int ret_value = SUCCEED;
/* Make a copy of the FAPL, for the file open call to use, eventually */
if (fapl == H5P_DEFAULT) {
if ((new_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed");
} /* end if */
else {
if ((new_fapl = H5Pcopy(fapl)) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcopy failed");
} /* end else */
/* Determine which driver the user wants to open the file with. Try
@@ -475,7 +452,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum)
if (!HDstrcmp(driver, drivernames[SEC2_IDX])) {
/* SEC2 driver */
if (H5Pset_fapl_sec2(new_fapl) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_sec2 failed");
if (drivernum)
*drivernum = SEC2_IDX;
@@ -487,7 +464,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum)
* is the member size.
*/
if (H5Pset_fapl_family(new_fapl, (hsize_t) 0, H5P_DEFAULT) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_family failed");
if (drivernum)
*drivernum = FAMILY_IDX;
@@ -495,7 +472,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum)
else if (!HDstrcmp(driver, drivernames[SPLIT_IDX])) {
/* SPLIT Driver */
if (H5Pset_fapl_split(new_fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_split failed");
if (drivernum)
*drivernum = SPLIT_IDX;
@@ -503,7 +480,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum)
else if (!HDstrcmp(driver, drivernames[MULTI_IDX])) {
/* MULTI Driver */
if (H5Pset_fapl_multi(new_fapl, NULL, NULL, NULL, NULL, TRUE) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_multi failed");
if(drivernum)
*drivernum = MULTI_IDX;
@@ -519,29 +496,28 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum)
if(mpi_initialized && !mpi_finalized) {
if(H5Pset_fapl_mpio(new_fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
- goto error;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_mpio failed");
if(drivernum)
*drivernum = MPIO_IDX;
} /* end if */
}
#endif /* H5_HAVE_PARALLEL */
else
- goto error;
+ ret_value = -1;
- return(new_fapl);
-
-error:
- if(new_fapl != H5P_DEFAULT)
+done:
+ if((new_fapl != H5P_DEFAULT) && (ret_value < 0)) {
H5Pclose(new_fapl);
- return -1;
+ new_fapl = -1;
+ }
+
+ return(new_fapl);
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Open a file with various VFL drivers.
- * Description:
- * Loop through the various types of VFL drivers trying to open FNAME.
+ * Function: h5tools_fopen
+ *
+ * Purpose: Loop through the various types of VFL drivers trying to open FNAME.
* If the HDF5 library is version 1.2 or less, then we have only the SEC2
* driver to try out. If the HDF5 library is greater than version 1.2,
* then we have the FAMILY, SPLIT, and MULTI drivers to play with.
@@ -549,6 +525,7 @@ error:
* If DRIVER is non-NULL, then it will try to open the file with that
* driver first. We assume that the user knows what they are doing so, if
* we fail, then we won't try other file drivers.
+ *
* Return:
* On success, returns a file id for the opened file. If DRIVERNAME is
* non-null then the first DRIVERNAME_SIZE-1 characters of the driver
@@ -556,38 +533,6 @@ error:
*
* Otherwise, the function returns FAIL. If DRIVERNAME is non-null then
* the first byte is set to the null terminator.
- * Programmer:
- * Lost in the mists of time.
- * Modifications:
- * Robb Matzke, 2000-06-23
- * We only have to initialize driver[] on the first call, thereby
- * preventing memory leaks from repeated calls to H5Pcreate().
- *
- * Robb Matzke, 2000-06-23
- * Added DRIVERNAME_SIZE arg to prevent overflows when writing to
- * DRIVERNAME.
- *
- * Robb Matzke, 2000-06-23
- * Added test to prevent coredump when the file could not be opened by
- * any driver.
- *
- * Robb Matzke, 2000-06-23
- * Changed name from H5ToolsFopen() so it jives better with the names we
- * already have at the top of this source file.
- *
- * Thomas Radke, 2000-09-12
- * Added Stream VFD to the driver[] array.
- *
- * Bill Wendling, 2001-01-10
- * Changed macro behavior so that if we have a version other than 1.2.x
- * (i.e., > 1.2), then we do the drivers check.
- *
- * Bill Wendling, 2001-07-30
- * Added DRIVER parameter so that the user can specify "try this driver"
- * instead of the default behaviour. If it fails to open the file with
- * that driver, this will fail completely (i.e., we won't try the other
- * drivers). We're assuming the user knows what they're doing. How UNIX
- * of us.
*-------------------------------------------------------------------------
*/
hid_t
@@ -652,18 +597,13 @@ done:
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Count the number of columns in a string.
- * Description:
- * Count the number of columns in a string. This is the number of
- * characters in the string not counting line-control characters.
- * Return:
- * On success, returns the width of the string. Otherwise this function
- * returns 0.
- * Programmer:
- * Robb Matzke, Tuesday, April 27, 1999
- * Modifications:
+ * Function: h5tools_count_ncols
+ *
+ * Purpose: Count the number of columns in a string. This is the number of
+ * characters in the string not counting line-control characters.
+ *
+ * Return: success - returns the width of the string.
+ * failure - 0.
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE static size_t
@@ -681,20 +621,17 @@ h5tools_count_ncols(const char *s)
/*-------------------------------------------------------------------------
* Function: h5tools_detect_vlen
*
- * Purpose: Recursive check for any variable length data in given type.
+ * Purpose: Recursive check for any variable length data in given type.
*
- * Return:
- * TRUE : type conatains any variable length data
- * FALSE : type doesn't contain any variable length data
- * Negative value: error occur
- *
- * Programmer: Jonathan Kim March 18, 2011
+ * Return: TRUE : type contains any variable length data
+ * FALSE : type doesn't contain any variable length data
+ * Negative value: failed
*-------------------------------------------------------------------------
*/
htri_t
h5tools_detect_vlen(hid_t tid)
{
- htri_t ret;
+ htri_t ret = FALSE;
/* recursive detect any vlen data values in type (compound, array ...) */
ret = H5Tdetect_class(tid, H5T_VLEN);
@@ -713,20 +650,18 @@ done:
/*-------------------------------------------------------------------------
* Function: h5tools_detect_vlen_str
*
- * Purpose: Recursive check for variable length string of a datatype.
- *
- * Return:
- * TRUE : type conatains any variable length string
- * FALSE : type doesn't contain any variable length string
- * Negative value: error occur
+ * Purpose: Recursive check for variable length string of a datatype.
*
+ * Return: TRUE : type contains any variable length string
+ * FALSE : type doesn't contain any variable length string
+ * Negative value: failed
*-------------------------------------------------------------------------
*/
htri_t
h5tools_detect_vlen_str(hid_t tid)
{
H5T_class_t tclass = -1;
- htri_t ret = FALSE;
+ htri_t ret = FALSE;
ret = H5Tis_variable_str(tid);
if((ret == TRUE) || (ret < 0))
@@ -774,25 +709,13 @@ done:
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Emit a simple prefix to STREAM.
- * Description:
- * If /ctx->need_prefix/ is set then terminate the current line (if
- * applicable), calculate the prefix string, and display it at the start
- * of a line.
- * Return:
- * None
- * Programmer:
- * Robb Matzke, Monday, April 26, 1999
- * Modifications:
- * Robb Matzke, 1999-09-29
- * If a new prefix is printed then the current element number is set back
- * to zero.
- * pvn, 2004-07-08
- * Added support for printing array indices:
- * the indentation is printed before the prefix (printed one indentation
- * level before)
+ * Function: h5tools_simple_prefix
+ *
+ * Purpose: If /ctx->need_prefix/ is set then terminate the current line (if
+ * applicable), calculate the prefix string, and display it at the start
+ * of a line.
+ *
+ * Return: None
*-------------------------------------------------------------------------
*/
void
@@ -800,7 +723,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx, hsize_t elmtno, int secnum)
{
h5tools_str_t prefix;
- h5tools_str_t str; /*temporary for indentation */
+ h5tools_str_t str; /*temporary for indentation */
size_t templength = 0;
unsigned u, indentlevel = 0;
@@ -871,15 +794,13 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info,
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Emit a simple prefix to STREAM.
- * Description:
- * If /ctx->need_prefix/ is set then terminate the current line (if
- * applicable), calculate the prefix string, and display it at the start
- * of a line. Calls region specific function.
- * Return:
- * None
+ * Function: h5tools_region_simple_prefix
+ *
+ * Purpose: If /ctx->need_prefix/ is set then terminate the current line (if
+ * applicable), calculate the prefix string, and display it at the start
+ * of a line. Calls region specific function.
+ *
+ * Return: None
*-------------------------------------------------------------------------
*/
void
@@ -887,7 +808,7 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum)
{
h5tools_str_t prefix;
- h5tools_str_t str; /*temporary for indentation */
+ h5tools_str_t str; /*temporary for indentation */
size_t templength = 0;
unsigned u, indentlevel = 0;
@@ -958,28 +879,26 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info,
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Render an element to output STREAM.
- * Description:
- * Prints the string buffer to the output STREAM. The string is
- * printed according to the format described in INFO. The CTX struct
- * contains context information shared between calls to this function.
+ * Function: h5tools_render_element
*
- * Return:
- * False if a dimension end is reached, otherwise true
+ * Purpose: Prints the string buffer to the output STREAM. The string is
+ * printed according to the format described in INFO. The CTX struct
+ * contains context information shared between calls to this function.
+ *
+ * Return: False if a dimension end is reached
+ * True otherwise
*
* In/Out:
- * h5tools_context_t *ctx
- * h5tools_str_t *buffer
- * hsize_t *curr_pos
+ * h5tools_context_t *ctx
+ * h5tools_str_t *buffer
+ * hsize_t *curr_pos
*
* Parameters Description:
- * h5tools_str_t *buffer is the string into which to render
- * hsize_t curr_pos is the total data element position
- * size_t ncols
- * hsize_t local_elmt_counter is the local element loop counter
- * hsize_t elmt_count is the data element loop counter
+ * h5tools_str_t *buffer is the string into which to render
+ * hsize_t curr_pos is the total data element position
+ * size_t ncols
+ * hsize_t local_elmt_counter is the local element loop counter
+ * hsize_t elmt_count is the data element loop counter
*-------------------------------------------------------------------------
*/
hbool_t
@@ -988,10 +907,10 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info,
size_t ncols, hsize_t local_elmt_counter, hsize_t elmt_counter)
{
hbool_t dimension_break = TRUE;
- char *s;
- char *section; /*a section of output */
- int secnum; /*section sequence number */
- int multiline; /*datum was multiline */
+ char *s = NULL;
+ char *section = NULL; /* a section of output */
+ int secnum; /* section sequence number */
+ int multiline; /* datum was multiline */
if (stream == NULL)
return dimension_break;
@@ -1114,29 +1033,28 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info,
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Render a region element to output STREAM.
- * Description:
- * Prints the string buffer to the output STREAM. The string is
- * printed according to the format described in INFO. The CTX struct
- * contains context information shared between calls to this function.
+ * Function: h5tools_render_region_element
+ *
+ * Purpose: Prints the string buffer to the output STREAM. The string is
+ * printed according to the format described in INFO. The CTX struct
+ * contains context information shared between calls to this function.
*
* Return:
- * False if a dimension end is reached, otherwise true
+ * False if a dimension end is reached
+ * True otherwise
*
* In/Out:
- * h5tools_context_t *ctx
- * h5tools_str_t *buffer
- * hsize_t *curr_pos
+ * h5tools_context_t *ctx
+ * h5tools_str_t *buffer
+ * hsize_t *curr_pos
*
* Parameters Description:
- * h5tools_str_t *buffer is the string into which to render
- * hsize_t curr_pos is the total data element position
- * size_t ncols
- * hsize_t *ptdata
- * hsize_t local_elmt_counter is the local element loop counter
- * hsize_t elmt_count is the data element loop counter
+ * h5tools_str_t *buffer is the string into which to render
+ * hsize_t curr_pos is the total data element position
+ * size_t ncols
+ * hsize_t *ptdata
+ * hsize_t local_elmt_counter is the local element loop counter
+ * hsize_t elmt_count is the data element loop counter
*-------------------------------------------------------------------------
*/
hbool_t
@@ -1145,10 +1063,10 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info,
size_t ncols, hsize_t *ptdata, hsize_t local_elmt_counter, hsize_t elmt_counter)
{
hbool_t dimension_break = TRUE;
- char *s;
- char *section; /*a section of output */
- int secnum; /*section sequence number */
- int multiline; /*datum was multiline */
+ char *s = NULL;
+ char *section = NULL; /* a section of output */
+ int secnum; /* section sequence number */
+ int multiline; /* datum was multiline */
s = h5tools_str_fmt(buffer, (size_t)0, "%s");
@@ -1270,11 +1188,11 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info,
}
/*-------------------------------------------------------------------------
- * Function: init_acc_pos
+ * Function: init_acc_pos
*
- * Purpose: initialize accumulator and matrix position
+ * Purpose: initialize accumulator and matrix position
*
- * Return: void
+ * Return: void
*-------------------------------------------------------------------------
*/
void
@@ -1295,10 +1213,10 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims)
/*-------------------------------------------------------------------------
* Function: render_bin_output
*
- * Purpose: Write one element of memory buffer to a binary file stream
+ * Purpose: Write one element of memory buffer to a binary file stream
*
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: Success: SUCCEED
+ * Failure: FAIL
*-------------------------------------------------------------------------
*/
int
@@ -1344,7 +1262,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
{
unsigned int i;
H5T_str_t pad;
- char *s;
+ char *s = NULL;
unsigned char tempuchar;
pad = H5Tget_strpad(tid);
@@ -1372,7 +1290,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
break;
case H5T_COMPOUND:
{
- int snmembs;
+ int snmembs;
unsigned nmembs;
if((snmembs = H5Tget_nmembers(tid)) < 0)
@@ -1384,7 +1302,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
mem = ((unsigned char*)_mem) + block_index * size;
for (j = 0; j < nmembs; j++) {
- hid_t memb;
+ hid_t memb = -1;
size_t offset;
offset = H5Tget_member_offset(tid, j);
@@ -1404,7 +1322,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
{
int k, ndims;
hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts;
- hid_t memb;
+ hid_t memb = -1;
/* get the array's base datatype for each element */
memb = H5Tget_super(tid);
@@ -1437,7 +1355,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
case H5T_VLEN:
{
hsize_t nelmts;
- hid_t memb;
+ hid_t memb = -1;
/* get the VL sequences's base datatype for each element */
memb = H5Tget_super(tid);
@@ -1462,7 +1380,8 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
/* if (H5Tequal(tid, H5T_STD_REF_DSETREG)) */
if (region_output) {
/* region data */
- hid_t region_id, region_space;
+ hid_t region_id = -1;
+ hid_t region_space = -1;
H5S_sel_type region_type;
for (block_index = 0; block_index < block_nelmts; block_index++) {
@@ -1512,15 +1431,13 @@ CATCH
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Print the data values from a dataset referenced by region blocks.
+ * Function: render_bin_output_region_data_blocks
*
- * Description:
- * This is a special case subfunction to print the data in a region reference of type blocks.
+ * Purpose: Print the data values from a dataset referenced by region blocks.
+ * This is a special case subfunction to print the data in a region reference of type blocks.
*
- * Return:
- * The function returns FAIL if there was an error, otherwise SUCEED
+ * Return: FAIL if there was an error
+ * SUCCEED otherwise
*
*-------------------------------------------------------------------------
*/
@@ -1609,16 +1526,13 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream,
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Print some values from a dataset referenced by region blocks.
- *
- * Description:
- * This is a special case subfunction to dump a region reference using blocks.
+ * Function: render_bin_output_region_blocks
*
- * Return:
- * The function returns False if ERROR, otherwise True
+ * Purpose: Print some values from a dataset referenced by region blocks.
+ * This is a special case subfunction to dump a region reference using blocks.
*
+ * Return: False if ERROR
+ * True otherwise
*-------------------------------------------------------------------------
*/
hbool_t
@@ -1629,7 +1543,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id,
hssize_t snblocks;
hsize_t nblocks;
hsize_t alloc_size;
- hsize_t *ptdata;
+ hsize_t *ptdata = NULL;
int sndims;
unsigned ndims;
hid_t dtype = -1;
@@ -1675,8 +1589,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id,
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
+ * Function: H5Tools Library
* Purpose: Print the data values from a dataset referenced by region points.
*
* Description:
@@ -1736,16 +1649,13 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id,
}
/*-------------------------------------------------------------------------
- * Audience: Public
- * Chapter: H5Tools Library
- * Purpose: Print some values from a dataset referenced by region points.
+ * Function: render_bin_output_region_points
*
- * Description:
- * This is a special case subfunction to dump a region reference using points.
- *
- * Return:
- * The function returns False if the last dimension has been reached, otherwise True
+ * Purpose: Print some values from a dataset referenced by region points.
+ * This is a special case function to dump a region reference using points.
*
+ * Return: False if the last dimension has been reached
+ * True otherwise
*-------------------------------------------------------------------------
*/
hbool_t
@@ -1791,11 +1701,12 @@ CATCH
}
/*-------------------------------------------------------------------------
- * Function: h5tools_is_zero
+ * Function: h5tools_is_zero
*
- * Purpose: Determines if memory is initialized to all zero bytes.
+ * Purpose: Determines if memory is initialized to all zero bytes.
*
- * Return: TRUE if all bytes are zero; FALSE otherwise
+ * Return: TRUE if all bytes are zero
+ * FALSE otherwise
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE hbool_t
@@ -1811,23 +1722,20 @@ h5tools_is_zero(const void *_mem, size_t size)
}
/*-------------------------------------------------------------------------
- * Function: h5tools_is_obj_same
+ * Function: h5tools_is_obj_same
*
- * Purpose: Check if two given object IDs or link names point to the same object.
+ * Purpose: Check if two given object IDs or link names point to the same object.
*
* Parameters:
- * hid_t loc_id1: location of the first object
- * char *name1: link name of the first object.
- * Use "." or NULL if loc_id1 is the object to be compared.
- * hid_t loc_id2: location of the second object
- * char *name1: link name of the first object.
- * Use "." or NULL if loc_id2 is the object to be compared.
- *
- * Return: TRUE if it is the same object; FALSE otherwise.
+ * hid_t loc_id1: location of the first object
+ * char *name1: link name of the first object.
+ * Use "." or NULL if loc_id1 is the object to be compared.
+ * hid_t loc_id2: location of the second object
+ * char *name1: link name of the first object.
+ * Use "." or NULL if loc_id2 is the object to be compared.
*
- * Programmer: Peter Cao
- * 4/27/2011
- *
+ * Return: TRUE if it is the same object
+ * FALSE otherwise.
*-------------------------------------------------------------------------
*/
hbool_t
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index fb79b77..ed7d38a 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -642,8 +642,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
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)
- {
+ if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) {
HERROR(H5E_tools_g, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
HGOTO_DONE(dimension_break);
}
@@ -1910,9 +1909,8 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
obj = search_obj(h5dump_type_table, oinfo.addr);
if(obj) {
- if(!obj->recorded) {
+ if(!obj->recorded)
h5tools_str_append(buffer,"\"/#"H5_PRINTF_HADDR_FMT"\"", obj->objno);
- }
else
h5tools_str_append(buffer, "\"%s\"", obj->objname);
}
@@ -1929,121 +1927,86 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
switch (type_class) {
case H5T_INTEGER:
- if (H5Tequal(type, H5T_STD_I8BE) == TRUE) {
+ if (H5Tequal(type, H5T_STD_I8BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_I8BE");
- }
- else if (H5Tequal(type, H5T_STD_I8LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_I8LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_I8LE");
- }
- else if (H5Tequal(type, H5T_STD_I16BE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_I16BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_I16BE");
- }
- else if (H5Tequal(type, H5T_STD_I16LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_I16LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_I16LE");
- }
- else if (H5Tequal(type, H5T_STD_I32BE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_I32BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_I32BE");
- }
- else if (H5Tequal(type, H5T_STD_I32LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_I32LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_I32LE");
- }
- else if (H5Tequal(type, H5T_STD_I64BE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_I64BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_I64BE");
- }
- else if (H5Tequal(type, H5T_STD_I64LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_I64LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_I64LE");
- }
- else if (H5Tequal(type, H5T_STD_U8BE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_U8BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_U8BE");
- }
- else if (H5Tequal(type, H5T_STD_U8LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_U8LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_U8LE");
- }
- else if (H5Tequal(type, H5T_STD_U16BE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_U16BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_U16BE");
- }
- else if (H5Tequal(type, H5T_STD_U16LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_U16LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_U16LE");
- }
- else if (H5Tequal(type, H5T_STD_U32BE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_U32BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_U32BE");
- }
- else if (H5Tequal(type, H5T_STD_U32LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_U32LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_U32LE");
- }
- else if (H5Tequal(type, H5T_STD_U64BE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_U64BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_U64BE");
- }
- else if (H5Tequal(type, H5T_STD_U64LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_U64LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_U64LE");
- }
- else if (H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_SCHAR");
- }
- else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_UCHAR");
- }
- else if (H5Tequal(type, H5T_NATIVE_SHORT) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_SHORT) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_SHORT");
- }
- else if (H5Tequal(type, H5T_NATIVE_USHORT) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_USHORT) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_USHORT");
- }
- else if (H5Tequal(type, H5T_NATIVE_INT) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_INT) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_INT");
- }
- else if (H5Tequal(type, H5T_NATIVE_UINT) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_UINT) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_UINT");
- }
- else if (H5Tequal(type, H5T_NATIVE_LONG) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_LONG) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_LONG");
- }
- else if (H5Tequal(type, H5T_NATIVE_ULONG) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_ULONG) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_ULONG");
- }
- else if (H5Tequal(type, H5T_NATIVE_LLONG) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_LLONG) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_LLONG");
- }
- else if (H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_ULLONG");
- }
else {
/* byte order */
if (H5Tget_size(type) > 1) {
order = H5Tget_order(type);
- if (H5T_ORDER_LE == order) {
+ if (H5T_ORDER_LE == order)
order_s = " little-endian";
- }
- else if (H5T_ORDER_BE == order) {
+ else if (H5T_ORDER_BE == order)
order_s = " big-endian";
- }
- else if (H5T_ORDER_VAX == order) {
+ else if (H5T_ORDER_VAX == order)
order_s = " mixed-endian";
- }
- else {
+ else
order_s = " unknown-byte-order";
- }
}
- else {
+ else
order_s = "";
- }
/* sign */
if ((sign = H5Tget_sign(type)) >= 0) {
- if (H5T_SGN_NONE == sign) {
+ if (H5T_SGN_NONE == sign)
sign_s = " unsigned";
- }
- else if (H5T_SGN_2 == sign) {
+ else if (H5T_SGN_2 == sign)
sign_s = "";
- }
- else {
+ else
sign_s = " unknown-sign";
- }
}
- else {
+ else
sign_s = " unknown-sign";
- }
/* print size, order, and sign */
h5tools_str_append(buffer, "%lu-bit%s%s integer",
@@ -2052,56 +2015,42 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
break;
case H5T_FLOAT:
- if (H5Tequal(type, H5T_IEEE_F32BE) == TRUE) {
+ if (H5Tequal(type, H5T_IEEE_F32BE) == TRUE)
h5tools_str_append(buffer, "H5T_IEEE_F32BE");
- }
- else if (H5Tequal(type, H5T_IEEE_F32LE) == TRUE) {
+ else if (H5Tequal(type, H5T_IEEE_F32LE) == TRUE)
h5tools_str_append(buffer, "H5T_IEEE_F32LE");
- }
- else if (H5Tequal(type, H5T_IEEE_F64BE) == TRUE) {
+ else if (H5Tequal(type, H5T_IEEE_F64BE) == TRUE)
h5tools_str_append(buffer, "H5T_IEEE_F64BE");
- }
- else if (H5Tequal(type, H5T_IEEE_F64LE) == TRUE) {
+ else if (H5Tequal(type, H5T_IEEE_F64LE) == TRUE)
h5tools_str_append(buffer, "H5T_IEEE_F64LE");
- }
- else if (H5Tequal(type, H5T_VAX_F32) == TRUE) {
+ else if (H5Tequal(type, H5T_VAX_F32) == TRUE)
h5tools_str_append(buffer, "H5T_VAX_F32");
- }
- else if (H5Tequal(type, H5T_VAX_F64) == TRUE) {
+ else if (H5Tequal(type, H5T_VAX_F64) == TRUE)
h5tools_str_append(buffer, "H5T_VAX_F64");
- }
- else if (H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_FLOAT");
- }
- else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_DOUBLE");
#if H5_SIZEOF_LONG_DOUBLE !=0
- }
- else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE) {
+ else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_LDOUBLE");
#endif
- }
else {
/* byte order */
if (H5Tget_size(type) > 1) {
order = H5Tget_order(type);
- if (H5T_ORDER_LE == order) {
+ if (H5T_ORDER_LE == order)
order_s = " little-endian";
- }
- else if (H5T_ORDER_BE == order) {
+ else if (H5T_ORDER_BE == order)
order_s = " big-endian";
- }
- else if (H5T_ORDER_VAX == order) {
+ else if (H5T_ORDER_VAX == order)
order_s = " mixed-endian";
- }
- else {
+ else
order_s = " unknown-byte-order";
- }
}
- else {
+ else
order_s = "";
- }
/* print size and byte order */
h5tools_str_append(buffer, "%lu-bit%s floating-point",
@@ -2308,33 +2257,24 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
break;
case H5T_BITFIELD:
- if (H5Tequal(type, H5T_STD_B8BE) == TRUE) {
+ if (H5Tequal(type, H5T_STD_B8BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_B8BE");
- }
- else if (H5Tequal(type, H5T_STD_B8LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_B8LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_B8LE");
- }
- else if (H5Tequal(type, H5T_STD_B16BE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_B16BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_B16BE");
- }
- else if (H5Tequal(type, H5T_STD_B16LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_B16LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_B16LE");
- }
- else if (H5Tequal(type, H5T_STD_B32BE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_B32BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_B32BE");
- }
- else if (H5Tequal(type, H5T_STD_B32LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_B32LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_B32LE");
- }
- else if (H5Tequal(type, H5T_STD_B64BE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_B64BE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_B64BE");
- }
- else if (H5Tequal(type, H5T_STD_B64LE) == TRUE) {
+ else if (H5Tequal(type, H5T_STD_B64LE) == TRUE)
h5tools_str_append(buffer, "H5T_STD_B64LE");
- }
- else {
+ else
h5tools_str_append(buffer, "undefined bitfield");
- }
break;
case H5T_OPAQUE:
@@ -2948,7 +2888,7 @@ void
h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t dcpl, hid_t type_id, hid_t obj_id)
{
size_t size;
- hid_t n_type;
+ hid_t n_type = -1;
void *buf = NULL;
n_type = H5Tget_native_type(type_id, H5T_DIR_DEFAULT);
@@ -3698,7 +3638,8 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info,
error_msg("unable to open attribute \"%s\"\n", attr_name);
}
else {
- hid_t type, space;
+ hid_t type = -1;
+ hid_t space = -1;
ctx->indent_level++;
@@ -3917,9 +3858,9 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info,
H5S_class_t space_type;
int ndims;
int i;
- hid_t space;
- hid_t type;
- hid_t p_type;
+ hid_t space = -1;
+ hid_t type = -1;
+ hid_t p_type = -1;
hsize_t size[64];
hsize_t alloc_size;
hsize_t nelmts = 1;
diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c
index abd55db..db61d51 100644
--- a/tools/lib/h5tools_filters.c
+++ b/tools/lib/h5tools_filters.c
@@ -18,28 +18,32 @@
* print a warning message
*-------------------------------------------------------------------------
*/
-static void print_warning(const char *dname, const char *fname)
+static void print_filter_warning(const char *dname, const char *fname)
{
fprintf(stderr,
- "warning: dataset <%s> cannot be read, %s filter is not available\n",
+ "Warning: dataset <%s> cannot be read, %s filter is not available\n",
dname, fname);
}
/*-------------------------------------------------------------------------
* Function: h5tools_canreadf
*
- * Purpose: check if the dataset creation property list has filters that
- * are not registered in the current configuration
- * 1) the external filters GZIP and SZIP might not be available
- * 2) the internal filters might be turned off
+ * Purpose: check if the dataset creation property list has filters that
+ * are not registered in the current configuration
+ * 1) the external filters GZIP and SZIP might not be available
+ * 2) the internal filters might be turned off
*
- * Return: 1, can read, 0, cannot, -1 error
+ * Return:
+ * 1 can read,
+ * 0 cannot,
+ * -1 error
*-------------------------------------------------------------------------
*/
-int h5tools_canreadf(const char* name, /* object name, serves also as boolean print */
+int
+h5tools_canreadf(const char* name, /* object name, serves also as boolean print */
hid_t dcpl_id) /* dataset creation property list */
{
- int ret_value = 1; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
+ int ret_value = 1;
int nfilters; /* number of filters */
H5Z_filter_t filtn; /* filter identification number */
int i; /* index */
@@ -69,7 +73,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
}
else if (!udfilter_avail) {
if (name)
- print_warning(name, "user defined");
+ print_filter_warning(name, "user defined");
ret_value = 0;
}
break;
@@ -81,7 +85,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
case H5Z_FILTER_DEFLATE:
#ifndef H5_HAVE_FILTER_DEFLATE
if (name)
- print_warning(name,"deflate");
+ print_filter_warning(name,"deflate");
ret_value = 0;
#endif
break;
@@ -92,7 +96,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
case H5Z_FILTER_SZIP:
#ifndef H5_HAVE_FILTER_SZIP
if (name)
- print_warning(name,"SZIP");
+ print_filter_warning(name,"SZIP");
ret_value = 0;
#endif
break;
@@ -130,56 +134,58 @@ done:
/*-------------------------------------------------------------------------
* Function: h5tools_canwritef
*
- * Purpose: check if the filter is available and can write data.
- * At this time, all filters that are available can write data,
- * except SZIP, which may be configured decoder-only.
+ * Purpose: check if the filter is available and can write data.
*
- * Return: 1, can write, 0, cannot, -1 error
+ * Return: 1 can write,
+ * 0 cannot,
+ * -1 error
*-------------------------------------------------------------------------
*/
H5_ATTR_CONST int
-h5tools_can_encode(H5Z_filter_t filtn) {
+h5tools_can_encode(H5Z_filter_t filtn)
+{
+ int ret_value = 1;
+
switch (filtn) {
/* user defined filter */
default:
- return 0;
-
+ HGOTO_DONE(0)
case H5Z_FILTER_DEFLATE:
#ifndef H5_HAVE_FILTER_DEFLATE
- return 0;
+ HGOTO_DONE(0)
#endif
break;
case H5Z_FILTER_SZIP:
#ifndef H5_HAVE_FILTER_SZIP
- return 0;
+ HGOTO_DONE(0)
#else
- {
+ {
unsigned int filter_config_flags;
if (H5Zget_filter_info(filtn, &filter_config_flags) < 0)
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "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 (???) */
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "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 */
- return 0;
+ HGOTO_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 (???) */
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "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)) {
- return 1;
+ HGOTO_DONE(1)
}
- }
+ }
#endif
break;
@@ -196,6 +202,7 @@ h5tools_can_encode(H5Z_filter_t filtn) {
break;
}/*switch*/
- return 1;
+done:
+ return ret_value;
}
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index a66cfe5..a018394 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -715,10 +715,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
{
size_t nsize, offset, size=0, nelmts, start;
H5T_sign_t nsign;
- char *name;
+ char *name = NULL;
unsigned char *ucp_vp = (unsigned char *)vp;
char *cp_vp = (char *)vp;
- hid_t memb, obj;
+ hid_t memb = -1;
+ hid_t obj = -1;
static char fmt_llong[8], fmt_ullong[8];
H5T_str_t pad;
H5T_class_t type_class;
@@ -1306,7 +1307,8 @@ void
h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info,
hid_t container, void *vp)
{
- hid_t obj, region;
+ hid_t obj = -1;
+ hid_t region = -1;
char ref_name[1024];
H5S_sel_type region_type;
diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c
index ee58ccb..f63c228 100644
--- a/tools/lib/h5tools_type.c
+++ b/tools/lib/h5tools_type.c
@@ -21,12 +21,6 @@
*
* Return: Success: datatype ID
* Failure: FAIL
- *
- * Programmer: Pedro Vicente Nunes
- * Tuesday, July 18, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hid_t
@@ -43,40 +37,40 @@ h5tools_get_little_endian_type(hid_t tid)
switch(type_class) {
case H5T_INTEGER:
- if ( size == 1 && sign == H5T_SGN_2)
- p_type=H5Tcopy(H5T_STD_I8LE);
- else if ( size == 2 && sign == H5T_SGN_2)
- p_type=H5Tcopy(H5T_STD_I16LE);
- else if ( size == 4 && sign == H5T_SGN_2)
- p_type=H5Tcopy(H5T_STD_I32LE);
- else if ( size == 8 && sign == H5T_SGN_2)
- p_type=H5Tcopy(H5T_STD_I64LE);
- else if ( size == 1 && sign == H5T_SGN_NONE)
- p_type=H5Tcopy(H5T_STD_U8LE);
- else if ( size == 2 && sign == H5T_SGN_NONE)
- p_type=H5Tcopy(H5T_STD_U16LE);
- else if ( size == 4 && sign == H5T_SGN_NONE)
- p_type=H5Tcopy(H5T_STD_U32LE);
- else if ( size == 8 && sign == H5T_SGN_NONE)
- p_type=H5Tcopy(H5T_STD_U64LE);
+ if (size == 1 && sign == H5T_SGN_2)
+ p_type = H5Tcopy(H5T_STD_I8LE);
+ else if (size == 2 && sign == H5T_SGN_2)
+ p_type = H5Tcopy(H5T_STD_I16LE);
+ else if (size == 4 && sign == H5T_SGN_2)
+ p_type = H5Tcopy(H5T_STD_I32LE);
+ else if (size == 8 && sign == H5T_SGN_2)
+ p_type = H5Tcopy(H5T_STD_I64LE);
+ else if (size == 1 && sign == H5T_SGN_NONE)
+ p_type = H5Tcopy(H5T_STD_U8LE);
+ else if (size == 2 && sign == H5T_SGN_NONE)
+ p_type = H5Tcopy(H5T_STD_U16LE);
+ else if (size == 4 && sign == H5T_SGN_NONE)
+ p_type = H5Tcopy(H5T_STD_U32LE);
+ else if (size == 8 && sign == H5T_SGN_NONE)
+ p_type = H5Tcopy(H5T_STD_U64LE);
break;
case H5T_FLOAT:
- if ( size == 4)
- p_type=H5Tcopy(H5T_IEEE_F32LE);
- else if ( size == 8)
- p_type=H5Tcopy(H5T_IEEE_F64LE);
+ if (size == 4)
+ p_type = H5Tcopy(H5T_IEEE_F32LE);
+ else if (size == 8)
+ p_type = H5Tcopy(H5T_IEEE_F64LE);
break;
case H5T_BITFIELD:
- if ( size == 1)
- p_type=H5Tcopy(H5T_STD_B8LE);
- else if ( size == 2)
- p_type=H5Tcopy(H5T_STD_B16LE);
- else if ( size == 4)
- p_type=H5Tcopy(H5T_STD_B32LE);
- else if ( size == 8)
- p_type=H5Tcopy(H5T_STD_B64LE);
+ if (size == 1)
+ p_type = H5Tcopy(H5T_STD_B8LE);
+ else if (size == 2)
+ p_type = H5Tcopy(H5T_STD_B16LE);
+ else if (size == 4)
+ p_type = H5Tcopy(H5T_STD_B32LE);
+ else if (size == 8)
+ p_type = H5Tcopy(H5T_STD_B64LE);
break;
case H5T_TIME:
@@ -107,18 +101,12 @@ h5tools_get_little_endian_type(hid_t tid)
*
* Return: Success: datatype ID
* Failure: FAIL
- *
- * Programmer: Pedro Vicente Nunes
- * Tuesday, July 18, 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hid_t
h5tools_get_big_endian_type(hid_t tid)
{
- hid_t p_type=-1;
+ hid_t p_type = -1;
H5T_class_t type_class;
size_t size;
H5T_sign_t sign;
@@ -129,39 +117,39 @@ h5tools_get_big_endian_type(hid_t tid)
switch(type_class) {
case H5T_INTEGER:
- if ( size == 1 && sign == H5T_SGN_2)
- p_type=H5Tcopy(H5T_STD_I8BE);
- else if ( size == 2 && sign == H5T_SGN_2)
- p_type=H5Tcopy(H5T_STD_I16BE);
- else if ( size == 4 && sign == H5T_SGN_2)
- p_type=H5Tcopy(H5T_STD_I32BE);
- else if ( size == 8 && sign == H5T_SGN_2)
- p_type=H5Tcopy(H5T_STD_I64BE);
- else if ( size == 1 && sign == H5T_SGN_NONE)
- p_type=H5Tcopy(H5T_STD_U8BE);
- else if ( size == 2 && sign == H5T_SGN_NONE)
- p_type=H5Tcopy(H5T_STD_U16BE);
- else if ( size == 4 && sign == H5T_SGN_NONE)
- p_type=H5Tcopy(H5T_STD_U32BE);
- else if ( size == 8 && sign == H5T_SGN_NONE)
- p_type=H5Tcopy(H5T_STD_U64BE);
+ if (size == 1 && sign == H5T_SGN_2)
+ p_type = H5Tcopy(H5T_STD_I8BE);
+ else if (size == 2 && sign == H5T_SGN_2)
+ p_type = H5Tcopy(H5T_STD_I16BE);
+ else if (size == 4 && sign == H5T_SGN_2)
+ p_type = H5Tcopy(H5T_STD_I32BE);
+ else if (size == 8 && sign == H5T_SGN_2)
+ p_type = H5Tcopy(H5T_STD_I64BE);
+ else if (size == 1 && sign == H5T_SGN_NONE)
+ p_type = H5Tcopy(H5T_STD_U8BE);
+ else if (size == 2 && sign == H5T_SGN_NONE)
+ p_type = H5Tcopy(H5T_STD_U16BE);
+ else if (size == 4 && sign == H5T_SGN_NONE)
+ p_type = H5Tcopy(H5T_STD_U32BE);
+ else if (size == 8 && sign == H5T_SGN_NONE)
+ p_type = H5Tcopy(H5T_STD_U64BE);
break;
case H5T_FLOAT:
- if ( size == 4)
- p_type=H5Tcopy(H5T_IEEE_F32BE);
- else if ( size == 8)
- p_type=H5Tcopy(H5T_IEEE_F64BE);
+ if (size == 4)
+ p_type = H5Tcopy(H5T_IEEE_F32BE);
+ else if (size == 8)
+ p_type = H5Tcopy(H5T_IEEE_F64BE);
break;
case H5T_BITFIELD:
- if ( size == 1)
- p_type=H5Tcopy(H5T_STD_B8BE);
- else if ( size == 2)
- p_type=H5Tcopy(H5T_STD_B16BE);
- else if ( size == 4)
- p_type=H5Tcopy(H5T_STD_B32BE);
- else if ( size == 8)
+ if (size == 1)
+ p_type = H5Tcopy(H5T_STD_B8BE);
+ else if (size == 2)
+ p_type = H5Tcopy(H5T_STD_B16BE);
+ else if (size == 4)
+ p_type = H5Tcopy(H5T_STD_B32BE);
+ else if (size == 8)
p_type=H5Tcopy(H5T_STD_B64BE);
break;
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 8c435b2..5272e81 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -58,15 +58,11 @@ static void add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t
/*-------------------------------------------------------------------------
* Function: parallel_print
*
- * Purpose: wrapper for printf for use in parallel mode.
- *
- * Programmer: Leon Arber
- *
- * Date: December 1, 2004
- *
+ * Purpose: wrapper for printf for use in parallel mode.
*-------------------------------------------------------------------------
*/
-void parallel_print(const char* format, ...)
+void
+parallel_print(const char* format, ...)
{
int bytes_written;
va_list ap;
@@ -103,18 +99,12 @@ void parallel_print(const char* format, ...)
/*-------------------------------------------------------------------------
- * Function: error_msg
+ * Function: error_msg
*
- * Purpose: Print a nicely formatted error message to stderr flushing the
+ * Purpose: Print a nicely formatted error message to stderr flushing the
* stdout stream first.
*
- * Return: Nothing
- *
- * Programmer: Bill Wendling
- * Tuesday, 20. February 2001
- *
- * Modifications:
- *
+ * Return: Nothing
*-------------------------------------------------------------------------
*/
void
@@ -134,18 +124,12 @@ error_msg(const char *fmt, ...)
/*-------------------------------------------------------------------------
- * Function: warn_msg
+ * Function: warn_msg
*
- * Purpose: Print a nicely formatted warning message to stderr flushing
+ * Purpose: Print a nicely formatted warning message to stderr flushing
* the stdout stream first.
*
- * Return: Nothing
- *
- * Programmer: Bill Wendling
- * Tuesday, 20. February 2001
- *
- * Modifications:
- *
+ * Return: Nothing
*-------------------------------------------------------------------------
*/
void
@@ -163,14 +147,11 @@ warn_msg(const char *fmt, ...)
}
/*-------------------------------------------------------------------------
- * Function: help_ref_msg
- *
- * Purpose: Print a message to refer help page
+ * Function: help_ref_msg
*
- * Return: Nothing
- *
- * Modifications:
+ * Purpose: Print a message to refer help page
*
+ * Return: Nothing
*-------------------------------------------------------------------------
*/
void
@@ -182,24 +163,16 @@ help_ref_msg(FILE *output)
/*-------------------------------------------------------------------------
- * Function: get_option
+ * Function: get_option
*
- * Purpose: Determine the command-line options a user specified. We can
- * accept both short and long type command-lines.
+ * Purpose: Determine the command-line options a user specified. We can
+ * accept both short and long type command-lines.
*
* Return: Success: The short valued "name" of the command line
* parameter or EOF if there are no more
* parameters to process.
*
- * Failure: A question mark.
- *
- * Programmer: Bill Wendling
- * Friday, 5. January 2001
- *
- * Modifications: Pedro Vicente
- * October, 27 2008
- * Wilcard "*" argument type
- *
+ * Failure: A question mark.
*-------------------------------------------------------------------------
*/
int
@@ -351,16 +324,11 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
/*-------------------------------------------------------------------------
- * Function: indentation
- *
- * Purpose: Print spaces for indentation
- *
- * Return: void
- *
- * Programmer: Ruey-Hsia Li
+ * Function: indentation
*
- * Modifications:
+ * Purpose: Print spaces for indentation
*
+ * Return: void
*-------------------------------------------------------------------------
*/
void
@@ -378,17 +346,12 @@ indentation(unsigned x)
/*-------------------------------------------------------------------------
- * Function: print_version
- *
- * Purpose: Print the program name and the version information which is
- * defined the same as the HDF5 library version.
- *
- * Return: void
+ * Function: print_version
*
- * Programmer: unknown
- *
- * Modifications:
+ * Purpose: Print the program name and the version information which is
+ * defined the same as the HDF5 library version.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
void
@@ -407,11 +370,6 @@ print_version(const char *progname)
* and committed types
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -434,11 +392,6 @@ init_table(table_t **tbl)
* and committed types
*
* Return: void
- *
- * Programmer: Paul Harten
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -462,11 +415,6 @@ free_table(table_t *table)
* Purpose: display the contents of tables for debugging purposes
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -488,11 +436,6 @@ dump_table(char* tablename, table_t *table)
* Purpose: display the contents of tables for debugging purposes
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -513,11 +456,6 @@ dump_tables(find_objs_t *info)
* Return: Success: an integer, the location of the object
*
* Failure: FAIL if object is not found
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE obj_t *
@@ -541,16 +479,10 @@ search_obj(table_t *table, haddr_t objno)
* Return: Success: SUCCEED
*
* Failure: FAIL
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen,
- void *op_data)
+find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen, void *op_data)
{
find_objs_t *info = (find_objs_t*)op_data;
herr_t ret_value = 0;
@@ -563,7 +495,7 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen
case H5O_TYPE_DATASET:
if(NULL == already_seen) {
- hid_t dset;
+ hid_t dset = -1;
/* Add the dataset to the list of objects */
add_obj(info->dset_table, oinfo->addr, name, TRUE);
@@ -623,11 +555,6 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen
* Return: Success: SUCCEED
*
* Failure: FAIL
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -657,11 +584,6 @@ init_objs(hid_t fid, find_objs_t *info, table_t **group_table,
* realloc the table if necessary
*
* Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -695,11 +617,6 @@ add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t record)
*
* Return: a stream description when succeeds.
* NULL if fails.
- *
- * Programmer: Albert Cheng, 2005/8/9
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
FILE *
@@ -723,70 +640,61 @@ tmpfile(void)
*
* Return:
* 2 : given pathname is object
- * 1 : Succed to get link info.
+ * 1 : Succeed to get link info.
* 0 : Detected as a dangling link
* -1 : H5 API failed.
*
* NOTE:
* link_info->trg_path must be freed out of this function
- *
- * Programmer: Jonathan Kim
- *
- * Date: Feb 8, 2010
*-------------------------------------------------------------------------*/
int
-H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info,
- hbool_t get_obj_type)
+H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info, hbool_t get_obj_type)
{
htri_t l_ret;
H5O_info_t trg_oinfo;
hid_t fapl = H5P_DEFAULT;
hid_t lapl = H5P_DEFAULT;
- int ret = -1; /* init to fail */
+ int ret_value = -1; /* init to fail */
/* init */
link_info->trg_type = H5O_TYPE_UNKNOWN;
/* if path is root, return group type */
- if(!HDstrcmp(linkpath,"/"))
- {
+ if(!HDstrcmp(linkpath,"/")) {
link_info->trg_type = H5O_TYPE_GROUP;
- ret = 2;
- goto out;
+ HGOTO_DONE(2);
}
/* check if link itself exist */
if(H5Lexists(file_id, linkpath, H5P_DEFAULT) <= 0) {
if(link_info->opt.msg_mode == 1)
parallel_print("Warning: link <%s> doesn't exist \n",linkpath);
- goto out;
+ HGOTO_DONE(FAIL);
} /* end if */
/* get info from link */
if(H5Lget_info(file_id, linkpath, &(link_info->linfo), H5P_DEFAULT) < 0) {
if(link_info->opt.msg_mode == 1)
parallel_print("Warning: unable to get link info from <%s>\n",linkpath);
- goto out;
+ HGOTO_DONE(FAIL);
} /* end if */
/* given path is hard link (object) */
- if(link_info->linfo.type == H5L_TYPE_HARD) {
- ret = 2;
- goto out;
- } /* end if */
+ if(link_info->linfo.type == H5L_TYPE_HARD)
+ HGOTO_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->opt.msg_mode == 1)
parallel_print("Warning: unable to allocate buffer for <%s>\n",linkpath);
- goto out;
+ HGOTO_DONE(FAIL);
} /* end if */
/* get link value */
if(H5Lget_val(file_id, linkpath, (void *)link_info->trg_path, link_info->linfo.u.val_size, H5P_DEFAULT) < 0) {
if(link_info->opt.msg_mode == 1)
parallel_print("Warning: unable to get link value from <%s>\n",linkpath);
- goto out;
+ HGOTO_DONE(FAIL);
} /* end if */
/*-----------------------------------------------------
@@ -795,13 +703,13 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_
*/
if(link_info->linfo.type == H5L_TYPE_EXTERNAL) {
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- goto out;
+ HGOTO_DONE(FAIL);
if(H5Pset_fapl_sec2(fapl) < 0)
- goto out;
+ HGOTO_DONE(FAIL);
if((lapl = H5Pcreate(H5P_LINK_ACCESS)) < 0)
- goto out;
+ HGOTO_DONE(FAIL);
if(H5Pset_elink_fapl(lapl, fapl) < 0)
- goto out;
+ HGOTO_DONE(FAIL);
} /* end if */
/* Check for retrieving object info */
@@ -814,25 +722,24 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_
/* detect dangling link */
if(l_ret == FALSE) {
- ret = 0;
- goto out;
- } /* end if */
- /* function failed */
- else if(l_ret < 0)
- goto out;
+ HGOTO_DONE(0);
+ }
+ else if(l_ret < 0) { /* function failed */
+ HGOTO_DONE(FAIL);
+ }
/* get target object info */
if(H5Oget_info_by_name(file_id, linkpath, &trg_oinfo, lapl) < 0) {
if(link_info->opt.msg_mode == 1)
parallel_print("Warning: unable to get object information for <%s>\n", linkpath);
- goto out;
+ HGOTO_DONE(FAIL);
} /* end if */
/* check unknown type */
if(trg_oinfo.type < H5O_TYPE_GROUP || trg_oinfo.type >=H5O_TYPE_NTYPES) {
if(link_info->opt.msg_mode == 1)
parallel_print("Warning: target object of <%s> is unknown type\n", linkpath);
- goto out;
+ HGOTO_DONE(FAIL);
} /* end if */
/* set target obj type to return */
@@ -844,31 +751,34 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_
link_info->trg_type = H5O_TYPE_UNKNOWN;
/* succeed */
- ret = 1;
+ ret_value = 1;
-out:
+done:
if(fapl != H5P_DEFAULT)
H5Pclose(fapl);
if(lapl != H5P_DEFAULT)
H5Pclose(lapl);
- return ret;
+ return ret_value;
} /* end H5tools_get_symlink_info() */
/*-------------------------------------------------------------------------
* Audience: Public
- * Chapter: H5Tools Library
+ *
* Purpose: Initialize the name and operation status of the H5 Tools library
+ *
* Description:
* These are utility functions to set/get the program name and operation status.
*-------------------------------------------------------------------------
*/
-void h5tools_setprogname(const char *Progname)
+void
+h5tools_setprogname(const char *Progname)
{
h5tools_progname = Progname;
}
-void h5tools_setstatus(int D_status)
+void
+h5tools_setstatus(int D_status)
{
h5tools_d_status = D_status;
}
@@ -892,25 +802,19 @@ h5tools_getstatus(void)
* This can be called from each tools main() as part of initial act.
* Note: this is more of debugging purpose for now.
*/
-int h5tools_getenv_update_hyperslab_bufsize(void)
+int
+h5tools_getenv_update_hyperslab_bufsize(void)
{
const char *env_str = NULL;
long hyperslab_bufsize_mb;
+ int ret_value = 1;
/* check if environment variable is set for the hyperslab buffer size */
- if (NULL != (env_str = HDgetenv ("H5TOOLS_BUFSIZE")))
- {
+ if (NULL != (env_str = HDgetenv ("H5TOOLS_BUFSIZE"))) {
errno = 0;
hyperslab_bufsize_mb = HDstrtol(env_str, (char**)NULL, 10);
if (errno != 0 || hyperslab_bufsize_mb <= 0)
- {
- /* TODO: later when pubilshed
- HDfprintf(rawerrorstream,"Error: Invalid environment variable \"H5TOOLS_BUFSIZE\" : %s\n", env_str);
- */
-
- goto error;
- }
-
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "hyperslab buffer size failed");
/* convert MB to byte */
H5TOOLS_BUFSIZE = (hsize_t)hyperslab_bufsize_mb * 1024 * 1024;
@@ -918,9 +822,7 @@ int h5tools_getenv_update_hyperslab_bufsize(void)
H5TOOLS_MALLOCSIZE = MAX(H5TOOLS_BUFSIZE, H5TOOLS_MALLOCSIZE);
}
- return (1);
-
-error:
- return (-1);
+done:
+ return ret_value;
}
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index ddc0109..b6d32f7 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -13,6 +13,7 @@
#include "h5trav.h"
+#include "h5tools.h"
#include "H5private.h"
/*-------------------------------------------------------------------------
@@ -81,10 +82,9 @@ static int trav_verbosity = 0;
/*-------------------------------------------------------------------------
* Function: h5trav_set_index
*
- * Purpose: Set indexing properties for the objects & links in the file
- *
- * Return: none
+ * Purpose: Set indexing properties for the objects & links in the file
*
+ * Return: none
*-------------------------------------------------------------------------
*/
void
@@ -97,10 +97,9 @@ h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order)
/*-------------------------------------------------------------------------
* Function: h5trav_set_verbose
*
- * Purpose: Set verbosity of file contents 1=>attributes
- *
- * Return: none
+ * Purpose: Set verbosity of file contents 1=>attributes
*
+ * Return: none
*-------------------------------------------------------------------------
*/
void
@@ -118,14 +117,9 @@ h5trav_set_verbose(int print_verbose)
/*-------------------------------------------------------------------------
* Function: trav_addr_add
*
- * Purpose: Add a hardlink address to visited data structure
- *
- * Return: void
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 1, 2007
+ * Purpose: Add a hardlink address to visited data structure
*
+ * Return: void
*-------------------------------------------------------------------------
*/
static void
@@ -149,14 +143,9 @@ trav_addr_add(trav_addr_t *visited, haddr_t addr, const char *path)
/*-------------------------------------------------------------------------
* Function: trav_addr_visited
*
- * Purpose: Check if an address has already been visited
- *
- * Return: TRUE/FALSE
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 1, 2007
+ * Purpose: Check if an address has already been visited
*
+ * Return: TRUE/FALSE
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE static const char *
@@ -178,12 +167,7 @@ trav_addr_visited(trav_addr_t *visited, haddr_t addr)
/*-------------------------------------------------------------------------
* Function: traverse_cb
*
- * Purpose: Iterator callback for traversing objects in file
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 1, 2007
- *
+ * Purpose: Iterator callback for traversing objects in file
*-------------------------------------------------------------------------
*/
static herr_t
@@ -258,26 +242,23 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo,
/*-------------------------------------------------------------------------
* Function: traverse
*
- * Purpose: Iterate over all the objects/links in a file. Conforms to the
- * "visitor" pattern.
- *
- * Return: 0 on success, -1 on failure
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 1, 2007
+ * Purpose: Iterate over all the objects/links in a file. Conforms to the
+ * "visitor" pattern.
*
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
static int
traverse(hid_t file_id, const char *grp_name, hbool_t visit_start,
- hbool_t recurse, const trav_visitor_t *visitor)
+ hbool_t recurse, const trav_visitor_t *visitor)
{
H5O_info_t oinfo; /* Object info for starting group */
+ int ret_value = SUCCEED;
/* Get info for starting object */
if(H5Oget_info_by_name(file_id, grp_name, &oinfo, H5P_DEFAULT) < 0)
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info_by_name failed");
/* Visit the starting object */
if(visit_start && visitor->visit_obj)
@@ -306,12 +287,12 @@ traverse(hid_t file_id, const char *grp_name, hbool_t visit_start,
if(recurse) {
/* Visit all links in group, recursively */
if(H5Lvisit_by_name(file_id, grp_name, trav_index_by, trav_index_order, traverse_cb, &udata, H5P_DEFAULT) < 0)
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lvisit_by_name failed");
} /* end if */
else {
/* Iterate over links in group */
if(H5Literate_by_name(file_id, grp_name, trav_index_by, trav_index_order, NULL, traverse_cb, &udata, H5P_DEFAULT) < 0)
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Literate_by_name failed");
} /* end else */
/* Free visited addresses table */
@@ -325,21 +306,17 @@ traverse(hid_t file_id, const char *grp_name, hbool_t visit_start,
} /* end if */
} /* end if */
- return 0;
+done:
+ return ret_value;
}
/*-------------------------------------------------------------------------
* Function: trav_info_add
*
- * Purpose: Add a link path & type to info struct
- *
- * Return: void
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 1, 2007
+ * Purpose: Add a link path & type to info struct
*
+ * Return: void
*-------------------------------------------------------------------------
*/
void
@@ -347,18 +324,20 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type)
{
size_t idx; /* Index of address to use */
- /* Allocate space if necessary */
- 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));
- } /* end if */
+ if (info) {
+ /* Allocate space if necessary */
+ 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));
+ } /* end if */
- /* Append it */
- idx = info->nused++;
- info->paths[idx].path = HDstrdup(path);
- info->paths[idx].type = obj_type;
- info->paths[idx].fileno = 0;
- info->paths[idx].objno = HADDR_UNDEF;
+ /* Append it */
+ idx = info->nused++;
+ info->paths[idx].path = HDstrdup(path);
+ info->paths[idx].type = obj_type;
+ info->paths[idx].fileno = 0;
+ info->paths[idx].objno = HADDR_UNDEF;
+ }
} /* end trav_info_add() */
@@ -368,7 +347,6 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type)
* Purpose: Add a file addr & fileno to info struct
*
* Return: void
- *
*-------------------------------------------------------------------------
*/
void
@@ -390,22 +368,19 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id)
/*-------------------------------------------------------------------------
* Function: trav_info_visit_obj
*
- * Purpose: Callback for visiting object, with 'info' structure
- *
- * Return: 0 on success, -1 on failure
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 1, 2007
+ * Purpose: Callback for visiting object, with 'info' structure
*
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
int
trav_info_visit_obj(const char *path, const H5O_info_t *oinfo,
- const char H5_ATTR_UNUSED *already_visited, void *udata)
+ const char H5_ATTR_UNUSED *already_visited, void *udata)
{
size_t idx;
trav_info_t *info_p;
+
/* Add the object to the 'info' struct */
/* (object types map directly to "traversal" types) */
trav_info_add((trav_info_t *)udata, path, (h5trav_type_t)oinfo->type);
@@ -423,14 +398,10 @@ trav_info_visit_obj(const char *path, const H5O_info_t *oinfo,
/*-------------------------------------------------------------------------
* Function: trav_info_visit_lnk
*
- * Purpose: Callback for visiting link, with 'info' structure
- *
- * Return: 0 on success, -1 on failure
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 1, 2007
+ * Purpose: Callback for visiting link, with 'info' structure
*
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
int
@@ -446,21 +417,18 @@ trav_info_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
/*-------------------------------------------------------------------------
* Function: h5trav_getinfo
*
- * Purpose: get an array of "trav_info_t" , containing the name and type of
- * objects in the file
- *
- * Return: number of object names in file
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: November 6, 2002
+ * Purpose: get an array of "trav_info_t" , containing the name and type of
+ * objects in the file
*
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
int
h5trav_getinfo(hid_t file_id, trav_info_t *info)
{
trav_visitor_t info_visitor; /* Visitor structure for trav_info_t's */
+ int ret_value = SUCCEED;
/* Init visitor structure */
info_visitor.visit_obj = trav_info_visit_obj;
@@ -469,25 +437,21 @@ h5trav_getinfo(hid_t file_id, trav_info_t *info)
/* Traverse all objects in the file, visiting each object & link */
if(traverse(file_id, "/", TRUE, TRUE, &info_visitor) < 0)
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed");
- return 0;
+done:
+ return ret_value;
}
/*-------------------------------------------------------------------------
* Function: h5trav_getindex
*
- * Purpose: get index of OBJ in list
- *
- * Return: index, -1 if not found
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: May 9, 2003
+ * Purpose: get index of OBJ in list
*
+ * Return: index on success,
+ * -1 if not found
*-------------------------------------------------------------------------
*/
-
H5_ATTR_PURE ssize_t
h5trav_getindex(const trav_info_t *info, const char *obj)
{
@@ -511,17 +475,11 @@ h5trav_getindex(const trav_info_t *info, const char *obj)
/*-------------------------------------------------------------------------
* Function: trav_info_init
*
- * Purpose: Initialize the info
- *
- * Return: void
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 6, 2007
+ * Purpose: Initialize the info
*
+ * Return: void
*-------------------------------------------------------------------------
*/
-
void
trav_info_init(const char *filename, hid_t fileid, trav_info_t **_info)
{
@@ -545,11 +503,9 @@ trav_info_init(const char *filename, hid_t fileid, trav_info_t **_info)
/*-------------------------------------------------------------------------
* Function: trav_info_free
*
- * Purpose: free info memory
- *
+ * Purpose: free info memory
*-------------------------------------------------------------------------
*/
-
void
trav_info_free(trav_info_t *info)
{
@@ -557,11 +513,9 @@ trav_info_free(trav_info_t *info)
if(info) {
/* Free visited symbolic links path and file (if alloc) */
- for(u=0; u < info->symlink_visited.nused; u++)
- {
+ 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);
}
HDfree(info->symlink_visited.objs);
@@ -586,12 +540,8 @@ trav_info_free(trav_info_t *info)
*
* Purpose: Callback for visiting object, with 'table' sructure
*
- * Return: 0 on success, -1 on failure
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 1, 2007
- *
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
static int
@@ -608,21 +558,17 @@ trav_table_visit_obj(const char *path, const H5O_info_t *oinfo,
/* Add alias for object to table */
trav_table_addlink(table, oinfo->addr, path);
- return(0);
+ return 0;
} /* end trav_table_visit_obj() */
/*-------------------------------------------------------------------------
* Function: trav_table_visit_lnk
*
- * Purpose: Callback for visiting link, with 'table' sructure
- *
- * Return: 0 on success, -1 on failure
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 1, 2007
+ * Purpose: Callback for visiting link, with 'table' sructure
*
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
static int
@@ -631,28 +577,24 @@ trav_table_visit_lnk(const char *path, const H5L_info_t H5_ATTR_UNUSED *linfo, v
/* Add the link to the 'table' struct */
trav_table_add((trav_table_t *)udata, path, NULL);
- return(0);
+ return 0;
} /* end trav_table_visit_lnk() */
/*-------------------------------------------------------------------------
* Function: h5trav_gettable
*
- * Purpose: get the trav_table_t struct
- *
- * Return: 0, -1 on error
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: December 17, 2003
+ * Purpose: get the trav_table_t struct
*
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
-
int
h5trav_gettable(hid_t fid, trav_table_t *table)
{
trav_visitor_t table_visitor; /* Visitor structure for trav_table_t's */
+ int ret_value = SUCCEED;
/* Init visitor structure */
table_visitor.visit_obj = trav_table_visit_obj;
@@ -661,71 +603,63 @@ h5trav_gettable(hid_t fid, trav_table_t *table)
/* Traverse all objects in the file, visiting each object & link */
if(traverse(fid, "/", TRUE, TRUE, &table_visitor) < 0)
- return -1;
- return 0;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed");
+
+done:
+ return ret_value;
}
/*-------------------------------------------------------------------------
* Function: h5trav_getindext
*
- * Purpose: get index of NAME in list
- *
- * Return: index, -1 if not found
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: December 18, 2003
+ * Purpose: get index of NAME in list
*
+ * Return: index on success,
+ * -1 if not found
*-------------------------------------------------------------------------
*/
-
H5_ATTR_PURE int
h5trav_getindext(const char *name, const trav_table_t *table)
{
unsigned int i;
- for(i = 0; i < table->nobjs; i++) {
- /* Check for object name having full path (with leading '/') */
- if(HDstrcmp(name, table->objs[i].name) == 0)
- return((int)i);
-
- /* Check for object name without leading '/' */
- if(HDstrcmp(name, table->objs[i].name + 1) == 0)
- return((int)i);
+ if(table) {
+ for(i = 0; i < table->nobjs; i++) {
+ /* Check for object name having full path (with leading '/') */
+ if(HDstrcmp(name, table->objs[i].name) == 0)
+ return((int)i);
- /* search also in the list of links */
- if(table->objs[i].nlinks) {
- unsigned int j;
+ /* Check for object name without leading '/' */
+ if(HDstrcmp(name, table->objs[i].name + 1) == 0)
+ return((int)i);
- for ( j=0; j<table->objs[i].nlinks; j++) {
- /* Check for object name having full path (with leading '/') */
- if(HDstrcmp(name, table->objs[i].links[j].new_name) == 0)
- return((int)i);
+ /* search also in the list of links */
+ if(table->objs[i].nlinks) {
+ unsigned int j;
- /* Check for object name without leading '/' */
- if(HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0)
- return((int)i);
- } /* end for */
- } /* end if */
- } /* end for */
+ for ( j=0; j<table->objs[i].nlinks; j++) {
+ /* Check for object name having full path (with leading '/') */
+ if(HDstrcmp(name, table->objs[i].links[j].new_name) == 0)
+ return((int)i);
+ /* Check for object name without leading '/' */
+ if(HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0)
+ return((int)i);
+ } /* end for */
+ } /* end if */
+ } /* end for */
+ }
return -1;
}
/*-------------------------------------------------------------------------
* Function: trav_table_add
*
- * Purpose: Add OBJNO, NAME and TYPE of object to table
- *
- * Return: void
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: November 4, 2002
+ * Purpose: Add OBJNO, NAME and TYPE of object to table
*
+ * Return: void
*-------------------------------------------------------------------------
*/
-
static void
trav_table_add(trav_table_t *table,
const char *path,
@@ -733,20 +667,22 @@ trav_table_add(trav_table_t *table,
{
size_t new_obj;
- 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));
- } /* end if */
+ 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));
+ } /* end if */
- new_obj = table->nobjs++;
- table->objs[new_obj].objno = oinfo ? oinfo->addr : HADDR_UNDEF;
- table->objs[new_obj].flags[0] = table->objs[new_obj].flags[1] = 0;
- table->objs[new_obj].is_same_trgobj = 0;
- table->objs[new_obj].name = (char *)HDstrdup(path);
- table->objs[new_obj].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK;
- table->objs[new_obj].nlinks = 0;
- table->objs[new_obj].sizelinks = 0;
- table->objs[new_obj].links = NULL;
+ new_obj = table->nobjs++;
+ table->objs[new_obj].objno = oinfo ? oinfo->addr : HADDR_UNDEF;
+ table->objs[new_obj].flags[0] = table->objs[new_obj].flags[1] = 0;
+ table->objs[new_obj].is_same_trgobj = 0;
+ table->objs[new_obj].name = (char *)HDstrdup(path);
+ table->objs[new_obj].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK;
+ table->objs[new_obj].nlinks = 0;
+ table->objs[new_obj].sizelinks = 0;
+ table->objs[new_obj].links = NULL;
+ }
}
/*-------------------------------------------------------------------------
@@ -755,58 +691,47 @@ trav_table_add(trav_table_t *table,
* Purpose: Add a hardlink name to the object
*
* Return: void
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: December 17, 2003
- *
*-------------------------------------------------------------------------
*/
-
static void
trav_table_addlink(trav_table_t *table, haddr_t objno, const char *path)
{
size_t i; /* Local index variable */
- for(i = 0; i < table->nobjs; i++) {
- if(table->objs[i].objno == objno) {
- size_t n;
+ if(table) {
+ for(i = 0; i < table->nobjs; i++) {
+ if(table->objs[i].objno == objno) {
+ size_t n;
- /* already inserted? */
- if(HDstrcmp(table->objs[i].name, path) == 0)
- return;
+ /* already inserted? */
+ if(HDstrcmp(table->objs[i].name, path) == 0)
+ return;
- /* 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, table->objs[i].sizelinks * sizeof(trav_link_t));
- } /* end if */
+ /* 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, table->objs[i].sizelinks * sizeof(trav_link_t));
+ } /* end if */
- /* insert it */
- n = table->objs[i].nlinks++;
- table->objs[i].links[n].new_name = (char *)HDstrdup(path);
+ /* insert it */
+ n = table->objs[i].nlinks++;
+ table->objs[i].links[n].new_name = (char *)HDstrdup(path);
- return;
+ return;
+ } /* end for */
} /* end for */
- } /* end for */
+ }
}
-
/*-------------------------------------------------------------------------
* Function: trav_table_addflags
*
- * Purpose: Add FLAGS, NAME and TYPE of object to table
- *
- * Return: void
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: November 4, 2002
+ * Purpose: Add FLAGS, NAME and TYPE of object to table
*
+ * Return: void
*-------------------------------------------------------------------------
*/
-
void trav_table_addflags(unsigned *flags,
char *name,
h5trav_type_t type,
@@ -814,92 +739,83 @@ void trav_table_addflags(unsigned *flags,
{
size_t new_obj;
- 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));
- } /* end if */
+ 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));
+ } /* end if */
- new_obj = table->nobjs++;
- table->objs[new_obj].objno = 0;
- table->objs[new_obj].flags[0] = flags[0];
- table->objs[new_obj].flags[1] = flags[1];
- table->objs[new_obj].is_same_trgobj = 0;
- table->objs[new_obj].name = (char *)HDstrdup(name);
- table->objs[new_obj].type = type;
- table->objs[new_obj].nlinks = 0;
- table->objs[new_obj].sizelinks = 0;
- table->objs[new_obj].links = NULL;
+ new_obj = table->nobjs++;
+ table->objs[new_obj].objno = 0;
+ table->objs[new_obj].flags[0] = flags[0];
+ table->objs[new_obj].flags[1] = flags[1];
+ table->objs[new_obj].is_same_trgobj = 0;
+ table->objs[new_obj].name = (char *)HDstrdup(name);
+ table->objs[new_obj].type = type;
+ table->objs[new_obj].nlinks = 0;
+ table->objs[new_obj].sizelinks = 0;
+ table->objs[new_obj].links = NULL;
+ }
}
/*-------------------------------------------------------------------------
* Function: trav_table_init
*
- * Purpose: Initialize the table
- *
- * Return: void
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: November 4, 2002
+ * Purpose: Initialize the table
*
+ * Return: void
*-------------------------------------------------------------------------
*/
-
void trav_table_init(trav_table_t **tbl)
{
trav_table_t* table = (trav_table_t*) HDmalloc(sizeof(trav_table_t));
-
- table->size = 0;
- table->nobjs = 0;
- table->objs = NULL;
-
+ if(table) {
+ table->size = 0;
+ table->nobjs = 0;
+ table->objs = NULL;
+ }
*tbl = table;
}
-
/*-------------------------------------------------------------------------
* Function: trav_table_free
*
- * Purpose: free table memory
- *
- * Return: void
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: November 4, 2002
+ * Purpose: free table memory
*
+ * Return: void
*-------------------------------------------------------------------------
*/
-
-void trav_table_free( trav_table_t *table )
+void trav_table_free(trav_table_t *table)
{
- if(table->objs) {
- unsigned int i;
+ if(table) {
+ if(table->objs) {
+ unsigned int i;
- for(i = 0; i < table->nobjs; i++) {
- HDfree(table->objs[i].name );
- if(table->objs[i].nlinks) {
- unsigned int j;
+ for(i = 0; i < table->nobjs; i++) {
+ HDfree(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);
+ for(j = 0; j < table->objs[i].nlinks; j++)
+ HDfree(table->objs[i].links[j].new_name);
- HDfree(table->objs[i].links);
- } /* end if */
- } /* end for */
- HDfree(table->objs);
- } /* end if */
- HDfree(table);
+ HDfree(table->objs[i].links);
+ } /* end if */
+ } /* end for */
+ HDfree(table->objs);
+ } /* end if */
+ HDfree(table);
+ }
}
static herr_t
trav_attr(hid_t
#ifndef H5TRAV_PRINT_SPACE
-H5_ATTR_UNUSED
+ H5_ATTR_UNUSED
#endif /* H5TRAV_PRINT_SPACE */
-obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_data)
+ obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_data)
{
trav_path_op_data_t *op_data = (trav_path_op_data_t *)_op_data;
const char *buf = op_data->path;
@@ -938,7 +854,7 @@ obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_da
case H5S_SIMPLE:
/* simple dataspace */
printf(" {");
- for (i=0; i<ndims; i++) {
+ for (i = 0; i < ndims; i++) {
printf("%s" HSIZE_T_FORMAT, i?", ":"", size[i]);
}
printf("}\n");
@@ -968,19 +884,15 @@ obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_da
/*-------------------------------------------------------------------------
* Function: trav_print_visit_obj
*
- * Purpose: Callback for visiting object, when printing info
- *
- * Return: 0 on success, -1 on failure
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 6, 2007
+ * Purpose: Callback for visiting object, when printing info
*
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
static int
trav_print_visit_obj(const char *path, const H5O_info_t *oinfo,
- const char *already_visited, void *udata)
+ const char *already_visited, void *udata)
{
trav_print_udata_t *print_udata = (trav_print_udata_t *)udata;
/* Print the name of the object */
@@ -1029,14 +941,10 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo,
/*-------------------------------------------------------------------------
* Function: trav_print_visit_lnk
*
- * Purpose: Callback for visiting link, when printing info
- *
- * Return: 0 on success, -1 on failure
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 6, 2007
+ * Purpose: Callback for visiting link, when printing info
*
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
static int
@@ -1062,7 +970,7 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
case H5L_TYPE_EXTERNAL:
if(linfo->u.val_size > 0) {
- char *targbuf;
+ char *targbuf = NULL;
const char *filename = NULL;
const char *objname = NULL;
@@ -1097,22 +1005,18 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
/*-------------------------------------------------------------------------
* Function: h5trav_print
*
- * Purpose: Print information about the objects & links in the file
- *
- * Return: 0, -1 on error
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: September 6, 2007
+ * Purpose: Print information about the objects & links in the file
*
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
-
int
h5trav_print(hid_t fid)
{
trav_print_udata_t print_udata; /* User data for traversal */
trav_visitor_t print_visitor; /* Visitor structure for printing objects */
+ int ret_value = SUCCEED;
/* Init user data for printing */
print_udata.fid = fid;
@@ -1124,9 +1028,10 @@ h5trav_print(hid_t fid)
/* Traverse all objects in the file, visiting each object & link */
if(traverse(fid, "/", TRUE, TRUE, &print_visitor) < 0)
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed");
- return 0;
+done:
+ return ret_value;
}
@@ -1135,21 +1040,17 @@ h5trav_print(hid_t fid)
*
* Purpose: Generic traversal routine for visiting objects and links
*
- * Return: 0, -1 on error
- *
- * Programmer: Quincey Koziol, koziol@hdfgroup.org
- *
- * Date: November 6, 2007
- *
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
-
int
h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start,
hbool_t recurse, h5trav_obj_func_t visit_obj, h5trav_lnk_func_t visit_lnk,
void *udata)
{
trav_visitor_t visitor; /* Visitor structure for objects */
+ int ret_value = SUCCEED;
/* Init visitor structure */
visitor.visit_obj = visit_obj;
@@ -1158,9 +1059,10 @@ h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start,
/* Traverse all objects in the file, visiting each object & link */
if(traverse(fid, grp_name, visit_start, recurse, &visitor) < 0)
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed");
- return 0;
+done:
+ return ret_value;
}
/*-------------------------------------------------------------------------
@@ -1168,19 +1070,15 @@ h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start,
*
* Purpose: Add an symbolic link to visited data structure
*
- * Return: 0 on success, -1 on failure
- *
- * Programmer: Neil Fortner, nfortne2@hdfgroup.org
- * Adapted from trav_addr_add in h5trav.c by Quincey Koziol
- *
- * Date: September 5, 2008
- *
+ * Return: 0 on success,
+ * -1 on failure
*-------------------------------------------------------------------------
*/
herr_t
symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path)
{
- size_t idx; /* Index of address to use */
+ herr_t ret_value = SUCCEED;
+ size_t idx; /* Index of address to use */
/* Allocate space if necessary */
if(visited->nused == visited->nalloc) {
@@ -1188,7 +1086,7 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co
visited->nalloc = MAX(1, visited->nalloc * 2);
if(NULL == (tmp_ptr = HDrealloc(visited->objs, visited->nalloc * sizeof(symlink_trav_path_t))))
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "visited data structure realloc failed");
visited->objs = (symlink_trav_path_t *)tmp_ptr;
} /* end if */
@@ -1202,7 +1100,7 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co
if(type == H5L_TYPE_EXTERNAL) {
if(NULL == (visited->objs[idx].file = HDstrdup(file))) {
visited->nused--;
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "visited data structure name allocation failed");
} /* end if */
} /* end if */
@@ -1210,25 +1108,20 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co
visited->nused--;
if(visited->objs[idx].file)
HDfree (visited->objs[idx].file);
- return -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "visited data structure path allocation failed");
} /* end if */
- return 0;
+done:
+ return ret_value;
} /* end symlink_visit_add() */
/*-------------------------------------------------------------------------
* Function: symlink_is_visited
*
- * Purpose: Check if an symbolic link has already been visited
- *
- * Return: TRUE/FALSE
- *
- * Programmer: Neil Fortner, nfortne2@hdfgroup.org
- * Adapted from trav_addr_visited in h5trav.c by Quincey Koziol
- *
- * Date: September 5, 2008
+ * Purpose: Check if an symbolic link has already been visited
*
+ * Return: TRUE/FALSE
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE hbool_t
diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h
index 996a611..2189e31 100644
--- a/tools/lib/ph5diff.h
+++ b/tools/lib/ph5diff.h
@@ -32,7 +32,7 @@ struct diff_mpi_args
{
char name1[256];
char name2[256];
- diff_opt_t options;
+ diff_opt_t opts;
diff_args_t argdata; /* rest args */
};
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index e4696c0..ce5df78 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -52,7 +52,7 @@ static struct long_options l_opts[] = {
*
*-------------------------------------------------------------------------
*/
-static void check_options(diff_opt_t* options)
+static void check_options(diff_opt_t* opts)
{
/*--------------------------------------------------------------
* check for mutually exclusive options
@@ -61,7 +61,7 @@ static void check_options(diff_opt_t* options)
/* check between -d , -p, --use-system-epsilon.
* These options are mutually exclusive.
*/
- if ((options->d + options->p + options->use_system_epsilon) > 1) {
+ if ((opts->d + opts->p + opts->use_system_epsilon) > 1) {
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);
@@ -84,27 +84,27 @@ void parse_command_line(int argc,
const char** fname2,
const char** objname1,
const char** objname2,
- diff_opt_t* options)
+ diff_opt_t* opts)
{
int i;
int opt;
struct exclude_path_list *exclude_head, *exclude_prev, *exclude_node;
/* process the command-line */
- memset(options, 0, sizeof (diff_opt_t));
+ memset(opts, 0, sizeof (diff_opt_t));
/* assume equal contents initially */
- options->contents = 1;
+ opts->contents = 1;
/* NaNs are handled by default */
- options->do_nans = 1;
+ opts->do_nans = 1;
/* not Listing objects that are not comparable */
- options->m_list_not_cmp = 0;
+ opts->m_list_not_cmp = 0;
/* initially no not-comparable. */
/**this is bad in mixing option with results**/
- options->not_cmp=0;
+ opts->not_cmp=0;
/* init for exclude-path option */
exclude_head = NULL;
@@ -115,17 +115,20 @@ void parse_command_line(int argc,
default:
usage();
h5diff_exit(EXIT_FAILURE);
+ break;
case 'h':
usage();
h5diff_exit(EXIT_SUCCESS);
+ break;
case 'V':
print_version(h5tools_getprogname());
h5diff_exit(EXIT_SUCCESS);
+ break;
case 'v':
- options->m_verbose = 1;
+ opts->m_verbose = 1;
/* This for loop is for handling style like
* -v, -v1, --verbose, --verbose=1.
*/
@@ -135,11 +138,11 @@ void parse_command_line(int argc,
*/
if (!strcmp (argv[i], "-v")) { /* no arg */
opt_ind--;
- options->m_verbose_level = 0;
+ opts->m_verbose_level = 0;
break;
}
else if (!strncmp (argv[i], "-v", (size_t)2)) {
- options->m_verbose_level = atoi(&argv[i][2]);
+ opts->m_verbose_level = atoi(&argv[i][2]);
break;
}
@@ -147,11 +150,11 @@ void parse_command_line(int argc,
* long opt
*/
if (!strcmp (argv[i], "--verbose")) { /* no arg */
- options->m_verbose_level = 0;
+ opts->m_verbose_level = 0;
break;
}
else if ( !strncmp (argv[i], "--verbose", (size_t)9) && argv[i][9]=='=') {
- options->m_verbose_level = atoi(&argv[i][10]);
+ opts->m_verbose_level = atoi(&argv[i][10]);
break;
}
}
@@ -159,19 +162,19 @@ void parse_command_line(int argc,
case 'q':
/* use quiet mode; supress the message "0 differences found" */
- options->m_quiet = 1;
+ opts->m_quiet = 1;
break;
case 'r':
- options->m_report = 1;
+ opts->m_report = 1;
break;
case 'l':
- options->follow_links = TRUE;
+ opts->follow_links = TRUE;
break;
case 'x':
- options->no_dangle_links = 1;
+ opts->no_dangle_links = 1;
break;
case 'S':
@@ -179,7 +182,7 @@ void parse_command_line(int argc,
break;
case 'E':
- options->exclude_path = 1;
+ opts->exclude_path = 1;
/* create linked list of excluding objects */
if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) {
@@ -206,64 +209,64 @@ void parse_command_line(int argc,
break;
case 'd':
- options->d=1;
+ opts->d=1;
if (check_d_input(opt_arg) == - 1) {
printf("<-d %s> is not a valid option\n", opt_arg);
usage();
h5diff_exit(EXIT_FAILURE);
}
- options->delta = atof(opt_arg);
+ opts->delta = atof(opt_arg);
/* -d 0 is the same as default */
- if (H5_DBL_ABS_EQUAL(options->delta, (double)0.0F))
- options->d=0;
+ if (H5_DBL_ABS_EQUAL(opts->delta, (double)0.0F))
+ opts->d=0;
break;
case 'p':
- options->p=1;
+ opts->p=1;
if (check_p_input(opt_arg) == -1) {
printf("<-p %s> is not a valid option\n", opt_arg);
usage();
h5diff_exit(EXIT_FAILURE);
}
- options->percent = atof(opt_arg);
+ opts->percent = atof(opt_arg);
/* -p 0 is the same as default */
- if (H5_DBL_ABS_EQUAL(options->percent, (double)0.0F))
- options->p = 0;
+ if (H5_DBL_ABS_EQUAL(opts->percent, (double)0.0F))
+ opts->p = 0;
break;
case 'n':
- options->n=1;
+ opts->n=1;
if ( check_n_input(opt_arg) == -1) {
printf("<-n %s> is not a valid option\n", opt_arg);
usage();
h5diff_exit(EXIT_FAILURE);
}
- options->count = HDstrtoull(opt_arg, NULL, 0);
+ opts->count = HDstrtoull(opt_arg, NULL, 0);
break;
case 'N':
- options->do_nans = 0;
+ opts->do_nans = 0;
break;
case 'c':
- options->m_list_not_cmp = 1;
+ opts->m_list_not_cmp = 1;
break;
case 'e':
- options->use_system_epsilon = 1;
+ opts->use_system_epsilon = 1;
break;
}
}
/* check options */
- check_options(options);
+ check_options(opts);
/* if exclude-path option is used, keep the exclude path list */
- if (options->exclude_path)
- options->exclude = exclude_head;
+ if (opts->exclude_path)
+ opts->exclude = exclude_head;
/* check for file names to be processed */
if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) {
@@ -300,23 +303,23 @@ void parse_command_line(int argc,
*-------------------------------------------------------------------------
*/
- void print_info(diff_opt_t* options)
+ void print_info(diff_opt_t* opts)
{
- if (options->m_quiet || options->err_stat)
+ if (opts->m_quiet || opts->err_stat)
return;
- if (options->cmn_objs == 0) {
+ if (opts->cmn_objs == 0) {
printf("No common objects found. Files are not comparable.\n");
- if (!options->m_verbose)
+ if (!opts->m_verbose)
printf("Use -v for a list of objects.\n");
}
- if (options->not_cmp == 1) {
- if (options->m_list_not_cmp == 0) {
+ if (opts->not_cmp == 1) {
+ if (opts->m_list_not_cmp == 0) {
printf("--------------------------------\n");
printf("Some objects are not comparable\n");
printf("--------------------------------\n");
- if (options->m_verbose)
+ if (opts->m_verbose)
printf("Use -c for a list of objects without details of differences.\n");
else
printf("Use -c for a list of objects.\n");
diff --git a/tools/src/h5diff/h5diff_common.h b/tools/src/h5diff/h5diff_common.h
index e5dfe3f..dc0676c 100644
--- a/tools/src/h5diff/h5diff_common.h
+++ b/tools/src/h5diff/h5diff_common.h
@@ -23,9 +23,9 @@ extern "C" {
#endif
void usage(void);
-void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options);
+void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* opts);
void h5diff_exit(int status);
-void print_info(diff_opt_t* options);
+void print_info(diff_opt_t* opts);
#ifdef __cplusplus
}
diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c
index 8dab3b4..ad488a4 100644
--- a/tools/src/h5diff/h5diff_main.c
+++ b/tools/src/h5diff/h5diff_main.c
@@ -78,7 +78,7 @@ int main(int argc, const char *argv[])
const char *objname1 = NULL;
const char *objname2 = NULL;
hsize_t nfound=0;
- diff_opt_t options;
+ diff_opt_t opts;
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
@@ -98,7 +98,7 @@ int main(int argc, const char *argv[])
* process the command-line
*-------------------------------------------------------------------------
*/
- parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
+ parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts);
if (enable_error_stack) {
H5Eset_auto2(H5E_DEFAULT, func, edata);
@@ -110,9 +110,9 @@ int main(int argc, const char *argv[])
*-------------------------------------------------------------------------
*/
- nfound = h5diff(fname1, fname2, objname1, objname2, &options);
+ nfound = h5diff(fname1, fname2, objname1, objname2, &opts);
- print_info(&options);
+ print_info(&opts);
/*-------------------------------------------------------------------------
* exit code
@@ -123,11 +123,11 @@ int main(int argc, const char *argv[])
ret = (nfound == 0 ? 0 : 1);
/* if graph difference return 1 for differences */
- if (options.contents == 0)
+ if (opts.contents == 0)
ret = 1;
/* and return 2 for error */
- if (options.err_stat)
+ if (opts.err_stat)
ret = 2;
h5diff_exit(ret);
diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c
index 89efc39..83240cb 100644
--- a/tools/src/h5diff/ph5diff_main.c
+++ b/tools/src/h5diff/ph5diff_main.c
@@ -50,7 +50,7 @@ int main(int argc, const char *argv[])
const char *fname2 = NULL;
const char *objname1 = NULL;
const char *objname2 = NULL;
- diff_opt_t options;
+ diff_opt_t opts;
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
@@ -72,11 +72,11 @@ int main(int argc, const char *argv[])
g_Parallel = 0;
- parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
+ parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts);
- h5diff(fname1, fname2, objname1, objname2, &options);
+ h5diff(fname1, fname2, objname1, objname2, &opts);
- print_info(&options);
+ print_info(&opts);
}
/* Parallel h5diff */
else {
@@ -84,13 +84,13 @@ int main(int argc, const char *argv[])
/* Have the manager process the command-line */
if(nID == 0)
{
- parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
+ parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts);
- h5diff(fname1, fname2, objname1, objname2, &options);
+ h5diff(fname1, fname2, objname1, objname2, &opts);
MPI_Barrier(MPI_COMM_WORLD);
- print_info(&options);
+ print_info(&opts);
print_manager_output();
}
/* All other tasks become workers and wait for assignments. */
@@ -178,8 +178,8 @@ ph5diff_worker(int nID)
MPI_Recv(&args, sizeof(args), MPI_BYTE, 0, MPI_TAG_ARGS, MPI_COMM_WORLD, &Status);
/* Do the diff */
- diffs.nfound = diff(file1_id, args.name1, file2_id, args.name2, &(args.options), &(args.argdata));
- diffs.not_cmp = args.options.not_cmp;
+ diffs.nfound = diff(file1_id, args.name1, file2_id, args.name2, &(args.opts), &(args.argdata));
+ diffs.not_cmp = args.opts.not_cmp;
/* If print buffer has something in it, request print token.*/
if(outBuffOffset>0)
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index 8c15686..cc5fcdc 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -179,9 +179,11 @@ parse_command_line (int argc, const char *argv[])
case 'h':
usage (h5tools_getprogname());
leave (EXIT_SUCCESS);
+ break;
case 'V':
print_version (h5tools_getprogname());
leave (EXIT_SUCCESS);
+ break;
case '?':
default:
usage (h5tools_getprogname());
@@ -198,10 +200,6 @@ parse_command_line (int argc, const char *argv[])
* Return: Success: 0
* Failure: 1
*
- * Programmer:
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index d397067..a07d308 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -2709,6 +2709,7 @@ main(int argc, const char *argv[])
case 'h': /* --help */
usage();
leave(EXIT_SUCCESS);
+ break;
case 'a': /* --address */
address_g = TRUE;
@@ -2759,6 +2760,7 @@ main(int argc, const char *argv[])
case 'V': /* --version */
print_version(h5tools_getprogname());
leave(EXIT_SUCCESS);
+ break;
case 'x': /* --hexdump */
hexdump_g = TRUE;
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c
index 6b8cf8a..e7f4aae 100644
--- a/tools/src/h5repack/h5repack.c
+++ b/tools/src/h5repack/h5repack.c
@@ -75,6 +75,8 @@ h5repack_init(pack_opt_t *options, int verbose, hbool_t latest)
options->verbose = verbose;
options->latest = latest;
options->layout_g = H5D_LAYOUT_ERROR;
+ options->low_bound = H5F_LIBVER_EARLIEST;
+ options->high_bound = H5F_LIBVER_LATEST;
for (n = 0; n < H5_REPACK_MAX_NFILTERS; n++) {
options->filter_g[n].filtn = -1;
@@ -221,13 +223,12 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
hid_t ret_value = -1; /* The identifier of the named dtype in the out file */
if (H5Oget_info(type_in, &oinfo) < 0)
- goto done;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info failed");
if (*named_dt_head_p) {
/* Stack already exists, search for the datatype */
while (dt && dt->addr_in != oinfo.addr)
dt = dt->next;
-
dt_ret = dt;
}
else {
@@ -238,7 +239,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) {
/* Push onto the stack */
if (NULL == (dt = (named_dt_t *)HDmalloc(sizeof(named_dt_t))))
- goto done;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed failed");
dt->next = *named_dt_head_p;
*named_dt_head_p = dt;
@@ -259,7 +260,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
if (!dt_ret) {
/* Push the new datatype onto the stack */
if (NULL == (dt_ret = (named_dt_t *)HDmalloc(sizeof(named_dt_t))))
- goto done;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed failed");
dt_ret->next = *named_dt_head_p;
*named_dt_head_p = dt_ret;
@@ -276,9 +277,9 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
else
dt_ret->id_out = H5Tcopy(type_in);
if (dt_ret->id_out < 0)
- goto done;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type-H5Tcopy failed");
if (H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0)
- goto done;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tcommit_anon failed");
} /* end if */
/* Set return value */
@@ -286,7 +287,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
/* Increment the ref count on id_out, because the calling function will try to close it */
if(H5Iinc_ref(ret_value) < 0)
- ret_value = -1;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Iinc_ref failed");
done:
return ret_value;
@@ -305,7 +306,7 @@ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) {
while (dt) {
/* Pop the datatype off the stack and free it */
if (H5Tclose(dt->id_out) < 0 && !ignore_err)
- goto done;
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
dt = dt->next;
HDfree(*named_dt_head_p);
*named_dt_head_p = dt;
@@ -332,7 +333,7 @@ int
copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
trav_table_t *travt, pack_opt_t *options)
{
- int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
+ int ret_value = 0;
hid_t attr_id = -1; /* attr ID */
hid_t attr_out = -1; /* attr ID */
hid_t space_id = -1; /* space ID */
@@ -375,7 +376,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
if ((is_named = H5Tcommitted(ftype_id)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tcommitted failed");
if (is_named && travt) {
- hid_t fidout;
+ hid_t fidout = -1;
/* Create out file id */
if ((fidout = H5Iget_file_id(loc_out)) < 0)
@@ -426,7 +427,8 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
base_type = H5Tget_super(ftype_id);
is_ref = (is_ref || (H5Tget_class(base_type) == H5T_REFERENCE));
- H5Tclose(base_type);
+ if (H5Tclose(base_type) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed");
}
if (type_class == H5T_COMPOUND) {
@@ -435,7 +437,8 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
for (j = 0; j < nmembers; j++) {
hid_t mtid = H5Tget_member_type(wtype_id, (unsigned)j);
H5T_class_t mtclass = H5Tget_class(mtid);
- H5Tclose(mtid);
+ if (H5Tclose(mtid) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtid failed");
if (mtclass == H5T_REFERENCE) {
is_ref = 1;
@@ -481,7 +484,24 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
if (options->verbose)
printf(FORMAT_OBJ_ATTR, "attr", name);
- } /* u */
+
+ /*-------------------------------------------------------------------------
+ * close
+ *-------------------------------------------------------------------------
+ */
+ if (H5Sclose(space_id) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
+ space_id = -1;
+ if (H5Tclose(wtype_id) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
+ wtype_id = -1;
+ if (H5Tclose(ftype_id) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
+ ftype_id = -1;
+ if (H5Aclose(attr_id) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed");
+ attr_id = -1;
+ } /* for u */
done:
H5E_BEGIN_TRY {
@@ -495,11 +515,11 @@ done:
HDfree(buf);
} /* end if */
- H5Tclose(ftype_id);
- H5Tclose(wtype_id);
+ H5Aclose(attr_out);
H5Sclose(space_id);
+ H5Tclose(wtype_id);
+ H5Tclose(ftype_id);
H5Aclose(attr_id);
- H5Aclose(attr_out);
} H5E_END_TRY;
return ret_value;
@@ -689,9 +709,9 @@ done:
*/
static int check_objects(const char* fname, pack_opt_t *options) {
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
- hid_t fid;
- hid_t did;
- hid_t sid;
+ hid_t fid = -1;
+ hid_t did = -1;
+ hid_t sid = -1;
unsigned int i;
unsigned int uf;
trav_table_t *travt = NULL;
@@ -792,9 +812,9 @@ static int check_objects(const char* fname, pack_opt_t *options) {
done:
H5E_BEGIN_TRY {
- H5Fclose(fid);
H5Sclose(sid);
H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
if (travt)
trav_table_free(travt);
diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h
index 0252768..a0e0387 100644
--- a/tools/src/h5repack/h5repack.h
+++ b/tools/src/h5repack/h5repack.h
@@ -101,21 +101,23 @@ typedef struct {
/* all the above, ready to go to the hrepack call */
typedef struct {
- pack_opttbl_t *op_tbl; /*table with all -c and -f options */
- int all_layout; /*apply the layout to all objects */
- int all_filter; /*apply the filter to all objects */
+ pack_opttbl_t *op_tbl; /*table with all -c and -f options */
+ int all_layout; /*apply the layout to all objects */
+ int all_filter; /*apply the filter to all objects */
filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */
- int n_filter_g; /*number of global filters */
- chunk_info_t chunk_g; /*global chunk INFO for the ALL case */
- H5D_layout_t layout_g; /*global layout information for the ALL case */
- int verbose; /*verbose mode */
- hsize_t min_comp; /*minimum size to compress, in bytes */
- int use_native; /*use a native type in write */
- hbool_t latest; /*pack file with the latest file format */
- int grp_compact; /* Set the maximum number of links to store as header messages in the group */
- int grp_indexed; /* Set the minimum number of links to store in the indexed format */
- int msg_size[8]; /* Minimum size of shared messages: dataspace,
- datatype, fill value, filter pipleline, attribute */
+ int n_filter_g; /*number of global filters */
+ chunk_info_t chunk_g; /*global chunk INFO for the ALL case */
+ H5D_layout_t layout_g; /*global layout information for the ALL case */
+ int verbose; /*verbose mode */
+ hsize_t min_comp; /*minimum size to compress, in bytes */
+ int use_native; /*use a native type in write */
+ hbool_t latest; /*pack file with the latest file format */
+ H5F_libver_t low_bound; /* The file's low bound as in H5Fset_libver_bounds() */
+ H5F_libver_t high_bound; /* The file's high bound as in H5Fset_libver_bounds() */
+ int grp_compact; /* Set the maximum number of links to store as header messages in the group */
+ int grp_indexed; /* Set the minimum number of links to store in the indexed format */
+ int msg_size[8]; /* Minimum size of shared messages: dataspace,
+ datatype, fill value, filter pipleline, attribute */
const char *ublock_filename; /* user block file name */
hsize_t ublock_size; /* user block size */
hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index 9fcf218..b279cf9 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -78,23 +78,21 @@ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t
*
* Return: 0, ok,
* -1 no
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: October, 23, 2003
- *
*-------------------------------------------------------------------------
*/
int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
{
- int ret_value = 0; /* no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
- hid_t fidin;
+ int ret_value = 0;
+ hid_t fidin = -1;
hid_t fidout = -1;
- trav_table_t *travt = NULL;
- hsize_t ub_size = 0; /* size of user block */
+ hid_t fcpl_in = -1; /* file creation property list ID for input file */
+ hid_t grp_in = -1; /* group ID */
+ hid_t gcpl_in = -1; /* group creation property list */
hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */
hid_t fapl = H5P_DEFAULT; /* file access property list ID */
+ trav_table_t *travt = NULL;
+ hsize_t ub_size = 0; /* size of user block */
H5F_fspace_strategy_t set_strategy; /* Strategy to be set in outupt file */
hbool_t set_persist; /* Persist free-space status to be set in output file */
hsize_t set_threshold; /* Free-space section threshold to be set in output file */
@@ -114,10 +112,6 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
/* get user block size and file space strategy/persist/threshold */
{
- hid_t fcpl_in; /* file creation property list ID for input file */
- hid_t grp_in = -1; /* group ID */
- hid_t gcpl_in = -1; /* group creation property list */
-
if ((fcpl_in = H5Fget_create_plist(fidin)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list");
@@ -148,8 +142,18 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed to close property list");
}
+ if(options->latest)
+ options->low_bound = options->high_bound = H5F_LIBVER_LATEST;
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list");
+
+ /* It can be default, latest or other settings by users */
+ if(H5Pset_libver_bounds(fapl, options->low_bound, options->high_bound) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_libver_bounds failed to set format version bounds");
+
/* Check if we need to create a non-default file creation property list */
- if (options->latest || ub_size > 0) {
+ if (options->low_bound >= H5F_LIBVER_V18 || ub_size > 0) {
/* Create file creation property list */
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list");
@@ -158,7 +162,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
if (H5Pset_userblock(fcpl, ub_size) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_userblock failed to set non-default userblock size");
- if (options->latest) {
+ if (options->low_bound >= H5F_LIBVER_V18) {
unsigned i = 0, nindex = 0, mesg_type_flags[5], min_mesg_sizes[5];
/* Adjust group creation parameters for root group */
@@ -209,12 +213,6 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shared_mesg_index failed to configure the specified shared object header message index");
} /* if (nindex>0) */
- /* Create file access property list */
- if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list");
-
- if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_libver_bounds failed to set property for using latest version of the format");
} /* end if */
} /* end if */
#if defined (H5REPACK_DEBUG_USER_BLOCK)
@@ -343,42 +341,26 @@ print_user_block(fnamein, fidin);
/* init table */
trav_table_init(&travt);
- /* get the list of objects in the file */
- if (h5trav_gettable(fidin, travt) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed");
-
- /*-------------------------------------------------------------------------
- * do the copy
- *-------------------------------------------------------------------------
- */
- if (do_copy_objects(fidin, fidout, travt, options) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_objects from <%s> could not copy data to <%s>", fnamein, fnameout);
-
- /*-------------------------------------------------------------------------
- * do the copy of referenced objects
- * and create hard links
- *-------------------------------------------------------------------------
- */
- if (do_copy_refobjs(fidin, fidout, travt, options) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_refobjs from <%s> could not copy data to <%s>", fnamein, fnameout);
-
- /*-------------------------------------------------------------------------
- * close
- *-------------------------------------------------------------------------
- */
-
- if (fapl > 0)
- H5Pclose(fapl);
-
- if (fcpl > 0)
- H5Pclose(fcpl);
-
- H5Fclose(fidin);
- H5Fclose(fidout);
-
- /* free table */
- trav_table_free(travt);
- travt = NULL;
+ if (travt) {
+ /* get the list of objects in the file */
+ if (h5trav_gettable(fidin, travt) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed");
+
+ /*-------------------------------------------------------------------------
+ * do the copy
+ *-------------------------------------------------------------------------
+ */
+ if (do_copy_objects(fidin, fidout, travt, options) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_objects from <%s> could not copy data to <%s>", fnamein, fnameout);
+
+ /*-------------------------------------------------------------------------
+ * do the copy of referenced objects
+ * and create hard links
+ *-------------------------------------------------------------------------
+ */
+ if (do_copy_refobjs(fidin, fidout, travt, options) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_refobjs from <%s> could not copy data to <%s>", fnamein, fnameout);
+ }
/*-------------------------------------------------------------------------
* write only the input file user block if there is no user block file input
@@ -389,17 +371,15 @@ print_user_block(fnamein, fidin);
if (copy_user_block(fnamein, fnameout, ub_size) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting...");
- return 0;
-
- /*-------------------------------------------------------------------------
- * out
- *-------------------------------------------------------------------------
- */
-
done:
H5E_BEGIN_TRY {
+ H5Pclose(fcpl_in);
+ H5Pclose(gcpl_in);
H5Pclose(fapl);
H5Pclose(fcpl);
+ H5Gclose(grp_in);
+ H5Fclose(fidin);
+ H5Fclose(fidout);
H5Fclose(fidin);
H5Fclose(fidout);
} H5E_END_TRY;
@@ -416,7 +396,7 @@ done:
* The size of hyperslab is limitted by H5TOOLS_BUFSIZE.
* Return the hyperslab dimentions and size in byte.
*
- * Return: 0 - SUCCEED, -1 FAILED
+ * Return: 0 - SUCCEED, -1 FAILED
*
* Parameters:
* dcpl_id : [IN] dataset creation property.
@@ -426,8 +406,6 @@ done:
* dims_hslab[] : [OUT] calculated hyperslab dimentions
* * hslab_nbytes_p : [OUT] total byte of the hyperslab
*
- * Programmer: Jonathan Kim
- * Date: Feburary, 2012
* Update:
* The hyperslab calucation would be depend on if the dataset is chunked
* or not.
@@ -441,25 +419,23 @@ done:
* the boundary would be dataset's dims.
*
* The calulation starts from the last dimention (h5dump dims output).
- *
- * Note:
- * Added for JIRA HDFFV-7862.
*-----------------------------------------*/
-int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
+int
+Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p)
{
- int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
+ int ret_value = 0;
int k;
H5D_layout_t dset_layout;
int rank_chunk;
hsize_t dims_chunk[H5S_MAX_RANK];
hsize_t size_chunk = 1;
- hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
- hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
+ hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
+ hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
hsize_t chunk_dims_map[H5S_MAX_RANK]; /* mapped chunk dimentions */
- hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimentions */
- hsize_t hslab_nbytes; /* size of hyperslab in byte */
+ hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimentions */
+ hsize_t hslab_nbytes; /* size of hyperslab in byte */
/* init to set as size of a data element */
hslab_nbytes = size_datum;
@@ -572,24 +548,9 @@ done:
/*-------------------------------------------------------------------------
* Function: do_copy_objects
*
- * Purpose: duplicate all HDF5 objects in the file
- *
- * Return: 0, ok, -1 no
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: October, 23, 2003
- *
- * Modifications:
- *
- * July 2004: Introduced the extra EC or NN option for SZIP
- *
- * December 2004: Added a check for H5Dcreate; if the dataset cannot be created
- * with the requested filter, use the input one
- *
- * October 2006: Read/write using the file type by default.
+ * Purpose: duplicate all HDF5 objects in the file
*
- * October 2006: Read by hyperslabs for big datasets.
+ * Return: 0, ok, -1 no
*
* A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done
* i.e., if the memory needed to read a dataset is greater than this limit,
@@ -630,31 +591,6 @@ done:
* in (2) is that, when using the strip mine size, it assures that the "remaining" part
* of the dataset that does not fill an entire strip mine is processed.
*
- * November 2006: Use H5Ocopy in the copy of objects. The logic for using
- * H5Ocopy or not is if a change of filters or layout is requested by the user
- * then use read/write else use H5Ocopy.
- *
- * May, 1, 2008: Add a printing of the compression ratio of old size / new size
- *
- * Feburary 2012: improve Read/Write by hyperslabs for big datasets.
- * Programmer: Jonathan Kim
- *
- * A threshold of H5TOOLS_MALLOCSIZE is the limit upon which I/O hyperslab is done
- * i.e., if the memory needed to read a dataset is greater than this limit,
- * then hyperslab I/O is done instead of one operation I/O
- * For each dataset, the memory needed is calculated according to
- *
- * memory needed = number of elements * size of each element
- *
- * if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations
- * are done
- *
- * H5Dread( input_dataset )
- * H5Dwrite( output_dataset )
- *
- * with all elements in the datasets selected. If the memory needed is greater than
- * H5TOOLS_MALLOCSIZE, then the following operations are done instead:
- *
* 1. figure out a hyperslab (dimentions) and size (refer to Get_hyperslab()).
* 2. Calculate the hyperslab selections as the selection is moving forward.
* Selection would be same as the hyperslab except for the remaining edge portion
@@ -666,7 +602,7 @@ done:
int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
pack_opt_t *options) /* repack options */
{
- int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
+ int ret_value = 0;
hid_t grp_in = -1; /* group ID */
hid_t grp_out = -1; /* group ID */
hid_t dset_in = -1; /* read dataset ID */
@@ -988,13 +924,18 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
if(H5Dread(dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
if(H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed");
/* Check if we have VL data in the dataset's
* datatype that must be reclaimed */
if (TRUE == H5Tdetect_class(wtype_id, H5T_VLEN))
if (H5Dvlen_reclaim(wtype_id, f_space_id, H5P_DEFAULT, buf) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dvlen_reclaim failed");
+ /* free */
+ if (buf != NULL) {
+ HDfree(buf);
+ buf = NULL;
+ }
}
else { /* possibly not enough memory, read/write by hyperslabs */
size_t p_type_nbytes = msize; /*size of memory type */
@@ -1074,7 +1015,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
if(H5Dread(dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
if(H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed");
/* reclaim any VL memory, if necessary */
if (vl_data)
@@ -1165,7 +1106,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
*-------------------------------------------------------------------------
*/
else {
- hid_t pid;
+ hid_t pid = -1;
/* create property to pass copy options */
if ((pid = H5Pcreate(H5P_OBJECT_COPY)) < 0)
@@ -1243,6 +1184,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
if (H5Tclose(type_out) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
+ type_out = -1; /* named datatypes stack, named_dt_head, manages allocation */
break;
@@ -1273,6 +1215,18 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
} /* end if */
done:
+
+ /* Finalize (link) the stack of named datatypes (if any) first
+ * because of reference counting */
+ if (0 == ret_value && named_dt_head != NULL) {
+ if (named_datatype_free(&named_dt_head, 0) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "named_datatype_free failed");
+ }
+ else
+ H5E_BEGIN_TRY {
+ named_datatype_free(&named_dt_head, 1);
+ } H5E_END_TRY;
+
H5E_BEGIN_TRY
{
H5Gclose(grp_in);
@@ -1295,14 +1249,6 @@ done:
if (hslab_buf != NULL)
HDfree(hslab_buf);
- /* Finalize (link) the stack of named datatypes (if any) */
- if (0 == ret_value && named_dt_head != NULL)
- named_datatype_free(&named_dt_head, 0);
- else
- H5E_BEGIN_TRY {
- named_datatype_free(&named_dt_head, 1);
- } H5E_END_TRY;
-
return ret_value;
}
@@ -1310,10 +1256,10 @@ done:
* Function: print_dataset_info
*
* Purpose: print name, filters, percentage compression of a dataset
- *
*-------------------------------------------------------------------------
*/
-static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr)
+static void
+print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr)
{
char strfilter[255];
#if defined (PRINT_DEBUG )
@@ -1325,7 +1271,7 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int p
unsigned cd_values[20]; /* filter client data values */
size_t cd_nelmts; /* filter client number of values */
char f_objname[256]; /* filter objname */
- int i;
+ int i;
HDstrcpy(strfilter, "\0");
@@ -1417,19 +1363,15 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int p
/*-------------------------------------------------------------------------
* Function: copy_user_block
*
- * Purpose: copy user block from one file to another
- *
- * Return: 0, ok, -1 no
- *
- * Programmer: Peter Cao
- *
- * Date: October, 25, 2007
+ * Purpose: copy user block from one file to another
*
+ * Return: 0, ok, -1 no
*-------------------------------------------------------------------------
*/
-static int copy_user_block(const char *infile, const char *outfile, hsize_t size)
+static int
+copy_user_block(const char *infile, const char *outfile, hsize_t size)
{
- int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
+ int ret_value = 0;
int infid = -1, outfid = -1; /* File descriptors */
/* User block must be any power of 2 equal to 512 or greater (512, 1024, 2048, etc.) */
@@ -1491,66 +1433,62 @@ done:
/*-------------------------------------------------------------------------
* Function: print_user_block
*
- * Purpose: print user block
- *
- * Return: 0, ok, -1 no
- *
- * Programmer: Pedro Vicente
- *
- * Date: August, 20, 2008
+ * Purpose: print user block
*
+ * Return: 0, ok, -1 no
*-------------------------------------------------------------------------
*/
#if defined (H5REPACK_DEBUG_USER_BLOCK)
static
-void print_user_block(const char *filename, hid_t fid)
+void
+print_user_block(const char *filename, hid_t fid)
{
- int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
- int fh; /* file handle */
- hsize_t ub_size; /* user block size */
- hsize_t size; /* size read */
- hid_t fcpl; /* file creation property list ID for HDF5 file */
+ int ret_value = 0;
+ int fh = -1; /* file handle */
+ hsize_t ub_size; /* user block size */
+ hsize_t size; /* size read */
+ hid_t fcpl = -1; /* file creation property list ID for HDF5 file */
int i;
/* get user block size */
- if(( fcpl = H5Fget_create_plist(fid)) < 0) {
+ if ((fcpl = H5Fget_create_plist(fid)) < 0) {
HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list");
}
- if(H5Pget_userblock(fcpl, &ub_size) < 0) {
+ if (H5Pget_userblock(fcpl, &ub_size) < 0) {
HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pget_userblock failed to retrieve userblock size");
}
- if(H5Pclose(fcpl) < 0) {
+ if (H5Pclose(fcpl) < 0) {
HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pclose failed to close property list");
}
/* open file */
- if((fh = HDopen(filename, O_RDONLY)) < 0) {
+ if ((fh = HDopen(filename, O_RDONLY)) < 0) {
HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed to open file <%s>", filename);
}
size = ub_size;
/* read file */
- while(size > 0) {
+ while (size > 0) {
ssize_t nread; /* # of bytes read */
char rbuf[USERBLOCK_XFER_SIZE]; /* buffer for reading */
/* read buffer */
- if(size > USERBLOCK_XFER_SIZE)
+ if (size > USERBLOCK_XFER_SIZE)
nread = HDread(fh, rbuf, (size_t)USERBLOCK_XFER_SIZE);
else
nread = HDread(fh, rbuf, (size_t)size);
- for(i = 0; i < nread; i++) {
+ for (i = 0; i < nread; i++) {
printf("%c ", rbuf[i]);
}
printf("\n");
- if(nread < 0) {
+ if (nread < 0) {
HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "nread < 0");
}
@@ -1559,7 +1497,7 @@ void print_user_block(const char *filename, hid_t fid)
}
done:
- if(fh > 0)
+ if (fh > 0)
HDclose(fh);
return;
diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c
index e968b3c..067ebad 100644
--- a/tools/src/h5repack/h5repack_filters.c
+++ b/tools/src/h5repack/h5repack_filters.c
@@ -42,7 +42,7 @@ static int aux_copy_obj(hid_t dcpl_id, /* dataset creation property list */
H5D_layout_t layout;
int rank; /* rank of dataset */
hsize_t chsize[64]; /* chunk size in elements */
- unsigned int i, j;
+ unsigned int i;
/* get information about input filters */
if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0)
@@ -240,7 +240,7 @@ int apply_filters(const char* name, /* object name from traverse list */
int nfilters; /* number of filters in DCPL */
hsize_t chsize[64]; /* chunk size in elements */
H5D_layout_t layout;
- int i, j;
+ int i;
pack_info_t obj;
pack_info_t filtobj;
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index d34c394..037aa4a 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -31,7 +31,7 @@ const char *outfile = NULL;
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:S:P:T:G:q:z:E";
+static const char *s_opts = "hVvf:l:m:e:nLj:k:c:d:s:u:b:M:t:a:i:o:S:P:T:G:q:z:E";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "version", no_arg, 'V' },
@@ -42,6 +42,8 @@ static struct long_options l_opts[] = {
{ "file", require_arg, 'e' },
{ "native", no_arg, 'n' },
{ "latest", no_arg, 'L' },
+ { "low", require_arg, 'j' },
+ { "high", require_arg, 'k' },
{ "compact", require_arg, 'c' },
{ "indexed", require_arg, 'd' },
{ "ssize", require_arg, 's' },
@@ -82,6 +84,9 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n");
PRINTVALSTREAM(rawoutstream, " -n, --native Use a native HDF5 type when repacking\n");
PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n");
+ PRINTVALSTREAM(rawoutstream, " This option will take precedence over the -j and -k options\n");
+ PRINTVALSTREAM(rawoutstream, " -j, --low The low bound as in H5Pset_libver_bounds()\n");
+ PRINTVALSTREAM(rawoutstream, " -k, --high The high bound as in H5Pset_libver_bounds()\n");
PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n");
PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n");
PRINTVALSTREAM(rawoutstream, " -s S[:F], --ssize=S[:F] Shared object header message minimum size\n");
@@ -500,6 +505,22 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
options->latest = TRUE;
break;
+ case 'j':
+ options->low_bound = (H5F_libver_t)HDatoi(opt_arg);
+ if(options->low_bound < H5F_LIBVER_EARLIEST || options->low_bound > H5F_LIBVER_LATEST) {
+ error_msg("in parsing low bound\n");
+ goto done;
+ }
+ break;
+
+ case 'k':
+ options->high_bound = (H5F_libver_t)HDatoi(opt_arg);
+ if(options->high_bound < H5F_LIBVER_EARLIEST || options->high_bound > H5F_LIBVER_LATEST) {
+ error_msg("in parsing high bound\n");
+ goto done;
+ }
+ break;
+
case 'c':
options->grp_compact = HDatoi( opt_arg );
if (options->grp_compact > 0)
diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c
index 376ab92..7b610a3 100644
--- a/tools/src/h5repack/h5repack_refs.c
+++ b/tools/src/h5repack/h5repack_refs.c
@@ -145,7 +145,7 @@ int do_copy_refobjs(hid_t fidin,
*-------------------------------------------------------------------------
*/
if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) {
- hid_t refobj_id;
+ hid_t refobj_id = -1;
hobj_ref_t *refbuf = NULL; /* buffer for object references */
hobj_ref_t *buf = NULL;
const char* refname;
@@ -189,7 +189,8 @@ int do_copy_refobjs(hid_t fidin,
refname);
}
} /*refname*/
- H5Oclose(refobj_id);
+ if (H5Oclose(refobj_id) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Oclose refob failed");
} /* u */
} /*nelmts*/
@@ -220,7 +221,7 @@ int do_copy_refobjs(hid_t fidin,
*-------------------------------------------------------------------------
*/
else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) {
- hid_t refobj_id;
+ hid_t refobj_id = -1;
hdset_reg_ref_t *refbuf = NULL; /* input buffer for region references */
hdset_reg_ref_t *buf = NULL; /* output buffer */
const char* refname;
@@ -259,7 +260,7 @@ int do_copy_refobjs(hid_t fidin,
* in the second traversal of the file
*/
if((refname = MapIdToName(refobj_id, travt)) != NULL) {
- hid_t region_id; /* region id of the referenced dataset */
+ hid_t region_id = -1; /* region id of the referenced dataset */
if((region_id = H5Rget_region(dset_in, H5R_DATASET_REGION, &buf[u])) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rget_region failed");
@@ -276,7 +277,8 @@ int do_copy_refobjs(hid_t fidin,
refname);
}
} /*refname*/
- H5Oclose(refobj_id);
+ if (H5Oclose(refobj_id) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Oclose refobj_id failed");
} /* u */
} /*nelmts*/
@@ -377,7 +379,8 @@ int do_copy_refobjs(hid_t fidin,
* This function is paired with copy_named_datatype() which is called
* in copy_attr(), so need to free.
*/
- named_datatype_free(&named_dt_head, 0);
+ if (named_datatype_free(&named_dt_head, 0) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "named_datatype_free failed");
return ret_value;
@@ -392,7 +395,7 @@ done:
H5Tclose(ftype_id);
H5Tclose(mtype_id);
H5Tclose(type_in);
- named_datatype_free(&named_dt_head, 0);
+ named_datatype_free(&named_dt_head, 1);
} H5E_END_TRY;
return ret_value;
@@ -478,20 +481,20 @@ static int copy_refs_attr(hid_t loc_in,
is_ref = (type_class == H5T_REFERENCE);
if(type_class == H5T_VLEN ) {
- hid_t base_type;
+ hid_t base_type = H5Tget_super(ftype_id);
- base_type = H5Tget_super(ftype_id);
is_ref_vlen = (H5Tget_class(base_type) == H5T_REFERENCE);
msize = H5Tget_size(base_type);
- H5Tclose(base_type);
+ if (H5Tclose(base_type) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed");
}
else if(type_class == H5T_ARRAY ) {
- hid_t base_type;
+ hid_t base_type = H5Tget_super(ftype_id);
- base_type = H5Tget_super(ftype_id);
is_ref_array = (H5Tget_class(base_type) == H5T_REFERENCE);
msize = H5Tget_size(base_type);
- H5Tclose(base_type);
+ if (H5Tclose(base_type) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed");
}
else if(type_class == H5T_COMPOUND) {
int nmembers = H5Tget_nmembers(ftype_id) ;
@@ -511,7 +514,8 @@ static int copy_refs_attr(hid_t loc_in,
ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid);
ref_comp_field_n++;
}
- H5Tclose(mtid);
+ if (H5Tclose(mtid) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtid failed");
}
/* if compound don't contain reference type member, free the above
@@ -533,9 +537,12 @@ static int copy_refs_attr(hid_t loc_in,
is_ref_comp = (ref_comp_field_n > 0);
if (!(is_ref || is_ref_vlen || is_ref_array || is_ref_comp)) {
- H5Tclose(mtype_id);
- H5Tclose(ftype_id);
- H5Aclose(attr_id);
+ if (H5Tclose(mtype_id) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtype_id failed");
+ if (H5Tclose(ftype_id) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose ftype_id failed");
+ if (H5Aclose(attr_id) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Aclose attr_id failed");
continue;
}
@@ -564,11 +571,11 @@ static int copy_refs_attr(hid_t loc_in,
unsigned array_rank = 0;
hsize_t array_size = 1;
hsize_t array_dims[H5S_MAX_RANK];
- hid_t base_type;
+ hid_t base_type = H5Tget_super(ftype_id);
- base_type = H5Tget_super(ftype_id);
msize = H5Tget_size(base_type);
- H5Tclose(base_type);
+ if (H5Tclose(base_type) < 0)
+ H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed");
array_rank = (unsigned)H5Tget_array_ndims(mtype_id);
H5Tget_array_dims2(mtype_id, array_dims);
diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c
index 43d6bfe..b7ff73c 100644
--- a/tools/src/misc/h5mkgrp.c
+++ b/tools/src/misc/h5mkgrp.c
@@ -129,6 +129,7 @@ parse_command_line(int argc, const char *argv[], param_t *parms)
case 'h':
usage();
leave(EXIT_SUCCESS);
+ break;
/* Create objects with the latest version of the format */
case 'l':
@@ -149,6 +150,7 @@ parse_command_line(int argc, const char *argv[], param_t *parms)
case 'V':
print_version(h5tools_getprogname());
leave(EXIT_SUCCESS);
+ break;
/* Bad command line argument */
default:
diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt
index 4a519ab..c57cd5e 100644
--- a/tools/test/h5copy/CMakeLists.txt
+++ b/tools/test/h5copy/CMakeLists.txt
@@ -10,14 +10,44 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib)
# Add the h5copy test executables
# --------------------------------------------------------------------
- if (HDF5_BUILD_GENERATORS)
- add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c)
- TARGET_NAMING (h5copygentest STATIC)
- TARGET_C_PROPERTIES (h5copygentest STATIC " " " ")
- target_link_libraries (h5copygentest ${HDF5_LIB_TARGET})
- set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools)
+if (HDF5_BUILD_GENERATORS)
+ add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c)
+ TARGET_NAMING (h5copygentest STATIC)
+ TARGET_C_PROPERTIES (h5copygentest STATIC " " " ")
+ target_link_libraries (h5copygentest ${HDF5_LIB_TARGET})
+ set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>)
- endif ()
+ #add_test (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>)
+endif ()
- include (CMakeTests.cmake)
+#-----------------------------------------------------------------------------
+# If plugin library tests can be tested
+#-----------------------------------------------------------------------------
+if (BUILD_SHARED_LIBS)
+ set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibcopy")
+ set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
+ set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
+ add_definitions (${HDF_EXTRA_C_FLAGS})
+ INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
+
+ add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c)
+ TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ")
+ target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
+
+ # make plugins dir
+ file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
+ #-----------------------------------------------------------------------------
+ # Copy plugin library to a plugins folder
+ #-----------------------------------------------------------------------------
+ add_custom_command (
+ TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ )
+endif ()
+
+include (CMakeTests.cmake)
diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake
index b60c0e9..1bdefa6 100644
--- a/tools/test/h5copy/CMakeTests.cmake
+++ b/tools/test/h5copy/CMakeTests.cmake
@@ -24,10 +24,16 @@
${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5
${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5
${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5
+ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5
+ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter2.h5
)
set (LIST_OTHER_TEST_FILES
${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out
+ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5.txt
+ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5_ERR.txt
+ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_fail_ERR.out.h5.txt
+ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_test.out.h5.txt
)
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
@@ -74,9 +80,9 @@
if (NOT "${resultcode}" STREQUAL "2")
add_test (
NAME H5COPY_F-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
- SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname})
+ set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname})
if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
@@ -110,9 +116,9 @@
if (NOT "${resultcode}" STREQUAL "2")
add_test (
NAME H5COPY-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
- SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
+ set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
@@ -160,9 +166,9 @@
if (NOT "${resultcode}" STREQUAL "2")
add_test (
NAME H5COPY-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
- SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
+ set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
@@ -201,9 +207,9 @@
if (NOT "${resultcode}" STREQUAL "2")
add_test (
NAME H5COPY_SAME-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
- SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname})
+ set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname})
if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
@@ -250,6 +256,134 @@
endif ()
endmacro ()
+ macro (ADD_H5_UD_TEST testname resultcode infile sparam srcname dparam dstname cmpfile)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5COPY_UD-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ testfiles/${testname}.out.h5
+ testfiles/${infile}.out
+ testfiles/${infile}.out.err
+ testfiles/${testname}.out.h5.out
+ testfiles/${testname}.out.h5.out.err
+ )
+ if ("${resultcode}" STREQUAL "2")
+ add_test (
+ NAME H5COPY_UD-${testname}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
+ -D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=./testfiles/${infile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=./testfiles/${infile}.txt"
+ -D "TEST_APPEND=EXIT CODE:"
+ -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
+ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ else ()
+ add_test (
+ NAME H5COPY_UD-${testname}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
+ -D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=./testfiles/${infile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=./testfiles/${infile}.txt"
+ -D "TEST_APPEND=EXIT CODE:"
+ -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
+ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (H5COPY_UD-${testname} PROPERTIES DEPENDS H5COPY_UD-${testname}-clear-objects)
+ add_test (
+ NAME H5COPY_UD-${testname}-DIFF
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
+ -D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}.out.h5;${srcname};${dstname}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=./testfiles/${testname}.out.h5.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=./testfiles/${testname}.out.h5.txt"
+ -D "TEST_APPEND=EXIT CODE:"
+ -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
+ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5COPY_UD-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD-${testname})
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_UD_ERR_TEST testname resultcode infile sparam srcname dparam dstname cmpfile)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5COPY_UD_ERR-${testname}-clearall-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ testfiles/${testname}_ERR.out.h5
+ testfiles/${infile}_ERR.out
+ testfiles/${infile}_ERR.out.err
+ testfiles/${testname}_ERR.out.h5.out
+ testfiles/${testname}_ERR.out.h5.out.err
+ )
+ if ("${resultcode}" STREQUAL "2")
+ add_test (
+ NAME H5COPY_UD_ERR-${testname}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
+ -D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=./testfiles/${infile}_ERR.out"
+ -D "TEST_EXPECT=0"
+ -D "TEST_REFERENCE=./testfiles/${infile}_ERR.txt"
+ -D "TEST_MASK_ERROR=true"
+ -D "TEST_APPEND=EXIT CODE:"
+ -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
+ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ else ()
+ add_test (
+ NAME H5COPY_UD_ERR-${testname}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
+ -D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=./testfiles/${infile}_ERR.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=./testfiles/${infile}_ERR.txt"
+ -D "TEST_MASK_ERROR=true"
+ -D "TEST_APPEND=EXIT CODE:"
+ -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
+ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (H5COPY_UD_ERR-${testname} PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}-clearall-objects)
+ add_test (
+ NAME H5COPY_UD_ERR-${testname}-DIFF
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
+ -D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}_ERR.out.h5;${srcname};${dstname}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=./testfiles/${testname}_ERR.out.h5.out"
+ -D "TEST_EXPECT=0"
+ -D "TEST_REFERENCE=./testfiles/${testname}_ERR.out.h5.txt"
+ -D "TEST_APPEND=EXIT CODE:"
+ -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
+ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD_ERR-${testname})
+ endif ()
+ endmacro ()
+
##############################################################################
##############################################################################
### T H E T E S T S ###
@@ -434,3 +568,11 @@
else ()
ADD_H5_TEST_SAME (samefile2 2 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp)
endif ()
+
+##############################################################################
+### P L U G I N T E S T S
+##############################################################################
+if (BUILD_SHARED_LIBS)
+ ADD_H5_UD_TEST (h5copy_plugin_test 0 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5 )
+ ADD_H5_UD_ERR_TEST (h5copy_plugin_fail 2 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5)
+endif ()
diff --git a/tools/test/h5copy/dynlib_copy.c b/tools/test/h5copy/dynlib_copy.c
new file mode 100644
index 0000000..571452e
--- /dev/null
+++ b/tools/test/h5copy/dynlib_copy.c
@@ -0,0 +1,89 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/*
+ * Purpose: Tests the plugin module (H5PL)
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "H5PLextern.h"
+
+#define H5Z_FILTER_DYNLIBUD 300
+#define MULTIPLIER 3
+
+static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+
+/* This message derives from H5Z */
+const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DYNLIBUD, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dynlibud", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
+}};
+
+H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
+const void *H5PLget_plugin_info(void) {return H5Z_DYNLIBUD;}
+
+/*-------------------------------------------------------------------------
+ * Function: H5Z_filter_dynlibud
+ *
+ * Purpose: A dynlib2 filter method that multiplies the original value
+ * during write and divide the original value during read. It
+ * will be built as a shared library. plugin.c test will load
+ * and use this filter library.
+ *
+ * Return: Success: Data chunk size
+ *
+ * Failure: 0
+ *-------------------------------------------------------------------------
+ */
+static size_t
+H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes,
+ size_t *buf_size, void **buf)
+{
+ char *int_ptr = (char *)*buf; /* Pointer to the data values */
+ size_t buf_left = *buf_size; /* Amount of data buffer left to process */
+
+ /* Check for the correct number of parameters */
+ if(cd_nelmts > 0)
+ return(0);
+
+ /* Assignment to eliminate unused parameter warning. */
+ cd_values = cd_values;
+
+ if(flags & H5Z_FLAG_REVERSE) { /*read*/
+ /* Subtract the original value with MULTIPLIER */
+ while(buf_left > 0) {
+ char temp = *int_ptr;
+ *int_ptr = temp - MULTIPLIER;
+ int_ptr++;
+ buf_left -= sizeof(*int_ptr);
+ } /* end while */
+ } /* end if */
+ else { /*write*/
+ /* Add the original value with MULTIPLIER */
+ while(buf_left > 0) {
+ char temp = *int_ptr;
+ *int_ptr = temp + MULTIPLIER;
+ int_ptr++;
+ buf_left -= sizeof(*int_ptr);
+ } /* end while */
+ } /* end else */
+
+ return nbytes;
+} /* end H5Z_filter_dynlibud() */
+
diff --git a/tools/test/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt b/tools/test/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt
new file mode 100644
index 0000000..66e9eb2
--- /dev/null
+++ b/tools/test/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt
@@ -0,0 +1,3 @@
+dataset: </dynlibud> and </dynlibud>
+0 differences found
+EXIT CODE: 0
diff --git a/tools/test/h5copy/testfiles/h5copy_plugin_test.out.h5.txt b/tools/test/h5copy/testfiles/h5copy_plugin_test.out.h5.txt
new file mode 100644
index 0000000..66e9eb2
--- /dev/null
+++ b/tools/test/h5copy/testfiles/h5copy_plugin_test.out.h5.txt
@@ -0,0 +1,3 @@
+dataset: </dynlibud> and </dynlibud>
+0 differences found
+EXIT CODE: 0
diff --git a/tools/test/h5copy/testfiles/tudfilter.h5 b/tools/test/h5copy/testfiles/tudfilter.h5
new file mode 100644
index 0000000..081b000
--- /dev/null
+++ b/tools/test/h5copy/testfiles/tudfilter.h5
Binary files differ
diff --git a/tools/test/h5copy/testfiles/tudfilter.h5.txt b/tools/test/h5copy/testfiles/tudfilter.h5.txt
new file mode 100644
index 0000000..eabe407
--- /dev/null
+++ b/tools/test/h5copy/testfiles/tudfilter.h5.txt
@@ -0,0 +1,2 @@
+Copying file <./testfiles/tudfilter.h5> and object </dynlibud> to file <./testfiles/h5copy_plugin_test.out.h5> and object </dynlibud>
+EXIT CODE: 0
diff --git a/tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt b/tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt
new file mode 100644
index 0000000..3c5b3ca
--- /dev/null
+++ b/tools/test/h5copy/testfiles/tudfilter.h5_ERR.txt
@@ -0,0 +1,2 @@
+Copying file <./testfiles/tudfilter.h5> and object </dynlibud> to file <./testfiles/h5copy_plugin_fail_ERR.out.h5> and object </dynlibud>
+EXIT CODE: 0
diff --git a/tools/test/h5copy/testfiles/tudfilter2.h5 b/tools/test/h5copy/testfiles/tudfilter2.h5
new file mode 100644
index 0000000..081b000
--- /dev/null
+++ b/tools/test/h5copy/testfiles/tudfilter2.h5
Binary files differ
diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake
index d87a47f..bbc39d8 100644
--- a/tools/test/h5diff/CMakeTests.cmake
+++ b/tools/test/h5diff/CMakeTests.cmake
@@ -447,7 +447,7 @@
macro (ADD_PH5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN})
+ add_test (NAME PH5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5diff> ${MPIEXEC_POSTFLAGS} ${ARGN})
set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles")
if (NOT "${resultcode}" STREQUAL "0")
set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -470,7 +470,7 @@
add_test (
NAME PH5DIFF-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$<TARGET_FILE:ph5diff>"
+ -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5diff>;${MPIEXEC_POSTFLAGS}"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am
index d2b5ebb..a2ce9c4 100644
--- a/tools/test/h5diff/Makefile.am
+++ b/tools/test/h5diff/Makefile.am
@@ -52,10 +52,7 @@ if HAVE_SHARED_CONDITIONAL
# Build it as shared library if configure is enabled for shared library.
noinst_LTLIBRARIES=libdynlibdiff.la
libdynlibdiff_la_SOURCES=dynlib_diff.c
- libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere
-
- libdynlibdiff.la: $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_DEPENDENCIES) $(EXTRA_libdynlibdiff_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdynlibdiff_la_LINK) $(am_libdynlibdiff_la_rpath) $(libdynlibdiff_la_OBJECTS) $(libdynlibdiff_la_LIBADD)
+ libdynlibdiff_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
endif
# Temporary files. *.h5 are generated by h5diff. They should
diff --git a/tools/test/h5diff/testfiles/h5diff_454_ERR.err b/tools/test/h5diff/testfiles/h5diff_454_ERR.err
index 8fa1718..82802a1 100644
--- a/tools/test/h5diff/testfiles/h5diff_454_ERR.err
+++ b/tools/test/h5diff/testfiles/h5diff_454_ERR.err
@@ -1,4 +1,4 @@
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: treat dangling link as error
+ #000: (file name) line (number) in h5diff(): treat dangling link as error
major: Failure in tools library
minor: error in function
diff --git a/tools/test/h5diff/testfiles/h5diff_454_ERR.txt b/tools/test/h5diff/testfiles/h5diff_454_ERR.txt
index de25a69..4501071 100644
--- a/tools/test/h5diff/testfiles/h5diff_454_ERR.txt
+++ b/tools/test/h5diff/testfiles/h5diff_454_ERR.txt
@@ -1,6 +1,6 @@
Warning: </softlink_noexist> is a dangling link.
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: treat dangling link as error
+ #000: (file name) line (number) in h5diff(): treat dangling link as error
major: Failure in tools library
minor: error in function
EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_455_ERR.err b/tools/test/h5diff/testfiles/h5diff_455_ERR.err
index 8fa1718..82802a1 100644
--- a/tools/test/h5diff/testfiles/h5diff_455_ERR.err
+++ b/tools/test/h5diff/testfiles/h5diff_455_ERR.err
@@ -1,4 +1,4 @@
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: treat dangling link as error
+ #000: (file name) line (number) in h5diff(): treat dangling link as error
major: Failure in tools library
minor: error in function
diff --git a/tools/test/h5diff/testfiles/h5diff_455_ERR.txt b/tools/test/h5diff/testfiles/h5diff_455_ERR.txt
index de25a69..4501071 100644
--- a/tools/test/h5diff/testfiles/h5diff_455_ERR.txt
+++ b/tools/test/h5diff/testfiles/h5diff_455_ERR.txt
@@ -1,6 +1,6 @@
Warning: </softlink_noexist> is a dangling link.
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: treat dangling link as error
+ #000: (file name) line (number) in h5diff(): treat dangling link as error
major: Failure in tools library
minor: error in function
EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_457_ERR.err b/tools/test/h5diff/testfiles/h5diff_457_ERR.err
index 8fa1718..82802a1 100644
--- a/tools/test/h5diff/testfiles/h5diff_457_ERR.err
+++ b/tools/test/h5diff/testfiles/h5diff_457_ERR.err
@@ -1,4 +1,4 @@
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: treat dangling link as error
+ #000: (file name) line (number) in h5diff(): treat dangling link as error
major: Failure in tools library
minor: error in function
diff --git a/tools/test/h5diff/testfiles/h5diff_457_ERR.txt b/tools/test/h5diff/testfiles/h5diff_457_ERR.txt
index 6594c9a..9d73750 100644
--- a/tools/test/h5diff/testfiles/h5diff_457_ERR.txt
+++ b/tools/test/h5diff/testfiles/h5diff_457_ERR.txt
@@ -1,6 +1,6 @@
Warning: </ext_link_noexist1> is a dangling link.
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: treat dangling link as error
+ #000: (file name) line (number) in h5diff(): treat dangling link as error
major: Failure in tools library
minor: error in function
EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_458_ERR.err b/tools/test/h5diff/testfiles/h5diff_458_ERR.err
index 8fa1718..82802a1 100644
--- a/tools/test/h5diff/testfiles/h5diff_458_ERR.err
+++ b/tools/test/h5diff/testfiles/h5diff_458_ERR.err
@@ -1,4 +1,4 @@
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: treat dangling link as error
+ #000: (file name) line (number) in h5diff(): treat dangling link as error
major: Failure in tools library
minor: error in function
diff --git a/tools/test/h5diff/testfiles/h5diff_458_ERR.txt b/tools/test/h5diff/testfiles/h5diff_458_ERR.txt
index 9a09c17..b084914 100644
--- a/tools/test/h5diff/testfiles/h5diff_458_ERR.txt
+++ b/tools/test/h5diff/testfiles/h5diff_458_ERR.txt
@@ -1,6 +1,6 @@
Warning: </ext_link_noexist2> is a dangling link.
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: treat dangling link as error
+ #000: (file name) line (number) in h5diff(): treat dangling link as error
major: Failure in tools library
minor: error in function
EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_459_ERR.err b/tools/test/h5diff/testfiles/h5diff_459_ERR.err
index 8fa1718..82802a1 100644
--- a/tools/test/h5diff/testfiles/h5diff_459_ERR.err
+++ b/tools/test/h5diff/testfiles/h5diff_459_ERR.err
@@ -1,4 +1,4 @@
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: treat dangling link as error
+ #000: (file name) line (number) in h5diff(): treat dangling link as error
major: Failure in tools library
minor: error in function
diff --git a/tools/test/h5diff/testfiles/h5diff_459_ERR.txt b/tools/test/h5diff/testfiles/h5diff_459_ERR.txt
index 6594c9a..9d73750 100644
--- a/tools/test/h5diff/testfiles/h5diff_459_ERR.txt
+++ b/tools/test/h5diff/testfiles/h5diff_459_ERR.txt
@@ -1,6 +1,6 @@
Warning: </ext_link_noexist1> is a dangling link.
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: treat dangling link as error
+ #000: (file name) line (number) in h5diff(): treat dangling link as error
major: Failure in tools library
minor: error in function
EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_60.txt b/tools/test/h5diff/testfiles/h5diff_60.txt
index 938f279..dde17f6 100644
--- a/tools/test/h5diff/testfiles/h5diff_60.txt
+++ b/tools/test/h5diff/testfiles/h5diff_60.txt
@@ -2,8 +2,8 @@ dataset: </string1> and </string1>
size: [3x4] [3x4]
position string1 string1 difference
------------------------------------------------------------
-[ 1 0 ] 5 \000
-[ 1 1 ] 6 \000
+[ 1 0 ] \000 5
+[ 1 1 ] \000 6
[ 1 2 ] \000 7
[ 1 3 ] \000 8
4 differences found
diff --git a/tools/test/h5diff/testfiles/h5diff_61.txt b/tools/test/h5diff/testfiles/h5diff_61.txt
index 1f238b1..5553d63 100644
--- a/tools/test/h5diff/testfiles/h5diff_61.txt
+++ b/tools/test/h5diff/testfiles/h5diff_61.txt
@@ -2,29 +2,29 @@ dataset: </string2> and </string2>
size: [20] [20]
position string2 string2 difference
------------------------------------------------------------
-[ 8 ] 9 e
-[ 8 ] f
-[ 8 ] 9
-[ 9 ] 0 e
-[ 9 ] f
-[ 9 ] 0
-[ 10 ] 1 e
-[ 10 ] f
-[ 10 ] 1
-[ 11 ] 2 e
-[ 11 ] f
-[ 11 ] 2
-[ 12 ] e 3
-[ 12 ] f
-[ 12 ] 3
-[ 13 ] e 4
-[ 13 ] f
-[ 13 ] 4
-[ 14 ] e 5
-[ 14 ] f
-[ 14 ] 5
-[ 15 ] e 6
-[ 15 ] f
-[ 15 ] 6
+[ 8 ] e 9
+[ 8 ] f
+[ 8 ] 9
+[ 9 ] e 0
+[ 9 ] f
+[ 9 ] 0
+[ 10 ] e 1
+[ 10 ] f
+[ 10 ] 1
+[ 11 ] e 2
+[ 11 ] f
+[ 11 ] 2
+[ 12 ] 3 e
+[ 12 ] f
+[ 12 ] 3
+[ 13 ] 4 e
+[ 13 ] f
+[ 13 ] 4
+[ 14 ] 5 e
+[ 14 ] f
+[ 14 ] 5
+[ 15 ] 6 e
+[ 15 ] f
+[ 15 ] 6
24 differences found
EXIT CODE: 1
diff --git a/tools/test/h5diff/testfiles/h5diff_62.txt b/tools/test/h5diff/testfiles/h5diff_62.txt
index 0cc0947..934f61e 100644
--- a/tools/test/h5diff/testfiles/h5diff_62.txt
+++ b/tools/test/h5diff/testfiles/h5diff_62.txt
@@ -2,36 +2,36 @@ dataset: </string3> and </string3>
size: [27] [27]
position string3 string3 difference
------------------------------------------------------------
-[ 12 ] d c
-[ 12 ] 2 d
-[ 12 ] \000 2
-[ 13 ] 3 d
-[ 13 ] \000 3
-[ 14 ] b a
-[ 14 ] c b
-[ 14 ] d c
-[ 14 ] 4 d
-[ 14 ] \000 4
-[ 15 ] c b
-[ 15 ] d c
-[ 15 ] 5 d
-[ 15 ] \000 5
-[ 16 ] c d
-[ 16 ] d 6
-[ 16 ] 6 \000
-[ 17 ] d 7
-[ 17 ] 7 \000
-[ 18 ] a b
-[ 18 ] b c
-[ 18 ] c d
-[ 18 ] d 8
-[ 18 ] 8 \000
-[ 19 ] b c
-[ 19 ] c d
-[ 19 ] d 9
-[ 19 ] 9 \000
-[ 24 ] c d
-[ 25 ] c d
-[ 26 ] c d
+[ 12 ] c d
+[ 12 ] d 2
+[ 12 ] 2 \000
+[ 13 ] d 3
+[ 13 ] 3 \000
+[ 14 ] a b
+[ 14 ] b c
+[ 14 ] c d
+[ 14 ] d 4
+[ 14 ] 4 \000
+[ 15 ] b c
+[ 15 ] c d
+[ 15 ] d 5
+[ 15 ] 5 \000
+[ 16 ] d c
+[ 16 ] 6 d
+[ 16 ] \000 6
+[ 17 ] 7 d
+[ 17 ] \000 7
+[ 18 ] b a
+[ 18 ] c b
+[ 18 ] d c
+[ 18 ] 8 d
+[ 18 ] \000 8
+[ 19 ] c b
+[ 19 ] d c
+[ 19 ] 9 d
+[ 19 ] \000 9
+[ 24 ] d c
+[ 25 ] d c
+[ 26 ] d c
31 differences found
EXIT CODE: 1
diff --git a/tools/test/h5diff/testfiles/h5diff_63.txt b/tools/test/h5diff/testfiles/h5diff_63.txt
index 043da16..6b46c18 100644
--- a/tools/test/h5diff/testfiles/h5diff_63.txt
+++ b/tools/test/h5diff/testfiles/h5diff_63.txt
@@ -2,9 +2,9 @@ dataset: </string4> and </string4>
size: [3] [3]
position string4 string4 difference
------------------------------------------------------------
-[ 1 ] 8
-[ 1 ] 9
-[ 2 ] 8
-[ 2 ] 9
+[ 1 ] 8
+[ 1 ] 9
+[ 2 ] 8
+[ 2 ] 9
4 differences found
EXIT CODE: 1
diff --git a/tools/test/h5diff/testfiles/h5diff_70.txt b/tools/test/h5diff/testfiles/h5diff_70.txt
index 0a6b0c0..efa34ea 100644
--- a/tools/test/h5diff/testfiles/h5diff_70.txt
+++ b/tools/test/h5diff/testfiles/h5diff_70.txt
@@ -11,79 +11,79 @@ attribute: <VLstring of </>> and <VLstring of </>>
size: [2] [2]
position VLstring of </> VLstring of </> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </>> and <VLstring2D of </>>
size: [3x2] [3x2]
position VLstring2D of </> VLstring2D of </> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </>> and <VLstring3D of </>>
size: [4x3x2] [4x3x2]
position VLstring3D of </> VLstring3D of </> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </>> and <array of </>>
size: [2] [2]
@@ -514,79 +514,79 @@ attribute: <string of </>> and <string of </>>
size: [2] [2]
position string of </> string of </> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </>> and <string2D of </>>
size: [3x2] [3x2]
position string2D of </> string2D of </> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </>> and <string3D of </>>
size: [4x3x2] [4x3x2]
position string3D of </> string3D of </> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </>> and <vlen of </>>
size: [2] [2]
@@ -683,79 +683,79 @@ attribute: <VLstring of </dset>> and <VLstring of </dset>>
size: [2] [2]
position VLstring of </dset> VLstring of </dset> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </dset>> and <VLstring2D of </dset>>
size: [3x2] [3x2]
position VLstring2D of </dset> VLstring2D of </dset> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </dset>> and <VLstring3D of </dset>>
size: [4x3x2] [4x3x2]
position VLstring3D of </dset> VLstring3D of </dset> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </dset>> and <array of </dset>>
size: [2] [2]
@@ -1192,79 +1192,79 @@ attribute: <string of </dset>> and <string of </dset>>
size: [2] [2]
position string of </dset> string of </dset> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </dset>> and <string2D of </dset>>
size: [3x2] [3x2]
position string2D of </dset> string2D of </dset> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </dset>> and <string3D of </dset>>
size: [4x3x2] [4x3x2]
position string3D of </dset> string3D of </dset> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </dset>> and <vlen of </dset>>
size: [2] [2]
@@ -1360,79 +1360,79 @@ attribute: <VLstring of </g1>> and <VLstring of </g1>>
size: [2] [2]
position VLstring of </g1> VLstring of </g1> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </g1>> and <VLstring2D of </g1>>
size: [3x2] [3x2]
position VLstring2D of </g1> VLstring2D of </g1> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </g1>> and <VLstring3D of </g1>>
size: [4x3x2] [4x3x2]
position VLstring3D of </g1> VLstring3D of </g1> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </g1>> and <array of </g1>>
size: [2] [2]
@@ -1863,79 +1863,79 @@ attribute: <string of </g1>> and <string of </g1>>
size: [2] [2]
position string of </g1> string of </g1> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </g1>> and <string2D of </g1>>
size: [3x2] [3x2]
position string2D of </g1> string2D of </g1> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </g1>> and <string3D of </g1>>
size: [4x3x2] [4x3x2]
position string3D of </g1> string3D of </g1> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </g1>> and <vlen of </g1>>
size: [2] [2]
diff --git a/tools/test/h5diff/testfiles/h5diff_700.txt b/tools/test/h5diff/testfiles/h5diff_700.txt
index 1cf71dd..851a407 100644
--- a/tools/test/h5diff/testfiles/h5diff_700.txt
+++ b/tools/test/h5diff/testfiles/h5diff_700.txt
@@ -13,79 +13,79 @@ attribute: <VLstring of </>> and <VLstring of </>>
size: [2] [2]
position VLstring of </> VLstring of </> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </>> and <VLstring2D of </>>
size: [3x2] [3x2]
position VLstring2D of </> VLstring2D of </> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </>> and <VLstring3D of </>>
size: [4x3x2] [4x3x2]
position VLstring3D of </> VLstring3D of </> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </>> and <array of </>>
size: [2] [2]
@@ -516,79 +516,79 @@ attribute: <string of </>> and <string of </>>
size: [2] [2]
position string of </> string of </> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </>> and <string2D of </>>
size: [3x2] [3x2]
position string2D of </> string2D of </> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </>> and <string3D of </>>
size: [4x3x2] [4x3x2]
position string3D of </> string3D of </> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </>> and <vlen of </>>
size: [2] [2]
@@ -687,79 +687,79 @@ attribute: <VLstring of </dset>> and <VLstring of </dset>>
size: [2] [2]
position VLstring of </dset> VLstring of </dset> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </dset>> and <VLstring2D of </dset>>
size: [3x2] [3x2]
position VLstring2D of </dset> VLstring2D of </dset> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </dset>> and <VLstring3D of </dset>>
size: [4x3x2] [4x3x2]
position VLstring3D of </dset> VLstring3D of </dset> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </dset>> and <array of </dset>>
size: [2] [2]
@@ -1196,79 +1196,79 @@ attribute: <string of </dset>> and <string of </dset>>
size: [2] [2]
position string of </dset> string of </dset> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </dset>> and <string2D of </dset>>
size: [3x2] [3x2]
position string2D of </dset> string2D of </dset> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </dset>> and <string3D of </dset>>
size: [4x3x2] [4x3x2]
position string3D of </dset> string3D of </dset> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </dset>> and <vlen of </dset>>
size: [2] [2]
@@ -1366,79 +1366,79 @@ attribute: <VLstring of </g1>> and <VLstring of </g1>>
size: [2] [2]
position VLstring of </g1> VLstring of </g1> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </g1>> and <VLstring2D of </g1>>
size: [3x2] [3x2]
position VLstring2D of </g1> VLstring2D of </g1> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </g1>> and <VLstring3D of </g1>>
size: [4x3x2] [4x3x2]
position VLstring3D of </g1> VLstring3D of </g1> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </g1>> and <array of </g1>>
size: [2] [2]
@@ -1869,79 +1869,79 @@ attribute: <string of </g1>> and <string of </g1>>
size: [2] [2]
position string of </g1> string of </g1> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </g1>> and <string2D of </g1>>
size: [3x2] [3x2]
position string2D of </g1> string2D of </g1> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </g1>> and <string3D of </g1>>
size: [4x3x2] [4x3x2]
position string3D of </g1> string3D of </g1> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </g1>> and <vlen of </g1>>
size: [2] [2]
diff --git a/tools/test/h5diff/testfiles/h5diff_701.txt b/tools/test/h5diff/testfiles/h5diff_701.txt
index 405ab2f..33f1a0f 100644
--- a/tools/test/h5diff/testfiles/h5diff_701.txt
+++ b/tools/test/h5diff/testfiles/h5diff_701.txt
@@ -45,79 +45,79 @@ attribute: <VLstring of </>> and <VLstring of </>>
size: [2] [2]
position VLstring of </> VLstring of </> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </>> and <VLstring2D of </>>
size: [3x2] [3x2]
position VLstring2D of </> VLstring2D of </> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </>> and <VLstring3D of </>>
size: [4x3x2] [4x3x2]
position VLstring3D of </> VLstring3D of </> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </>> and <array of </>>
size: [2] [2]
@@ -548,79 +548,79 @@ attribute: <string of </>> and <string of </>>
size: [2] [2]
position string of </> string of </> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </>> and <string2D of </>>
size: [3x2] [3x2]
position string2D of </> string2D of </> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </>> and <string3D of </>>
size: [4x3x2] [4x3x2]
position string3D of </> string3D of </> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </>> and <vlen of </>>
size: [2] [2]
@@ -754,79 +754,79 @@ attribute: <VLstring of </dset>> and <VLstring of </dset>>
size: [2] [2]
position VLstring of </dset> VLstring of </dset> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </dset>> and <VLstring2D of </dset>>
size: [3x2] [3x2]
position VLstring2D of </dset> VLstring2D of </dset> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </dset>> and <VLstring3D of </dset>>
size: [4x3x2] [4x3x2]
position VLstring3D of </dset> VLstring3D of </dset> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </dset>> and <array of </dset>>
size: [2] [2]
@@ -1263,79 +1263,79 @@ attribute: <string of </dset>> and <string of </dset>>
size: [2] [2]
position string of </dset> string of </dset> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </dset>> and <string2D of </dset>>
size: [3x2] [3x2]
position string2D of </dset> string2D of </dset> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </dset>> and <string3D of </dset>>
size: [4x3x2] [4x3x2]
position string3D of </dset> string3D of </dset> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </dset>> and <vlen of </dset>>
size: [2] [2]
@@ -1465,79 +1465,79 @@ attribute: <VLstring of </g1>> and <VLstring of </g1>>
size: [2] [2]
position VLstring of </g1> VLstring of </g1> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </g1>> and <VLstring2D of </g1>>
size: [3x2] [3x2]
position VLstring2D of </g1> VLstring2D of </g1> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </g1>> and <VLstring3D of </g1>>
size: [4x3x2] [4x3x2]
position VLstring3D of </g1> VLstring3D of </g1> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </g1>> and <array of </g1>>
size: [2] [2]
@@ -1968,79 +1968,79 @@ attribute: <string of </g1>> and <string of </g1>>
size: [2] [2]
position string of </g1> string of </g1> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </g1>> and <string2D of </g1>>
size: [3x2] [3x2]
position string2D of </g1> string2D of </g1> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </g1>> and <string3D of </g1>>
size: [4x3x2] [4x3x2]
position string3D of </g1> string3D of </g1> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </g1>> and <vlen of </g1>>
size: [2] [2]
diff --git a/tools/test/h5diff/testfiles/h5diff_702.txt b/tools/test/h5diff/testfiles/h5diff_702.txt
index 1cf71dd..851a407 100644
--- a/tools/test/h5diff/testfiles/h5diff_702.txt
+++ b/tools/test/h5diff/testfiles/h5diff_702.txt
@@ -13,79 +13,79 @@ attribute: <VLstring of </>> and <VLstring of </>>
size: [2] [2]
position VLstring of </> VLstring of </> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </>> and <VLstring2D of </>>
size: [3x2] [3x2]
position VLstring2D of </> VLstring2D of </> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </>> and <VLstring3D of </>>
size: [4x3x2] [4x3x2]
position VLstring3D of </> VLstring3D of </> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </>> and <array of </>>
size: [2] [2]
@@ -516,79 +516,79 @@ attribute: <string of </>> and <string of </>>
size: [2] [2]
position string of </> string of </> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </>> and <string2D of </>>
size: [3x2] [3x2]
position string2D of </> string2D of </> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </>> and <string3D of </>>
size: [4x3x2] [4x3x2]
position string3D of </> string3D of </> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </>> and <vlen of </>>
size: [2] [2]
@@ -687,79 +687,79 @@ attribute: <VLstring of </dset>> and <VLstring of </dset>>
size: [2] [2]
position VLstring of </dset> VLstring of </dset> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </dset>> and <VLstring2D of </dset>>
size: [3x2] [3x2]
position VLstring2D of </dset> VLstring2D of </dset> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </dset>> and <VLstring3D of </dset>>
size: [4x3x2] [4x3x2]
position VLstring3D of </dset> VLstring3D of </dset> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </dset>> and <array of </dset>>
size: [2] [2]
@@ -1196,79 +1196,79 @@ attribute: <string of </dset>> and <string of </dset>>
size: [2] [2]
position string of </dset> string of </dset> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </dset>> and <string2D of </dset>>
size: [3x2] [3x2]
position string2D of </dset> string2D of </dset> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </dset>> and <string3D of </dset>>
size: [4x3x2] [4x3x2]
position string3D of </dset> string3D of </dset> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </dset>> and <vlen of </dset>>
size: [2] [2]
@@ -1366,79 +1366,79 @@ attribute: <VLstring of </g1>> and <VLstring of </g1>>
size: [2] [2]
position VLstring of </g1> VLstring of </g1> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </g1>> and <VLstring2D of </g1>>
size: [3x2] [3x2]
position VLstring2D of </g1> VLstring2D of </g1> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </g1>> and <VLstring3D of </g1>>
size: [4x3x2] [4x3x2]
position VLstring3D of </g1> VLstring3D of </g1> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </g1>> and <array of </g1>>
size: [2] [2]
@@ -1869,79 +1869,79 @@ attribute: <string of </g1>> and <string of </g1>>
size: [2] [2]
position string of </g1> string of </g1> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </g1>> and <string2D of </g1>>
size: [3x2] [3x2]
position string2D of </g1> string2D of </g1> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </g1>> and <string3D of </g1>>
size: [4x3x2] [4x3x2]
position string3D of </g1> string3D of </g1> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </g1>> and <vlen of </g1>>
size: [2] [2]
diff --git a/tools/test/h5diff/testfiles/h5diff_703.txt b/tools/test/h5diff/testfiles/h5diff_703.txt
index 405ab2f..33f1a0f 100644
--- a/tools/test/h5diff/testfiles/h5diff_703.txt
+++ b/tools/test/h5diff/testfiles/h5diff_703.txt
@@ -45,79 +45,79 @@ attribute: <VLstring of </>> and <VLstring of </>>
size: [2] [2]
position VLstring of </> VLstring of </> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </>> and <VLstring2D of </>>
size: [3x2] [3x2]
position VLstring2D of </> VLstring2D of </> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </>> and <VLstring3D of </>>
size: [4x3x2] [4x3x2]
position VLstring3D of </> VLstring3D of </> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </>> and <array of </>>
size: [2] [2]
@@ -548,79 +548,79 @@ attribute: <string of </>> and <string of </>>
size: [2] [2]
position string of </> string of </> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </>> and <string2D of </>>
size: [3x2] [3x2]
position string2D of </> string2D of </> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </>> and <string3D of </>>
size: [4x3x2] [4x3x2]
position string3D of </> string3D of </> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </>> and <vlen of </>>
size: [2] [2]
@@ -754,79 +754,79 @@ attribute: <VLstring of </dset>> and <VLstring of </dset>>
size: [2] [2]
position VLstring of </dset> VLstring of </dset> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </dset>> and <VLstring2D of </dset>>
size: [3x2] [3x2]
position VLstring2D of </dset> VLstring2D of </dset> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </dset>> and <VLstring3D of </dset>>
size: [4x3x2] [4x3x2]
position VLstring3D of </dset> VLstring3D of </dset> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </dset>> and <array of </dset>>
size: [2] [2]
@@ -1263,79 +1263,79 @@ attribute: <string of </dset>> and <string of </dset>>
size: [2] [2]
position string of </dset> string of </dset> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </dset>> and <string2D of </dset>>
size: [3x2] [3x2]
position string2D of </dset> string2D of </dset> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </dset>> and <string3D of </dset>>
size: [4x3x2] [4x3x2]
position string3D of </dset> string3D of </dset> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </dset>> and <vlen of </dset>>
size: [2] [2]
@@ -1465,79 +1465,79 @@ attribute: <VLstring of </g1>> and <VLstring of </g1>>
size: [2] [2]
position VLstring of </g1> VLstring of </g1> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <VLstring2D of </g1>> and <VLstring2D of </g1>>
size: [3x2] [3x2]
position VLstring2D of </g1> VLstring2D of </g1> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <VLstring3D of </g1>> and <VLstring3D of </g1>>
size: [4x3x2] [4x3x2]
position VLstring3D of </g1> VLstring3D of </g1> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <array of </g1>> and <array of </g1>>
size: [2] [2]
@@ -1968,79 +1968,79 @@ attribute: <string of </g1>> and <string of </g1>>
size: [2] [2]
position string of </g1> string of </g1> difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
attribute: <string2D of </g1>> and <string2D of </g1>>
size: [3x2] [3x2]
position string2D of </g1> string2D of </g1> difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
attribute: <string3D of </g1>> and <string3D of </g1>>
size: [4x3x2] [4x3x2]
position string3D of </g1> string3D of </g1> difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
attribute: <vlen of </g1>> and <vlen of </g1>>
size: [2] [2]
diff --git a/tools/test/h5diff/testfiles/h5diff_80.txt b/tools/test/h5diff/testfiles/h5diff_80.txt
index 836e073..b223eed 100644
--- a/tools/test/h5diff/testfiles/h5diff_80.txt
+++ b/tools/test/h5diff/testfiles/h5diff_80.txt
@@ -59,79 +59,79 @@ dataset: </g1/VLstring> and </g1/VLstring>
size: [2] [2]
position VLstring VLstring difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
dataset: </g1/VLstring2D> and </g1/VLstring2D>
size: [3x2] [3x2]
position VLstring2D VLstring2D difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
dataset: </g1/VLstring3D> and </g1/VLstring3D>
size: [4x3x2] [4x3x2]
position VLstring3D VLstring3D difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
dataset: </g1/array> and </g1/array>
size: [2] [2]
@@ -702,79 +702,79 @@ dataset: </g1/string> and </g1/string>
size: [2] [2]
position string string difference
------------------------------------------------------------
-[ 0 ] a z
-[ 0 ] b z
-[ 1 ] d z
-[ 1 ] e z
+[ 0 ] z a
+[ 0 ] z b
+[ 1 ] z d
+[ 1 ] z e
4 differences found
dataset: </g1/string2D> and </g1/string2D>
size: [3x2] [3x2]
position string2D string2D difference
------------------------------------------------------------
-[ 0 0 ] a z
-[ 0 0 ] b z
-[ 0 1 ] c z
-[ 0 1 ] d z
-[ 1 0 ] e z
-[ 1 0 ] f z
-[ 1 1 ] g z
-[ 1 1 ] h z
-[ 2 0 ] i z
-[ 2 0 ] j z
-[ 2 1 ] k z
-[ 2 1 ] l z
+[ 0 0 ] z a
+[ 0 0 ] z b
+[ 0 1 ] z c
+[ 0 1 ] z d
+[ 1 0 ] z e
+[ 1 0 ] z f
+[ 1 1 ] z g
+[ 1 1 ] z h
+[ 2 0 ] z i
+[ 2 0 ] z j
+[ 2 1 ] z k
+[ 2 1 ] z l
12 differences found
dataset: </g1/string3D> and </g1/string3D>
size: [4x3x2] [4x3x2]
position string3D string3D difference
------------------------------------------------------------
-[ 0 0 0 ] a z
-[ 0 0 0 ] b z
-[ 0 0 1 ] c z
-[ 0 0 1 ] d z
-[ 0 1 0 ] e z
-[ 0 1 0 ] f z
-[ 0 1 1 ] g z
-[ 0 1 1 ] h z
-[ 0 2 0 ] i z
-[ 0 2 0 ] j z
-[ 0 2 1 ] k z
-[ 0 2 1 ] l z
-[ 1 0 0 ] m z
-[ 1 0 0 ] n z
-[ 1 0 1 ] p z
-[ 1 0 1 ] q z
-[ 1 1 0 ] r z
-[ 1 1 0 ] s z
-[ 1 1 1 ] t z
-[ 1 1 1 ] u z
-[ 1 2 0 ] v z
-[ 1 2 0 ] w z
-[ 1 2 1 ] x z
-[ 2 0 0 ] A z
-[ 2 0 0 ] B z
-[ 2 0 1 ] C z
-[ 2 0 1 ] D z
-[ 2 1 0 ] E z
-[ 2 1 0 ] F z
-[ 2 1 1 ] G z
-[ 2 1 1 ] H z
-[ 2 2 0 ] I z
-[ 2 2 0 ] J z
-[ 2 2 1 ] K z
-[ 2 2 1 ] L z
-[ 3 0 0 ] M z
-[ 3 0 0 ] N z
-[ 3 0 1 ] P z
-[ 3 0 1 ] Q z
-[ 3 1 0 ] R z
-[ 3 1 0 ] S z
-[ 3 1 1 ] T z
-[ 3 1 1 ] U z
-[ 3 2 0 ] V z
-[ 3 2 0 ] W z
-[ 3 2 1 ] X z
-[ 3 2 1 ] Z z
+[ 0 0 0 ] z a
+[ 0 0 0 ] z b
+[ 0 0 1 ] z c
+[ 0 0 1 ] z d
+[ 0 1 0 ] z e
+[ 0 1 0 ] z f
+[ 0 1 1 ] z g
+[ 0 1 1 ] z h
+[ 0 2 0 ] z i
+[ 0 2 0 ] z j
+[ 0 2 1 ] z k
+[ 0 2 1 ] z l
+[ 1 0 0 ] z m
+[ 1 0 0 ] z n
+[ 1 0 1 ] z p
+[ 1 0 1 ] z q
+[ 1 1 0 ] z r
+[ 1 1 0 ] z s
+[ 1 1 1 ] z t
+[ 1 1 1 ] z u
+[ 1 2 0 ] z v
+[ 1 2 0 ] z w
+[ 1 2 1 ] z x
+[ 2 0 0 ] z A
+[ 2 0 0 ] z B
+[ 2 0 1 ] z C
+[ 2 0 1 ] z D
+[ 2 1 0 ] z E
+[ 2 1 0 ] z F
+[ 2 1 1 ] z G
+[ 2 1 1 ] z H
+[ 2 2 0 ] z I
+[ 2 2 0 ] z J
+[ 2 2 1 ] z K
+[ 2 2 1 ] z L
+[ 3 0 0 ] z M
+[ 3 0 0 ] z N
+[ 3 0 1 ] z P
+[ 3 0 1 ] z Q
+[ 3 1 0 ] z R
+[ 3 1 0 ] z S
+[ 3 1 1 ] z T
+[ 3 1 1 ] z U
+[ 3 2 0 ] z V
+[ 3 2 0 ] z W
+[ 3 2 1 ] z X
+[ 3 2 1 ] z Z
47 differences found
dataset: </g1/vlen> and </g1/vlen>
size: [2] [2]
diff --git a/tools/test/h5diff/testfiles/h5diff_udfail.txt b/tools/test/h5diff/testfiles/h5diff_udfail.txt
index c154c6b..d51de38 100644
--- a/tools/test/h5diff/testfiles/h5diff_udfail.txt
+++ b/tools/test/h5diff/testfiles/h5diff_udfail.txt
@@ -8,5 +8,5 @@ group : </> and </>
0 differences found
dataset: </dynlibud> and </dynlibud>
0 differences found
-warning: dataset </dynlibud> cannot be read, user defined filter is not available
+Warning: dataset </dynlibud> cannot be read, user defined filter is not available
EXIT CODE: 2
diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am
index 1454987..a7a2bcb 100644
--- a/tools/test/h5dump/Makefile.am
+++ b/tools/test/h5dump/Makefile.am
@@ -41,10 +41,7 @@ if HAVE_SHARED_CONDITIONAL
# Build it as shared library if configure is enabled for shared library.
noinst_LTLIBRARIES=libdynlibdump.la
libdynlibdump_la_SOURCES=dynlib_dump.c
- libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere
-
- libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD)
+ libdynlibdump_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
endif
# Temporary files. *.h5 are generated by h5dumpgentest. They should
diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake
index 4af220b..2240813 100644
--- a/tools/test/h5format_convert/CMakeTests.cmake
+++ b/tools/test/h5format_convert/CMakeTests.cmake
@@ -47,6 +47,7 @@
old_h5fc_ext2_sf.ddl
old_h5fc_ext3_isf.ddl
h5fc_v_err.ddl
+ h5fc_v_err.ddl.err
)
set (HDF5_REFERENCE_TEST_FILES
h5fc_non_v3.h5
@@ -140,6 +141,62 @@
endif ()
endmacro ()
+ macro (ADD_H5_MASK_OUTPUT testname resultfile resultcode testfile)
+ # If using memchecker add tests without using scripts
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5FC-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ./testfiles/outtmp.h5
+ ./testfiles/${testname}.out
+ ./testfiles/${testname}.out.err
+ )
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
+ endif ()
+ if (NOT "${testfile}" STREQUAL "")
+ add_test (
+ NAME H5FC-${testname}-${testfile}-tmpfile
+ COMMAND ${CMAKE_COMMAND}
+ -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
+ )
+ set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
+ add_test (
+ NAME H5FC-${testname}-${testfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_ARGS=${ARGN};outtmp.h5"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}"
+ -D "TEST_ERRREF=${resultfile}.err"
+ -D "TEST_MASK_ERROR=true"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile")
+ set (last_test "H5FC-${testname}-${testfile}")
+ else ()
+ add_test (
+ NAME H5FC-${testname}-NA
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_ARGS=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}"
+ -D "TEST_ERRREF=${resultfile}.err"
+ -D "TEST_MASK_ERROR=true"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5FC-${testname}-NA PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
+ set (last_test "H5FC-${testname}-NA")
+ endif ()
+ endif ()
+ endmacro ()
+
macro (ADD_H5_TEST testname resultcode testfile)
# If using memchecker add tests without using scripts
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -391,7 +448,7 @@
#
#
# h5format_convert -v h5fc_err_level.h5 (error encountered in converting the dataset)
- ADD_H5_OUTPUT (h5fc_v_err h5fc_v_err.ddl 1 h5fc_err_level.h5 -v)
+ ADD_H5_MASK_OUTPUT (h5fc_v_err h5fc_v_err.ddl 1 h5fc_err_level.h5 -v)
#
#
#
diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl
index b671db0..0b7d0ac 100644
--- a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl
+++ b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl
@@ -10,4 +10,3 @@ Dataset's chunk indexing type is not version 1 B-tree
Converting the dataset...
Error encountered
Close the file
-h5format_convert error: unable to downgrade dataset "/DSET_ERR"
diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err
new file mode 100644
index 0000000..d85a999
--- /dev/null
+++ b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl.err
@@ -0,0 +1,8 @@
+h5format_convert error: unable to downgrade dataset "/DSET_ERR"
+H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
+ #000: (file name) line (number) in h5trav_visit(): traverse failed
+ major: Failure in tools library
+ minor: error in function
+ #001: (file name) line (number) in traverse(): H5Lvisit_by_name failed
+ major: Failure in tools library
+ minor: error in function
diff --git a/tools/test/h5format_convert/testh5fc.sh.in b/tools/test/h5format_convert/testh5fc.sh.in
index c3056e8..585d389 100644
--- a/tools/test/h5format_convert/testh5fc.sh.in
+++ b/tools/test/h5format_convert/testh5fc.sh.in
@@ -32,8 +32,8 @@ EXIT_FAILURE=1
FORMCONV=../../src/h5format_convert/h5format_convert # The tool name
FORMCONV_BIN=`pwd`/$FORMCONV # The path of the tool binary
-CHK_IDX=h5fc_chk_idx # The program name
-CHK_IDX_BIN=`pwd`/$CHK_IDX # The program to verify the chunk indexing type is v1 B-tree
+CHK_IDX=h5fc_chk_idx # The program name
+CHK_IDX_BIN=`pwd`/$CHK_IDX # The program to verify the chunk indexing type is v1 B-tree
RM='rm -rf'
CMP='cmp -s'
@@ -131,6 +131,7 @@ $SRC_H5FORMCONV_TESTFILES/old_h5fc_ext2_is.ddl
$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext2_sf.ddl
$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext3_isf.ddl
$SRC_H5FORMCONV_TESTFILES/h5fc_v_err.ddl
+$SRC_H5FORMCONV_TESTFILES/h5fc_v_err.ddl.err
"
#
@@ -154,10 +155,10 @@ COPY_TESTFILES_TO_TESTDIR()
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $CP -f $tstfile $TESTDIR
+ $CP -f $tstfile $TESTDIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy $tstfile ."
-
+
# Comment out this to CREATE expected file
exit $EXIT_FAILURE
fi
@@ -177,7 +178,7 @@ CLEAN_TESTFILES_AND_TESTDIR()
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
$RM $TESTDIR
else
- $RM $TESTDIR/$TMPFILE
+ $RM $TESTDIR/$TMPFILE
$RM $TESTDIR/$TMPOUTFILE
$RM $TESTDIR/$TMPCHKFILE
$RM $TESTDIR/$TMPDMPFILE
@@ -201,13 +202,13 @@ TESTING() {
# non-zero value.
#
# $1: expected output
-# $2: the test file name
-# --fname might be empty or fname does not exist
-# --fname is copied to a temporary file for testing
+# $2: the test file name
+# --fname might be empty or fname does not exist
+# --fname is copied to a temporary file for testing
# $3 to at most $6--options to the tool such as:
-# -d dname or --dname=dname
-# -v or --verbose
-# -n or --noop
+# -d dname or --dname=dname
+# -v or --verbose
+# -n or --noop
TOOLTEST_OUT() {
# Prepare expected and actual output
expect="$TESTDIR/$1"
@@ -220,15 +221,15 @@ TOOLTEST_OUT() {
$RM $TESTDIR/$TMPOUTFILE
TFILE=$2
if [ ! -z "$2" ] && [ -e $TESTDIR/$2 ] ; then
- $CP $TESTDIR/$2 $TESTDIR/$TMPOUTFILE
- TFILE=$TMPOUTFILE
+ $CP $TESTDIR/$2 $TESTDIR/$TMPOUTFILE
+ TFILE=$TMPOUTFILE
fi
# Run test.
TESTING $FORMCONV $3 $4 $5 $6 $2
(
- cd $TESTDIR
- $RUNSERIAL $FORMCONV_BIN $3 $4 $5 $6 $TFILE
+ cd $TESTDIR
+ $RUNSERIAL $FORMCONV_BIN $3 $4 $5 $6 $TFILE
) >$actual 2>$actual_err
cp $actual $actual_sav
cp $actual_err $actual_err_sav
@@ -239,20 +240,81 @@ TOOLTEST_OUT() {
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
- $RM $actual $actual_err
- $RM $actual $actual_err $actual_sav $actual_err_sav
+ $RM $actual $actual_err
+ $RM $actual $actual_err $actual_sav $actual_err_sav
+ fi
+}
+# Same as TOOLTEST_OUT but filters error stack output and compares to an error file
+TOOLTEST_MASK_OUT() {
+ # Prepare expected and actual output
+ expect="$TESTDIR/$1"
+ expect_err="$TESTDIR/$1.err"
+ actual_ext="$TESTDIR/$1.ext"
+ actual="$TESTDIR/`basename $1 .ddl`.out"
+ actual_err="$TESTDIR/`basename $1 .ddl`.err"
+ actual_sav=${actual}-sav
+ actual_err_sav=${actual_err}-sav
+
+ # Prepare the test file
+ $RM $TESTDIR/$TMPOUTFILE
+ TFILE=$2
+ if [ ! -z "$2" ] && [ -e $TESTDIR/$2 ] ; then
+ $CP $TESTDIR/$2 $TESTDIR/$TMPOUTFILE
+ TFILE=$TMPOUTFILE
+ fi
+
+ # Run test.
+ TESTING $FORMCONV $3 $4 $5 $6 $2
+ (
+ cd $TESTDIR
+ $RUNSERIAL $FORMCONV_BIN $3 $4 $5 $6 $TFILE
+ ) >$actual 2>$actual_err
+ cp $actual $actual_sav
+ cp $actual_err $actual_err_sav
+ STDERR_FILTER $actual_err
+
+ # Extract file name, line number, version and thread IDs because they may be different
+ sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
+ -e 's/line [0-9]*/line (number)/' \
+ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
+ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
+ -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \
+ -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \
+ $actual_err > $actual_ext
+
+ # Compare output
+ if $CMP $expect $actual; then
+ if $CMP $expect_err $actual_ext; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ echo " Expected result (*.err) differs from actual result (*.oerr)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /'
+ fi
+ else
+ echo "*FAILED*"
+ echo " Expected result (*.ddl) differs from actual result (*.out)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ $RM $actual $actual_err
+ $RM $actual $actual_err $actual_sav $actual_err_sav
fi
}
-# To check that the tool exits success, no output
+# To check that the tool exits success, no output
# Assume all short options
-# $1 is the test file name
-# --fname exists
-# --fname is copied to a temporary file for testing
-# $2 is the temporary file name
+# $1 is the test file name
+# --fname exists
+# --fname is copied to a temporary file for testing
+# $2 is the temporary file name
# $3 to at most $5--options to the tool such as:
-# -d dname
-# -n
+# -d dname
+# -n
TOOLTEST() {
TESTING $FORMCONV $3 $4 $5 $1
$RM $TESTDIR/$2
@@ -260,11 +322,11 @@ TOOLTEST() {
$RUNSERIAL $FORMCONV_BIN $3 $4 $5 $TESTDIR/$2
exitcode=$?
if [ $exitcode -ne 0 ]; then
- echo "*FAILED*"
- echo " The tool exits failure"
- nerrors="`expr $nerrors + 1`"
+ echo "*FAILED*"
+ echo " The tool exits failure"
+ nerrors="`expr $nerrors + 1`"
else
- echo " PASSED"
+ echo " PASSED"
fi
}
@@ -280,11 +342,11 @@ IDX_CHECK() {
$RUNSERIAL $CHK_IDX_BIN $TESTDIR/$TMPCHKFILE $1
ret=$?
if [ $ret -eq 0 ]; then
- echo " PASSED"
+ echo " PASSED"
else
- echo "*FAILED*"
- echo " The chunk indexing type is not correct"
- nerrors="`expr $nerrors + 1`"
+ echo "*FAILED*"
+ echo " The chunk indexing type is not correct"
+ nerrors="`expr $nerrors + 1`"
fi
}
@@ -317,7 +379,7 @@ H5DUMP_CHECK() {
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
- $RM $actual $actual_err
+ $RM $actual $actual_err
fi
}
@@ -326,12 +388,12 @@ SKIP() {
TESTING $STAT $@
echo " -SKIP-"
}
-
+
##############################################################################
##############################################################################
-### T H E T E S T S ###
+### T H E T E S T S ###
##############################################################################
##############################################################################
# prepare for test
@@ -377,7 +439,7 @@ TOOLTEST_OUT h5fc_v_n_all.ddl h5fc_non_v3.h5 -v -n
#
#
# h5format_convert -v h5fc_err_level.h5 (error encountered in converting the dataset)
-TOOLTEST_OUT h5fc_v_err.ddl h5fc_err_level.h5 -v
+TOOLTEST_MASK_OUT h5fc_v_err.ddl h5fc_err_level.h5 -v
#
#
#
@@ -436,7 +498,7 @@ TOOLTEST h5fc_non_v3.h5 $TMPFILE -n
#
# No output from tests: just check exit code
# h5format_convert h5fc_non_v3.h5
-# 1) convert all datasets
+# 1) convert all datasets
# 2) verify indexing types
TOOLTEST h5fc_non_v3.h5 $TMPCHKFILE
IDX_CHECK /DSET_NDATA_EA
diff --git a/tools/test/h5ls/Makefile.am b/tools/test/h5ls/Makefile.am
index ec8b8c3..f5ec0f7 100644
--- a/tools/test/h5ls/Makefile.am
+++ b/tools/test/h5ls/Makefile.am
@@ -38,10 +38,7 @@ if HAVE_SHARED_CONDITIONAL
# Build it as shared library if configure is enabled for shared library.
noinst_LTLIBRARIES=libdynlibls.la
libdynlibls_la_SOURCES=dynlib_ls.c
- libdynlibls_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere
-
- libdynlibls.la: $(libdynlibls_la_OBJECTS) $(libdynlibls_la_DEPENDENCIES) $(EXTRA_libdynlibls_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdynlibls_la_LINK) $(am_libdynlibls_la_rpath) $(libdynlibls_la_OBJECTS) $(libdynlibls_la_LIBADD)
+ libdynlibls_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
endif
diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake
index 559dd88..13ebd17 100644
--- a/tools/test/h5repack/CMakeTests.cmake
+++ b/tools/test/h5repack/CMakeTests.cmake
@@ -275,12 +275,12 @@
endif ()
add_test (
NAME H5REPACK-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND $<TARGET_FILE:h5repack> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS H5REPACK-${testname}-clear-objects)
add_test (
NAME H5REPACK-${testname}_DFF
- COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND $<TARGET_FILE:h5diff> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname})
endif ()
diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am
index d4dc843..ce7cad4 100644
--- a/tools/test/h5repack/Makefile.am
+++ b/tools/test/h5repack/Makefile.am
@@ -48,13 +48,8 @@ if HAVE_SHARED_CONDITIONAL
noinst_LTLIBRARIES=libdynlibadd.la libdynlibvers.la
libdynlibadd_la_SOURCES=dynlib_rpk.c
libdynlibvers_la_SOURCES=dynlib_vrpk.c
- libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere
- libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere
-
- libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EXTRA_libdynlibadd_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdynlibadd_la_LINK) $(am_libdynlibadd_la_rpath) $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_LIBADD)
- libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdynlibvers_la_LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD)
+ libdynlibadd_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+ libdynlibvers_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
endif
diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c
index 264550e..f6166da 100644
--- a/tools/test/h5repack/h5repacktst.c
+++ b/tools/test/h5repack/h5repacktst.c
@@ -3041,9 +3041,9 @@ int make_all_filters(hid_t loc_id)
/* close */
if(H5Tclose(dtid) < 0)
- return -1;
+ goto out;
if(H5Dclose(dsid) < 0)
- return -1;
+ goto out;
if(H5Sclose(sid) < 0)
goto out;
@@ -3055,6 +3055,8 @@ int make_all_filters(hid_t loc_id)
out:
H5E_BEGIN_TRY
{
+ H5Tclose(dtid);
+ H5Dclose(dsid);
H5Pclose(dcpl);
H5Sclose(sid);
} H5E_END_TRY;
diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt
index 1ff5b73..77e2178 100644
--- a/tools/test/h5repack/testfiles/h5repack-help.txt
+++ b/tools/test/h5repack/testfiles/h5repack-help.txt
@@ -7,6 +7,9 @@ usage: h5repack [OPTIONS] file1 file2
-V, --version Print version number and exit
-n, --native Use a native HDF5 type when repacking
-L, --latest Use latest version of file format
+ This option will take precedence over the -j and -k options
+ -j, --low The low bound as in H5Pset_libver_bounds()
+ -k, --high The high bound as in H5Pset_libver_bounds()
-c L1, --compact=L1 Maximum number of links in header messages
-d L2, --indexed=L2 Minimum number of links in the indexed format
-s S[:F], --ssize=S[:F] Shared object header message minimum size
diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake
index b9095fb..942ae7a 100644
--- a/tools/test/misc/CMakeTestsClear.cmake
+++ b/tools/test/misc/CMakeTestsClear.cmake
@@ -55,6 +55,8 @@
##############################################################################
##############################################################################
+ # Need special dependencies for tests that use the same reference file
+ # This is an issue on Windows
macro (ADD_H5_CMP testname resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
@@ -64,6 +66,9 @@
testfiles/${testname}.out
testfiles/${testname}.out.err
)
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
+ endif ()
add_test (
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
@@ -76,6 +81,7 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects)
+ set (last_test "H5CLEAR_CMP-${testname}")
endif ()
endmacro ()
diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake
index 2bd8d46..450667a 100644
--- a/tools/test/perform/CMakeTests.cmake
+++ b/tools/test/perform/CMakeTests.cmake
@@ -167,13 +167,12 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS PERFORM_zip_perf_help)
-set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects")
if (H5_HAVE_PARALLEL)
- add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf>)
+ add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:h5perf> ${MPIEXEC_POSTFLAGS})
if (HDF5_BUILD_PERFORM_STANDALONE)
- add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf_alone>)
+ add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:h5perf_alone> ${MPIEXEC_POSTFLAGS})
endif ()
endif ()