summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-03-06 23:33:00 (GMT)
committerGitHub <noreply@github.com>2022-03-06 23:33:00 (GMT)
commit78375882485a99a81caa933928ed08d7a38ef88b (patch)
treef18c41d7794d546b6562dd2aa36932c78f00a16a /src/H5S.c
parent7e176db164d1a6f944e703c612c4952b15d333f4 (diff)
downloadhdf5-78375882485a99a81caa933928ed08d7a38ef88b.zip
hdf5-78375882485a99a81caa933928ed08d7a38ef88b.tar.gz
hdf5-78375882485a99a81caa933928ed08d7a38ef88b.tar.bz2
VFD SWMR: normalization with develop (#1472)
Much normalization with develop. Still needs tools changes wrt VFD plugins.
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c85
1 files changed, 19 insertions, 66 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 13d32cf..75d3399 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -55,9 +55,6 @@ static htri_t H5S__is_simple(const H5S_t *sdim);
/* Package Variables */
/*********************/
-/* Package initialization variable */
-hbool_t H5_PKG_INIT_VAR = FALSE;
-
/* Format version bounds for dataspace */
const unsigned H5O_sdspace_ver_bounds[] = {
H5O_SDSPACE_VERSION_1, /* H5F_LIBVER_EARLIEST */
@@ -96,9 +93,6 @@ static const H5I_class_t H5I_SPACE_SEL_ITER_CLS[1] = {{
(H5I_free_t)H5S__sel_iter_close_cb /* Callback routine for closing objects of this class */
}};
-/* Flag indicating "top" of interface has been initialized */
-static hbool_t H5S_top_package_initialize_s = FALSE;
-
/*-------------------------------------------------------------------------
* Function: H5S_init
*
@@ -114,44 +108,19 @@ H5S_init(void)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- /* FUNC_ENTER() does all the work */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_init() */
-
-/*--------------------------------------------------------------------------
-NAME
- H5S__init_package -- Initialize interface-specific information
-USAGE
- herr_t H5S__init_package()
-RETURNS
- Non-negative on success/Negative on failure
-DESCRIPTION
- Initializes any interface-specific data or routines.
---------------------------------------------------------------------------*/
-herr_t
-H5S__init_package(void)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
/* Initialize the ID group for the dataspace IDs */
if (H5I_register_type(H5I_DATASPACE_CLS) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize dataspace ID class")
- /* Initialize the ID group for the dataspace selction iterator IDs */
+ /* Initialize the ID group for the dataspace selection iterator IDs */
if (H5I_register_type(H5I_SPACE_SEL_ITER_CLS) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL,
"unable to initialize dataspace selection iterator ID class")
- /* Mark "top" of interface as initialized, too */
- H5S_top_package_initialize_s = TRUE;
-
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S__init_package() */
+} /* end H5S_init() */
/*--------------------------------------------------------------------------
NAME
@@ -178,21 +147,14 @@ H5S_top_term_package(void)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- if (H5S_top_package_initialize_s) {
- if (H5I_nmembers(H5I_DATASPACE) > 0) {
- (void)H5I_clear_type(H5I_DATASPACE, FALSE, FALSE);
- n++; /*H5I*/
- } /* end if */
-
- if (H5I_nmembers(H5I_SPACE_SEL_ITER) > 0) {
- (void)H5I_clear_type(H5I_SPACE_SEL_ITER, FALSE, FALSE);
- n++; /*H5I*/
- } /* end if */
-
- /* Mark "top" of interface as closed */
- if (0 == n)
- H5S_top_package_initialize_s = FALSE;
- } /* end if */
+ if (H5I_nmembers(H5I_DATASPACE) > 0) {
+ (void)H5I_clear_type(H5I_DATASPACE, FALSE, FALSE);
+ n++;
+ }
+ if (H5I_nmembers(H5I_SPACE_SEL_ITER) > 0) {
+ (void)H5I_clear_type(H5I_SPACE_SEL_ITER, FALSE, FALSE);
+ n++;
+ }
FUNC_LEAVE_NOAPI(n)
} /* end H5S_top_term_package() */
@@ -224,22 +186,15 @@ H5S_term_package(void)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- if (H5_PKG_INIT_VAR) {
- /* Sanity checks */
- HDassert(0 == H5I_nmembers(H5I_DATASPACE));
- HDassert(0 == H5I_nmembers(H5I_SPACE_SEL_ITER));
- HDassert(FALSE == H5S_top_package_initialize_s);
-
- /* Destroy the dataspace object id group */
- n += (H5I_dec_type_ref(H5I_DATASPACE) > 0);
+ /* Sanity checks */
+ HDassert(0 == H5I_nmembers(H5I_DATASPACE));
+ HDassert(0 == H5I_nmembers(H5I_SPACE_SEL_ITER));
- /* Destroy the dataspace selection iterator object id group */
- n += (H5I_dec_type_ref(H5I_SPACE_SEL_ITER) > 0);
+ /* Destroy the dataspace object id group */
+ n += (H5I_dec_type_ref(H5I_DATASPACE) > 0);
- /* Mark interface as closed */
- if (0 == n)
- H5_PKG_INIT_VAR = FALSE;
- } /* end if */
+ /* Destroy the dataspace selection iterator object id group */
+ n += (H5I_dec_type_ref(H5I_SPACE_SEL_ITER) > 0);
FUNC_LEAVE_NOAPI(n)
} /* end H5S_term_package() */
@@ -759,7 +714,7 @@ H5S_get_simple_extent_npoints(const H5S_t *ds)
{
hssize_t ret_value = -1; /* Return value */
- FUNC_ENTER_NOAPI(-1)
+ FUNC_ENTER_NOAPI_NOERR
/* check args */
HDassert(ds);
@@ -767,7 +722,6 @@ H5S_get_simple_extent_npoints(const H5S_t *ds)
/* Get the number of elements in extent */
ret_value = (hssize_t)ds->extent.nelem;
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_get_simple_extent_npoints() */
@@ -1740,13 +1694,12 @@ H5S_get_simple_extent_type(const H5S_t *space)
{
H5S_class_t ret_value = H5S_NO_CLASS; /* Return value */
- FUNC_ENTER_NOAPI(H5S_NO_CLASS)
+ FUNC_ENTER_NOAPI_NOERR
HDassert(space);
ret_value = H5S_GET_EXTENT_TYPE(space);
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_get_simple_extent_type() */