summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_str.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2019-02-28 21:24:02 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2019-02-28 21:24:02 (GMT)
commit646fc294078f560fc9bef784cb1c4e27cdc51f5b (patch)
tree21502062cfc4ab6410f6d81de11e28c1523e85bd /tools/lib/h5tools_str.c
parent5eef94f83f4875b64ffe7f9cea05d965bddbd802 (diff)
parent6819c11508b0610f222fe3bfe8a19f637bf4319c (diff)
downloadhdf5-dc9412f73acfd0f887f7a112533ea078fedd1f19.zip
hdf5-dc9412f73acfd0f887f7a112533ea078fedd1f19.tar.gz
hdf5-dc9412f73acfd0f887f7a112533ea078fedd1f19.tar.bz2
Merge pull request #1590 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:1.10/master to 1.10/masterhdf5-1_10_5
* commit '6819c11508b0610f222fe3bfe8a19f637bf4319c': (154 commits) CMake needs a tar.gz examples file for windows, too. Correct file permissions on README.txt. Address merge anomalies and incorrect file permissions. Update release date in README.txt and RELEASE.txt. Revisions to Platforms tested. Updated LT_VERS_AGE in config/lt_vers.am due to reinstatement of previously removed symbols, then ran autogen.sh to propagate so number changes and H5E_LOGFAIL_g addition to files checked in on release branch. Updated H5err.txt to replace a global variable that was removed during the metadata cache logging changes (to maintain binary compatibility). HDFFV-10552,10686 restore H5O_*1 functions Minor fix in h5str_sprintf for NULL region references Add new files to MANIFEST. Update so version numbers. fix 2 typos. Update RELEASE.txt for TRILABS-34 and remove unused sections. Add script for building HDF5 with CMake on HPC machines that use sbatch. Add README file for inclusion in CMake-hdf5-<version>.tar.gz file. Add updated README_HPC file with cross compile instructions. set version to 1.10.5-pre1. Change default build mode to production. Merge pull request #1560 in HDFFV/hdf5 from hdf5-1-10-documentation-only to hdf5_1_10_5 Update HISTORY-1_10.txt and RELEASE.txt files. Modify RELEASE.txt in response to PR comments Check in files generated by autogen.sh for hdf5_1_10_5 release branch. Check in files generated by autogen.sh for hdf5_1_10_5 release branch. 2019/02/16. Code improvement ...
Diffstat (limited to 'tools/lib/h5tools_str.c')
-rw-r--r--tools/lib/h5tools_str.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 3d595ca..3e8f1fe 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -1045,43 +1045,47 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
}
else {
- unsigned nmembs;
- unsigned j;
+ int retvalue;
- nmembs = (unsigned)H5Tget_nmembers(type);
- h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{"));
+ retvalue = H5Tget_nmembers(type);
+ if (retvalue >= 0) {
+ unsigned j;
+ unsigned nmembs = (unsigned)retvalue;
- ctx->indent_level++;
+ h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{"));
- for(j = 0; j < nmembs; j++) {
- if(j)
- h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", "OPTIONAL_LINE_BREAK));
- else
- h5tools_str_append(str, "%s", OPT(info->cmpd_end, ""));
+ ctx->indent_level++;
- if(info->arr_linebreak)
- h5tools_str_indent(str, info, ctx);
+ for(j = 0; j < nmembs; j++) {
+ if(j)
+ h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", "OPTIONAL_LINE_BREAK));
+ else
+ h5tools_str_append(str, "%s", OPT(info->cmpd_end, ""));
- /* The name */
- name = H5Tget_member_name(type, j);
- h5tools_str_append(str, OPT(info->cmpd_name, ""), name);
- H5free_memory(name);
+ if(info->arr_linebreak)
+ h5tools_str_indent(str, info, ctx);
- /* The value */
- offset = H5Tget_member_offset(type, j);
- memb = H5Tget_member_type(type, j);
+ /* The name */
+ name = H5Tget_member_name(type, j);
+ h5tools_str_append(str, OPT(info->cmpd_name, ""), name);
+ H5free_memory(name);
- h5tools_str_sprint(str, info, container, memb, cp_vp + offset, ctx);
+ /* The value */
+ offset = H5Tget_member_offset(type, j);
+ memb = H5Tget_member_type(type, j);
- H5Tclose(memb);
- }
- ctx->indent_level--;
+ h5tools_str_sprint(str, info, container, memb, cp_vp + offset, ctx);
- if(info->arr_linebreak) {
- h5tools_str_append(str, "%s", OPT(info->cmpd_end, ""));
- h5tools_str_indent(str, info, ctx);
+ H5Tclose(memb);
+ }
+ ctx->indent_level--;
+
+ if(info->arr_linebreak) {
+ h5tools_str_append(str, "%s", OPT(info->cmpd_end, ""));
+ h5tools_str_indent(str, info, ctx);
+ }
+ h5tools_str_append(str, "%s", OPT(info->cmpd_suf, "}"));
}
- h5tools_str_append(str, "%s", OPT(info->cmpd_suf, "}"));
}
break;