summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2009-01-14 21:43:26 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2009-01-14 21:43:26 (GMT)
commit2ad37c5958c85df03f28feb33c4251b64c042c59 (patch)
tree1ef0c5022d18575c4b253e6b92faf4bd5c4418f3 /tools
parentf677f9fbcfe035593cc1989c171215c43933b12d (diff)
downloadhdf5-2ad37c5958c85df03f28feb33c4251b64c042c59.zip
hdf5-2ad37c5958c85df03f28feb33c4251b64c042c59.tar.gz
hdf5-2ad37c5958c85df03f28feb33c4251b64c042c59.tar.bz2
[svn-r16320] merge 16319
add conditinal nan detection to some missing places tested: windows, linux
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5diff_array.c100
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)
{