summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r--tools/lib/h5diff_array.c44
1 files changed, 26 insertions, 18 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 98b9db3..8321a98 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -487,7 +487,7 @@ static hsize_t diff_datum(
case H5T_COMPOUND:
H5TOOLS_DEBUG("diff_datum H5T_COMPOUND");
{
- hid_t memb_type = -1;
+ hid_t memb_type = H5I_INVALID_HID;
nmembs = members->n;
for (j = 0; j < nmembs; j++) {
@@ -698,7 +698,7 @@ static hsize_t diff_datum(
*/
case H5T_ARRAY:
{
- hid_t memb_type = -1;
+ hid_t memb_type = H5I_INVALID_HID;
hsize_t adims[H5S_MAX_RANK];
int ndims;
@@ -734,8 +734,8 @@ static hsize_t diff_datum(
H5TOOLS_GOTO_DONE(opts->err_stat);
}
else if (!iszero1 && !iszero2) {
- hid_t obj1_id = -1;
- hid_t obj2_id = -1;
+ hid_t obj1_id = H5I_INVALID_HID;
+ hid_t obj2_id = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* H5T_STD_REF
@@ -744,10 +744,10 @@ static hsize_t diff_datum(
*/
if (H5Tequal(m_type, H5T_STD_REF)) {
/* if (type_size == H5R_STD_REF_SIZE) */
- hid_t region1_id = -1;
- hid_t region2_id = -1;
- H5R_ref_t *ref1_buf = (const H5R_ref_t *)_mem1;
- H5R_ref_t *ref2_buf = (const H5R_ref_t *)_mem2;
+ hid_t region1_id = H5I_INVALID_HID;
+ hid_t region2_id = H5I_INVALID_HID;
+ H5R_ref_t *ref1_buf = (H5R_ref_t *)_mem1;
+ H5R_ref_t *ref2_buf = (H5R_ref_t *)_mem2;
H5O_type_t obj1_type = -1; /* Object type */
H5O_type_t obj2_type = -1; /* Object type */
H5R_type_t ref_type; /* Reference type */
@@ -920,7 +920,7 @@ static hsize_t diff_datum(
/* if (obj_id < 0) - could mean that no reference was written do not throw failure */
obj1_id = H5Ropen_object(ref1_buf, H5P_DEFAULT, H5P_DEFAULT);
obj2_id = H5Ropen_object(ref2_buf, H5P_DEFAULT, H5P_DEFAULT);
- if((obj1_id < 0) || (obj1_id < 0)) {
+ if((obj1_id < 0) || (obj2_id < 0)) {
H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION2 failed");
}
else {
@@ -979,7 +979,7 @@ static hsize_t diff_datum(
H5TOOLS_INFO("H5Ropen_attr object 2 failed");
}
- if((obj1_id < 0) || (obj1_id < 0)) {
+ if((obj1_id < 0) || (obj2_id < 0)) {
H5TOOLS_INFO("H5Ropen_attr H5R_ATTR failed");
}
else {
@@ -1024,8 +1024,8 @@ static hsize_t diff_datum(
*/
else if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) {
/* if (type_size == H5R_DSET_REG_REF_BUF_SIZE) */
- hid_t region1_id = -1;
- hid_t region2_id = -1;
+ hid_t region1_id = H5I_INVALID_HID;
+ hid_t region2_id = H5I_INVALID_HID;
H5TOOLS_INFO("H5T_STD_REF_DSETREG reference type");
@@ -1113,7 +1113,7 @@ static hsize_t diff_datum(
*/
case H5T_VLEN:
{
- hid_t memb_type = -1;
+ hid_t memb_type = H5I_INVALID_HID;
H5TOOLS_DEBUG("diff_datum H5T_VLEN");
/* get the VL sequences's base datatype for each element */
@@ -2394,14 +2394,22 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
/* print differences if found */
if (nfound_b && opts->m_verbose) {
- H5O_info_t oi1, oi2;
+ H5O_info2_t oi1, oi2;
+ char *obj1_str = NULL, *obj2_str = NULL;
- H5Oget_info2(obj1_id, &oi1, H5O_INFO_BASIC);
- H5Oget_info2(obj2_id, &oi2, H5O_INFO_BASIC);
+ H5Oget_info3(obj1_id, &oi1, H5O_INFO_BASIC);
+ H5Oget_info3(obj2_id, &oi2, H5O_INFO_BASIC);
- parallel_print("Referenced dataset %lu %lu\n", (unsigned long) oi1.addr, (unsigned long) oi2.addr);
+ /* Convert object tokens into printable output */
+ H5Otoken_to_str(obj1_id, &oi1.token, &obj1_str);
+ H5Otoken_to_str(obj2_id, &oi2.token, &obj2_str);
+
+ parallel_print("Referenced dataset %s %s\n", obj1_str, obj2_str);
parallel_print( "------------------------------------------------------------\n");
+ H5free_memory(obj1_str);
+ H5free_memory(obj2_str);
+
parallel_print("Region blocks\n");
for (i = 0; i < nblocks1; i++) {
parallel_print("block #%d", i);
@@ -4509,7 +4517,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2,
static
int ull2float(unsigned long long ull_value, float *f_value)
{
- hid_t dxpl_id = -1;
+ hid_t dxpl_id = H5I_INVALID_HID;
unsigned char *buf = NULL;
size_t src_size;
size_t dst_size;