summaryrefslogtreecommitdiffstats
path: root/tools/h5stat
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-09-06 15:54:22 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-09-06 15:54:22 (GMT)
commit3bed8703631cbcffb215ccd82235fcc293e14218 (patch)
treebf56b0bcd4f41986f17138059f6349df78f0c059 /tools/h5stat
parent3eb8c81b8046d282ced9c2d94e7132058243013e (diff)
downloadhdf5-3bed8703631cbcffb215ccd82235fcc293e14218.zip
hdf5-3bed8703631cbcffb215ccd82235fcc293e14218.tar.gz
hdf5-3bed8703631cbcffb215ccd82235fcc293e14218.tar.bz2
[svn-r14136] Description:
Move H5Gget_num_objs() and several minor macros, etc. to deprecated symbols section, replacing it with H5Gget_info(). Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) AIX/32 5.3 (copper) Solaris/32 5.10 (linew) Mac OS X/32 10.4.10 (amazon)
Diffstat (limited to 'tools/h5stat')
-rw-r--r--tools/h5stat/h5stat.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c
index 6c4f1af..54c517d 100644
--- a/tools/h5stat/h5stat.c
+++ b/tools/h5stat/h5stat.c
@@ -461,9 +461,8 @@ static herr_t
group_stats(hid_t group, const char *name, const char *fullname,
const H5O_info_t *oi, H5L_iterate_t walk, iter_t *iter)
{
- hid_t gid; /* Group ID */
const char *last_container;
- hsize_t num_objs;
+ H5G_info_t ginfo; /* Group information */
unsigned bin; /* "bin" the number of objects falls in */
herr_t ret;
@@ -476,21 +475,18 @@ group_stats(hid_t group, const char *name, const char *fullname,
iter->group_ohdr_info.total_size += oi->hdr.space.total;
iter->group_ohdr_info.free_size += oi->hdr.space.free;
- gid = H5Gopen2(group, name, H5P_DEFAULT);
- assert(gid > 0);
-
- /* Get number of links in this group */
- ret = H5Gget_num_objs(gid, &num_objs);
+ /* Get group information */
+ ret = H5Gget_info(group, name, &ginfo, H5P_DEFAULT);
assert(ret >= 0);
/* Update link stats */
- if(num_objs < SIZE_SMALL_GROUPS)
- (iter->num_small_groups[(size_t)num_objs])++;
- if(num_objs > iter->max_fanout)
- iter->max_fanout = num_objs;
+ if(ginfo.nlinks < SIZE_SMALL_GROUPS)
+ (iter->num_small_groups[(size_t)ginfo.nlinks])++;
+ if(ginfo.nlinks > iter->max_fanout)
+ iter->max_fanout = ginfo.nlinks;
/* Add group count to proper bin */
- bin = ceil_log10((unsigned long)num_objs);
+ bin = ceil_log10((unsigned long)ginfo.nlinks);
if((bin + 1) > iter->group_nbins) {
/* Allocate more storage for info about dataset's datatype */
iter->group_bins = realloc(iter->group_bins, (bin + 1) * sizeof(unsigned long));
@@ -515,10 +511,6 @@ group_stats(hid_t group, const char *name, const char *fullname,
ret = attribute_stats(iter, oi);
assert(ret >= 0);
- /* Close current group */
- ret = H5Gclose(gid);
- assert(ret >= 0);
-
/* Update current container info */
last_container = iter->container;
iter->container = fullname;
@@ -742,7 +734,7 @@ dataset_stats(hid_t group, const char *name, const H5O_info_t *oi, iter_t *iter)
*-------------------------------------------------------------------------
*/
static herr_t
-walk(hid_t group, const char *name, const H5L_info_t *linfo, void *_iter)
+walk(hid_t group, const char *name, const H5L_info_t UNUSED *linfo, void *_iter)
{
iter_t *iter = (iter_t *)_iter;
H5O_info_t oi;