diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-10-22 21:03:52 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-10-22 21:03:52 (GMT) |
commit | df980186393c9d37227b7eb6c42ce929578857eb (patch) | |
tree | 1a8dfa039709aeeb79b33cc2e8cb18d2147d708c /tools | |
parent | 35c87b26a522326f2a2b010bd0f27cbdb8cd0294 (diff) | |
download | hdf5-df980186393c9d37227b7eb6c42ce929578857eb.zip hdf5-df980186393c9d37227b7eb6c42ce929578857eb.tar.gz hdf5-df980186393c9d37227b7eb6c42ce929578857eb.tar.bz2 |
[svn-r9448] Purpose:
Bug fix
Description:
Correct values used in "space utilization" equation: the 'used' and
'total' values were backwards.
Platforms tested:
FreeBSD 4.10 (sleipnir)
Too minor to require h5committest
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5ls/h5ls.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 07b53d1..a77a3bc 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1522,24 +1522,19 @@ dataset_list2(hid_t dset, const char UNUSED *name) } /* Print total raw storage size */ - used = H5Sget_simple_extent_npoints(space) * H5Tget_size(type); - total = H5Dget_storage_size(dset); + total = H5Sget_simple_extent_npoints(space) * H5Tget_size(type); + used = H5Dget_storage_size(dset); printf(" %-10s ", "Storage:"); printf("%lu logical byte%s, %lu allocated byte%s", - (unsigned long)used, 1==used?"":"s", - (unsigned long)total, 1==total?"":"s"); - if (total>0) { + (unsigned long)total, 1==total?"":"s", + (unsigned long)used, 1==used?"":"s"); + if (used>0) { #ifdef WIN32 - hsize_t mask = (hsize_t)1 << (8*sizeof(hsize_t)-1); - if ((used & mask) || (total & mask)) { - total = 0; /*prevent utilization printing*/ - } else { - utilization = (hssize_t)used*100.0 /(hssize_t)total; - } + utilization = (hssize_t)used*100.0 /(hssize_t)total; #else - utilization = (used*100.0)/total; + utilization = (used*100.0)/total; #endif - printf(", %1.2f%% utilization", utilization/*(used*100.0)/total*/); + printf(", %1.2f%% utilization", utilization); } putchar('\n'); |