summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-12-14 16:10:32 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-12-14 16:10:32 (GMT)
commit10c6d6d500ec4188862f408ee0a414bd3fc61374 (patch)
tree5e52abc1b0d4e5edfa933d06f3c4bded89a7435c /src
parent375f018aa18eeb5fc854f2efba2a65d5a057f1a7 (diff)
downloadhdf5-10c6d6d500ec4188862f408ee0a414bd3fc61374.zip
hdf5-10c6d6d500ec4188862f408ee0a414bd3fc61374.tar.gz
hdf5-10c6d6d500ec4188862f408ee0a414bd3fc61374.tar.bz2
[svn-r3138] Purpose:
Bug Fix Description: More descrimination is necessary for the type of background buffer needed. Compound types need H5T_BKG_TEMP and vlen & array types need H5T_BKG_YES. Solution: Make the internal routine be more specific about the background type set. Platforms tested: FreeBSD 4.2 (hawkwind)
Diffstat (limited to 'src')
-rw-r--r--src/H5Tconv.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index f63f30d..9b70ea1 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -796,7 +796,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
*-------------------------------------------------------------------------
*/
static herr_t
-H5T_conv_need_bkg (H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, H5T_bkg_t bkg_type)
+H5T_conv_need_bkg (H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
{
FUNC_ENTER (H5T_conv_need_bkg, FAIL);
@@ -804,8 +804,15 @@ H5T_conv_need_bkg (H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, H5T_bkg_t bkg_typ
assert(dst);
assert(cdata);
+ /* Compound datatypes only need a "temp" buffer */
if (H5T_detect_class(src,H5T_COMPOUND)==TRUE || H5T_detect_class(dst,H5T_COMPOUND)==TRUE)
- cdata->need_bkg = bkg_type;
+ cdata->need_bkg = H5T_BKG_TEMP;
+
+ /* Compound datatypes need a "yes" buffer though */
+ if (H5T_detect_class(src,H5T_VLEN)==TRUE || H5T_detect_class(dst,H5T_VLEN)==TRUE)
+ cdata->need_bkg = H5T_BKG_YES;
+ if (H5T_detect_class(src,H5T_ARRAY)==TRUE || H5T_detect_class(dst,H5T_ARRAY)==TRUE)
+ cdata->need_bkg = H5T_BKG_YES;
FUNC_LEAVE (SUCCEED);
}
@@ -931,7 +938,7 @@ H5T_conv_struct_init (H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
}
/* Check if we need a background buffer */
- H5T_conv_need_bkg (src, dst, cdata, H5T_BKG_TEMP);
+ H5T_conv_need_bkg (src, dst, cdata);
cdata->recalc = FALSE;
FUNC_LEAVE (SUCCEED);
@@ -1845,7 +1852,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
assert (H5T_VLEN==dst->type);
/* Check if we need a background buffer */
- H5T_conv_need_bkg (src, dst, cdata, H5T_BKG_YES);
+ H5T_conv_need_bkg (src, dst, cdata);
break;
@@ -2080,7 +2087,7 @@ H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
#endif /* LATER */
/* Check if we need a background buffer */
- H5T_conv_need_bkg (src, dst, cdata, H5T_BKG_YES);
+ H5T_conv_need_bkg (src, dst, cdata);
break;