diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-07-21 17:50:49 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-07-21 17:50:49 (GMT) |
commit | 140dfae48a286c2f2a185594ceb49d4c61aa6465 (patch) | |
tree | 3d2a6c376670b951b76d067f33cc7ab1a87ed2a8 /tools/lib/h5diff_attr.c | |
parent | 50a853d807e65a9f2ecdca12bd698fbafe1d97fa (diff) | |
download | hdf5-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_attr.c')
-rw-r--r-- | tools/lib/h5diff_attr.c | 73 |
1 files changed, 62 insertions, 11 deletions
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index bf3a874..6aedaf5 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -189,7 +189,12 @@ int diff_attr(hid_t loc1_id, */ sprintf(name1,"%s of <%s>",name1,path1); sprintf(name2,"%s of <%s>",name2,path2); - nfound = diff_array(buf1, + + /* always print name */ + if (options->m_verbose) + { + printf( "Attribute: <%s> and <%s>\n",name1,name2); + nfound = diff_array(buf1, buf2, nelmts1, rank1, @@ -200,18 +205,64 @@ int diff_attr(hid_t loc1_id, mtype1_id, attr1_id, attr2_id); - - }/*cmp*/ - -/*------------------------------------------------------------------------- - * print how many differences were found - *------------------------------------------------------------------------- - */ - if (print_objname(options,nfound)) - { - printf( "Attribute: <%s> and <%s>\n",name1,name2); print_found(nfound); + } + /* check first if we have differences */ + else + { + if (options->m_quiet==0) + { + /* shut up temporarily */ + options->m_quiet=1; + nfound = diff_array(buf1, + buf2, + nelmts1, + rank1, + dims1, + options, + name1, + name2, + mtype1_id, + attr1_id, + attr2_id); + /* print again */ + options->m_quiet=0; + if (nfound) + { + printf( "Attribute: <%s> and <%s>\n",name1,name2); + nfound = diff_array(buf1, + buf2, + nelmts1, + rank1, + dims1, + options, + name1, + name2, + mtype1_id, + attr1_id, + attr2_id); + print_found(nfound); + } /*if*/ + } /*if*/ + /* in quiet mode, just count differences */ + else + { + nfound = diff_array(buf1, + buf2, + nelmts1, + rank1, + dims1, + options, + name1, + name2, + mtype1_id, + attr1_id, + attr2_id); + } /*else quiet */ + } /*else verbose */ + }/*cmp*/ + /*------------------------------------------------------------------------- |