diff options
Diffstat (limited to 'src/H5Tvlen.c')
-rw-r--r-- | src/H5Tvlen.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 0556078..fc898c5 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -222,9 +222,13 @@ herr_t H5T_vlen_seq_mem_write(hid_t plist_id, H5F_t UNUSED *f, void *vl_addr, vo /* Use the user's memory allocation routine is one is defined */ + /* Get the default dataset transfer property list if the user didn't provide one */ + if (H5P_DEFAULT == plist_id) + 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))) - HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer 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,H5D_XFER_VLEN_ALLOC_INFO_NAME,&alloc_info)<0) @@ -343,9 +347,13 @@ herr_t H5T_vlen_str_mem_write(hid_t plist_id, H5F_t UNUSED *f, void *vl_addr, vo /* Use the user's memory allocation routine if one is defined */ + /* Get the default dataset transfer property list if the user didn't provide one */ + if (H5P_DEFAULT == plist_id) + 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))) - HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer 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,H5D_XFER_VLEN_ALLOC_INFO_NAME,&alloc_info)<0) @@ -645,9 +653,13 @@ H5T_vlen_reclaim(void *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t UNUSED if (H5I_DATATYPE!=H5I_get_type(type_id) || NULL==(dt=H5I_object(type_id))) HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); + /* Get the default dataset transfer property list if the user didn't provide one */ + if (H5P_DEFAULT == plist_id) + 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))) - HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer 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,H5D_XFER_VLEN_FREE_INFO_NAME,&free_info)<0) |