diff options
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r-- | tools/h5dump/h5dump.c | 67 |
1 files changed, 32 insertions, 35 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 21913cd..601b3bd 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -70,7 +70,9 @@ static void dump_oid(hid_t oid); static void print_enum(hid_t type); static herr_t dump_all(hid_t group, const char *name, void *op_data); static char *lookup_ref_path(hobj_ref_t *); +#ifdef LATER static void check_compression(hid_t); +#endif /* LATER */ static struct ref_path_table_entry_t *ref_path_table_lookup(const char *); static int xml_name_to_XID(const char *, char *, int , int ); static int get_next_xid(void); @@ -1425,7 +1427,6 @@ dump_all(hid_t group, const char *name, void * op_data) dump_header_format->datasetblockend); } else { /* the XML version */ - int res; char *t_tmp; char *t_prefix; char *t_name; @@ -1437,8 +1438,8 @@ dump_all(hid_t group, const char *name, void * op_data) t_tmp = xml_escape_the_name(strcat(strcat(tx_tmp, "/"), name)); t_prefix = xml_escape_the_name(prefix); t_name = xml_escape_the_name(name); - res = xml_name_to_XID( strcat(strcat(tmp,"/"),name), dsetxid,100,1); - res = xml_name_to_XID( prefix ,parentxid,100,1); + xml_name_to_XID( strcat(strcat(tmp,"/"),name), dsetxid,100,1); + xml_name_to_XID( prefix ,parentxid,100,1); printf("<%sDataset Name=\"%s\" OBJ-XID=\"%s-%d\" " "H5Path=\"%s\" Parents=\"%s\" " @@ -1449,7 +1450,7 @@ dump_all(hid_t group, const char *name, void * op_data) (strcmp(prefix, "") ? t_prefix : "/")); indentation(indent + COL); - res = xml_name_to_XID(dset_table->objs[i].objname,pointerxid,100,1); + xml_name_to_XID(dset_table->objs[i].objname,pointerxid,100,1); printf("<%sDatasetPtr OBJ-XID=\"%s\" H5Path=\"%s\"/>\n", xmlnsprefix, pointerxid,t_tmp); @@ -3743,9 +3744,8 @@ xml_print_datatype(hid_t type, unsigned in_group) /* This should be defined somewhere else */ /* These 2 cases are handled the same right now, but probably will have something different eventually */ - int res; char * dtxid = malloc(100); - res = xml_name_to_XID(type_table->objs[i].objname,dtxid,100,1); + xml_name_to_XID(type_table->objs[i].objname,dtxid,100,1); if (!type_table->objs[i].recorded) { /* 'anonymous' NDT. Use it's object num. as it's name. */ @@ -4111,9 +4111,8 @@ xml_dump_datatype(hid_t type) if (i >= 0) { /* Shared data type, must be entered as an object */ /* These 2 cases are the same now, but may change */ - int res; char * dtxid = malloc(100); - res = xml_name_to_XID(type_table->objs[i].objname,dtxid,100,1); + xml_name_to_XID(type_table->objs[i].objname,dtxid,100,1); if (!type_table->objs[i].recorded) { /* anonymous stored data type: following the dumper's current @@ -4457,7 +4456,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, void UNUSED * op_data) static void xml_dump_named_datatype(hid_t type, const char *name) { - int res; char *tmp; char * dtxid; char * parentxid; @@ -4476,8 +4474,8 @@ xml_dump_named_datatype(hid_t type, const char *name) /*char **/t_tmp = xml_escape_the_name(tmp); /*char **/t_prefix = xml_escape_the_name(prefix); /*char **/t_name = xml_escape_the_name(name); - res = xml_name_to_XID(tmp,dtxid,100,1); - res = xml_name_to_XID(prefix,parentxid,100,1); + xml_name_to_XID(tmp,dtxid,100,1); + xml_name_to_XID(prefix,parentxid,100,1); if (strncmp(name, "#", 1) == 0) { /* Special: this is an 'anonymous' NDT, deleted but still in use. @@ -4583,20 +4581,19 @@ xml_dump_group(hid_t gid, const char *name) d_status = EXIT_FAILURE; } else if (group_table->objs[i].displayed) { /* already seen: enter a groupptr */ - int res; char *t_name = xml_escape_the_name(name); char *grpxid = malloc(100); char *parentxid = malloc(100); if (isRoot) { /* probably can't happen! */ - res = xml_name_to_XID("/",grpxid,100,1); + xml_name_to_XID("/",grpxid,100,1); printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", xmlnsprefix,grpxid,"/"); } else { t_objname = xml_escape_the_name(group_table->objs[i].objname); par_name = xml_escape_the_name(par); - res = xml_name_to_XID(tmp,grpxid,100,1); - res = xml_name_to_XID(par,parentxid,100,1); + xml_name_to_XID(tmp,grpxid,100,1); + xml_name_to_XID(par,parentxid,100,1); printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s-%d\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\">\n", xmlnsprefix,t_name, grpxid, get_next_xid(), @@ -4611,8 +4608,8 @@ xml_dump_group(hid_t gid, const char *name) ptrstr = malloc(100); t_objname = xml_escape_the_name(group_table->objs[i].objname); par_name = xml_escape_the_name(par); - res = xml_name_to_XID(par,parentxid,100,1); - res = xml_name_to_XID(group_table->objs[i].objname,ptrstr,100,1); + xml_name_to_XID(par,parentxid,100,1); + xml_name_to_XID(group_table->objs[i].objname,ptrstr,100,1); printf("<%sGroupPtr OBJ-XID=\"%s\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" />\n", xmlnsprefix, @@ -4623,19 +4620,18 @@ xml_dump_group(hid_t gid, const char *name) } else { /* first time this group has been seen -- describe it */ - int res; char *t_name = xml_escape_the_name(name); char *grpxid = malloc(100); char *parentxid = malloc(100); if (isRoot) { - res = xml_name_to_XID("/",grpxid,100,1); + xml_name_to_XID("/",grpxid,100,1); printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", xmlnsprefix,grpxid,"/"); } else { char *t_tmp = xml_escape_the_name(tmp); par_name = xml_escape_the_name(par); - res = xml_name_to_XID(tmp,grpxid,100,1); - res = xml_name_to_XID(par,parentxid,100,1); + xml_name_to_XID(tmp,grpxid,100,1); + xml_name_to_XID(par,parentxid,100,1); printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" >\n", xmlnsprefix,t_name, grpxid, t_tmp, parentxid, par_name); @@ -4682,19 +4678,18 @@ xml_dump_group(hid_t gid, const char *name) } else { /* only link -- must be first time! */ - int res; char *t_name = xml_escape_the_name(name); char *grpxid = malloc(100); char *parentxid = malloc(100); if (isRoot) { - res = xml_name_to_XID("/",grpxid,100,1); + xml_name_to_XID("/",grpxid,100,1); printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", xmlnsprefix,grpxid,"/"); } else { char *t_tmp = xml_escape_the_name(tmp); par_name = xml_escape_the_name(par); - res = xml_name_to_XID(tmp,grpxid,100,1); - res = xml_name_to_XID(par,parentxid,100,1); + xml_name_to_XID(tmp,grpxid,100,1); + xml_name_to_XID(par,parentxid,100,1); printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" >\n", xmlnsprefix,t_name, grpxid, t_tmp, @@ -4864,7 +4859,7 @@ xml_print_strs(hid_t did, int source) char *bp; char *onestring=NULL; hsize_t ssiz; - size_t tsiz, str_size; + size_t tsiz, str_size=0; size_t i; htri_t is_vlstr; @@ -4967,6 +4962,7 @@ xml_print_strs(hid_t did, int source) * *------------------------------------------------------------------------- */ +#ifdef LATER static void check_compression(hid_t dcpl) { @@ -4997,6 +4993,8 @@ check_compression(hid_t dcpl) } } } +#endif /* LATER */ + /*------------------------------------------------------------------------- * Function: check_filters * @@ -5095,8 +5093,8 @@ check_filters(hid_t dcpl) static void xml_dump_fill_value(hid_t dcpl, hid_t type) { -int sz; -int i; +size_t sz; +size_t i; hsize_t space; void * buf; char * path; @@ -5160,6 +5158,7 @@ char * name; printf("\""); for (i = 0; i < sz; i++) { printf("%x ",*(unsigned int *)buf); + buf = (char *)buf + sizeof(unsigned int); } printf("\"\n"); indentation(indent); @@ -5230,7 +5229,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) { hid_t type, space; hid_t dcpl; - herr_t err; H5D_fill_value_t fvstatus; int maxdims; hsize_t *chsize; @@ -5238,7 +5236,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) int i; H5D_alloc_time_t at; H5D_fill_time_t ft; - int res; hsize_t tempi; char *tmp; char *t_name, *t_tmp, *t_prefix; @@ -5255,8 +5252,8 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) t_tmp = xml_escape_the_name(tmp); t_prefix = xml_escape_the_name(prefix); - res = xml_name_to_XID(tmp, rstr, 100, 1); - res = xml_name_to_XID(prefix, pstr, 100, 1); + xml_name_to_XID(tmp, rstr, 100, 1); + xml_name_to_XID(prefix, pstr, 100, 1); printf("<%sDataset Name=\"%s\" OBJ-XID=\"%s\" H5Path= \"%s\" Parents=\"%s\" H5ParentPaths=\"%s\">\n",xmlnsprefix, t_name, rstr, t_tmp, pstr, strcmp(prefix, "") ? t_prefix : "/"); @@ -5341,7 +5338,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) indent += COL; indentation(indent); printf("<%sFillValueInfo ",xmlnsprefix); - err = H5Pget_fill_time(dcpl, &ft); + H5Pget_fill_time(dcpl, &ft); printf("FillTime=\""); switch ( ft ) { case H5D_FILL_TIME_ALLOC: @@ -5358,7 +5355,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) break; } printf("\" "); - err = H5Pget_alloc_time(dcpl, &at); + H5Pget_alloc_time(dcpl, &at); printf("AllocationTime=\""); switch ( at ) { case H5D_ALLOC_TIME_EARLY: @@ -5382,7 +5379,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) indentation(indent); printf("<%sFillValue>\n",xmlnsprefix); indent += COL; - err = H5Pfill_value_defined(dcpl, &fvstatus); + H5Pfill_value_defined(dcpl, &fvstatus); if (fvstatus == H5D_FILL_VALUE_UNDEFINED) { indentation(indent + COL); printf("<%sNoFill/>\n",xmlnsprefix); |