diff options
Diffstat (limited to 'tools/h5diff/h5diff.c')
-rw-r--r-- | tools/h5diff/h5diff.c | 388 |
1 files changed, 194 insertions, 194 deletions
diff --git a/tools/h5diff/h5diff.c b/tools/h5diff/h5diff.c index 801a762..0e18b11 100644 --- a/tools/h5diff/h5diff.c +++ b/tools/h5diff/h5diff.c @@ -62,18 +62,18 @@ options_t options = {0,0,0,0,0,0,0}; */ static int diff_dataset( hid_t file1_id, hid_t file2_id, const char *obj1_name, - const char *obj2_name, options_t options ); + const char *obj2_name, options_t opts ); static int diff( hid_t file1_id, const char *obj1_name, hid_t file2_id, const char *obj2_name, - options_t options, int type ); + options_t opts, int type ); static int compare( hid_t file1_id, const char *file1_name, const char *obj1_name, int nobjects1, info_t *info1, hid_t file2_id, const char *file2_name, const char *obj2_name, int nobjects2, info_t *info2, - options_t options ); + options_t opts ); static int match( hid_t file1_id, int nobjects1, info_t *info1, - hid_t file2_id, int nobjects2, info_t *info2, options_t options ); + hid_t file2_id, int nobjects2, info_t *info2, options_t opts ); static int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims, - options_t options, const char *obj1, const char *obj2, + options_t opts, const char *obj1, const char *obj2, hid_t m_type ); /*------------------------------------------------------------------------- @@ -572,7 +572,7 @@ int compare_object( char *obj1, char *obj2 ) */ static int match( hid_t file1_id, int nobjects1, info_t *info1, - hid_t file2_id, int nobjects2, info_t *info2, options_t options ) + hid_t file2_id, int nobjects2, info_t *info2, options_t opts ) { int cmp; int more_names_exist = (nobjects1>0 && nobjects2>0) ? 1 : 0; @@ -669,7 +669,7 @@ int match( hid_t file1_id, int nobjects1, info_t *info1, if ( table->objs[i].flags[0] && table->objs[i].flags[1] ) nfound+=diff( file1_id, table->objs[i].objname, file2_id, table->objs[i].objname, - options, table->objs[i].type ); + opts, table->objs[i].type ); } /* free table */ @@ -741,7 +741,7 @@ int compare( hid_t file1_id, const char *file1_name, const char *obj1_name, int nobjects1, info_t *info1, hid_t file2_id, const char *file2_name, const char *obj2_name, int nobjects2, info_t *info2, - options_t options ) + options_t opts ) { int f1=0, f2=0; @@ -777,7 +777,7 @@ int compare( hid_t file1_id, const char *file1_name, const char *obj1_name, return 0; } - nfound=diff( file1_id, obj1_name, file2_id, obj2_name, options, info1[i].type ); + nfound=diff( file1_id, obj1_name, file2_id, obj2_name, opts, info1[i].type ); return nfound; } @@ -803,14 +803,14 @@ int compare( hid_t file1_id, const char *file1_name, const char *obj1_name, static int diff( hid_t file1_id, const char *obj1_name, hid_t file2_id, const char *obj2_name, - options_t options, int type ) + options_t opts, int type ) { int nfound=0; switch ( type ) { case H5G_DATASET: - nfound=diff_dataset(file1_id,file2_id,obj1_name,obj2_name,options); + nfound=diff_dataset(file1_id,file2_id,obj1_name,obj2_name,opts); break; default: @@ -845,7 +845,7 @@ int diff( hid_t file1_id, const char *obj1_name, hid_t file2_id, const char *obj */ static int diff_dataset( hid_t file1_id, hid_t file2_id, const char *obj1_name, - const char *obj2_name, options_t options ) + const char *obj2_name, options_t opts ) { hid_t dset1_id =-1; hid_t dset2_id =-1; @@ -1182,7 +1182,7 @@ int diff_dataset( hid_t file1_id, hid_t file2_id, const char *obj1_name, printf( "Comparing <%s> with <%s>\n", obj1_name, obj2_name ); name1=h5diff_basename(obj1_name); name2=h5diff_basename(obj2_name); - nfound = array_diff(buf1,buf2,tot_cnt1,rank1,dims1,options,name1,name2,m_type1); + nfound = array_diff(buf1,buf2,tot_cnt1,rank1,dims1,opts,name1,name2,m_type1); printf("%d differences found\n", nfound ); /*------------------------------------------------------------------------- @@ -1231,7 +1231,7 @@ out: */ static int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims, - options_t options, const char *obj1, const char *obj2, + options_t opts, const char *obj1, const char *obj2, hid_t m_type ) { char fmt_llong[255], fmt_ullong[255]; @@ -1281,13 +1281,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_char, _buf1, sizeof(char)); memcpy(&temp2_char, _buf2, sizeof(char)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs(temp1_char-temp2_char) > options.delta) + if (abs(temp1_char-temp2_char) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1297,13 +1297,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options.percent ) + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1314,14 +1314,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options.percent && - abs(temp1_char-temp2_char) > options.delta ) + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > opts.percent && + abs(temp1_char-temp2_char) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1333,9 +1333,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_char != temp2_char) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1365,13 +1365,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_uchar, _buf1, sizeof(unsigned char)); memcpy(&temp2_uchar, _buf2, sizeof(unsigned char)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs(temp1_uchar-temp2_uchar) > options.delta) + if (abs(temp1_uchar-temp2_uchar) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1381,13 +1381,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options.percent ) + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1398,14 +1398,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options.percent && - abs(temp1_uchar-temp2_uchar) > options.delta ) + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > opts.percent && + abs(temp1_uchar-temp2_uchar) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1417,9 +1417,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_uchar != temp2_uchar) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1450,13 +1450,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_short, _buf1, sizeof(short)); memcpy(&temp2_short, _buf2, sizeof(short)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs(temp1_short-temp2_short) > options.delta) + if (abs(temp1_short-temp2_short) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1466,13 +1466,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options.percent ) + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1483,14 +1483,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options.percent && - abs(temp1_short-temp2_short) > options.delta ) + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > opts.percent && + abs(temp1_short-temp2_short) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1502,9 +1502,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_short != temp2_short) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1534,13 +1534,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_ushort, _buf1, sizeof(unsigned short)); memcpy(&temp2_ushort, _buf2, sizeof(unsigned short)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs(temp1_ushort-temp2_ushort) > options.delta) + if (abs(temp1_ushort-temp2_ushort) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1550,13 +1550,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options.percent ) + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1567,14 +1567,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options.percent && - abs(temp1_ushort-temp2_ushort) > options.delta ) + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > opts.percent && + abs(temp1_ushort-temp2_ushort) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1586,9 +1586,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_ushort != temp2_ushort) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1619,13 +1619,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_int, _buf1, sizeof(int)); memcpy(&temp2_int, _buf2, sizeof(int)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs(temp1_int-temp2_int) > options.delta) + if (abs(temp1_int-temp2_int) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1635,13 +1635,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options.percent ) + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1652,14 +1652,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options.percent && - abs(temp1_int-temp2_int) > options.delta ) + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > opts.percent && + abs(temp1_int-temp2_int) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1671,9 +1671,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_int != temp2_int) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1704,13 +1704,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_uint, _buf1, sizeof(unsigned int)); memcpy(&temp2_uint, _buf2, sizeof(unsigned int)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs((int)(temp1_uint-temp2_uint)) > options.delta) + if (abs((int)(temp1_uint-temp2_uint)) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1720,13 +1720,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.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)) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1737,14 +1737,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options.percent && - abs((int)(temp1_uint-temp2_uint)) > options.delta ) + if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > opts.percent && + abs((int)(temp1_uint-temp2_uint)) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1756,9 +1756,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_uint != temp2_uint) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1789,13 +1789,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_long, _buf1, sizeof(long)); memcpy(&temp2_long, _buf2, sizeof(long)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (labs(temp1_long-temp2_long) > (long)options.delta) + if (labs(temp1_long-temp2_long) > (long)opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1805,13 +1805,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.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)opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1822,14 +1822,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options.percent && - labs(temp1_long-temp2_long) > (long)options.delta ) + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)opts.percent && + labs(temp1_long-temp2_long) > (long)opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1841,9 +1841,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_long != temp2_long) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1873,13 +1873,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_ulong, _buf1, sizeof(unsigned long)); memcpy(&temp2_ulong, _buf2, sizeof(unsigned long)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (labs((long)(temp1_ulong-temp2_ulong)) > (long)options.delta) + if (labs((long)(temp1_ulong-temp2_ulong)) > (long)opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1889,13 +1889,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.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)opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1906,14 +1906,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options.percent && - labs((long)(temp1_ulong-temp2_ulong)) > (long)options.delta ) + if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)opts.percent && + labs((long)(temp1_ulong-temp2_ulong)) > (long)opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1925,9 +1925,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_ulong != temp2_ulong) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1957,13 +1957,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_llong, _buf1, sizeof(long_long)); memcpy(&temp2_llong, _buf2, sizeof(long_long)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (labs((long)(temp1_llong-temp2_llong)) > (long)options.delta) + if (labs((long)(temp1_llong-temp2_llong)) > (long)opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1973,13 +1973,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.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)opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1990,14 +1990,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options.percent && - labs((long)(temp1_llong-temp2_llong)) > (long)options.delta ) + if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)opts.percent && + labs((long)(temp1_llong-temp2_llong)) > (long)opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2009,9 +2009,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_llong != temp2_llong) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2041,13 +2041,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_ullong, _buf1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, _buf2, sizeof(unsigned long_long)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (labs((long)(temp1_ullong-temp2_ullong)) > (long)options.delta) + if (labs((long)(temp1_ullong-temp2_ullong)) > (long)opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2058,13 +2058,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.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)opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2076,14 +2076,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options.percent && - labs((long)(temp1_ullong-temp2_ullong)) > (long)options.delta ) + if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)opts.percent && + labs((long)(temp1_ullong-temp2_ullong)) > (long)opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2096,9 +2096,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_ullong != temp2_ullong) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2129,13 +2129,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_float, _buf1, sizeof(float)); memcpy(&temp2_float, _buf2, sizeof(float)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (fabs(temp1_float-temp2_float) > options.delta) + if (fabs(temp1_float-temp2_float) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2145,13 +2145,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options.percent ) + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2162,14 +2162,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options.percent && - fabs(temp1_float-temp2_float) > options.delta ) + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > opts.percent && + fabs(temp1_float-temp2_float) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2181,9 +2181,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_float != temp2_float) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2213,13 +2213,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_double, _buf1, sizeof(double)); memcpy(&temp2_double, _buf2, sizeof(double)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (fabs(temp1_double-temp2_double) > options.delta) + if (fabs(temp1_double-temp2_double) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2229,13 +2229,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options.percent ) + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2246,14 +2246,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options.percent && - fabs(temp1_double-temp2_double) > options.delta ) + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > opts.percent && + fabs(temp1_double-temp2_double) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2265,9 +2265,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_double != temp2_double) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); |