summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2012-05-22 21:36:45 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2012-05-22 21:36:45 (GMT)
commitb904ca7ec369149f858495860795fd7afcba8670 (patch)
treea3d592fedf3dca2fd90c1f50e1c262d0d86fc493 /tools/lib
parent2f8b5057c1613f02e3ba24aa2511734e5ea836bd (diff)
downloadhdf5-b904ca7ec369149f858495860795fd7afcba8670.zip
hdf5-b904ca7ec369149f858495860795fd7afcba8670.tar.gz
hdf5-b904ca7ec369149f858495860795fd7afcba8670.tar.bz2
[svn-r22391] HDFFV-7999: h5dump did not display H5T_DSET_UTF8.
Changed if/else block to switch like in h5ls, and distinguished between ERROR and UNKNOWN. Reviewed by JKM Tested: local linux
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5tools_dump.c73
1 files changed, 61 insertions, 12 deletions
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 194e85e..20c1c8f 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -2119,14 +2119,38 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_str_reset(buffer);
h5tools_str_append(buffer, "%s ", STRPAD);
- if (str_pad == H5T_STR_NULLTERM)
- h5tools_str_append(buffer, "H5T_STR_NULLTERM;");
- else if (str_pad == H5T_STR_NULLPAD)
- h5tools_str_append(buffer, "H5T_STR_NULLPAD;");
- else if (str_pad == H5T_STR_SPACEPAD)
- h5tools_str_append(buffer, "H5T_STR_SPACEPAD;");
- else
- h5tools_str_append(buffer, "H5T_STR_ERROR;");
+ switch (str_pad) {
+ case H5T_STR_NULLTERM:
+ h5tools_str_append(buffer, "H5T_STR_NULLTERM;");
+ break;
+ case H5T_STR_NULLPAD:
+ h5tools_str_append(buffer, "H5T_STR_NULLPAD;");
+ break;
+ case H5T_STR_SPACEPAD:
+ h5tools_str_append(buffer, "H5T_STR_SPACEPAD;");
+ break;
+ case H5T_STR_RESERVED_3:
+ case H5T_STR_RESERVED_4:
+ case H5T_STR_RESERVED_5:
+ case H5T_STR_RESERVED_6:
+ case H5T_STR_RESERVED_7:
+ case H5T_STR_RESERVED_8:
+ case H5T_STR_RESERVED_9:
+ case H5T_STR_RESERVED_10:
+ case H5T_STR_RESERVED_11:
+ case H5T_STR_RESERVED_12:
+ case H5T_STR_RESERVED_13:
+ case H5T_STR_RESERVED_14:
+ case H5T_STR_RESERVED_15:
+ h5tools_str_append(buffer, "H5T_STR_UNKNOWN;");
+ break;
+ case H5T_STR_ERROR:
+ h5tools_str_append(buffer, "H5T_STR_ERROR;");
+ break;
+ default:
+ h5tools_str_append(buffer, "ERROR;");
+ break;
+ }
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0);
ctx->need_prefix = TRUE;
@@ -2136,10 +2160,35 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_str_append(buffer, "%s ", CSET);
- if (cset == H5T_CSET_ASCII)
- h5tools_str_append(buffer, "H5T_CSET_ASCII;");
- else
- h5tools_str_append(buffer, "unknown_cset;");
+ switch (cset) {
+ case H5T_CSET_ASCII:
+ h5tools_str_append(buffer, "H5T_CSET_ASCII;");
+ break;
+ case H5T_CSET_UTF8:
+ h5tools_str_append(buffer, "H5T_CSET_UTF8;");
+ break;
+ case H5T_CSET_RESERVED_2:
+ case H5T_CSET_RESERVED_3:
+ case H5T_CSET_RESERVED_4:
+ case H5T_CSET_RESERVED_5:
+ case H5T_CSET_RESERVED_6:
+ case H5T_CSET_RESERVED_7:
+ case H5T_CSET_RESERVED_8:
+ case H5T_CSET_RESERVED_9:
+ case H5T_CSET_RESERVED_10:
+ case H5T_CSET_RESERVED_11:
+ case H5T_CSET_RESERVED_12:
+ case H5T_CSET_RESERVED_13:
+ case H5T_CSET_RESERVED_14:
+ case H5T_CSET_RESERVED_15:
+ h5tools_str_append(buffer, "H5T_CSET_UNKNOWN;");
+ case H5T_CSET_ERROR:
+ h5tools_str_append(buffer, "H5T_CSET_ERROR;");
+ break;
+ default:
+ h5tools_str_append(buffer, "ERROR;");
+ break;
+ }
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0);
ctx->need_prefix = TRUE;