summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-03-09 08:47:16 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-03-09 08:47:16 (GMT)
commitce19753d87babcd578fbc9fb7b9329722e3a604c (patch)
treebefd99d086b9ad13476ba30ffd805d8f9b084bb3 /tools/lib
parent5b294640c003dac45c2cc489793950207bf63c8f (diff)
parent2a4ea9b24e5d28598b627fca39fb42a9baedfaa3 (diff)
downloadhdf5-ce19753d87babcd578fbc9fb7b9329722e3a604c.zip
hdf5-ce19753d87babcd578fbc9fb7b9329722e3a604c.tar.gz
hdf5-ce19753d87babcd578fbc9fb7b9329722e3a604c.tar.bz2
[svn-r26396] Merge of r26349-26392 from the trunk.
Tested on: h5committest
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5trav.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index d0a4a76..90e6d3d 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -50,6 +50,10 @@ typedef struct {
hid_t fid; /* File ID being traversed */
} trav_print_udata_t;
+typedef struct trav_path_op_data_t {
+ const char *path;
+} trav_path_op_data_t;
+
/* format for hsize_t */
#ifdef H5TRAV_PRINT_SPACE
#define HSIZE_T_FORMAT "%" H5_PRINTF_LL_WIDTH "u"
@@ -899,11 +903,11 @@ trav_attr(hid_t
#ifndef H5TRAV_PRINT_SPACE
UNUSED
#endif /* H5TRAV_PRINT_SPACE */
-obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *op_data)
+obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *_op_data)
{
- char *buf;
+ trav_path_op_data_t *op_data = (trav_path_op_data_t *)_op_data;
+ const char *buf = op_data->path;
- buf = (char*)op_data;
if((strlen(buf)==1) && (*buf=='/'))
printf(" %-10s %s%s", "attribute", buf, attr_name);
else
@@ -1009,10 +1013,14 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo,
/* Check if we've already seen this object */
if(NULL == already_visited) {
+ trav_path_op_data_t op_data;
+
+ op_data.path = path;
/* Finish printing line about object */
printf("\n");
if(trav_verbosity > 0)
- H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, (void *)path, H5P_DEFAULT);
+ H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order,
+ NULL, trav_attr, &op_data, H5P_DEFAULT);
}
else
/* Print the link's original name */