summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_dset.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2006-03-21 16:01:42 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2006-03-21 16:01:42 (GMT)
commitbd73819e2682bebcde6e9c3f1183acdb9608e6ce (patch)
tree436dc84e3f19b13b9ca7346d3fc74dceed22678a /tools/lib/h5diff_dset.c
parent2db47ff504a58278019957f9e5bc446d58894fed (diff)
downloadhdf5-bd73819e2682bebcde6e9c3f1183acdb9608e6ce.zip
hdf5-bd73819e2682bebcde6e9c3f1183acdb9608e6ce.tar.gz
hdf5-bd73819e2682bebcde6e9c3f1183acdb9608e6ce.tar.bz2
[svn-r12126] Purpose:
bug fix Description: the compare check for the datatype sign was not done in the correct place, causing invalid comparisons to be made Solution: put it on the correct place Platforms tested: linux 32, 64 AIX Misc. update:
Diffstat (limited to 'tools/lib/h5diff_dset.c')
-rw-r--r--tools/lib/h5diff_dset.c60
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
*-------------------------------------------------------------------------
*/