HDFFV-10980 - h5diff uses new ref APIs

This commit is contained in:
Allen Byrne
2019-12-19 16:29:35 -06:00
committed by David Young
parent b6b0567bdf
commit d486a9b27e
48 changed files with 1493 additions and 475 deletions

View File

@@ -496,8 +496,8 @@ static hid_t
h5tools_get_fapl(hid_t fapl, const char *fname, const char *driver,
unsigned *drivernum)
{
H5TOOLS_ERR_INIT(int, SUCCEED)
hid_t new_fapl = -1; /* Copy of file access property list passed in, or new property list */
int ret_value = SUCCEED;
/* Make a copy of the FAPL, for the file open call to use, eventually */
if (fapl == H5P_DEFAULT) {
@@ -1582,6 +1582,7 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream,
hsize_t blkndx;
hid_t sid1 = -1;
H5TOOLS_PUSH_STACK();
/* Get the dataspace of the dataset */
if((sid1 = H5Dget_space(region_id)) < 0)
H5TOOLS_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
@@ -1648,6 +1649,8 @@ CATCH
if(H5Sclose(sid1) < 0)
H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1675,6 +1678,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id,
hid_t dtype = -1;
hid_t type_id = -1;
H5TOOLS_PUSH_STACK();
if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0)
H5TOOLS_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed");
nblocks = (hsize_t)snblocks;
@@ -1698,7 +1702,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id,
render_bin_output_region_data_blocks(region_id, stream, container, ndims, type_id, nblocks, ptdata);
done:
done:
HDfree(ptdata);
if(type_id > 0 && H5Tclose(type_id) < 0)
@@ -1709,7 +1713,9 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id,
H5_LEAVE(TRUE)
CATCH
CATCH
H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1741,6 +1747,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id,
hid_t mem_space = -1;
void *region_buf = NULL;
H5TOOLS_PUSH_STACK();
if((type_size = H5Tget_size(type_id)) == 0)
H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
@@ -1763,13 +1770,15 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id,
if(render_bin_output(stream, container, type_id, (char*)region_buf, npoints) < 0)
H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "render_bin_output of data points failed");
done:
done:
HDfree(region_buf);
HDfree(dims1);
if(H5Sclose(mem_space) < 0)
H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
H5TOOLS_POP_STACK();
return ret_value;
}
@@ -1795,6 +1804,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id,
hid_t dtype = -1;
hid_t type_id = -1;
H5TOOLS_PUSH_STACK();
if((snpoints = H5Sget_select_elem_npoints(region_space)) <= 0)
H5TOOLS_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed");
npoints = (hsize_t)snpoints;
@@ -1812,7 +1822,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id,
render_bin_output_region_data_points(region_space, region_id, stream, container, ndims, type_id, npoints);
done:
done:
if(type_id > 0 && H5Tclose(type_id) < 0)
H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
@@ -1821,6 +1831,8 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id,
H5_LEAVE(ret_value)
CATCH
H5TOOLS_ENDDEBUG(H5E_tools_min_dbg_id_g, "exit");
H5TOOLS_POP_STACK();
return ret_value;
}