summaryrefslogtreecommitdiffstats
path: root/src/H5Tvlen.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-01-04 02:41:57 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-01-04 02:41:57 (GMT)
commit9c3d062c267e98526c00e0162f222f84e867d49d (patch)
tree2f4a0b6fe928157602a1c58eb272ea2a252d1c0b /src/H5Tvlen.c
parent14a242987fa8f44c0ca9ca8798580a4521afe712 (diff)
downloadhdf5-9c3d062c267e98526c00e0162f222f84e867d49d.zip
hdf5-9c3d062c267e98526c00e0162f222f84e867d49d.tar.gz
hdf5-9c3d062c267e98526c00e0162f222f84e867d49d.tar.bz2
[svn-r4772] Purpose:
Bug Fix. Description: Equation to compute size of attribute in memory was incorrectly using the disk's datatype (and dataspace, but that turns out not to have been the actual issue) and when a variable length datatype was used for the attribute, the wrong size is being computed. Also, the variable-length datatype conversions aren't handling the default dataset transfer property list (H5P_DEFAULT) correctly. Solution: Changed attribute code to compute the attribute size in memory correctly by using the memory datatype & dataspace. Changed the variable-length datatype conversion code to use the default dataset transfer property list when H5P_DEFAULT is passed as the property list ID. Platforms tested: FreeBSD 4.5 (sleipnir)
Diffstat (limited to 'src/H5Tvlen.c')
-rw-r--r--src/H5Tvlen.c18
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)