From 7ba45c05b3e9345bc8d77a5d205bb41086b78f1e Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Tue, 5 Oct 2004 09:31:14 -0500 Subject: [svn-r9364] Purpose: change feature Description: Back up support bitfield and time datatypes in H5Tget_native_type.Leave it to future support. Let it return "not supported" error message for now. Platforms tested: h5committest and fuss. Misc. update: RELEASE.txt --- release_docs/RELEASE.txt | 4 ++++ src/H5Tnative.c | 10 +++++----- test/ntypes.c | 23 +++++++-------------- tools/h5dump/h5dump.c | 27 ++++++++++++++++++++++--- tools/h5ls/h5ls.c | 8 +++++++- tools/h5repack/h5repack_copy.c | 28 ++++++++++++++++++++++---- tools/h5repack/h5repack_refs.c | 28 ++++++++++++++++++++++---- tools/lib/h5diff_attr.c | 26 ++++++++++++++++++++---- tools/lib/h5diff_dset.c | 45 ++++++++++++++++++++++++++++++++++++++---- tools/lib/h5tools.c | 11 +++++++++-- tools/lib/talign.c | 7 ++++++- 11 files changed, 173 insertions(+), 44 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9476690..cfa6f5f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -186,6 +186,10 @@ Bug Fixes since HDF5-1.6.0 release Library ------- + - Back up supporting bitfield and time types in H5Tget_native_type. + Leave it to future support. The function simply returns error + message of "not support" for bitfield and time types. + SLU - 2004/10/5 - Fixed address check in Core VFL driver to avoid spurious address/size overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 - Fixed parallel bug in which some processes attempted collective diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 3785310..1ece922 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -212,13 +212,13 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig } break; - /* These types need to be supported properly still... */ + /* These 2 types will be supported in the future. Simply return "not supported" + * message for now.*/ case H5T_TIME: - case H5T_BITFIELD: - if((ret_value=H5T_copy(dtype, H5T_COPY_TRANSIENT))==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "time type is not supported yet") - break; + case H5T_BITFIELD: + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "bit field type is not supported yet") case H5T_OPAQUE: if((ret_value=H5T_copy(dtype, H5T_COPY_TRANSIENT))==NULL) diff --git a/test/ntypes.c b/test/ntypes.c index 4fe6842..2cb07e3 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -2312,26 +2312,17 @@ test_bitfield_dtype(hid_t file) if((dtype=H5Dget_type(dataset))<0) TEST_ERROR; - if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) - TEST_ERROR; - - if(!H5Tequal(native_type, type)) TEST_ERROR; - - if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf)<0) + H5E_BEGIN_TRY { + native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT); + } H5E_END_TRY; + if(native_type>0) { + H5_FAILED(); + puts(" Bit field isn't supported. Should have failed."); TEST_ERROR; - - for(i=0; i=0) { diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 110069b..5908809 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -259,6 +259,7 @@ int do_copy_objects(hid_t fidin, #endif /* LATER */ int i, j; int wrote=0; + H5T_class_t type_class; /* datatype class */ /*------------------------------------------------------------------------- * copy the suppplied object list @@ -321,8 +322,17 @@ int do_copy_objects(hid_t fidin, nelmts=1; for (j=0; jraw) p_type = H5Tcopy(f_type); - else - p_type = H5Tget_native_type(f_type,H5T_DIR_DEFAULT); + else { + H5T_class_t type_class; + + type_class = H5Tget_class(f_type); + if(type_class==H5T_BITFIELD) + p_type=H5Tcopy(f_type); + else + p_type = H5Tget_native_type(f_type,H5T_DIR_DEFAULT); + } H5Tclose(f_type); diff --git a/tools/lib/talign.c b/tools/lib/talign.c index e24cabf..082e37e 100644 --- a/tools/lib/talign.c +++ b/tools/lib/talign.c @@ -29,6 +29,7 @@ int main(void) hsize_t dim[2]; hsize_t cdim[4]; + H5T_class_t type_class; char string5[5]; float fok[2] = {1234., 2341.}; @@ -72,7 +73,11 @@ int main(void) H5Tinsert(cmp, "Not Ok", sizeof(fok) + sizeof(string5), array_dt); H5Tclose(array_dt); - fix = H5Tget_native_type(cmp,H5T_DIR_DEFAULT); + type_class = H5Tget_class(cmp); + if(type_class==H5T_BITFIELD) + fix=H5Tcopy(cmp); + else + fix=H5Tget_native_type(cmp, H5T_DIR_DEFAULT); cmp1 = H5Tcreate(H5T_COMPOUND, sizeof(fok)); -- cgit v0.12