diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2009-09-17 20:31:44 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2009-09-17 20:31:44 (GMT) |
commit | d00707bf117f688c4be2f394425873dce68b71b5 (patch) | |
tree | 040e43e5eca536b77a35dee67c3aa6c1ac5549f4 /tools/lib/h5tools_str.c | |
parent | 5713f108ce4a9ec9ddf0d0446cdd083e1761d3a6 (diff) | |
download | hdf5-d00707bf117f688c4be2f394425873dce68b71b5.zip hdf5-d00707bf117f688c4be2f394425873dce68b71b5.tar.gz hdf5-d00707bf117f688c4be2f394425873dce68b71b5.tar.bz2 |
[svn-r17492] Moved printing of brackets before printing contents of region references.
Changed default Error handling init to successful as all error macros set the return to failure
Tested: local linux
Diffstat (limited to 'tools/lib/h5tools_str.c')
-rw-r--r-- | tools/lib/h5tools_str.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 1558df0..3567975 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -432,8 +432,6 @@ h5tools_str_dump_region_blocks(h5tools_str_t *str, hid_t region, if (nblocks > 0) { int i; - h5tools_str_append(str, "{"); - alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ ptdata = malloc((size_t) alloc_size); @@ -459,8 +457,6 @@ h5tools_str_dump_region_blocks(h5tools_str_t *str, hid_t region, } free(ptdata); - - h5tools_str_append(str, "}"); } /* end if (nblocks > 0) */ } @@ -497,8 +493,6 @@ h5tools_str_dump_region_points(h5tools_str_t *str, hid_t region, if (npoints > 0) { int i; - h5tools_str_append(str, "{"); - alloc_size = npoints * ndims * sizeof(ptdata[0]); assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ ptdata = malloc((size_t) alloc_size); @@ -519,8 +513,6 @@ h5tools_str_dump_region_points(h5tools_str_t *str, hid_t region, } free(ptdata); - - h5tools_str_append(str, "}"); } /* end if (npoints > 0) */ } @@ -1133,12 +1125,17 @@ h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, H5Rget_name(obj, H5R_DATASET_REGION, vp, (char*) ref_name, 1024); h5tools_str_append(str, info->dset_format, ref_name); + + h5tools_str_append(str, "{"); + region_type = H5Sget_select_type(region); if(region_type==H5S_SEL_POINTS) h5tools_str_dump_region_points(str, region, info, ctx); else h5tools_str_dump_region_blocks(str, region, info, ctx); + h5tools_str_append(str, "}"); + H5Sclose(region); } /* end if (region >= 0) */ H5Dclose(obj); |