mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-12-27 08:01:04 +08:00
[svn-r17432] Description:
Simplify out dataspace cleanup code. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
This commit is contained in:
parent
b1512c79e5
commit
f88607ed24
22
src/H5Z.c
22
src/H5Z.c
@ -497,7 +497,8 @@ done:
|
|||||||
static herr_t
|
static herr_t
|
||||||
H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type)
|
H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type)
|
||||||
{
|
{
|
||||||
herr_t ret_value = SUCCEED; /* Return value */
|
hid_t space_id = -1; /* ID for dataspace describing chunk */
|
||||||
|
herr_t ret_value = SUCCEED; /* Return value */
|
||||||
|
|
||||||
FUNC_ENTER_NOAPI_NOINIT(H5Z_prelude_callback)
|
FUNC_ENTER_NOAPI_NOINIT(H5Z_prelude_callback)
|
||||||
|
|
||||||
@ -529,7 +530,6 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty
|
|||||||
if(dcpl_pline.nused > 0) {
|
if(dcpl_pline.nused > 0) {
|
||||||
hsize_t chunk_dims[H5O_LAYOUT_NDIMS]; /* Size of chunk dimensions */
|
hsize_t chunk_dims[H5O_LAYOUT_NDIMS]; /* Size of chunk dimensions */
|
||||||
H5S_t *space; /* Dataspace describing chunk */
|
H5S_t *space; /* Dataspace describing chunk */
|
||||||
hid_t space_id; /* ID for dataspace describing chunk */
|
|
||||||
size_t u; /* Local index variable */
|
size_t u; /* Local index variable */
|
||||||
|
|
||||||
/* Create a data space for a chunk & set the extent */
|
/* Create a data space for a chunk & set the extent */
|
||||||
@ -572,10 +572,6 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty
|
|||||||
|
|
||||||
/* Check return value */
|
/* Check return value */
|
||||||
if(status <= 0) {
|
if(status <= 0) {
|
||||||
/* We're leaving, so close dataspace */
|
|
||||||
if(H5I_dec_ref(space_id, FALSE) < 0)
|
|
||||||
HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace")
|
|
||||||
|
|
||||||
/* Indicate filter can't apply to this combination of parameters */
|
/* Indicate filter can't apply to this combination of parameters */
|
||||||
if(status == 0)
|
if(status == 0)
|
||||||
HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "filter parameters not appropriate")
|
HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "filter parameters not appropriate")
|
||||||
@ -590,14 +586,9 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty
|
|||||||
/* Check if there is a "set local" callback */
|
/* Check if there is a "set local" callback */
|
||||||
if(fclass->set_local) {
|
if(fclass->set_local) {
|
||||||
/* Make callback to filter's "set local" function */
|
/* Make callback to filter's "set local" function */
|
||||||
if((fclass->set_local)(dcpl_id, type_id, space_id)<0) {
|
if((fclass->set_local)(dcpl_id, type_id, space_id) < 0)
|
||||||
/* We're leaving, so close dataspace */
|
|
||||||
if(H5I_dec_ref(space_id, FALSE)<0)
|
|
||||||
HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace")
|
|
||||||
|
|
||||||
/* Indicate error during filter callback */
|
/* Indicate error during filter callback */
|
||||||
HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback")
|
HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback")
|
||||||
} /* end if */
|
|
||||||
} /* end if */
|
} /* end if */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -606,15 +597,14 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty
|
|||||||
} /* end switch */
|
} /* end switch */
|
||||||
} /* end else */
|
} /* end else */
|
||||||
} /* end for */
|
} /* end for */
|
||||||
|
|
||||||
/* Close dataspace */
|
|
||||||
if(H5I_dec_ref(space_id, FALSE) < 0)
|
|
||||||
HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace")
|
|
||||||
} /* end if */
|
} /* end if */
|
||||||
} /* end if */
|
} /* end if */
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
if(space_id > 0 && H5I_dec_ref(space_id, FALSE) < 0)
|
||||||
|
HDONE_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace")
|
||||||
|
|
||||||
FUNC_LEAVE_NOAPI(ret_value)
|
FUNC_LEAVE_NOAPI(ret_value)
|
||||||
} /* end H5Z_prelude_callback() */
|
} /* end H5Z_prelude_callback() */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user