summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2014-07-30 20:56:40 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2014-07-30 20:56:40 (GMT)
commite8c162613b75fb3b269830defa769728f439db72 (patch)
tree7c02108c8d1012fb7e8a2b54c5503a5c2f5c019c /tools/lib
parentff1a9ae0e74ded0274729313ba24df578ffaf678 (diff)
downloadhdf5-e8c162613b75fb3b269830defa769728f439db72.zip
hdf5-e8c162613b75fb3b269830defa769728f439db72.tar.gz
hdf5-e8c162613b75fb3b269830defa769728f439db72.tar.bz2
[svn-r25497] Description:
Merge changes that correspond to the 64-bit ID changes (without the actual switch to 64-bit IDs) to the 1.8 release branch. (Plus a few minor cleanups and alignments with the trunk that aren't on the branch) Tested on: Mac OSX/64 10.9.4 (amazon) w/C++ & FORTRAN (h5committested on branch already for a week)
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5tools.c24
-rw-r--r--tools/lib/h5tools_dump.c49
-rw-r--r--tools/lib/h5tools_dump.h2
-rw-r--r--tools/lib/h5tools_str.c4
4 files changed, 40 insertions, 39 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index fb12408..a7b0e5e 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -844,18 +844,18 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info,
the prefix is printed one indentation level before */
if (info->pindex) {
for (i = 0; i < indentlevel - 1; i++) {
- PUTSTREAM(h5tools_str_fmt(&str, 0, info->line_indent), stream);
+ PUTSTREAM(h5tools_str_fmt(&str, (size_t)0, info->line_indent), stream);
}
}
if (elmtno == 0 && secnum == 0 && info->line_1st) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_1st), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_1st), stream);
}
else if (secnum && info->line_cont) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_cont), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_cont), stream);
}
else {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_pre), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_pre), stream);
}
templength = h5tools_str_len(&prefix);
@@ -863,7 +863,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info,
for (i = 0; i < indentlevel; i++) {
/*we already made the indent for the array indices case */
if (!info->pindex) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_indent), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_indent), stream);
templength += h5tools_str_len(&prefix);
}
else {
@@ -937,22 +937,22 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info,
the prefix is printed one indentation level before */
if (info->pindex)
for (i = 0; i < indentlevel - 1; i++) {
- PUTSTREAM(h5tools_str_fmt(&str, 0, info->line_indent), stream);
+ PUTSTREAM(h5tools_str_fmt(&str, (size_t)0, info->line_indent), stream);
}
if (elmtno == 0 && secnum == 0 && info->line_1st) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_1st), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_1st), stream);
} else if (secnum && info->line_cont) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_cont), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_cont), stream);
} else
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_pre), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_pre), stream);
templength = h5tools_str_len(&prefix);
for (i = 0; i < indentlevel; i++) {
/*we already made the indent for the array indices case */
if (!info->pindex) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_indent), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_indent), stream);
templength += h5tools_str_len(&prefix);
}
else {
@@ -1009,7 +1009,7 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info,
if (stream == NULL)
return dimension_break;
- s = h5tools_str_fmt(buffer, 0, "%s");
+ s = h5tools_str_fmt(buffer, (size_t)0, "%s");
/*
* If the element would split on multiple lines if printed at our
@@ -1163,7 +1163,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info,
int secnum; /*section sequence number */
int multiline; /*datum was multiline */
- s = h5tools_str_fmt(buffer, 0, "%s");
+ s = h5tools_str_fmt(buffer, (size_t)0, "%s");
/*
* If the element would split on multiple lines if printed at our
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index f11065c..5ab066e 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_str.c b/tools/lib/h5tools_str.c
index d43fc33..ac191d6 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -352,7 +352,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info,
}
/* Add prefix and suffix to the index */
- return h5tools_str_fmt(str, 0, OPT(info->idx_fmt, "%s: "));
+ return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: "));
}
/*-------------------------------------------------------------------------
@@ -412,7 +412,7 @@ h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info,
}
/* Add prefix and suffix to the index */
- return h5tools_str_fmt(str, 0, OPT(info->idx_fmt, "%s: "));
+ return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: "));
}
/*-------------------------------------------------------------------------