summaryrefslogtreecommitdiffstats
path: root/tools/src/h5repack/h5repack_refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/h5repack/h5repack_refs.c')
-rw-r--r--tools/src/h5repack/h5repack_refs.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c
index a275443..f5846ba 100644
--- a/tools/src/h5repack/h5repack_refs.c
+++ b/tools/src/h5repack/h5repack_refs.c
@@ -22,7 +22,7 @@
*/
static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt);
-static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options,
+static int copy_refs_attr(hid_t loc_in, hid_t loc_out,
trav_table_t *travt, hid_t fidout);
static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in,
hid_t fid_out, void *ref_out, trav_table_t *travt);
@@ -81,7 +81,7 @@ int do_copy_refobjs(hid_t fidin,
if((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed");
- if(copy_refs_attr(grp_in, grp_out, options, travt, fidout) < 0)
+ if(copy_refs_attr(grp_in, grp_out, travt, fidout) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed");
if(H5Gclose(grp_out) < 0)
@@ -316,7 +316,7 @@ int do_copy_refobjs(hid_t fidin,
* copy referenced objects in attributes
*-------------------------------------------------------------------------
*/
- if(copy_refs_attr(dset_in, dset_out, options, travt, fidout) < 0)
+ if(copy_refs_attr(dset_in, dset_out, travt, fidout) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed");
/*-------------------------------------------------------------------------
@@ -426,7 +426,6 @@ done:
static int copy_refs_attr(hid_t loc_in,
hid_t loc_out,
- pack_opt_t *options,
trav_table_t *travt,
hid_t fidout) /* for saving references */
{
@@ -450,7 +449,6 @@ static int copy_refs_attr(hid_t loc_in,
is_ref_comp = 0;
void *refbuf = NULL;
void *buf = NULL;
- const char *refname = NULL;
unsigned *ref_comp_index = NULL;
size_t *ref_comp_size = NULL;
int ref_comp_field_n = 0;
@@ -604,12 +602,9 @@ static int copy_refs_attr(hid_t loc_in,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
} /* end if */
- for(i = 0; i < (unsigned)nelmts; i++) {
- if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt)<0)
+ for(i = 0; i < (unsigned)nelmts; i++)
+ if(update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt) < 0)
continue;
- if(options->verbose)
- printf("object <%s> reference created to <%s>\n", name, refname);
- } /* i */
} /* H5T_STD_REF_OBJ */
/* handle region references */
else if((is_ref || is_ref_array) && (H5R_DSET_REG_REF_BUF_SIZE == msize)) {
@@ -632,12 +627,9 @@ static int copy_refs_attr(hid_t loc_in,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
} /* end if */
- for(i = 0; i < (unsigned)nelmts; i++) {
- if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt)<0)
+ for(i = 0; i < (unsigned)nelmts; i++)
+ if(update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt) < 0)
continue;
- if(options->verbose)
- printf("object <%s> region reference created to <%s>\n", name, refname);
- }
} /* H5T_STD_REF_DSETREG */
else if (is_ref_vlen) {
/* handle VLEN of references */
@@ -700,7 +692,7 @@ static int copy_refs_attr(hid_t loc_in,
size_t idx = (i * msize) + H5Tget_member_offset(mtype_id, ref_comp_index[j]);
hobj_ref_t ref_out;
- if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
+ if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)((void *)(((char *)buf)+idx)), fidout, &ref_out, travt) < 0) /* Extra (void *) cast to quiet "cast to create alignment" warning - 2019/07/05, QAK */
continue;
HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
} /* if */