summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-07-21 17:50:49 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-07-21 17:50:49 (GMT)
commit140dfae48a286c2f2a185594ceb49d4c61aa6465 (patch)
tree3d2a6c376670b951b76d067f33cc7ab1a87ed2a8 /tools/lib/h5diff.c
parent50a853d807e65a9f2ecdca12bd698fbafe1d97fa (diff)
downloadhdf5-140dfae48a286c2f2a185594ceb49d4c61aa6465.zip
hdf5-140dfae48a286c2f2a185594ceb49d4c61aa6465.tar.gz
hdf5-140dfae48a286c2f2a185594ceb49d4c61aa6465.tar.bz2
[svn-r8912] Purpose:
bug fixes Description: the return error code for a function was not initialized. in HP-UX it happened that this variable was initialized to -1 causing the function to return with an error condtion solution : initialized the variable to 0 the name of the dataset was printed after the differences in verbose mode and report when differences were found solution : check first if differences were found and then print the name of dataset and differences in verbose mode always print the name first Solution: Platforms tested: linux aix solaris Misc. update:
Diffstat (limited to 'tools/lib/h5diff.c')
-rw-r--r--tools/lib/h5diff.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 818bc40..f5ba995 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -432,9 +432,39 @@ hsize_t diff( hid_t file1_id,
*-------------------------------------------------------------------------
*/
case H5G_DATASET:
- nfound=diff_dataset(file1_id,file2_id,path1,path2,options);
- if (print_objname(options,nfound))
+
+ /* always print name */
+ if (options->m_verbose)
+ {
+ if (print_objname(options,1))
printf( "Dataset: <%s> and <%s>\n",path1,path2);
+ nfound=diff_dataset(file1_id,file2_id,path1,path2,options);
+
+ }
+ /* check first if we have differences */
+ else
+ {
+ if (options->m_quiet==0)
+ {
+ /* shut up temporarily */
+ options->m_quiet=1;
+ nfound=diff_dataset(file1_id,file2_id,path1,path2,options);
+ /* print again */
+ options->m_quiet=0;
+ if (nfound)
+ {
+ if (print_objname(options,nfound))
+ printf( "Dataset: <%s> and <%s>\n",path1,path2);
+ nfound=diff_dataset(file1_id,file2_id,path1,path2,options);
+ } /*if*/
+ } /*if*/
+ /* in quiet mode, just count differences */
+ else
+ {
+ nfound=diff_dataset(file1_id,file2_id,path1,path2,options);
+ }
+ }/*else*/
+
break;
/*-------------------------------------------------------------------------