summaryrefslogtreecommitdiffstats
path: root/tools/src/h5repack/h5repack_refs.c
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2019-12-28 05:02:26 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2019-12-28 20:08:04 (GMT)
commit2cbf31cb3ad8032fb1915c783dc52a2050aaf7da (patch)
treed88ce3a7584792894bd073df1f2290f22eb69daa /tools/src/h5repack/h5repack_refs.c
parent34a68acc934800d6b8c9a51c2ce91155b3178111 (diff)
downloadhdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.zip
hdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.tar.gz
hdf5-2cbf31cb3ad8032fb1915c783dc52a2050aaf7da.tar.bz2
Refactor tools library error handling macros
Diffstat (limited to 'tools/src/h5repack/h5repack_refs.c')
-rw-r--r--tools/src/h5repack/h5repack_refs.c162
1 files changed, 81 insertions, 81 deletions
diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c
index 02a2a6d..01ef1d3 100644
--- a/tools/src/h5repack/h5repack_refs.c
+++ b/tools/src/h5repack/h5repack_refs.c
@@ -76,18 +76,18 @@ int do_copy_refobjs(hid_t fidin,
*-------------------------------------------------------------------------
*/
if((grp_out = H5Gopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Gopen2 failed");
if((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Gopen2 failed");
if(copy_refs_attr(grp_in, grp_out, travt, fidout) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "copy_refs_attr failed");
if(H5Gclose(grp_out) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Gclose failed");
if(H5Gclose(grp_in) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Gclose failed");
/*-------------------------------------------------------------------------
* check for hard links
@@ -104,26 +104,26 @@ int do_copy_refobjs(hid_t fidin,
*/
case H5TRAV_TYPE_DATASET:
if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dopen2 failed");
if((space_id = H5Dget_space(dset_in)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed");
if((ftype_id = H5Dget_type(dset_in)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_type failed");
if((dcpl_id = H5Dget_create_plist(dset_in)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_create_plist failed");
if((rank = H5Sget_simple_extent_ndims(space_id)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sget_simple_extent_ndims failed");
if(H5Sget_simple_extent_dims(space_id, dims, NULL) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sget_simple_extent_dims failed");
nelmts = 1;
for(k = 0; k < rank; k++)
nelmts *= dims[k];
if((mtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_native_type failed");
if((msize = H5Tget_size(mtype_id)) == 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_size failed");
/*-------------------------------------------------------------------------
* check if the dataset creation property list has filters that
@@ -159,15 +159,15 @@ int do_copy_refobjs(hid_t fidin,
buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize));
if(buf==NULL) {
HDprintf("cannot read into memory\n" );
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "HDmalloc failed");
} /* end if */
if(H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dread failed");
refbuf = (hobj_ref_t*) HDcalloc((unsigned)nelmts, msize);
if(refbuf == NULL){
HDprintf("cannot allocate memory\n" );
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "HDcalloc failed");
} /* end if */
for(u = 0; u < nelmts; u++) {
H5E_BEGIN_TRY {
@@ -181,7 +181,7 @@ int do_copy_refobjs(hid_t fidin,
if((refname = MapIdToName(refobj_id, travt)) != NULL) {
/* create the reference, -1 parameter for objects */
if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, (hid_t)-1) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Rcreate failed");
if(options->verbose) {
HDprintf(FORMAT_OBJ,"dset",travt->objs[i].name );
HDprintf("object <%s> object reference created to <%s>\n",
@@ -190,7 +190,7 @@ int do_copy_refobjs(hid_t fidin,
}
} /*refname*/
if (H5Oclose(refobj_id) < 0)
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Oclose refob failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Oclose refob failed");
} /* u */
} /*nelmts*/
@@ -199,10 +199,10 @@ int do_copy_refobjs(hid_t fidin,
*-------------------------------------------------------------------------
*/
if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dcreate2 failed");
if(nelmts)
if(H5Dwrite(dset_out, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, refbuf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dwrite failed");
if(buf)
HDfree(buf);
@@ -213,7 +213,7 @@ int do_copy_refobjs(hid_t fidin,
* copy attrs
*----------------------------------------------------*/
if(copy_attr(dset_in, dset_out, &named_dt_head, travt, options) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_attr failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "copy_attr failed");
} /*H5T_STD_REF_OBJ*/
/*-------------------------------------------------------------------------
@@ -235,10 +235,10 @@ int do_copy_refobjs(hid_t fidin,
buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize));
if(buf == NULL) {
HDprintf("cannot read into memory\n");
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "HDmalloc failed");
} /* end if */
if(H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dread failed");
/*-------------------------------------------------------------------------
* create output
@@ -247,7 +247,7 @@ int do_copy_refobjs(hid_t fidin,
refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */
if(refbuf == NULL) {
HDprintf("cannot allocate memory\n");
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "HDcalloc failed");
} /* end if */
for(u = 0; u < nelmts; u++) {
@@ -263,13 +263,13 @@ int do_copy_refobjs(hid_t fidin,
hid_t region_id = -1; /* region id of the referenced dataset */
if((region_id = H5Rget_region(dset_in, H5R_DATASET_REGION, &buf[u])) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rget_region failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Rget_region failed");
/* create the reference, we need the space_id */
if(H5Rcreate(&refbuf[u], fidout, refname, H5R_DATASET_REGION, region_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Rcreate failed");
if(H5Sclose(region_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sclose failed");
if(options->verbose) {
HDprintf(FORMAT_OBJ,"dset",travt->objs[i].name );
HDprintf("object <%s> region reference created to <%s>\n",
@@ -278,7 +278,7 @@ int do_copy_refobjs(hid_t fidin,
}
} /*refname*/
if (H5Oclose(refobj_id) < 0)
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Oclose refobj_id failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Oclose refobj_id failed");
} /* u */
} /*nelmts*/
@@ -287,10 +287,10 @@ int do_copy_refobjs(hid_t fidin,
*-------------------------------------------------------------------------
*/
if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dcreate2 failed");
if(nelmts)
if(H5Dwrite(dset_out, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, refbuf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dwrite failed");
if(buf)
HDfree(buf);
@@ -301,7 +301,7 @@ int do_copy_refobjs(hid_t fidin,
* copy attrs
*----------------------------------------------------*/
if(copy_attr(dset_in, dset_out, &named_dt_head, travt, options) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_attr failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "copy_attr failed");
} /* H5T_STD_REF_DSETREG */
/*-------------------------------------------------------------------------
* not references, open previously created object in 1st traversal
@@ -309,7 +309,7 @@ int do_copy_refobjs(hid_t fidin,
*/
else {
if((dset_out = H5Dopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dopen2 failed");
} /* end else */
/*-------------------------------------------------------------------------
@@ -317,7 +317,7 @@ int do_copy_refobjs(hid_t fidin,
*-------------------------------------------------------------------------
*/
if(copy_refs_attr(dset_in, dset_out, travt, fidout) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "copy_refs_attr failed");
/*-------------------------------------------------------------------------
* check for hard links
@@ -328,7 +328,7 @@ int do_copy_refobjs(hid_t fidin,
H5Lcreate_hard(fidout, travt->objs[i].name, H5L_SAME_LOC, travt->objs[i].links[j].new_name, H5P_DEFAULT, H5P_DEFAULT);
if(H5Dclose(dset_out) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dclose failed");
} /*can_read*/
/*-------------------------------------------------------------------------
@@ -336,15 +336,15 @@ int do_copy_refobjs(hid_t fidin,
*-------------------------------------------------------------------------
*/
if(H5Tclose(ftype_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
if(H5Tclose(mtype_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
if(H5Pclose(dcpl_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pclose failed");
if(H5Sclose(space_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sclose failed");
if(H5Dclose(dset_in) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Dclose failed");
break;
/*-------------------------------------------------------------------------
@@ -353,9 +353,9 @@ int do_copy_refobjs(hid_t fidin,
*/
case H5TRAV_TYPE_NAMED_DATATYPE:
if((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Topen2 failed");
if(H5Tclose(type_in) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
break;
/*-------------------------------------------------------------------------
@@ -368,7 +368,8 @@ int do_copy_refobjs(hid_t fidin,
case H5TRAV_TYPE_UNKNOWN:
case H5TRAV_TYPE_UDLINK:
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5TRAV invalid type");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5TRAV invalid type");
+ break;
default:
break;
@@ -380,7 +381,7 @@ int do_copy_refobjs(hid_t fidin,
* in copy_attr(), so need to free.
*/
if (named_datatype_free(&named_dt_head, 0) < 0)
- H5TOOLS_INFO(H5E_tools_min_id_g, "named_datatype_free failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "named_datatype_free failed");
return ret_value;
@@ -453,28 +454,27 @@ static int copy_refs_attr(hid_t loc_in,
size_t *ref_comp_size = NULL;
int ref_comp_field_n = 0;
-
if(H5Oget_info2(loc_in, &oinfo, H5O_INFO_NUM_ATTRS) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Oget_info failed");
for(u = 0; u < (unsigned)oinfo.num_attrs; u++) {
is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0;
/* open attribute */
if((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aopen_by_idx failed");
/* get the file datatype */
if((ftype_id = H5Aget_type(attr_id)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aget_type failed");
type_class = H5Tget_class(ftype_id);
if((mtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_native_type failed");
if((msize = H5Tget_size(mtype_id)) == 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_size failed");
is_ref = (type_class == H5T_REFERENCE);
@@ -484,7 +484,7 @@ static int copy_refs_attr(hid_t loc_in,
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");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose base_type failed");
}
else if(type_class == H5T_ARRAY ) {
hid_t base_type = H5Tget_super(ftype_id);
@@ -492,13 +492,13 @@ static int copy_refs_attr(hid_t loc_in,
is_ref_array = (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");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose base_type failed");
}
else if(type_class == H5T_COMPOUND) {
int nmembers = H5Tget_nmembers(ftype_id) ;
if (nmembers < 1)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_nmembers failed");
ref_comp_index = (unsigned *)HDmalloc((size_t)nmembers*sizeof(unsigned));
ref_comp_size = (size_t *)HDmalloc((size_t)nmembers*sizeof(ref_comp_size));
@@ -513,7 +513,7 @@ static int copy_refs_attr(hid_t loc_in,
ref_comp_field_n++;
}
if (H5Tclose(mtid) < 0)
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtid failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose mtid failed");
}
/* if compound don't contain reference type member, free the above
@@ -536,25 +536,25 @@ static int copy_refs_attr(hid_t loc_in,
if (!(is_ref || is_ref_vlen || is_ref_array || is_ref_comp)) {
if (H5Tclose(mtype_id) < 0)
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtype_id failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose mtype_id failed");
if (H5Tclose(ftype_id) < 0)
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose ftype_id failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose ftype_id failed");
if (H5Aclose(attr_id) < 0)
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Aclose attr_id failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aclose attr_id failed");
continue;
}
/* get name */
if(H5Aget_name(attr_id, 255, name) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aget_name failed");
/* get the dataspace handle */
if((space_id = H5Aget_space(attr_id)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_space failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aget_space failed");
/* get dimensions */
if((rank = H5Sget_simple_extent_dims(space_id, dims, NULL)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sget_simple_extent_dims failed");
/*-------------------------------------------------------------------------
@@ -573,7 +573,7 @@ static int copy_refs_attr(hid_t loc_in,
msize = H5Tget_size(base_type);
if (H5Tclose(base_type) < 0)
- H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose base_type failed");
array_rank = (unsigned)H5Tget_array_ndims(mtype_id);
H5Tget_array_dims2(mtype_id, array_dims);
@@ -583,7 +583,7 @@ static int copy_refs_attr(hid_t loc_in,
}
if((attr_out = H5Acreate2(loc_out, name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Acreate2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Acreate2 failed");
if (nelmts>0) {
/* handle object references */
@@ -591,15 +591,15 @@ static int copy_refs_attr(hid_t loc_in,
buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize));
if(buf == NULL) {
HDprintf("cannot read into memory\n");
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "HDmalloc failed");
} /* end if */
if(H5Aread(attr_id, mtype_id, buf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aread failed");
refbuf = (hobj_ref_t *)HDcalloc((unsigned)nelmts, msize);
if(refbuf == NULL) {
HDprintf("cannot allocate memory\n");
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "HDcalloc failed");
} /* end if */
for(i = 0; i < (unsigned)nelmts; i++)
@@ -612,10 +612,10 @@ static int copy_refs_attr(hid_t loc_in,
if(buf == NULL) {
HDprintf( "cannot read into memory\n" );
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "HDmalloc failed");
} /* end if */
if(H5Aread(attr_id, mtype_id, buf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aread failed");
/*-------------------------------------------------------------------------
* create output
@@ -624,7 +624,7 @@ static int copy_refs_attr(hid_t loc_in,
refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */
if(refbuf == NULL) {
HDprintf( "cannot allocate memory\n" );
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "HDcalloc failed");
} /* end if */
for(i = 0; i < (unsigned)nelmts; i++)
@@ -639,11 +639,11 @@ static int copy_refs_attr(hid_t loc_in,
if(buf == NULL) {
HDprintf( "cannot read into memory\n" );
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "HDmalloc failed");
} /* end if */
if(H5Aread(attr_id, mtype_id, buf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aread failed");
if (H5R_OBJ_REF_BUF_SIZE==msize) {
hobj_ref_t ref_out;
@@ -680,11 +680,11 @@ static int copy_refs_attr(hid_t loc_in,
if(buf == NULL) {
HDprintf( "cannot read into memory\n" );
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "HDmalloc failed");
} /* end if */
if(H5Aread(attr_id, mtype_id, buf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aread failed");
for (i=0; i<(unsigned)nelmts; i++) {
for (j=0; j<(unsigned)ref_comp_field_n; j++) {
@@ -709,7 +709,7 @@ static int copy_refs_attr(hid_t loc_in,
} /* else if (is_ref_comp) */
if(H5Awrite(attr_out, mtype_id, refbuf) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Awrite failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Awrite failed");
if (is_ref_vlen && buf)
H5Treclaim (mtype_id, space_id, H5P_DEFAULT, buf);
@@ -739,20 +739,20 @@ static int copy_refs_attr(hid_t loc_in,
}
if(H5Aclose(attr_out) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aclose failed");
/*-------------------------------------------------------------------------
* close
*-------------------------------------------------------------------------
*/
if(H5Tclose(ftype_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
if(H5Tclose(mtype_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Tclose failed");
if(H5Sclose(space_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Sclose failed");
if(H5Aclose(attr_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Aclose failed");
} /* for(u = 0; u < (unsigned)oinfo.num_attrs; u++) */
done:
@@ -829,20 +829,20 @@ static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in,
ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in);
if (ref_obj_id < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rdereference2 failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Rdereference2 failed");
ref_obj_name = MapIdToName(ref_obj_id, travt);
if (ref_obj_name == NULL)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "MapIdToName failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "MapIdToName failed");
if (ref_type == H5R_DATASET_REGION) {
space_id = H5Rget_region(obj_id, H5R_DATASET_REGION, ref_in);
if (space_id < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rget_region failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Rget_region failed");
}
if(H5Rcreate(ref_out, fid_out, ref_obj_name, ref_type, space_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed");
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Rcreate failed");
done:
H5E_BEGIN_TRY {