aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-12-18 19:20:04 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-12-18 19:20:04 +0100
commit30a8e0c2f9006db75840724ce89883595dfc7379 (patch)
treeb2d4c15373d135ca850be1be5c6ef178be899081 /miscutils
parent694d2982e5cc73edfc870e26647e85a558d71bbe (diff)
downloadbusybox-w32-30a8e0c2f9006db75840724ce89883595dfc7379.tar.gz
busybox-w32-30a8e0c2f9006db75840724ce89883595dfc7379.tar.bz2
busybox-w32-30a8e0c2f9006db75840724ce89883595dfc7379.zip
bc: code shrink
function old new delta zbc_program_print 684 680 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-4) Total: -4 bytes text data bss dec hex filename 981368 485 7296 989149 f17dd busybox_old 981364 485 7296 989145 f17d9 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/bc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index eba8aa272..e62ca0f69 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -5290,7 +5290,7 @@ static FAST_FUNC void bc_num_printHex(size_t num, size_t width, bool radix)
5290 if (radix) { 5290 if (radix) {
5291 bc_num_printNewline(); 5291 bc_num_printNewline();
5292 bb_putchar('.'); 5292 bb_putchar('.');
5293 G.prog.nchars += 1; 5293 G.prog.nchars++;
5294 } 5294 }
5295 5295
5296 bc_num_printNewline(); 5296 bc_num_printNewline();
@@ -5302,8 +5302,10 @@ static void bc_num_printDecimal(BcNum *n)
5302{ 5302{
5303 size_t i, rdx = n->rdx - 1; 5303 size_t i, rdx = n->rdx - 1;
5304 5304
5305 if (n->neg) bb_putchar('-'); 5305 if (n->neg) {
5306 G.prog.nchars += n->neg; 5306 bb_putchar('-');
5307 G.prog.nchars++;
5308 }
5307 5309
5308 for (i = n->len - 1; i < n->len; --i) 5310 for (i = n->len - 1; i < n->len; --i)
5309 bc_num_printHex((size_t) n->num[i], 1, i == rdx); 5311 bc_num_printHex((size_t) n->num[i], 1, i == rdx);