summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/h5dump_ddl.c13
-rw-r--r--tools/h5dump/h5dump_ddl.h4
-rw-r--r--tools/h5dump/h5dump_defines.h30
-rw-r--r--tools/h5dump/h5dump_xml.c14
4 files changed, 34 insertions, 27 deletions
diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c
index 0cd0847..fd50710 100644
--- a/tools/h5dump/h5dump_ddl.c
+++ b/tools/h5dump/h5dump_ddl.c
@@ -1518,10 +1518,10 @@ handle_paths(hid_t fid, const char *path_name, void H5_ATTR_UNUSED * data, int H
void
handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H5_ATTR_UNUSED pe, const char H5_ATTR_UNUSED *display_name)
{
- hid_t oid = -1;
- hid_t attr_id = -1;
- char *obj_name;
- char *attr_name;
+ hid_t oid = -1;
+ hid_t attr_id = -1;
+ char *obj_name = NULL;
+ char *attr_name = NULL;
int j;
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
@@ -1898,8 +1898,9 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_AT
begin_obj(h5tools_dump_header_format->softlinkbegin, links, h5tools_dump_header_format->softlinkblockbegin);
PRINTVALSTREAM(rawoutstream, "\n");
indentation(COL);
- if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0)
+ if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) {
PRINTSTREAM(rawoutstream, "LINKTARGET \"%s\"\n", buf);
+ }
else {
error_msg("h5dump error: unable to get link value for \"%s\"\n", links);
h5tools_setstatus(EXIT_FAILURE);
@@ -1941,7 +1942,7 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_AT
case H5L_TYPE_MAX:
HDassert(0);
/* fall through */
- H5L_TYPE_HARD:
+ case H5L_TYPE_HARD:
default:
begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin);
PRINTVALSTREAM(rawoutstream, "\n");
diff --git a/tools/h5dump/h5dump_ddl.h b/tools/h5dump/h5dump_ddl.h
index 6cd9181..2b3f61e 100644
--- a/tools/h5dump/h5dump_ddl.h
+++ b/tools/h5dump/h5dump_ddl.h
@@ -34,6 +34,10 @@ void dump_fcontents(hid_t fid);
/* callback function used by H5Aiterate2() */
herr_t dump_attr_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, void *_op_data);
+/* other iteration functions */
+void link_iteration(hid_t gid, unsigned crt_order_flags);
+void attr_iteration(hid_t gid, unsigned attr_crt_order_flags);
+
void handle_paths(hid_t fid, const char *path_name, void *data, int pe, const char *display_name);
void handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *display_name);
void handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H5_ATTR_UNUSED pe, const char H5_ATTR_UNUSED *display_name);
diff --git a/tools/h5dump/h5dump_defines.h b/tools/h5dump/h5dump_defines.h
index 5f2df43..2be2dcc 100644
--- a/tools/h5dump/h5dump_defines.h
+++ b/tools/h5dump/h5dump_defines.h
@@ -23,23 +23,25 @@
#define COL 3
/* Macros for displaying objects */
-#define begin_obj(obj,name,begin) \
- do { \
- if ((name)) \
+#define begin_obj(obj,name,begin) \
+ do { \
+ if ((name)) { \
PRINTSTREAM(rawoutstream, "%s \"%s\" %s", (obj), (name), (begin)); \
- else \
- PRINTSTREAM(rawoutstream, "%s %s", (obj), (begin)); \
+ } \
+ else { \
+ PRINTSTREAM(rawoutstream, "%s %s", (obj), (begin)); \
+ } \
} while(0);
-#define end_obj(obj,end) \
- do { \
- if(HDstrlen(end)) { \
- PRINTSTREAM(rawoutstream, "%s", end); \
- if(HDstrlen(obj)) \
- PRINTVALSTREAM(rawoutstream, " "); \
- } \
- if(HDstrlen(obj)) \
- PRINTSTREAM(rawoutstream, "%s", obj); \
+#define end_obj(obj,end) \
+ do { \
+ if(HDstrlen(end)) { \
+ PRINTSTREAM(rawoutstream, "%s", end); \
+ if(HDstrlen(obj)) \
+ PRINTVALSTREAM(rawoutstream, " "); \
+ } \
+ if(HDstrlen(obj)) \
+ PRINTSTREAM(rawoutstream, "%s", obj); \
} while(0);
diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c
index e872114..5bc43eb 100644
--- a/tools/h5dump/h5dump_xml.c
+++ b/tools/h5dump/h5dump_xml.c
@@ -2968,9 +2968,9 @@ static int
xml_print_refs(hid_t did, int source)
{
herr_t e;
- hid_t type;
- hid_t space;
- hssize_t ssiz;
+ hid_t type = -1;
+ hid_t space = -1;
+ hssize_t ssiz = -1;
hsize_t i;
size_t tsiz;
hobj_ref_t *refbuf = NULL;
@@ -3125,11 +3125,11 @@ static int
xml_print_strs(hid_t did, int source)
{
herr_t e;
- hid_t type;
- hid_t space;
- hssize_t ssiz;
+ hid_t type = -1;
+ hid_t space = -1;
+ hssize_t ssiz = -1;
htri_t is_vlstr = FALSE;
- size_t tsiz;
+ size_t tsiz = 0;
size_t i;
size_t str_size = 0;
char *bp = NULL;