diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-07-13 15:53:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-13 15:53:00 (GMT) |
commit | b0d9fa058ad88f63e03638f8247814116b6a86bf (patch) | |
tree | 38ae1b680b9ced294f95c77a110b71dd4acef264 /java/src/jni/h5util.c | |
parent | b2363a8195408331797cd32820fbb0dfc288f646 (diff) | |
download | hdf5-b0d9fa058ad88f63e03638f8247814116b6a86bf.zip hdf5-b0d9fa058ad88f63e03638f8247814116b6a86bf.tar.gz hdf5-b0d9fa058ad88f63e03638f8247814116b6a86bf.tar.bz2 |
Fix for a tools compile issue when deprecated symbols are disabled (#1884)
* Fix for a tools compile issue when deprecated symbols are disabled
Introduced in #1811, also uses VOL token instead of addr
* Fix for similar compile issues in java when deprecated symbols are
disabled.
* Committing clang-format changes
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'java/src/jni/h5util.c')
-rw-r--r-- | java/src/jni/h5util.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 6325ae4..d661acb 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -1180,8 +1180,9 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); } else if (H5R_OBJ_REF_BUF_SIZE == typeSize) { - H5O_info1_t oi; - hid_t obj = H5I_INVALID_HID; + H5O_info2_t oi; + hid_t obj = H5I_INVALID_HID; + char * obj_tok_str = NULL; /* * Object references -- show the type and OID of the referenced @@ -1194,33 +1195,40 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i if ((obj = H5Rdereference2(container, H5P_DEFAULT, H5R_OBJECT, cptr)) < 0) H5_LIBRARY_ERROR(ENVONLY); - if (H5Oget_info2(obj, &oi, H5O_INFO_ALL) < 0) + if (H5Oget_info3(obj, &oi, H5O_INFO_ALL) < 0) H5_LIBRARY_ERROR(ENVONLY); /* Print object data and close object */ + H5Otoken_to_str(obj, &oi.token, &obj_tok_str); + switch (oi.type) { case H5O_TYPE_GROUP: - if (HDsprintf(this_str, "%s %llu", H5_TOOLS_GROUP, oi.addr) < 0) + if (HDsprintf(this_str, "%s %s", H5_TOOLS_GROUP, obj_tok_str) < 0) H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure"); break; case H5O_TYPE_DATASET: - if (HDsprintf(this_str, "%s %llu", H5_TOOLS_DATASET, oi.addr) < 0) + if (HDsprintf(this_str, "%s %s", H5_TOOLS_DATASET, obj_tok_str) < 0) H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure"); break; case H5O_TYPE_NAMED_DATATYPE: - if (HDsprintf(this_str, "%s %llu", H5_TOOLS_DATATYPE, oi.addr) < 0) + if (HDsprintf(this_str, "%s %s", H5_TOOLS_DATATYPE, obj_tok_str) < 0) H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure"); break; case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: - if (HDsprintf(this_str, "%u-%llu", (unsigned)oi.type, oi.addr) < 0) + if (HDsprintf(this_str, "%u-%s", (unsigned)oi.type, obj_tok_str) < 0) H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure"); break; - } /* end switch */ + } + + if (obj_tok_str) { + H5free_memory(obj_tok_str); + obj_tok_str = NULL; + } if (H5Oclose(obj) < 0) H5_LIBRARY_ERROR(ENVONLY); |