summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-09-16 16:22:16 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-09-16 16:22:16 (GMT)
commitb9be0455961ca1098bc4977bf1138394932b75db (patch)
tree8bf7377bbda85d614e4e5984c5a1a59ac323310e /tools/lib
parent37a1f87664a1b2026e1d2a1dd5033eb2e8b1f5fc (diff)
downloadhdf5-b9be0455961ca1098bc4977bf1138394932b75db.zip
hdf5-b9be0455961ca1098bc4977bf1138394932b75db.tar.gz
hdf5-b9be0455961ca1098bc4977bf1138394932b75db.tar.bz2
[svn-r15629] Description:
Remove trailing whitespace from C/C++ source files, with the following script: foreach f (*.[ch] *.cpp) sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f end Tested on: Mac OS X/32 10.5.5 (amazon) No need for h5committest, just whitespace changes...
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c234
-rw-r--r--tools/lib/h5diff_array.c1188
-rw-r--r--tools/lib/h5diff_attr.c104
-rw-r--r--tools/lib/h5diff_dset.c98
-rw-r--r--tools/lib/h5diff_util.c4
-rw-r--r--tools/lib/h5tools.c112
-rw-r--r--tools/lib/h5tools.h2
-rw-r--r--tools/lib/h5tools_str.c4
-rw-r--r--tools/lib/h5tools_type.c26
9 files changed, 886 insertions, 886 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 3bd6fb3..0022860 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -53,7 +53,7 @@ print_objname (diff_opt_t * options, hsize_t nfound)
/*-------------------------------------------------------------------------
* Function: do_print_objname
*
- * Purpose: print object name
+ * Purpose: print object name
*
*-------------------------------------------------------------------------
*/
@@ -195,7 +195,7 @@ hsize_t h5diff(const char *fname1,
HDmemset(filenames, 0, 1024 * 2);
- if(options->m_quiet && (options->m_verbose || options->m_report))
+ if(options->m_quiet && (options->m_verbose || options->m_report))
{
printf("Error: -q (quiet mode) cannot be added to verbose or report modes\n");
options->err_stat=1;
@@ -208,10 +208,10 @@ hsize_t h5diff(const char *fname1,
*/
/* disable error reporting */
- H5E_BEGIN_TRY
+ H5E_BEGIN_TRY
{
/* open the files */
- if((file1_id = H5Fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ if((file1_id = H5Fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
{
printf("h5diff: <%s>: unable to open file\n", fname1);
options->err_stat = 1;
@@ -223,7 +223,7 @@ hsize_t h5diff(const char *fname1,
#endif
goto out;
} /* end if */
- if((file2_id = H5Fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ if((file2_id = H5Fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
{
printf("h5diff: <%s>: unable to open file\n", fname2);
options->err_stat = 1;
@@ -264,7 +264,7 @@ hsize_t h5diff(const char *fname1,
* object name was supplied
*-------------------------------------------------------------------------
*/
- if( objname1 )
+ if( objname1 )
{
#ifdef H5_HAVE_PARALLEL
if(g_Parallel)
@@ -273,13 +273,13 @@ hsize_t h5diff(const char *fname1,
#endif
assert(objname2);
options->cmn_objs = 1; /* eliminate warning */
- nfound = diff_compare(file1_id,
- fname1,
- objname1,
+ nfound = diff_compare(file1_id,
+ fname1,
+ objname1,
info1,
- file2_id,
- fname2,
- objname2,
+ file2_id,
+ fname2,
+ objname2,
info2,
options);
} /* end if */
@@ -289,14 +289,14 @@ hsize_t h5diff(const char *fname1,
*-------------------------------------------------------------------------
*/
- else
+ else
{
#ifdef H5_HAVE_PARALLEL
- if(g_Parallel)
+ if(g_Parallel)
{
int i;
- if((HDstrlen(fname1) > 1024) || (HDstrlen(fname2) > 1024))
+ if((HDstrlen(fname1) > 1024) || (HDstrlen(fname2) > 1024))
{
fprintf(stderr, "The parallel diff only supports path names up to 1024 characters\n");
MPI_Abort(MPI_COMM_WORLD, 0);
@@ -311,10 +311,10 @@ hsize_t h5diff(const char *fname1,
} /* end if */
#endif
- nfound = diff_match(file1_id,
- info1,
- file2_id,
- info2,
+ nfound = diff_match(file1_id,
+ info1,
+ file2_id,
+ info2,
options);
} /* end else */
@@ -323,7 +323,7 @@ hsize_t h5diff(const char *fname1,
out:
/* close */
- H5E_BEGIN_TRY
+ H5E_BEGIN_TRY
{
H5Fclose(file1_id);
H5Fclose(file2_id);
@@ -373,7 +373,7 @@ hsize_t diff_match(hid_t file1_id,
curr1 = 0;
curr2 = 0;
- while(curr1 < info1->nused && curr2 < info2->nused)
+ while(curr1 < info1->nused && curr2 < info2->nused)
{
/* criteria is string compare */
int cmp = HDstrcmp(info1->paths[curr1].path, info2->paths[curr2].path);
@@ -386,14 +386,14 @@ hsize_t diff_match(hid_t file1_id,
curr1++;
curr2++;
} /* end if */
- else if(cmp < 0)
+ else if(cmp < 0)
{
infile[0] = 1;
infile[1] = 0;
trav_table_addflags(infile, info1->paths[curr1].path, info1->paths[curr1].type, table);
curr1++;
} /* end else-if */
- else
+ else
{
infile[0] = 0;
infile[1] = 1;
@@ -405,7 +405,7 @@ hsize_t diff_match(hid_t file1_id,
/* list1 did not end */
infile[0] = 1;
infile[1] = 0;
- while(curr1 < info1->nused)
+ while(curr1 < info1->nused)
{
trav_table_addflags(infile, info1->paths[curr1].path, info1->paths[curr1].type, table);
curr1++;
@@ -414,7 +414,7 @@ hsize_t diff_match(hid_t file1_id,
/* list2 did not end */
infile[0] = 0;
infile[1] = 1;
- while(curr2 < info2->nused)
+ while(curr2 < info2->nused)
{
trav_table_addflags(infile, info2->paths[curr2].path, info2->paths[curr2].type, table);
curr2++;
@@ -424,7 +424,7 @@ hsize_t diff_match(hid_t file1_id,
* print the list
*-------------------------------------------------------------------------
*/
- if(options->m_verbose)
+ if(options->m_verbose)
{
printf("\n");
printf("file1 file2\n");
@@ -450,22 +450,22 @@ hsize_t diff_match(hid_t file1_id,
{
/* assume equal contents initially */
options->contents = 1;
-
+
/* number of different objects */
if ( info1->nused != info2->nused )
{
options->contents = 0;
}
-
-
- for( i = 0; i < table->nobjs; i++)
+
+
+ for( i = 0; i < table->nobjs; i++)
{
- if( table->objs[i].flags[0] != table->objs[i].flags[1] )
+ if( table->objs[i].flags[0] != table->objs[i].flags[1] )
{
options->contents = 0;
}
}
-
+
}
@@ -487,12 +487,12 @@ hsize_t diff_match(hid_t file1_id,
HDmemset(workerTasks, 1, (g_nTasks - 1));
#endif
- for(i = 0; i < table->nobjs; i++)
+ for(i = 0; i < table->nobjs; i++)
{
- if( table->objs[i].flags[0] && table->objs[i].flags[1])
+ if( table->objs[i].flags[0] && table->objs[i].flags[1])
{
options->cmn_objs = 1;
- if(!g_Parallel)
+ if(!g_Parallel)
{
nfound += diff(file1_id,
table->objs[i].name,
@@ -500,7 +500,7 @@ hsize_t diff_match(hid_t file1_id,
table->objs[i].name, options, table->objs[i].type);
} /* end if */
#ifdef H5_HAVE_PARALLEL
- else
+ else
{
int workerFound = 0;
@@ -514,7 +514,7 @@ hsize_t diff_match(hid_t file1_id,
*/
/*Set up args to pass to worker task. */
- if(HDstrlen(table->objs[i].name) > 255)
+ if(HDstrlen(table->objs[i].name) > 255)
{
printf("The parallel diff only supports object names up to 255 characters\n");
MPI_Abort(MPI_COMM_WORLD, 0);
@@ -526,7 +526,7 @@ hsize_t diff_match(hid_t file1_id,
h5diffdebug2("busyTasks=%d\n", busyTasks);
/* if there are any outstanding print requests, let's handle one. */
- if(busyTasks > 0)
+ if(busyTasks > 0)
{
int incomingMessage;
@@ -534,7 +534,7 @@ hsize_t diff_match(hid_t file1_id,
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &incomingMessage, &Status);
/* first block*/
- if(incomingMessage)
+ if(incomingMessage)
{
workerTasks[Status.MPI_SOURCE - 1] = 1;
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status);
@@ -544,7 +544,7 @@ hsize_t diff_match(hid_t file1_id,
} /* end if */
/* check to see if the print token was returned. */
- if(!havePrintToken)
+ if(!havePrintToken)
{
/* If we don't have the token, someone is probably sending us output */
print_incoming_data();
@@ -564,11 +564,11 @@ hsize_t diff_match(hid_t file1_id,
} /* end if */
/* check to see if anyone needs the print token. */
- if(havePrintToken)
+ if(havePrintToken)
{
/* check incoming queue for print token requests */
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &incomingMessage, &Status);
- if(incomingMessage)
+ if(incomingMessage)
{
MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status);
MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD);
@@ -580,9 +580,9 @@ hsize_t diff_match(hid_t file1_id,
/* check array of tasks to see which ones are free.
* Manager task never does work, so freeTasks[0] is really
* worker task 0. */
- for(n = 1; (n < g_nTasks) && !workerFound; n++)
+ for(n = 1; (n < g_nTasks) && !workerFound; n++)
{
- if(workerTasks[n-1])
+ if(workerTasks[n-1])
{
/* send file id's and names to first free worker */
MPI_Send(&args, sizeof(args), MPI_BYTE, n, MPI_TAG_ARGS, MPI_COMM_WORLD);
@@ -597,7 +597,7 @@ hsize_t diff_match(hid_t file1_id,
} /* end for */
h5diffdebug2("workerfound is %d \n", workerFound);
- if(!workerFound)
+ if(!workerFound)
{
/* if they were all busy, we've got to wait for one free up
* before we can move on. If we don't have the token, some
@@ -605,15 +605,15 @@ hsize_t diff_match(hid_t file1_id,
* return it.
*/
- if(!havePrintToken)
+ if(!havePrintToken)
{
- while(!havePrintToken)
+ while(!havePrintToken)
{
int incomingMessage;
print_incoming_data();
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status);
- if(incomingMessage)
+ if(incomingMessage)
{
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status);
havePrintToken = 1;
@@ -625,26 +625,26 @@ hsize_t diff_match(hid_t file1_id,
} /* end while */
} /* end if */
/* if we do have the token, check for task to free up, or wait for a task to request it */
- else
+ else
{
/* But first print all the data in our incoming queue */
print_incoming_data();
MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &Status);
- if(Status.MPI_TAG == MPI_TAG_DONE)
+ if(Status.MPI_TAG == MPI_TAG_DONE)
{
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD);
} /* end if */
- else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST)
+ else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST)
{
int incomingMessage;
MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status);
MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD);
- do
+ do
{
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status);
@@ -656,7 +656,7 @@ hsize_t diff_match(hid_t file1_id,
options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD);
} /* end else-if */
- else
+ else
{
printf("ERROR: Invalid tag (%d) received \n", Status.MPI_TAG);
MPI_Abort(MPI_COMM_WORLD, 0);
@@ -671,20 +671,20 @@ hsize_t diff_match(hid_t file1_id,
h5diffdebug("done with for loop\n");
#ifdef H5_HAVE_PARALLEL
- if(g_Parallel)
+ if(g_Parallel)
{
/* make sure all tasks are done */
- while(busyTasks > 0)
+ while(busyTasks > 0)
{
MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &Status);
- if(Status.MPI_TAG == MPI_TAG_DONE)
+ if(Status.MPI_TAG == MPI_TAG_DONE)
{
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp;
busyTasks--;
} /* end if */
- else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN)
+ else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN)
{
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
@@ -692,10 +692,10 @@ hsize_t diff_match(hid_t file1_id,
busyTasks--;
havePrintToken = 1;
} /* end else-if */
- else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST)
+ else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST)
{
MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status);
- if(havePrintToken)
+ if(havePrintToken)
{
int incomingMessage;
@@ -713,12 +713,12 @@ hsize_t diff_match(hid_t file1_id,
busyTasks--;
} /* end if */
/* someone else must have it...wait for them to return it, then give it to the task that just asked for it. */
- else
+ else
{
int source = Status.MPI_SOURCE;
int incomingMessage;
- do
+ do
{
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status);
@@ -733,7 +733,7 @@ hsize_t diff_match(hid_t file1_id,
MPI_Send(NULL, 0, MPI_BYTE, source, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD);
} /* end else */
} /* end else-if */
- else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN)
+ else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN)
{
MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status);
nfound += nFoundbyWorker.nfound;
@@ -750,7 +750,7 @@ hsize_t diff_match(hid_t file1_id,
printf("%s", data);
} /* end else-if */
- else
+ else
{
printf("ph5diff-manager: ERROR!! Invalid tag (%d) received \n", Status.MPI_TAG);
MPI_Abort(MPI_COMM_WORLD, 0);
@@ -803,10 +803,10 @@ hsize_t diff_compare(hid_t file1_id,
int f1 = 0;
int f2 = 0;
hsize_t nfound = 0;
-
+
ssize_t i = h5trav_getindex (info1, obj1_name);
ssize_t j = h5trav_getindex (info2, obj2_name);
-
+
if (i == -1)
{
parallel_print ("Object <%s> could not be found in <%s>\n", obj1_name,
@@ -824,11 +824,11 @@ hsize_t diff_compare(hid_t file1_id,
options->err_stat = 1;
return 0;
}
-
+
/* use the name with "/" first, as obtained by iterator function */
obj1_name = info1->paths[i].path;
obj2_name = info2->paths[j].path;
-
+
/* objects are not the same type */
if (info1->paths[i].type != info2->paths[j].type)
{
@@ -839,14 +839,14 @@ hsize_t diff_compare(hid_t file1_id,
options->not_cmp=1;
return 0;
}
-
- nfound = diff(file1_id,
- obj1_name,
- file2_id,
- obj2_name,
- options,
+
+ nfound = diff(file1_id,
+ obj1_name,
+ file2_id,
+ obj2_name,
+ options,
info1->paths[i].type);
-
+
return nfound;
}
@@ -872,9 +872,9 @@ hsize_t diff_compare(hid_t file1_id,
hsize_t diff(hid_t file1_id,
const char *path1,
- hid_t file2_id,
- const char *path2,
- diff_opt_t * options,
+ hid_t file2_id,
+ const char *path2,
+ diff_opt_t * options,
h5trav_type_t type)
{
hid_t type1_id = (-1);
@@ -883,8 +883,8 @@ hsize_t diff(hid_t file1_id,
hid_t grp2_id = (-1);
int ret;
hsize_t nfound = 0;
-
- switch(type)
+
+ switch(type)
{
/*-------------------------------------------------------------------------
* H5TRAV_TYPE_DATASET
@@ -895,7 +895,7 @@ hsize_t diff(hid_t file1_id,
* verbose, always print name
*-------------------------------------------------------------------------
*/
- if(options->m_verbose)
+ if(options->m_verbose)
{
if(print_objname(options, (hsize_t)1))
do_print_objname("dataset", path1, path2);
@@ -908,9 +908,9 @@ hsize_t diff(hid_t file1_id,
* disabling quiet mode
*-------------------------------------------------------------------------
*/
- else
+ else
{
- if(options->m_quiet == 0)
+ if(options->m_quiet == 0)
{
/* shut up temporarily */
options->m_quiet = 1;
@@ -918,7 +918,7 @@ hsize_t diff(hid_t file1_id,
/* print again */
options->m_quiet = 0;
- if(nfound)
+ if(nfound)
{
if(print_objname(options,nfound))
do_print_objname("dataset", path1, path2);
@@ -931,7 +931,7 @@ hsize_t diff(hid_t file1_id,
nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
} /* end else */
break;
-
+
/*-------------------------------------------------------------------------
* H5TRAV_TYPE_NAMED_DATATYPE
*-------------------------------------------------------------------------
@@ -941,20 +941,20 @@ hsize_t diff(hid_t file1_id,
goto out;
if((type2_id = H5Topen2(file2_id, path2, H5P_DEFAULT)) < 0)
goto out;
-
+
if((ret = H5Tequal(type1_id, type2_id)) < 0)
goto out;
-
+
/* if H5Tequal is > 0 then the datatypes refer to the same datatype */
nfound = (ret > 0) ? 0 : 1;
-
+
if(print_objname(options,nfound))
do_print_objname("datatype", path1, path2);
/* always print the number of differences found in verbose mode */
if(options->m_verbose)
print_found(nfound);
-
+
/*-------------------------------------------------------------------------
* compare attributes
* the if condition refers to cases when the dataset is a referenced object
@@ -962,30 +962,30 @@ hsize_t diff(hid_t file1_id,
*/
if(path1)
nfound += diff_attr(type1_id, type2_id, path1, path2, options);
-
+
if(H5Tclose(type1_id) < 0)
goto out;
if(H5Tclose(type2_id) < 0)
goto out;
break;
-
+
/*-------------------------------------------------------------------------
* H5TRAV_TYPE_GROUP
*-------------------------------------------------------------------------
*/
case H5TRAV_TYPE_GROUP:
ret = HDstrcmp(path1, path2);
-
+
/* if "path1" != "path2" then the groups are "different" */
nfound = (ret != 0) ? 1 : 0;
-
+
if(print_objname(options, nfound))
do_print_objname("group", path1, path2);
/* always print the number of differences found in verbose mode */
if(options->m_verbose)
print_found(nfound);
-
+
if((grp1_id = H5Gopen2(file1_id, path1, H5P_DEFAULT)) < 0)
goto out;
if((grp2_id = H5Gopen2(file2_id, path2, H5P_DEFAULT)) < 0)
@@ -998,14 +998,14 @@ hsize_t diff(hid_t file1_id,
*/
if(path1)
nfound += diff_attr(grp1_id, grp2_id, path1, path2, options);
-
+
if(H5Gclose(grp1_id) < 0)
goto out;
if(H5Gclose(grp2_id) < 0)
goto out;
break;
-
-
+
+
/*-------------------------------------------------------------------------
* H5TRAV_TYPE_LINK
*-------------------------------------------------------------------------
@@ -1014,37 +1014,37 @@ hsize_t diff(hid_t file1_id,
{
H5L_info_t li1, li2;
char *buf1, *buf2;
-
+
if(H5Lget_info(file1_id, path1, &li1, H5P_DEFAULT) < 0)
goto out;
if(H5Lget_info(file1_id, path1, &li2, H5P_DEFAULT) < 0)
goto out;
-
+
buf1 = HDmalloc(li1.u.val_size);
buf2 = HDmalloc(li2.u.val_size);
-
+
if(H5Lget_val(file1_id, path1, buf1, li1.u.val_size, H5P_DEFAULT) < 0)
goto out;
if(H5Lget_val(file2_id, path2, buf2, li2.u.val_size, H5P_DEFAULT) < 0)
goto out;
-
+
ret = HDstrcmp(buf1, buf2);
-
+
/* if "buf1" != "buf2" then the links are "different" */
nfound = (ret != 0) ? 1 : 0;
-
+
if(print_objname(options, nfound))
do_print_objname("link", path1, path2);
/* always print the number of differences found in verbose mode */
if(options->m_verbose)
print_found(nfound);
-
+
HDfree(buf1);
HDfree(buf2);
}
break;
-
+
/*-------------------------------------------------------------------------
* H5TRAV_TYPE_UDLINK
*-------------------------------------------------------------------------
@@ -1052,19 +1052,19 @@ hsize_t diff(hid_t file1_id,
case H5TRAV_TYPE_UDLINK:
{
H5L_info_t li1, li2;
-
+
if(H5Lget_info(file1_id, path1, &li1, H5P_DEFAULT) < 0)
goto out;
if(H5Lget_info(file1_id, path1, &li2, H5P_DEFAULT) < 0)
goto out;
-
+
/* Only external links will have a query function registered */
if(li1.type == H5L_TYPE_EXTERNAL && li2.type == H5L_TYPE_EXTERNAL) {
char *buf1, *buf2;
buf1 = HDmalloc(li1.u.val_size);
buf2 = HDmalloc(li2.u.val_size);
-
+
if(H5Lget_val(file1_id, path1, buf1, li1.u.val_size, H5P_DEFAULT) < 0) {
HDfree(buf1);
HDfree(buf2);
@@ -1075,7 +1075,7 @@ hsize_t diff(hid_t file1_id,
HDfree(buf2);
goto out;
} /* end if */
-
+
/* If the buffers are the same size, compare them */
if(li1.u.val_size == li2.u.val_size) {
if(H5Lget_val(file1_id, path1, buf1, li1.u.val_size, H5P_DEFAULT) < 0) {
@@ -1092,20 +1092,20 @@ hsize_t diff(hid_t file1_id,
}
else
ret = 1;
-
+
/* if "buf1" != "buf2" then the links are "different" */
nfound = (ret != 0) ? 1 : 0;
-
+
if(print_objname(options, nfound))
do_print_objname("external link", path1, path2);
-
+
HDfree(buf1);
HDfree(buf2);
} /* end if */
else {
/* If one or both of these links isn't an external link, we can only
* compare information from H5Lget_info since we don't have a query
- * function registered for them.
+ * function registered for them.
*
* If the link classes or the buffer length are not the
* same, the links are "different"
@@ -1114,17 +1114,17 @@ hsize_t diff(hid_t file1_id,
nfound = 1;
else
nfound = 0;
-
+
if (print_objname (options, nfound))
do_print_objname ("user defined link", path1, path2);
} /* end else */
-
+
/* always print the number of differences found in verbose mode */
if(options->m_verbose)
print_found(nfound);
}
break;
-
+
default:
if(options->m_verbose)
printf("Comparison not supported: <%s> and <%s> are of type %s\n",
@@ -1132,9 +1132,9 @@ hsize_t diff(hid_t file1_id,
options->not_cmp = 1;
break;
}
-
+
return nfound;
-
+
out:
options->err_stat = 1;
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index a348ca0..37c424a 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -71,9 +71,9 @@
/*-------------------------------------------------------------------------
* -p relative error formula
*
- * We assume the true value of a quantity to be A (value in first dataset)
- * and the measured or inferred value to be B (value in second dataset).
- * The relative error is defined by
+ * We assume the true value of a quantity to be A (value in first dataset)
+ * and the measured or inferred value to be B (value in second dataset).
+ * The relative error is defined by
*
* B - A
* --------
@@ -137,7 +137,7 @@ static hbool_t equal_double(double value, double expected);
* NaN detection
*-------------------------------------------------------------------------
*/
-typedef enum dtype_t
+typedef enum dtype_t
{
FLT_FLOAT, FLT_DOUBLE,
#if H5_SIZEOF_LONG_DOUBLE !=0
@@ -186,7 +186,7 @@ void print_pos( int *ph, /* print header */
const char *obj2 )
{
int i;
-
+
/* print header */
if ( *ph==1 )
{
@@ -197,7 +197,7 @@ void print_pos( int *ph, /* print header */
parallel_print("%-11s","");
print_dimensions (rank,dims);
parallel_print("\n");
-
+
if (pp)
{
parallel_print("%-15s %-15s %-15s %-15s %-15s\n",
@@ -218,14 +218,14 @@ void print_pos( int *ph, /* print header */
parallel_print("------------------------------------------------------------\n");
}
} /* end print header */
-
+
for ( i = 0; i < rank; i++)
{
pos[i] = curr_pos/acc[i];
curr_pos -= acc[i]*pos[i];
}
assert( curr_pos == 0 );
-
+
parallel_print("[ " );
for ( i = 0; i < rank; i++)
{
@@ -271,11 +271,11 @@ hsize_t diff_array( void *_mem1,
int ph=1; /* print header */
hsize_t i;
int j;
-
-
+
+
/* get the size. */
size = H5Tget_size( m_type );
-
+
acc[rank-1]=1;
for(j=(rank-2); j>=0; j--)
{
@@ -283,7 +283,7 @@ hsize_t diff_array( void *_mem1,
}
for ( j = 0; j < rank; j++)
pos[j]=0;
-
+
if(H5Tis_variable_str(m_type))
{
for ( i = 0; i < nelmts; i++)
@@ -307,7 +307,7 @@ hsize_t diff_array( void *_mem1,
return nfound;
} /* i */
}
-
+
else
{
switch (H5Tget_class(m_type))
@@ -315,22 +315,22 @@ hsize_t diff_array( void *_mem1,
default:
assert(0);
break;
-
+
/*-------------------------------------------------------------------------
* float and integer atomic types
*-------------------------------------------------------------------------
*/
-
+
case H5T_FLOAT:
-
- if (H5Tequal(m_type, H5T_NATIVE_FLOAT))
+
+ if (H5Tequal(m_type, H5T_NATIVE_FLOAT))
nfound=diff_float(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph);
else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE))
nfound=diff_double(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph);
break;
-
+
case H5T_INTEGER:
-
+
if (H5Tequal(m_type, H5T_NATIVE_SCHAR))
nfound=diff_schar(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph);
else if (H5Tequal(m_type, H5T_NATIVE_UCHAR))
@@ -351,14 +351,14 @@ hsize_t diff_array( void *_mem1,
nfound=diff_llong(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph);
else if (H5Tequal(m_type, H5T_NATIVE_ULLONG))
nfound=diff_ullong(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph);
-
+
break;
-
+
/*-------------------------------------------------------------------------
* Other types than float and integer
*-------------------------------------------------------------------------
*/
-
+
case H5T_COMPOUND:
case H5T_STRING:
case H5T_BITFIELD:
@@ -367,7 +367,7 @@ hsize_t diff_array( void *_mem1,
case H5T_ARRAY:
case H5T_VLEN:
case H5T_REFERENCE:
-
+
for ( i = 0; i < nelmts; i++)
{
nfound+=diff_datum(
@@ -390,7 +390,7 @@ hsize_t diff_array( void *_mem1,
} /* i */
} /* switch */
} /* else */
-
+
return nfound;
}
@@ -466,9 +466,9 @@ hsize_t diff_datum(void *_mem1,
float f1, f2;
double per;
int both_zero;
-
+
type_size = H5Tget_size( m_type );
-
+
switch (H5Tget_class(m_type))
{
default:
@@ -477,7 +477,7 @@ hsize_t diff_datum(void *_mem1,
case H5T_TIME:
assert(0);
break;
-
+
/*-------------------------------------------------------------------------
* H5T_COMPOUND
*-------------------------------------------------------------------------
@@ -508,7 +508,7 @@ hsize_t diff_datum(void *_mem1,
H5Tclose(memb_type);
}
break;
-
+
/*-------------------------------------------------------------------------
* H5T_STRING
*-------------------------------------------------------------------------
@@ -518,7 +518,7 @@ hsize_t diff_datum(void *_mem1,
{
H5T_str_t pad;
char *s;
-
+
/* Get pointer to first string to compare */
s = (char *)mem1;
@@ -529,9 +529,9 @@ hsize_t diff_datum(void *_mem1,
size = HDstrlen(s);
else
size = H5Tget_size(m_type);
-
+
pad = H5Tget_strpad(m_type);
-
+
for (u=0; u<size && (s[u] || pad!=H5T_STR_NULLTERM); u++)
nfound+=character_compare(
mem1 + u,
@@ -546,16 +546,16 @@ hsize_t diff_datum(void *_mem1,
obj2,
ph);
}
-
+
}
break;
-
+
/*-------------------------------------------------------------------------
* H5T_BITFIELD
*-------------------------------------------------------------------------
*/
case H5T_BITFIELD:
-
+
/* byte-by-byte comparison */
for (u=0; u<type_size; u++)
nfound+=character_compare_opt(
@@ -570,15 +570,15 @@ hsize_t diff_datum(void *_mem1,
obj1,
obj2,
ph);
-
+
break;
-
+
/*-------------------------------------------------------------------------
* H5T_OPAQUE
*-------------------------------------------------------------------------
*/
case H5T_OPAQUE:
-
+
/* byte-by-byte comparison */
for (u=0; u<type_size; u++)
nfound+=character_compare_opt(
@@ -593,29 +593,29 @@ hsize_t diff_datum(void *_mem1,
obj1,
obj2,
ph);
-
+
break;
-
-
+
+
/*-------------------------------------------------------------------------
* H5T_ENUM
*-------------------------------------------------------------------------
*/
case H5T_ENUM:
-
+
/* For enumeration types we compare the names instead of the
integer values. For each pair of elements being
compared, we convert both bit patterns to their corresponding
enumeration constant and do a string comparison
*/
-
+
{
char enum_name1[1024];
char enum_name2[1024];
-
+
/* disable error reporting */
H5E_BEGIN_TRY {
-
+
if ((H5Tenum_nameof(m_type, mem1, enum_name1, sizeof enum_name1) >= 0) &&
(H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2) >= 0))
{
@@ -649,10 +649,10 @@ hsize_t diff_datum(void *_mem1,
/* enable error reporting */
} H5E_END_TRY;
}
-
-
+
+
break;
-
+
/*-------------------------------------------------------------------------
* H5T_ARRAY
*-------------------------------------------------------------------------
@@ -668,7 +668,7 @@ hsize_t diff_datum(void *_mem1,
ndims = H5Tget_array_ndims(m_type);
H5Tget_array_dims2(m_type, adims);
assert(ndims >= 1 && ndims <= H5S_MAX_RANK);
-
+
/* calculate the number of array elements */
for (u = 0, nelmts = 1; u <ndims; u++)
nelmts *= adims[u];
@@ -691,16 +691,16 @@ hsize_t diff_datum(void *_mem1,
H5Tclose(memb_type);
}
break;
-
-
-
+
+
+
/*-------------------------------------------------------------------------
* H5T_REFERENCE
*-------------------------------------------------------------------------
*/
-
+
case H5T_REFERENCE:
-
+
iszero1=all_zero(_mem1, H5Tget_size(m_type));
iszero2=all_zero(_mem2, H5Tget_size(m_type));
if (iszero1 != iszero2)
@@ -709,18 +709,18 @@ hsize_t diff_datum(void *_mem1,
}
else if (!iszero1 && !iszero2)
{
-
+
/*-------------------------------------------------------------------------
* H5T_STD_REF_DSETREG
* Dataset region reference
*-------------------------------------------------------------------------
*/
-
+
if (H5Tequal(m_type, H5T_STD_REF_DSETREG))
{
hid_t region1_id;
hid_t region2_id;
-
+
if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1))<0)
ret= -1;
if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2))<0)
@@ -729,22 +729,22 @@ hsize_t diff_datum(void *_mem1,
ret= -1;
if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2))<0)
ret= -1;
-
+
if (ret==-1) {
options->err_stat=1;
return 0;
}
-
+
nfound = diff_region(obj1_id,obj2_id,region1_id,region2_id,options);
-
+
H5Oclose(obj1_id);
H5Oclose(obj2_id);
H5Sclose(region1_id);
H5Sclose(region2_id);
-
+
}/*dataset reference*/
-
-
+
+
/*-------------------------------------------------------------------------
* H5T_STD_REF_OBJ
* Object references. get the type and OID of the referenced object
@@ -754,7 +754,7 @@ hsize_t diff_datum(void *_mem1,
{
H5O_type_t obj1_type;
H5O_type_t obj2_type;
-
+
if(H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0)
ret = -1;
if(H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0)
@@ -763,7 +763,7 @@ hsize_t diff_datum(void *_mem1,
options->err_stat = 1;
return 0;
} /* end if */
-
+
/* check object type */
if(obj1_type != obj2_type)
{
@@ -771,7 +771,7 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp = 1;
return 0;
}
-
+
if((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1)) < 0)
ret = -1;
if((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2)) < 0)
@@ -780,7 +780,7 @@ hsize_t diff_datum(void *_mem1,
options->err_stat = 1;
return 0;
} /* end if */
-
+
/* compare */
if(obj1_type == H5O_TYPE_DATASET)
nfound = diff_datasetid(obj1_id,
@@ -793,31 +793,31 @@ hsize_t diff_datum(void *_mem1,
obj1, obj2);
options->not_cmp = 1;
}
-
+
H5Oclose(obj1_id);
H5Oclose(obj2_id);
-
+
}/*object reference*/
-
+
}/*is zero*/
-
-
+
+
break;
/*-------------------------------------------------------------------------
* H5T_VLEN
*-------------------------------------------------------------------------
*/
-
+
case H5T_VLEN:
-
+
/* get the VL sequences's base datatype for each element */
memb_type = H5Tget_super(m_type);
size = H5Tget_size(memb_type);
-
+
/* get the number of sequence elements */
nelmts = ((hvl_t *)mem1)->len;
-
+
for (j = 0; j < (int)nelmts; j++)
nfound+=diff_datum(
((char *)(((hvl_t *)mem1)->p)) + j * size,
@@ -834,21 +834,21 @@ hsize_t diff_datum(void *_mem1,
container1_id,
container2_id,
ph);
-
+
H5Tclose(memb_type);
-
+
break;
-
-
+
+
/*-------------------------------------------------------------------------
* H5T_INTEGER
*-------------------------------------------------------------------------
- */
-
+ */
+
case H5T_INTEGER:
-
-
+
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_SCHAR
*-------------------------------------------------------------------------
@@ -878,7 +878,7 @@ hsize_t diff_datum(void *_mem1,
else if (!options->d && options->p)
{
PER(temp1_char,temp2_char);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -890,9 +890,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -908,7 +908,7 @@ hsize_t diff_datum(void *_mem1,
else if ( options->d && options->p)
{
PER(temp1_char,temp2_char);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -920,9 +920,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_char-temp2_char) > options->delta )
{
if ( print_data(options) )
@@ -944,9 +944,9 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
+
} /*H5T_NATIVE_SCHAR*/
-
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_UCHAR
*-------------------------------------------------------------------------
@@ -956,7 +956,7 @@ hsize_t diff_datum(void *_mem1,
unsigned char temp1_uchar;
unsigned char temp2_uchar;
assert(type_size==sizeof(unsigned char));
-
+
memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
/* -d and !-p */
@@ -977,7 +977,7 @@ hsize_t diff_datum(void *_mem1,
else if (!options->d && options->p)
{
PER_UNSIGN(signed char,temp1_uchar,temp2_uchar);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -989,9 +989,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -1007,7 +1007,7 @@ hsize_t diff_datum(void *_mem1,
else if ( options->d && options->p)
{
PER_UNSIGN(signed char,temp1_uchar,temp2_uchar);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1019,9 +1019,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta )
{
if ( print_data(options) )
@@ -1043,21 +1043,21 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
+
} /*H5T_NATIVE_UCHAR*/
-
-
+
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_SHORT
*-------------------------------------------------------------------------
*/
-
+
else if (H5Tequal(m_type, H5T_NATIVE_SHORT))
{
short temp1_short;
short temp2_short;
assert(type_size==sizeof(short));
-
+
memcpy(&temp1_short, mem1, sizeof(short));
memcpy(&temp2_short, mem2, sizeof(short));
/* -d and !-p */
@@ -1078,7 +1078,7 @@ hsize_t diff_datum(void *_mem1,
else if (!options->d && options->p)
{
PER(temp1_short,temp2_short);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1090,9 +1090,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -1108,7 +1108,7 @@ hsize_t diff_datum(void *_mem1,
else if ( options->d && options->p)
{
PER(temp1_short,temp2_short);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1120,9 +1120,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_short-temp2_short) > options->delta )
{
if ( print_data(options) )
@@ -1144,21 +1144,21 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
-
+
+
} /*H5T_NATIVE_SHORT*/
-
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_USHORT
*-------------------------------------------------------------------------
*/
-
+
else if (H5Tequal(m_type, H5T_NATIVE_USHORT))
{
unsigned short temp1_ushort;
unsigned short temp2_ushort;
assert(type_size==sizeof(short));
-
+
memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
/* -d and !-p */
@@ -1166,7 +1166,7 @@ hsize_t diff_datum(void *_mem1,
{
if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta)
{
-
+
if ( print_data(options) )
{
print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2);
@@ -1180,7 +1180,7 @@ hsize_t diff_datum(void *_mem1,
else if (!options->d && options->p)
{
PER_UNSIGN(signed short,temp1_ushort,temp2_ushort);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1193,9 +1193,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -1211,7 +1211,7 @@ hsize_t diff_datum(void *_mem1,
else if ( options->d && options->p)
{
PER_UNSIGN(signed short,temp1_ushort,temp2_ushort);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1223,9 +1223,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta )
{
if ( print_data(options) )
@@ -1248,19 +1248,19 @@ hsize_t diff_datum(void *_mem1,
nfound++;
}
} /*H5T_NATIVE_USHORT*/
-
-
+
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_INT
*-------------------------------------------------------------------------
*/
-
+
else if (H5Tequal(m_type, H5T_NATIVE_INT))
{
int temp1_int;
int temp2_int;
assert(type_size==sizeof(int));
-
+
memcpy(&temp1_int, mem1, sizeof(int));
memcpy(&temp2_int, mem2, sizeof(int));
/* -d and !-p */
@@ -1281,7 +1281,7 @@ hsize_t diff_datum(void *_mem1,
else if (!options->d && options->p)
{
PER(temp1_int,temp2_int);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1293,9 +1293,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -1311,7 +1311,7 @@ hsize_t diff_datum(void *_mem1,
else if ( options->d && options->p)
{
PER(temp1_int,temp2_int);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1323,9 +1323,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_int-temp2_int) > options->delta )
{
if ( print_data(options) )
@@ -1348,19 +1348,19 @@ hsize_t diff_datum(void *_mem1,
nfound++;
}
} /*H5T_NATIVE_INT*/
-
-
+
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_UINT
*-------------------------------------------------------------------------
*/
-
+
else if (H5Tequal(m_type, H5T_NATIVE_UINT))
{
unsigned int temp1_uint;
unsigned int temp2_uint;
assert(type_size==sizeof(int));
-
+
memcpy(&temp1_uint, mem1, sizeof(unsigned int));
memcpy(&temp2_uint, mem2, sizeof(unsigned int));
/* -d and !-p */
@@ -1381,7 +1381,7 @@ hsize_t diff_datum(void *_mem1,
else if (!options->d && options->p)
{
PER_UNSIGN(signed int,temp1_uint,temp2_uint);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1393,9 +1393,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -1411,7 +1411,7 @@ hsize_t diff_datum(void *_mem1,
else if ( options->d && options->p)
{
PER_UNSIGN(signed int,temp1_uint,temp2_uint);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1423,9 +1423,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta )
{
if ( print_data(options) )
@@ -1448,19 +1448,19 @@ hsize_t diff_datum(void *_mem1,
nfound++;
}
} /*H5T_NATIVE_UINT*/
-
-
+
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_LONG
*-------------------------------------------------------------------------
*/
-
+
else if (H5Tequal(m_type, H5T_NATIVE_LONG))
{
long temp1_long;
long temp2_long;
assert(type_size==sizeof(long));
-
+
memcpy(&temp1_long, mem1, sizeof(long));
memcpy(&temp2_long, mem2, sizeof(long));
/* -d and !-p */
@@ -1481,7 +1481,7 @@ hsize_t diff_datum(void *_mem1,
else if (!options->d && options->p)
{
PER(temp1_long,temp2_long);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1494,9 +1494,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -1512,7 +1512,7 @@ hsize_t diff_datum(void *_mem1,
else if ( options->d && options->p)
{
PER(temp1_long,temp2_long);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1524,9 +1524,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_long-temp2_long) > options->delta )
{
if ( print_data(options) )
@@ -1551,18 +1551,18 @@ hsize_t diff_datum(void *_mem1,
nfound++;
}
} /*H5T_NATIVE_LONG*/
-
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_ULONG
*-------------------------------------------------------------------------
*/
-
+
else if (H5Tequal(m_type, H5T_NATIVE_ULONG))
{
unsigned long temp1_ulong;
unsigned long temp2_ulong;
assert(type_size==sizeof(unsigned long));
-
+
memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
/* -d and !-p */
@@ -1583,7 +1583,7 @@ hsize_t diff_datum(void *_mem1,
else if (!options->d && options->p)
{
PER_UNSIGN(signed long,temp1_ulong,temp2_ulong);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1595,9 +1595,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -1613,7 +1613,7 @@ hsize_t diff_datum(void *_mem1,
else if ( options->d && options->p)
{
PER_UNSIGN(signed long,temp1_ulong,temp2_ulong);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1625,9 +1625,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta )
{
if ( print_data(options) )
@@ -1649,21 +1649,21 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
-
+
+
} /*H5T_NATIVE_ULONG*/
-
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_LLONG
*-------------------------------------------------------------------------
*/
-
+
else if (H5Tequal(m_type, H5T_NATIVE_LLONG))
{
long_long temp1_llong;
long_long temp2_llong;
assert(type_size==sizeof(long_long));
-
+
memcpy(&temp1_llong, mem1, sizeof(long_long));
memcpy(&temp2_llong, mem2, sizeof(long_long));
/* -d and !-p */
@@ -1684,7 +1684,7 @@ hsize_t diff_datum(void *_mem1,
else if (!options->d && options->p)
{
PER(temp1_llong,temp2_llong);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1696,9 +1696,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -1714,7 +1714,7 @@ hsize_t diff_datum(void *_mem1,
else if ( options->d && options->p)
{
PER(temp1_llong,temp2_llong);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1726,9 +1726,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_llong-temp2_llong) > options->delta )
{
if ( print_data(options) )
@@ -1750,20 +1750,20 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
+
} /*H5T_NATIVE_LLONG*/
-
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_ULLONG
*-------------------------------------------------------------------------
*/
-
+
else if (H5Tequal(m_type, H5T_NATIVE_ULLONG))
{
unsigned long_long temp1_ullong;
unsigned long_long temp2_ullong;
assert(type_size==sizeof(unsigned long_long));
-
+
memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long));
memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long));
/* -d and !-p */
@@ -1786,7 +1786,7 @@ hsize_t diff_datum(void *_mem1,
ull2float(temp1_ullong,&f1);
ull2float(temp2_ullong,&f2);
PER(f1,f2);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1798,12 +1798,12 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
-
+
if ( print_data(options) )
{
print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2);
@@ -1819,7 +1819,7 @@ hsize_t diff_datum(void *_mem1,
ull2float(temp1_ullong,&f1);
ull2float(temp2_ullong,&f2);
PER(f1,f2);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1831,16 +1831,16 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long_long)options->delta )
{
-
+
if ( print_data(options) )
{
print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2);
-
+
parallel_print(SPACES);
parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per);
}
@@ -1857,22 +1857,22 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
+
} /*H5T_NATIVE_ULLONG*/
-
-
+
+
break; /* H5T_INTEGER class */
-
+
/*-------------------------------------------------------------------------
* H5T_FLOAT
*-------------------------------------------------------------------------
*/
-
+
case H5T_FLOAT:
-
-
-
+
+
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_FLOAT
*-------------------------------------------------------------------------
@@ -1889,7 +1889,7 @@ hsize_t diff_datum(void *_mem1,
memcpy(&temp1_float, mem1, sizeof(float));
memcpy(&temp2_float, mem2, sizeof(float));
- /* logic for detecting NaNs is different with options -d, -p and no options */
+ /* logic for detecting NaNs is different with options -d, -p and no options */
/*-------------------------------------------------------------------------
* -d and !-p
@@ -1897,18 +1897,18 @@ hsize_t diff_datum(void *_mem1,
*/
if (options->d && !options->p)
{
-
-
+
+
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
isnan1 = my_isnan(FLT_FLOAT,&temp1_float);
isnan2 = my_isnan(FLT_FLOAT,&temp2_float);
-
+
if ( !isnan1 && !isnan2)
- {
-
+ {
+
if (ABS(temp1_float-temp2_float) > options->delta)
{
if ( print_data(options) )
@@ -1919,7 +1919,7 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
+
} /* NaN */
}
/*-------------------------------------------------------------------------
@@ -1928,19 +1928,19 @@ hsize_t diff_datum(void *_mem1,
*/
else if (!options->d && options->p)
{
-
+
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
isnan1 = my_isnan(FLT_FLOAT,&temp1_float);
isnan2 = my_isnan(FLT_FLOAT,&temp2_float);
-
+
if ( !isnan1 && !isnan2)
- {
-
+ {
+
PER(temp1_float,temp2_float);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -1952,9 +1952,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_float-temp2_float) > options->delta )
{
if ( print_data(options) )
@@ -1967,7 +1967,7 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
+
} /* NaN */
}
@@ -1975,22 +1975,22 @@ hsize_t diff_datum(void *_mem1,
* -d and -p
*-------------------------------------------------------------------------
*/
-
+
else if ( options->d && options->p)
{
-
+
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
isnan1 = my_isnan(FLT_FLOAT,&temp1_float);
isnan2 = my_isnan(FLT_FLOAT,&temp2_float);
-
+
if ( !isnan1 && !isnan2)
- {
-
+ {
+
PER(temp1_float,temp2_float);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -2003,9 +2003,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -2013,22 +2013,22 @@ hsize_t diff_datum(void *_mem1,
print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2);
parallel_print(SPACES);
parallel_print(F_FORMAT_P,temp1_float,temp2_float,
- ABS(temp1_float-temp2_float),
+ ABS(temp1_float-temp2_float),
ABS(1-temp2_float/temp1_float));
}
nfound++;
}
-
+
} /* NaN */
}
-
+
/*-------------------------------------------------------------------------
* no -d and -p
*-------------------------------------------------------------------------
*/
else if (equal_float(temp1_float,temp2_float)==FALSE)
{
-
+
if ( print_data(options) )
{
print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2);
@@ -2038,12 +2038,12 @@ hsize_t diff_datum(void *_mem1,
nfound++;
}
} /*H5T_NATIVE_FLOAT*/
-
+
/*-------------------------------------------------------------------------
* H5T_NATIVE_DOUBLE
*-------------------------------------------------------------------------
*/
-
+
else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE))
{
double temp1_double;
@@ -2053,11 +2053,11 @@ hsize_t diff_datum(void *_mem1,
assert(type_size==sizeof(double));
-
+
memcpy(&temp1_double, mem1, sizeof(double));
memcpy(&temp2_double, mem2, sizeof(double));
- /* logic for detecting NaNs is different with options -d, -p and no options */
+ /* logic for detecting NaNs is different with options -d, -p and no options */
/*-------------------------------------------------------------------------
* -d and !-p
@@ -2072,10 +2072,10 @@ hsize_t diff_datum(void *_mem1,
*/
isnan1 = my_isnan(FLT_DOUBLE,&temp1_double);
isnan2 = my_isnan(FLT_DOUBLE,&temp2_double);
-
+
if ( !isnan1 && !isnan2)
- {
-
+ {
+
if (ABS(temp1_double-temp2_double) > options->delta)
{
if ( print_data(options) )
@@ -2086,7 +2086,7 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
+
} /* NaN */
}
@@ -2103,12 +2103,12 @@ hsize_t diff_datum(void *_mem1,
*/
isnan1 = my_isnan(FLT_DOUBLE,&temp1_double);
isnan2 = my_isnan(FLT_DOUBLE,&temp2_double);
-
+
if ( !isnan1 && !isnan2)
- {
-
+ {
+
PER(temp1_double,temp2_double);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -2121,9 +2121,9 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -2136,12 +2136,12 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
+
} /* NaN */
}
-
+
/*-------------------------------------------------------------------------
- * -d and -p
+ * -d and -p
*-------------------------------------------------------------------------
*/
else if ( options->d && options->p)
@@ -2153,12 +2153,12 @@ hsize_t diff_datum(void *_mem1,
*/
isnan1 = my_isnan(FLT_DOUBLE,&temp1_double);
isnan2 = my_isnan(FLT_DOUBLE,&temp2_double);
-
+
if ( !isnan1 && !isnan2)
- {
-
+ {
+
PER(temp1_double,temp2_double);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -2171,10 +2171,10 @@ hsize_t diff_datum(void *_mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
- if ( per > options->percent &&
+
+ if ( per > options->percent &&
ABS(temp1_double-temp2_double) > options->delta )
{
if ( print_data(options) )
@@ -2187,12 +2187,12 @@ hsize_t diff_datum(void *_mem1,
}
nfound++;
}
-
+
} /* NaN */
}
-
+
/*-------------------------------------------------------------------------
- * no -d and -p
+ * no -d and -p
*-------------------------------------------------------------------------
*/
else if (equal_double(temp1_double,temp2_double)==FALSE)
@@ -2206,12 +2206,12 @@ hsize_t diff_datum(void *_mem1,
nfound++;
}
} /*H5T_NATIVE_DOUBLE*/
-
-
+
+
break; /* H5T_FLOAT class */
-
+
} /* switch */
-
+
return nfound;
}
@@ -2250,7 +2250,7 @@ static
void print_region_block(int i, hsize_t *ptdata, int ndims)
{
int j;
-
+
parallel_print(" ");
for (j = 0; j < ndims; j++)
parallel_print("%s%lu", j ? "," : " (",
@@ -2259,7 +2259,7 @@ void print_region_block(int i, hsize_t *ptdata, int ndims)
parallel_print("%s%lu", j ? "," : ")-(",
(unsigned long)ptdata[i * 2 * ndims + j + ndims]);
parallel_print(")");
-
+
}
@@ -2277,13 +2277,13 @@ static
void print_points(int i, hsize_t *ptdata, int ndims)
{
int j;
-
+
parallel_print(" ");
for (j = 0; j < ndims; j++)
parallel_print("%s%lu", j ? "," : "(",
(unsigned long)(ptdata[i * ndims + j]));
parallel_print(")");
-
+
}
/*-------------------------------------------------------------------------
@@ -2492,10 +2492,10 @@ hsize_t character_compare(unsigned char *mem1,
hsize_t nfound=0; /* differences found */
unsigned char temp1_uchar;
unsigned char temp2_uchar;
-
+
memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
-
+
if (temp1_uchar != temp2_uchar)
{
if ( print_data(options) )
@@ -2506,7 +2506,7 @@ hsize_t character_compare(unsigned char *mem1,
}
nfound++;
}
-
+
return nfound;
}
@@ -2538,12 +2538,12 @@ hsize_t character_compare_opt(unsigned char *mem1,
unsigned char temp2_uchar;
double per;
int both_zero;
-
+
memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
-
+
/* -d and !-p */
-
+
if (options->d && !options->p)
{
if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta)
@@ -2597,9 +2597,9 @@ hsize_t character_compare_opt(unsigned char *mem1,
}
nfound++;
}
-
+
return nfound;
-
+
}
@@ -2634,13 +2634,13 @@ hsize_t diff_float(unsigned char *mem1,
int both_zero;
int isnan1;
int isnan2;
-
+
/*-------------------------------------------------------------------------
- * -d and !-p
+ * -d and !-p
*-------------------------------------------------------------------------
*/
-
+
if (options->d && !options->p)
{
for ( i = 0; i < nelmts; i++)
@@ -2656,7 +2656,7 @@ hsize_t diff_float(unsigned char *mem1,
isnan2 = my_isnan(FLT_FLOAT,&temp2_float);
if ( !isnan1 && !isnan2)
- {
+ {
if (ABS(temp1_float-temp2_float) > options->delta)
{
if ( print_data(options) )
@@ -2676,7 +2676,7 @@ hsize_t diff_float(unsigned char *mem1,
}
/*-------------------------------------------------------------------------
- * !-d and -p
+ * !-d and -p
*-------------------------------------------------------------------------
*/
else if (!options->d && options->p)
@@ -2685,19 +2685,19 @@ hsize_t diff_float(unsigned char *mem1,
{
memcpy(&temp1_float, mem1, sizeof(float));
memcpy(&temp2_float, mem2, sizeof(float));
-
+
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
isnan1 = my_isnan(FLT_FLOAT,&temp1_float);
isnan2 = my_isnan(FLT_FLOAT,&temp2_float);
-
+
if ( !isnan1 && !isnan2)
- {
-
+ {
+
PER(temp1_float,temp2_float);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -2710,9 +2710,9 @@ hsize_t diff_float(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -2732,31 +2732,31 @@ hsize_t diff_float(unsigned char *mem1,
return nfound;
} /* i */
}
-
+
/*-------------------------------------------------------------------------
- * -d and -p
+ * -d and -p
*-------------------------------------------------------------------------
*/
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_float, mem1, sizeof(float));
memcpy(&temp2_float, mem2, sizeof(float));
-
+
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
*/
isnan1 = my_isnan(FLT_FLOAT,&temp1_float);
isnan2 = my_isnan(FLT_FLOAT,&temp2_float);
-
+
if ( !isnan1 && !isnan2)
- {
-
+ {
+
PER(temp1_float,temp2_float);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -2769,9 +2769,9 @@ hsize_t diff_float(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_float-temp2_float) > options->delta )
{
if ( print_data(options) )
@@ -2784,7 +2784,7 @@ hsize_t diff_float(unsigned char *mem1,
}
nfound++;
}
-
+
} /* NaN */
mem1+=sizeof(float);
mem2+=sizeof(float);
@@ -2794,7 +2794,7 @@ hsize_t diff_float(unsigned char *mem1,
}
/*-------------------------------------------------------------------------
- * no -d and -p
+ * no -d and -p
*-------------------------------------------------------------------------
*/
else
@@ -2814,13 +2814,13 @@ hsize_t diff_float(unsigned char *mem1,
#endif
#endif
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_float, mem1, sizeof(float));
memcpy(&temp2_float, mem2, sizeof(float));
-
+
if (equal_float(temp1_float,temp2_float)==FALSE)
{
if ( print_data(options) )
@@ -2831,7 +2831,7 @@ hsize_t diff_float(unsigned char *mem1,
}
nfound++;
}
-
+
mem1+=sizeof(float);
mem2+=sizeof(float);
if (options->n && nfound>=options->count)
@@ -2854,9 +2854,9 @@ hsize_t diff_float(unsigned char *mem1,
#endif
-
+
}
-
+
return nfound;
}
@@ -2891,17 +2891,17 @@ hsize_t diff_double(unsigned char *mem1,
hsize_t i;
double per;
int both_zero;
-
-
+
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_double, mem1, sizeof(double));
memcpy(&temp2_double, mem2, sizeof(double));
-
+
if (ABS(temp1_double-temp2_double) > options->delta)
{
if ( print_data(options) )
@@ -2918,18 +2918,18 @@ hsize_t diff_double(unsigned char *mem1,
return nfound;
}
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_double, mem1, sizeof(double));
memcpy(&temp2_double, mem2, sizeof(double));
-
+
PER(temp1_double,temp2_double);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -2942,9 +2942,9 @@ hsize_t diff_double(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -2963,18 +2963,18 @@ hsize_t diff_double(unsigned char *mem1,
return nfound;
}
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_double, mem1, sizeof(double));
memcpy(&temp2_double, mem2, sizeof(double));
-
+
PER(temp1_double,temp2_double);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -2987,9 +2987,9 @@ hsize_t diff_double(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta )
{
if ( print_data(options) )
@@ -3010,12 +3010,12 @@ hsize_t diff_double(unsigned char *mem1,
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_double, mem1, sizeof(double));
memcpy(&temp2_double, mem2, sizeof(double));
-
+
if (equal_double(temp1_double,temp2_double)==FALSE)
{
if ( print_data(options) )
@@ -3026,15 +3026,15 @@ hsize_t diff_double(unsigned char *mem1,
}
nfound++;
}
-
+
mem1+=sizeof(double);
mem2+=sizeof(double);
if (options->n && nfound>=options->count)
return nfound;
} /* nelmts */
-
+
}
-
+
return nfound;
}
@@ -3067,17 +3067,17 @@ hsize_t diff_schar(unsigned char *mem1,
hsize_t i;
double per;
int both_zero;
-
-
+
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_char, mem1, sizeof(char));
memcpy(&temp2_char, mem2, sizeof(char));
-
+
if (ABS(temp1_char-temp2_char) > options->delta)
{
if ( print_data(options) )
@@ -3094,18 +3094,18 @@ hsize_t diff_schar(unsigned char *mem1,
return nfound;
}
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_char, mem1, sizeof(char));
memcpy(&temp2_char, mem2, sizeof(char));
-
+
PER(temp1_char,temp2_char);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -3118,9 +3118,9 @@ hsize_t diff_schar(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -3139,18 +3139,18 @@ hsize_t diff_schar(unsigned char *mem1,
return nfound;
}
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_char, mem1, sizeof(char));
memcpy(&temp2_char, mem2, sizeof(char));
-
+
PER(temp1_char,temp2_char);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -3163,9 +3163,9 @@ hsize_t diff_schar(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_char-temp2_char) > options->delta )
{
if ( print_data(options) )
@@ -3183,16 +3183,16 @@ hsize_t diff_schar(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_char, mem1, sizeof(char));
memcpy(&temp2_char, mem2, sizeof(char));
-
+
if (temp1_char != temp2_char)
{
if ( print_data(options) )
@@ -3203,15 +3203,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;
}
@@ -3246,17 +3246,17 @@ hsize_t diff_uchar(unsigned char *mem1,
hsize_t i;
double per;
int both_zero;
-
-
+
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
-
+
if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta)
{
if ( print_data(options) )
@@ -3272,20 +3272,20 @@ hsize_t diff_uchar(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
-
+
PER_UNSIGN(signed char,temp1_uchar,temp2_uchar);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -3298,9 +3298,9 @@ hsize_t diff_uchar(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -3319,18 +3319,18 @@ hsize_t diff_uchar(unsigned char *mem1,
return nfound;
}
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
-
+
PER_UNSIGN(signed char,temp1_uchar,temp2_uchar);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -3343,9 +3343,9 @@ hsize_t diff_uchar(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta )
{
if ( print_data(options) )
@@ -3363,16 +3363,16 @@ hsize_t diff_uchar(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
-
+
if (temp1_uchar != temp2_uchar)
{
if ( print_data(options) )
@@ -3383,15 +3383,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;
}
@@ -3424,16 +3424,16 @@ hsize_t diff_short(unsigned char *mem1,
hsize_t i;
double per;
int both_zero;
-
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_short, mem1, sizeof(short));
memcpy(&temp2_short, mem2, sizeof(short));
-
+
if (ABS(temp1_short-temp2_short) > options->delta)
{
if ( print_data(options) )
@@ -3449,20 +3449,20 @@ hsize_t diff_short(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_short, mem1, sizeof(short));
memcpy(&temp2_short, mem2, sizeof(short));
-
+
PER(temp1_short,temp2_short);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -3475,9 +3475,9 @@ hsize_t diff_short(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -3495,21 +3495,21 @@ hsize_t diff_short(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
-
+
+
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_short, mem1, sizeof(short));
memcpy(&temp2_short, mem2, sizeof(short));
-
+
PER(temp1_short,temp2_short);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -3522,9 +3522,9 @@ hsize_t diff_short(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_short-temp2_short) > options->delta )
{
if ( print_data(options) )
@@ -3542,16 +3542,16 @@ hsize_t diff_short(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_short, mem1, sizeof(short));
memcpy(&temp2_short, mem2, sizeof(short));
-
+
if (temp1_short != temp2_short)
{
if ( print_data(options) )
@@ -3562,15 +3562,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;
}
@@ -3604,16 +3604,16 @@ hsize_t diff_ushort(unsigned char *mem1,
hsize_t i;
double per;
int both_zero;
-
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
-
+
if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta)
{
if ( print_data(options) )
@@ -3629,20 +3629,20 @@ hsize_t diff_ushort(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
-
+
PER_UNSIGN(signed short,temp1_ushort,temp2_ushort);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -3655,9 +3655,9 @@ hsize_t diff_ushort(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -3675,21 +3675,21 @@ hsize_t diff_ushort(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
-
+
+
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
-
+
PER_UNSIGN(signed short,temp1_ushort,temp2_ushort);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -3702,9 +3702,9 @@ hsize_t diff_ushort(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta )
{
if ( print_data(options) )
@@ -3722,16 +3722,16 @@ hsize_t diff_ushort(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
-
+
if (temp1_ushort != temp2_ushort)
{
if ( print_data(options) )
@@ -3742,15 +3742,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;
}
@@ -3785,16 +3785,16 @@ hsize_t diff_int(unsigned char *mem1,
hsize_t i;
double per;
int both_zero;
-
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_int, mem1, sizeof(int));
memcpy(&temp2_int, mem2, sizeof(int));
-
+
if (ABS(temp1_int-temp2_int) > options->delta)
{
if ( print_data(options) )
@@ -3810,20 +3810,20 @@ hsize_t diff_int(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_int, mem1, sizeof(int));
memcpy(&temp2_int, mem2, sizeof(int));
-
+
PER(temp1_int,temp2_int);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -3836,9 +3836,9 @@ hsize_t diff_int(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -3856,21 +3856,21 @@ hsize_t diff_int(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
-
+
+
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_int, mem1, sizeof(int));
memcpy(&temp2_int, mem2, sizeof(int));
-
+
PER(temp1_int,temp2_int);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -3883,9 +3883,9 @@ hsize_t diff_int(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_int-temp2_int) > options->delta )
{
if ( print_data(options) )
@@ -3903,16 +3903,16 @@ hsize_t diff_int(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_int, mem1, sizeof(int));
memcpy(&temp2_int, mem2, sizeof(int));
-
+
if (temp1_int != temp2_int)
{
if ( print_data(options) )
@@ -3923,15 +3923,15 @@ hsize_t diff_int(unsigned char *mem1,
}
nfound++;
}
-
+
mem1+=sizeof(int);
mem2+=sizeof(int);
if (options->n && nfound>=options->count)
return nfound;
} /* nelmts */
-
+
}
-
+
return nfound;
}
@@ -3966,16 +3966,16 @@ hsize_t diff_uint(unsigned char *mem1,
hsize_t i;
double per;
int both_zero;
-
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_uint, mem1, sizeof(unsigned int));
memcpy(&temp2_uint, mem2, sizeof(unsigned int));
-
+
if ( PDIFF(temp1_uint,temp2_uint) > options->delta)
{
if ( print_data(options) )
@@ -3991,20 +3991,20 @@ hsize_t diff_uint(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_uint, mem1, sizeof(unsigned int));
memcpy(&temp2_uint, mem2, sizeof(unsigned int));
-
+
PER_UNSIGN(signed int,temp1_uint,temp2_uint);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -4016,9 +4016,9 @@ hsize_t diff_uint(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -4036,21 +4036,21 @@ hsize_t diff_uint(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
-
+
+
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_uint, mem1, sizeof(unsigned int));
memcpy(&temp2_uint, mem2, sizeof(unsigned int));
-
+
PER_UNSIGN(signed int,temp1_uint,temp2_uint);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -4062,9 +4062,9 @@ hsize_t diff_uint(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta )
{
if ( print_data(options) )
@@ -4082,16 +4082,16 @@ hsize_t diff_uint(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_uint, mem1, sizeof(unsigned int));
memcpy(&temp2_uint, mem2, sizeof(unsigned int));
-
+
if (temp1_uint != temp2_uint)
{
if ( print_data(options) )
@@ -4102,15 +4102,15 @@ hsize_t diff_uint(unsigned char *mem1,
}
nfound++;
}
-
+
mem1+=sizeof(unsigned int);
mem2+=sizeof(unsigned int);
if (options->n && nfound>=options->count)
return nfound;
} /* nelmts */
-
+
}
-
+
return nfound;
}
@@ -4145,19 +4145,19 @@ hsize_t diff_long(unsigned char *mem1,
hsize_t i;
double per;
int both_zero;
-
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_long, mem1, sizeof(long));
memcpy(&temp2_long, mem2, sizeof(long));
-
+
if (ABS(temp1_long-temp2_long) > options->delta)
{
if ( print_data(options) )
@@ -4175,18 +4175,18 @@ hsize_t diff_long(unsigned char *mem1,
}
}
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_long, mem1, sizeof(long));
memcpy(&temp2_long, mem2, sizeof(long));
-
+
PER(temp1_long,temp2_long);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -4199,9 +4199,9 @@ hsize_t diff_long(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -4219,21 +4219,21 @@ hsize_t diff_long(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
-
+
+
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_long, mem1, sizeof(long));
memcpy(&temp2_long, mem2, sizeof(long));
-
+
PER(temp1_long,temp2_long);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -4246,9 +4246,9 @@ hsize_t diff_long(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_long-temp2_long) > options->delta )
{
if ( print_data(options) )
@@ -4266,16 +4266,16 @@ hsize_t diff_long(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_long, mem1, sizeof(long));
memcpy(&temp2_long, mem2, sizeof(long));
-
+
if (temp1_long != temp2_long)
{
if ( print_data(options) )
@@ -4286,15 +4286,15 @@ hsize_t diff_long(unsigned char *mem1,
}
nfound++;
}
-
+
mem1+=sizeof(long);
mem2+=sizeof(long);
if (options->n && nfound>=options->count)
return nfound;
} /* nelmts */
-
+
}
-
+
return nfound;
}
@@ -4330,20 +4330,20 @@ hsize_t diff_ulong(unsigned char *mem1,
hsize_t i;
double per;
int both_zero;
-
-
+
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
-
+
if ( PDIFF(temp1_ulong,temp2_ulong) > options->delta)
{
if ( print_data(options) )
@@ -4359,22 +4359,22 @@ hsize_t diff_ulong(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
-
+
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
-
+
PER_UNSIGN(signed long,temp1_ulong,temp2_ulong);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -4386,9 +4386,9 @@ hsize_t diff_ulong(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -4406,21 +4406,21 @@ hsize_t diff_ulong(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
-
+
+
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
-
+
PER_UNSIGN(signed long,temp1_ulong,temp2_ulong);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -4432,9 +4432,9 @@ hsize_t diff_ulong(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta )
{
if ( print_data(options) )
@@ -4452,16 +4452,16 @@ hsize_t diff_ulong(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
-
+
if (temp1_ulong != temp2_ulong)
{
if ( print_data(options) )
@@ -4472,15 +4472,15 @@ hsize_t diff_ulong(unsigned char *mem1,
}
nfound++;
}
-
+
mem1+=sizeof(unsigned long);
mem2+=sizeof(unsigned long);
if (options->n && nfound>=options->count)
return nfound;
} /* nelmts */
-
+
}
-
+
return nfound;
}
@@ -4515,16 +4515,16 @@ hsize_t diff_llong(unsigned char *mem1,
hsize_t i;
double per;
int both_zero;
-
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_llong, mem1, sizeof(long_long));
memcpy(&temp2_llong, mem2, sizeof(long_long));
-
+
if (ABS( temp1_llong-temp2_llong) > options->delta)
{
if ( print_data(options) )
@@ -4540,20 +4540,20 @@ hsize_t diff_llong(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_llong, mem1, sizeof(long_long));
memcpy(&temp2_llong, mem2, sizeof(long_long));
-
+
PER(temp1_llong,temp2_llong);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -4565,9 +4565,9 @@ hsize_t diff_llong(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -4583,21 +4583,21 @@ hsize_t diff_llong(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
-
+
+
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_llong, mem1, sizeof(long_long));
memcpy(&temp2_llong, mem2, sizeof(long_long));
-
+
PER(temp1_llong,temp2_llong);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -4609,9 +4609,9 @@ hsize_t diff_llong(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && ABS(temp1_llong-temp2_llong) > options->delta )
{
if ( print_data(options) )
@@ -4627,16 +4627,16 @@ hsize_t diff_llong(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_llong, mem1, sizeof(long_long));
memcpy(&temp2_llong, mem2, sizeof(long_long));
-
+
if (temp1_llong != temp2_llong)
{
if ( print_data(options) )
@@ -4647,15 +4647,15 @@ hsize_t diff_llong(unsigned char *mem1,
}
nfound++;
}
-
+
mem1+=sizeof(long_long);
mem2+=sizeof(long_long);
if (options->n && nfound>=options->count)
return nfound;
} /* nelmts */
-
+
}
-
+
return nfound;
}
@@ -4691,16 +4691,16 @@ hsize_t diff_ullong(unsigned char *mem1,
float f1, f2;
double per;
int both_zero;
-
+
/* -d and !-p */
if (options->d && !options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long));
memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long));
-
+
if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long_long) options->delta)
{
if ( print_data(options) )
@@ -4716,22 +4716,22 @@ hsize_t diff_ullong(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
-
+
/* !-d and -p */
else if (!options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long));
memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long));
-
+
ull2float(temp1_ullong,&f1);
ull2float(temp2_ullong,&f2);
PER(f1,f2);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -4743,9 +4743,9 @@ hsize_t diff_ullong(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent )
{
if ( print_data(options) )
@@ -4761,23 +4761,23 @@ hsize_t diff_ullong(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
-
+
+
}
-
+
/* -d and -p */
else if ( options->d && options->p)
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long));
memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long));
-
+
ull2float(temp1_ullong,&f1);
ull2float(temp2_ullong,&f2);
PER(f1,f2);
-
+
if (not_comparable && !both_zero) /* not comparable */
{
if ( print_data(options) )
@@ -4789,9 +4789,9 @@ hsize_t diff_ullong(unsigned char *mem1,
options->not_cmp=1;
nfound++;
}
-
+
else
-
+
if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long_long)options->delta )
{
if ( print_data(options) )
@@ -4807,16 +4807,16 @@ hsize_t diff_ullong(unsigned char *mem1,
if (options->n && nfound>=options->count)
return nfound;
}
-
+
}
else
{
-
+
for ( i = 0; i < nelmts; i++)
{
memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long));
memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long));
-
+
if (temp1_ullong != temp2_ullong)
{
if ( print_data(options) )
@@ -4827,15 +4827,15 @@ hsize_t diff_ullong(unsigned char *mem1,
}
nfound++;
}
-
+
mem1+=sizeof(unsigned long_long);
mem2+=sizeof(unsigned long_long);
if (options->n && nfound>=options->count)
return nfound;
} /* nelmts */
-
+
}
-
+
return nfound;
}
@@ -4895,8 +4895,8 @@ error:
/*-------------------------------------------------------------------------
* Function: equal_double
*
- * Purpose: use a relative error formula to deal with floating point
- * uncertainty
+ * Purpose: use a relative error formula to deal with floating point
+ * uncertainty
*
* Programmer: pvn
* October 24, 2006
@@ -4906,8 +4906,8 @@ error:
*
*-------------------------------------------------------------------------
*/
-static
-hbool_t equal_double(double value, double expected)
+static
+hbool_t equal_double(double value, double expected)
{
int both_zero;
int is_zero;
@@ -4922,7 +4922,7 @@ hbool_t equal_double(double value, double expected)
int isnan2 = my_isnan(FLT_DOUBLE,&expected);
/*-------------------------------------------------------------------------
- * we consider NaN == NaN to be true
+ * we consider NaN == NaN to be true
*-------------------------------------------------------------------------
*/
if ( isnan1 && isnan2 )
@@ -4958,14 +4958,14 @@ hbool_t equal_double(double value, double expected)
return TRUE;
else
return FALSE;
-
+
}
/*-------------------------------------------------------------------------
* Function: equal_float
*
- * Purpose: use a relative error formula to deal with floating point
- * uncertainty
+ * Purpose: use a relative error formula to deal with floating point
+ * uncertainty
*
* Programmer: pvn
* October 24, 2006
@@ -4975,8 +4975,8 @@ hbool_t equal_double(double value, double expected)
*
*-------------------------------------------------------------------------
*/
-static
-hbool_t equal_float(float value, float expected)
+static
+hbool_t equal_float(float value, float expected)
{
int both_zero;
int is_zero;
@@ -4991,7 +4991,7 @@ hbool_t equal_float(float value, float expected)
int isnan2 = my_isnan(FLT_FLOAT,&expected);
/*-------------------------------------------------------------------------
- * we consider NaN == NaN to be true
+ * we consider NaN == NaN to be true
*-------------------------------------------------------------------------
*/
if ( isnan1 && isnan2 )
@@ -5014,7 +5014,7 @@ hbool_t equal_float(float value, float expected)
*/
#endif
-
+
BOTH_ZERO(value,expected)
if (both_zero)
return TRUE;
@@ -5027,7 +5027,7 @@ hbool_t equal_float(float value, float expected)
return TRUE;
else
return FALSE;
-
+
}
@@ -5053,73 +5053,73 @@ my_isnan(dtype_t type, void *val)
{
int retval = 0;
char s[256];
-
- if (FLT_FLOAT==type)
+
+ if (FLT_FLOAT==type)
{
float x;
HDmemcpy(&x, val, sizeof(float));
retval = (x!=x);
-
- }
- else if (FLT_DOUBLE==type)
+
+ }
+ else if (FLT_DOUBLE==type)
{
double x;
HDmemcpy(&x, val, sizeof(double));
retval = (x!=x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
- }
- else if (FLT_LDOUBLE==type)
+ }
+ else if (FLT_LDOUBLE==type)
{
long double x;
HDmemcpy(&x, val, sizeof(long double));
retval = (x!=x);
#endif
- }
- else
+ }
+ else
{
return 0;
}
-
+
/*
* Sometimes NaN==NaN (e.g., DEC Alpha) so we try to print it and see if
* the result contains a NaN string.
*/
- if (!retval)
+ if (!retval)
{
- if (FLT_FLOAT==type)
+ if (FLT_FLOAT==type)
{
float x;
HDmemcpy(&x, val, sizeof(float));
sprintf(s, "%g", x);
- }
- else if (FLT_DOUBLE==type)
+ }
+ else if (FLT_DOUBLE==type)
{
double x;
HDmemcpy(&x, val, sizeof(double));
sprintf(s, "%g", x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
- }
- else if (FLT_LDOUBLE==type)
+ }
+ else if (FLT_LDOUBLE==type)
{
long double x;
HDmemcpy(&x, val, sizeof(long double));
sprintf(s, "%Lg", x);
#endif
- }
- else
+ }
+ else
{
return 0;
}
-
- if ( HDstrstr(s, "NaN") ||
- HDstrstr(s, "NAN") ||
- HDstrstr(s, "nan") ||
- HDstrstr(s, "-1.#IND") /* WIN32 */
+
+ if ( HDstrstr(s, "NaN") ||
+ HDstrstr(s, "NAN") ||
+ HDstrstr(s, "nan") ||
+ HDstrstr(s, "-1.#IND") /* WIN32 */
)
{
@@ -5130,13 +5130,13 @@ my_isnan(dtype_t type, void *val)
}
-
+
#ifdef H5_VMS
/* For "float" and "double" on OpenVMS/Alpha, NaN is
* actually a valid value of maximal value.*/
- if(!retval)
+ if(!retval)
{
- if (FLT_FLOAT==type)
+ if (FLT_FLOAT==type)
{
float x;
HDmemcpy(&x, val, sizeof(float));
@@ -5145,17 +5145,17 @@ my_isnan(dtype_t type, void *val)
double x;
HDmemcpy(&x, val, sizeof(double));
retval = (x==DBL_MAX || x==-DBL_MAX);
- } else
+ } else
{
return 0;
}
}
#endif /*H5_VMS*/
-
+
return retval;
}
-
+
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index d6c1c48..6dec22b 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -70,39 +70,39 @@ hsize_t diff_attr(hid_t loc1_id,
hsize_t nfound = 0;
hsize_t nfound_total = 0;
int j;
-
+
if(H5Oget_info(loc1_id, &oinfo1) < 0)
goto error;
if(H5Oget_info(loc2_id, &oinfo2) < 0)
goto error;
-
+
if(oinfo1.num_attrs != oinfo2.num_attrs)
return 1;
-
+
for( u = 0; u < (unsigned)oinfo1.num_attrs; u++)
{
/* reset buffers for every attribute, we might goto out and call free */
buf1 = NULL;
buf2 = NULL;
-
+
/* open attribute */
if((attr1_id = H5Aopen_by_idx(loc1_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
/* get name */
if(H5Aget_name(attr1_id, 255, name1) < 0)
goto error;
-
+
/* use the name on the first file to open the second file */
- H5E_BEGIN_TRY
+ H5E_BEGIN_TRY
{
if((attr2_id = H5Aopen(loc2_id, name1, H5P_DEFAULT)) < 0)
goto error;
} H5E_END_TRY;
-
+
/* get name */
if(H5Aget_name(attr2_id, 255, name2) < 0)
goto error;
-
+
/* get the datatypes */
if ((ftype1_id = H5Aget_type(attr1_id)) < 0)
goto error;
@@ -115,28 +115,28 @@ hsize_t diff_attr(hid_t loc1_id,
if ((msize1 = H5Tget_size(mtype1_id))==0)
goto error;
if ((msize2 = H5Tget_size(mtype2_id))==0)
- goto error;
-
+ goto error;
+
/* get the dataspace */
if ((space1_id = H5Aget_space(attr1_id)) < 0)
goto error;
if ((space2_id = H5Aget_space(attr2_id)) < 0)
goto error;
-
+
/* get dimensions */
if ( (rank1 = H5Sget_simple_extent_dims(space1_id, dims1, NULL)) < 0 )
goto error;
if ( (rank2 = H5Sget_simple_extent_dims(space2_id, dims2, NULL)) < 0 )
goto error;
-
-
+
+
/*-------------------------------------------------------------------------
* check for comparable TYPE and SPACE
*-------------------------------------------------------------------------
*/
-
+
if ( msize1 != msize2
- ||
+ ||
diff_can_type(ftype1_id,
ftype2_id,
rank1,
@@ -149,44 +149,44 @@ hsize_t diff_attr(hid_t loc1_id,
name2,
options)!=1)
{
-
+
if (options->m_verbose)
printf("Comparison not possible for attribute <%s>\n",
name1);
-
+
options->not_cmp=1;
-
- if (H5Tclose(ftype1_id)<0)
+
+ if (H5Tclose(ftype1_id)<0)
goto error;
- if (H5Tclose(ftype2_id)<0)
+ if (H5Tclose(ftype2_id)<0)
goto error;
- if (H5Sclose(space1_id)<0)
+ if (H5Sclose(space1_id)<0)
goto error;
- if (H5Sclose(space2_id)<0)
+ if (H5Sclose(space2_id)<0)
goto error;
- if (H5Aclose(attr1_id)<0)
+ if (H5Aclose(attr1_id)<0)
goto error;
- if (H5Aclose(attr2_id)<0)
+ if (H5Aclose(attr2_id)<0)
goto error;
- if (H5Tclose(mtype1_id)<0)
+ if (H5Tclose(mtype1_id)<0)
goto error;
- if (H5Tclose(mtype2_id)<0)
+ if (H5Tclose(mtype2_id)<0)
goto error;
continue;
-
-
+
+
}
-
-
+
+
/*-------------------------------------------------------------------------
- * read
+ * read
*-------------------------------------------------------------------------
*/
nelmts1=1;
for (j=0; j<rank1; j++)
nelmts1*=dims1[j];
-
+
buf1=(void *) HDmalloc((unsigned)(nelmts1*msize1));
buf2=(void *) HDmalloc((unsigned)(nelmts1*msize2));
if ( buf1==NULL || buf2==NULL){
@@ -197,16 +197,16 @@ hsize_t diff_attr(hid_t loc1_id,
goto error;
if (H5Aread(attr2_id,mtype2_id,buf2)<0)
goto error;
-
+
/* format output string */
sprintf(np1,"%s of <%s>",name1,path1);
sprintf(np2,"%s of <%s>",name2,path2);
-
+
/*-------------------------------------------------------------------------
* array compare
*-------------------------------------------------------------------------
*/
-
+
/* always print name */
if (options->m_verbose)
{
@@ -224,7 +224,7 @@ hsize_t diff_attr(hid_t loc1_id,
attr1_id,
attr2_id);
print_found(nfound);
-
+
}
/* check first if we have differences */
else
@@ -282,40 +282,40 @@ hsize_t diff_attr(hid_t loc1_id,
attr2_id);
} /*else quiet */
} /*else verbose */
-
-
+
+
/*-------------------------------------------------------------------------
* close
*-------------------------------------------------------------------------
*/
-
- if (H5Tclose(ftype1_id)<0)
+
+ if (H5Tclose(ftype1_id)<0)
goto error;
- if (H5Tclose(ftype2_id)<0)
+ if (H5Tclose(ftype2_id)<0)
goto error;
- if (H5Sclose(space1_id)<0)
+ if (H5Sclose(space1_id)<0)
goto error;
- if (H5Sclose(space2_id)<0)
+ if (H5Sclose(space2_id)<0)
goto error;
- if (H5Aclose(attr1_id)<0)
+ if (H5Aclose(attr1_id)<0)
goto error;
- if (H5Aclose(attr2_id)<0)
+ if (H5Aclose(attr2_id)<0)
goto error;
- if (H5Tclose(mtype1_id)<0)
+ if (H5Tclose(mtype1_id)<0)
goto error;
- if (H5Tclose(mtype2_id)<0)
+ if (H5Tclose(mtype2_id)<0)
goto error;
-
+
if (buf1)
HDfree(buf1);
if (buf2)
HDfree(buf2);
-
+
nfound_total += nfound;
} /* u */
-
+
return nfound_total;
-
+
error:
H5E_BEGIN_TRY {
H5Tclose(ftype1_id);
@@ -331,7 +331,7 @@ error:
if (buf2)
HDfree(buf2);
} H5E_END_TRY;
-
+
options->err_stat=1;
return nfound_total;
}
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index ea833db..be6950b 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -21,7 +21,7 @@
/*-------------------------------------------------------------------------
* Function: print_size
*
- * Purpose: print dimensions
+ * Purpose: print dimensions
*
*-------------------------------------------------------------------------
*/
@@ -39,7 +39,7 @@ print_size (int rank, hsize_t *dims)
}
parallel_print("%"H5_PRINTF_LL_WIDTH"u", (unsigned long_long)dims[rank-1]);
parallel_print("]\n" );
-
+
}
#endif /* H5DIFF_DEBUG */
@@ -152,48 +152,48 @@ error:
*
* Date: May 9, 2003
*
- * Modifications:
+ * Modifications:
*
*
* October 2006: Read by hyperslabs for big datasets.
*
* A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done
- * i.e., if the memory needed to read a dataset is greater than this limit,
- * then hyperslab I/O is done instead of one operation I/O
+ * i.e., if the memory needed to read a dataset is greater than this limit,
+ * then hyperslab I/O is done instead of one operation I/O
* For each dataset, the memory needed is calculated according to
*
* memory needed = number of elements * size of each element
*
- * if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations
+ * if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations
* are done
*
* H5Dread( input_dataset1 )
* H5Dread( input_dataset2 )
*
- * with all elements in the datasets selected. If the memory needed is greater than
+ * with all elements in the datasets selected. If the memory needed is greater than
* H5TOOLS_MALLOCSIZE, then the following operations are done instead:
*
- * a strip mine is defined for each dimension k (a strip mine is defined as a
+ * a strip mine is defined for each dimension k (a strip mine is defined as a
* hyperslab whose size is memory manageable) according to the formula
*
* (1) strip_mine_size[k ] = MIN(dimension[k ], H5TOOLS_BUFSIZE / size of memory type)
*
- * where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures
- * that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip
- * mine size k is simply defined as its dimension k, but for larger datasets the
+ * where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures
+ * that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip
+ * mine size k is simply defined as its dimension k, but for larger datasets the
* hyperslab size is still memory manageable.
- * a cycle is done until the number of elements in the dataset is reached. In each
- * iteration, two parameters are defined for the function H5Sselect_hyperslab,
+ * a cycle is done until the number of elements in the dataset is reached. In each
+ * iteration, two parameters are defined for the function H5Sselect_hyperslab,
* the start and size of each hyperslab, according to
*
* (2) hyperslab_size [k] = MIN(dimension[k] - hyperslab_offset[k], strip_mine_size [k])
*
- * where hyperslab_offset [k] is initially set to zero, and later incremented in
- * hyperslab_size[k] offsets. The reason for the operation
+ * where hyperslab_offset [k] is initially set to zero, and later incremented in
+ * hyperslab_size[k] offsets. The reason for the operation
*
* dimension[k] - hyperslab_offset[k]
*
- * in (2) is that, when using the strip mine size, it assures that the "remaining" part
+ * in (2) is that, when using the strip mine size, it assures that the "remaining" part
* of the dataset that does not fill an entire strip mine is processed.
*
*-------------------------------------------------------------------------
@@ -207,13 +207,13 @@ hsize_t diff_datasetid( hid_t did1,
hid_t sid1=-1;
hid_t sid2=-1;
hid_t f_tid1=-1;
- hid_t f_tid2=-1;
+ hid_t f_tid2=-1;
hid_t m_tid1=-1;
- hid_t m_tid2=-1;
+ hid_t m_tid2=-1;
size_t m_size1;
- size_t m_size2;
+ size_t m_size2;
H5T_sign_t sign1;
- H5T_sign_t sign2;
+ H5T_sign_t sign2;
int rank1;
int rank2;
hsize_t nelmts1;
@@ -228,9 +228,9 @@ hsize_t diff_datasetid( hid_t did1,
hsize_t storage_size2;
hsize_t nfound=0; /* number of differences found */
int cmp=1; /* do diff or not */
- void *buf1=NULL;
- void *buf2=NULL;
- void *sm_buf1=NULL;
+ void *buf1=NULL;
+ void *buf2=NULL;
+ void *sm_buf1=NULL;
void *sm_buf2=NULL;
size_t need; /* bytes needed for malloc */
int i;
@@ -401,7 +401,7 @@ hsize_t diff_datasetid( hid_t did1,
name2=diff_basename(obj2_name);
}
-
+
/*-------------------------------------------------------------------------
* read/compare
*-------------------------------------------------------------------------
@@ -435,60 +435,60 @@ hsize_t diff_datasetid( hid_t did1,
did1,
did2);
}
-
+
else /* possibly not enough memory, read/compare by hyperslabs */
-
+
{
size_t p_type_nbytes = m_size1; /*size of memory type */
hsize_t p_nelmts = nelmts1; /*total selected elmts */
hsize_t elmtno; /*counter */
int carry; /*counter carry value */
unsigned int vl_data = 0; /*contains VL datatypes */
-
+
/* stripmine info */
hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */
hsize_t sm_nbytes; /*bytes per stripmine */
hsize_t sm_nelmts; /*elements per stripmine*/
hid_t sm_space; /*stripmine data space */
-
+
/* hyperslab info */
hsize_t hs_offset[H5S_MAX_RANK]; /*starting offset */
hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */
hsize_t hs_nelmts; /*elements in request */
hsize_t zero[8]; /*vector of zeros */
-
+
/* check if we have VL data in the dataset's datatype */
if (H5Tdetect_class(m_tid1, H5T_VLEN) == TRUE)
vl_data = TRUE;
-
+
/*
* determine the strip mine size and allocate a buffer. The strip mine is
* a hyperslab whose size is manageable.
*/
sm_nbytes = p_type_nbytes;
-
+
for (i = rank1; i > 0; --i) {
sm_size[i - 1] = MIN(dims1[i - 1], H5TOOLS_BUFSIZE / sm_nbytes);
sm_nbytes *= sm_size[i - 1];
assert(sm_nbytes > 0);
}
-
+
sm_buf1 = malloc((size_t)sm_nbytes);
sm_buf2 = malloc((size_t)sm_nbytes);
-
+
sm_nelmts = sm_nbytes / p_type_nbytes;
sm_space = H5Screate_simple(1, &sm_nelmts, NULL);
-
+
/* the stripmine loop */
memset(hs_offset, 0, sizeof hs_offset);
memset(zero, 0, sizeof zero);
- for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts)
+ for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts)
{
/* calculate the hyperslab size */
- if (rank1 > 0)
+ if (rank1 > 0)
{
- for (i = 0, hs_nelmts = 1; i < rank1; i++)
+ for (i = 0, hs_nelmts = 1; i < rank1; i++)
{
hs_size[i] = MIN(dims1[i] - hs_offset[i], sm_size[i]);
hs_nelmts *= hs_size[i];
@@ -499,21 +499,21 @@ hsize_t diff_datasetid( hid_t did1,
goto error;
if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0)
goto error;
- }
- else
+ }
+ else
{
H5Sselect_all(sid1);
H5Sselect_all(sid2);
H5Sselect_all(sm_space);
hs_nelmts = 1;
} /* rank */
-
+
if ( H5Dread(did1,m_tid1,sm_space,sid1,H5P_DEFAULT,sm_buf1) < 0 )
goto error;
if ( H5Dread(did2,m_tid2,sm_space,sid2,H5P_DEFAULT,sm_buf2) < 0 )
goto error;
-
- /* get array differences. in the case of hyperslab read, increment the number of differences
+
+ /* get array differences. in the case of hyperslab read, increment the number of differences
found in each hyperslab and pass the position at the beggining for printing */
nfound += diff_array(sm_buf1,
sm_buf2,
@@ -534,9 +534,9 @@ hsize_t diff_datasetid( hid_t did1,
H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1);
H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2);
}
-
+
/* calculate the next hyperslab offset */
- for (i = rank1, carry = 1; i > 0 && carry; --i)
+ for (i = rank1, carry = 1; i > 0 && carry; --i)
{
hs_offset[i - 1] += hs_size[i - 1];
if (hs_offset[i - 1] == dims1[i - 1])
@@ -545,7 +545,7 @@ hsize_t diff_datasetid( hid_t did1,
carry = 0;
} /* i */
} /* elmtno */
-
+
H5Sclose(sm_space);
/* free */
if (sm_buf1!=NULL)
@@ -558,10 +558,10 @@ hsize_t diff_datasetid( hid_t did1,
free(sm_buf2);
sm_buf2=NULL;
}
-
+
} /* hyperslab read */
}/*cmp*/
-
+
/*-------------------------------------------------------------------------
* compare attributes
* the if condition refers to cases when the dataset is a referenced object
@@ -575,7 +575,7 @@ hsize_t diff_datasetid( hid_t did1,
* close
*-------------------------------------------------------------------------
*/
-
+
/* free */
if (buf1!=NULL)
{
@@ -611,7 +611,7 @@ hsize_t diff_datasetid( hid_t did1,
error:
options->err_stat=1;
-
+
/* free */
if (buf1!=NULL)
{
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 9e9c556..39bd973 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -93,7 +93,7 @@ void parallel_print(const char* format, ...)
/*-------------------------------------------------------------------------
* Function: print_dimensions
*
- * Purpose: print dimensions
+ * Purpose: print dimensions
*
*-------------------------------------------------------------------------
*/
@@ -110,7 +110,7 @@ print_dimensions (int rank, hsize_t *dims)
}
parallel_print("%"H5_PRINTF_LL_WIDTH"u", (unsigned long_long)dims[rank-1]);
parallel_print("]" );
-
+
}
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 3e407e6..12dcd82 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -709,7 +709,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
*
* Select a hyperslab from the dataset DSET using the parameters
* specified in SSET. Dump this out to STREAM.
- *
+ *
* Hyperslabs select "count" blocks of size "block", spaced "stride" elements
* from each other, starting at coordinate "start".
*
@@ -724,22 +724,22 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
*
* Algorithm
*
- * In a inner loop, the parameters from SSET are translated into temporary
- * variables so that 1 row is printed at a time (getting the coordinate indices
+ * In a inner loop, the parameters from SSET are translated into temporary
+ * variables so that 1 row is printed at a time (getting the coordinate indices
* at each row).
- * We define the stride, count and block to be 1 in the row dimension to achieve
- * this and advance until all points are printed.
- * An outer loop for cases where dimensionality is greater than 2D is made.
- * In each iteration, the 2D block is displayed in the inner loop. The remaining
+ * We define the stride, count and block to be 1 in the row dimension to achieve
+ * this and advance until all points are printed.
+ * An outer loop for cases where dimensionality is greater than 2D is made.
+ * In each iteration, the 2D block is displayed in the inner loop. The remaining
* slower dimensions above the first 2 are incremented one at a time in the outer loop
*
* The element position is obtained from the matrix according to:
- * Given an index I(z,y,x) its position from the beginning of an array
+ * Given an index I(z,y,x) its position from the beginning of an array
* of sizes A(size_z, size_y,size_x) is given by
- * Position of I(z,y,x) = index_z * size_y * size_x
+ * Position of I(z,y,x) = index_z * size_y * size_x
* + index_y * size_x
* + index_x
- *
+ *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -781,14 +781,14 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
hsize_t total_points = 1; /* to print */
hsize_t printed_points = 0; /* printed */
#endif
-
+
ret = FAIL; /* be pessimistic */
f_space = H5Dget_space(dset);
-
+
if (f_space == FAIL)
goto done;
-
+
/*
* check that everything looks okay. the dimensionality must not be too
* great and the dimensionality of the items selected for printing must
@@ -835,7 +835,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
total_points *= sset->count[ i ] * sset->block[ i ];;
}
#endif
-
+
/* initialize temporary start, count and maximum start */
@@ -854,55 +854,55 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
{
max_start[ i ] = temp_start[ i ] + sset->count[ i ];
temp_count[ i ] = 1;
-
+
}
}
-
+
/* offset loop */
for (n = 0; n < outer_count; n++)
{
- hsize_t row_counter = 0;
+ hsize_t row_counter = 0;
/* number of read iterations in inner loop, read by rows, to match 2D display */
if (ctx.ndims > 1)
{
-
+
/* count is the number of iterations to display all the rows,
the block size count times */
count = sset->count[ row_dim ] * sset->block[ row_dim ];
-
+
/* always 1 row_counter at a time, that is a block of size 1, 1 time */
- temp_count[ row_dim ] = 1;
- temp_block[ row_dim ] = 1;
-
+ temp_count[ row_dim ] = 1;
+ temp_block[ row_dim ] = 1;
+
/* advance 1 row_counter at a time */
if (sset->block[ row_dim ] > 1 )
temp_stride[ row_dim ] = 1;
-
-
+
+
}
/* for the 1D case */
else
{
count = 1;
}
-
-
+
+
size_row_block = sset->block[ row_dim ];
-
+
/* display loop */
- for (; count > 0;
+ for (; count > 0;
temp_start[ row_dim ] += temp_stride[ row_dim ],
count--)
{
-
+
/* jump rows if size of block exceeded
cases where block > 1 only and stride > block */
- if ( size_row_block > 1 &&
+ if ( size_row_block > 1 &&
row_counter == size_row_block &&
sset->stride[ row_dim ] > sset->block[ row_dim ]
)
@@ -914,7 +914,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
temp_start[ row_dim ] += increase_rows;
row_counter = 0;
-
+
}
row_counter++;
@@ -927,32 +927,32 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
temp_count,
temp_block);
sm_nelmts = H5Sget_select_npoints(f_space);
-
+
if (sm_nelmts == 0) {
/* nothing to print */
ret = SUCCEED;
goto done_close;
}
-
+
/*
* determine the strip mine size and allocate a buffer. the strip mine is
* a hyperslab whose size is manageable.
*/
sm_nbytes = p_type_nbytes = H5Tget_size(p_type);
-
+
if (ctx.ndims > 0)
for (i = ctx.ndims; i > 0; --i) {
sm_size[i - 1] = MIN(total_size[i - 1], H5TOOLS_BUFSIZE / sm_nbytes);
sm_nbytes *= sm_size[i - 1];
assert(sm_nbytes > 0);
}
-
+
assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/
sm_buf = malloc((size_t)sm_nelmts * p_type_nbytes);
sm_space = H5Screate_simple(1, &sm_nelmts, NULL);
-
+
H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, &zero, NULL, &sm_nelmts, NULL);
-
+
/* read the data */
if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0) {
H5Sclose(f_space);
@@ -960,43 +960,43 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
free(sm_buf);
return FAIL;
}
-
+
/* print the data */
flags = START_OF_DATA;
-
+
if (count == 1)
flags |= END_OF_DATA;
-
+
for (i = 0; i < ctx.ndims; i++)
ctx.p_max_idx[i] = ctx.p_min_idx[i] + MIN(total_size[i], sm_size[i]);
-
+
/* print array indices. get the lower bound of the hyperslab and calulate
the element position at the start of hyperslab */
H5Sget_select_bounds(f_space,low,high);
elmtno=0;
- for (i = 0; i < (size_t)ctx.ndims-1; i++)
+ for (i = 0; i < (size_t)ctx.ndims-1; i++)
{
hsize_t offset = 1; /* accumulation of the previous dimensions */
- for (j = i+1; j < (size_t)ctx.ndims; j++)
+ for (j = i+1; j < (size_t)ctx.ndims; j++)
offset *= total_size[j];
elmtno+= low[i] * offset;
}
elmtno+= low[ctx.ndims - 1];
-
+
/* initialize the current stripmine position; this is necessary to print the array
indices */
ctx.sm_pos = elmtno;
-
+
h5tools_dump_simple_data(stream, info, dset, &ctx, flags, sm_nelmts,
p_type, sm_buf);
free(sm_buf);
-
+
/* we need to jump to next line and update the index */
ctx.need_prefix = 1;
-
+
ctx.continuation++;
-
-
+
+
#if defined (SANITY_CHECK)
printed_points += sm_nelmts;
#endif
@@ -1008,14 +1008,14 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
{
/* dimension for start */
current_outer_dim = (ctx.ndims - 2) -1;
-
+
/* set start to original from current_outer_dim up */
for (i = current_outer_dim + 1; i < ctx.ndims; i++)
{
temp_start[ i ] = sset->start[ i ];
}
-
+
/* increment start dimension */
do
{
@@ -1034,9 +1034,9 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
}
}
while (current_outer_dim >= 0 && reset_dim);
-
+
} /* ctx.ndims > 1 */
-
+
} /* outer_count */
#if defined (SANITY_CHECK)
@@ -1050,9 +1050,9 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
putc('\n', stream);
fputs(OPT(info->line_sep, ""), stream);
}
-
+
ret = SUCCEED;
-
+
done_close:
H5Sclose(f_space);
done:
@@ -1125,7 +1125,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, hid_t dset,
ctx.indent_level = indentlevel;
ctx.need_prefix = 1;
ctx.ndims = H5Sget_simple_extent_ndims(f_space);
-
+
if ((size_t)ctx.ndims > NELMTS(sm_size)) {
H5Sclose(f_space);
return FAIL;
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index dad73e7..fb24f76 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -40,7 +40,7 @@
#define H5TOOLS_BUFSIZE (1024 * 1024)
#else
#define H5TOOLS_BUFSIZE (1024)
-#endif
+#endif
/*
* Maximum size used in a call to malloc
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 80839ce..5d42307 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -338,7 +338,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info,
h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT),
(hsize_t)ctx->pos[i]);
-
+
}
} else {
/* Scalar */
@@ -851,7 +851,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
obj = H5Rdereference(container, H5R_DATASET_REGION, vp);
region = H5Rget_region(container, H5R_DATASET_REGION, vp);
-
+
/* get name of the dataset the region reference points to using H5Rget_name */
H5Rget_name(obj, H5R_DATASET_REGION, vp, (char*)ref_name, 1024);
h5tools_str_append(str, info->dset_format, ref_name);
diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c
index b4e6d08..bbd1b8d 100644
--- a/tools/lib/h5tools_type.c
+++ b/tools/lib/h5tools_type.c
@@ -75,7 +75,7 @@ h5tools_get_little_endian_type(hid_t tid)
size = H5Tget_size(tid);
sign = H5Tget_sign(tid);
- switch( type_class )
+ switch( type_class )
{
case H5T_INTEGER:
{
@@ -88,7 +88,7 @@ h5tools_get_little_endian_type(hid_t tid)
else if ( size == 8 && sign == H5T_SGN_2)
p_type=H5Tcopy(H5T_STD_I64LE);
else if ( size == 1 && sign == H5T_SGN_NONE)
- p_type=H5Tcopy(H5T_STD_U8LE);
+ p_type=H5Tcopy(H5T_STD_U8LE);
else if ( size == 2 && sign == H5T_SGN_NONE)
p_type=H5Tcopy(H5T_STD_U16LE);
else if ( size == 4 && sign == H5T_SGN_NONE)
@@ -97,14 +97,14 @@ h5tools_get_little_endian_type(hid_t tid)
p_type=H5Tcopy(H5T_STD_U64LE);
}
break;
-
+
case H5T_FLOAT:
if ( size == 4)
p_type=H5Tcopy(H5T_IEEE_F32LE);
else if ( size == 8)
p_type=H5Tcopy(H5T_IEEE_F64LE);
break;
-
+
case H5T_TIME:
case H5T_BITFIELD:
case H5T_OPAQUE:
@@ -115,10 +115,10 @@ h5tools_get_little_endian_type(hid_t tid)
case H5T_VLEN:
case H5T_ARRAY:
break;
-
+
default:
break;
-
+
}
return(p_type);
@@ -152,7 +152,7 @@ h5tools_get_big_endian_type(hid_t tid)
size = H5Tget_size(tid);
sign = H5Tget_sign(tid);
- switch( type_class )
+ switch( type_class )
{
case H5T_INTEGER:
{
@@ -165,7 +165,7 @@ h5tools_get_big_endian_type(hid_t tid)
else if ( size == 8 && sign == H5T_SGN_2)
p_type=H5Tcopy(H5T_STD_I64BE);
else if ( size == 1 && sign == H5T_SGN_NONE)
- p_type=H5Tcopy(H5T_STD_U8BE);
+ p_type=H5Tcopy(H5T_STD_U8BE);
else if ( size == 2 && sign == H5T_SGN_NONE)
p_type=H5Tcopy(H5T_STD_U16BE);
else if ( size == 4 && sign == H5T_SGN_NONE)
@@ -174,14 +174,14 @@ h5tools_get_big_endian_type(hid_t tid)
p_type=H5Tcopy(H5T_STD_U64BE);
}
break;
-
+
case H5T_FLOAT:
if ( size == 4)
p_type=H5Tcopy(H5T_IEEE_F32BE);
else if ( size == 8)
p_type=H5Tcopy(H5T_IEEE_F64BE);
break;
-
+
case H5T_TIME:
case H5T_BITFIELD:
case H5T_OPAQUE:
@@ -192,13 +192,13 @@ h5tools_get_big_endian_type(hid_t tid)
case H5T_VLEN:
case H5T_ARRAY:
break;
-
+
default:
break;
-
+
}
-
+
return(p_type);
}