[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:
This commit is contained in:
Pedro Vicente Nunes
2006-03-21 11:01:42 -05:00
parent 2db47ff504
commit bd73819e26
5 changed files with 267 additions and 322 deletions

View File

@@ -234,6 +234,42 @@ hsize_t diff_datasetid( hid_t dset1_id,
options->not_cmp=1;
}
/*-------------------------------------------------------------------------
* memory type and sizes
*-------------------------------------------------------------------------
*/
if ((m_type1=h5tools_get_native_type(f_type1))<0)
goto error;
if ((m_type2=h5tools_get_native_type(f_type2))<0)
goto error;
m_size1 = H5Tget_size( m_type1 );
m_size2 = H5Tget_size( m_type2 );
#if defined (H5DIFF_DEBUG)
if (obj1_name)
print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2);
#endif
/*-------------------------------------------------------------------------
* check for different signed/unsigned types
*-------------------------------------------------------------------------
*/
sign1=H5Tget_sign(m_type1);
sign2=H5Tget_sign(m_type2);
if ( sign1 != sign2 )
{
if (options->m_verbose && obj1_name) {
parallel_print("Comparison not supported: <%s> has sign %s ", obj1_name, get_sign(sign1));
parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2));
}
cmp=0;
options->not_cmp=1;
}
/*-------------------------------------------------------------------------
* only attempt to compare if possible
*-------------------------------------------------------------------------
@@ -260,42 +296,6 @@ hsize_t diff_datasetid( hid_t dset1_id,
/* 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;
if ((m_type2=h5tools_get_native_type(f_type2))<0)
goto error;
m_size1 = H5Tget_size( m_type1 );
m_size2 = H5Tget_size( m_type2 );
#if defined (H5DIFF_DEBUG)
if (obj1_name)
print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2);
#endif
/*-------------------------------------------------------------------------
* check for different signed/unsigned types
*-------------------------------------------------------------------------
*/
sign1=H5Tget_sign(m_type1);
sign2=H5Tget_sign(m_type2);
if ( sign1 != sign2 )
{
if (options->m_verbose && obj1_name) {
parallel_print("Comparison not supported: <%s> has sign %s ", obj1_name, get_sign(sign1));
parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2));
}
cmp=0;
options->not_cmp=1;
}
/*-------------------------------------------------------------------------
* "upgrade" the smaller memory size
*-------------------------------------------------------------------------