diff options
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5diff_array.c | 225 | ||||
-rw-r--r-- | tools/lib/h5diff_dset.c | 202 |
2 files changed, 279 insertions, 148 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index f17a364..abf1f74 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -52,7 +52,8 @@ /* local functions */ static void close_obj(H5G_obj_t obj_type, hid_t obj_id); -static int diff_region(hid_t region1_id, hid_t region2_id); +static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, + hid_t region1_id, hid_t region2_id, diff_opt_t *options); static hbool_t is_zero(const void *_mem, size_t size); static int ull2float(unsigned long_long ull_value, float *f_value); @@ -344,8 +345,6 @@ hsize_t diff_datum(void *_mem1, H5G_obj_t obj2_type; hid_t obj1_id; hid_t obj2_id; - H5G_stat_t sb1; - H5G_stat_t sb2; hsize_t nfound=0; /* differences found */ int ret=0; /* check return error */ float f1, f2, per; @@ -606,10 +605,10 @@ hsize_t diff_datum(void *_mem1, iszero1=is_zero(_mem1, H5Tget_size(m_type)); iszero2=is_zero(_mem2, H5Tget_size(m_type)); - if (iszero1==1 && iszero2==1) + if (iszero1==1 || iszero2==1) + { return 0; - else if (iszero1!=iszero2) - return 1; + } else { @@ -628,10 +627,6 @@ hsize_t diff_datum(void *_mem1, ret= -1; if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2))<0) ret= -1; - if (H5Gget_objinfo(obj1_id, ".", FALSE, &sb1)<0) - ret= -1; - if (H5Gget_objinfo(obj2_id, ".", FALSE, &sb2)<0) - ret= -1; if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1))<0) ret= -1; if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2))<0) @@ -642,10 +637,7 @@ hsize_t diff_datum(void *_mem1, return 0; } - if (diff_region(region1_id,region2_id)) - { - parallel_print("Different region referenced\n"); - } + nfound = diff_region(obj1_id,obj2_id,region1_id,region2_id,options); close_obj(H5G_DATASET,obj1_id); close_obj(H5G_DATASET,obj2_id); @@ -676,7 +668,8 @@ hsize_t diff_datum(void *_mem1, if (obj1_type!=obj2_type) { parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); - return 1; + options->not_cmp=1; + return 0; } if ((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1))<0) @@ -688,7 +681,7 @@ hsize_t diff_datum(void *_mem1, return 0; } - /*deep compare */ + /* compare */ switch (obj1_type) { case H5G_DATASET: nfound=diff_datasetid(obj1_id, @@ -1716,29 +1709,97 @@ static void close_obj(H5G_obj_t obj_type, hid_t obj_id) break; } } + +/*------------------------------------------------------------------------- + * Function: print_region_block + * + * Purpose: print start coordinates and opposite corner of a region block + * + * Return: void + * + *------------------------------------------------------------------------- + */ + +static +void print_region_block(int i, hsize_t *ptdata, int ndims) +{ + int j; + + parallel_print(" "); + for (j = 0; j < ndims; j++) + parallel_print("%s%lu", j ? "," : " (", + (unsigned long)ptdata[i * 2 * ndims + j]); + for (j = 0; j < ndims; j++) + parallel_print("%s%lu", j ? "," : ")-(", + (unsigned long)ptdata[i * 2 * ndims + j + ndims]); + parallel_print(")"); + +} + + +/*------------------------------------------------------------------------- + * Function: print_points + * + * Purpose: print points of a region reference + * + * Return: void + * + *------------------------------------------------------------------------- + */ + +static +void print_points(int i, hsize_t *ptdata, int ndims) +{ + int j; + + parallel_print(" "); + for (j = 0; j < ndims; j++) + parallel_print("%s%lu", j ? "," : "(", + (unsigned long)(ptdata[i * ndims + j])); + parallel_print(")"); + +} /*------------------------------------------------------------------------- * Function: diff_region * * Purpose: diff a dataspace region * - * Return: 0, diff not found, 1 found + * Return: number of differences * *------------------------------------------------------------------------- */ -static int diff_region(hid_t region1_id, - hid_t region2_id) +static +hsize_t diff_region(hid_t obj1_id, + hid_t obj2_id, + hid_t region1_id, + hid_t region2_id, + diff_opt_t *options) { - hssize_t nblocks1, npoints1; - hssize_t nblocks2, npoints2; - hsize_t alloc_size; - hsize_t *ptdata1; - hsize_t *ptdata2; - int ndims1 = H5Sget_simple_extent_ndims(region1_id); - int ndims2 = H5Sget_simple_extent_ndims(region2_id); - int ret=0; + hssize_t nblocks1, npoints1; + hssize_t nblocks2, npoints2; + H5G_stat_t sb1; + H5G_stat_t sb2; + hsize_t alloc_size; + hsize_t *ptdata1; + hsize_t *ptdata2; + int ndims1; + int ndims2; + int i, j, ret; + haddr_t objno1, objno2; /* compact form of object's location */ + hsize_t nfound_b=0; /* block differences found */ + hsize_t nfound_p=0; /* point differences found */ + + ndims1 = H5Sget_simple_extent_ndims(region1_id); + ndims2 = H5Sget_simple_extent_ndims(region2_id); + + H5Gget_objinfo(obj1_id, ".", FALSE, &sb1); + H5Gget_objinfo(obj2_id, ".", FALSE, &sb2); + + objno1 = (haddr_t)sb1.objno[0] | ((haddr_t)sb1.objno[1] << (8 * sizeof(long))); + objno2 = (haddr_t)sb2.objno[0] | ((haddr_t)sb2.objno[1] << (8 * sizeof(long))); /* * These two functions fail if the region does not have blocks or points, @@ -1752,11 +1813,17 @@ static int diff_region(hid_t region1_id, npoints1 = H5Sget_select_elem_npoints(region1_id); npoints2 = H5Sget_select_elem_npoints(region2_id); } H5E_END_TRY; - + if (nblocks1!=nblocks2 || npoints1!=npoints2 || ndims1!=ndims2) - return 1; - - /* compare block information */ + { + options->not_cmp=1; + return 0; + } + +/*------------------------------------------------------------------------- + * compare block information + *------------------------------------------------------------------------- + */ if (nblocks1 > 0) { @@ -1771,32 +1838,50 @@ static int diff_region(hid_t region1_id, H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region2_id, (hsize_t)0, (hsize_t)nblocks2, ptdata2); - ret=HDmemcmp(ptdata1,ptdata2,(size_t)alloc_size); - -#if defined (H5DIFF_DEBUG) for (i = 0; i < nblocks1; i++) { - int j; - /* start coordinates and opposite corner */ for (j = 0; j < ndims1; j++) - parallel_print("%s%lu", j ? "," : "(", - (unsigned long)ptdata1[i * 2 * ndims1 + j]); - - for (j = 0; j < ndims1; j++) - parallel_print("%s%lu", j ? "," : ")-(", - (unsigned long)ptdata1[i * 2 * ndims1 + j + ndims1]); - - parallel_print(")\n"); + { + hsize_t start1, start2, end1, end2; + start1 = ptdata1[i * 2 * ndims1 + j]; + start2 = ptdata2[i * 2 * ndims1 + j]; + end1 = ptdata1[i * 2 * ndims1 + j + ndims1]; + end2 = ptdata2[i * 2 * ndims1 + j + ndims1]; + if (start1 != start2 || end1 != end2) + { + nfound_b++; + } + } } -#endif - + + /* print differences if found */ + if (nfound_b) + { + parallel_print("Referenced dataset %lu %lu\n", + (unsigned long)objno1,(unsigned long)objno2); + parallel_print("------------------------------------------------------------\n"); + + parallel_print("Region blocks\n"); + for (i = 0; i < nblocks1; i++) + { + parallel_print("block #%d", i); + print_region_block(i, ptdata1, ndims1); + print_region_block(i, ptdata2, ndims1); + parallel_print("\n"); + + } + } HDfree(ptdata1); HDfree(ptdata2); } - - /* Print point information */ + +/*------------------------------------------------------------------------- + * compare point information + *------------------------------------------------------------------------- + */ + if (npoints1 > 0) { alloc_size = npoints1 * ndims1 * sizeof(ptdata1[0]); @@ -1809,9 +1894,45 @@ static int diff_region(hid_t region1_id, ptdata2 = malloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2); - - ret=HDmemcmp(ptdata1,ptdata2,(size_t)alloc_size); - + + for (i = 0; i < npoints1; i++) + { + hsize_t pt1, pt2; + + for (j = 0; j < ndims1; j++) + { + pt1 = ptdata1[i * ndims1 + j]; + pt2 = ptdata2[i * ndims1 + j]; + if (pt1 != pt2) + nfound_p++; + } + } + + if (nfound_p) + { + parallel_print("Region points\n"); + for (i = 0; i < npoints1; i++) + { + hsize_t pt1, pt2; + int diff=0; + for (j = 0; j < ndims1; j++) + { + pt1 = ptdata1[i * ndims1 + j]; + pt2 = ptdata2[i * ndims1 + j]; + if (pt1 != pt2) + diff=1; + } + if (diff) + { + parallel_print("point #%d", i); + print_points(i, ptdata1, ndims1); + print_points(i, ptdata2, ndims1); + parallel_print("\n"); + } + } + } + + #if defined (H5DIFF_DEBUG) for (i = 0; i < npoints1; i++) { @@ -1833,7 +1954,7 @@ static int diff_region(hid_t region1_id, HDfree(ptdata2); } - return ret; + return (nfound_p + nfound_b)/2; } diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 3fd280c..ad49b1a 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -26,17 +26,20 @@ *------------------------------------------------------------------------- */ #if defined (H5DIFF_DEBUG) -void print_sizes( const char *obj1, const char *obj2, - hid_t f_type1, hid_t f_type2, - hid_t m_type1, hid_t m_type2 ) +void print_sizes( const char *obj1, + const char *obj2, + hid_t f_tid1, + hid_t f_tid2, + hid_t m_tid1, + hid_t m_tid2 ) { size_t f_size1, f_size2; /* size of type in file */ size_t m_size1, m_size2; /* size of type in memory */ - f_size1 = H5Tget_size( f_type1 ); - f_size2 = H5Tget_size( f_type2 ); - m_size1 = H5Tget_size( m_type1 ); - m_size2 = H5Tget_size( m_type2 ); + f_size1 = H5Tget_size( f_tid1 ); + f_size2 = H5Tget_size( f_tid2 ); + m_size1 = H5Tget_size( m_tid1 ); + m_size2 = H5Tget_size( m_tid2 ); printf("\n"); printf("------------------\n"); @@ -46,23 +49,23 @@ void print_sizes( const char *obj1, const char *obj2, printf("sizeof(long) %u\n", sizeof(long) ); printf("<%s> ------------------\n", obj1); printf("type on file "); - print_type(f_type1); + print_type(f_tid1); printf("\n"); printf("size on file %u\n", f_size1 ); printf("type on memory "); - print_type(m_type1); + print_type(m_tid1); printf("\n"); printf("size on memory %u\n", m_size1 ); printf("<%s> ------------------\n", obj2); printf("type on file "); - print_type(f_type2); + print_type(f_tid2); printf("\n"); printf("size on file %u\n", f_size2 ); printf("type on memory "); - print_type(m_type2); + print_type(m_tid2); printf("\n"); printf("size on memory %u\n", m_size2 ); printf("\n"); @@ -91,10 +94,10 @@ hsize_t diff_dataset( hid_t file1_id, const char *obj2_name, diff_opt_t *options ) { - hid_t dset1_id=-1; - hid_t dset2_id=-1; - hid_t dcpl1_id=-1; - hid_t dcpl2_id=-1; + hid_t did1; + hid_t did2; + hid_t dcpl1; + hid_t dcpl2; hsize_t nfound=0; /*------------------------------------------------------------------------- @@ -104,12 +107,12 @@ hsize_t diff_dataset( hid_t file1_id, /* disable error reporting */ H5E_BEGIN_TRY { /* Open the datasets */ - if ( (dset1_id = H5Dopen(file1_id,obj1_name)) < 0 ) + if ( (did1 = H5Dopen(file1_id,obj1_name)) < 0 ) { printf("Cannot open dataset <%s>\n", obj1_name ); goto error; } - if ( (dset2_id = H5Dopen(file2_id,obj2_name)) < 0 ) + if ( (did2 = H5Dopen(file2_id,obj2_name)) < 0 ) { printf("Cannot open dataset <%s>\n", obj2_name ); goto error; @@ -118,9 +121,9 @@ hsize_t diff_dataset( hid_t file1_id, } H5E_END_TRY; - if ((dcpl1_id=H5Dget_create_plist(dset1_id))<0) + if ((dcpl1=H5Dget_create_plist(did1))<0) goto error; - if ((dcpl2_id=H5Dget_create_plist(dset2_id))<0) + if ((dcpl2=H5Dget_create_plist(did2))<0) goto error; /*------------------------------------------------------------------------- @@ -130,14 +133,14 @@ hsize_t diff_dataset( hid_t file1_id, * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ - if ((h5tools_canreadf((options->m_verbose?obj1_name:NULL),dcpl1_id)==1) && - (h5tools_canreadf((options->m_verbose?obj2_name:NULL),dcpl2_id)==1)) + if ((h5tools_canreadf((options->m_verbose?obj1_name:NULL),dcpl1)==1) && + (h5tools_canreadf((options->m_verbose?obj2_name:NULL),dcpl2)==1)) { - nfound=diff_datasetid(dset1_id, - dset2_id, - obj1_name, - obj2_name, - options); + nfound=diff_datasetid(did1, + did2, + obj1_name, + obj2_name, + options); } /*------------------------------------------------------------------------- * close @@ -145,10 +148,10 @@ hsize_t diff_dataset( hid_t file1_id, */ /* disable error reporting */ H5E_BEGIN_TRY { - H5Pclose(dcpl1_id); - H5Pclose(dcpl2_id); - H5Dclose(dset1_id); - H5Dclose(dset2_id); + H5Pclose(dcpl1); + H5Pclose(dcpl2); + H5Dclose(did1); + H5Dclose(did2); /* enable error reporting */ } H5E_END_TRY; @@ -158,10 +161,10 @@ error: options->err_stat=1; /* disable error reporting */ H5E_BEGIN_TRY { - H5Pclose(dcpl1_id); - H5Pclose(dcpl2_id); - H5Dclose(dset1_id); - H5Dclose(dset2_id); + H5Pclose(dcpl1); + H5Pclose(dcpl2); + H5Dclose(did1); + H5Dclose(did2); /* enable error reporting */ } H5E_END_TRY; @@ -182,21 +185,28 @@ error: * *------------------------------------------------------------------------- */ -hsize_t diff_datasetid( hid_t dset1_id, - hid_t dset2_id, +hsize_t diff_datasetid( hid_t did1, + hid_t did2, const char *obj1_name, const char *obj2_name, diff_opt_t *options ) { - hid_t space1_id =-1; - hid_t space2_id =-1; - hid_t f_type1=-1, f_type2=-1; /* file data type */ - hid_t m_type1=-1, m_type2=-1; /* memory data type */ - size_t m_size1, m_size2; /* size of type in memory */ - H5T_sign_t sign1, sign2; /* sign of type */ - int rank1, rank2; - void *buf1=NULL, *buf2=NULL; - hsize_t nelmts1, nelmts2; + hid_t sid1; + hid_t sid2; + hid_t f_tid1; + hid_t f_tid2; /* file data type */ + hid_t m_tid1; + hid_t m_tid2; /* memory data type */ + size_t m_size1; + size_t m_size2; /* size of type in memory */ + H5T_sign_t sign1; + H5T_sign_t sign2; /* sign of type */ + int rank1; + int rank2; + void *buf1=NULL; + void *buf2=NULL; + hsize_t nelmts1; + hsize_t nelmts2; hsize_t dims1[H5S_MAX_RANK]; hsize_t dims2[H5S_MAX_RANK]; hsize_t maxdim1[H5S_MAX_RANK]; @@ -210,27 +220,27 @@ hsize_t diff_datasetid( hid_t dset1_id, int i; /* Get the dataspace handle */ - if ( (space1_id = H5Dget_space(dset1_id)) < 0 ) + if ( (sid1 = H5Dget_space(did1)) < 0 ) goto error; /* Get rank */ - if ( (rank1 = H5Sget_simple_extent_ndims(space1_id)) < 0 ) + if ( (rank1 = H5Sget_simple_extent_ndims(sid1)) < 0 ) goto error; /* Get the dataspace handle */ - if ( (space2_id = H5Dget_space(dset2_id)) < 0 ) + if ( (sid2 = H5Dget_space(did2)) < 0 ) goto error; /* Get rank */ - if ( (rank2 = H5Sget_simple_extent_ndims(space2_id)) < 0 ) + if ( (rank2 = H5Sget_simple_extent_ndims(sid2)) < 0 ) goto error; /* Get dimensions */ - if ( H5Sget_simple_extent_dims(space1_id,dims1,maxdim1) < 0 ) + if ( H5Sget_simple_extent_dims(sid1,dims1,maxdim1) < 0 ) goto error; /* Get dimensions */ - if ( H5Sget_simple_extent_dims(space2_id,dims2,maxdim2) < 0 ) + if ( H5Sget_simple_extent_dims(sid2,dims2,maxdim2) < 0 ) goto error; /*------------------------------------------------------------------------- @@ -239,11 +249,11 @@ hsize_t diff_datasetid( hid_t dset1_id, */ /* Get the data type */ - if ( (f_type1 = H5Dget_type(dset1_id)) < 0 ) + if ( (f_tid1 = H5Dget_type(did1)) < 0 ) goto error; /* Get the data type */ - if ( (f_type2 = H5Dget_type(dset2_id)) < 0 ) + if ( (f_tid2 = H5Dget_type(did2)) < 0 ) goto error; @@ -252,8 +262,8 @@ hsize_t diff_datasetid( hid_t dset1_id, *------------------------------------------------------------------------- */ - storage_size1=H5Dget_storage_size(dset1_id); - storage_size2=H5Dget_storage_size(dset2_id); + storage_size1=H5Dget_storage_size(did1); + storage_size2=H5Dget_storage_size(did2); if (storage_size1<=0 && storage_size2<=0) { if (options->m_verbose && obj1_name && obj2_name) @@ -268,8 +278,8 @@ hsize_t diff_datasetid( hid_t dset1_id, *------------------------------------------------------------------------- */ - if (diff_can_type(f_type1, - f_type2, + if (diff_can_type(f_tid1, + f_tid2, rank1, rank2, dims1, @@ -288,18 +298,18 @@ hsize_t diff_datasetid( hid_t dset1_id, * memory type and sizes *------------------------------------------------------------------------- */ - if ((m_type1=h5tools_get_native_type(f_type1))<0) + if ((m_tid1=h5tools_get_native_type(f_tid1))<0) goto error; - if ((m_type2=h5tools_get_native_type(f_type2))<0) + if ((m_tid2=h5tools_get_native_type(f_tid2))<0) goto error; - m_size1 = H5Tget_size( m_type1 ); - m_size2 = H5Tget_size( m_type2 ); + m_size1 = H5Tget_size( m_tid1 ); + m_size2 = H5Tget_size( m_tid2 ); #if defined (H5DIFF_DEBUG) if (obj1_name) - print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2); + print_sizes(obj1_name,obj2_name,f_tid1,f_tid2,m_tid1,m_tid2); #endif /*------------------------------------------------------------------------- @@ -307,8 +317,8 @@ hsize_t diff_datasetid( hid_t dset1_id, *------------------------------------------------------------------------- */ - sign1=H5Tget_sign(m_type1); - sign2=H5Tget_sign(m_type2); + sign1=H5Tget_sign(m_tid1); + sign2=H5Tget_sign(m_tid2); if ( sign1 != sign2 ) { if (options->m_verbose && obj1_name) { @@ -355,26 +365,26 @@ hsize_t diff_datasetid( hid_t dset1_id, { if ( m_size1 < m_size2 ) { - H5Tclose(m_type1); + H5Tclose(m_tid1); - if ((m_type1=h5tools_get_native_type(f_type2))<0) + if ((m_tid1=h5tools_get_native_type(f_tid2))<0) goto error; - m_size1 = H5Tget_size( m_type1 ); + m_size1 = H5Tget_size( m_tid1 ); } else { - H5Tclose(m_type2); + H5Tclose(m_tid2); - if ((m_type2=h5tools_get_native_type(f_type1))<0) + if ((m_tid2=h5tools_get_native_type(f_tid1))<0) goto error; - m_size2 = H5Tget_size( m_type2 ); + m_size2 = H5Tget_size( m_tid2 ); } #if defined (H5DIFF_DEBUG) printf("WARNING: Size was upgraded\n"); if (obj1_name) - print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2); + print_sizes(obj1_name,obj2_name,f_tid1,f_tid2,m_tid1,m_tid2); #endif } assert(m_size1==m_size2); @@ -394,10 +404,10 @@ hsize_t diff_datasetid( hid_t dset1_id, *------------------------------------------------------------------------- */ - if ( H5Dread(dset1_id,m_type1,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf1) < 0 ) + if ( H5Dread(did1,m_tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf1) < 0 ) goto error; - if ( H5Dread(dset2_id,m_type2,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf2) < 0 ) + if ( H5Dread(did2,m_tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf2) < 0 ) goto error; /*------------------------------------------------------------------------- @@ -418,9 +428,9 @@ hsize_t diff_datasetid( hid_t dset1_id, options, name1, name2, - m_type1, - dset1_id, - dset2_id); + m_tid1, + did1, + did2); /*------------------------------------------------------------------------- * compare attributes * the if condition refers to cases when the dataset is a referenced object @@ -428,7 +438,7 @@ hsize_t diff_datasetid( hid_t dset1_id, */ if (obj1_name) - diff_attr(dset1_id,dset2_id,obj1_name,obj2_name,options); + diff_attr(did1,did2,obj1_name,obj2_name,options); }/*cmp*/ @@ -443,12 +453,12 @@ hsize_t diff_datasetid( hid_t dset1_id, /* close */ /* disable error reporting */ H5E_BEGIN_TRY { - H5Sclose(space1_id); - H5Sclose(space2_id); - H5Tclose(f_type1); - H5Tclose(f_type2); - H5Tclose(m_type1); - H5Tclose(m_type2); + H5Sclose(sid1); + H5Sclose(sid2); + H5Tclose(f_tid1); + H5Tclose(f_tid2); + H5Tclose(m_tid1); + H5Tclose(m_tid2); /* enable error reporting */ } H5E_END_TRY; @@ -461,12 +471,12 @@ error: /* close */ /* disable error reporting */ H5E_BEGIN_TRY { - H5Sclose(space1_id); - H5Sclose(space2_id); - H5Tclose(f_type1); - H5Tclose(f_type2); - H5Tclose(m_type1); - H5Tclose(m_type2); + H5Sclose(sid1); + H5Sclose(sid2); + H5Tclose(f_tid1); + H5Tclose(f_tid2); + H5Tclose(m_tid1); + H5Tclose(m_tid2); /* enable error reporting */ } H5E_END_TRY; @@ -490,8 +500,8 @@ error: *------------------------------------------------------------------------- */ -int diff_can_type( hid_t f_type1, /* file data type */ - hid_t f_type2, /* file data type */ +int diff_can_type( hid_t f_tid1, /* file data type */ + hid_t f_tid2, /* file data type */ int rank1, int rank2, hsize_t *dims1, @@ -515,10 +525,10 @@ int diff_can_type( hid_t f_type1, /* file data type */ *------------------------------------------------------------------------- */ - if ((tclass1=H5Tget_class(f_type1))<0) + if ((tclass1=H5Tget_class(f_tid1))<0) return -1; - if ((tclass2=H5Tget_class(f_type2))<0) + if ((tclass2=H5Tget_class(f_tid2))<0) return -1; if ( tclass1 != tclass2 ) @@ -564,14 +574,14 @@ int diff_can_type( hid_t f_type1, /* file data type */ *------------------------------------------------------------------------- */ - if ( (H5Tequal(f_type1, f_type2)==0) && options->m_verbose && obj1_name) + if ( (H5Tequal(f_tid1, f_tid2)==0) && options->m_verbose && obj1_name) { printf("warning: different storage datatype\n"); printf("<%s> has file datatype ", obj1_name); - print_type(f_type1); + print_type(f_tid1); printf("\n"); printf("<%s> has file datatype ", obj2_name); - print_type(f_type2); + print_type(f_tid2); printf("\n"); } |