diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2014-11-18 17:57:48 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2014-11-18 17:57:48 (GMT) |
commit | 4ddc3c769e595ded8b70cc843a79e5ab37ba60e7 (patch) | |
tree | 4d686637dd3e18b4be0e9b5ea45c993569f3b878 /tools/lib | |
parent | 5cf77a2a7bfd44127db4c3b5d2b760666b2887a1 (diff) | |
download | hdf5-4ddc3c769e595ded8b70cc843a79e5ab37ba60e7.zip hdf5-4ddc3c769e595ded8b70cc843a79e5ab37ba60e7.tar.gz hdf5-4ddc3c769e595ded8b70cc843a79e5ab37ba60e7.tar.bz2 |
[svn-r25823] Bring revisions #25484 - 25508 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5tools_dump.c | 49 | ||||
-rw-r--r-- | tools/lib/h5tools_dump.h | 2 | ||||
-rw-r--r-- | tools/lib/h5tools_filters.c | 3 |
3 files changed, 28 insertions, 26 deletions
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index ea65b59..b5c4251 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -1748,11 +1748,11 @@ CATCH */ int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, - hid_t dset, hid_t _p_type, struct subset_t *sset) + hid_t dset, struct subset_t *sset) { - hid_t f_space; - hid_t p_type = _p_type; - hid_t f_type; + hid_t f_space = -1; + hid_t p_type = -1; + hid_t f_type = -1; H5S_class_t space_type; int status = FAIL; h5tool_format_t info_dflt; @@ -1765,26 +1765,26 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t * info = &info_dflt; } - if (p_type < 0) { - f_type = H5Dget_type(dset); - - if (info->raw || bin_form == 1) - p_type = H5Tcopy(f_type); - else if (bin_form == 2) - p_type = h5tools_get_little_endian_type(f_type); - else if (bin_form == 3) - p_type = h5tools_get_big_endian_type(f_type); - else - p_type = h5tools_get_native_type(f_type); + f_type = H5Dget_type(dset); + if (f_type < 0) + goto done; - H5Tclose(f_type); + if (info->raw || bin_form == 1) + p_type = H5Tcopy(f_type); + else if (bin_form == 2) + p_type = h5tools_get_little_endian_type(f_type); + else if (bin_form == 3) + p_type = h5tools_get_big_endian_type(f_type); + else + p_type = h5tools_get_native_type(f_type); - if (p_type < 0) - goto done; - } + if (p_type < 0) + goto done; /* Check the data space */ f_space = H5Dget_space(dset); + if (f_space < 0) + goto done; space_type = H5Sget_simple_extent_type(f_space); @@ -1799,12 +1799,13 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t * /* space is H5S_NULL */ status = SUCCEED; - /* Close the dataspace */ - H5Sclose(f_space); - done: - if (p_type != _p_type) + if (f_type > 0) + H5Tclose(f_type); + if (p_type > 0) H5Tclose(p_type); + if (f_space > 0) + H5Sclose(f_space); return status; } @@ -3859,7 +3860,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, } else datactx.need_prefix = TRUE; - status = h5tools_dump_dset(stream, info, &datactx, obj_id, -1, sset); + status = h5tools_dump_dset(stream, info, &datactx, obj_id, sset); if((display_char && H5Tget_size(f_type) == 1) && (H5Tget_class(f_type) == H5T_INTEGER)) { h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\""); diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h index 061a3db..b05f226 100644 --- a/tools/lib/h5tools_dump.h +++ b/tools/lib/h5tools_dump.h @@ -40,7 +40,7 @@ H5TOOLS_DLL void h5tools_dump_init(void); H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t dset, - hid_t p_typ, struct subset_t *sset); + struct subset_t *sset); H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t obj_id, hid_t type, hid_t space, void *mem); diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 3664a29..79cf253 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -20,7 +20,8 @@ * print a warning message *------------------------------------------------------------------------- */ -static void print_warning(const char *dname, const char *fname) { +static void print_warning(const char *dname, const char *fname) +{ fprintf(stderr, "warning: dataset <%s> cannot be read, %s filter is not available\n", dname, fname); |