summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-10-21 03:44:32 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-10-21 03:44:32 (GMT)
commit8430e2d4dea5015e1d71ae518bbd98a1aa06363b (patch)
tree48367b471bbac3ae1bc6c9eff5f8410b391ab014 /src
parent961a24ac3c18614850f998d7391728164090d1d6 (diff)
downloadhdf5-8430e2d4dea5015e1d71ae518bbd98a1aa06363b.zip
hdf5-8430e2d4dea5015e1d71ae518bbd98a1aa06363b.tar.gz
hdf5-8430e2d4dea5015e1d71ae518bbd98a1aa06363b.tar.bz2
[svn-r22935] Description:
Clean up a few warnings and minor code issues during review of enum -> int/float conversion changes. Tested on: Mac OSX/64 10.8.2 (amazon) w/debug (too minor to require h5committest)
Diffstat (limited to 'src')
-rw-r--r--src/H5Tconv.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index b0827f8..5ecf864 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -2909,8 +2909,8 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
size_t buf_stride, size_t UNUSED bkg_stride, void *_buf,
void UNUSED *bkg, hid_t UNUSED dxpl_id)
{
- H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */
- H5T_t *src_parent = NULL; /*parent type for src */
+ H5T_t *src, *dst; /*src and dst datatypes */
+ H5T_t *src_parent; /*parent type for src */
hid_t src_parent_id = -1; /*ID for parent of the source */
H5T_path_t *tpath; /* Conversion information */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2941,24 +2941,17 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
src_parent = src->shared->parent;
- if(H5T_INTEGER != src_parent->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "the base type of the source enum is not an integer type")
if(NULL == (tpath = H5T_path_find(src_parent, dst, NULL, NULL, dxpl_id, FALSE))) {
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype")
- } else if (!H5T_path_noop(tpath)) {
+ } else if(!H5T_path_noop(tpath)) {
if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion")
- }
-
- /* Convert the data */
- if(H5T_convert(tpath, src_parent_id, dst_id, nelmts, buf_stride, bkg_stride, _buf, bkg, dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed")
-
- /* Release the temporary datatype IDs used */
- if(src_parent_id >= 0)
- H5I_dec_ref(src_parent_id);
+ /* Convert the data */
+ if(H5T_convert(tpath, src_parent_id, dst_id, nelmts, buf_stride, bkg_stride, _buf, bkg, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed")
+ }
break;
default:
@@ -2967,6 +2960,10 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
} /* end switch */
done:
+ /* Release the temporary datatype IDs used */
+ if(src_parent_id >= 0)
+ H5I_dec_ref(src_parent_id);
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__conv_enum_numeric() */