diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2001-11-20 19:07:22 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2001-11-20 19:07:22 (GMT) |
commit | 6ab0e9f0929738cdb3ba87fd409c68ad3db4178c (patch) | |
tree | 8142391516c53e90569f4e8ff4dcde376fcf16f9 /src/H5Tvlen.c | |
parent | 2e53165b47744ad71645492f74d4332371cc5179 (diff) | |
download | hdf5-6ab0e9f0929738cdb3ba87fd409c68ad3db4178c.zip hdf5-6ab0e9f0929738cdb3ba87fd409c68ad3db4178c.tar.gz hdf5-6ab0e9f0929738cdb3ba87fd409c68ad3db4178c.tar.bz2 |
[svn-r4620] Purpose:
Code cleanup
Description:
Get rid of IDs from internal function calls and some small cleanups from
the old-stype => generic property list conversion.
Platforms tested:
FreeBSD 4.4 (hawkwind)
Diffstat (limited to 'src/H5Tvlen.c')
-rw-r--r-- | src/H5Tvlen.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index d355c47..2c305b7 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -209,6 +209,7 @@ herr_t H5T_vlen_seq_mem_write(hid_t plist_id, H5F_t UNUSED *f, void *vl_addr, vo void *alloc_info; /* Vlen allocation information */ hvl_t *vl=(hvl_t *)vl_addr; /* Pointer to the user's hvl_t information */ size_t len=seq_len*base_size; + H5P_genplist_t *plist; /* Property list */ FUNC_ENTER (H5T_vlen_seq_mem_write, FAIL); @@ -221,9 +222,11 @@ herr_t H5T_vlen_seq_mem_write(hid_t plist_id, H5F_t UNUSED *f, void *vl_addr, vo assert((seq_len*base_size)==(hsize_t)((size_t)(seq_len*base_size))); /*check for overflow*/ /* Get the allocation function & info */ - if (H5P_get(plist_id,H5D_XFER_VLEN_ALLOC_NAME,&alloc_func)<0) + if(TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(plist_id))) + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_NAME,&alloc_func)<0) HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); - if (H5P_get(plist_id,H5D_XFER_VLEN_ALLOC_INFO_NAME,&alloc_info)<0) + if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_INFO_NAME,&alloc_info)<0) HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); if(alloc_func!=NULL) { @@ -329,6 +332,7 @@ herr_t H5T_vlen_str_mem_write(hid_t plist_id, H5F_t UNUSED *f, void *vl_addr, vo void *alloc_info; /* Vlen allocation information */ char **s=(char **)vl_addr; /* Pointer to the user's hvl_t information */ size_t len=seq_len*base_size; + H5P_genplist_t *plist; /* Property list */ FUNC_ENTER (H5T_vlen_str_mem_write, FAIL); @@ -339,9 +343,11 @@ herr_t H5T_vlen_str_mem_write(hid_t plist_id, H5F_t UNUSED *f, void *vl_addr, vo assert(((seq_len+1)*base_size)==(hsize_t)((size_t)((seq_len+1)*base_size))); /*check for overflow*/ /* Get the allocation function & info */ - if (H5P_get(plist_id,H5D_XFER_VLEN_ALLOC_NAME,&alloc_func)<0) + if(TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(plist_id))) + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_NAME,&alloc_func)<0) HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); - if (H5P_get(plist_id,H5D_XFER_VLEN_ALLOC_INFO_NAME,&alloc_info)<0) + if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_INFO_NAME,&alloc_info)<0) HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); if(alloc_func!=NULL) { @@ -623,6 +629,7 @@ H5T_vlen_reclaim(void *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t UNUSED H5MM_free_t free_func; /* Vlen free function */ void *free_info=NULL; /* Vlen free information */ H5T_t *dt = NULL; + H5P_genplist_t *plist; /* Property list */ herr_t ret_value = FAIL; FUNC_ENTER(H5T_vlen_reclaim, FAIL); @@ -635,9 +642,11 @@ H5T_vlen_reclaim(void *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t UNUSED HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); /* Get the free func & information */ - if (H5P_get(plist_id,H5D_XFER_VLEN_FREE_NAME,&free_func)<0) + if(TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER) || NULL == (plist = H5I_object(plist_id))) + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + if (H5P_get(plist,H5D_XFER_VLEN_FREE_NAME,&free_func)<0) HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); - if (H5P_get(plist_id,H5D_XFER_VLEN_FREE_INFO_NAME,&free_info)<0) + if (H5P_get(plist,H5D_XFER_VLEN_FREE_INFO_NAME,&free_info)<0) HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value"); /* Pull the free function and free info pointer out of the op_data and call the recurse datatype free function */ |