summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-07-30 19:21:26 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-07-30 19:21:26 (GMT)
commit617d269ceb3dda4f504ac48e3dd618d31b4b3fd8 (patch)
treea1d559fbb3e16313a97d92e311555d1ffbda48e6
parent11bfbb10012b06894e70730735cf9c47bf565fe8 (diff)
downloadhdf5-617d269ceb3dda4f504ac48e3dd618d31b4b3fd8.zip
hdf5-617d269ceb3dda4f504ac48e3dd618d31b4b3fd8.tar.gz
hdf5-617d269ceb3dda4f504ac48e3dd618d31b4b3fd8.tar.bz2
Warnings reduction in tools
-rw-r--r--tools/lib/h5diff.c2
-rw-r--r--tools/lib/h5diff.h1
-rw-r--r--tools/lib/h5diff_array.c200
-rw-r--r--tools/lib/h5diff_attr.c12
-rw-r--r--tools/lib/h5diff_dset.c14
-rw-r--r--tools/lib/h5tools.c2
-rw-r--r--tools/lib/h5tools_dump.c4
-rw-r--r--tools/lib/h5tools_str.c10
8 files changed, 119 insertions, 126 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 15da7d3..e9b79b4 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -234,7 +234,7 @@ done:
* 0 - not excluded path
*------------------------------------------------------------------------*/
static int
-is_exclude_attr (char *path, h5trav_type_t type, diff_opt_t *opts)
+is_exclude_attr (const char *path, h5trav_type_t type, diff_opt_t *opts)
{
struct exclude_path_list *exclude_ptr;
int ret_cmp;
diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h
index 0209d31..c7c57ae 100644
--- a/tools/lib/h5diff.h
+++ b/tools/lib/h5diff.h
@@ -57,6 +57,7 @@ typedef struct {
int mode_list_not_cmp; /* list not comparable messages */
int print_header; /* print header */
int print_percentage; /* print percentage */
+ int print_dims; /* print dimension index */
int delta_bool; /* delta, absolute value to compare */
double delta; /* delta value */
int use_system_epsilon; /* flag to use system epsilon (1 or 0) */
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index f46dc73..cb35217 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -134,7 +134,7 @@ typedef struct mcomp_t {
*/
static hbool_t all_zero(const void *_mem, size_t size);
static int ull2float(unsigned long long ull_value, float *f_value);
-static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, ssize_t u, diff_opt_t *opts);
+static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t *opts);
static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno, diff_opt_t *opts);
static hbool_t equal_float(float value, float expected, diff_opt_t *opts);
static hbool_t equal_double(double value, double expected, diff_opt_t *opts);
@@ -143,7 +143,7 @@ static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t
#endif
static int print_data(diff_opt_t *opts);
-static void print_pos(diff_opt_t *opts, hsize_t elemtno, ssize_t u);
+static void print_pos(diff_opt_t *opts, hsize_t elemtno, size_t u);
static void h5diff_print_char(char ch);
static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *opts);
@@ -679,7 +679,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
*/
nfound += 1;
opts->print_percentage = 0;
- print_pos(opts, elemtno, -1);
+ print_pos(opts, elemtno, 0);
if (print_data(opts)) {
parallel_print(S_FORMAT, enum_name1, enum_name2);
}
@@ -689,7 +689,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
if (HDstrcmp(enum_name1, enum_name2) != 0) {
nfound = 1;
opts->print_percentage = 0;
- print_pos(opts, elemtno, -1);
+ print_pos(opts, elemtno, 0);
if (print_data(opts)) {
parallel_print(S_FORMAT, enum_name1, enum_name2);
}
@@ -1322,7 +1322,7 @@ done:
*-------------------------------------------------------------------------
*/
-static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, ssize_t u, diff_opt_t *opts)
+static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t *opts)
{
hsize_t nfound = 0; /* differences found */
char temp1_uchar;
@@ -1335,6 +1335,7 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, ssize_
if (temp1_uchar != temp2_uchar) {
if (print_data(opts)) {
opts->print_percentage = 0;
+ opts->print_dims = 1;
print_pos(opts, elemtno, u);
parallel_print(" ");
h5diff_print_char(temp1_uchar);
@@ -1374,7 +1375,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h
if (opts->delta_bool && !opts->percent_bool) {
if (PDIFF(temp1_uchar,temp2_uchar) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elemtno, -1);
+ print_pos(opts, elemtno, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
}
@@ -1386,7 +1387,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h
PER_UNSIGN(signed char, temp1_uchar, temp2_uchar);
if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elemtno, -1);
+ print_pos(opts, elemtno, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per);
}
@@ -1398,7 +1399,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h
PER_UNSIGN(signed char, temp1_uchar, temp2_uchar);
if (per > opts->percent && PDIFF(temp1_uchar,temp2_uchar) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elemtno, -1);
+ print_pos(opts, elemtno, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per);
}
@@ -1407,7 +1408,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h
}
else if (temp1_uchar != temp2_uchar) {
opts->print_percentage = 0;
- print_pos(opts, elemtno, -1);
+ print_pos(opts, elemtno, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
}
@@ -1462,7 +1463,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (!isnan1 && !isnan2) {
if ((double) ABS(temp1_float - temp2_float) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
@@ -1472,7 +1473,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
@@ -1498,7 +1499,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
@@ -1506,7 +1507,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float,
(double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float));
@@ -1517,7 +1518,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
@@ -1544,7 +1545,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
@@ -1552,7 +1553,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float,
(double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float));
@@ -1563,7 +1564,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
@@ -1577,7 +1578,7 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz
else {
if (equal_float(temp1_float, temp2_float, opts) == FALSE) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float));
}
@@ -1630,7 +1631,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi
if (!isnan1 && !isnan2) {
if (ABS(temp1_double-temp2_double) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1640,7 +1641,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1667,7 +1668,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1675,7 +1676,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT_P, temp1_double, temp2_double,
ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double));
@@ -1686,7 +1687,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1713,7 +1714,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1721,7 +1722,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi
}
else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT_P, temp1_double, temp2_double,
ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double));
@@ -1732,7 +1733,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1746,7 +1747,7 @@ static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsi
else {
if (equal_double(temp1_double, temp2_double, opts) == FALSE) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1803,7 +1804,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs
if (!isnan1 && !isnan2) {
if (ABS(temp1_double-temp2_double) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1813,7 +1814,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1840,7 +1841,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1848,7 +1849,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double));
}
@@ -1858,7 +1859,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1885,7 +1886,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1893,7 +1894,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs
}
else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double));
}
@@ -1903,7 +1904,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs
/* only one is NaN, assume difference */
else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1916,7 +1917,7 @@ static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hs
*/
else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
@@ -1953,7 +1954,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (opts->delta_bool && !opts->percent_bool) {
if (ABS(temp1_char-temp2_char) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
}
@@ -1966,7 +1967,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
}
@@ -1974,7 +1975,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per);
}
@@ -1987,7 +1988,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
}
@@ -1995,7 +1996,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per);
}
@@ -2004,7 +2005,7 @@ static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (temp1_char != temp2_char) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char));
}
@@ -2040,7 +2041,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (opts->delta_bool && !opts->percent_bool) {
if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
}
@@ -2053,7 +2054,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
}
@@ -2061,7 +2062,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per);
}
@@ -2074,7 +2075,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
}
@@ -2082,7 +2083,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per);
}
@@ -2091,7 +2092,7 @@ static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (temp1_uchar != temp2_uchar) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar));
}
@@ -2127,7 +2128,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (opts->delta_bool && !opts->percent_bool) {
if (ABS(temp1_short - temp2_short) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
}
@@ -2140,7 +2141,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
}
@@ -2148,7 +2149,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per);
}
@@ -2161,7 +2162,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
}
@@ -2169,7 +2170,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per);
}
@@ -2178,7 +2179,7 @@ static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (temp1_short != temp2_short) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short));
}
@@ -2214,7 +2215,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi
if (opts->delta_bool && !opts->percent_bool) {
if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
}
@@ -2227,7 +2228,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
}
@@ -2235,7 +2236,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per);
}
@@ -2248,7 +2249,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
}
@@ -2256,7 +2257,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi
}
else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per);
}
@@ -2265,7 +2266,7 @@ static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsi
}
else if (temp1_ushort != temp2_ushort) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort));
}
@@ -2301,7 +2302,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_
if (opts->delta_bool && !opts->percent_bool) {
if (ABS(temp1_int-temp2_int) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
}
@@ -2314,7 +2315,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
}
@@ -2322,7 +2323,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per);
}
@@ -2335,7 +2336,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
}
@@ -2343,7 +2344,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_
}
else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per);
}
@@ -2352,7 +2353,7 @@ static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_
}
else if (temp1_int != temp2_int) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int));
}
@@ -2388,7 +2389,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize
if (opts->delta_bool && !opts->percent_bool) {
if (PDIFF(temp1_uint, temp2_uint) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
}
@@ -2401,7 +2402,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
}
@@ -2409,7 +2410,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per);
}
@@ -2422,7 +2423,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
}
@@ -2430,7 +2431,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize
}
else if (per > opts->percent && PDIFF(temp1_uint,temp2_uint) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per);
}
@@ -2439,7 +2440,7 @@ static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize
}
else if (temp1_uint != temp2_uint) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint));
}
@@ -2475,7 +2476,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize
if (opts->delta_bool && !opts->percent_bool) {
if (ABS(temp1_long-temp2_long) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
}
@@ -2488,7 +2489,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
}
@@ -2496,7 +2497,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per);
}
@@ -2509,7 +2510,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
}
@@ -2517,7 +2518,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize
}
else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per);
}
@@ -2526,7 +2527,7 @@ static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize
}
else if (temp1_long != temp2_long) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long));
}
@@ -2562,7 +2563,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (opts->delta_bool && !opts->percent_bool) {
if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
}
@@ -2575,7 +2576,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
}
@@ -2583,7 +2584,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per);
}
@@ -2596,7 +2597,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
}
@@ -2604,7 +2605,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per);
}
@@ -2613,7 +2614,7 @@ static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (temp1_ulong != temp2_ulong) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong));
}
@@ -2650,7 +2651,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (opts->delta_bool && !opts->percent_bool) {
if (ABS( temp1_llong-temp2_llong) > opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong));
}
@@ -2663,7 +2664,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong));
}
@@ -2671,7 +2672,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per);
}
@@ -2684,7 +2685,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong));
}
@@ -2692,7 +2693,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz
}
else if (per > opts->percent && ABS(temp1_llong-temp2_llong) > opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per);
}
@@ -2702,7 +2703,7 @@ static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsiz
else {
if (temp1_llong != temp2_llong) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong));
}
@@ -2741,7 +2742,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi
if (opts->delta_bool && !opts->percent_bool) {
if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong));
}
@@ -2756,7 +2757,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong));
}
@@ -2764,7 +2765,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi
}
else if (per > opts->percent) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong,temp2_ullong), per);
}
@@ -2779,7 +2780,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi
if (not_comparable && !both_zero) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong));
}
@@ -2787,7 +2788,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi
}
else if (per > opts->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) {
opts->print_percentage = 1;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong), per);
}
@@ -2797,7 +2798,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi
else {
if (temp1_ullong != temp2_ullong) {
opts->print_percentage = 0;
- print_pos(opts, elem_idx, -1);
+ print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong));
}
@@ -3048,7 +3049,7 @@ void print_header(diff_opt_t *opts)
*-------------------------------------------------------------------------
*/
static
-void print_pos(diff_opt_t *opts, hsize_t idx, ssize_t u)
+void print_pos(diff_opt_t *opts, hsize_t idx, size_t u)
{
int i,j;
@@ -3111,7 +3112,7 @@ void print_pos(diff_opt_t *opts, hsize_t idx, ssize_t u)
* Calculate the number of elements represented by a unit change in a
* certain index position.
*/
- calc_acc_pos(opts->rank, curr_pos, opts->acc, opts->pos);
+ calc_acc_pos((unsigned)opts->rank, curr_pos, opts->acc, opts->pos);
for (i = 0; i < opts->rank; i++) {
H5TOOLS_DEBUG("pos loop:%d with opts->pos=%ld opts->sm_pos=%ld", i, opts->pos[i], opts->sm_pos[i]);
@@ -3123,10 +3124,11 @@ void print_pos(diff_opt_t *opts, hsize_t idx, ssize_t u)
parallel_print("]");
}
else {
- if (u >= 0) {
+ if (opts->print_dims) {
parallel_print("[ ");
parallel_print("%zu", u);
parallel_print("]");
+ opts->print_dims = 0;
}
else
parallel_print(" ");
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 3b5f6cc..2e903be 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -375,18 +375,16 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id,
j = (int)HDstrlen(name1);
H5TOOLS_DEBUG("attr1_name: %s - %d", name1, j);
if (j > 0) {
- opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char));
- HDstrncpy(opts->obj_name[0], name1, (size_t)j);
- opts->obj_name[0][j] = '\0';
+ opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1);
+ HDstrncpy(opts->obj_name[0], name1, (size_t)j + 1);
}
}
if (name2) {
j = (int)HDstrlen(name2);
H5TOOLS_DEBUG("attr2_name: %s - %d", name2, j);
if (j > 0) {
- opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char));
- HDstrncpy(opts->obj_name[1], name2, (size_t)j);
- opts->obj_name[1][j] = '\0';
+ opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1);
+ HDstrncpy(opts->obj_name[1], name2, (size_t)j + 1);
}
}
H5TOOLS_DEBUG("attr_names: %s - %s", opts->obj_name[0], opts->obj_name[1]);
@@ -412,7 +410,7 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id,
opts->nelmts *= dims1[j];
}
opts->rank = rank1;
- init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx);
+ init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx);
/*---------------------------------------------------------------------
* read
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index 79884fa..8fb24e1 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -277,9 +277,8 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n
j = (int)HDstrlen(obj1_name);
H5TOOLS_DEBUG("obj1_name: %s - %d", obj1_name, j);
if (j > 0) {
- opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char));
- HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j );
- opts->obj_name[0][j] = '\0';
+ opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1);
+ HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j + 1);
}
}
@@ -289,9 +288,8 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n
j = (int)HDstrlen(obj2_name);
H5TOOLS_DEBUG("obj2_name: %s - %d", obj2_name, j);
if (j > 0) {
- opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char));
- HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j);
- opts->obj_name[1][j] = '\0';
+ opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1);
+ HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j + 1);
}
}
@@ -439,7 +437,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n
} /* end if */
/* Assume entire data space to be printed */
- init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx);
+ init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx);
for(i = 0; i < opts->rank; i++) {
opts->p_max_idx[i] = opts->dims[i];
@@ -780,7 +778,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n
opts->sm_pos[j] = low[j];
/* Assume entire data space to be printed */
- init_acc_pos(opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx);
+ init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx);
/* get array differences. in the case of hyperslab read, increment the number of differences
found in each hyperslab and pass the position at the beginning for printing */
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 8c3623a..7f046fe 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1492,7 +1492,7 @@ calc_acc_pos(unsigned ndims, hsize_t elmtno, hsize_t *acc, hsize_t *pos)
H5TOOLS_START_DEBUG("");
if(ndims > 0) {
- for(i = 0; i < (size_t) ndims; i++) {
+ for(i = 0; i < (int)ndims; i++) {
if(curr_pos > 0) {
H5TOOLS_DEBUG("curr_pos=%ld - ctx->acc[%d]=%ld", curr_pos, i, acc[i]);
pos[i] = curr_pos / acc[i];
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 01c4655..905d147 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -1564,8 +1564,8 @@ static herr_t
h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset, hid_t p_type)
{
int sndims;
- hid_t f_space = H5I_INVALID_HID; /* file data space */
- hsize_t total_size[H5S_MAX_RANK];/* total size of dataset*/
+ hid_t f_space = H5I_INVALID_HID; /* file data space */
+ hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/
hbool_t past_catch = FALSE;
herr_t ret_value = SUCCEED;
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 3843ee4..9f00eee 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -286,17 +286,14 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, hs
h5tools_context_t *ctx)
{
size_t i = 0;
- hsize_t curr_pos = elmtno;
H5TOOLS_START_DEBUG("");
H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims);
h5tools_str_reset(str);
- curr_pos = calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos);
+ calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos);
if(ctx->ndims > 0) {
- HDassert(curr_pos == 0);
-
/* Print the index values */
for(i = 0; i < (size_t) ctx->ndims; i++) {
if (i)
@@ -329,17 +326,14 @@ h5tools_str_region_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *i
hsize_t *ptdata, h5tools_context_t *ctx)
{
size_t i = 0;
- hsize_t curr_pos = elmtno;
H5TOOLS_START_DEBUG("");
H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims);
h5tools_str_reset(str);
- curr_pos = calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos);
+ calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos);
if(ctx->ndims > 0) {
- HDassert(curr_pos == 0);
-
/* Print the index values */
for(i = 0; i < (size_t) ctx->ndims; i++) {
ctx->pos[i] += (unsigned long) ptdata[ctx->sm_pos+i];