diff options
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 13d2353..79fefef 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -1826,8 +1826,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)); @@ -1848,8 +1848,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) { @@ -1878,8 +1881,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) { @@ -1928,8 +1934,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) { @@ -1993,8 +2002,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)); @@ -2015,8 +2024,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) { @@ -2046,8 +2058,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) { @@ -2096,8 +2111,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) { @@ -2164,8 +2182,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)); @@ -2186,8 +2204,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) { @@ -2217,8 +2238,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) { @@ -2267,8 +2291,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) { @@ -2756,8 +2783,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; /*------------------------------------------------------------------------- @@ -2776,8 +2803,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) { @@ -2814,8 +2844,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) { @@ -2873,8 +2906,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) { |