diff options
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5diff.c | 4 | ||||
-rw-r--r-- | tools/lib/h5tools.c | 16 | ||||
-rw-r--r-- | tools/lib/h5tools.h | 4 | ||||
-rw-r--r-- | tools/lib/h5tools_dump.c | 8 |
4 files changed, 18 insertions, 14 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index badaf3c..46dcf6f 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -594,8 +594,8 @@ hsize_t h5diff(const char *fname1, trav_info_t *info1_grp = NULL; trav_info_t *info2_grp = NULL; /* local pointer */ - trav_info_t *info1_lp; - trav_info_t *info2_lp; + trav_info_t *info1_lp = NULL; + trav_info_t *info2_lp = NULL; /* link info from specified object */ H5L_info_t src_linfo1; H5L_info_t src_linfo2; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 274b398..19d71bb 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1641,8 +1641,8 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, hsize_t alloc_size; hsize_t *ptdata; int ndims; - hid_t dtype; - hid_t type_id; + hid_t dtype = -1; + hid_t type_id = -1; if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed"); @@ -1672,10 +1672,10 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, done: HDfree(ptdata); - if(H5Tclose(type_id) < 0) + if(type_id > 0 && H5Tclose(type_id) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - if(H5Tclose(dtype) < 0) + if(dtype > 0 && H5Tclose(dtype) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); H5_LEAVE(TRUE) @@ -1765,8 +1765,8 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, HERR_INIT(hbool_t, TRUE) hssize_t npoints; int ndims; - hid_t dtype; - hid_t type_id; + hid_t dtype = -1; + hid_t type_id = -1; if((npoints = H5Sget_select_elem_npoints(region_space)) <= 0) H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed"); @@ -1785,10 +1785,10 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, stream, container, ndims, type_id, npoints); done: - if(H5Tclose(type_id) < 0) + if(type_id > 0 && H5Tclose(type_id) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - if(H5Tclose(dtype) < 0) + if(dtype > 0 && H5Tclose(dtype) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); H5_LEAVE(ret_value) diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index d6c3720..49f2dc9 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -574,8 +574,12 @@ H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_form h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum); H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t nelmts); +H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, + hid_t container, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); H5TOOLS_DLL hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream, hid_t container); +H5TOOLS_DLL int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, + FILE* stream, hid_t container, int ndims, hid_t type_id, hssize_t npoints); H5TOOLS_DLL hbool_t render_bin_output_region_points(hid_t region_space, hid_t region_id, FILE *stream, hid_t container); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 6388273..a007882 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -926,8 +926,8 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, hsize_t *ptdata; int ndims; hssize_t indx; - hid_t dtype; - hid_t type_id; + hid_t dtype = -1; + hid_t type_id = -1; HDassert(info); HDassert(ctx); @@ -1048,10 +1048,10 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, done: HDfree(ptdata); - if(H5Tclose(type_id) < 0) + if(type_id > 0 && H5Tclose(type_id) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - if(H5Tclose(dtype) < 0) + if(dtype > 0 && H5Tclose(dtype) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); ctx->need_prefix = TRUE; |