diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-09-16 15:52:51 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-09-16 15:52:51 (GMT) |
commit | bdd7d59902483885dd8b883f3b2393e77383e5e8 (patch) | |
tree | aaf20ab132d057b95b3c016d50fc22b77719084b /tools/lib/h5diff_array.c | |
parent | 8bc0d5ed9019a681e1ea20c24264415d01c1cf2a (diff) | |
download | hdf5-bdd7d59902483885dd8b883f3b2393e77383e5e8.zip hdf5-bdd7d59902483885dd8b883f3b2393e77383e5e8.tar.gz hdf5-bdd7d59902483885dd8b883f3b2393e77383e5e8.tar.bz2 |
[svn-r15628] Description:
Remove trailing whitespace from C/C++ source files, with the following
script:
foreach f (*.[ch] *.cpp)
sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f
end
Tested on:
Mac OS X/32 10.5.5 (amazon)
No need for h5committest, just whitespace changes...
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r-- | tools/lib/h5diff_array.c | 1202 |
1 files changed, 601 insertions, 601 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index c5646ed..5250c3c 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -71,9 +71,9 @@ /*------------------------------------------------------------------------- * -p relative error formula * - * We assume the true value of a quantity to be A (value in first dataset) - * and the measured or inferred value to be B (value in second dataset). - * The relative error is defined by + * We assume the true value of a quantity to be A (value in first dataset) + * and the measured or inferred value to be B (value in second dataset). + * The relative error is defined by * * B - A * -------- @@ -138,7 +138,7 @@ static int ull2float(unsigned long_long ull_value, float *f_value); * NaN detection *------------------------------------------------------------------------- */ -typedef enum dtype_t +typedef enum dtype_t { FLT_FLOAT, FLT_DOUBLE, #if H5_SIZEOF_LONG_DOUBLE !=0 @@ -187,7 +187,7 @@ void print_pos( int *ph, /* print header */ const char *obj2 ) { int i; - + /* print header */ if ( *ph==1 ) { @@ -198,7 +198,7 @@ void print_pos( int *ph, /* print header */ parallel_print("%-11s",""); print_dimensions (rank,dims); parallel_print("\n"); - + if (pp) { parallel_print("%-15s %-15s %-15s %-15s %-15s\n", @@ -219,14 +219,14 @@ void print_pos( int *ph, /* print header */ parallel_print("------------------------------------------------------------\n"); } } /* end print header */ - + for ( i = 0; i < rank; i++) { pos[i] = curr_pos/acc[i]; curr_pos -= acc[i]*pos[i]; } assert( curr_pos == 0 ); - + parallel_print("[ " ); for ( i = 0; i < rank; i++) { @@ -272,11 +272,11 @@ hsize_t diff_array( void *_mem1, int ph=1; /* print header */ hsize_t i; int j; - - + + /* get the size. */ size = H5Tget_size( m_type ); - + acc[rank-1]=1; for(j=(rank-2); j>=0; j--) { @@ -284,7 +284,7 @@ hsize_t diff_array( void *_mem1, } for ( j = 0; j < rank; j++) pos[j]=0; - + if(H5Tis_variable_str(m_type)) { for ( i = 0; i < nelmts; i++) @@ -308,7 +308,7 @@ hsize_t diff_array( void *_mem1, return nfound; } /* i */ } - + else { switch (H5Tget_class(m_type)) @@ -316,22 +316,22 @@ hsize_t diff_array( void *_mem1, default: assert(0); break; - + /*------------------------------------------------------------------------- * float and integer atomic types *------------------------------------------------------------------------- */ - + case H5T_FLOAT: - - if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) + + if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) nfound=diff_float(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) nfound=diff_double(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); break; - + case H5T_INTEGER: - + if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) nfound=diff_schar(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) @@ -352,14 +352,14 @@ hsize_t diff_array( void *_mem1, nfound=diff_llong(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) nfound=diff_ullong(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); - + break; - + /*------------------------------------------------------------------------- * Other types than float and integer *------------------------------------------------------------------------- */ - + case H5T_COMPOUND: case H5T_STRING: case H5T_BITFIELD: @@ -368,7 +368,7 @@ hsize_t diff_array( void *_mem1, case H5T_ARRAY: case H5T_VLEN: case H5T_REFERENCE: - + for ( i = 0; i < nelmts; i++) { nfound+=diff_datum( @@ -391,7 +391,7 @@ hsize_t diff_array( void *_mem1, } /* i */ } /* switch */ } /* else */ - + return nfound; } @@ -467,9 +467,9 @@ hsize_t diff_datum(void *_mem1, float f1, f2; double per; int both_zero; - + type_size = H5Tget_size( m_type ); - + switch (H5Tget_class(m_type)) { default: @@ -478,7 +478,7 @@ hsize_t diff_datum(void *_mem1, case H5T_TIME: assert(0); break; - + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- @@ -509,7 +509,7 @@ hsize_t diff_datum(void *_mem1, H5Tclose(memb_type); } break; - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- @@ -519,7 +519,7 @@ hsize_t diff_datum(void *_mem1, { H5T_str_t pad; char *s; - + /* Get pointer to first string to compare */ s = (char *)mem1; @@ -530,9 +530,9 @@ hsize_t diff_datum(void *_mem1, size = HDstrlen(s); else size = H5Tget_size(m_type); - + pad = H5Tget_strpad(m_type); - + for (u=0; u<size && (s[u] || pad!=H5T_STR_NULLTERM); u++) nfound+=character_compare( mem1 + u, @@ -547,16 +547,16 @@ hsize_t diff_datum(void *_mem1, obj2, ph); } - + } break; - + /*------------------------------------------------------------------------- * H5T_BITFIELD *------------------------------------------------------------------------- */ case H5T_BITFIELD: - + /* byte-by-byte comparison */ for (u=0; u<type_size; u++) nfound+=character_compare_opt( @@ -571,15 +571,15 @@ hsize_t diff_datum(void *_mem1, obj1, obj2, ph); - + break; - + /*------------------------------------------------------------------------- * H5T_OPAQUE *------------------------------------------------------------------------- */ case H5T_OPAQUE: - + /* byte-by-byte comparison */ for (u=0; u<type_size; u++) nfound+=character_compare_opt( @@ -594,29 +594,29 @@ hsize_t diff_datum(void *_mem1, obj1, obj2, ph); - + break; - - + + /*------------------------------------------------------------------------- * H5T_ENUM *------------------------------------------------------------------------- */ case H5T_ENUM: - + /* For enumeration types we compare the names instead of the integer values. For each pair of elements being compared, we convert both bit patterns to their corresponding enumeration constant and do a string comparison */ - + { char enum_name1[1024]; char enum_name2[1024]; - + /* disable error reporting */ H5E_BEGIN_TRY { - + if ((H5Tenum_nameof(m_type, mem1, enum_name1, sizeof enum_name1) >= 0) && (H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2) >= 0)) { @@ -650,10 +650,10 @@ hsize_t diff_datum(void *_mem1, /* enable error reporting */ } H5E_END_TRY; } - - + + break; - + /*------------------------------------------------------------------------- * H5T_ARRAY *------------------------------------------------------------------------- @@ -669,7 +669,7 @@ hsize_t diff_datum(void *_mem1, ndims = H5Tget_array_ndims(m_type); H5Tget_array_dims2(m_type, adims); assert(ndims >= 1 && ndims <= H5S_MAX_RANK); - + /* calculate the number of array elements */ for (u = 0, nelmts = 1; u <ndims; u++) nelmts *= adims[u]; @@ -692,15 +692,15 @@ hsize_t diff_datum(void *_mem1, H5Tclose(memb_type); } break; - - + + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- */ - + case H5T_REFERENCE: - + iszero1=all_zero(_mem1, H5Tget_size(m_type)); iszero2=all_zero(_mem2, H5Tget_size(m_type)); if (iszero1 != iszero2) @@ -709,18 +709,18 @@ hsize_t diff_datum(void *_mem1, } else if (!iszero1 && !iszero2) { - + /*------------------------------------------------------------------------- * H5T_STD_REF_DSETREG * Dataset region reference *------------------------------------------------------------------------- */ - + if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) { hid_t region1_id; hid_t region2_id; - + if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1))<0) ret= -1; if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2))<0) @@ -729,22 +729,22 @@ hsize_t diff_datum(void *_mem1, ret= -1; if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2))<0) ret= -1; - + if (ret==-1) { options->err_stat=1; return 0; } - + nfound = diff_region(obj1_id,obj2_id,region1_id,region2_id,options); - + H5Oclose(obj1_id); H5Oclose(obj2_id); H5Sclose(region1_id); H5Sclose(region2_id); - + }/*dataset reference*/ - - + + /*------------------------------------------------------------------------- * H5T_STD_REF_OBJ * Object references. get the type and OID of the referenced object @@ -754,7 +754,7 @@ hsize_t diff_datum(void *_mem1, { H5O_type_t obj1_type; H5O_type_t obj2_type; - + if(H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) ret = -1; if(H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) @@ -763,7 +763,7 @@ hsize_t diff_datum(void *_mem1, options->err_stat = 1; return 0; } /* end if */ - + /* check object type */ if(obj1_type != obj2_type) { @@ -771,7 +771,7 @@ hsize_t diff_datum(void *_mem1, options->not_cmp = 1; return 0; } - + if((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1)) < 0) ret = -1; if((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2)) < 0) @@ -780,7 +780,7 @@ hsize_t diff_datum(void *_mem1, options->err_stat = 1; return 0; } /* end if */ - + /* compare */ if(obj1_type == H5O_TYPE_DATASET) nfound = diff_datasetid(obj1_id, @@ -793,31 +793,31 @@ hsize_t diff_datum(void *_mem1, obj1, obj2); options->not_cmp = 1; } - + H5Oclose(obj1_id); H5Oclose(obj2_id); - + }/*object reference*/ - + }/*is zero*/ - - + + break; /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - + case H5T_VLEN: - + /* get the VL sequences's base datatype for each element */ memb_type = H5Tget_super(m_type); size = H5Tget_size(memb_type); - + /* get the number of sequence elements */ nelmts = ((hvl_t *)mem1)->len; - + for (j = 0; j < (int)nelmts; j++) nfound+=diff_datum( ((char *)(((hvl_t *)mem1)->p)) + j * size, @@ -834,21 +834,21 @@ hsize_t diff_datum(void *_mem1, container1_id, container2_id, ph); - + H5Tclose(memb_type); - + break; - - + + /*------------------------------------------------------------------------- * H5T_INTEGER *------------------------------------------------------------------------- - */ - + */ + case H5T_INTEGER: - - + + /*------------------------------------------------------------------------- * H5T_NATIVE_SCHAR *------------------------------------------------------------------------- @@ -878,7 +878,7 @@ hsize_t diff_datum(void *_mem1, else if (!options->d && options->p) { PER(temp1_char,temp2_char); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -890,9 +890,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -908,7 +908,7 @@ hsize_t diff_datum(void *_mem1, else if ( options->d && options->p) { PER(temp1_char,temp2_char); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -920,9 +920,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_char-temp2_char) > options->delta ) { if ( print_data(options) ) @@ -944,9 +944,9 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_SCHAR*/ - + /*------------------------------------------------------------------------- * H5T_NATIVE_UCHAR *------------------------------------------------------------------------- @@ -956,7 +956,7 @@ hsize_t diff_datum(void *_mem1, unsigned char temp1_uchar; unsigned char temp2_uchar; assert(type_size==sizeof(unsigned char)); - + memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ @@ -977,7 +977,7 @@ hsize_t diff_datum(void *_mem1, else if (!options->d && options->p) { PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -989,9 +989,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -1007,7 +1007,7 @@ hsize_t diff_datum(void *_mem1, else if ( options->d && options->p) { PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1019,9 +1019,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta ) { if ( print_data(options) ) @@ -1043,21 +1043,21 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_UCHAR*/ - - + + /*------------------------------------------------------------------------- * H5T_NATIVE_SHORT *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_SHORT)) { short temp1_short; short temp2_short; assert(type_size==sizeof(short)); - + memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); /* -d and !-p */ @@ -1078,7 +1078,7 @@ hsize_t diff_datum(void *_mem1, else if (!options->d && options->p) { PER(temp1_short,temp2_short); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1090,9 +1090,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -1108,7 +1108,7 @@ hsize_t diff_datum(void *_mem1, else if ( options->d && options->p) { PER(temp1_short,temp2_short); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1120,9 +1120,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_short-temp2_short) > options->delta ) { if ( print_data(options) ) @@ -1144,21 +1144,21 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_SHORT*/ - + /*------------------------------------------------------------------------- * H5T_NATIVE_USHORT *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_USHORT)) { unsigned short temp1_ushort; unsigned short temp2_ushort; assert(type_size==sizeof(short)); - + memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); /* -d and !-p */ @@ -1166,7 +1166,7 @@ hsize_t diff_datum(void *_mem1, { if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta) { - + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); @@ -1180,7 +1180,7 @@ hsize_t diff_datum(void *_mem1, else if (!options->d && options->p) { PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1193,9 +1193,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -1211,7 +1211,7 @@ hsize_t diff_datum(void *_mem1, else if ( options->d && options->p) { PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1223,9 +1223,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta ) { if ( print_data(options) ) @@ -1248,19 +1248,19 @@ hsize_t diff_datum(void *_mem1, nfound++; } } /*H5T_NATIVE_USHORT*/ - - + + /*------------------------------------------------------------------------- * H5T_NATIVE_INT *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_INT)) { int temp1_int; int temp2_int; assert(type_size==sizeof(int)); - + memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); /* -d and !-p */ @@ -1281,7 +1281,7 @@ hsize_t diff_datum(void *_mem1, else if (!options->d && options->p) { PER(temp1_int,temp2_int); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1293,9 +1293,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -1311,7 +1311,7 @@ hsize_t diff_datum(void *_mem1, else if ( options->d && options->p) { PER(temp1_int,temp2_int); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1323,9 +1323,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_int-temp2_int) > options->delta ) { if ( print_data(options) ) @@ -1348,19 +1348,19 @@ hsize_t diff_datum(void *_mem1, nfound++; } } /*H5T_NATIVE_INT*/ - - + + /*------------------------------------------------------------------------- * H5T_NATIVE_UINT *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_UINT)) { unsigned int temp1_uint; unsigned int temp2_uint; assert(type_size==sizeof(int)); - + memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); /* -d and !-p */ @@ -1381,7 +1381,7 @@ hsize_t diff_datum(void *_mem1, else if (!options->d && options->p) { PER_UNSIGN(signed int,temp1_uint,temp2_uint); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1393,9 +1393,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -1411,7 +1411,7 @@ hsize_t diff_datum(void *_mem1, else if ( options->d && options->p) { PER_UNSIGN(signed int,temp1_uint,temp2_uint); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1423,9 +1423,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta ) { if ( print_data(options) ) @@ -1448,19 +1448,19 @@ hsize_t diff_datum(void *_mem1, nfound++; } } /*H5T_NATIVE_UINT*/ - - + + /*------------------------------------------------------------------------- * H5T_NATIVE_LONG *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_LONG)) { long temp1_long; long temp2_long; assert(type_size==sizeof(long)); - + memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); /* -d and !-p */ @@ -1481,7 +1481,7 @@ hsize_t diff_datum(void *_mem1, else if (!options->d && options->p) { PER(temp1_long,temp2_long); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1494,9 +1494,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -1512,7 +1512,7 @@ hsize_t diff_datum(void *_mem1, else if ( options->d && options->p) { PER(temp1_long,temp2_long); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1524,9 +1524,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_long-temp2_long) > options->delta ) { if ( print_data(options) ) @@ -1551,18 +1551,18 @@ hsize_t diff_datum(void *_mem1, nfound++; } } /*H5T_NATIVE_LONG*/ - + /*------------------------------------------------------------------------- * H5T_NATIVE_ULONG *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) { unsigned long temp1_ulong; unsigned long temp2_ulong; assert(type_size==sizeof(unsigned long)); - + memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); /* -d and !-p */ @@ -1583,7 +1583,7 @@ hsize_t diff_datum(void *_mem1, else if (!options->d && options->p) { PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1595,9 +1595,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -1613,7 +1613,7 @@ hsize_t diff_datum(void *_mem1, else if ( options->d && options->p) { PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1625,9 +1625,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta ) { if ( print_data(options) ) @@ -1649,21 +1649,21 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_ULONG*/ - + /*------------------------------------------------------------------------- * H5T_NATIVE_LLONG *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) { long_long temp1_llong; long_long temp2_llong; assert(type_size==sizeof(long_long)); - + memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); /* -d and !-p */ @@ -1684,7 +1684,7 @@ hsize_t diff_datum(void *_mem1, else if (!options->d && options->p) { PER(temp1_llong,temp2_llong); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1696,9 +1696,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -1714,7 +1714,7 @@ hsize_t diff_datum(void *_mem1, else if ( options->d && options->p) { PER(temp1_llong,temp2_llong); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1726,9 +1726,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_llong-temp2_llong) > options->delta ) { if ( print_data(options) ) @@ -1750,20 +1750,20 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_LLONG*/ - + /*------------------------------------------------------------------------- * H5T_NATIVE_ULLONG *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) { unsigned long_long temp1_ullong; unsigned long_long temp2_ullong; assert(type_size==sizeof(unsigned long_long)); - + memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); /* -d and !-p */ @@ -1786,7 +1786,7 @@ hsize_t diff_datum(void *_mem1, ull2float(temp1_ullong,&f1); ull2float(temp2_ullong,&f2); PER(f1,f2); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1798,12 +1798,12 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { - + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); @@ -1819,7 +1819,7 @@ hsize_t diff_datum(void *_mem1, ull2float(temp1_ullong,&f1); ull2float(temp2_ullong,&f2); PER(f1,f2); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1831,16 +1831,16 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long_long)options->delta ) { - + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - + parallel_print(SPACES); parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); } @@ -1857,22 +1857,22 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_ULLONG*/ - - + + break; /* H5T_INTEGER class */ - + /*------------------------------------------------------------------------- * H5T_FLOAT *------------------------------------------------------------------------- */ - + case H5T_FLOAT: - - - + + + /*------------------------------------------------------------------------- * H5T_NATIVE_FLOAT *------------------------------------------------------------------------- @@ -1889,7 +1889,7 @@ hsize_t diff_datum(void *_mem1, memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); - /* logic for detecting NaNs is different with options -d, -p and no options */ + /* logic for detecting NaNs is different with options -d, -p and no options */ /*------------------------------------------------------------------------- * -d and !-p @@ -1897,18 +1897,18 @@ hsize_t diff_datum(void *_mem1, */ if (options->d && !options->p) { - - + + /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ isnan1 = my_isnan(FLT_FLOAT,&temp1_float); isnan2 = my_isnan(FLT_FLOAT,&temp2_float); - + if ( !isnan1 && !isnan2) - { - + { + if (ABS(temp1_float-temp2_float) > options->delta) { if ( print_data(options) ) @@ -1919,7 +1919,7 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /* NaN */ } /*------------------------------------------------------------------------- @@ -1928,19 +1928,19 @@ hsize_t diff_datum(void *_mem1, */ else if (!options->d && options->p) { - + /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ isnan1 = my_isnan(FLT_FLOAT,&temp1_float); isnan2 = my_isnan(FLT_FLOAT,&temp2_float); - + if ( !isnan1 && !isnan2) - { - + { + PER(temp1_float,temp2_float); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -1952,9 +1952,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_float-temp2_float) > options->delta ) { if ( print_data(options) ) @@ -1967,7 +1967,7 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /* NaN */ } @@ -1975,22 +1975,22 @@ hsize_t diff_datum(void *_mem1, * -d and -p *------------------------------------------------------------------------- */ - + else if ( options->d && options->p) { - + /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ isnan1 = my_isnan(FLT_FLOAT,&temp1_float); isnan2 = my_isnan(FLT_FLOAT,&temp2_float); - + if ( !isnan1 && !isnan2) - { - + { + PER(temp1_float,temp2_float); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -2003,9 +2003,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -2013,22 +2013,22 @@ hsize_t diff_datum(void *_mem1, print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P,temp1_float,temp2_float, - ABS(temp1_float-temp2_float), + ABS(temp1_float-temp2_float), ABS(1-temp2_float/temp1_float)); } nfound++; } - + } /* NaN */ } - + /*------------------------------------------------------------------------- * no -d and -p *------------------------------------------------------------------------- */ else if (equal_float(temp1_float,temp2_float)==FALSE) { - + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); @@ -2038,12 +2038,12 @@ hsize_t diff_datum(void *_mem1, nfound++; } } /*H5T_NATIVE_FLOAT*/ - + /*------------------------------------------------------------------------- * H5T_NATIVE_DOUBLE *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) { double temp1_double; @@ -2053,11 +2053,11 @@ hsize_t diff_datum(void *_mem1, assert(type_size==sizeof(double)); - + memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - /* logic for detecting NaNs is different with options -d, -p and no options */ + /* logic for detecting NaNs is different with options -d, -p and no options */ /*------------------------------------------------------------------------- * -d and !-p @@ -2072,10 +2072,10 @@ hsize_t diff_datum(void *_mem1, */ isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); - + if ( !isnan1 && !isnan2) - { - + { + if (ABS(temp1_double-temp2_double) > options->delta) { if ( print_data(options) ) @@ -2086,7 +2086,7 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /* NaN */ } @@ -2103,12 +2103,12 @@ hsize_t diff_datum(void *_mem1, */ isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); - + if ( !isnan1 && !isnan2) - { - + { + PER(temp1_double,temp2_double); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -2121,9 +2121,9 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -2136,12 +2136,12 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /* NaN */ } - + /*------------------------------------------------------------------------- - * -d and -p + * -d and -p *------------------------------------------------------------------------- */ else if ( options->d && options->p) @@ -2153,12 +2153,12 @@ hsize_t diff_datum(void *_mem1, */ isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); - + if ( !isnan1 && !isnan2) - { - + { + PER(temp1_double,temp2_double); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -2171,10 +2171,10 @@ hsize_t diff_datum(void *_mem1, options->not_cmp=1; nfound++; } - + else - - if ( per > options->percent && + + if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta ) { if ( print_data(options) ) @@ -2187,12 +2187,12 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /* NaN */ } - + /*------------------------------------------------------------------------- - * no -d and -p + * no -d and -p *------------------------------------------------------------------------- */ else if (equal_double(temp1_double,temp2_double)==FALSE) @@ -2206,12 +2206,12 @@ hsize_t diff_datum(void *_mem1, nfound++; } } /*H5T_NATIVE_DOUBLE*/ - - + + break; /* H5T_FLOAT class */ - + } /* switch */ - + return nfound; } @@ -2250,7 +2250,7 @@ static void print_region_block(int i, hsize_t *ptdata, int ndims) { int j; - + parallel_print(" "); for (j = 0; j < ndims; j++) parallel_print("%s%lu", j ? "," : " (", @@ -2259,7 +2259,7 @@ void print_region_block(int i, hsize_t *ptdata, int ndims) parallel_print("%s%lu", j ? "," : ")-(", (unsigned long)ptdata[i * 2 * ndims + j + ndims]); parallel_print(")"); - + } @@ -2277,13 +2277,13 @@ static void print_points(int i, hsize_t *ptdata, int ndims) { int j; - + parallel_print(" "); for (j = 0; j < ndims; j++) parallel_print("%s%lu", j ? "," : "(", (unsigned long)(ptdata[i * ndims + j])); parallel_print(")"); - + } /*------------------------------------------------------------------------- @@ -2492,10 +2492,10 @@ hsize_t character_compare(unsigned char *mem1, hsize_t nfound=0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - + memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - + if (temp1_uchar != temp2_uchar) { if ( print_data(options) ) @@ -2506,7 +2506,7 @@ hsize_t character_compare(unsigned char *mem1, } nfound++; } - + return nfound; } @@ -2538,12 +2538,12 @@ hsize_t character_compare_opt(unsigned char *mem1, unsigned char temp2_uchar; double per; int both_zero; - + memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - + /* -d and !-p */ - + if (options->d && !options->p) { if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta) @@ -2597,9 +2597,9 @@ hsize_t character_compare_opt(unsigned char *mem1, } nfound++; } - + return nfound; - + } @@ -2634,13 +2634,13 @@ hsize_t diff_float(unsigned char *mem1, int both_zero; int isnan1; int isnan2; - + /*------------------------------------------------------------------------- - * -d and !-p + * -d and !-p *------------------------------------------------------------------------- */ - + if (options->d && !options->p) { for ( i = 0; i < nelmts; i++) @@ -2656,7 +2656,7 @@ hsize_t diff_float(unsigned char *mem1, isnan2 = my_isnan(FLT_FLOAT,&temp2_float); if ( !isnan1 && !isnan2) - { + { if (ABS(temp1_float-temp2_float) > options->delta) { if ( print_data(options) ) @@ -2676,7 +2676,7 @@ hsize_t diff_float(unsigned char *mem1, } /*------------------------------------------------------------------------- - * !-d and -p + * !-d and -p *------------------------------------------------------------------------- */ else if (!options->d && options->p) @@ -2685,19 +2685,19 @@ hsize_t diff_float(unsigned char *mem1, { memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); - + /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ isnan1 = my_isnan(FLT_FLOAT,&temp1_float); isnan2 = my_isnan(FLT_FLOAT,&temp2_float); - + if ( !isnan1 && !isnan2) - { - + { + PER(temp1_float,temp2_float); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -2710,9 +2710,9 @@ hsize_t diff_float(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -2732,31 +2732,31 @@ hsize_t diff_float(unsigned char *mem1, return nfound; } /* i */ } - + /*------------------------------------------------------------------------- - * -d and -p + * -d and -p *------------------------------------------------------------------------- */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); - + /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ isnan1 = my_isnan(FLT_FLOAT,&temp1_float); isnan2 = my_isnan(FLT_FLOAT,&temp2_float); - + if ( !isnan1 && !isnan2) - { - + { + PER(temp1_float,temp2_float); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -2769,9 +2769,9 @@ hsize_t diff_float(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_float-temp2_float) > options->delta ) { if ( print_data(options) ) @@ -2784,7 +2784,7 @@ hsize_t diff_float(unsigned char *mem1, } nfound++; } - + } /* NaN */ mem1+=sizeof(float); mem2+=sizeof(float); @@ -2794,7 +2794,7 @@ hsize_t diff_float(unsigned char *mem1, } /*------------------------------------------------------------------------- - * no -d and -p + * no -d and -p *------------------------------------------------------------------------- */ else @@ -2814,13 +2814,13 @@ hsize_t diff_float(unsigned char *mem1, #endif #endif - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); - + if (equal_float(temp1_float,temp2_float)==FALSE) { if ( print_data(options) ) @@ -2831,7 +2831,7 @@ hsize_t diff_float(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(float); mem2+=sizeof(float); if (options->n && nfound>=options->count) @@ -2854,9 +2854,9 @@ hsize_t diff_float(unsigned char *mem1, #endif - + } - + return nfound; } @@ -2892,13 +2892,13 @@ hsize_t diff_double(unsigned char *mem1, int both_zero; int isnan1; int isnan2; - + /*------------------------------------------------------------------------- - * -d and !-p + * -d and !-p *------------------------------------------------------------------------- */ - + if (options->d && !options->p) { for ( i = 0; i < nelmts; i++) @@ -2914,7 +2914,7 @@ hsize_t diff_double(unsigned char *mem1, isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); if ( !isnan1 && !isnan2) - { + { if (ABS(temp1_double-temp2_double) > options->delta) { if ( print_data(options) ) @@ -2934,7 +2934,7 @@ hsize_t diff_double(unsigned char *mem1, } /*------------------------------------------------------------------------- - * !-d and -p + * !-d and -p *------------------------------------------------------------------------- */ else if (!options->d && options->p) @@ -2943,19 +2943,19 @@ hsize_t diff_double(unsigned char *mem1, { memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - + /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); - + if ( !isnan1 && !isnan2) - { - + { + PER(temp1_double,temp2_double); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -2968,9 +2968,9 @@ hsize_t diff_double(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -2990,31 +2990,31 @@ hsize_t diff_double(unsigned char *mem1, return nfound; } /* i */ } - + /*------------------------------------------------------------------------- - * -d and -p + * -d and -p *------------------------------------------------------------------------- */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - + /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); - + if ( !isnan1 && !isnan2) - { - + { + PER(temp1_double,temp2_double); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3027,9 +3027,9 @@ hsize_t diff_double(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta ) { if ( print_data(options) ) @@ -3042,7 +3042,7 @@ hsize_t diff_double(unsigned char *mem1, } nfound++; } - + } /* NaN */ mem1+=sizeof(double); mem2+=sizeof(double); @@ -3052,17 +3052,17 @@ hsize_t diff_double(unsigned char *mem1, } /*------------------------------------------------------------------------- - * no -d and -p + * no -d and -p *------------------------------------------------------------------------- */ else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - + if (equal_double(temp1_double,temp2_double)==FALSE) { if ( print_data(options) ) @@ -3073,15 +3073,15 @@ hsize_t diff_double(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(double); mem2+=sizeof(double); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -3117,17 +3117,17 @@ hsize_t diff_schar(unsigned char *mem1, hsize_t i; double per; int both_zero; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_char, mem1, sizeof(char)); memcpy(&temp2_char, mem2, sizeof(char)); - + if (ABS(temp1_char-temp2_char) > options->delta) { if ( print_data(options) ) @@ -3144,18 +3144,18 @@ hsize_t diff_schar(unsigned char *mem1, return nfound; } } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_char, mem1, sizeof(char)); memcpy(&temp2_char, mem2, sizeof(char)); - + PER(temp1_char,temp2_char); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3168,9 +3168,9 @@ hsize_t diff_schar(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -3189,18 +3189,18 @@ hsize_t diff_schar(unsigned char *mem1, return nfound; } } - + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_char, mem1, sizeof(char)); memcpy(&temp2_char, mem2, sizeof(char)); - + PER(temp1_char,temp2_char); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3213,9 +3213,9 @@ hsize_t diff_schar(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_char-temp2_char) > options->delta ) { if ( print_data(options) ) @@ -3233,16 +3233,16 @@ hsize_t diff_schar(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_char, mem1, sizeof(char)); memcpy(&temp2_char, mem2, sizeof(char)); - + if (temp1_char != temp2_char) { if ( print_data(options) ) @@ -3253,15 +3253,15 @@ hsize_t diff_schar(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(char); mem2+=sizeof(char); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -3296,17 +3296,17 @@ hsize_t diff_uchar(unsigned char *mem1, hsize_t i; double per; int both_zero; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - + if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta) { if ( print_data(options) ) @@ -3322,20 +3322,20 @@ hsize_t diff_uchar(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - + PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3348,9 +3348,9 @@ hsize_t diff_uchar(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -3369,18 +3369,18 @@ hsize_t diff_uchar(unsigned char *mem1, return nfound; } } - + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - + PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3393,9 +3393,9 @@ hsize_t diff_uchar(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta ) { if ( print_data(options) ) @@ -3413,16 +3413,16 @@ hsize_t diff_uchar(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - + if (temp1_uchar != temp2_uchar) { if ( print_data(options) ) @@ -3433,15 +3433,15 @@ hsize_t diff_uchar(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(unsigned char); mem2+=sizeof(unsigned char); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -3474,16 +3474,16 @@ hsize_t diff_short(unsigned char *mem1, hsize_t i; double per; int both_zero; - + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); - + if (ABS(temp1_short-temp2_short) > options->delta) { if ( print_data(options) ) @@ -3499,20 +3499,20 @@ hsize_t diff_short(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); - + PER(temp1_short,temp2_short); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3525,9 +3525,9 @@ hsize_t diff_short(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -3545,21 +3545,21 @@ hsize_t diff_short(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - + + } - + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); - + PER(temp1_short,temp2_short); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3572,9 +3572,9 @@ hsize_t diff_short(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_short-temp2_short) > options->delta ) { if ( print_data(options) ) @@ -3592,16 +3592,16 @@ hsize_t diff_short(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); - + if (temp1_short != temp2_short) { if ( print_data(options) ) @@ -3612,15 +3612,15 @@ hsize_t diff_short(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(short); mem2+=sizeof(short); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -3654,16 +3654,16 @@ hsize_t diff_ushort(unsigned char *mem1, hsize_t i; double per; int both_zero; - + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - + if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta) { if ( print_data(options) ) @@ -3679,20 +3679,20 @@ hsize_t diff_ushort(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - + PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3705,9 +3705,9 @@ hsize_t diff_ushort(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -3725,21 +3725,21 @@ hsize_t diff_ushort(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - + + } - + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - + PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3752,9 +3752,9 @@ hsize_t diff_ushort(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta ) { if ( print_data(options) ) @@ -3772,16 +3772,16 @@ hsize_t diff_ushort(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - + if (temp1_ushort != temp2_ushort) { if ( print_data(options) ) @@ -3792,15 +3792,15 @@ hsize_t diff_ushort(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(unsigned short); mem2+=sizeof(unsigned short); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -3835,16 +3835,16 @@ hsize_t diff_int(unsigned char *mem1, hsize_t i; double per; int both_zero; - + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); - + if (ABS(temp1_int-temp2_int) > options->delta) { if ( print_data(options) ) @@ -3860,20 +3860,20 @@ hsize_t diff_int(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); - + PER(temp1_int,temp2_int); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3886,9 +3886,9 @@ hsize_t diff_int(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -3906,21 +3906,21 @@ hsize_t diff_int(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - + + } - + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); - + PER(temp1_int,temp2_int); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -3933,9 +3933,9 @@ hsize_t diff_int(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_int-temp2_int) > options->delta ) { if ( print_data(options) ) @@ -3953,16 +3953,16 @@ hsize_t diff_int(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); - + if (temp1_int != temp2_int) { if ( print_data(options) ) @@ -3973,15 +3973,15 @@ hsize_t diff_int(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(int); mem2+=sizeof(int); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -4016,16 +4016,16 @@ hsize_t diff_uint(unsigned char *mem1, hsize_t i; double per; int both_zero; - + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); - + if ( PDIFF(temp1_uint,temp2_uint) > options->delta) { if ( print_data(options) ) @@ -4041,20 +4041,20 @@ hsize_t diff_uint(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); - + PER_UNSIGN(signed int,temp1_uint,temp2_uint); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -4066,9 +4066,9 @@ hsize_t diff_uint(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -4086,21 +4086,21 @@ hsize_t diff_uint(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - + + } - + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); - + PER_UNSIGN(signed int,temp1_uint,temp2_uint); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -4112,9 +4112,9 @@ hsize_t diff_uint(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta ) { if ( print_data(options) ) @@ -4132,16 +4132,16 @@ hsize_t diff_uint(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); - + if (temp1_uint != temp2_uint) { if ( print_data(options) ) @@ -4152,15 +4152,15 @@ hsize_t diff_uint(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(unsigned int); mem2+=sizeof(unsigned int); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -4195,19 +4195,19 @@ hsize_t diff_long(unsigned char *mem1, hsize_t i; double per; int both_zero; - + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - + if (ABS(temp1_long-temp2_long) > options->delta) { if ( print_data(options) ) @@ -4225,18 +4225,18 @@ hsize_t diff_long(unsigned char *mem1, } } } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - + PER(temp1_long,temp2_long); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -4249,9 +4249,9 @@ hsize_t diff_long(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -4269,21 +4269,21 @@ hsize_t diff_long(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - + + } - + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - + PER(temp1_long,temp2_long); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -4296,9 +4296,9 @@ hsize_t diff_long(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_long-temp2_long) > options->delta ) { if ( print_data(options) ) @@ -4316,16 +4316,16 @@ hsize_t diff_long(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - + if (temp1_long != temp2_long) { if ( print_data(options) ) @@ -4336,15 +4336,15 @@ hsize_t diff_long(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(long); mem2+=sizeof(long); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -4380,20 +4380,20 @@ hsize_t diff_ulong(unsigned char *mem1, hsize_t i; double per; int both_zero; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - + if ( PDIFF(temp1_ulong,temp2_ulong) > options->delta) { if ( print_data(options) ) @@ -4409,22 +4409,22 @@ hsize_t diff_ulong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - + PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -4436,9 +4436,9 @@ hsize_t diff_ulong(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -4456,21 +4456,21 @@ hsize_t diff_ulong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - + + } - + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - + PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -4482,9 +4482,9 @@ hsize_t diff_ulong(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta ) { if ( print_data(options) ) @@ -4502,16 +4502,16 @@ hsize_t diff_ulong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - + if (temp1_ulong != temp2_ulong) { if ( print_data(options) ) @@ -4522,15 +4522,15 @@ hsize_t diff_ulong(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(unsigned long); mem2+=sizeof(unsigned long); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -4565,16 +4565,16 @@ hsize_t diff_llong(unsigned char *mem1, hsize_t i; double per; int both_zero; - + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); - + if (ABS( temp1_llong-temp2_llong) > options->delta) { if ( print_data(options) ) @@ -4590,20 +4590,20 @@ hsize_t diff_llong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); - + PER(temp1_llong,temp2_llong); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -4615,9 +4615,9 @@ hsize_t diff_llong(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -4633,21 +4633,21 @@ hsize_t diff_llong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - + + } - + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); - + PER(temp1_llong,temp2_llong); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -4659,9 +4659,9 @@ hsize_t diff_llong(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && ABS(temp1_llong-temp2_llong) > options->delta ) { if ( print_data(options) ) @@ -4677,16 +4677,16 @@ hsize_t diff_llong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); - + if (temp1_llong != temp2_llong) { if ( print_data(options) ) @@ -4697,15 +4697,15 @@ hsize_t diff_llong(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(long_long); mem2+=sizeof(long_long); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -4741,16 +4741,16 @@ hsize_t diff_ullong(unsigned char *mem1, float f1, f2; double per; int both_zero; - + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); - + if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long_long) options->delta) { if ( print_data(options) ) @@ -4766,22 +4766,22 @@ hsize_t diff_ullong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); - + ull2float(temp1_ullong,&f1); ull2float(temp2_ullong,&f2); PER(f1,f2); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -4793,9 +4793,9 @@ hsize_t diff_ullong(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent ) { if ( print_data(options) ) @@ -4811,23 +4811,23 @@ hsize_t diff_ullong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - + + } - + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); - + ull2float(temp1_ullong,&f1); ull2float(temp2_ullong,&f2); PER(f1,f2); - + if (not_comparable && !both_zero) /* not comparable */ { if ( print_data(options) ) @@ -4839,9 +4839,9 @@ hsize_t diff_ullong(unsigned char *mem1, options->not_cmp=1; nfound++; } - + else - + if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long_long)options->delta ) { if ( print_data(options) ) @@ -4857,16 +4857,16 @@ hsize_t diff_ullong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); - + if (temp1_ullong != temp2_ullong) { if ( print_data(options) ) @@ -4877,15 +4877,15 @@ hsize_t diff_ullong(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(unsigned long_long); mem2+=sizeof(unsigned long_long); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -4945,8 +4945,8 @@ error: /*------------------------------------------------------------------------- * Function: equal_double * - * Purpose: use a relative error formula to deal with floating point - * uncertainty + * Purpose: use a relative error formula to deal with floating point + * uncertainty * * Programmer: pvn * October 24, 2006 @@ -4956,8 +4956,8 @@ error: * *------------------------------------------------------------------------- */ -static -hbool_t equal_double(double value, double expected) +static +hbool_t equal_double(double value, double expected) { int both_zero; int is_zero; @@ -4972,7 +4972,7 @@ hbool_t equal_double(double value, double expected) int isnan2 = my_isnan(FLT_DOUBLE,&expected); /*------------------------------------------------------------------------- - * we consider NaN == NaN to be true + * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ if ( isnan1 && isnan2 ) @@ -5008,14 +5008,14 @@ hbool_t equal_double(double value, double expected) return TRUE; else return FALSE; - + } /*------------------------------------------------------------------------- * Function: equal_float * - * Purpose: use a relative error formula to deal with floating point - * uncertainty + * Purpose: use a relative error formula to deal with floating point + * uncertainty * * Programmer: pvn * October 24, 2006 @@ -5025,8 +5025,8 @@ hbool_t equal_double(double value, double expected) * *------------------------------------------------------------------------- */ -static -hbool_t equal_float(float value, float expected) +static +hbool_t equal_float(float value, float expected) { int both_zero; int is_zero; @@ -5041,7 +5041,7 @@ hbool_t equal_float(float value, float expected) int isnan2 = my_isnan(FLT_FLOAT,&expected); /*------------------------------------------------------------------------- - * we consider NaN == NaN to be true + * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ if ( isnan1 && isnan2 ) @@ -5064,7 +5064,7 @@ hbool_t equal_float(float value, float expected) */ #endif - + BOTH_ZERO(value,expected) if (both_zero) return TRUE; @@ -5077,7 +5077,7 @@ hbool_t equal_float(float value, float expected) return TRUE; else return FALSE; - + } @@ -5103,73 +5103,73 @@ my_isnan(dtype_t type, void *val) { int retval = 0; char s[256]; - - if (FLT_FLOAT==type) + + if (FLT_FLOAT==type) { float x; HDmemcpy(&x, val, sizeof(float)); retval = (x!=x); - - } - else if (FLT_DOUBLE==type) + + } + else if (FLT_DOUBLE==type) { double x; HDmemcpy(&x, val, sizeof(double)); retval = (x!=x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 - } - else if (FLT_LDOUBLE==type) + } + else if (FLT_LDOUBLE==type) { long double x; HDmemcpy(&x, val, sizeof(long double)); retval = (x!=x); #endif - } - else + } + else { return 0; } - + /* * Sometimes NaN==NaN (e.g., DEC Alpha) so we try to print it and see if * the result contains a NaN string. */ - if (!retval) + if (!retval) { - if (FLT_FLOAT==type) + if (FLT_FLOAT==type) { float x; HDmemcpy(&x, val, sizeof(float)); sprintf(s, "%g", x); - } - else if (FLT_DOUBLE==type) + } + else if (FLT_DOUBLE==type) { double x; HDmemcpy(&x, val, sizeof(double)); sprintf(s, "%g", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 - } - else if (FLT_LDOUBLE==type) + } + else if (FLT_LDOUBLE==type) { long double x; HDmemcpy(&x, val, sizeof(long double)); sprintf(s, "%Lg", x); #endif - } - else + } + else { return 0; } - - if ( HDstrstr(s, "NaN") || - HDstrstr(s, "NAN") || - HDstrstr(s, "nan") || - HDstrstr(s, "-1.#IND") /* WIN32 */ + + if ( HDstrstr(s, "NaN") || + HDstrstr(s, "NAN") || + HDstrstr(s, "nan") || + HDstrstr(s, "-1.#IND") /* WIN32 */ ) { @@ -5180,13 +5180,13 @@ my_isnan(dtype_t type, void *val) } - + #ifdef H5_VMS /* For "float" and "double" on OpenVMS/Alpha, NaN is * actually a valid value of maximal value.*/ - if(!retval) + if(!retval) { - if (FLT_FLOAT==type) + if (FLT_FLOAT==type) { float x; HDmemcpy(&x, val, sizeof(float)); @@ -5195,17 +5195,17 @@ my_isnan(dtype_t type, void *val) double x; HDmemcpy(&x, val, sizeof(double)); retval = (x==DBL_MAX || x==-DBL_MAX); - } else + } else { return 0; } } #endif /*H5_VMS*/ - + return retval; } - + |