From 2d011283a352d0a972c66155b2981a2e66c87e39 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Wed, 3 Dec 2003 10:35:32 -0500 Subject: [svn-r7908] Purpose: code clean, bug fix Description: cleaned warnings on IRIX fixed bug in parse command line Solution: Platforms tested: linux IRIX 6.5 64 Misc. update: --- tools/h5diff/h5diff_main.c | 7 ++++++- tools/lib/h5diff_array.c | 2 +- tools/lib/h5diff_attr.c | 4 ++-- tools/lib/h5diff_dset.c | 3 --- tools/lib/h5trav.c | 2 +- tools/lib/h5trav.h | 17 ++++++++++++++--- tools/lib/h5trav_table.c | 12 ++++++++---- tools/testfiles/h5diff_12.txt | 7 ++++++- tools/testfiles/h5diff_625.txt | 6 ++++-- tools/testfiles/h5diff_626.txt | 7 +++++-- tools/testfiles/h5diff_627.txt | 10 ++++++++-- tools/testfiles/h5diff_628.txt | 5 +++-- 12 files changed, 58 insertions(+), 24 deletions(-) diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 58fc9a9..0fb0576 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -118,6 +118,7 @@ int main(int argc, const char *argv[]) usage(); } options.delta = atof(argv[i+1]); + i++; /* go to next */ } else { @@ -135,6 +136,7 @@ int main(int argc, const char *argv[]) usage(); } options.percent = atof(argv[i+1]); + i++; /* go to next */ } break; case 'n': @@ -147,6 +149,7 @@ int main(int argc, const char *argv[]) usage(); } options.count = atoi(argv[i+1]); + i++; /* go to next */ } break; } /*switch*/ @@ -166,9 +169,11 @@ int main(int argc, const char *argv[]) if ( objname2==NULL ) { /* check if we have a second object name */ - if ( i+1 and <%s, %d>", + HDfprintf(stdout,"Different OIDs in reference: <%s, %Hu> and <%s, %Hu>", obj1, sb1.objno, obj2, sb2.objno); nfound = 1; } diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index c2e36ef..c1dc945 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -156,9 +156,9 @@ int diff_attr(hid_t loc1_id, goto error; if ((mtype2_id=H5Tget_native_type(ftype2_id,H5T_DIR_DEFAULT))<0) goto error; - if ((msize1=H5Tget_size(mtype1_id))<0) + if ((msize1=H5Tget_size(mtype1_id))==0) goto error; - if ((msize2=H5Tget_size(mtype2_id))<0) + if ((msize2=H5Tget_size(mtype2_id))==0) goto error; assert(msize1==msize2); diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 13dfe5f..2e4cd67 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -414,9 +414,6 @@ int diff_can_type( hid_t f_type1, /* file data type */ H5T_class_t tclass1; H5T_class_t tclass2; - int nfound=0; /* number of differences found */ - const char *name1=NULL; /* relative names */ - const char *name2=NULL; int maxdim_diff=0; /* maximum dimensions are different */ int dim_diff=0; /* current dimensions are different */ int i; diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index ba74b6c..8d51ac4 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -282,7 +282,7 @@ int traverse( hid_t loc_id, { char *name=NULL; - int type; + H5G_obj_t type; int nobjs; int i; char *path=NULL; diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index cb61cd1..15c82ca 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -84,10 +84,21 @@ void h5trav_freeinfo( trav_info_t *info, int nobjs ); */ void trav_table_init(trav_table_t **table); + void trav_table_free(trav_table_t *table); -int trav_table_search(haddr_t objno, trav_table_t *table ); -void trav_table_add(haddr_t objno, char *objname, int type, trav_table_t *table); -void trav_table_addflags(unsigned *flags, char *objname, int type, trav_table_t *table); + +int trav_table_search(haddr_t objno, + trav_table_t *table ); + +void trav_table_add(haddr_t objno, + char *objname, + H5G_obj_t type, + trav_table_t *table); + +void trav_table_addflags(unsigned *flags, + char *objname, + H5G_obj_t type, + trav_table_t *table); diff --git a/tools/lib/h5trav_table.c b/tools/lib/h5trav_table.c index 8d29c7c..bbbe2d6 100644 --- a/tools/lib/h5trav_table.c +++ b/tools/lib/h5trav_table.c @@ -56,8 +56,10 @@ int trav_table_search(haddr_t objno, trav_table_t *table ) *------------------------------------------------------------------------- */ -void -trav_table_add(haddr_t objno, char *objname, int type, trav_table_t *table) +void trav_table_add(haddr_t objno, + char *objname, + H5G_obj_t type, + trav_table_t *table) { int i; @@ -98,8 +100,10 @@ trav_table_add(haddr_t objno, char *objname, int type, trav_table_t *table) *------------------------------------------------------------------------- */ -void -trav_table_addflags(unsigned *flags, char *objname, int type, trav_table_t *table) +void trav_table_addflags(unsigned *flags, + char *objname, + H5G_obj_t type, + trav_table_t *table) { int i; diff --git a/tools/testfiles/h5diff_12.txt b/tools/testfiles/h5diff_12.txt index 5c53bb7..ad9afa4 100644 --- a/tools/testfiles/h5diff_12.txt +++ b/tools/testfiles/h5diff_12.txt @@ -2,5 +2,10 @@ Expected output for 'h5diff file1.h5 file2.h5 -v -n 2 g1/dset1 g1/dset2' ############################# $h5diff file1.h5 file2.h5 -v -n 2 g1/dset1 g1/dset2 -Object <2> could not be found in +Dataset: and +position dset1 dset2 difference +------------------------------------------------------------ +[ 0 1 ] 1.000000 1.100000 0.100000 +[ 1 0 ] 1.000000 1.010000 0.010000 +2 differences found diff --git a/tools/testfiles/h5diff_625.txt b/tools/testfiles/h5diff_625.txt index 7aab196..cb46e93 100644 --- a/tools/testfiles/h5diff_625.txt +++ b/tools/testfiles/h5diff_625.txt @@ -1,6 +1,8 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 2 g1/dset3 g1/dset4' ############################# -Object <2> could not be found in -Object could not be found in +position dset3 dset4 difference +------------------------------------------------------------ +[ 0 0 ] 100.000000 110.000000 10.000000 +[ 0 1 ] 110.000000 100.000000 10.000000 diff --git a/tools/testfiles/h5diff_626.txt b/tools/testfiles/h5diff_626.txt index 498f9df..919cd2a 100644 --- a/tools/testfiles/h5diff_626.txt +++ b/tools/testfiles/h5diff_626.txt @@ -1,6 +1,9 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 2 -n 3 g1/dset3 g1/dset4' ############################# -Object <2> could not be found in -Object <2> could not be found in +position dset3 dset4 difference +------------------------------------------------------------ +[ 0 0 ] 100.000000 110.000000 10.000000 +[ 0 1 ] 110.000000 100.000000 10.000000 +[ 1 0 ] 100.000000 90.000000 10.000000 diff --git a/tools/testfiles/h5diff_627.txt b/tools/testfiles/h5diff_627.txt index 4e26443..9d1395a 100644 --- a/tools/testfiles/h5diff_627.txt +++ b/tools/testfiles/h5diff_627.txt @@ -1,6 +1,12 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 200 g1/dset3 g1/dset4' ############################# -Object <200> could not be found in -Object could not be found in +position dset3 dset4 difference +------------------------------------------------------------ +[ 0 0 ] 100.000000 110.000000 10.000000 +[ 0 1 ] 110.000000 100.000000 10.000000 +[ 1 0 ] 100.000000 90.000000 10.000000 +[ 1 1 ] 100.000000 80.000000 20.000000 +[ 2 0 ] 100.000000 140.000000 40.000000 +[ 2 1 ] 100.000000 200.000000 100.000000 diff --git a/tools/testfiles/h5diff_628.txt b/tools/testfiles/h5diff_628.txt index ddf9e7d..d21d04c 100644 --- a/tools/testfiles/h5diff_628.txt +++ b/tools/testfiles/h5diff_628.txt @@ -1,6 +1,7 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 1 g1/dset3 g1/dset4' ############################# -Object <1> could not be found in -Object could not be found in +position dset3 dset4 difference +------------------------------------------------------------ +[ 0 0 ] 100.000000 110.000000 10.000000 -- cgit v0.12