diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2009-01-14 21:37:25 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2009-01-14 21:37:25 (GMT) |
commit | 60ab04d3835323a99ab93dd7c59cf364aa9f74cb (patch) | |
tree | 8644a92e56b3df442b978f3cba44aada9671e1cb /tools/lib/h5diff_array.c | |
parent | ea92781324c5ab1553d99e555f1bce477789e65b (diff) | |
download | hdf5-60ab04d3835323a99ab93dd7c59cf364aa9f74cb.zip hdf5-60ab04d3835323a99ab93dd7c59cf364aa9f74cb.tar.gz hdf5-60ab04d3835323a99ab93dd7c59cf364aa9f74cb.tar.bz2 |
[svn-r16319] add conditinal nan detection to some missing places
tested: windows, linux
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r-- | tools/lib/h5diff_array.c | 100 |
1 files changed, 68 insertions, 32 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index e5f065c..5481d23 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -1825,8 +1825,8 @@ hsize_t diff_datum(void *_mem1, { float temp1_float; float temp2_float; - int isnan1; - int isnan2; + int isnan1=0; + int isnan2=0; assert(type_size==sizeof(float)); @@ -1847,8 +1847,11 @@ hsize_t diff_datum(void *_mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_FLOAT,&temp1_float); + isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + } if ( !isnan1 && !isnan2) { @@ -1877,8 +1880,11 @@ hsize_t diff_datum(void *_mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_FLOAT,&temp1_float); + isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + } if ( !isnan1 && !isnan2) { @@ -1927,8 +1933,11 @@ hsize_t diff_datum(void *_mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_FLOAT,&temp1_float); + isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + } if ( !isnan1 && !isnan2) { @@ -1992,8 +2001,8 @@ hsize_t diff_datum(void *_mem1, { double temp1_double; double temp2_double; - int isnan1; - int isnan2; + int isnan1=0; + int isnan2=0; assert(type_size==sizeof(double)); @@ -2014,8 +2023,11 @@ hsize_t diff_datum(void *_mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + } if ( !isnan1 && !isnan2) { @@ -2045,8 +2057,11 @@ hsize_t diff_datum(void *_mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + } if ( !isnan1 && !isnan2) { @@ -2095,8 +2110,11 @@ hsize_t diff_datum(void *_mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + } if ( !isnan1 && !isnan2) { @@ -2163,8 +2181,8 @@ hsize_t diff_datum(void *_mem1, { long double temp1_double; long double temp2_double; - int isnan1; - int isnan2; + int isnan1=0; + int isnan2=0; assert(type_size==sizeof(long double)); @@ -2185,8 +2203,11 @@ hsize_t diff_datum(void *_mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + } if ( !isnan1 && !isnan2) { @@ -2216,8 +2237,11 @@ hsize_t diff_datum(void *_mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + } if ( !isnan1 && !isnan2) { @@ -2266,8 +2290,11 @@ hsize_t diff_datum(void *_mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + } if ( !isnan1 && !isnan2) { @@ -2755,8 +2782,8 @@ hsize_t diff_float(unsigned char *mem1, hsize_t i; double per; int both_zero; - int isnan1; - int isnan2; + int isnan1=0; + int isnan2=0; /*------------------------------------------------------------------------- @@ -2775,8 +2802,11 @@ hsize_t diff_float(unsigned char *mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_FLOAT,&temp1_float); + isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + } if ( !isnan1 && !isnan2) { @@ -2813,8 +2843,11 @@ hsize_t diff_float(unsigned char *mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_FLOAT,&temp1_float); + isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + } if ( !isnan1 && !isnan2) { @@ -2872,8 +2905,11 @@ hsize_t diff_float(unsigned char *mem1, * detect NaNs *------------------------------------------------------------------------- */ - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + if ( options->do_nans ) + { + isnan1 = my_isnan(FLT_FLOAT,&temp1_float); + isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + } if ( !isnan1 && !isnan2) { |