diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-08-12 13:33:42 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-08-12 13:33:42 (GMT) |
commit | 5112232ddf96f7b8b7dca86ce91dc05f3470c682 (patch) | |
tree | 239a5e8982540789ec643ec2292a324e296409c8 | |
parent | 694e9bb380925e38a0711b803bf7dd86f219a07f (diff) | |
download | hdf5-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)
-rw-r--r-- | src/H5D.c | 54 | ||||
-rw-r--r-- | src/H5Distore.c | 5 | ||||
-rw-r--r-- | src/H5Dseq.c | 2 | ||||
-rw-r--r-- | src/H5F.c | 15 | ||||
-rw-r--r-- | src/H5FD.c | 8 | ||||
-rw-r--r-- | src/H5FDcore.c | 4 | ||||
-rw-r--r-- | src/H5FDfamily.c | 6 | ||||
-rw-r--r-- | src/H5FDgass.c | 6 | ||||
-rw-r--r-- | src/H5FDlog.c | 6 | ||||
-rw-r--r-- | src/H5FDmpio.c | 14 | ||||
-rw-r--r-- | src/H5FDmpiposix.c | 6 | ||||
-rw-r--r-- | src/H5FDsec2.c | 2 | ||||
-rw-r--r-- | src/H5FDsrb.c | 6 | ||||
-rw-r--r-- | src/H5FDstream.c | 6 | ||||
-rw-r--r-- | src/H5Farray.c | 2 | ||||
-rw-r--r-- | src/H5Fistore.c | 5 | ||||
-rw-r--r-- | src/H5Fseq.c | 2 | ||||
-rw-r--r-- | src/H5P.c | 385 | ||||
-rw-r--r-- | src/H5Pprivate.h | 1 | ||||
-rw-r--r-- | src/H5Smpio.c | 1 | ||||
-rw-r--r-- | src/H5Sselect.c | 12 | ||||
-rw-r--r-- | src/H5Tvlen.c | 6 |
22 files changed, 183 insertions, 371 deletions
@@ -399,9 +399,9 @@ H5D_crt_copy(hid_t new_plist_id, hid_t old_plist_id, void UNUSED *copy_data) FUNC_ENTER_NOAPI(H5D_crt_copy, FAIL); /* Verify property list ID */ - if (TRUE!=H5P_isa_class(new_plist_id,H5P_DATASET_CREATE) || NULL == (new_plist = H5I_object(new_plist_id))) + if (NULL == (new_plist = H5P_object_verify(new_plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - if (TRUE!=H5P_isa_class(old_plist_id,H5P_DATASET_CREATE) || NULL == (old_plist = H5I_object(old_plist_id))) + if (NULL == (old_plist = H5P_object_verify(old_plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); /* Get the fill value, external file list, and data pipeline properties @@ -476,7 +476,7 @@ H5D_crt_close(hid_t dcpl_id, void UNUSED *close_data) FUNC_ENTER_NOAPI(H5D_crt_close, FAIL); /* Check arguments */ - if (TRUE!=H5P_isa_class(dcpl_id,H5P_DATASET_CREATE) || NULL == (plist = H5I_object(dcpl_id))) + if (NULL == (plist = H5P_object_verify(dcpl_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); /* Get the fill value, external file list, and data pipeline properties @@ -535,7 +535,7 @@ H5D_xfer_create(hid_t dxpl_id, void UNUSED *create_data) FUNC_ENTER_NOAPI(H5D_xfer_create, FAIL); /* Check arguments */ - if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(dxpl_id))) + if (NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); /* Get the driver information */ @@ -629,7 +629,7 @@ H5D_xfer_close(hid_t dxpl_id, void UNUSED *close_data) FUNC_ENTER_NOAPI(H5D_xfer_close, FAIL); /* Check arguments */ - if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(dxpl_id))) + if (NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0) @@ -712,7 +712,7 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); if(H5P_DEFAULT == plist_id) plist_id = H5P_DATASET_CREATE_DEFAULT; - if(H5I_GENPROP_LST != H5I_get_type(plist_id) || TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) + if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list"); /* build and open the new dataset */ @@ -1243,7 +1243,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if (H5P_DEFAULT == plist_id) plist_id= H5P_DATASET_XFER_DEFAULT; - if (H5I_GENPROP_LST != H5I_get_type(plist_id) || TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) + if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); if (!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer"); @@ -1256,6 +1256,7 @@ done: FUNC_LEAVE(ret_value); } + /*------------------------------------------------------------------------- * Function: H5Dwrite * @@ -1333,7 +1334,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if (H5P_DEFAULT == plist_id) plist_id= H5P_DATASET_XFER_DEFAULT; - if (H5I_GENPROP_LST != H5I_get_type(plist_id) || TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) + if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); if (!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer"); @@ -1414,30 +1415,32 @@ H5D_t * H5D_new(hid_t dcpl_id) { H5P_genplist_t *plist; /* Property list created */ - H5D_t *ret_value = NULL; /*return value */ + H5D_t *new_dset = NULL; /* New dataset object */ + H5D_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5D_new, NULL); - /* check args */ - /* Nothing to check */ - - if (NULL==(ret_value = H5FL_ALLOC(H5D_t,1))) + if (NULL==(new_dset = H5FL_ALLOC(H5D_t,1))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); if(H5P_DEFAULT == dcpl_id) dcpl_id = H5P_DATASET_CREATE_DEFAULT; - if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not property list"); - /* Check arguments. */ - if (NULL == (plist = H5I_object(dcpl_id))) + /* Get the property list */ + if (NULL == (plist = H5P_object_verify(dcpl_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list"); - ret_value->dcpl_id = H5P_copy_plist(plist); - ret_value->ent.header = HADDR_UNDEF; + new_dset->dcpl_id = H5P_copy_plist(plist); + new_dset->ent.header = HADDR_UNDEF; - /* Success */ + /* Set return value */ + ret_value=new_dset; done: + if(ret_value==NULL) { + if(new_dset!=NULL) + H5FL_FREE(H5D_t,new_dset); + } /* end if */ + FUNC_LEAVE(ret_value); } @@ -1520,10 +1523,9 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, assert (name && *name); assert (type); assert (space); - assert (TRUE==H5P_isa_class(dcpl_id,H5P_DATASET_CREATE)); /* Get property list object */ - if (NULL == (plist = H5I_object(dcpl_id))) + if (NULL == (plist = H5P_object_verify(dcpl_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "can't get dataset creation property list"); if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &dcpl_pline) < 0) @@ -2239,8 +2241,6 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, assert(dataset && dataset->ent.file); assert(mem_type); assert(buf); - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); - assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); /* Initialize these before any errors can occur */ HDmemset(&mem_iter,0,sizeof(H5S_sel_iter_t)); @@ -2252,7 +2252,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); /* Get the dataset transfer property list */ - if (NULL == (dx_plist = H5I_object_verify(dxpl_id,H5I_GENPROP_LST))) + if (NULL == (dx_plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); if (!file_space) { @@ -2653,8 +2653,6 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, assert(dataset && dataset->ent.file); assert(mem_type); assert(buf); - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); - assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); /* Initialize these before any errors can occur */ HDmemset(&mem_iter,0,sizeof(H5S_sel_iter_t)); @@ -2666,7 +2664,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); /* Get the dataset transfer property list */ - if (NULL == (dx_plist = H5I_object_verify(dxpl_id,H5I_GENPROP_LST))) + if (NULL == (dx_plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); #ifdef H5_HAVE_PARALLEL diff --git a/src/H5Distore.c b/src/H5Distore.c index ffcabf3..2c6a403 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -1461,7 +1461,6 @@ H5F_istore_lock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, ent->wr_count = chunk_size; ent->chunk = chunk; - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); plist=H5I_object(dxpl_id); assert(plist!=NULL); @@ -1609,7 +1608,6 @@ H5F_istore_unlock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, x.alloc_size = x.chunk_size; x.chunk = chunk; - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); plist=H5I_object(dxpl_id); assert(plist!=NULL); @@ -2354,7 +2352,6 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, assert(layout && H5D_CHUNKED==layout->type); assert(layout->ndims>0 && layout->ndims<=H5O_LAYOUT_NDIMS); assert(H5F_addr_defined(layout->addr)); - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); assert(dc_plist!=NULL); @@ -2367,7 +2364,7 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve fill time"); /* Get necessary properties from dataset transfer property list */ - if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (dx_plist = H5I_object(dxpl_id))) + if (NULL == (dx_plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if(H5P_get(dx_plist,H5D_XFER_BTREE_SPLIT_RATIO_NAME,split_ratios)<0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "can't get B-tree split ratios"); diff --git a/src/H5Dseq.c b/src/H5Dseq.c index ce11c8d..a3f2941 100644 --- a/src/H5Dseq.c +++ b/src/H5Dseq.c @@ -184,7 +184,6 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, assert(layout); assert(real_buf); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); #ifdef H5_HAVE_PARALLEL @@ -569,7 +568,6 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, assert(layout); assert(real_buf); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); #ifdef H5_HAVE_PARALLEL @@ -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 @@ -773,7 +773,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) /* Check arguments */ 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 a file access property list"); if (0==maxaddr) @@ -2166,8 +2166,7 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id= H5P_DATASET_XFER_DEFAULT; - if (H5I_GENPROP_LST != H5I_get_type(dxpl_id) || - TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER)) + if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); if (!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null result buffer"); @@ -2394,8 +2393,7 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id= H5P_DATASET_XFER_DEFAULT; - if (H5I_GENPROP_LST != H5I_get_type(dxpl_id) || - TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER)) + if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); if (!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null buffer"); diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 9298587..f15120d 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -193,7 +193,7 @@ H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store) H5TRACE3("e","izb",fapl_id,increment,backing_store); /* 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 file access property list"); fa.increment = increment; @@ -239,7 +239,7 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment/*out*/, FUNC_ENTER_API(H5Pget_fapl_core, FAIL); H5TRACE3("e","ixx",fapl_id,increment,backing_store); - 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 file access property list"); if (H5FD_CORE!=H5P_get_driver(plist)) diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index b1d445f..a71fd64 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -244,7 +244,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *memb_size/*out*/, FUNC_ENTER_API(H5Pget_fapl_family, FAIL); H5TRACE3("e","ixx",fapl_id,memb_size,memb_fapl_id); - 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 file access list"); if (H5FD_FAMILY!=H5P_get_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -936,7 +936,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si if (H5P_DEFAULT!=dxpl_id && H5FD_FAMILY==H5P_get_driver(plist)) { H5FD_family_dxpl_t *dx = H5P_get_driver_info(plist); - assert(H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); + assert(TRUE==H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); assert(dx); memb_dxpl_id = dx->memb_dxpl_id; } @@ -1013,7 +1013,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s if (H5P_DEFAULT!=dxpl_id && H5FD_FAMILY==H5P_get_driver(plist)) { H5FD_family_dxpl_t *dx = H5P_get_driver_info(plist); - assert(H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); + assert(TRUE==H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); assert(dx); memb_dxpl_id = dx->memb_dxpl_id; } diff --git a/src/H5FDgass.c b/src/H5FDgass.c index 9a5d4b7..6f761a7 100644 --- a/src/H5FDgass.c +++ b/src/H5FDgass.c @@ -241,7 +241,7 @@ H5Pset_fapl_gass(hid_t fapl_id, GASS_Info info) /*NO TRACE*/ /* Check arguments */ - 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"); #ifdef LATER @@ -293,7 +293,7 @@ H5Pget_fapl_gass(hid_t fapl_id, GASS_Info *info/*out*/) FUNC_ENTER_API(H5Pget_fapl_gass, FAIL); H5TRACE2("e","ix",fapl_id,info); - 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 file access property list"); if (H5FD_GASS!=H5P_get_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -359,7 +359,7 @@ H5FD_gass_open(const char *name, unsigned flags, hid_t fapl_id, strcpy (filename, name); /* Obtain a pointer to gass-specific file access properties */ - 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 a file access property list"); if (H5P_DEFAULT==fapl_id || H5FD_GASS!=H5P_get_driver(plist)) { GASS_INFO_NULL (_fa.info); diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 53eb186..381f8d0 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -290,7 +290,7 @@ H5Pset_fapl_log(hid_t fapl_id, char *logfile, int verbosity) FUNC_ENTER_API(H5Pset_fapl_log, FAIL); H5TRACE3("e","isIs",fapl_id,logfile,verbosity); - 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 file access property list"); fa.logfile=logfile; @@ -337,7 +337,7 @@ H5Pset_fapl_log(hid_t fapl_id, char *logfile, unsigned flags, size_t buf_size) FUNC_ENTER_API(H5Pset_fapl_log, FAIL); H5TRACE4("e","isIuz",fapl_id,logfile,flags,buf_size); - 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 file access property list"); fa.logfile=logfile; @@ -525,7 +525,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct"); /* Get the driver specific information */ - 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 a file access property list"); fa = H5P_get_driver_info(plist); diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index cf23ed4..25f530e 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -254,7 +254,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info) H5TRACE3("e","iMcMi",fapl_id,comm,info); /* Check arguments */ - 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_PLIST, H5E_BADTYPE, FAIL, "not a file access list"); #ifdef LATER @@ -315,7 +315,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/) FUNC_ENTER_API(H5Pget_fapl_mpio, FAIL); H5TRACE3("e","ixx",fapl_id,comm,info); - 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_PLIST, H5E_BADTYPE, FAIL, "not a file access list"); if (H5FD_MPIO!=H5P_get_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -369,7 +369,7 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode) H5TRACE2("e","iDt",dxpl_id,xfer_mode); /* Check arguments */ - if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(dxpl_id))) + if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); if (H5FD_MPIO_INDEPENDENT!=xfer_mode && H5FD_MPIO_COLLECTIVE!=xfer_mode) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incorrect xfer_mode"); @@ -414,7 +414,7 @@ H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode/*out*/) FUNC_ENTER_API(H5Pget_dxpl_mpio, FAIL); H5TRACE2("e","ix",dxpl_id,xfer_mode); - if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(dxpl_id))) + if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); if (H5FD_MPIO!=H5P_get_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -566,7 +566,7 @@ H5FD_mpio_setup(hid_t dxpl_id, MPI_Datatype btype, MPI_Datatype ftype, unsigned FUNC_ENTER_NOAPI(H5FD_mpio_setup, FAIL); /* Check arguments */ - if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(dxpl_id))) + if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list"); /* Set buffer MPI type */ @@ -610,7 +610,7 @@ H5FD_mpio_teardown(hid_t dxpl_id) FUNC_ENTER_NOAPI(H5FD_mpio_teardown, FAIL); /* Check arguments */ - if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(dxpl_id))) + if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list"); /* Remove buffer MPI type */ @@ -844,7 +844,7 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, #endif /* Obtain a pointer to mpio-specific file access properties */ - 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 a file access property list"); if (H5P_DEFAULT==fapl_id || H5FD_MPIO!=H5P_get_driver(plist)) { _fa.comm = MPI_COMM_SELF; /*default*/ diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index 2d35944..4a37775 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -291,7 +291,7 @@ H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm) H5TRACE2("e","iMc",fapl_id,comm); /* Check arguments */ - 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_PLIST, H5E_BADTYPE, FAIL, "not a file access list"); #ifdef LATER #warning "We need to verify that COMM contains sensible information." @@ -340,7 +340,7 @@ H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/) FUNC_ENTER_API(H5Pget_fapl_mpiposix, FAIL); H5TRACE2("e","ix",fapl_id,comm); - 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_PLIST, H5E_BADTYPE, FAIL, "not a file access list"); if (H5FD_MPIPOSIX!=H5P_get_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -555,7 +555,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr"); /* Obtain a pointer to mpiposix-specific file access properties */ - 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 a file access property list"); if (H5P_DEFAULT==fapl_id || H5FD_MPIPOSIX!=H5P_get_driver(plist)) { _fa.comm = MPI_COMM_SELF; /*default*/ diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 246e486..4e2b1e2 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -242,7 +242,7 @@ H5Pset_fapl_sec2(hid_t fapl_id) FUNC_ENTER_API(H5Pset_fapl_sec2, FAIL); H5TRACE1("e","i",fapl_id); - 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 file access property list"); ret_value= H5P_set_driver(plist, H5FD_SEC2, NULL); diff --git a/src/H5FDsrb.c b/src/H5FDsrb.c index 7408c5b..4dde148 100644 --- a/src/H5FDsrb.c +++ b/src/H5FDsrb.c @@ -210,7 +210,7 @@ H5Pset_fapl_srb(hid_t fapl_id, SRB_Info info) FUNC_ENTER_API(H5Pset_fapl_srb, FAIL); /*NO TRACE*/ - 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 file access property list"); /*connect to SRB server */ @@ -261,7 +261,7 @@ H5Pget_fapl_srb(hid_t fapl_id, SRB_Info *info/*out*/) FUNC_ENTER_API(H5Pget_fapl_srb, FAIL); H5TRACE2("e","ix",fapl_id,info); - 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 file access property list"); if(H5FD_SRB != H5P_get_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -316,7 +316,7 @@ H5FD_srb_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) if (ADDR_OVERFLOW(maxaddr)) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr"); - 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 a file access property list"); if(H5P_DEFAULT==fapl_id || H5FD_SRB!=H5P_get_driver(plist)) { HDmemset((void*)&_fa, 0, sizeof(H5FD_srb_fapl_t)); diff --git a/src/H5FDstream.c b/src/H5FDstream.c index 31f278d..2883d13 100644 --- a/src/H5FDstream.c +++ b/src/H5FDstream.c @@ -272,7 +272,7 @@ herr_t H5Pset_fapl_stream (hid_t fapl_id, H5FD_stream_fapl_t *fapl) FUNC_ENTER_API(H5Pset_fapl_stream, FAIL); H5TRACE2 ("e", "ix", fapl_id, fapl); - 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_PLIST, H5E_BADTYPE, FAIL, "not a fapl"); if (fapl) { @@ -317,7 +317,7 @@ herr_t H5Pget_fapl_stream(hid_t fapl_id, H5FD_stream_fapl_t *fapl /* out */) FUNC_ENTER_API(H5Pget_fapl_stream, FAIL); H5TRACE2("e","ix",fapl_id,fapl); - 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_PLIST, H5E_BADTYPE, FAIL, "not a fapl"); if (H5FD_STREAM != H5P_get_driver (plist)) HGOTO_ERROR (H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -593,7 +593,7 @@ H5FD_stream_open (const char *filename, fapl = NULL; if (H5P_DEFAULT != fapl_id) { - 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 a file access property list"); fapl = H5P_get_driver_info (plist); } diff --git a/src/H5Farray.c b/src/H5Farray.c index d2f84be..1e389f4 100644 --- a/src/H5Farray.c +++ b/src/H5Farray.c @@ -163,7 +163,6 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, assert(mem_size); assert(buf); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); /* Make a local copy of size so we can modify it */ @@ -406,7 +405,6 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, assert(mem_size); assert(buf); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); /* Make a local copy of _size so we can modify it */ diff --git a/src/H5Fistore.c b/src/H5Fistore.c index ffcabf3..2c6a403 100644 --- a/src/H5Fistore.c +++ b/src/H5Fistore.c @@ -1461,7 +1461,6 @@ H5F_istore_lock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, ent->wr_count = chunk_size; ent->chunk = chunk; - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); plist=H5I_object(dxpl_id); assert(plist!=NULL); @@ -1609,7 +1608,6 @@ H5F_istore_unlock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, x.alloc_size = x.chunk_size; x.chunk = chunk; - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); plist=H5I_object(dxpl_id); assert(plist!=NULL); @@ -2354,7 +2352,6 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, assert(layout && H5D_CHUNKED==layout->type); assert(layout->ndims>0 && layout->ndims<=H5O_LAYOUT_NDIMS); assert(H5F_addr_defined(layout->addr)); - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); assert(dc_plist!=NULL); @@ -2367,7 +2364,7 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve fill time"); /* Get necessary properties from dataset transfer property list */ - if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (dx_plist = H5I_object(dxpl_id))) + if (NULL == (dx_plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if(H5P_get(dx_plist,H5D_XFER_BTREE_SPLIT_RATIO_NAME,split_ratios)<0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "can't get B-tree split ratios"); diff --git a/src/H5Fseq.c b/src/H5Fseq.c index ce11c8d..a3f2941 100644 --- a/src/H5Fseq.c +++ b/src/H5Fseq.c @@ -184,7 +184,6 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, assert(layout); assert(real_buf); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); #ifdef H5_HAVE_PARALLEL @@ -569,7 +568,6 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, assert(layout); assert(real_buf); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); #ifdef H5_HAVE_PARALLEL @@ -619,12 +619,8 @@ H5Pget_version(hid_t plist_id, int *boot/*out*/, int *freelist/*out*/, FUNC_ENTER_API(H5Pget_version, FAIL); H5TRACE5("e","ixxxx",plist_id,boot,freelist,stab,shhdr); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -674,10 +670,6 @@ H5Pset_userblock(hid_t plist_id, hsize_t size) FUNC_ENTER_API(H5Pset_userblock, FAIL); H5TRACE2("e","ih",plist_id,size); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Check that the userblock size is a power of two */ for (i=8; i<8*sizeof(hsize_t); i++) { hsize_t p2 = 8==i ? 0 : ((hsize_t)1<<i); @@ -689,7 +681,7 @@ H5Pset_userblock(hid_t plist_id, hsize_t size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "userblock size is not valid"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set value */ @@ -730,12 +722,8 @@ H5Pget_userblock(hid_t plist_id, hsize_t *size) FUNC_ENTER_API(H5Pget_userblock, FAIL); H5TRACE2("e","i*h",plist_id,size); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get value */ @@ -788,13 +776,11 @@ H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignment) H5TRACE3("e","ihh",fapl_id,threshold,alignment); /* Check args */ - if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (alignment<1) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "alignment must be positive"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(fapl_id))) + if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set values */ @@ -839,12 +825,8 @@ H5Pget_alignment(hid_t fapl_id, hsize_t *threshold/*out*/, FUNC_ENTER_API(H5Pget_alignment, FAIL); H5TRACE3("e","ixx",fapl_id,threshold,alignment); - /* Check args */ - if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(fapl_id))) + if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -886,9 +868,6 @@ H5Pset_sizes(hid_t plist_id, size_t sizeof_addr, size_t sizeof_size) H5TRACE3("e","izz",plist_id,sizeof_addr,sizeof_size); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - if (sizeof_addr) { if (sizeof_addr != 2 && sizeof_addr != 4 && sizeof_addr != 8 && sizeof_addr != 16) @@ -901,7 +880,7 @@ H5Pset_sizes(hid_t plist_id, size_t sizeof_addr, size_t sizeof_size) } /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set value */ @@ -945,12 +924,8 @@ H5Pget_sizes(hid_t plist_id, FUNC_ENTER_API(H5Pget_sizes, FAIL); H5TRACE3("e","ixx",plist_id,sizeof_addr,sizeof_size); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -1007,12 +982,8 @@ H5Pset_sym_k(hid_t plist_id, int ik, int lk) FUNC_ENTER_API(H5Pset_sym_k, FAIL); H5TRACE3("e","iIsIs",plist_id,ik,lk); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set values */ @@ -1062,12 +1033,8 @@ H5Pget_sym_k(hid_t plist_id, int *ik /*out */ , int *lk /*out */ ) FUNC_ENTER_API(H5Pget_sym_k, FAIL); H5TRACE3("e","ixx",plist_id,ik,lk); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -1125,12 +1092,8 @@ H5Pset_sym_k(hid_t plist_id, int ik, unsigned lk) FUNC_ENTER_API(H5Pset_sym_k, FAIL); H5TRACE3("e","iIsIu",plist_id,ik,lk); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set values */ @@ -1180,12 +1143,8 @@ H5Pget_sym_k(hid_t plist_id, int *ik /*out */ , unsigned *lk /*out */ ) FUNC_ENTER_API(H5Pget_sym_k, FAIL); H5TRACE3("e","ixx",plist_id,ik,lk); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -1234,13 +1193,11 @@ H5Pset_istore_k(hid_t plist_id, int ik) H5TRACE2("e","iIs",plist_id,ik); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); if (ik <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "istore IK value must be positive"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set value */ @@ -1286,12 +1243,8 @@ H5Pget_istore_k(hid_t plist_id, int *ik /*out */ ) FUNC_ENTER_API(H5Pget_istore_k, FAIL); H5TRACE2("e","ix",plist_id,ik); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get value */ @@ -1335,13 +1288,11 @@ H5Pset_layout(hid_t plist_id, H5D_layout_t layout) H5TRACE2("e","iDl",plist_id,layout); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); if (layout < 0 || layout >= H5D_NLAYOUTS) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "raw data layout method is not valid"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set value */ @@ -1383,12 +1334,8 @@ H5Pget_layout(hid_t plist_id) FUNC_ENTER_API(H5Pget_layout, H5D_LAYOUT_ERROR); H5TRACE1("Dl","i",plist_id); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5D_LAYOUT_ERROR, "not a dataset creation property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5D_LAYOUT_ERROR, "can't find object for ID"); /* Get value */ @@ -1437,8 +1384,6 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) H5TRACE3("e","iIs*[a1]h",plist_id,ndims,dim); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); if (ndims <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "chunk dimensionality must be positive"); if (ndims > H5S_MAX_RANK) @@ -1447,7 +1392,7 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no chunk dimensions specified"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Initialize chunk dims to 0s */ @@ -1508,12 +1453,8 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) FUNC_ENTER_API(H5Pget_chunk, FAIL); H5TRACE3("Is","iIsx",plist_id,max_ndims,dim); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); if(H5P_get(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) @@ -1581,8 +1522,6 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) H5TRACE4("e","isoh",plist_id,name,offset,size); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); if (!name || !*name) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no name given"); if (offset<0) @@ -1591,7 +1530,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "zero size"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) @@ -1664,12 +1603,8 @@ H5Pget_external_count(hid_t plist_id) FUNC_ENTER_API(H5Pget_external_count, FAIL); H5TRACE1("Is","i",plist_id); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get value */ @@ -1726,12 +1661,8 @@ H5Pget_external(hid_t plist_id, int idx, size_t name_size, char *name/*out*/, FUNC_ENTER_API(H5Pget_external, FAIL); H5TRACE6("e","iIszxxx",plist_id,idx,name_size,name,offset,size); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get value */ @@ -2149,15 +2080,13 @@ H5Pset_cache(hid_t plist_id, int mdc_nelmts, rdcc_w0); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS) ) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (mdc_nelmts<0) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "meta data cache size must be non-negative"); if (rdcc_w0<0.0 || rdcc_w0>1.0) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "raw data cache w0 value must be between 0.0 and 1.0 inclusive"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + 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 sizes */ @@ -2210,12 +2139,8 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, H5TRACE5("e","i*Is*Is*z*d",plist_id,mdc_nelmts,_rdcc_nelmts,rdcc_nbytes, rdcc_w0); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get sizes */ @@ -2279,15 +2204,13 @@ H5Pset_cache(hid_t plist_id, int mdc_nelmts, H5TRACE5("e","iIszzd",plist_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS) ) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (mdc_nelmts<0) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "meta data cache size must be non-negative"); if (rdcc_w0<0.0 || rdcc_w0>1.0) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "raw data cache w0 value must be between 0.0 and 1.0 inclusive"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + 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 sizes */ @@ -2339,12 +2262,8 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, H5TRACE5("e","i*Is*z*z*d",plist_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes, rdcc_w0); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get sizes */ @@ -2402,13 +2321,11 @@ H5Pset_buffer(hid_t plist_id, hsize_t _size, void *tconv, void *bkg) H5TRACE4("e","ihxx",plist_id,_size,tconv,bkg); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if (size<=0) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "buffer size must not be zero"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Update property list */ @@ -2450,12 +2367,8 @@ H5Pget_buffer(hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/) FUNC_ENTER_API(H5Pget_buffer, 0); H5TRACE3("h","ixx",plist_id,tconv,bkg); - /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, 0, "not a dataset transfer property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, 0, "can't find object for ID"); /* Return values */ @@ -2512,13 +2425,11 @@ H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg) H5TRACE4("e","izxx",plist_id,size,tconv,bkg); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if (size<=0) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "buffer size must not be zero"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Update property list */ @@ -2560,12 +2471,8 @@ H5Pget_buffer(hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/) FUNC_ENTER_API(H5Pget_buffer, 0); H5TRACE3("z","ixx",plist_id,tconv,bkg); - /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, 0, "not a dataset transfer property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, 0, "can't find object for ID"); /* Return values */ @@ -2623,12 +2530,8 @@ H5Pset_hyper_cache(hid_t plist_id, unsigned cache, unsigned limit) FUNC_ENTER_API(H5Pset_hyper_cache, FAIL); H5TRACE3("e","iIuIu",plist_id,cache,limit); - /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset tranxfer property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Update property list */ @@ -2667,12 +2570,8 @@ H5Pget_hyper_cache(hid_t plist_id, unsigned *cache/*out*/, FUNC_ENTER_API(H5Pget_hyper_cache, FAIL); H5TRACE3("e","ixx",plist_id,cache,limit); - /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Return values */ @@ -2717,12 +2616,8 @@ H5Pset_preserve(hid_t plist_id, hbool_t status) FUNC_ENTER_API(H5Pset_preserve, FAIL); H5TRACE2("e","ib",plist_id,status); - /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Update property list */ @@ -2761,12 +2656,8 @@ H5Pget_preserve(hid_t plist_id) FUNC_ENTER_API(H5Pget_preserve, FAIL); H5TRACE1("Is","i",plist_id); - /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get value */ @@ -2833,12 +2724,8 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, FUNC_ENTER_API(H5Pset_filter, FAIL); H5TRACE5("e","iZfIuz*[a3]Iu",plist_id,filter,flags,cd_nelmts,cd_values); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) @@ -2896,12 +2783,8 @@ H5Pget_nfilters(hid_t plist_id) FUNC_ENTER_API(H5Pget_nfilters, FAIL); H5TRACE1("Is","i",plist_id); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get value */ @@ -2960,12 +2843,8 @@ H5Pget_filter(hid_t plist_id, int idx, unsigned int *flags/*out*/, H5TRACE7("Zf","iIsx*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen, name); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, H5Z_FILTER_ERROR, "not a dataset creation property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5Z_FILTER_ERROR, "can't find object for ID"); /* Get pipeline info */ @@ -3063,13 +2942,11 @@ H5Pset_deflate(hid_t plist_id, unsigned level) H5TRACE2("e","iIu",plist_id,level); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); if (level>9) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid deflate level"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Add the filter */ @@ -3113,12 +2990,8 @@ H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/, double *middle/*out*/, FUNC_ENTER_API(H5Pget_btree_ratios, FAIL); H5TRACE4("e","ixxx",plist_id,left,middle,right); - /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get the split ratios */ @@ -3172,14 +3045,12 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, H5TRACE4("e","iddd",plist_id,left,middle,right); /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if (left<0.0 || left>1.0 || middle<0.0 || middle>1.0 || right<0.0 || right>1.0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set values */ @@ -3232,12 +3103,8 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) FUNC_ENTER_API(H5Pset_fill_value, FAIL); H5TRACE3("e","iix",plist_id,type_id,value); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get the "basic" fill value structure */ @@ -3311,15 +3178,13 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) H5TRACE3("e","iix",plist_id,type_id,value); /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation proprety list"); if (NULL==(type=H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); if (!value) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,"no fill value output buffer"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* @@ -3458,12 +3323,8 @@ H5Pfill_value_defined(hid_t plist_id, H5D_fill_value_t *status) assert(status); - /* Check arguments */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation proprety list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Call the internal function */ @@ -3500,12 +3361,8 @@ H5Pset_space_time(hid_t plist_id, H5D_space_time_t alloc_time) FUNC_ENTER_API(H5Pset_space_time, FAIL); H5TRACE2("e","iDs",plist_id,alloc_time); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - /* Get the property list structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set values */ @@ -3542,12 +3399,8 @@ H5Pget_space_time(hid_t plist_id, H5D_space_time_t *alloc_time/*out*/) FUNC_ENTER_API(H5Pget_space_time, FAIL); H5TRACE2("e","ix",plist_id,alloc_time); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - /* Get the property list structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -3583,12 +3436,8 @@ H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time) FUNC_ENTER_API(H5Pset_fill_time, FAIL); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - /* Get the property list structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set values */ @@ -3624,12 +3473,8 @@ H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time/*out*/) FUNC_ENTER_API(H5Pget_fill_time, FAIL); H5TRACE2("e","ix",plist_id,fill_time); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - /* Get the property list structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set values */ @@ -3682,12 +3527,8 @@ H5Pset_gc_references(hid_t plist_id, unsigned gc_ref) FUNC_ENTER_API(H5Pset_gc_references, FAIL); H5TRACE2("e","iIu",plist_id,gc_ref); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + 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 values */ @@ -3728,12 +3569,8 @@ H5Pget_gc_references(hid_t plist_id, unsigned *gc_ref/*out*/) FUNC_ENTER_API(H5Pget_gc_references, FAIL); H5TRACE2("e","ix",plist_id,gc_ref); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -3769,12 +3606,8 @@ H5Pset_fclose_degree(hid_t plist_id, H5F_close_degree_t degree) FUNC_ENTER_API(H5Pset_fclose_degree, FAIL); H5TRACE2("e","iFc",plist_id,degree); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + 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 values */ @@ -3807,12 +3640,8 @@ herr_t H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree) FUNC_ENTER_API(H5Pget_fclose_degree, FAIL); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + 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( degree && (H5P_get(plist, H5F_CLOSE_DEGREE_NAME, degree) < 0) ) @@ -3901,7 +3730,7 @@ H5Pset_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t alloc_func, H5TRACE5("e","ixxxx",plist_id,alloc_func,alloc_info,free_func,free_info); /* Check arguments */ - if(TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); /* Update property list */ @@ -3939,12 +3768,8 @@ H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func/*out*/, FUNC_ENTER_API(H5Pget_vlen_mem_manager, FAIL); H5TRACE5("e","ixxxx",plist_id,alloc_func,alloc_info,free_func,free_info); - /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); if(alloc_func!=NULL) @@ -4003,12 +3828,8 @@ H5Pset_meta_block_size(hid_t plist_id, hsize_t size) FUNC_ENTER_API(H5Pset_meta_block_size, FAIL); H5TRACE2("e","ih",plist_id,size); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + 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 values */ @@ -4049,12 +3870,8 @@ H5Pget_meta_block_size(hid_t plist_id, hsize_t *size/*out*/) FUNC_ENTER_API(H5Pget_meta_block_size, FAIL); H5TRACE2("e","ix",plist_id,size); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -4108,12 +3925,8 @@ H5Pset_sieve_buf_size(hid_t plist_id, hsize_t _size) FUNC_ENTER_API(H5Pset_sieve_buf_size, FAIL); H5TRACE2("e","ih",plist_id,_size); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + 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 values */ @@ -4155,12 +3968,8 @@ H5Pget_sieve_buf_size(hid_t plist_id, hsize_t *_size/*out*/) FUNC_ENTER_API(H5Pget_sieve_buf_size, FAIL); H5TRACE2("e","ix",plist_id,_size); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -4213,12 +4022,8 @@ H5Pset_sieve_buf_size(hid_t plist_id, size_t size) FUNC_ENTER_API(H5Pset_sieve_buf_size, FAIL); H5TRACE2("e","iz",plist_id,size); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + 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 values */ @@ -4259,12 +4064,8 @@ H5Pget_sieve_buf_size(hid_t plist_id, size_t *size/*out*/) FUNC_ENTER_API(H5Pget_sieve_buf_size, FAIL); H5TRACE2("e","ix",plist_id,size); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -4311,13 +4112,11 @@ H5Pset_hyper_vector_size(hid_t plist_id, size_t vector_size) H5TRACE2("e","iz",plist_id,vector_size); /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if (vector_size<1) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "vector size too small"); /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Update property list */ @@ -4352,12 +4151,8 @@ H5Pget_hyper_vector_size(hid_t plist_id, size_t *vector_size/*out*/) FUNC_ENTER_API(H5Pget_hyper_vector_size, FAIL); H5TRACE2("e","ix",plist_id,vector_size); - /* Check arguments */ - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Return values */ @@ -4403,12 +4198,8 @@ H5Pset_small_data_block_size(hid_t plist_id, hsize_t size) FUNC_ENTER_API(H5Pset_small_data_block_size, FAIL); H5TRACE2("e","ih",plist_id,size); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + 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 values */ @@ -4444,12 +4235,8 @@ H5Pget_small_data_block_size(hid_t plist_id, hsize_t *size/*out*/) FUNC_ENTER_API(H5Pget_small_data_block_size, FAIL); H5TRACE2("e","ix",plist_id,size); - /* Check args */ - if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); - /* Get the plist structure */ - if(NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ @@ -7027,9 +6814,6 @@ done: GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS - What about returning a value indicating that the property class is further - up the class hierarchy? - This function is special in that it is an internal library function, but accepts hid_t's as parameters. Since it is used in basically the same way as the H5I functions, this should be OK. Don't make more library functions @@ -7106,6 +6890,53 @@ done: /*-------------------------------------------------------------------------- NAME + H5P_object_verify + PURPOSE + Internal routine to query whether a property list is a certain class and + retrieve the property list object associated with it. + USAGE + void *H5P_object_verify(plist_id, pclass_id) + hid_t plist_id; IN: Property list to query + hid_t pclass_id; IN: Property class to query + RETURNS + Success: valid pointer to a property list object + Failure: NULL + DESCRIPTION + This routine queries whether a property list is member of a certain class + and retrieves the property list object associated with it. + + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + This function is special in that it is an internal library function, but + accepts hid_t's as parameters. Since it is used in basically the same way + as the H5I functions, this should be OK. Don't make more library functions + which accept hid_t's without thorough discussion. -QAK + + This function is similar (in spirit) to H5I_object_verify() + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +void *H5P_object_verify(hid_t plist_id, hid_t pclass_id) +{ + void *ret_value; /* return value */ + + FUNC_ENTER_NOAPI(H5P_object_verify, NULL); + + /* Compare the property list's class against the other class */ + if (H5P_isa_class(plist_id,pclass_id)!=TRUE) + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, NULL, "property list is not a member of the class"); + + /* Get the plist structure */ + if(NULL == (ret_value = H5I_object(plist_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID"); + +done: + FUNC_LEAVE (ret_value); +} /* H5P_object_verify() */ + + +/*-------------------------------------------------------------------------- + NAME H5P_iterate_props PURPOSE Internal routine to iterate over a hashtable of properties diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 083e383..fc0d64f 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -57,6 +57,7 @@ __DLL__ herr_t H5P_fill_value_defined(H5P_genplist_t *plist, /* *SPECIAL* Don't make more of these! -QAK */ __DLL__ htri_t H5P_isa_class(hid_t plist_id, hid_t pclass_id); +__DLL__ void *H5P_object_verify(hid_t plist_id, hid_t pclass_id); /* Private functions to "peek" at properties of a certain type */ diff --git a/src/H5Smpio.c b/src/H5Smpio.c index da09cb7..61297bb 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -779,7 +779,6 @@ H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout, size_t elmt_size, assert (buf); assert (IS_H5FD_MPIO(f)); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); /* Get the preference for MPI derived types */ diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 8f9ebc1..10ece00 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -804,7 +804,7 @@ H5S_select_fscat (H5F_t *f, const struct H5O_layout_t *layout, assert (_buf); /* Get the hyperslab vector size */ - if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (dx_plist = H5I_object(dxpl_id))) + if(NULL == (dx_plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5P_get(dx_plist,H5D_XFER_HYPER_VECTOR_SIZE_NAME,&vector_size)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); @@ -897,7 +897,7 @@ H5S_select_fgath (H5F_t *f, const struct H5O_layout_t *layout, assert (_buf); /* Get the hyperslab vector size */ - if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (dx_plist = H5I_object(dxpl_id))) + if(NULL == (dx_plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a file access property list"); if (H5P_get(dx_plist,H5D_XFER_HYPER_VECTOR_SIZE_NAME,&vector_size)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, 0, "unable to get value"); @@ -983,7 +983,7 @@ H5S_select_mscat (const void *_tscat_buf, size_t elmt_size, const H5S_t *space, assert (buf); /* Get the hyperslab vector size */ - if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (dx_plist = H5I_object(dxpl_id))) + if(NULL == (dx_plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if (H5P_get(dx_plist,H5D_XFER_HYPER_VECTOR_SIZE_NAME,&vector_size)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); @@ -1075,7 +1075,7 @@ H5S_select_mgath (const void *_buf, size_t elmt_size, const H5S_t *space, assert (tgath_buf); /* Get the hyperslab vector size */ - if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (dx_plist = H5I_object(dxpl_id))) + if(NULL == (dx_plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset transfer property list"); if (H5P_get(dx_plist,H5D_XFER_HYPER_VECTOR_SIZE_NAME,&vector_size)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, 0, "unable to get value"); @@ -1165,7 +1165,7 @@ H5S_select_read(H5F_t *f, const H5O_layout_t *layout, H5P_genplist_t *dc_plist, FUNC_ENTER_NOAPI(H5S_select_read, FAIL); /* Get the hyperslab vector size */ - if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (dx_plist = H5I_object(dxpl_id))) + if(NULL == (dx_plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if (H5P_get(dx_plist,H5D_XFER_HYPER_VECTOR_SIZE_NAME,&vector_size)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); @@ -1395,7 +1395,7 @@ H5S_select_write(H5F_t *f, const H5O_layout_t *layout, H5P_genplist_t *dc_plist, FUNC_ENTER_NOAPI(H5S_select_write, FAIL); /* Get the hyperslab vector size */ - if(TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER) || NULL == (dx_plist = H5I_object(dxpl_id))) + if(NULL == (dx_plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if (H5P_get(dx_plist,H5D_XFER_HYPER_VECTOR_SIZE_NAME,&vector_size)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 8efa915..343f48b 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -237,7 +237,7 @@ H5T_vlen_seq_mem_write(hid_t plist_id, H5F_t UNUSED *f, void *vl_addr, void *buf plist_id= H5P_DATASET_XFER_DEFAULT; /* Get the allocation function & info */ - if(TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_NAME,&alloc_func)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); @@ -371,7 +371,7 @@ H5T_vlen_str_mem_write(hid_t plist_id, H5F_t UNUSED *f, void *vl_addr, void *buf plist_id= H5P_DATASET_XFER_DEFAULT; /* Get the allocation function & info */ - if(TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_NAME,&alloc_func)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); @@ -710,7 +710,7 @@ H5T_vlen_reclaim(void *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t UNUSED plist_id= H5P_DATASET_XFER_DEFAULT; /* Get the free func & information */ - if(TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(plist_id))) + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); if (H5P_get(plist,H5D_XFER_VLEN_FREE_NAME,&free_func)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); |