summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_copy.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-10-06 16:11:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-10-06 16:11:18 (GMT)
commitdefe612ab21a22b9d54e19fa332d45f8489a6da5 (patch)
treed142a0ce72e5f80a3cba336542e5cadc96458a8c /tools/h5repack/h5repack_copy.c
parent5d9f7ebd4c1fb7a008aaa5190fa212dbca5c711c (diff)
downloadhdf5-defe612ab21a22b9d54e19fa332d45f8489a6da5.zip
hdf5-defe612ab21a22b9d54e19fa332d45f8489a6da5.tar.gz
hdf5-defe612ab21a22b9d54e19fa332d45f8489a6da5.tar.bz2
[svn-r9370] Purpose:
Refactor code Description: Refactor common code for determining the native type for using in the tools into separate routine. Also, reduce diffs between the two branches and bring back some fixes from the development branch to the release branch. Platforms tested: FreeBSD 4.10 (sleipnir) too minor to require h5committest
Diffstat (limited to 'tools/h5repack/h5repack_copy.c')
-rw-r--r--tools/h5repack/h5repack_copy.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index 5908809..a5b6a3f 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -259,7 +259,6 @@ 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
@@ -323,15 +322,8 @@ int do_copy_objects(hid_t fidin,
for (j=0; j<rank; j++)
nelmts*=dims[j];
- 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 ((mtype_id=h5tools_get_native_type(ftype_id))<0)
+ goto error;
if ((msize=H5Tget_size(mtype_id))==0)
goto error;
@@ -618,7 +610,6 @@ 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;
@@ -658,15 +649,8 @@ int copy_attr(hid_t loc_in,
for (j=0; j<rank; j++)
nelmts*=dims[j];
- 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 ((mtype_id=h5tools_get_native_type(ftype_id))<0)
+ goto error;
if ((msize=H5Tget_size(mtype_id))==0)
goto error;