summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_util.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2003-12-02 23:13:27 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2003-12-02 23:13:27 (GMT)
commit486c13d307978ccbb9c2306c85c39a674ed56b96 (patch)
tree5c5863521d8acf6dd3c7d4db3880596fecad84de /tools/lib/h5diff_util.c
parent684db5595b5fa30633eb648f6e71a36d3857644a (diff)
downloadhdf5-486c13d307978ccbb9c2306c85c39a674ed56b96.zip
hdf5-486c13d307978ccbb9c2306c85c39a674ed56b96.tar.gz
hdf5-486c13d307978ccbb9c2306c85c39a674ed56b96.tar.bz2
[svn-r7904] Purpose:
h5diff new features Description: added comparison for attributes adeded comparison for all dataset datatypes added tests for the new features changed the output format Solution: Platforms tested: linux solaris 5.7 IRIX 6.5 (64) Misc. update:
Diffstat (limited to 'tools/lib/h5diff_util.c')
-rw-r--r--tools/lib/h5diff_util.c70
1 files changed, 20 insertions, 50 deletions
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 3340e2d..673b67f 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -16,47 +16,6 @@
#include <assert.h>
-
-/*-------------------------------------------------------------------------
- * Function: diff_can
- *
- * Purpose: Check if TYPE_ID is supported; only the listed types are
- * supported in the current version
- * Date: May 30, 2003
- *
- * Modifications: October 29, 2003
- * Added support for H5T_COMPOUND, H5T_STRING, H5T_ARRAY types;
- *
- *-------------------------------------------------------------------------
- */
-int diff_can(hid_t type_id)
-{
- int ret=0;
-
- if ( ((H5Tget_class(type_id) == H5T_COMPOUND)==1)|| /* get class */
- ((H5Tget_class(type_id) == H5T_STRING)==1)|| /* get class */
- ((H5Tget_class(type_id) == H5T_ARRAY)==1)|| /* get class */
-
- (H5Tequal(type_id, H5T_NATIVE_FLOAT)==1)||
- (H5Tequal(type_id, H5T_NATIVE_DOUBLE)==1)||
- (H5Tequal(type_id, H5T_NATIVE_INT)==1)||
- (H5Tequal(type_id, H5T_NATIVE_UINT)==1)||
- (H5Tequal(type_id, H5T_NATIVE_SCHAR)==1)||
- (H5Tequal(type_id, H5T_NATIVE_UCHAR)==1)||
- (H5Tequal(type_id, H5T_NATIVE_SHORT)==1)||
- (H5Tequal(type_id, H5T_NATIVE_USHORT)==1)||
- (H5Tequal(type_id, H5T_NATIVE_LONG)==1)||
- (H5Tequal(type_id, H5T_NATIVE_ULONG)==1)||
- (H5Tequal(type_id, H5T_NATIVE_LLONG)==1)||
- (H5Tequal(type_id, H5T_NATIVE_ULLONG)==1)
- )
- ret=1;
- return ret;
-}
-
-
-
-
/*-------------------------------------------------------------------------
* Function: print_pos
*
@@ -70,8 +29,14 @@ int diff_can(hid_t type_id)
*
*-------------------------------------------------------------------------
*/
-void print_pos( int *ph, int p, unsigned int curr_pos, int *acc,
- int *pos, int rank, const char *obj1, const char *obj2 )
+void print_pos( int *ph,
+ int per,
+ hsize_t curr_pos,
+ hsize_t *acc,
+ hsize_t *pos,
+ int rank,
+ const char *obj1,
+ const char *obj2 )
{
int i;
@@ -79,23 +44,28 @@ void print_pos( int *ph, int p, unsigned int curr_pos, int *acc,
if ( *ph==1 )
{
*ph=0;
- if (p)
+ if (per)
{
- printf("%-15s %-15s %-15s %-15s %-15s\n", "position", obj1, obj2, "difference",
+ printf("%-15s %-15s %-15s %-15s %-15s\n",
+ "position",
+ (obj1!=NULL) ? obj1 : " ",
+ (obj2!=NULL) ? obj2 : " ",
+ "difference",
"relative");
printf("------------------------------------------------------------------------\n");
}
else
{
- printf("%-15s %-15s %-15s %-20s\n", "position", obj1, obj2, "difference");
+ printf("%-15s %-15s %-15s %-20s\n",
+ "position",
+ (obj1!=NULL) ? obj1 : " ",
+ (obj2!=NULL) ? obj2 : " ",
+ "difference");
printf("------------------------------------------------------------\n");
}
}
for ( i = 0; i < rank; i++)
- pos[i]=0;
-
- for ( i = 0; i < rank; i++)
{
pos[i] = curr_pos/acc[i];
curr_pos -= acc[i]*pos[i];
@@ -105,7 +75,7 @@ void print_pos( int *ph, int p, unsigned int curr_pos, int *acc,
printf("[ " );
for ( i = 0; i < rank; i++)
{
- printf("%d ", pos[i] );
+ HDfprintf(stdout,"%Hu ", pos[i] );
}
printf("]" );
}