summaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-04-14 22:21:54 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-04-14 22:21:54 (GMT)
commit2521c4084c06f078846fe06bb1d3cd7bfa506316 (patch)
tree466b9213c163d812778434bba2097705b423e799 /tools/misc
parent3468ff3a5c4f6c384801edef9ae52ecc4f2de3c5 (diff)
downloadhdf5-2521c4084c06f078846fe06bb1d3cd7bfa506316.zip
hdf5-2521c4084c06f078846fe06bb1d3cd7bfa506316.tar.gz
hdf5-2521c4084c06f078846fe06bb1d3cd7bfa506316.tar.bz2
[svn-r12254] Purpose:
Anti-feature Description: Revert changes to H5G_stat_t struct, to make it compatible with the 1.6.x branch again. The information that was added to the H5G_stat_t struct will be reported through other API routines. Platforms tested: FreeBSD 4.11 (sleipnir) w/C++ Linux 2.4/64 (mir) w/C++ & Fortran Solaris 2.9 (shanti)
Diffstat (limited to 'tools/misc')
-rw-r--r--tools/misc/h5stat.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/tools/misc/h5stat.c b/tools/misc/h5stat.c
index e8f1647..e72f609 100644
--- a/tools/misc/h5stat.c
+++ b/tools/misc/h5stat.c
@@ -123,11 +123,12 @@ ceil_log10(unsigned long x)
static void
sym_insert(H5G_stat_t *sb, const char *name)
{
+ haddr_t objno; /* Compact form of object's location */
int n;
/* Don't add it if the link count is 1 because such an object can only
* have one name. */
- if (sb->u.obj.nlink<2) return;
+ if (sb->nlink<2) return;
/* Extend the table */
if (idtab_g.nobjs>=idtab_g.nalloc) {
@@ -138,7 +139,8 @@ sym_insert(H5G_stat_t *sb, const char *name)
/* Insert the entry */
n = idtab_g.nobjs++;
- idtab_g.obj[n].id = sb->u.obj.objno;
+ objno = (haddr_t)sb->objno[0] | ((haddr_t)sb->objno[1] << (8 * sizeof(long)));
+ idtab_g.obj[n].id = objno;
idtab_g.obj[n].name = strdup(name);
}
@@ -162,12 +164,14 @@ sym_insert(H5G_stat_t *sb, const char *name)
static char *
sym_lookup(H5G_stat_t *sb)
{
+ haddr_t objno; /* Compact form of object's location */
int n;
- if (sb->u.obj.nlink<2)
+ if (sb->nlink<2)
return NULL; /*only one name possible*/
+ objno = (haddr_t)sb->objno[0] | ((haddr_t)sb->objno[1] << (8 * sizeof(long)));
for (n=0; n<idtab_g.nobjs; n++) {
- if (idtab_g.obj[n].id==sb->u.obj.objno)
+ if(idtab_g.obj[n].id == objno)
return idtab_g.obj[n].name;
}
return NULL;
@@ -267,8 +271,8 @@ printf("walk: fullname = %s\n", fullname);
sym_insert(&sb, fullname);
/* Gather some statistics about the object */
- if(sb.u.obj.nlink > iter->max_links)
- iter->max_links = sb.u.obj.nlink;
+ if(sb.nlink > iter->max_links)
+ iter->max_links = sb.nlink;
switch(sb.type) {
case H5G_GROUP:
@@ -284,8 +288,8 @@ printf("walk: fullname = %s\n", fullname);
iter->max_depth = iter->curr_depth;
/* Get object header information */
- iter->group_ohdr_info.total_size += sb.u.obj.ohdr.size;
- iter->group_ohdr_info.free_size += sb.u.obj.ohdr.free;
+ iter->group_ohdr_info.total_size += sb.ohdr.size;
+ iter->group_ohdr_info.free_size += sb.ohdr.free;
gid = H5Gopen(group, name);
assert(gid > 0);
@@ -346,8 +350,8 @@ printf("walk: fullname = %s\n", fullname);
iter->uniq_dsets++;
/* Get object header information */
- iter->dset_ohdr_info.total_size += sb.u.obj.ohdr.size;
- iter->dset_ohdr_info.free_size += sb.u.obj.ohdr.free;
+ iter->dset_ohdr_info.total_size += sb.ohdr.size;
+ iter->dset_ohdr_info.free_size += sb.ohdr.free;
did = H5Dopen(group, name);
assert(did > 0);