diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2005-08-13 20:53:35 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2005-08-13 20:53:35 (GMT) |
commit | 6b45f5172ccb4311e0be9ae15da3758abb6b0e67 (patch) | |
tree | 5a7a112fe7a8a98c6fecb45b513789d15962eb3d /tools/lib/h5diff_array.c | |
parent | 6562465a2c2a58cfbc2f47bf60bb538f7a783933 (diff) | |
download | hdf5-6b45f5172ccb4311e0be9ae15da3758abb6b0e67.zip hdf5-6b45f5172ccb4311e0be9ae15da3758abb6b0e67.tar.gz hdf5-6b45f5172ccb4311e0be9ae15da3758abb6b0e67.tar.bz2 |
[svn-r11245] Purpose:
Code cleanup
Description:
Trim trailing whitespace, which is making 'diff'ing the two branches
difficult.
Solution:
Ran this script in each directory:
foreach f (*.[ch] *.cpp)
sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f
end
Platforms tested:
FreeBSD 4.11 (sleipnir)
Too minor to require h5committest
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r-- | tools/lib/h5diff_array.c | 928 |
1 files changed, 464 insertions, 464 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 3632cdb..dd4784d 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -15,7 +15,7 @@ #include <math.h> #include "h5diff.h" #include "ph5diff.h" -#include "H5private.h" +#include "H5private.h" /* local functions */ static void close_obj(H5G_obj_t obj_type, hid_t obj_id); @@ -30,7 +30,7 @@ static hbool_t is_zero(const void *_mem, size_t size); *------------------------------------------------------------------------- */ static int print_data(diff_opt_t *options) -{ +{ return ( (options->m_report || options->m_verbose) && !options->m_quiet)?1:0; } @@ -45,22 +45,22 @@ static int print_data(diff_opt_t *options) * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: November 12, 2003 - * + * *------------------------------------------------------------------------- */ -hsize_t diff_array( void *_mem1, - void *_mem2, - hsize_t nelmts, - int rank, - hsize_t *dims, - diff_opt_t *options, - const char *name1, +hsize_t diff_array( void *_mem1, + void *_mem2, + hsize_t nelmts, + int rank, + hsize_t *dims, + diff_opt_t *options, + const char *name1, const char *name2, hid_t m_type, hid_t container1_id, hid_t container2_id) /* dataset where the reference came from*/ -{ +{ hsize_t nfound=0; /* number of differences found */ size_t size; /* size of datum */ unsigned char *mem1 = (unsigned char*)_mem1; @@ -85,13 +85,13 @@ hsize_t diff_array( void *_mem1, pos[j]=0; - if(H5Tis_variable_str(m_type)) + if(H5Tis_variable_str(m_type)) { - tmp1 = ((unsigned char**)mem1)[0]; - tmp2 = ((unsigned char**)mem2)[0]; + tmp1 = ((unsigned char**)mem1)[0]; + tmp2 = ((unsigned char**)mem2)[0]; nfound+=diff_datum( tmp1, - tmp2, + tmp2, m_type, (hsize_t)0, rank, @@ -109,16 +109,16 @@ hsize_t diff_array( void *_mem1, { - switch (H5Tget_class(m_type)) + switch (H5Tget_class(m_type)) { default: assert(0); break; case H5T_FLOAT: - if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) + if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) nfound=diff_float(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) + else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) nfound=diff_double(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); break; @@ -126,23 +126,23 @@ hsize_t diff_array( void *_mem1, if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) nfound=diff_schar(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) + else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) nfound=diff_uchar(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); else if (H5Tequal(m_type, H5T_NATIVE_SHORT)) nfound=diff_short(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); else if (H5Tequal(m_type, H5T_NATIVE_USHORT)) nfound=diff_ushort(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_INT)) + else if (H5Tequal(m_type, H5T_NATIVE_INT)) nfound=diff_int(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_UINT)) + else if (H5Tequal(m_type, H5T_NATIVE_UINT)) nfound=diff_uint(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_LONG)) + else if (H5Tequal(m_type, H5T_NATIVE_LONG)) nfound=diff_long(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) + else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) nfound=diff_ulong(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) + else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) nfound=diff_llong(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) + else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) nfound=diff_ullong(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); break; @@ -198,7 +198,7 @@ hsize_t diff_array( void *_mem1, * The compare of the 2 buffers read from the files is made datum by datum. * * H5T_INTEGER and H5T_FLOAT - * Copy the buffer into a compatible local datum and do a numerical + * Copy the buffer into a compatible local datum and do a numerical * compare of this datum * H5T_COMPOUND * Recursively call this function for each member @@ -207,34 +207,34 @@ hsize_t diff_array( void *_mem1, * H5T_VLEN * Recursively call this function for each element * H5T_STRING - * compare byte by byte in a cycle from 0 to type_size. this type_size is the - * value obtained by the get_size function but it is the string lenght for + * compare byte by byte in a cycle from 0 to type_size. this type_size is the + * value obtained by the get_size function but it is the string lenght for * variable sized strings * H5T_OPAQUE * compare byte by byte in a cycle from 0 to type_size * H5T_BITFIELD * compare byte by byte in a cycle from 0 to type_size * H5T_ENUM - * for each pair of elements being compared, both bit patterns are converted to + * for each pair of elements being compared, both bit patterns are converted to * their corresponding enumeration constant and a string comparison is made * H5T_REFERENCE - * Dereference the object and compare the type (basic object type). + * Dereference the object and compare the type (basic object type). *------------------------------------------------------------------------- */ -hsize_t diff_datum(void *_mem1, - void *_mem2, +hsize_t diff_datum(void *_mem1, + void *_mem2, hid_t m_type, - hsize_t i, - int rank, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, const char *obj2, hid_t container1_id, hid_t container2_id, /*where the reference came from*/ - int *ph) /*print header */ + int *ph) /*print header */ { static char fmt_llong[255]; static char fmt_ullong[255]; @@ -245,7 +245,7 @@ hsize_t diff_datum(void *_mem1, unsigned char *mem2 = (unsigned char*)_mem2; unsigned u; hid_t memb_type; - size_t type_size; + size_t type_size; size_t offset; int nmembs; int j; @@ -266,20 +266,20 @@ hsize_t diff_datum(void *_mem1, if (!fmt_llong[0]) { /* Build default formats for long long types */ - sprintf(fmt_llong, "%%%sd %%%sd %%%sd\n", + sprintf(fmt_llong, "%%%sd %%%sd %%%sd\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - sprintf(fmt_ullong, "%%%su %%%su %%%su\n", + sprintf(fmt_ullong, "%%%su %%%su %%%su\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - sprintf(fmt_llongp, "%%%sd %%%sd %%%sd %%%sd\n", + sprintf(fmt_llongp, "%%%sd %%%sd %%%sd %%%sd\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - sprintf(fmt_ullongp, "%%%su %%%su %%%su %%%su\n", + sprintf(fmt_ullongp, "%%%su %%%su %%%su %%%su\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); } type_size = H5Tget_size( m_type ); - switch (H5Tget_class(m_type)) + switch (H5Tget_class(m_type)) { default: assert(0); @@ -294,7 +294,7 @@ hsize_t diff_datum(void *_mem1, */ case H5T_COMPOUND: nmembs = H5Tget_nmembers(m_type); - for (j = 0; j < nmembs; j++) + for (j = 0; j < nmembs; j++) { offset = H5Tget_member_offset(m_type, (unsigned)j); memb_type = H5Tget_member_type(m_type, (unsigned)j); @@ -322,11 +322,11 @@ hsize_t diff_datum(void *_mem1, */ case H5T_STRING: { - + H5T_str_t pad; char *s; - - if(H5Tis_variable_str(m_type)) + + if(H5Tis_variable_str(m_type)) { /* mem1 is the pointer into the struct where a `char*' is stored. So we have * to dereference the pointer to get the `char*' to pass to HDstrlen(). */ @@ -334,14 +334,14 @@ hsize_t diff_datum(void *_mem1, if(s!=NULL) size = HDstrlen(s); } - else + else { s = mem1; size = H5Tget_size(m_type); } - + pad = H5Tget_strpad(m_type); - + /* check for NULL pointer for string */ if(s!=NULL) for (u=0; u<size && (s[u] || pad!=H5T_STR_NULLTERM); u++) @@ -349,14 +349,14 @@ hsize_t diff_datum(void *_mem1, mem1 + u, mem2 + u, /* offset */ i, /* index position */ - rank, + rank, acc, pos, - options, - obj1, + options, + obj1, obj2, ph); - + } break; @@ -372,11 +372,11 @@ hsize_t diff_datum(void *_mem1, mem1 + u, mem2 + u, /* offset */ i, /* index position */ - rank, + rank, acc, pos, - options, - obj1, + options, + obj1, obj2, ph); @@ -394,11 +394,11 @@ hsize_t diff_datum(void *_mem1, mem1 + u, mem2 + u, /* offset */ i, /* index position */ - rank, + rank, acc, pos, - options, - obj1, + options, + obj1, obj2, ph); @@ -413,7 +413,7 @@ hsize_t diff_datum(void *_mem1, /* 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 + compared, we convert both bit patterns to their corresponding enumeration constant and do a string comparison */ { @@ -429,7 +429,7 @@ hsize_t diff_datum(void *_mem1, if (HDstrcmp(enum_name1,enum_name2)!=0) { nfound=1; - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -443,11 +443,11 @@ hsize_t diff_datum(void *_mem1, mem1 + u, mem2 + u, /* offset */ i, /* index position */ - rank, + rank, acc, pos, - options, - obj1, + options, + obj1, obj2, ph); } @@ -473,7 +473,7 @@ hsize_t diff_datum(void *_mem1, /* calculate the number of array elements */ for (u = 0, nelmts = 1; u <ndims; u++) nelmts *= dims[u]; - for (u = 0; u < nelmts; u++) + for (u = 0; u < nelmts; u++) nfound+=diff_datum( mem1 + u * size, mem2 + u * size, /* offset */ @@ -504,7 +504,7 @@ hsize_t diff_datum(void *_mem1, /* get the number of sequence elements */ nelmts = ((hvl_t *)mem1)->len; - for (j = 0; j < (int)nelmts; j++) + for (j = 0; j < (int)nelmts; j++) nfound+=diff_datum( ((char *)(((hvl_t *)mem1)->p)) + j * size, ((char *)(((hvl_t *)mem2)->p)) + j * size, /* offset */ @@ -542,7 +542,7 @@ hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ - if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) + if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) { hid_t region1_id; hid_t region2_id; @@ -583,7 +583,7 @@ hsize_t diff_datum(void *_mem1, * Object references. get the type and OID of the referenced object *------------------------------------------------------------------------- */ - else if (H5Tequal(m_type, H5T_STD_REF_OBJ)) + else if (H5Tequal(m_type, H5T_STD_REF_OBJ)) { if ((obj1_type = H5Rget_obj_type(container1_id, H5R_OBJECT, _mem1))<0) @@ -622,7 +622,7 @@ hsize_t diff_datum(void *_mem1, options); break; default: - parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>", + parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>", obj1, obj2); options->not_cmp=1; break; @@ -646,7 +646,7 @@ hsize_t diff_datum(void *_mem1, * H5T_NATIVE_SCHAR *------------------------------------------------------------------------- */ - if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) + if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) { char temp1_char; char temp2_char; @@ -658,7 +658,7 @@ hsize_t diff_datum(void *_mem1, { if (abs(temp1_char-temp2_char) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -672,7 +672,7 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -684,10 +684,10 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent && + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent && abs(temp1_char-temp2_char) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -698,7 +698,7 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_char != temp2_char) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -713,7 +713,7 @@ hsize_t diff_datum(void *_mem1, * H5T_NATIVE_UCHAR *------------------------------------------------------------------------- */ - else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) + else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) { unsigned char temp1_uchar; unsigned char temp2_uchar; @@ -726,7 +726,7 @@ hsize_t diff_datum(void *_mem1, { if (abs(temp1_uchar-temp2_uchar) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -740,7 +740,7 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -752,10 +752,10 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && abs(temp1_uchar-temp2_uchar) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -766,7 +766,7 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_uchar != temp2_uchar) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -797,7 +797,7 @@ hsize_t diff_datum(void *_mem1, { if (abs(temp1_short-temp2_short) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -811,7 +811,7 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -823,10 +823,10 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent && + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent && abs(temp1_short-temp2_short) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -838,7 +838,7 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_short != temp2_short) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); @@ -870,7 +870,7 @@ hsize_t diff_datum(void *_mem1, if (abs(temp1_ushort-temp2_ushort) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -885,7 +885,7 @@ hsize_t diff_datum(void *_mem1, if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); @@ -898,11 +898,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent && + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent && abs(temp1_ushort-temp2_ushort) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); @@ -915,7 +915,7 @@ hsize_t diff_datum(void *_mem1, else if (temp1_ushort != temp2_ushort) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -933,7 +933,7 @@ hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ - else if (H5Tequal(m_type, H5T_NATIVE_INT)) + else if (H5Tequal(m_type, H5T_NATIVE_INT)) { int temp1_int; int temp2_int; @@ -947,7 +947,7 @@ hsize_t diff_datum(void *_mem1, if (abs(temp1_int-temp2_int) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -961,11 +961,11 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); - + parallel_print(SPACES); parallel_print(IPFORMAT,temp1_int,temp2_int,abs(temp1_int-temp2_int), abs(1-temp2_int/temp1_int)); } @@ -975,14 +975,14 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent && + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent && abs(temp1_int-temp2_int) > options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); - + parallel_print(SPACES); parallel_print(IPFORMAT,temp1_int,temp2_int,abs(temp1_int-temp2_int), abs(1-temp2_int/temp1_int)); } @@ -991,8 +991,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_int != temp2_int) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1000,8 +1000,8 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_INT*/ @@ -1009,13 +1009,13 @@ hsize_t diff_datum(void *_mem1, * H5T_NATIVE_UINT *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, 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 */ @@ -1023,8 +1023,8 @@ hsize_t diff_datum(void *_mem1, { if (abs((int)(temp1_uint-temp2_uint)) > options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1038,11 +1038,11 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); - + parallel_print(SPACES); parallel_print(IPFORMAT,temp1_uint,temp2_uint,abs((int)(temp1_uint-temp2_uint)), abs((int)(1-temp2_uint/temp1_uint))); } @@ -1052,14 +1052,14 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options->percent && + if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options->percent && abs((int)(temp1_uint-temp2_uint)) > options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); - + parallel_print(SPACES); parallel_print(IPFORMAT,temp1_uint,temp2_uint,abs((int)(temp1_uint-temp2_uint)), abs((int)(1-temp2_uint/temp1_uint))); } @@ -1069,7 +1069,7 @@ hsize_t diff_datum(void *_mem1, else if (temp1_uint != temp2_uint) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); @@ -1088,13 +1088,13 @@ hsize_t diff_datum(void *_mem1, * H5T_NATIVE_LONG *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, 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 */ @@ -1102,8 +1102,8 @@ hsize_t diff_datum(void *_mem1, { if (labs(temp1_long-temp2_long) > (long)options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1117,8 +1117,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1130,11 +1130,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options->percent && + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options->percent && labs(temp1_long-temp2_long) > (long)options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1146,7 +1146,7 @@ hsize_t diff_datum(void *_mem1, else if (temp1_long != temp2_long) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1155,21 +1155,21 @@ hsize_t diff_datum(void *_mem1, nfound++; } - - + + } /*H5T_NATIVE_LONG*/ /*------------------------------------------------------------------------- * H5T_NATIVE_ULONG *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, 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 */ @@ -1177,8 +1177,8 @@ hsize_t diff_datum(void *_mem1, { if (labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1192,8 +1192,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1205,11 +1205,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options->percent && + if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options->percent && labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1221,7 +1221,7 @@ hsize_t diff_datum(void *_mem1, else if (temp1_ulong != temp2_ulong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1229,21 +1229,21 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_ULONG*/ /*------------------------------------------------------------------------- * H5T_NATIVE_LLONG *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, 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 */ @@ -1251,8 +1251,8 @@ hsize_t diff_datum(void *_mem1, { if (labs((long)(temp1_llong-temp2_llong)) > (long)options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1266,8 +1266,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1279,11 +1279,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options->percent && + if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options->percent && labs((long)(temp1_llong-temp2_llong)) > (long)options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1295,7 +1295,7 @@ hsize_t diff_datum(void *_mem1, else if (temp1_llong != temp2_llong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); @@ -1304,21 +1304,21 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_LLONG*/ /*------------------------------------------------------------------------- * H5T_NATIVE_ULLONG *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, 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 */ @@ -1326,8 +1326,8 @@ hsize_t diff_datum(void *_mem1, { if (labs((long)(temp1_ullong-temp2_ullong)) > (long)options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1341,8 +1341,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1354,14 +1354,14 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options->percent && + if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options->percent && labs((long)(temp1_ullong-temp2_ullong)) > (long)options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); - + parallel_print(SPACES); parallel_print(fmt_ullongp,temp1_ullong,temp2_ullong, (unsigned long_long)labs((long)(temp1_ullong-temp2_ullong)), (unsigned long_long)labs((long)(1-temp2_ullong/temp1_ullong))); } @@ -1370,8 +1370,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_ullong != temp2_ullong) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1379,10 +1379,10 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_ULLONG*/ - + break; /* H5T_INTEGER class */ case H5T_FLOAT: @@ -1391,7 +1391,7 @@ hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ - if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) + if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) { float temp1_float; float temp2_float; @@ -1407,7 +1407,7 @@ hsize_t diff_datum(void *_mem1, if (fabs(temp1_float-temp2_float) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1422,7 +1422,7 @@ hsize_t diff_datum(void *_mem1, if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1431,15 +1431,15 @@ hsize_t diff_datum(void *_mem1, nfound++; } } - + /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent && + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent && fabs(temp1_float-temp2_float) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); @@ -1452,7 +1452,7 @@ hsize_t diff_datum(void *_mem1, else if (temp1_float != temp2_float) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); @@ -1469,7 +1469,7 @@ hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ - else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) + else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) { double temp1_double; double temp2_double; @@ -1483,7 +1483,7 @@ hsize_t diff_datum(void *_mem1, if (fabs(temp1_double-temp2_double) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1498,7 +1498,7 @@ hsize_t diff_datum(void *_mem1, if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1510,11 +1510,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent && + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent && fabs(temp1_double-temp2_double) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); @@ -1527,13 +1527,13 @@ hsize_t diff_datum(void *_mem1, else if (temp1_double != temp2_double) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); parallel_print(FFORMAT,temp1_double,temp2_double,fabs(temp1_double-temp2_double)); - + } nfound++; } @@ -1567,12 +1567,12 @@ hsize_t diff_datum(void *_mem1, hsize_t diff_native_uchar(unsigned char *mem1, unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *acc, + hsize_t i, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) { @@ -1588,7 +1588,7 @@ hsize_t diff_native_uchar(unsigned char *mem1, { if (abs(temp1_uchar-temp2_uchar) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1602,7 +1602,7 @@ hsize_t diff_native_uchar(unsigned char *mem1, { if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1614,10 +1614,10 @@ hsize_t diff_native_uchar(unsigned char *mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && abs(temp1_uchar-temp2_uchar) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1628,7 +1628,7 @@ hsize_t diff_native_uchar(unsigned char *mem1, } else if (temp1_uchar != temp2_uchar) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1638,7 +1638,7 @@ hsize_t diff_native_uchar(unsigned char *mem1, } return nfound; -} +} /*------------------------------------------------------------------------- @@ -1657,12 +1657,12 @@ hsize_t diff_native_uchar(unsigned char *mem1, hsize_t diff_char(unsigned char *mem1, unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *acc, + hsize_t i, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) { @@ -1675,7 +1675,7 @@ hsize_t diff_char(unsigned char *mem1, if (temp1_uchar != temp2_uchar) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1685,7 +1685,7 @@ hsize_t diff_char(unsigned char *mem1, } return nfound; -} +} @@ -1703,11 +1703,11 @@ static hbool_t is_zero(const void *_mem, size_t size) { const unsigned char *mem = (const unsigned char *)_mem; - + while (size-- > 0) if (mem[size]) return FALSE; - + return TRUE; } @@ -1719,10 +1719,10 @@ is_zero(const void *_mem, size_t size) *------------------------------------------------------------------------- */ -static +static void close_obj(H5G_obj_t obj_type, hid_t obj_id) { - + switch (obj_type) { case H5G_GROUP: H5Gclose(obj_id); @@ -1764,7 +1764,7 @@ static int diff_region(hid_t region1_id, hid_t region2_id) #if defined (H5DIFF_DEBUG) int i; #endif - + /* * These two functions fail if the region does not have blocks or points, * respectively. They do not currently know how to translate from one to @@ -1780,9 +1780,9 @@ static int diff_region(hid_t region1_id, hid_t region2_id) if (nblocks1!=nblocks2 || npoints1!=npoints2 || ndims1!=ndims2) return 1; - + /* compare block information */ - if (nblocks1 > 0) + if (nblocks1 > 0) { alloc_size = nblocks1 * ndims1 * 2 * sizeof(ptdata1[0]); @@ -1799,30 +1799,30 @@ static int diff_region(hid_t region1_id, hid_t region2_id) ret=HDmemcmp(ptdata1,ptdata2,(size_t)alloc_size); #if defined (H5DIFF_DEBUG) - for (i = 0; i < nblocks1; i++) + for (i = 0; i < nblocks1; i++) { int j; - + /* start coordinates and opposite corner */ for (j = 0; j < ndims1; j++) parallel_print("%s%lu", j ? "," : "(", (unsigned long)ptdata1[i * 2 * ndims1 + j]); - + for (j = 0; j < ndims1; j++) parallel_print("%s%lu", j ? "," : ")-(", (unsigned long)ptdata1[i * 2 * ndims1 + j + ndims1]); - + parallel_print(")\n"); } -#endif - - +#endif + + HDfree(ptdata1); HDfree(ptdata2); } - + /* Print point information */ - if (npoints1 > 0) + if (npoints1 > 0) { alloc_size = npoints1 * ndims1 * sizeof(ptdata1[0]); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ @@ -1834,30 +1834,30 @@ static int diff_region(hid_t region1_id, hid_t region2_id) ptdata2 = malloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2); - + ret=HDmemcmp(ptdata1,ptdata2,(size_t)alloc_size); #if defined (H5DIFF_DEBUG) - for (i = 0; i < npoints1; i++) + for (i = 0; i < npoints1; i++) { int j; - + parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i); - + for (j = 0; j < ndims1; j++) parallel_print("%s%lu", j ? "," : "(", (unsigned long)(ptdata1[i * ndims1 + j])); - + parallel_print(")"); } -#endif - +#endif + HDfree(ptdata1); HDfree(ptdata2); } - + return ret; } @@ -1875,11 +1875,11 @@ static int diff_region(hid_t region1_id, hid_t region2_id) hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) @@ -1901,7 +1901,7 @@ hsize_t diff_float(unsigned char *mem1, if (fabs(temp1_float-temp2_float) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1927,7 +1927,7 @@ hsize_t diff_float(unsigned char *mem1, if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1941,7 +1941,7 @@ hsize_t diff_float(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -1952,10 +1952,10 @@ hsize_t diff_float(unsigned char *mem1, memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); - if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent && + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent && fabs(temp1_float-temp2_float) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1969,8 +1969,8 @@ hsize_t diff_float(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -1980,7 +1980,7 @@ hsize_t diff_float(unsigned char *mem1, if (temp1_float != temp2_float) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2014,11 +2014,11 @@ hsize_t diff_float(unsigned char *mem1, hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) @@ -2041,7 +2041,7 @@ hsize_t diff_double(unsigned char *mem1, if (fabs(temp1_double-temp2_double) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2067,7 +2067,7 @@ hsize_t diff_double(unsigned char *mem1, if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2081,7 +2081,7 @@ hsize_t diff_double(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -2092,10 +2092,10 @@ hsize_t diff_double(unsigned char *mem1, memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent && + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent && fabs(temp1_double-temp2_double) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2109,8 +2109,8 @@ hsize_t diff_double(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -2120,7 +2120,7 @@ hsize_t diff_double(unsigned char *mem1, if (temp1_double != temp2_double) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2155,33 +2155,33 @@ hsize_t diff_double(unsigned char *mem1, hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ char temp1_char; char temp2_char; hsize_t i; - - + + /* -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) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2195,19 +2195,19 @@ 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)); - + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2221,21 +2221,21 @@ hsize_t diff_schar(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_char, mem1, sizeof(char)); memcpy(&temp2_char, mem2, sizeof(char)); - - if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent && + + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent && abs(temp1_char-temp2_char) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2249,19 +2249,19 @@ hsize_t diff_schar(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + 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) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2269,15 +2269,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; } @@ -2295,33 +2295,33 @@ hsize_t diff_schar(unsigned char *mem1, hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; hsize_t i; - - + + /* -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 (abs(temp1_uchar-temp2_uchar) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2334,21 +2334,21 @@ 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)); - + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2362,21 +2362,21 @@ 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)); - - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && + + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && abs(temp1_uchar-temp2_uchar) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2390,19 +2390,19 @@ hsize_t diff_uchar(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + 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) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2410,15 +2410,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; } @@ -2437,33 +2437,33 @@ hsize_t diff_uchar(unsigned char *mem1, hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ short temp1_short; short temp2_short; hsize_t i; - - + + /* -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) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2476,21 +2476,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)); - + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2504,23 +2504,23 @@ 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)); - - if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent && + + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent && abs(temp1_short-temp2_short) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2534,19 +2534,19 @@ hsize_t diff_short(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + 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) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2554,15 +2554,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; } @@ -2579,33 +2579,33 @@ hsize_t diff_short(unsigned char *mem1, hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ unsigned short temp1_ushort; unsigned short temp2_ushort; hsize_t i; - - + + /* -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 (abs(temp1_ushort-temp2_ushort) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2618,21 +2618,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)); - + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2646,23 +2646,23 @@ 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)); - - if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent && + + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent && abs(temp1_ushort-temp2_ushort) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2676,19 +2676,19 @@ hsize_t diff_ushort(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + 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) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2696,15 +2696,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; } @@ -2722,14 +2722,14 @@ hsize_t diff_ushort(unsigned char *mem1, hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ int temp1_int; @@ -2748,7 +2748,7 @@ hsize_t diff_int(unsigned char *mem1, if (abs(temp1_int-temp2_int) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2775,7 +2775,7 @@ hsize_t diff_int(unsigned char *mem1, if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2791,7 +2791,7 @@ hsize_t diff_int(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -2802,10 +2802,10 @@ hsize_t diff_int(unsigned char *mem1, memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); - if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent && + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent && abs(temp1_int-temp2_int) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2820,8 +2820,8 @@ hsize_t diff_int(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -2831,7 +2831,7 @@ hsize_t diff_int(unsigned char *mem1, if (temp1_int != temp2_int) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2865,14 +2865,14 @@ hsize_t diff_int(unsigned char *mem1, hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ unsigned int temp1_uint; @@ -2891,7 +2891,7 @@ hsize_t diff_uint(unsigned char *mem1, if (abs(temp1_uint-temp2_uint) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2918,7 +2918,7 @@ hsize_t diff_uint(unsigned char *mem1, if ( temp1_uint!=0 && abs(1-temp2_uint/temp1_uint) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2934,7 +2934,7 @@ hsize_t diff_uint(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -2945,10 +2945,10 @@ hsize_t diff_uint(unsigned char *mem1, memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); - if ( temp1_uint!=0 && abs(1-temp2_uint/temp1_uint) > options->percent && + if ( temp1_uint!=0 && abs(1-temp2_uint/temp1_uint) > options->percent && abs(temp1_uint-temp2_uint) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2963,8 +2963,8 @@ hsize_t diff_uint(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -2974,7 +2974,7 @@ hsize_t diff_uint(unsigned char *mem1, if (temp1_uint != temp2_uint) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3008,14 +3008,14 @@ hsize_t diff_uint(unsigned char *mem1, hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ long temp1_long; @@ -3034,7 +3034,7 @@ hsize_t diff_long(unsigned char *mem1, if (labs(temp1_long-temp2_long) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3061,14 +3061,14 @@ hsize_t diff_long(unsigned char *mem1, if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - + if (labs(temp1_long-temp2_long) > (long)options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3090,7 +3090,7 @@ hsize_t diff_long(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -3101,10 +3101,10 @@ hsize_t diff_long(unsigned char *mem1, memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent && + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent && labs(temp1_long-temp2_long) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3119,8 +3119,8 @@ hsize_t diff_long(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -3130,15 +3130,15 @@ hsize_t diff_long(unsigned char *mem1, if (temp1_long != temp2_long) { - if ( print_data(options) ) + if ( print_data(options) ) { memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - - if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent && + + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent && labs(temp1_long-temp2_long) > (long)options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3180,14 +3180,14 @@ hsize_t diff_long(unsigned char *mem1, hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ unsigned long temp1_ulong; @@ -3201,15 +3201,15 @@ hsize_t diff_ulong(unsigned char *mem1, 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 (labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3222,7 +3222,7 @@ hsize_t diff_ulong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } } @@ -3238,7 +3238,7 @@ hsize_t diff_ulong(unsigned char *mem1, if ( temp1_ulong!=0 && labs(1-temp2_ulong/temp1_ulong) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3254,7 +3254,7 @@ hsize_t diff_ulong(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -3265,10 +3265,10 @@ hsize_t diff_ulong(unsigned char *mem1, memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - if ( temp1_ulong!=0 && labs(1-temp2_ulong/temp1_ulong) > options->percent && + if ( temp1_ulong!=0 && labs(1-temp2_ulong/temp1_ulong) > options->percent && labs(temp1_ulong-temp2_ulong) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3283,8 +3283,8 @@ hsize_t diff_ulong(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -3294,7 +3294,7 @@ hsize_t diff_ulong(unsigned char *mem1, if (temp1_ulong != temp2_ulong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3328,14 +3328,14 @@ hsize_t diff_ulong(unsigned char *mem1, hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ long_long temp1_llong; @@ -3346,9 +3346,9 @@ hsize_t diff_llong(unsigned char *mem1, if (!fmt_llong[0]) { /* build default formats for long long types */ - sprintf(fmt_llong, "%%%sd %%%sd %%%sd\n", + sprintf(fmt_llong, "%%%sd %%%sd %%%sd\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - sprintf(fmt_llongp, "%%%sd %%%sd %%%sd %%%sd\n", + sprintf(fmt_llongp, "%%%sd %%%sd %%%sd %%%sd\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); } @@ -3364,7 +3364,7 @@ hsize_t diff_llong(unsigned char *mem1, if (labs( (long) (temp1_llong-temp2_llong)) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3391,7 +3391,7 @@ hsize_t diff_llong(unsigned char *mem1, if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3407,7 +3407,7 @@ hsize_t diff_llong(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -3418,10 +3418,10 @@ hsize_t diff_llong(unsigned char *mem1, memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); - if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > options->percent && + if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > options->percent && labs((long)(temp1_llong-temp2_llong)) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3436,8 +3436,8 @@ hsize_t diff_llong(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -3447,7 +3447,7 @@ hsize_t diff_llong(unsigned char *mem1, if (temp1_llong != temp2_llong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3481,11 +3481,11 @@ hsize_t diff_llong(unsigned char *mem1, hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) @@ -3499,9 +3499,9 @@ hsize_t diff_ullong(unsigned char *mem1, if (!fmt_ullong[0]) { /* build default formats for long long types */ - sprintf(fmt_ullong, "%%%su %%%su %%%su\n", + sprintf(fmt_ullong, "%%%su %%%su %%%su\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - sprintf(fmt_ullongp, "%%%su %%%su %%%su %%%su\n", + sprintf(fmt_ullongp, "%%%su %%%su %%%su %%%su\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); } @@ -3517,7 +3517,7 @@ hsize_t diff_ullong(unsigned char *mem1, if (labs((long)(temp1_ullong-temp2_ullong)) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3544,7 +3544,7 @@ hsize_t diff_ullong(unsigned char *mem1, if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3560,7 +3560,7 @@ hsize_t diff_ullong(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -3571,10 +3571,10 @@ hsize_t diff_ullong(unsigned char *mem1, memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); - if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > options->percent && + if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > options->percent && labs((long)(temp1_ullong-temp2_ullong)) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3589,8 +3589,8 @@ hsize_t diff_ullong(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -3600,7 +3600,7 @@ hsize_t diff_ullong(unsigned char *mem1, if (temp1_ullong != temp2_ullong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); |