diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2005-02-08 18:30:29 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2005-02-08 18:30:29 (GMT) |
commit | 70c0ba03cec20ad3c353fcf776f4b48f2ac8da9f (patch) | |
tree | 437db9a19b864616d6888a9d184e8a8e2714630e /src/H5T.c | |
parent | e31f8dfdc830cfc71a84ae36f2f69a0d432576db (diff) | |
download | hdf5-70c0ba03cec20ad3c353fcf776f4b48f2ac8da9f.zip hdf5-70c0ba03cec20ad3c353fcf776f4b48f2ac8da9f.tar.gz hdf5-70c0ba03cec20ad3c353fcf776f4b48f2ac8da9f.tar.bz2 |
[svn-r9959] Purpose: Bug fix
Description: For variable-length string, H5Tget_class returned H5T_STRING as
its class. But H5Tdetect_class and H5Tget_member_class considered it as
H5T_VLEN. This is fixed to let all these 3 functions treat it as H5T_STRING.
Some test cases have been added to dtypes.c
Platforms tested: heping - already tested for v1.6 with h5committest
Misc. update: RELEASE.txt
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -1752,7 +1752,7 @@ H5Tget_class(hid_t type_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a data type"); /* Set return value */ - ret_value= H5T_get_class(dt); + ret_value= H5T_get_class(dt, FALSE); done: FUNC_LEAVE_API(ret_value); @@ -1778,7 +1778,7 @@ done: *------------------------------------------------------------------------- */ H5T_class_t -H5T_get_class(const H5T_t *dt) +H5T_get_class(const H5T_t *dt, htri_t internal) { H5T_class_t ret_value; @@ -1792,6 +1792,16 @@ H5T_get_class(const H5T_t *dt) else ret_value=dt->shared->type; + /* Externally, a VL string is a string; internally, a VL string is a VL. */ + if(internal) { + ret_value=dt->shared->type; + } else { + if(H5T_IS_VL_STRING(dt->shared)) + ret_value=H5T_STRING; + else + ret_value=dt->shared->type; + } + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5T_get_class() */ @@ -1827,8 +1837,12 @@ H5Tdetect_class(hid_t type, H5T_class_t cls) if (!(cls>H5T_NO_CLASS && cls<H5T_NCLASSES)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a data type class"); - /* Set return value */ - ret_value=H5T_detect_class(dt,cls); + /* Set return value. Consider VL string as a string for API, as a VL for + * internal use. */ + if(H5T_IS_VL_STRING(dt->shared)) + ret_value = (H5T_STRING==cls); + else + ret_value=H5T_detect_class(dt,cls); done: FUNC_LEAVE_API(ret_value); |