diff options
author | Denys Vlasenko | 2009-10-13 01:25:09 +0200 |
---|---|---|
committer | Denys Vlasenko | 2009-10-13 01:25:09 +0200 |
commit | 0bf44d00a42dec70514c2e51926f4ca37b4b2367 (patch) | |
tree | be01fbf44da8040c5ef271e0d0bba147ce0c525e /include | |
parent | 76ace254e171ee9ca7a13f36335ccad9cc6ae6e1 (diff) | |
download | busybox-0bf44d00a42dec70514c2e51926f4ca37b4b2367.zip busybox-0bf44d00a42dec70514c2e51926f4ca37b4b2367.tar.gz |
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 'include')
-rw-r--r-- | include/libbb.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index dca14b4..be175d7 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -691,6 +691,10 @@ char *itoa_to_buf(int n, char *buf, unsigned buflen) FAST_FUNC; /* Intelligent formatters of bignums */ void smart_ulltoa4(unsigned long long ul, char buf[5], const char *scale) FAST_FUNC; void smart_ulltoa5(unsigned long long ul, char buf[5], const char *scale) FAST_FUNC; +/* If block_size == 0, display size without fractional part, + * else display (size * block_size) with one decimal digit. + * If display_unit == 0, add suffix (K,M,G...), + * else divide by display_unit and do not use suffix. */ //TODO: provide pointer to buf (avoid statics)? const char *make_human_readable_str(unsigned long long size, unsigned long block_size, unsigned long display_unit) FAST_FUNC; |