mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-17 16:10:24 +08:00
[svn-r7527] Purpose:
Code cleanup Description: Clean up a few loose ends and warnings for the 1.6 compatibility changes to the error API. Platforms tested: FreeBSD 4.9 (sleipnir) too minor to require h5committest
This commit is contained in:
parent
c48165cb11
commit
c58d85f10e
@ -168,7 +168,7 @@ display_error_cb (hid_t estack, void UNUSED *client_data)
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
H5Eprint(stdout);
|
||||
#else
|
||||
H5Eprint(H5E_DEFAULT, stdout);
|
||||
H5Eprint(estack, stdout);
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
|
||||
return 0;
|
||||
|
38
src/H5E.c
38
src/H5E.c
@ -114,7 +114,11 @@ static herr_t H5E_clear_entries(H5E_t *estack, unsigned nentries);
|
||||
static herr_t H5E_print(const H5E_t *estack, FILE *stream);
|
||||
static herr_t H5E_walk (const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func,
|
||||
void *client_data);
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
static herr_t H5E_walk_cb(int n, H5E_error_t *err_desc, void *client_data);
|
||||
#else /* H5_WANT_H5_V1_6_COMPAT */
|
||||
static herr_t H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data);
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
static herr_t H5E_get_auto(const H5E_t *estack, H5E_auto_t *func, void **client_data);
|
||||
static herr_t H5E_set_auto(H5E_t *estack, H5E_auto_t func, void *client_data);
|
||||
|
||||
@ -777,7 +781,7 @@ H5Eget_major(H5E_major_t maj)
|
||||
/* Don't know who is going to free it */
|
||||
msg_str = (char*)HDmalloc((++size)*sizeof(char));
|
||||
|
||||
if(H5E_get_msg(msg, NULL, msg_str, size)<0)
|
||||
if(H5E_get_msg(msg, NULL, msg_str, (size_t)size)<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text")
|
||||
|
||||
ret_value = msg_str;
|
||||
@ -827,7 +831,7 @@ H5Eget_minor(H5E_minor_t min)
|
||||
/* Don't know who is going to free it */
|
||||
msg_str = (char*)HDmalloc((++size)*sizeof(char));
|
||||
|
||||
if(H5E_get_msg(msg, NULL, msg_str, size)<0)
|
||||
if(H5E_get_msg(msg, NULL, msg_str, (size_t)size)<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text")
|
||||
|
||||
ret_value = msg_str;
|
||||
@ -835,8 +839,8 @@ H5Eget_minor(H5E_minor_t min)
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
}
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
|
||||
#else
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Eget_msg
|
||||
@ -872,7 +876,6 @@ H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg_str, size_t size)
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
}
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -1785,7 +1788,7 @@ done:
|
||||
herr_t
|
||||
H5Eprint(FILE *stream)
|
||||
{
|
||||
H5E_t *estack = NULL; /* Error stack to operate on */
|
||||
H5E_t *estack; /* Error stack to operate on */
|
||||
herr_t ret_value=SUCCEED; /* Return value */
|
||||
|
||||
/* Don't clear the error stack! :-) */
|
||||
@ -2062,6 +2065,16 @@ H5E_walk (const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void
|
||||
/* Walk the stack if a callback function was given */
|
||||
if(func) {
|
||||
status=SUCCEED;
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
if (H5E_WALK_UPWARD==direction) {
|
||||
for (i=0; i<(int)estack->nused && status>=0; i++)
|
||||
status = (func)(i, estack->slot+i, client_data);
|
||||
} else {
|
||||
H5_CHECK_OVERFLOW(estack->nused-1,size_t,int);
|
||||
for (i=(int)(estack->nused-1); i>=0 && status>=0; i--)
|
||||
status = (func)((int)estack->nused-(i+1), estack->slot+i, client_data);
|
||||
}
|
||||
#else /* H5_WANT_H5_V1_6_COMPAT */
|
||||
if (H5E_WALK_UPWARD==direction) {
|
||||
for (i=0; i<(int)estack->nused && status>=0; i++)
|
||||
status = (func)((unsigned)i, estack->slot+i, client_data);
|
||||
@ -2070,6 +2083,7 @@ H5E_walk (const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void
|
||||
for (i=(int)(estack->nused-1); i>=0 && status>=0; i--)
|
||||
status = (func)(estack->nused-(size_t)(i+1), estack->slot+i, client_data);
|
||||
}
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
if(status<0)
|
||||
HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack")
|
||||
} /* end if */
|
||||
@ -2112,8 +2126,13 @@ done:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
static herr_t
|
||||
H5E_walk_cb(int n, H5E_error_t *err_desc, void *client_data)
|
||||
#else /* H5_WANT_H5_V1_6_COMPAT */
|
||||
static herr_t
|
||||
H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data)
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
{
|
||||
H5E_print_t *eprint = (H5E_print_t *)client_data;
|
||||
FILE *stream; /* I/O stream to print output to */
|
||||
@ -2177,10 +2196,17 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data)
|
||||
have_desc=0;
|
||||
|
||||
/* Print error message */
|
||||
fprintf (stream, "%*s#%03u: %s line %u in %s()%s%s\n",
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
fprintf (stream, "%*s#%03d: %s line %u in %s()%s%s\n",
|
||||
H5E_INDENT, "", n, err_desc->file_name, err_desc->line,
|
||||
err_desc->func_name, (have_desc ? ": " : ""),
|
||||
(err_desc->desc ? err_desc->desc : ""));
|
||||
#else /* H5_WANT_H5_V1_6_COMPAT */
|
||||
fprintf (stream, "%*s#%03u: %s line %u in %s()%s%s\n",
|
||||
H5E_INDENT, "", n, err_desc->file_name, err_desc->line,
|
||||
err_desc->func_name, (have_desc ? ": " : ""),
|
||||
(have_desc ? err_desc->desc : ""));
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
fprintf (stream, "%*smajor: %s\n", H5E_INDENT*2, "", maj_str);
|
||||
fprintf (stream, "%*sminor: %s\n", H5E_INDENT*2, "", min_str);
|
||||
|
||||
|
@ -157,10 +157,11 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* Error stack traversal callback function pointers */
|
||||
typedef herr_t (*H5E_walk_t)(unsigned n, const H5E_error_t *err_desc, void *client_data);
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
typedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void *client_data);
|
||||
typedef herr_t (*H5E_auto_t)(void *client_data);
|
||||
#else
|
||||
typedef herr_t (*H5E_walk_t)(unsigned n, const H5E_error_t *err_desc, void *client_data);
|
||||
typedef herr_t (*H5E_auto_t)(hid_t estack, void *client_data);
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
|
||||
@ -172,6 +173,7 @@ H5_DLL hid_t H5Ecreate_msg(hid_t cls, H5E_type_t msg_type, const char *msg);
|
||||
H5_DLL hid_t H5Eget_current_stack(void);
|
||||
H5_DLL herr_t H5Eclose_stack(hid_t stack_id);
|
||||
H5_DLL ssize_t H5Eget_class_name(hid_t class_id, char *name, size_t size);
|
||||
H5_DLL ssize_t H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg, size_t size);
|
||||
H5_DLL int H5Eget_num(hid_t error_stack_id);
|
||||
H5_DLL herr_t H5Eset_current_stack(hid_t err_stack_id);
|
||||
H5_DLL herr_t H5Epop(hid_t err_stack, size_t count);
|
||||
@ -195,7 +197,6 @@ H5_DLL herr_t H5Ewalk(hid_t err_stack, H5E_direction_t direction, H5E_walk_t fu
|
||||
H5_DLL herr_t H5Eget_auto(hid_t estack_id, H5E_auto_t *func, void **client_data);
|
||||
H5_DLL herr_t H5Eset_auto(hid_t estack_id, H5E_auto_t func, void *client_data);
|
||||
H5_DLL herr_t H5Eclear(hid_t err_stack);
|
||||
H5_DLL ssize_t H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg, size_t size);
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
|
||||
#define DSET_NAME "a_dataset"
|
||||
#define FAKE_ID -1
|
||||
|
||||
herr_t custom_print_cb(unsigned n, const H5E_error_t *err_desc, void* client_data);
|
||||
herr_t custom_print_cb(int n, H5E_error_t *err_desc, void* client_data);
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -61,12 +61,10 @@ herr_t custom_print_cb(unsigned n, const H5E_error_t *err_desc, void* client_dat
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef TMP
|
||||
static herr_t
|
||||
test_error(hid_t file)
|
||||
{
|
||||
hid_t dataset, space;
|
||||
hid_t estack_id;
|
||||
hsize_t dims[2];
|
||||
const char *FUNC_test_error="test_error";
|
||||
H5E_auto_t old_func;
|
||||
@ -94,7 +92,6 @@ test_error(hid_t file)
|
||||
}
|
||||
|
||||
/* Test enabling and disabling default printing */
|
||||
#ifndef TMP
|
||||
if (H5Eget_auto(&old_func, &old_data)<0)
|
||||
TEST_ERROR;
|
||||
if (old_data != NULL)
|
||||
@ -106,7 +103,6 @@ test_error(hid_t file)
|
||||
|
||||
if(H5Eset_auto(NULL, NULL)<0)
|
||||
TEST_ERROR;
|
||||
#endif
|
||||
|
||||
/* Make H5Dwrite fail, verify default print is disabled */
|
||||
if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2)<0) {
|
||||
@ -126,31 +122,6 @@ test_error(hid_t file)
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: error_stack
|
||||
*
|
||||
* Purpose: Dummy function. Simply make it fail.
|
||||
*
|
||||
* Return: Success: 0
|
||||
*
|
||||
* Failure: -1
|
||||
*
|
||||
* Programmer: Raymond Lu
|
||||
* July 14, 2003
|
||||
*
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
error_stack(void)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -207,11 +178,11 @@ dump_error(void)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
custom_print_cb(unsigned n, const H5E_error_t *err_desc, void* client_data)
|
||||
custom_print_cb(int n, H5E_error_t *err_desc, void* client_data)
|
||||
{
|
||||
FILE *stream = (FILE *)client_data;
|
||||
char *maj;
|
||||
char *min;
|
||||
const char *maj;
|
||||
const char *min;
|
||||
const int indent = 4;
|
||||
|
||||
if((min = H5Eget_minor(err_desc->min_num))==NULL)
|
||||
@ -224,7 +195,9 @@ custom_print_cb(unsigned n, const H5E_error_t *err_desc, void* client_data)
|
||||
indent, "", n, err_desc->file_name,
|
||||
err_desc->func_name, err_desc->line);
|
||||
fprintf (stream, "%*smajor: %s\n", indent*2, "", maj);
|
||||
HDfree(maj);
|
||||
fprintf (stream, "%*sminor: %s\n", indent*2, "", min);
|
||||
HDfree(min);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -251,8 +224,6 @@ main(void)
|
||||
hid_t file, fapl;
|
||||
char filename[1024];
|
||||
const char *FUNC_main="main";
|
||||
H5E_auto_t old_func;
|
||||
void *old_data;
|
||||
|
||||
fprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There're supposed to be some error messages\n");
|
||||
/*h5_reset();*/
|
||||
@ -263,17 +234,16 @@ main(void)
|
||||
TEST_ERROR ;
|
||||
|
||||
/* Test error stack */
|
||||
if(error_stack()<0) {
|
||||
/* Push an error onto error stack */
|
||||
H5Epush(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADVALUE,
|
||||
"Error test failed");
|
||||
|
||||
/* Print out the errors on stack */
|
||||
dump_error();
|
||||
|
||||
/* Empty error stack */
|
||||
H5Eclear();
|
||||
}
|
||||
/* Push an error onto error stack */
|
||||
H5Epush(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADVALUE,
|
||||
"Error test failed");
|
||||
|
||||
/* Print out the errors on stack */
|
||||
dump_error();
|
||||
|
||||
/* Empty error stack */
|
||||
H5Eclear();
|
||||
|
||||
/* Test error API */
|
||||
if(test_error(file)<0) {
|
||||
|
@ -89,7 +89,11 @@ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
|
||||
*/
|
||||
static const char *multi_letters = "msbrglo";
|
||||
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
static herr_t h5_errors(void *client_data);
|
||||
#else /* H5_WANT_H5_V1_6_COMPAT */
|
||||
static herr_t h5_errors(hid_t err_stack, void *client_data);
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -108,8 +112,13 @@ static herr_t h5_errors(hid_t err_stack, void *client_data);
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
static herr_t
|
||||
h5_errors(void UNUSED *client_data)
|
||||
#else
|
||||
static herr_t
|
||||
h5_errors(hid_t err_stack, void UNUSED *client_data)
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
{
|
||||
H5_FAILED();
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
|
@ -126,7 +126,7 @@ main(void)
|
||||
goto error;
|
||||
}
|
||||
for (i=0; i<NOBJS; i++) {
|
||||
H5HL_t *heap = NULL;
|
||||
const H5HL_t *heap = NULL;
|
||||
|
||||
sprintf(buf, "%03d-", i);
|
||||
for (j=4; j<i; j++) buf[j] = '0' + j%10;
|
||||
|
@ -2648,7 +2648,7 @@ test_misc16(void)
|
||||
hid_t file; /* File ID */
|
||||
herr_t ret; /* Generic return value */
|
||||
const char wdata[MISC16_SPACE_DIM][MISC16_STR_SIZE] =
|
||||
{"1234567", "1234567\0", "12345678", NULL};
|
||||
{"1234567", "1234567\0", "12345678", {NULL}};
|
||||
char rdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; /* Information read in */
|
||||
hid_t dataset; /* Dataset ID */
|
||||
hid_t sid; /* Dataspace ID */
|
||||
@ -2729,7 +2729,7 @@ test_misc17(void)
|
||||
hid_t file; /* File ID */
|
||||
herr_t ret; /* Generic return value */
|
||||
const char wdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2] =
|
||||
{"1234567", "1234567\0", "12345678", NULL};
|
||||
{"1234567", "1234567\0", "12345678", {NULL}};
|
||||
char rdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; /* Information read in */
|
||||
hid_t dataset; /* Dataset ID */
|
||||
hid_t sid; /* Dataspace ID */
|
||||
|
@ -57,10 +57,11 @@
|
||||
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
static herr_t error_callback(void *);
|
||||
static herr_t walk_error_callback(int, H5E_error_t *, void *);
|
||||
#else /*H5_WANT_H5_V1_6_COMPAT*/
|
||||
static herr_t error_callback(hid_t, void *);
|
||||
static herr_t walk_error_callback(unsigned, const H5E_error_t *, void *);
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
static herr_t walk_error_callback(unsigned, H5E_error_t *, void *);
|
||||
static void *tts_error_thread(void *);
|
||||
|
||||
/* Global variables */
|
||||
@ -228,8 +229,13 @@ herr_t error_callback(hid_t estack, void *client_data)
|
||||
}
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
|
||||
#ifdef H5_WANT_H5_V1_6_COMPAT
|
||||
static
|
||||
herr_t walk_error_callback(unsigned n, H5E_error_t *err_desc, void UNUSED *client_data)
|
||||
herr_t walk_error_callback(int n, H5E_error_t *err_desc, void UNUSED *client_data)
|
||||
#else /* H5_WANT_H5_V1_6_COMPAT */
|
||||
static
|
||||
herr_t walk_error_callback(unsigned n, const H5E_error_t *err_desc, void UNUSED *client_data)
|
||||
#endif /* H5_WANT_H5_V1_6_COMPAT */
|
||||
{
|
||||
hid_t maj_num, min_num;
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user