diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-13 01:25:09 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-13 01:25:09 +0200 |
commit | 0bf44d00a42dec70514c2e51926f4ca37b4b2367 (patch) | |
tree | be01fbf44da8040c5ef271e0d0bba147ce0c525e /coreutils/du.c | |
parent | 76ace254e171ee9ca7a13f36335ccad9cc6ae6e1 (diff) | |
download | busybox-w32-0bf44d00a42dec70514c2e51926f4ca37b4b2367.tar.gz busybox-w32-0bf44d00a42dec70514c2e51926f4ca37b4b2367.tar.bz2 busybox-w32-0bf44d00a42dec70514c2e51926f4ca37b4b2367.zip |
libbb/human_readable.c: shrink; and reduce bss usage
also, move smart_ulltoaN there and comment usage locations
function old new delta
static.unit_chars 7 9 +2
utoa_to_buf 110 108 -2
make_human_readable_str 262 258 -4
fallbackSort 1723 1719 -4
static.fmt 97 92 -5
static.fmt_tenths 10 - -10
static.str 21 4 -17
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/5 up/down: 2/-42) Total: -40 bytes
text data bss dec hex filename
820981 453 6932 828366 ca3ce busybox_old
820968 453 6916 828337 ca3b1 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/du.c')
-rw-r--r-- | coreutils/du.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/coreutils/du.c b/coreutils/du.c index ec283f85e..730d6d162 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
@@ -58,14 +58,17 @@ static void print(unsigned long size, const char *filename) | |||
58 | { | 58 | { |
59 | /* TODO - May not want to defer error checking here. */ | 59 | /* TODO - May not want to defer error checking here. */ |
60 | #if ENABLE_FEATURE_HUMAN_READABLE | 60 | #if ENABLE_FEATURE_HUMAN_READABLE |
61 | printf("%s\t%s\n", make_human_readable_str(size, 512, G.disp_hr), | 61 | printf("%s\t%s\n", |
62 | /* size x 512 / G.disp_hr, show one fractional, | ||
63 | * use suffixes if G.disp_hr == 0 */ | ||
64 | make_human_readable_str(size, 512, G.disp_hr), | ||
62 | filename); | 65 | filename); |
63 | #else | 66 | #else |
64 | if (G.disp_k) { | 67 | if (G.disp_k) { |
65 | size++; | 68 | size++; |
66 | size >>= 1; | 69 | size >>= 1; |
67 | } | 70 | } |
68 | printf("%ld\t%s\n", size, filename); | 71 | printf("%lu\t%s\n", size, filename); |
69 | #endif | 72 | #endif |
70 | } | 73 | } |
71 | 74 | ||