summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-10-21 16:33:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-10-21 16:33:13 (GMT)
commit22378dbd24c08d7153f4f295b5bca057191edc38 (patch)
treed2f910799f9e3de2d91ff361bbc513b8aa1d8223 /src/H5Pfapl.c
parent7a4110b291bb75f1778d8fb81e97aa1e0c026f7d (diff)
downloadhdf5-22378dbd24c08d7153f4f295b5bca057191edc38.zip
hdf5-22378dbd24c08d7153f4f295b5bca057191edc38.tar.gz
hdf5-22378dbd24c08d7153f4f295b5bca057191edc38.tar.bz2
[svn-r15921] Description:
Review and get code to conform to standard library coding style, also add 'const' keyword to "set" routines. Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (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/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.5.2 (amazon) in debug mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5Pfapl.c')
-rw-r--r--src/H5Pfapl.c91
1 files changed, 28 insertions, 63 deletions
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 7f7e58d..ced4df8 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -1455,56 +1455,39 @@ done:
* Programmer: J. Mainzer
* Thursday, July 31, 2008
*
- * Modifications:
- *
- * Done.
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_jnl_config(hid_t plist_id,
- H5AC2_jnl_config_t * config_ptr)
+H5Pset_jnl_config(hid_t plist_id, const H5AC2_jnl_config_t *config_ptr)
{
- H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* return value */
- FUNC_ENTER_API(H5Pset_jnl_config, FAIL);
+ FUNC_ENTER_API(H5Pset_jnl_config, FAIL)
H5TRACE2("e", "i*x", plist_id, config_ptr);
/* Get the plist structure */
- if( NULL == ( plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS) ) ) {
-
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- }
-
- /* validate the new configuration */
- if ( H5AC2_validate_jnl_config(config_ptr) < 0 ) {
-
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \
- "invalid journaling configuration");
- }
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
- /* set the modified config */
+ /* Validate the new configuration */
+ if(H5AC2_validate_jnl_config(config_ptr) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid journaling configuration")
- /* If we ever support multiple versions of H5AC_jnl_config_t, we
- * will have to test the version and do translation here.
+ /* Set the modified config */
+ /* (If we ever support multiple versions of H5AC_jnl_config_t, we
+ * will have to test the version and do translation here.)
*/
-
- if(H5P_set(plist, H5F_ACS_JNL_INIT_CONFIG_NAME, config_ptr)<0) {
-
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \
- "can't set initial journaling config");
- }
+ if(H5P_set(plist, H5F_ACS_JNL_INIT_CONFIG_NAME, config_ptr) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set initial journaling config")
done:
-
- FUNC_LEAVE_API(ret_value);
-
+ FUNC_LEAVE_API(ret_value)
} /* H5Pset_jnl_config() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_mdc_config
+ * Function: H5Pget_jnl_config
*
* Purpose: Retrieve the journaling initial configuration
* from the target FAPL.
@@ -1518,39 +1501,26 @@ done:
* Programmer: J. Mainzer
* Thursday, July 31, 2008
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
-
herr_t
-H5Pget_jnl_config(hid_t plist_id,
- H5AC2_jnl_config_t * config_ptr)
+H5Pget_jnl_config(hid_t plist_id, H5AC2_jnl_config_t *config_ptr)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
- FUNC_ENTER_API(H5Pget_jnl_config, FAIL);
+ FUNC_ENTER_API(H5Pget_jnl_config, FAIL)
H5TRACE2("e", "i*x", plist_id, config_ptr);
- /* Get the plist structure */
- if ( NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)) ) {
-
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- }
-
- /* validate the config_ptr */
- if ( config_ptr == NULL ) {
-
+ /* Validate the config_ptr */
+ if(NULL == config_ptr)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.")
- }
-
- if ( ! H5AC2_validate_jnl_config_ver(config_ptr->version) ) {
-
+ if(!H5AC2_validate_jnl_config_ver(config_ptr->version))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown config version.")
- }
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* If we ever support multiple versions of H5AC_jnl_config_t, we
* will have to get the cannonical version here, and then translate
@@ -1558,16 +1528,11 @@ H5Pget_jnl_config(hid_t plist_id,
*/
/* Get the current initial metadata cache resize configuration */
- if ( H5P_get(plist, H5F_ACS_JNL_INIT_CONFIG_NAME, config_ptr) < 0 ) {
-
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, \
- "can't get initial journaling config");
- }
+ if(H5P_get(plist, H5F_ACS_JNL_INIT_CONFIG_NAME, config_ptr) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get initial journaling config")
done:
-
- FUNC_LEAVE_API(ret_value);
-
+ FUNC_LEAVE_API(ret_value)
} /* H5Pget_jnl_config() */