summaryrefslogtreecommitdiff
path: root/libbb/human_readable.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
commit6ca409e0e4c198fe3081346eebbae3f068fe605a (patch)
tree060cb05d99220a1eda399194d1209c269f0e8cd8 /libbb/human_readable.c
parent4185548984357df91311f30c8e43d95f33922576 (diff)
downloadbusybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz
busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.bz2
busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.zip
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 09fa82c09..d60ef61d7 100644
--- a/libbb/human_readable.c
+++ b/libbb/human_readable.c
@@ -31,12 +31,12 @@
31const char *make_human_readable_str(unsigned long long size, 31const char *make_human_readable_str(unsigned long long size,
32 unsigned long block_size, unsigned long display_unit) 32 unsigned long block_size, unsigned long display_unit)
33{ 33{
34 /* The code will adjust for additional (appended) units. */ 34 /* The code will adjust for additional (appended) units */
35 static const char zero_and_units[] = { '0', 0, 'k', 'M', 'G', 'T' }; 35 static const char zero_and_units[] ALIGN1 = { '0', 0, 'k', 'M', 'G', 'T' };
36 static const char fmt[] = "%llu"; 36 static const char fmt[] ALIGN1 = "%llu";
37 static const char fmt_tenths[] = "%llu.%d%c"; 37 static const char fmt_tenths[] ALIGN1 = "%llu.%d%c";
38 38
39 static char str[21]; /* Sufficient for 64 bit unsigned integers. */ 39 static char str[21] ALIGN1; /* Sufficient for 64 bit unsigned integers */
40 40
41 unsigned long long val; 41 unsigned long long val;
42 int frac; 42 int frac;
@@ -53,7 +53,7 @@ const char *make_human_readable_str(unsigned long long size,
53 } 53 }
54 54
55 if (display_unit) { 55 if (display_unit) {
56 val += display_unit/2; /* Deal with rounding. */ 56 val += display_unit/2; /* Deal with rounding */
57 val /= display_unit; /* Don't combine with the line above!!! */ 57 val /= display_unit; /* Don't combine with the line above!!! */
58 } else { 58 } else {
59 ++u; 59 ++u;