diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-01-03 18:03:38 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-01-03 18:03:38 (GMT) |
commit | 14a242987fa8f44c0ca9ca8798580a4521afe712 (patch) | |
tree | 4f1f34672328cf4059214abe6665eaa3b77e77d0 | |
parent | c70231a54ce2b898411504ffa9af0dff3e78be23 (diff) | |
download | hdf5-14a242987fa8f44c0ca9ca8798580a4521afe712.zip hdf5-14a242987fa8f44c0ca9ca8798580a4521afe712.tar.gz hdf5-14a242987fa8f44c0ca9ca8798580a4521afe712.tar.bz2 |
[svn-r4768] Purpose:
Bug Fix/Code Cleanup
Description:
Duplicated call to H5T_path_find was being made.
Solution:
Removed one... :-)
Platforms tested:
FreeBSD 4.5 (sleipnir)
-rw-r--r-- | src/H5Tconv.c | 37 |
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; |