summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-07-10 20:17:53 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-07-10 20:17:53 (GMT)
commitd7bb1d0c0752461dc0e4316c85c72867490b8532 (patch)
treecb32c6520eb36df199dc3016bf132c11de4cde64 /src/H5T.c
parenta631467c1b638ee3359d8f66c4067cae1a71f525 (diff)
downloadhdf5-d7bb1d0c0752461dc0e4316c85c72867490b8532.zip
hdf5-d7bb1d0c0752461dc0e4316c85c72867490b8532.tar.gz
hdf5-d7bb1d0c0752461dc0e4316c85c72867490b8532.tar.bz2
[svn-r4179] Purpose:
Documentation Description: H5Tget_member_type in v1.2.x returns the base type of array fields in compound datatypes, not an array type itself. Solution: Changed to emulate this behavior in v1.4.x when the --enable-hdf5v1_2 flag is given during configuration. Platforms tested: FreeBSD 4.3 (hawkwind)
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 91f7529..8f2862c 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -3548,12 +3548,35 @@ H5Tget_member_type(hid_t type_id, int membno)
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid member number");
}
+#ifdef WANT_H5_V1_2_COMPAT
+ /* HDF5-v1.2.x returns the base type of an array field, not the array
+ * field itself. Emulate this difference. - QAK
+ */
+ if(dt->u.compnd.memb[membno].type->type==H5T_ARRAY) {
+ /* Copy parent's data type into an atom */
+ if (NULL == (memb_dt = H5T_copy(dt->u.compnd.memb[membno].type->parent,
+ H5T_COPY_REOPEN))) {
+ HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
+ "unable to copy member data type");
+ }
+ } /* end if */
+ else {
+ /* Copy data type into an atom */
+ if (NULL == (memb_dt = H5T_copy(dt->u.compnd.memb[membno].type,
+ H5T_COPY_REOPEN))) {
+ HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
+ "unable to copy member data type");
+ }
+ } /* end if */
+
+#else /* WANT_H5_V1_2_COMPAT */
/* Copy data type into an atom */
if (NULL == (memb_dt = H5T_copy(dt->u.compnd.memb[membno].type,
H5T_COPY_REOPEN))) {
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
"unable to copy member data type");
}
+#endif /* WANT_H5_V1_2_COMPAT */
if ((memb_type_id = H5I_register(H5I_DATATYPE, memb_dt)) < 0) {
H5T_close(memb_dt);
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL,