summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2009-11-20 18:56:01 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2009-11-20 18:56:01 (GMT)
commit8bcc914263522081b88b2bcb1bec3b824cafa30e (patch)
tree2f2de48dadc1a39b8b1239f74e51eed5ad282914 /tools/lib
parent5a821b959b947c5573e3d41fb0c16477634d8415 (diff)
downloadhdf5-8bcc914263522081b88b2bcb1bec3b824cafa30e.zip
hdf5-8bcc914263522081b88b2bcb1bec3b824cafa30e.tar.gz
hdf5-8bcc914263522081b88b2bcb1bec3b824cafa30e.tar.bz2
[svn-r17905] Purpose:
Fix Bug1672 - Display garbage value on LE machine for BE data. Description: Casuing by calling diff_dataset twice when -r or no option was given. Change to call it once which fix the problem. It also improves the performance. (diffing time in half) According further test, it also occurred on BE machine as well and it seems occruing only with the BE data attached to Bugzilla. Don't know how the file was created. Anyway this fix will prevent from diffing with garbage values in similiar potential case. Tested on: linux32 (jam) , linux64 (almani), solaris (linew)
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c50
1 files changed, 16 insertions, 34 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 5a4e2f2..7d11f2f 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -916,45 +916,27 @@ hsize_t diff(hid_t file1_id,
*-------------------------------------------------------------------------
*/
case H5TRAV_TYPE_DATASET:
- /*-------------------------------------------------------------------------
- * verbose, always print name
- *-------------------------------------------------------------------------
- */
- if(options->m_verbose)
+ /* verbose (-v) and report (-r) mode */
+ if(options->m_verbose || options->m_report)
{
- if(print_objname(options, (hsize_t)1))
- do_print_objname("dataset", path1, path2);
+ do_print_objname("dataset", path1, path2);
nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
print_found(nfound);
- } /* end if */
- /*-------------------------------------------------------------------------
- * non verbose, check first if we have differences by enabling quiet mode
- * so that printing is off, and compare again if differences found,
- * disabling quiet mode
- *-------------------------------------------------------------------------
- */
+ }
+ /* quiet mode (-q), just count differences */
+ else if(options->m_quiet)
+ {
+ nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
+ }
+ /* the rest (-c, none, ...) */
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))
- do_print_objname("dataset", path1, path2);
- nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
- print_found(nfound);
- } /* end if */
- } /* end if */
- /* in quiet mode, just count differences */
- else
- nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
- } /* end else */
+ do_print_objname("dataset", path1, path2);
+ nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
+ /* not comparable, no display the different number */
+ if (!options->not_cmp)
+ print_found(nfound);
+ }
break;
/*-------------------------------------------------------------------------