summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2022-07-14 16:07:53 (GMT)
committerGitHub <noreply@github.com>2022-07-14 16:07:53 (GMT)
commit385ae6ac5b729e9eaf076bd13424108e168fbf2d (patch)
tree5df45c4f1c661d330d15eee189919d71f29977d9 /tools/lib
parentb0d9fa058ad88f63e03638f8247814116b6a86bf (diff)
downloadhdf5-385ae6ac5b729e9eaf076bd13424108e168fbf2d.zip
hdf5-385ae6ac5b729e9eaf076bd13424108e168fbf2d.tar.gz
hdf5-385ae6ac5b729e9eaf076bd13424108e168fbf2d.tar.bz2
Eliminate unnecessary error output (#1879)
* Eliminate unnecessary error output * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5tools_str.c34
-rw-r--r--tools/lib/h5tools_str.h3
2 files changed, 20 insertions, 17 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index ab446e0..551002c 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -1203,7 +1203,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
/* if(nsize == H5R_DSET_REG_REF_BUF_SIZE) */
H5TOOLS_DEBUG("H5T_REFERENCE:H5T_STD_REF_DSETREG");
h5tools_str_append(str, H5_TOOLS_DATASET);
- h5tools_str_sprint_old_reference(str, container, vp);
+ h5tools_str_sprint_old_reference(str, container, H5R_DATASET_REGION, vp);
}
else if (H5Tequal(type, H5T_STD_REF_OBJ)) {
/* if (nsize == H5R_OBJ_REF_BUF_SIZE) */
@@ -1252,7 +1252,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
obj_tok_str = NULL;
}
- h5tools_str_sprint_old_reference(str, container, vp);
+ h5tools_str_sprint_old_reference(str, container, H5R_OBJECT, vp);
} /* end else if (H5Tequal(type, H5T_STD_REF_OBJ)) */
}
break;
@@ -1405,7 +1405,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
*-------------------------------------------------------------------------
*/
void
-h5tools_str_sprint_old_reference(h5tools_str_t *str, hid_t container, void *vp)
+h5tools_str_sprint_old_reference(h5tools_str_t *str, hid_t container, H5R_type_t ref_type, void *vp)
{
hid_t obj = H5I_INVALID_HID;
hid_t region = H5I_INVALID_HID;
@@ -1414,21 +1414,23 @@ h5tools_str_sprint_old_reference(h5tools_str_t *str, hid_t container, void *vp)
H5TOOLS_START_DEBUG(" ");
h5tools_str_append(str, " \"");
- obj = H5Rdereference2(container, H5P_DEFAULT, H5R_DATASET_REGION, vp);
- if (obj >= 0) {
- region = H5Rget_region(container, H5R_DATASET_REGION, vp);
- if (region >= 0) {
- H5Rget_name(obj, H5R_DATASET_REGION, vp, (char *)ref_name, 1024);
- h5tools_str_append(str, "%s", ref_name);
+ if (ref_type == H5R_DATASET_REGION) {
+ obj = H5Rdereference2(container, H5P_DEFAULT, ref_type, vp);
+ if (obj >= 0) {
+ region = H5Rget_region(container, ref_type, vp);
+ if (region >= 0) {
+ H5Rget_name(obj, ref_type, vp, (char *)ref_name, 1024);
+ h5tools_str_append(str, "%s", ref_name);
- H5Sclose(region);
- } /* end if (region >= 0) */
- H5Dclose(obj);
- } /* end if (obj >= 0) */
- else {
- obj = H5Rdereference2(container, H5P_DEFAULT, H5R_OBJECT, vp);
+ H5Sclose(region);
+ } /* end if (region >= 0) */
+ H5Dclose(obj);
+ } /* end if (obj >= 0) */
+ }
+ else if (ref_type == H5R_OBJECT) {
+ obj = H5Rdereference2(container, H5P_DEFAULT, ref_type, vp);
if (obj >= 0) {
- H5Rget_name(obj, H5R_OBJECT, vp, (char *)ref_name, 1024);
+ H5Rget_name(obj, ref_type, vp, (char *)ref_name, 1024);
h5tools_str_append(str, "%s", ref_name);
H5Dclose(obj);
}
diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h
index 3f4fd05..f58cd3d 100644
--- a/tools/lib/h5tools_str.h
+++ b/tools/lib/h5tools_str.h
@@ -41,7 +41,8 @@ H5TOOLS_DLL void h5tools_str_dump_space_slabs(h5tools_str_t *, hid_t, const h5t
h5tools_context_t *ctx);
H5TOOLS_DLL void h5tools_str_dump_space_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *);
H5TOOLS_DLL void h5tools_str_dump_space_points(h5tools_str_t *, hid_t, const h5tool_format_t *);
-H5TOOLS_DLL void h5tools_str_sprint_old_reference(h5tools_str_t *str, hid_t container, void *vp);
+H5TOOLS_DLL void h5tools_str_sprint_old_reference(h5tools_str_t *str, hid_t container, H5R_type_t ref_type,
+ void *vp);
H5TOOLS_DLL void h5tools_str_sprint_reference(h5tools_str_t *str, H5R_ref_t *vp);
H5TOOLS_DLL char *h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t container,
hid_t type, void *vp, h5tools_context_t *ctx);