diff options
Diffstat (limited to 'tools/lib/h5diff_dset.c')
-rw-r--r-- | tools/lib/h5diff_dset.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 9c7368f..868eedf 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -235,40 +235,14 @@ hsize_t diff_datasetid( hid_t dset1_id, } /*------------------------------------------------------------------------- - * only attempt to compare if possible - *------------------------------------------------------------------------- - */ - if (cmp) - { - -/*------------------------------------------------------------------------- - * get number of elements - *------------------------------------------------------------------------- - */ - nelmts1 = 1; - for (i = 0; i < rank1; i++) - { - nelmts1 *= dims1[i]; - } - - nelmts2 = 1; - for (i = 0; i < rank2; i++) - { - nelmts2 *= dims2[i]; - } - - /* only assert if the space is the same */ - assert(nelmts1==nelmts2); - -/*------------------------------------------------------------------------- * memory type and sizes *------------------------------------------------------------------------- */ if ((m_type1=h5tools_get_native_type(f_type1))<0) - goto error; - + goto error; + if ((m_type2=h5tools_get_native_type(f_type2))<0) - goto error; + goto error; m_size1 = H5Tget_size( m_type1 ); m_size2 = H5Tget_size( m_type2 ); @@ -282,7 +256,7 @@ hsize_t diff_datasetid( hid_t dset1_id, * check for different signed/unsigned types *------------------------------------------------------------------------- */ - + sign1=H5Tget_sign(m_type1); sign2=H5Tget_sign(m_type2); if ( sign1 != sign2 ) @@ -297,6 +271,32 @@ hsize_t diff_datasetid( hid_t dset1_id, } /*------------------------------------------------------------------------- + * only attempt to compare if possible + *------------------------------------------------------------------------- + */ + if (cmp) + { + +/*------------------------------------------------------------------------- + * get number of elements + *------------------------------------------------------------------------- + */ + nelmts1 = 1; + for (i = 0; i < rank1; i++) + { + nelmts1 *= dims1[i]; + } + + nelmts2 = 1; + for (i = 0; i < rank2; i++) + { + nelmts2 *= dims2[i]; + } + + /* only assert if the space is the same */ + assert(nelmts1==nelmts2); + +/*------------------------------------------------------------------------- * "upgrade" the smaller memory size *------------------------------------------------------------------------- */ |