summaryrefslogtreecommitdiffstats
path: root/src/H5Tconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Tconv.c')
-rw-r--r--src/H5Tconv.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 21123fb..9133d90 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -2444,19 +2444,15 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
/* Get initial conversion buffer */
conv_buf_size=MAX(src_base_size,dst_base_size);
if ((conv_buf=H5FL_BLK_ALLOC(vlen_seq,conv_buf_size,0))==NULL)
- HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
- "memory allocation failed for type conversion");
+ HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion");
/* Set up conversion path for base elements */
- tpath = H5T_path_find(src->parent, dst->parent, NULL, NULL);
if (NULL==(tpath=H5T_path_find(src->parent, dst->parent, NULL, NULL))) {
- HRETURN_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL,
- "unable to convert between src and dest datatypes");
+ HRETURN_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatypes");
} else if (!H5T_IS_NOOP(tpath)) {
if ((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->parent, H5T_COPY_ALL)))<0 ||
- (tdst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->parent, H5T_COPY_ALL)))<0) {
- HRETURN_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL,
- "unable to register types for conversion");
+ (tdst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->parent, H5T_COPY_ALL)))<0) {
+ HRETURN_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion");
}
}
@@ -2640,21 +2636,12 @@ H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
dst_delta = direction * (buf_stride ? buf_stride : dst->size);
/* Set up conversion path for base elements */
- tpath = H5T_path_find(src->parent, dst->parent, NULL, NULL);
- if (NULL==(tpath=H5T_path_find(src->parent, dst->parent,
- NULL, NULL))) {
- HRETURN_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL,
- "unable to convert between src and dest "
- "datatypes");
+ if (NULL==(tpath=H5T_path_find(src->parent, dst->parent, NULL, NULL))) {
+ HRETURN_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatypes");
} else if (!H5T_IS_NOOP(tpath)) {
- if ((tsrc_id = H5I_register(H5I_DATATYPE,
- H5T_copy(src->parent,
- H5T_COPY_ALL)))<0 ||
- (tdst_id = H5I_register(H5I_DATATYPE,
- H5T_copy(dst->parent,
- H5T_COPY_ALL)))<0) {
- HRETURN_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL,
- "unable to register types for conversion");
+ if ((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->parent, H5T_COPY_ALL)))<0 ||
+ (tdst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->parent, H5T_COPY_ALL)))<0) {
+ HRETURN_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion");
}
}
@@ -2664,10 +2651,8 @@ H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
HDmemmove(dp, sp, src->size);
/* Convert array */
- if (H5T_convert(tpath, tsrc_id, tdst_id, (hsize_t)src->u.array.nelem, 0, bkg_stride,
- dp, _bkg, dset_xfer_plist)<0)
- HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
- "datatype conversion failed");
+ if (H5T_convert(tpath, tsrc_id, tdst_id, (hsize_t)src->u.array.nelem, 0, bkg_stride, dp, _bkg, dset_xfer_plist)<0)
+ HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed");
/* Advance the source & destination pointers */
sp += src_delta;