summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-10-22 21:03:50 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-10-22 21:03:50 (GMT)
commitb4d39e7adb6d9c228625c9678192cf283a2ddc01 (patch)
tree341bd1432030dc397e7fcbbde5d5ea71150819b2
parentcacc8fa4c6bd301339ce78e8ab41a31ab8bdf654 (diff)
downloadhdf5-b4d39e7adb6d9c228625c9678192cf283a2ddc01.zip
hdf5-b4d39e7adb6d9c228625c9678192cf283a2ddc01.tar.gz
hdf5-b4d39e7adb6d9c228625c9678192cf283a2ddc01.tar.bz2
[svn-r9447] 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
-rw-r--r--release_docs/RELEASE.txt2
-rw-r--r--tools/h5ls/h5ls.c21
2 files changed, 10 insertions, 13 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 1e1518e..38ed08d 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -386,6 +386,8 @@ Bug Fixes since HDF5-1.6.0 release
Tools
-----
+ - Fixed space utilization reported in h5ls to correct error in formula
+ used. QAK - 2004/10/22
- Fixed h5redeploy which sometimes complain too many argument for the
test command. (The complain did not hinder the h5redploy to
proceed correctly.) AKC - 2003/11/03
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index 5d1c6b2..1514ca6 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1534,24 +1534,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');