diff options
Diffstat (limited to 'tools/h5repack')
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 7 | ||||
-rw-r--r-- | tools/h5repack/h5repack_refs.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index dedca0a..5734285 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -901,10 +901,11 @@ int copy_attr(hid_t loc_in, int rank; /* rank of dataset */ hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ char name[255]; - int n, j; + H5O_info_t oinfo; /* Object info */ + int j; unsigned u; - if ((n = H5Aget_num_attrs(loc_in))<0) + if(H5Oget_info(loc_in, ".", &oinfo, H5P_DEFAULT) < 0) goto error; /*------------------------------------------------------------------------- @@ -912,7 +913,7 @@ int copy_attr(hid_t loc_in, *------------------------------------------------------------------------- */ - for ( u = 0; u < (unsigned)n; u++) + for ( u = 0; u < (unsigned)oinfo.num_attrs; u++) { buf=NULL; diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index f1738e8..8ec1cfd 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -418,13 +418,14 @@ static int copy_refs_attr(hid_t loc_in, int rank; /* rank of dataset */ hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ char name[255]; - int n, j; + H5O_info_t oinfo; /* Object info */ + int j; unsigned u; - if((n = H5Aget_num_attrs(loc_in)) < 0) + if(H5Oget_info(loc_in, ".", &oinfo, H5P_DEFAULT) < 0) goto error; - for(u = 0; u < (unsigned)n; u++) { + for(u = 0; u < (unsigned)oinfo.num_attrs; u++) { /*------------------------------------------------------------------------- * open *------------------------------------------------------------------------- |