diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-10-04 07:33:40 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-10-04 07:33:40 (GMT) |
commit | 914643490ab581c4b0bb78ca30a8e1fa520b4d6d (patch) | |
tree | 53436d1611395e02c652c7ac5c075898fc2ae261 /src/H5Aint.c | |
parent | 0ee053bb95a620b6f8109d22a372f6acc1cee300 (diff) | |
parent | 888a002cddaa4e1d9a165ea01dfe62f399df9eb9 (diff) | |
download | hdf5-914643490ab581c4b0bb78ca30a8e1fa520b4d6d.zip hdf5-914643490ab581c4b0bb78ca30a8e1fa520b4d6d.tar.gz hdf5-914643490ab581c4b0bb78ca30a8e1fa520b4d6d.tar.bz2 |
[svn-r27946] Brought VDS branch in sync with trunk (up to r27945).
Tested on Ubuntu 15.04 (Linux 3.19 x86_64), gcc 4.9.2, MPICH 3.1.4
and CMake 3.3.2.
- Autotools serial w/ Fortran, C++
- Autotools parallel w/ Fortran
- CMake serial w/ Fortran, C++
Diffstat (limited to 'src/H5Aint.c')
-rw-r--r-- | src/H5Aint.c | 58 |
1 files changed, 24 insertions, 34 deletions
diff --git a/src/H5Aint.c b/src/H5Aint.c index 193e8f4..baa352c 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -734,39 +734,31 @@ H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) /*------------------------------------------------------------------------- * Function: H5A_get_space * - * Purpose: Returns and ID for the dataspace of the attribute. + * Purpose: Returns dataspace of the attribute. * - * Return: Success: ID for dataspace + * Return: Success: dataspace * - * Failure: FAIL + * Failure: NULL * * Programmer: Mohamad Chaarawi * March, 2012 * *------------------------------------------------------------------------- */ -hid_t +H5S_t * H5A_get_space(H5A_t *attr) { - H5S_t *ds = NULL; - hid_t ret_value = FAIL; + H5S_t *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT - /* Copy the attribute's dataspace */ - if(NULL == (ds = H5S_copy(attr->shared->ds, FALSE, TRUE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to copy dataspace") + HDassert(attr); - /* Atomize */ - if((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") + /* Copy the attribute's dataspace */ + if(NULL == (ret_value = H5S_copy(attr->shared->ds, FALSE, TRUE))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to copy dataspace") done: - if(ret_value < 0 && ds) { - if(H5S_close(ds) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") - } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_get_space() */ @@ -774,28 +766,30 @@ done: /*------------------------------------------------------------------------- * Function: H5A_get_type * - * Purpose: Returns and ID for the datatype of the dataset. + * Purpose: Returns datatype of the dataset. * - * Return: Success: ID for datatype + * Return: Success: datatype * - * Failure: FAIL + * Failure: NULL * * Programmer: Mohamad Chaarawi * March, 2012 * *------------------------------------------------------------------------- */ -hid_t +H5T_t * H5A_get_type(H5A_t *attr) { - H5T_t *dt = NULL; - hid_t ret_value = FAIL; + H5T_t *dt = NULL; + H5T_t *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT + HDassert(attr); + /* Patch the datatype's "top level" file pointer */ if(H5T_patch_file(attr->shared->dt, attr->oloc.file) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to patch datatype's file pointer") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to patch datatype's file pointer") /* * Copy the attribute's datatype. If the type is a named type then @@ -803,25 +797,21 @@ H5A_get_type(H5A_t *attr) * read-only. */ if(NULL == (dt = H5T_copy(attr->shared->dt, H5T_COPY_REOPEN))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to copy datatype") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to copy datatype") /* Mark any datatypes as being in memory now */ if(H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location") /* Lock copied type */ if(H5T_lock(dt, FALSE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to lock transient datatype") - /* Create an atom */ - if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") + ret_value = dt; done: - if(ret_value < 0) { - if(dt && H5T_close(dt) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") - } /* end if */ + if(!ret_value && dt && (H5T_close(dt) < 0)) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_get_type() */ |