summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-08-12 13:33:42 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-08-12 13:33:42 (GMT)
commit5112232ddf96f7b8b7dca86ce91dc05f3470c682 (patch)
tree239a5e8982540789ec643ec2292a324e296409c8 /src/H5F.c
parent694e9bb380925e38a0711b803bf7dd86f219a07f (diff)
downloadhdf5-5112232ddf96f7b8b7dca86ce91dc05f3470c682.zip
hdf5-5112232ddf96f7b8b7dca86ce91dc05f3470c682.tar.gz
hdf5-5112232ddf96f7b8b7dca86ce91dc05f3470c682.tar.bz2
[svn-r5871] Purpose:
Code cleanup Description: Combined H5P_isa_class and H5I_object functionality into a new internal H5P API function: H5P_object_verify, which checks that a property list is the appropriate class and then returns the property list object associated with the property list ID. This reduces the source code by about 200 LOC and trims the library binary some more. Platforms tested: FreeBSD 4.6 (sleipnir)
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 2566b67..3afd64f 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -497,7 +497,7 @@ H5F_acs_create(hid_t fapl_id, void UNUSED *copy_data)
FUNC_ENTER_NOAPI(H5F_acs_create, FAIL);
/* Check argument */
- if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS) || NULL == (plist = H5I_object(fapl_id)))
+ if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
/* Retrieve properties */
@@ -552,7 +552,7 @@ H5F_acs_close(hid_t fapl_id, void UNUSED *close_data)
FUNC_ENTER_NOAPI(H5F_acs_close, FAIL);
/* Check argument */
- if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS) || NULL == (plist = H5I_object(fapl_id)))
+ if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
if(H5P_get(plist, H5F_ACS_FILE_DRV_ID_NAME, &driver_id) < 0)
@@ -1373,14 +1373,14 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id)
*/
if(H5P_DEFAULT == fcpl_id)
fcpl_id = H5P_FILE_CREATE_DEFAULT;
- if(TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE) || NULL == (plist = H5I_object(fcpl_id)))
+ if(NULL == (plist = H5P_object_verify(fcpl_id,H5P_FILE_CREATE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not property list");
f->shared->fcpl_id = H5P_copy_plist(plist);
if(H5P_DEFAULT == fapl_id)
fapl_id = H5P_FILE_ACCESS_DEFAULT;
- if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS) || NULL == (plist = H5I_object(fapl_id)))
+ if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list");
if(H5P_get(plist, H5F_ACS_META_CACHE_SIZE_NAME, &(f->shared->mdc_nelmts)) < 0)
@@ -1953,8 +1953,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
*/
if(H5P_DEFAULT == fapl_id)
fapl_id = H5P_FILE_ACCESS_DEFAULT;
- if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS) ||
- NULL == (a_plist = H5I_object(fapl_id)))
+ if(NULL == (a_plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list");
if(H5P_get(a_plist, H5F_CLOSE_DEGREE_NAME, &fc_degree) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file close degree");
@@ -2824,9 +2823,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child,
assert(loc);
assert(name && *name);
assert(child);
-
- if(TRUE != H5P_isa_class(plist_id, H5P_MOUNT))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property list");
+ assert(TRUE==H5P_isa_class(plist_id,H5P_MOUNT));
/*
* Check that the child isn't mounted, that the mount point exists, and