diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2004-10-05 14:31:14 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2004-10-05 14:31:14 (GMT) |
commit | 7ba45c05b3e9345bc8d77a5d205bb41086b78f1e (patch) | |
tree | e8b2ff9381a5c47415eee3941dc66ff6907d8354 /tools | |
parent | 71737e02ec70bbfd85ae4eb3f9a16d31b0f9789f (diff) | |
download | hdf5-7ba45c05b3e9345bc8d77a5d205bb41086b78f1e.zip hdf5-7ba45c05b3e9345bc8d77a5d205bb41086b78f1e.tar.gz hdf5-7ba45c05b3e9345bc8d77a5d205bb41086b78f1e.tar.bz2 |
[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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5dump/h5dump.c | 27 | ||||
-rw-r--r-- | tools/h5ls/h5ls.c | 8 | ||||
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 28 | ||||
-rw-r--r-- | tools/h5repack/h5repack_refs.c | 28 | ||||
-rw-r--r-- | tools/lib/h5diff_attr.c | 26 | ||||
-rw-r--r-- | tools/lib/h5diff_dset.c | 45 | ||||
-rw-r--r-- | tools/lib/h5tools.c | 11 | ||||
-rw-r--r-- | tools/lib/talign.c | 7 |
8 files changed, 157 insertions, 23 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index e370478..eabbd61 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -1948,8 +1948,15 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int pindex) if(space_type == H5S_NULL || space_type == H5S_NO_CLASS || space_type == H5S_COMPLEX) { status = SUCCEED; } else { + H5T_class_t type_class; + type = H5Aget_type(obj_id); - p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT); + type_class = H5Tget_class(type); + if(type_class==H5T_BITFIELD) + p_type=H5Tcopy(type); + else + p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT); + ndims = H5Sget_simple_extent_dims(space, size, NULL); for (i = 0; i < ndims; i++) @@ -2061,10 +2068,17 @@ static void dump_fill_value(hid_t dcpl,hid_t type_id, hid_t obj_id) int nelmts=1; h5dump_t *outputformat = &dataformat; hid_t n_type; + H5T_class_t type_class; memset(&ctx, 0, sizeof(ctx)); ctx.indent_level=2; - n_type = H5Tget_native_type(type_id,H5T_DIR_DEFAULT); + + type_class = H5Tget_class(type_id); + if(type_class==H5T_BITFIELD) + n_type=H5Tcopy(type_id); + else + n_type = H5Tget_native_type(type_id,H5T_DIR_DEFAULT); + size = H5Tget_size(n_type); buf = malloc(size); @@ -4835,7 +4849,14 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU status = xml_print_strs(obj_id, ATTRIBUTE_DATA); } else { /* all other data */ - p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT); + H5T_class_t type_class; + + type_class = H5Tget_class(type); + if(type_class==H5T_BITFIELD) + p_type=H5Tcopy(type); + else + p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT); + H5Tclose(type); space = H5Aget_space(obj_id); diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 24cd953..6066812 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1400,7 +1400,13 @@ list_attr (hid_t obj, const char *attr_name, void UNUSED *op_data) if (hexdump_g) { p_type = H5Tcopy(type); } else { - p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT); + H5T_class_t type_class; + + type_class = H5Tget_class(type); + if(type_class==H5T_BITFIELD) + p_type=H5Tcopy(type); + else + p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT); } if (p_type>=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; j<rank; j++) nelmts*=dims[j]; - if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0) - goto error; + + if((type_class = H5Tget_class(ftype_id))<0) + goto error; + if(type_class==H5T_BITFIELD) { + if((mtype_id=H5Tcopy(ftype_id))<0) + goto error; + } else { + if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0) + goto error; + } + if ((msize=H5Tget_size(mtype_id))==0) goto error; @@ -608,6 +618,7 @@ int copy_attr(hid_t loc_in, char name[255]; int n, j; unsigned u; + H5T_class_t type_class; if ((n = H5Aget_num_attrs(loc_in))<0) goto error; @@ -646,8 +657,17 @@ int copy_attr(hid_t loc_in, nelmts=1; for (j=0; j<rank; j++) nelmts*=dims[j]; - if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0) - goto error; + + if((type_class = H5Tget_class(ftype_id))<0) + goto error; + if(type_class==H5T_BITFIELD) { + if((mtype_id=H5Tcopy(ftype_id))<0) + goto error; + } else { + if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0) + goto error; + } + if ((msize=H5Tget_size(mtype_id))==0) goto error; diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 1a09b02..4662341 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -67,6 +67,7 @@ int do_copy_refobjs(hid_t fidin, hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ int next; /* external files */ int i, j; + H5T_class_t type_class; /* datatype class */ /*------------------------------------------------------------------------- * browse @@ -122,8 +123,17 @@ int do_copy_refobjs(hid_t fidin, nelmts=1; for (j=0; j<rank; j++) nelmts*=dims[j]; - if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0) - goto error; + + if((type_class = H5Tget_class(ftype_id))<0) + goto error; + if(type_class==H5T_BITFIELD) { + if((mtype_id=H5Tcopy(ftype_id))<0) + goto error; + } else { + if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0) + goto error; + } + if ((msize=H5Tget_size(mtype_id))==0) goto error; @@ -476,6 +486,7 @@ static int copy_refs_attr(hid_t loc_in, char name[255]; int n, j; unsigned u; + H5T_class_t type_class; /* datatype class */ if ((n = H5Aget_num_attrs(loc_in))<0) goto error; @@ -515,8 +526,17 @@ static int copy_refs_attr(hid_t loc_in, nelmts=1; for (j=0; j<rank; j++) nelmts*=dims[j]; - if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0) - goto error; + + if((type_class = H5Tget_class(ftype_id))<0) + goto error; + if(type_class==H5T_BITFIELD) { + if((mtype_id=H5Tcopy(ftype_id))<0) + goto error; + } else { + if ((mtype_id=H5Tget_native_type(ftype_id,H5T_DIR_DEFAULT))<0) + goto error; + } + if ((msize=H5Tget_size(mtype_id))==0) goto error; diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 6aedaf5..3278bdb 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -66,6 +66,7 @@ int diff_attr(hid_t loc1_id, int ret=0; hsize_t nfound; int cmp=1; + H5T_class_t type_class; /* Datatype class */ if ((n1 = H5Aget_num_attrs(loc1_id))<0) goto error; @@ -160,10 +161,27 @@ int diff_attr(hid_t loc1_id, nelmts1=1; for (j=0; j<rank1; j++) nelmts1*=dims1[j]; - if ((mtype1_id=H5Tget_native_type(ftype1_id,H5T_DIR_DEFAULT))<0) - goto error; - if ((mtype2_id=H5Tget_native_type(ftype2_id,H5T_DIR_DEFAULT))<0) - goto error; + + if((type_class = H5Tget_class(ftype1_id))<0) + goto error; + if(type_class==H5T_BITFIELD) { + if((mtype1_id=H5Tcopy(ftype1_id))<0) + goto error; + } else { + if ((mtype1_id=H5Tget_native_type(ftype1_id,H5T_DIR_DEFAULT))<0) + goto error; + } + + if((type_class = H5Tget_class(ftype2_id))<0) + goto error; + if(type_class==H5T_BITFIELD) { + if((mtype2_id=H5Tcopy(ftype2_id))<0) + goto error; + } else { + if ((mtype2_id=H5Tget_native_type(ftype2_id,H5T_DIR_DEFAULT))<0) + goto error; + } + if ((msize1=H5Tget_size(mtype1_id))==0) goto error; if ((msize2=H5Tget_size(mtype2_id))==0) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 69acfbd..767587d 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -155,6 +155,7 @@ hsize_t diff_datasetid( hid_t dset1_id, hsize_t storage_size1; hsize_t storage_size2; hsize_t nfound=0; /* number of differences found */ + H5T_class_t type_class; /* data type class */ int cmp=1; /* do diff or not */ int i; @@ -266,9 +267,25 @@ hsize_t diff_datasetid( hid_t dset1_id, * memory type and sizes *------------------------------------------------------------------------- */ + if((type_class = H5Tget_class(f_type1))<0) + goto error; + if(type_class==H5T_BITFIELD) { + if((m_type1=H5Tcopy(f_type1))<0) + goto error; + } else { + if ((m_type1=H5Tget_native_type(f_type1,H5T_DIR_DEFAULT))<0) + goto error; + } - m_type1 = H5Tget_native_type( f_type1 , H5T_DIR_DEFAULT); - m_type2 = H5Tget_native_type( f_type2 , H5T_DIR_DEFAULT); + if((type_class = H5Tget_class(f_type2))<0) + goto error; + if(type_class==H5T_BITFIELD) { + if((m_type2=H5Tcopy(f_type2))<0) + goto error; + } else { + if ((m_type2=H5Tget_native_type(f_type2,H5T_DIR_DEFAULT))<0) + goto error; + } m_size1 = H5Tget_size( m_type1 ); m_size2 = H5Tget_size( m_type2 ); @@ -304,13 +321,33 @@ hsize_t diff_datasetid( hid_t dset1_id, if ( m_size1 < m_size2 ) { H5Tclose(m_type1); - m_type1 = H5Tget_native_type( f_type2 , H5T_DIR_DEFAULT); + + if((type_class = H5Tget_class(f_type2))<0) + goto error; + if(type_class==H5T_BITFIELD) { + if((m_type1=H5Tcopy(f_type2))<0) + goto error; + } else { + if ((m_type1=H5Tget_native_type(f_type2,H5T_DIR_DEFAULT))<0) + goto error; + } + m_size1 = H5Tget_size( m_type1 ); } else { H5Tclose(m_type2); - m_type2 = H5Tget_native_type( f_type1 , H5T_DIR_DEFAULT); + + if((type_class = H5Tget_class(f_type1))<0) + goto error; + if(type_class==H5T_BITFIELD) { + if((m_type2=H5Tcopy(f_type1))<0) + goto error; + } else { + if ((m_type2=H5Tget_native_type(f_type1,H5T_DIR_DEFAULT))<0) + goto error; + } + m_size2 = H5Tget_size( m_type2 ); } #if defined (H5DIFF_DEBUG) diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index d25e9bb..d3a2d7a 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1137,8 +1137,15 @@ h5tools_dump_dset(FILE *stream, const h5dump_t *info, hid_t dset, hid_t _p_type, if (info->raw) 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)); |