summaryrefslogtreecommitdiffstats
path: root/tools/src/h5repack/h5repack_refs.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-10-23 14:26:15 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-10-23 14:26:15 (GMT)
commit8e2cedd066e4569bf36b530495bd2f811d95f808 (patch)
tree26a570f06f6010bff14f26bd3f22472b8ebd15e4 /tools/src/h5repack/h5repack_refs.c
parentd5acbfeb9e469ada610c4efa35a225be1cc2e0c1 (diff)
downloadhdf5-8e2cedd066e4569bf36b530495bd2f811d95f808.zip
hdf5-8e2cedd066e4569bf36b530495bd2f811d95f808.tar.gz
hdf5-8e2cedd066e4569bf36b530495bd2f811d95f808.tar.bz2
HDFFV-10297 Cleanup, Initialize variables
Diffstat (limited to 'tools/src/h5repack/h5repack_refs.c')
-rw-r--r--tools/src/h5repack/h5repack_refs.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c
index 14294ea..7b610a3 100644
--- a/tools/src/h5repack/h5repack_refs.c
+++ b/tools/src/h5repack/h5repack_refs.c
@@ -145,7 +145,7 @@ int do_copy_refobjs(hid_t fidin,
*-------------------------------------------------------------------------
*/
if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) {
- hid_t refobj_id;
+ hid_t refobj_id = -1;
hobj_ref_t *refbuf = NULL; /* buffer for object references */
hobj_ref_t *buf = NULL;
const char* refname;
@@ -221,7 +221,7 @@ int do_copy_refobjs(hid_t fidin,
*-------------------------------------------------------------------------
*/
else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) {
- hid_t refobj_id;
+ hid_t refobj_id = -1;
hdset_reg_ref_t *refbuf = NULL; /* input buffer for region references */
hdset_reg_ref_t *buf = NULL; /* output buffer */
const char* refname;
@@ -260,7 +260,7 @@ int do_copy_refobjs(hid_t fidin,
* in the second traversal of the file
*/
if((refname = MapIdToName(refobj_id, travt)) != NULL) {
- hid_t region_id; /* region id of the referenced dataset */
+ hid_t region_id = -1; /* region id of the referenced dataset */
if((region_id = H5Rget_region(dset_in, H5R_DATASET_REGION, &buf[u])) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rget_region failed");
@@ -481,18 +481,16 @@ static int copy_refs_attr(hid_t loc_in,
is_ref = (type_class == H5T_REFERENCE);
if(type_class == H5T_VLEN ) {
- hid_t base_type;
+ hid_t base_type = H5Tget_super(ftype_id);
- base_type = H5Tget_super(ftype_id);
is_ref_vlen = (H5Tget_class(base_type) == H5T_REFERENCE);
msize = H5Tget_size(base_type);
if (H5Tclose(base_type) < 0)
H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed");
}
else if(type_class == H5T_ARRAY ) {
- hid_t base_type;
+ hid_t base_type = H5Tget_super(ftype_id);
- base_type = H5Tget_super(ftype_id);
is_ref_array = (H5Tget_class(base_type) == H5T_REFERENCE);
msize = H5Tget_size(base_type);
if (H5Tclose(base_type) < 0)
@@ -573,9 +571,8 @@ static int copy_refs_attr(hid_t loc_in,
unsigned array_rank = 0;
hsize_t array_size = 1;
hsize_t array_dims[H5S_MAX_RANK];
- hid_t base_type;
+ hid_t base_type = H5Tget_super(ftype_id);
- base_type = H5Tget_super(ftype_id);
msize = H5Tget_size(base_type);
if (H5Tclose(base_type) < 0)
H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed");