summaryrefslogtreecommitdiff
path: root/libbb/human_readable.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-08-12 20:58:27 +0000
committerDenis Vlasenko2007-08-12 20:58:27 +0000
commit6ca409e0e4c198fe3081346eebbae3f068fe605a (patch)
tree060cb05d99220a1eda399194d1209c269f0e8cd8 /libbb/human_readable.c
parent4185548984357df91311f30c8e43d95f33922576 (diff)
downloadbusybox-6ca409e0e4c198fe3081346eebbae3f068fe605a.zip
busybox-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz
trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount of padding (unfortunately, needs hand editing ATM). *: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts size saving: 0.5k
Diffstat (limited to 'libbb/human_readable.c')
-rw-r--r--libbb/human_readable.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libbb/human_readable.c b/libbb/human_readable.c
index 09fa82c..d60ef61 100644
--- a/libbb/human_readable.c
+++ b/libbb/human_readable.c
@@ -31,12 +31,12 @@
const char *make_human_readable_str(unsigned long long size,
unsigned long block_size, unsigned long display_unit)
{
- /* The code will adjust for additional (appended) units. */
- static const char zero_and_units[] = { '0', 0, 'k', 'M', 'G', 'T' };
- static const char fmt[] = "%llu";
- static const char fmt_tenths[] = "%llu.%d%c";
+ /* The code will adjust for additional (appended) units */
+ static const char zero_and_units[] ALIGN1 = { '0', 0, 'k', 'M', 'G', 'T' };
+ static const char fmt[] ALIGN1 = "%llu";
+ static const char fmt_tenths[] ALIGN1 = "%llu.%d%c";
- static char str[21]; /* Sufficient for 64 bit unsigned integers. */
+ static char str[21] ALIGN1; /* Sufficient for 64 bit unsigned integers */
unsigned long long val;
int frac;
@@ -53,7 +53,7 @@ const char *make_human_readable_str(unsigned long long size,
}
if (display_unit) {
- val += display_unit/2; /* Deal with rounding. */
+ val += display_unit/2; /* Deal with rounding */
val /= display_unit; /* Don't combine with the line above!!! */
} else {
++u;