diff options
-rw-r--r-- | src/H5A.c | 2 | ||||
-rw-r--r-- | src/H5Tvlen.c | 18 |
2 files changed, 16 insertions, 4 deletions
@@ -247,7 +247,7 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type, /* Compute the internal sizes */ attr->dt_size=(H5O_DTYPE[0].raw_size)(attr->ent.file,type); attr->ds_size=(H5O_SDSPACE[0].raw_size)(attr->ent.file,&(space->extent.u.simple)); - H5_ASSIGN_OVERFLOW(attr->data_size,H5S_get_simple_extent_npoints(space)*H5T_get_size(type),hssize_t,size_t); + H5_ASSIGN_OVERFLOW(attr->data_size,H5S_get_simple_extent_npoints(attr->ds)*H5T_get_size(attr->dt),hssize_t,size_t); /* Hold the symbol table entry (and file) open */ if (H5O_open(&(attr->ent)) < 0) 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) |