summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_dump.c
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2019-12-28 08:16:44 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2019-12-31 00:02:06 (GMT)
commit1795aa660afe47adb28436b24eac64fa77f183fd (patch)
tree17cad54bdc89f8f095b72e0ff73ce9168215c0ee /tools/lib/h5tools_dump.c
parent2cbf31cb3ad8032fb1915c783dc52a2050aaf7da (diff)
downloadhdf5-1795aa660afe47adb28436b24eac64fa77f183fd.zip
hdf5-1795aa660afe47adb28436b24eac64fa77f183fd.tar.gz
hdf5-1795aa660afe47adb28436b24eac64fa77f183fd.tar.bz2
Clean up tools warnings introduced by H5TOOLS_ERR_INIT macro
Diffstat (limited to 'tools/lib/h5tools_dump.c')
-rw-r--r--tools/lib/h5tools_dump.c315
1 files changed, 146 insertions, 169 deletions
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index ada7ae8..b177a31 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -257,7 +257,6 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
h5tools_context_t *ctx, /* in,out */
unsigned flags, hsize_t nelmts, hid_t type, void *_mem)
{
- H5TOOLS_ERR_INIT(int, SUCCEED)
unsigned char *mem = (unsigned char*) _mem;
hsize_t i; /* element counter */
size_t size; /* size of each datum */
@@ -272,8 +271,8 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
* this var to count elements and
* break after we see a number equal
* to the ctx->size_last_dim. */
+ int ret_value = 0;
- H5TOOLS_PUSH_STACK();
H5TOOLS_DEBUG("enter file=%p", (void*)stream);
H5TOOLS_DEBUG("rawdata file=%p", (void*)rawdatastream);
/* binary dump */
@@ -321,7 +320,6 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
}/* else bin */
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -357,19 +355,18 @@ h5tools_dump_region_attribute(hid_t region_id,
size_t ncols, hsize_t region_elmt_counter, /* element counter */
hsize_t elmt_counter)
{
- H5TOOLS_ERR_INIT(hbool_t, TRUE)
- hbool_t dimension_break = TRUE;
- hid_t atype = H5I_INVALID_HID;
- hid_t type_id = H5I_INVALID_HID;
- hid_t region_space = H5I_INVALID_HID;
- h5tool_format_t outputformat; /* Use to disable prefix for DATA attribute display */
+ hbool_t dimension_break = TRUE;
+ hid_t atype = H5I_INVALID_HID;
+ hid_t type_id = H5I_INVALID_HID;
+ hid_t region_space = H5I_INVALID_HID;
+ h5tool_format_t outputformat; /* Use to disable prefix for DATA attribute display */
+ hbool_t past_catch = FALSE;
+ hbool_t ret_value = TRUE;
HDassert(info);
HDassert(ctx);
HDassert(buffer);
- H5TOOLS_PUSH_STACK();
-
outputformat = *info;
outputformat.idx_fmt = "";
outputformat.idx_n_fmt = "";
@@ -464,7 +461,6 @@ done:
CATCH
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -493,7 +489,6 @@ h5tools_print_region_data_blocks(hid_t region_id,
h5tools_str_t *buffer, /* string into which to render */
size_t ncols, unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata)
{
- H5TOOLS_ERR_INIT(int, SUCCEED)
hbool_t dimension_break = TRUE;
hsize_t *dims1 = NULL;
hsize_t *start = NULL;
@@ -507,11 +502,13 @@ h5tools_print_region_data_blocks(hid_t region_id,
hsize_t numindex;
unsigned indx;
unsigned jndx;
+ hbool_t past_catch = FALSE;
size_t type_size;
hid_t mem_space = -1;
hid_t sid1 = -1;
h5tools_context_t ctx;
void *region_buf = NULL;
+ int ret_value = 0;
HDassert(info);
HDassert(cur_ctx);
@@ -520,11 +517,10 @@ h5tools_print_region_data_blocks(hid_t region_id,
HDmemset(&ctx, 0, sizeof(ctx));
- H5TOOLS_PUSH_STACK();
H5TOOLS_DEBUG("enter");
if((type_size = H5Tget_size(type_id)) == 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
+ H5TOOLS_THROW(FAIL, "H5Tget_size failed");
/* Get the dataspace of the dataset */
if((sid1 = H5Dget_space(region_id)) < 0)
@@ -614,17 +610,16 @@ h5tools_print_region_data_blocks(hid_t region_id,
} /* end for (numindex = 0; numindex < numelem; numindex++, elmtno++, ctx.cur_elmt++) */
}
else {
- ctx.indent_level--;
- H5TOOLS_GOTO_ERROR(FAIL, "H5Sget_simple_extent_dims failed");
+ H5TOOLS_ERROR(FAIL, "H5Sget_simple_extent_dims failed");
}
ctx.indent_level--;
}
else {
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dread failed");
+ H5TOOLS_ERROR(FAIL, "H5Dread failed");
}
}
else {
- H5TOOLS_GOTO_ERROR(FAIL, "H5Sselect_hyperslab failed");
+ H5TOOLS_ERROR(FAIL, "H5Sselect_hyperslab failed");
}
} /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */
@@ -641,7 +636,6 @@ done:
H5TOOLS_ERROR(FAIL, "H5Sclose failed");
CATCH
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -678,7 +672,6 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
size_t ncols, hsize_t region_elmt_counter, /* element counter */
hsize_t elmt_counter)
{
- H5TOOLS_ERR_INIT(hbool_t, TRUE)
hbool_t dimension_break = TRUE;
hssize_t snblocks;
hsize_t nblocks;
@@ -690,13 +683,13 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
hid_t dtype = H5I_INVALID_HID;
hid_t type_id = H5I_INVALID_HID;
h5tool_format_t outputformat; /* Use to disable prefix for DATA attribute display */
+ hbool_t past_catch = FALSE;
+ hbool_t ret_value = TRUE;
HDassert(info);
HDassert(ctx);
HDassert(buffer);
- H5TOOLS_PUSH_STACK();
-
outputformat = *info;
outputformat.idx_fmt = "";
outputformat.idx_n_fmt = "";
@@ -704,12 +697,12 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
outputformat.line_pre = "";
if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0)
- H5TOOLS_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed");
+ H5TOOLS_THROW(dimension_break, "H5Sget_select_hyper_nblocks failed");
nblocks = (hsize_t)snblocks;
/* Print block information */
if((sndims = H5Sget_simple_extent_ndims(region_space)) < 0)
- H5TOOLS_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
+ H5TOOLS_THROW(dimension_break, "H5Sget_simple_extent_ndims failed");
ndims = (unsigned)sndims;
H5TOOLS_DEBUG("enter ndims=%d", ndims);
@@ -861,7 +854,6 @@ done:
CATCH
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -890,7 +882,6 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
h5tools_str_t *buffer, size_t ncols,
unsigned ndims, hid_t type_id, hsize_t npoints, hsize_t *ptdata)
{
- H5TOOLS_ERR_INIT(int, SUCCEED)
hbool_t dimension_break = TRUE;
hsize_t *dims1 = NULL;
hsize_t elmtno; /* elemnt index */
@@ -903,6 +894,8 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
hid_t mem_space = H5I_INVALID_HID;
void *region_buf = NULL;
h5tools_context_t ctx;
+ hbool_t past_catch = FALSE;
+ int ret_value = 0;
HDassert(info);
HDassert(cur_ctx);
@@ -910,25 +903,24 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
HDassert(ptdata);
HDassert(ndims > 0);
- H5TOOLS_PUSH_STACK();
H5TOOLS_DEBUG("enter");
HDmemset(&ctx, 0, sizeof(ctx));
/* Allocate space for the dimension array */
if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims");
+ H5TOOLS_THROW((-1), "Could not allocate buffer for dims");
dims1[0] = npoints;
/* Create dataspace for reading buffer */
if((mem_space = H5Screate_simple(1, dims1, NULL)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed");
+ H5TOOLS_THROW((-1), "H5Screate_simple failed");
if((type_size = H5Tget_size(type_id)) == 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
+ H5TOOLS_THROW((-1), "H5Tget_size failed");
if((region_buf = HDmalloc(type_size * (size_t)npoints)) == NULL)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for region");
+ H5TOOLS_THROW((-1), "Could not allocate buffer for region");
curr_pos = 0;
ctx.indent_level = cur_ctx->indent_level;
@@ -937,7 +929,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
ctx.ndims = ndims;
if(H5Dread(region_id, type_id, mem_space, region_space, H5P_DEFAULT, region_buf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dread failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dread failed");
H5TOOLS_DEBUG("data render start:%ld", npoints);
elmtno = 0;
@@ -986,8 +978,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
elmtno = 0;
}
else {
- ctx.indent_level--;
- H5TOOLS_GOTO_ERROR(FAIL, "H5Sget_simple_extent_dims failed");
+ H5TOOLS_ERROR((-1), "H5Sget_simple_extent_dims failed");
}
ctx.indent_level--;
} /* end for (jndx = 0; jndx < npoints; jndx++, elmtno++) */
@@ -998,10 +989,9 @@ CATCH
HDfree(dims1);
if(H5Sclose(mem_space) < 0)
- H5TOOLS_ERROR(FAIL, "H5Sclose failed");
+ H5TOOLS_ERROR((-1), "H5Sclose failed");
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1035,7 +1025,6 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t region_elmt_counter,
hsize_t elmt_counter)
{
- H5TOOLS_ERR_INIT(hbool_t, TRUE)
hbool_t dimension_break = TRUE;
hssize_t snpoints;
hsize_t npoints;
@@ -1047,13 +1036,13 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
hid_t dtype = H5I_INVALID_HID;
hid_t type_id = H5I_INVALID_HID;
h5tool_format_t outputformat; /* Use to disable prefix for DATA attribute display */
+ hbool_t past_catch = FALSE;
+ hbool_t ret_value = TRUE;
HDassert(info);
HDassert(ctx);
HDassert(buffer);
- H5TOOLS_PUSH_STACK();
-
outputformat = *info;
outputformat.idx_fmt = "";
outputformat.idx_n_fmt = "";
@@ -1061,12 +1050,12 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
outputformat.line_pre = "";
if((snpoints = H5Sget_select_elem_npoints(region_space)) <= 0)
- H5TOOLS_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed");
+ H5TOOLS_THROW(dimension_break, "H5Sget_select_elem_npoints failed");
npoints = (hsize_t)snpoints;
/* Allocate space for the dimension array */
if((sndims = H5Sget_simple_extent_ndims(region_space)) < 0)
- H5TOOLS_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
+ H5TOOLS_THROW(dimension_break, "H5Sget_simple_extent_ndims failed");
ndims = (unsigned)sndims;
H5TOOLS_DEBUG("enter ndims=%d", ndims);
@@ -1214,7 +1203,6 @@ done:
CATCH
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1262,7 +1250,6 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
hsize_t *total_size, /* total size of dataset */
unsigned int row_dim) /* index of row_counter dimension */
{
- H5TOOLS_ERR_INIT(herr_t, SUCCEED)
size_t i; /* counters */
size_t j; /* counters */
hsize_t zero[1] = {0}; /* vector of zeros */
@@ -1279,13 +1266,13 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
hid_t sm_space = H5I_INVALID_HID; /* stripmine data space */
hsize_t size_row_block; /* size for blocks along rows */
hsize_t row_counter = 0;
-
+ hbool_t past_catch = FALSE;
/* VL data special information */
- unsigned int vl_data = 0; /* contains VL datatypes */
+ unsigned int vl_data = 0; /* contains VL datatypes */
+ herr_t ret_value = SUCCEED;
- H5TOOLS_PUSH_STACK();
if ((size_t) ctx->ndims > NELMTS(sm_size))
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "ndims and sm_size comparision failed");
+ H5TOOLS_THROW(FAIL, "ndims and sm_size comparision failed");
if (ctx->ndims > 0)
init_acc_pos(ctx, total_size);
@@ -1313,10 +1300,10 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
/* calculate the potential number of elements we're going to print */
if(H5Sselect_hyperslab(f_space, H5S_SELECT_SET, temp_start, temp_stride, temp_count, temp_block) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
+ H5TOOLS_THROW(FAIL, "H5Sselect_hyperslab failed");
if((ssm_nelmts = H5Sget_select_npoints(f_space)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_select_npoints failed");
+ H5TOOLS_THROW(FAIL, "H5Sget_select_npoints failed");
sm_nelmts = (hsize_t)ssm_nelmts;
if (sm_nelmts > 0) {
@@ -1325,7 +1312,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
* a hyperslab whose size is manageable.
*/
if((sm_nbytes = p_type_nbytes = H5Tget_size(p_type)) == 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
+ H5TOOLS_THROW(FAIL, "H5Tget_size failed");
if (ctx->ndims > 0)
for (i = ctx->ndims; i > 0; --i) {
@@ -1339,17 +1326,17 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
HDassert(sm_nbytes == (hsize_t) ((size_t) sm_nbytes)); /*check for overflow*/
if(NULL == (sm_buf = (unsigned char *)HDmalloc((size_t) sm_nelmts * p_type_nbytes)))
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for strip-mine");
+ H5TOOLS_THROW(FAIL, "Could not allocate buffer for strip-mine");
if((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed");
+ H5TOOLS_THROW(FAIL, "H5Screate_simple failed");
if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &sm_nelmts, NULL) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
+ H5TOOLS_THROW(FAIL, "H5Sselect_hyperslab failed");
/* read the data */
if(H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Dread failed");
+ H5TOOLS_THROW(FAIL, "H5Dread failed");
/* print the data */
flags = START_OF_DATA;
@@ -1363,7 +1350,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
/* print array indices. get the lower bound of the hyperslab and calulate
the element position at the start of hyperslab */
if(H5Sget_select_bounds(f_space, low, high) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_select_bounds failed");
+ H5TOOLS_THROW(FAIL, "H5Sget_select_bounds failed");
elmtno = 0;
for (i = 0; i < (size_t) ctx->ndims - 1; i++) {
@@ -1381,20 +1368,20 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
ctx->need_prefix = TRUE;
if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, sm_nelmts, p_type, sm_buf) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "h5tools_dump_simple_data failed");
+ H5TOOLS_THROW(FAIL, "h5tools_dump_simple_data failed");
/* Reclaim any VL memory, if necessary */
if (vl_data)
H5Treclaim(p_type, sm_space, H5P_DEFAULT, sm_buf);
if(H5Sclose(sm_space) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_THROW(FAIL, "H5Sclose failed");
if(sm_buf)
HDfree(sm_buf);
sm_buf = NULL;
}
else
- H5TOOLS_THROW(SUCCEED, H5E_tools_min_id_g, "nothing to print");
+ H5TOOLS_THROW(SUCCEED, "nothing to print");
ctx->continuation++;
@@ -1405,7 +1392,6 @@ CATCH
HDfree(sm_buf);
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1585,18 +1571,18 @@ static herr_t
h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx,
hid_t dset, hid_t p_type)
{
- H5TOOLS_ERR_INIT(herr_t, SUCCEED)
- int sndims;
- hid_t f_space = H5I_INVALID_HID; /* file data space */
- size_t i; /* counters */
- hsize_t total_size[H5S_MAX_RANK];/* total size of dataset*/
+ int sndims;
+ hid_t f_space = H5I_INVALID_HID; /* file data space */
+ size_t i; /* counters */
+ hsize_t total_size[H5S_MAX_RANK];/* total size of dataset*/
+ hbool_t past_catch = FALSE;
+ herr_t ret_value = SUCCEED;
- H5TOOLS_PUSH_STACK();
if((f_space = H5Dget_space(dset)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
+ H5TOOLS_THROW(FAIL, "H5Dget_space failed");
if((sndims = H5Sget_simple_extent_ndims(f_space)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
+ H5TOOLS_THROW(FAIL, "H5Sget_simple_extent_ndims failed");
ctx->ndims = (unsigned)sndims;
/* assume entire data space to be printed */
@@ -1605,7 +1591,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co
ctx->p_min_idx[i] = 0;
if(H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
+ H5TOOLS_THROW(FAIL, "H5Sget_simple_extent_dims failed");
ctx->size_last_dim = total_size[ctx->ndims - 1];
/* Set the compound datatype field list for display */
@@ -1615,10 +1601,9 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co
CATCH
if(f_space >= 0 && H5Sclose(f_space) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_THROW(FAIL, "H5Sclose failed");
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1641,7 +1626,6 @@ static int
h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx,
hid_t dset, hid_t p_type)
{
- H5TOOLS_ERR_INIT(herr_t, SUCCEED)
hid_t f_space = H5I_INVALID_HID; /* file data space */
hsize_t elmtno; /* counter */
size_t i; /* counter */
@@ -1650,6 +1634,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
hsize_t zero[8]; /* vector of zeros */
unsigned int flags; /* buffer extent flags */
hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/
+ hbool_t past_catch = FALSE;
/* Print info */
size_t p_type_nbytes; /* size of memory type */
@@ -1669,20 +1654,20 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
/* VL data special information */
unsigned int vl_data = 0; /* contains VL datatypes */
+ int ret_value = 0;
- H5TOOLS_PUSH_STACK();
H5TOOLS_DEBUG("enter");
- if (FAIL == (f_space = H5Dget_space(dset)))
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed");
+ if (H5I_INVALID_HID == (f_space = H5Dget_space(dset)))
+ H5TOOLS_GOTO_ERROR((-1), "H5Dget_space failed");
sndims = H5Sget_simple_extent_ndims(f_space);
if(sndims < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_simple_extent_ndims failed");
+ H5TOOLS_GOTO_ERROR((-1), "H5Dget_simple_extent_ndims failed");
ctx->ndims = (unsigned)sndims;
H5TOOLS_DEBUG("sndims:%d", sndims);
if ((size_t)ctx->ndims > NELMTS(sm_size))
- H5TOOLS_GOTO_ERROR(FAIL, "ctx->ndims > NELMTS(sm_size) failed");
+ H5TOOLS_GOTO_ERROR((-1), "ctx->ndims > NELMTS(sm_size) failed");
/* Assume entire data space to be printed */
if (ctx->ndims > 0)
@@ -1754,15 +1739,15 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
}
if (H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Sselect_hyperslab hs_offset failed");
+ H5TOOLS_ERROR((-1), "H5Sselect_hyperslab hs_offset failed");
if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Sselect_hyperslab zero failed");
+ H5TOOLS_ERROR((-1), "H5Sselect_hyperslab zero failed");
}
else {
if (H5Sselect_all(f_space) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Sselect_all f_space failed");
+ H5TOOLS_ERROR((-1), "H5Sselect_all f_space failed");
if (H5Sselect_all(sm_space) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Sselect_all sm_space failed");
+ H5TOOLS_ERROR((-1), "H5Sselect_all sm_space failed");
hs_nelmts = 1;
}
@@ -1778,7 +1763,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
ctx->sm_pos = elmtno;
if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, hs_nelmts, p_type, sm_buf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "h5tools_dump_simple_data failed");
+ H5TOOLS_ERROR((-1), "h5tools_dump_simple_data failed");
/* Reclaim any VL memory, if necessary */
if (vl_data)
@@ -1797,7 +1782,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
}
}
else
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dread failed");
+ H5TOOLS_ERROR((-1), "H5Dread failed");
ctx->continuation++;
H5TOOLS_DEBUG("stripmine read loop:%d complete", i);
@@ -1807,12 +1792,11 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
done:
if(sm_space >= 0 && H5Sclose(sm_space) < 0)
- H5TOOLS_ERROR(FAIL, "H5Sclose failed");
+ H5TOOLS_ERROR((-1), "H5Sclose failed");
if(f_space >= 0 && H5Sclose(f_space) < 0)
- H5TOOLS_ERROR(FAIL, "H5Sclose failed");
+ H5TOOLS_ERROR((-1), "H5Sclose failed");
CATCH
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1830,31 +1814,31 @@ static int
h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx,
hid_t attr_id, hid_t p_type)
{
- H5TOOLS_ERR_INIT(herr_t, SUCCEED)
hid_t f_space = H5I_INVALID_HID; /* file data space */
hsize_t alloc_size;
int sndims; /* rank of dataspace */
unsigned i; /* counters */
hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/
hsize_t p_nelmts; /* total selected elmts */
- unsigned char *buf = NULL; /* buffer for raw data */
+ hbool_t past_catch = FALSE;
+ unsigned char *buf = NULL; /* buffer for raw data */
+ int ret_value = 0;
/* VL data special information */
unsigned int vl_data = 0; /* contains VL datatypes */
- H5TOOLS_PUSH_STACK();
H5TOOLS_DEBUG("enter");
- if (FAIL == (f_space = H5Aget_space(attr_id)))
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed");
+ if (H5I_INVALID_HID == (f_space = H5Aget_space(attr_id)))
+ H5TOOLS_GOTO_ERROR((-1), "H5Dget_space failed");
sndims = H5Sget_simple_extent_ndims(f_space);
if(sndims < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_simple_extent_ndims failed");
+ H5TOOLS_THROW((-1), "H5Dget_simple_extent_ndims failed");
ctx->ndims = (unsigned)sndims;
H5TOOLS_DEBUG("sndims:%d", sndims);
if ((size_t) ctx->ndims > NELMTS(ctx->p_min_idx))
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(ctx->p_min_idx) failed");
+ H5TOOLS_THROW((-1), "ctx->ndims > NELMTS(ctx->p_min_idx) failed");
/* Assume entire data space to be printed */
if (ctx->ndims > 0)
@@ -1892,22 +1876,21 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte
/* Read the data */
if (H5Aread(attr_id, p_type, buf) >= 0) {
if(h5tools_dump_simple_data(stream, info, attr_id, ctx, START_OF_DATA | END_OF_DATA, p_nelmts, p_type, buf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "h5tools_dump_simple_data failed");
+ H5TOOLS_ERROR((-1), "h5tools_dump_simple_data failed");
/* Reclaim any VL memory, if necessary */
if (vl_data)
H5Treclaim(p_type, f_space, H5P_DEFAULT, buf);
}
else
- H5TOOLS_GOTO_ERROR(FAIL, "H5Aread failed");
+ H5TOOLS_ERROR((-1), "H5Aread failed");
HDfree(buf);
} /* if (NULL != (buf...)) */
done:
if(f_space >= 0 && H5Sclose(f_space) < 0)
- H5TOOLS_ERROR(FAIL, "H5Sclose failed");
+ H5TOOLS_ERROR((-1), "H5Sclose failed");
CATCH
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1932,12 +1915,13 @@ CATCH
int
h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset)
{
- H5TOOLS_ERR_INIT(int, SUCCEED)
hid_t f_space = H5I_INVALID_HID;
hid_t p_type = H5I_INVALID_HID;
hid_t f_type = H5I_INVALID_HID;
H5S_class_t space_type;
h5tool_format_t info_dflt;
+ int ret_value = 0;
+
/* Use default values */
if (!stream)
stream = rawoutstream;
@@ -1990,7 +1974,6 @@ done:
H5Sclose(f_space);
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -2008,13 +1991,12 @@ done:
int
h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t attr_id)
{
- H5TOOLS_ERR_INIT(int, SUCCEED)
hid_t f_space = H5I_INVALID_HID;
hid_t p_type = H5I_INVALID_HID;
hid_t f_type = H5I_INVALID_HID;
h5tool_format_t info_dflt;
+ int ret_value = 0;
- H5TOOLS_PUSH_STACK();
/* Use default values */
if (!stream)
stream = rawoutstream;
@@ -2047,7 +2029,7 @@ h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c
/* Check the data space */
if (H5Sis_simple(f_space) <= 0) {
- H5TOOLS_GOTO_ERROR(FAIL, "H5Sis_simple failed");
+ H5TOOLS_ERROR((-1), "H5Sis_simple failed");
}
else {
ret_value = h5tools_dump_simple_mem(rawattrstream, info, ctx, attr_id, p_type);
@@ -2061,7 +2043,6 @@ done:
H5Sclose(f_space);
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -2080,7 +2061,6 @@ int
h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *info,
h5tools_context_t *ctx, hid_t type, int object_search)
{
- H5TOOLS_ERR_INIT(int, SUCCEED)
char *mname;
hid_t mtype = -1;
hid_t str_type = -1;
@@ -2100,12 +2080,13 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
H5T_class_t type_class;
H5T_sign_t sign; /* sign scheme value */
htri_t is_vlstr = FALSE;
+ hbool_t past_catch = FALSE;
const char *sign_s = NULL; /* sign scheme string */
const char *order_s = NULL; /* byte order string */
+ int ret_value = 0;
- H5TOOLS_PUSH_STACK();
if((type_class = H5Tget_class(type)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_class failed");
+ H5TOOLS_THROW((-1), "H5Tget_class failed");
if (object_search && H5Tcommitted(type) > 0) {
H5O_info_t oinfo;
obj_t *obj = NULL; /* Found object */
@@ -2395,11 +2376,11 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
order = H5Tget_order(tmp_type);
if(order == H5T_ORDER_LE) {
if(H5Tset_order(str_type, H5T_ORDER_LE) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tset_order failed");
+ H5TOOLS_ERROR((-1), "H5Tset_order failed");
} /* end if */
else if(order == H5T_ORDER_BE) {
if(H5Tset_order(str_type, H5T_ORDER_BE) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tset_order failed");
+ H5TOOLS_ERROR((-1), "H5Tset_order failed");
} /* end if */
if(H5Tequal(tmp_type, str_type)) {
@@ -2409,7 +2390,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
/* If not equal to C variable-length string, check Fortran type. */
if(H5Tclose(str_type) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
+ H5TOOLS_ERROR((-1), "H5Tclose failed");
str_type = H5Tcopy(H5T_FORTRAN_S1);
H5Tset_cset(str_type, cset);
@@ -2426,11 +2407,11 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
order = H5Tget_order(tmp_type);
if(order == H5T_ORDER_LE) {
if(H5Tset_order(str_type, H5T_ORDER_LE) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tset_order failed");
+ H5TOOLS_ERROR((-1), "H5Tset_order failed");
} /* end if */
else if(order == H5T_ORDER_BE) {
if(H5Tset_order(str_type, H5T_ORDER_BE) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tset_order failed");
+ H5TOOLS_ERROR((-1), "H5Tset_order failed");
} /* end if */
if(H5Tequal(tmp_type, str_type)) {
@@ -2449,9 +2430,9 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_str_reset(buffer);
if(H5Tclose(str_type) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
+ H5TOOLS_ERROR((-1), "H5Tclose failed");
if(H5Tclose(tmp_type) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
+ H5TOOLS_ERROR((-1), "H5Tclose failed");
h5tools_str_append(buffer, "%s", h5tools_dump_header_format->strblockend);
break;
@@ -2485,7 +2466,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
char *ttag;
if(NULL == (ttag = H5Tget_tag(type)))
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_tag failed");
+ H5TOOLS_THROW((-1), "H5Tget_tag failed");
ctx->need_prefix = TRUE;
@@ -2513,7 +2494,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
case H5T_COMPOUND:
if((snmembers = H5Tget_nmembers(type)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed");
+ H5TOOLS_THROW((-1), "H5Tget_nmembers failed");
nmembers = (unsigned)snmembers;
h5tools_str_append(buffer, "H5T_COMPOUND %s", h5tools_dump_header_format->structblockbegin);
@@ -2531,10 +2512,10 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_str_append(buffer, " \"%s\";", mname);
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
if(H5Tclose(mtype) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
+ H5TOOLS_ERROR((-1), "H5Tclose failed");
}
else
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_member_type failed");
+ H5TOOLS_ERROR((-1), "H5Tget_member_type failed");
H5free_memory(mname);
}
ctx->indent_level--;
@@ -2563,7 +2544,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
case H5T_ENUM:
if((super = H5Tget_super(type)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed");
+ H5TOOLS_THROW((-1), "H5Tget_super failed");
h5tools_str_append(buffer, "H5T_ENUM %s", h5tools_dump_header_format->enumblockbegin);
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
@@ -2575,7 +2556,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE);
if(H5Tclose(super) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
+ H5TOOLS_ERROR((-1), "H5Tclose failed");
h5tools_str_append(buffer, ";");
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
@@ -2593,14 +2574,14 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
case H5T_VLEN:
if((super = H5Tget_super(type)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed");
+ H5TOOLS_THROW((-1), "H5Tget_super failed");
h5tools_str_append(buffer, "H5T_VLEN %s ", h5tools_dump_header_format->vlenblockbegin);
h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE);
if(H5Tclose(super) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
+ H5TOOLS_ERROR((-1), "H5Tclose failed");
h5tools_str_append(buffer, "%s", h5tools_dump_header_format->vlenblockend);
@@ -2621,10 +2602,10 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_str_append(buffer, " ");
}
else
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_array_dims2 failed");
+ H5TOOLS_ERROR((-1), "H5Tget_array_dims2 failed");
}
else
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_array_ndims failed");
+ H5TOOLS_ERROR((-1), "H5Tget_array_ndims failed");
/* Get array base type */
if((super = H5Tget_super(type)) >= 0) {
@@ -2632,10 +2613,10 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE);
/* Close array base type */
if(H5Tclose(super) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
+ H5TOOLS_ERROR((-1), "H5Tclose failed");
}
else
- H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_super failed");
+ H5TOOLS_ERROR((-1), "H5Tget_super failed");
h5tools_str_append(buffer, " }");
@@ -2652,7 +2633,6 @@ done:
CATCH
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -2670,19 +2650,19 @@ CATCH
int
h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space)
{
- H5TOOLS_ERR_INIT(int, SUCCEED)
hsize_t size[H5TOOLS_DUMP_MAX_RANK];
hsize_t maxsize[H5TOOLS_DUMP_MAX_RANK];
int ndims = -1;
H5S_class_t space_type = -1;
+ hbool_t past_catch = FALSE;
int i;
+ int ret_value = 0;
- H5TOOLS_PUSH_STACK();
if((ndims = H5Sget_simple_extent_dims(space, size, maxsize)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
+ H5TOOLS_THROW((-1), "H5Sget_simple_extent_dims failed");
if((space_type = H5Sget_simple_extent_type(space)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_type failed");
+ H5TOOLS_THROW((-1), "H5Sget_simple_extent_type failed");
switch(space_type) {
case H5S_SCALAR:
@@ -2730,7 +2710,6 @@ h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space)
CATCH
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -2749,7 +2728,6 @@ CATCH
int
h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t type)
{
- H5TOOLS_ERR_INIT(int, SUCCEED)
char **name = NULL; /*member names */
unsigned char *value = NULL; /*value array */
unsigned char *copy = NULL; /*a pointer to value array */
@@ -2763,21 +2741,22 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
size_t dst_size; /*destination value type size */
size_t ncols = 80; /*available output width */
hsize_t curr_pos = 0; /* total data element position */
+ hbool_t past_catch = FALSE;
+ int ret_value = 0;
- H5TOOLS_PUSH_STACK();
if (info->line_ncols > 0)
ncols = info->line_ncols;
if((snmembs = H5Tget_nmembers(type)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed");
+ H5TOOLS_THROW((-1), "H5Tget_nmembers failed");
nmembs = (unsigned)snmembs;
HDassert(nmembs > 0);
if((super = H5Tget_super(type)) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed");
+ H5TOOLS_THROW((-1), "H5Tget_super failed");
if((type_size = H5Tget_size(type)) <= 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size(type) failed");
+ H5TOOLS_THROW((-1), "H5Tget_size(type) failed");
/*
* Determine what datatype to use for the native values. To simplify
@@ -2790,7 +2769,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
dst_size = sizeof(long long);
if((sign_type = H5Tget_sign(type))<0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_sign failed");
+ H5TOOLS_THROW((-1), "H5Tget_sign failed");
if(H5T_SGN_NONE == sign_type)
native = H5T_NATIVE_ULLONG;
else
@@ -2801,20 +2780,20 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
/* Get the names and raw values of all members */
if(NULL == (name = (char **)HDcalloc((size_t)nmembs, sizeof(char *))))
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member name");
+ H5TOOLS_THROW((-1), "Could not allocate buffer for member name");
if(NULL == (value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(type_size, dst_size))))
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member value");
+ H5TOOLS_THROW((-1), "Could not allocate buffer for member value");
for (i = 0; i < nmembs; i++) {
name[i] = H5Tget_member_name(type, i);
if(H5Tget_member_value(type, i, value + i * type_size) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_member_value failed");
+ H5TOOLS_THROW((-1), "H5Tget_member_value failed");
}
/* Convert values to native datatype */
if (native > 0)
if(H5Tconvert(super, native, (size_t)nmembs, value, NULL, H5P_DEFAULT) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Tconvert failed");
+ H5TOOLS_THROW((-1), "H5Tconvert failed");
/*
* Sort members by increasing value
@@ -2871,13 +2850,12 @@ CATCH
HDfree(value);
if(super >= 0 && H5Tclose(super) < 0)
- H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "Could not close datatype's super class");
+ H5TOOLS_THROW((-1), "Could not close datatype's super class");
if(0 == nmembs)
h5tools_str_append(buffer, "\n<empty>");
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
return ret_value;
}
@@ -3992,7 +3970,6 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tool
void
h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t obj_id, int obj_data)
{
- H5TOOLS_ERR_INIT(int, SUCCEED)
H5S_class_t space_type;
int ndims;
size_t i;
@@ -4011,7 +3988,6 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tool_format_t outputformat;
H5R_ref_t *ref_buf = NULL;
- H5TOOLS_PUSH_STACK();
H5TOOLS_DEBUG("enter file=%p", (void*)stream);
H5TOOLS_DEBUG("rawdata file=%p", (void*)rawdatastream);
/* setup */
@@ -4060,7 +4036,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
datactx = *ctx;
H5TOOLS_DEBUG("reference class type");
if (!H5Tequal(f_type, H5T_STD_REF) && !H5Tequal(f_type, H5T_STD_REF_DSETREG) && !H5Tequal(f_type, H5T_STD_REF_OBJ)) {
- H5TOOLS_GOTO_DONE(SUCCEED);
+ H5TOOLS_GOTO_DONE_NO_RET();
}
ndims = (int)H5Sget_simple_extent_npoints(space);
@@ -4080,13 +4056,15 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
if(obj_data) {
if(H5Dread(obj_id, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_buf) < 0) {
HDfree(ref_buf);
- H5TOOLS_GOTO_ERROR(FAIL, "H5Dread reference failed");
+ H5TOOLS_INFO("H5Dread reference failed");
+ H5TOOLS_GOTO_DONE_NO_RET();
}
}
else {
if(H5Aread(obj_id, H5T_STD_REF, ref_buf) < 0) {
HDfree(ref_buf);
- H5TOOLS_GOTO_ERROR(FAIL, "H5Aread reference failed");
+ H5TOOLS_INFO("H5Aread reference failed");
+ H5TOOLS_GOTO_DONE_NO_RET();
}
}
for(i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) {
@@ -4113,12 +4091,12 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_dump_data(stream, &outputformat, &datactx, new_obj_id, TRUE);
datactx.indent_level--;
if(H5Dclose(new_obj_id) < 0)
- H5TOOLS_ERROR(FAIL, "H5Dclose H5R_OBJECT1:H5O_TYPE_DATASET failed");
+ H5TOOLS_INFO("H5Dclose H5R_OBJECT1:H5O_TYPE_DATASET failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
- H5TOOLS_ERROR(FAIL, "H5Rdestroy H5R_OBJECT1:H5O_TYPE_DATASET failed");
+ H5TOOLS_INFO("H5Rdestroy H5R_OBJECT1:H5O_TYPE_DATASET failed");
}
else
- H5TOOLS_ERROR(FAIL, "H5Ropen_object H5R_OBJECT1:H5O_TYPE_DATASET failed");
+ H5TOOLS_INFO("H5Ropen_object H5R_OBJECT1:H5O_TYPE_DATASET failed");
break;
case H5O_TYPE_GROUP:
@@ -4131,7 +4109,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
} /* end switch */
}
else
- H5TOOLS_ERROR(FAIL, "H5Rget_obj_type3 H5R_OBJECT1 failed");
+ H5TOOLS_INFO("H5Rget_obj_type3 H5R_OBJECT1 failed");
break;
case H5R_DATASET_REGION1:
H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION1");
@@ -4140,12 +4118,12 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_dump_data(stream, &outputformat, &datactx, new_obj_id, TRUE);
datactx.indent_level--;
if(H5Dclose(new_obj_id) < 0)
- H5TOOLS_ERROR(FAIL, "H5Dclose H5R_DATASET_REGION1 failed");
+ H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION1 failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
- H5TOOLS_ERROR(FAIL, "H5Rdestroy H5R_DATASET_REGION1 failed");
+ H5TOOLS_INFO("H5Rdestroy H5R_DATASET_REGION1 failed");
}
else
- H5TOOLS_ERROR(FAIL, "H5Ropen_object H5R_DATASET_REGION1 failed");
+ H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION1 failed");
break;
case H5R_OBJECT2:
H5TOOLS_DEBUG("ref_type is H5R_OBJECT2");
@@ -4160,12 +4138,12 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_dump_data(stream, &outputformat, &datactx, new_obj_id, TRUE);
datactx.indent_level--;
if(H5Oclose(new_obj_id) < 0)
- H5TOOLS_ERROR(FAIL, "H5Oclose H5R_OBJECT2 failed");
+ H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
- H5TOOLS_ERROR(FAIL, "H5Rdestroy H5R_OBJECT2 failed");
+ H5TOOLS_INFO("H5Rdestroy H5R_OBJECT2 failed");
}
else
- H5TOOLS_ERROR(FAIL, "H5Ropen_object H5R_OBJECT2 failed");
+ H5TOOLS_INFO("H5Ropen_object H5R_OBJECT2 failed");
break;
case H5O_TYPE_NAMED_DATATYPE:
@@ -4179,7 +4157,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
} /* end switch */
}
else
- H5TOOLS_ERROR(FAIL, "H5Rget_obj_type3 H5R_OBJECT2 failed");
+ H5TOOLS_INFO("H5Rget_obj_type3 H5R_OBJECT2 failed");
break;
case H5R_DATASET_REGION2:
H5TOOLS_DEBUG("ref_type is H5R_DATASET_REGION2");
@@ -4189,7 +4167,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
/* if (new_obj_id < 0) - could mean that no reference was written do not throw failure */
if((new_obj_id = H5Ropen_object((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) < 0)
- H5TOOLS_ERROR(FAIL, "H5Ropen_object H5R_DATASET_REGION2 failed");
+ H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION2 failed");
else {
if((new_obj_sid = H5Ropen_region((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
if (h5tools_is_zero(&ref_buf[i], H5Tget_size(H5T_STD_REF))) {
@@ -4230,17 +4208,17 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
&buffer, &curr_pos, ncols, i, elmt_counter);
}
else
- H5TOOLS_ERROR(FAIL, "invalid region type");
+ H5TOOLS_INFO("invalid region type");
} /* end else to if (h5tools_is_zero(... */
if(H5Sclose(new_obj_sid) < 0)
- H5TOOLS_ERROR(FAIL, "H5Sclose H5R_DATASET_REGION2 failed");
+ H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION2 failed");
}
else
- H5TOOLS_ERROR(FAIL, "H5Ropen_region H5R_DATASET_REGION2 failed");
+ H5TOOLS_INFO("H5Ropen_region H5R_DATASET_REGION2 failed");
if(H5Dclose(new_obj_id) < 0)
- H5TOOLS_ERROR(FAIL, "H5Dclose H5R_DATASET_REGION2 failed");
+ H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
- H5TOOLS_ERROR(FAIL, "H5Rdestroy H5R_DATASET_REGION2 failed");
+ H5TOOLS_INFO("H5Rdestroy H5R_DATASET_REGION2 failed");
}
break;
case H5R_ATTR:
@@ -4249,9 +4227,9 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_dump_region_attribute(new_obj_id, stream, &outputformat, &datactx,
&buffer, &curr_pos, ncols, i, elmt_counter);
if(H5Aclose(new_obj_id) < 0)
- H5TOOLS_ERROR(FAIL, "H5Aclose H5R_ATTR failed");
+ H5TOOLS_INFO("H5Aclose H5R_ATTR failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
- H5TOOLS_ERROR(FAIL, "H5Rdestroy H5R_ATTR failed");
+ H5TOOLS_INFO("H5Rdestroy H5R_ATTR failed");
}
else {
H5TOOLS_DEBUG("NULL H5R_ATTR");
@@ -4276,7 +4254,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_str_append(&buffer, "}");
h5tools_render_element(stream, &outputformat, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
- H5TOOLS_ERROR(FAIL, "H5Ropen_attr H5R_ATTR failed");
+ H5TOOLS_INFO("H5Ropen_attr H5R_ATTR failed");
}
break;
case H5R_BADTYPE:
@@ -4392,6 +4370,5 @@ done:
h5tools_str_close(&buffer);
H5TOOLS_ENDDEBUG("exit");
- H5TOOLS_POP_STACK();
}