aboutsummaryrefslogtreecommitdiff
path: root/coreutils/od_bloaty.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-02-03 20:47:14 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2021-02-03 20:52:40 +0100
commitcad3fc743aa7c7744e4fcf044371f0fda50fa51f (patch)
tree30b1de29e61ed3b5975d183b1746516b7abdc88f /coreutils/od_bloaty.c
parent6ad38d66d08a2646c6423b967a790656ae026c95 (diff)
downloadbusybox-w32-cad3fc743aa7c7744e4fcf044371f0fda50fa51f.tar.gz
busybox-w32-cad3fc743aa7c7744e4fcf044371f0fda50fa51f.tar.bz2
busybox-w32-cad3fc743aa7c7744e4fcf044371f0fda50fa51f.zip
libbb: introduce and use fputs_stdout
function old new delta fputs_stdout - 12 +12 zxc_vm_process 7237 7230 -7 yes_main 85 78 -7 write_block 380 373 -7 wrapf 305 298 -7 strings_main 437 430 -7 show_bridge 353 346 -7 rev_main 384 377 -7 put_prompt_custom 58 51 -7 put_cur_glyph_and_inc_cursor 168 161 -7 print_numbered_lines 152 145 -7 print_named_ascii 130 123 -7 print_name 135 128 -7 print_login_issue 386 379 -7 print_ascii 208 201 -7 powertop_main 1249 1242 -7 od_main 1789 1782 -7 logread_main 518 511 -7 head_main 804 797 -7 display_process_list 1319 1312 -7 cut_main 1002 995 -7 bb_dump_dump 1550 1543 -7 bb_ask_noecho 393 386 -7 baseNUM_main 702 695 -7 expand_main 755 745 -10 dumpleases_main 497 487 -10 write1 12 - -12 putcsi 37 23 -14 print_login_prompt 55 41 -14 paste_main 525 511 -14 cat_main 440 426 -14 print_it 245 230 -15 print_addrinfo 1188 1171 -17 print_rule 770 750 -20 print_linkinfo 842 822 -20 httpd_main 791 771 -20 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/34 up/down: 12/-341) Total: -329 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/od_bloaty.c')
-rw-r--r--coreutils/od_bloaty.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c
index d5bd7bfe8..5b5e56a21 100644
--- a/coreutils/od_bloaty.c
+++ b/coreutils/od_bloaty.c
@@ -422,19 +422,19 @@ print_named_ascii(size_t n_bytes, const char *block,
422 422
423 masked_c &= 0x7f; 423 masked_c &= 0x7f;
424 if (masked_c == 0x7f) { 424 if (masked_c == 0x7f) {
425 fputs(" del", stdout); 425 fputs_stdout(" del");
426 continue; 426 continue;
427 } 427 }
428 if (masked_c > ' ') { 428 if (masked_c > ' ') {
429 buf[3] = masked_c; 429 buf[3] = masked_c;
430 fputs(buf, stdout); 430 fputs_stdout(buf);
431 continue; 431 continue;
432 } 432 }
433 /* Why? Because printf(" %3.3s") is much slower... */ 433 /* Why? Because printf(" %3.3s") is much slower... */
434 buf[6] = charname[masked_c][0]; 434 buf[6] = charname[masked_c][0];
435 buf[7] = charname[masked_c][1]; 435 buf[7] = charname[masked_c][1];
436 buf[8] = charname[masked_c][2]; 436 buf[8] = charname[masked_c][2];
437 fputs(buf+5, stdout); 437 fputs_stdout(buf+5);
438 } 438 }
439} 439}
440 440
@@ -451,7 +451,7 @@ print_ascii(size_t n_bytes, const char *block,
451 451
452 if (ISPRINT(c)) { 452 if (ISPRINT(c)) {
453 buf[3] = c; 453 buf[3] = c;
454 fputs(buf, stdout); 454 fputs_stdout(buf);
455 continue; 455 continue;
456 } 456 }
457 switch (c) { 457 switch (c) {
@@ -485,7 +485,7 @@ print_ascii(size_t n_bytes, const char *block,
485 buf[8] = (c & 7) + '0'; 485 buf[8] = (c & 7) + '0';
486 s = buf + 5; 486 s = buf + 5;
487 } 487 }
488 fputs(s, stdout); 488 fputs_stdout(s);
489 } 489 }
490} 490}
491 491
@@ -881,7 +881,7 @@ format_address_label(off_t address, char c)
881static void 881static void
882dump_hexl_mode_trailer(size_t n_bytes, const char *block) 882dump_hexl_mode_trailer(size_t n_bytes, const char *block)
883{ 883{
884 fputs(" >", stdout); 884 fputs_stdout(" >");
885 while (n_bytes--) { 885 while (n_bytes--) {
886 unsigned c = *(unsigned char *) block++; 886 unsigned c = *(unsigned char *) block++;
887 c = (ISPRINT(c) ? c : '.'); 887 c = (ISPRINT(c) ? c : '.');
@@ -1121,13 +1121,13 @@ dump_strings(off_t address, off_t end_offset)
1121 1121
1122 for (i = 0; (c = buf[i]); i++) { 1122 for (i = 0; (c = buf[i]); i++) {
1123 switch (c) { 1123 switch (c) {
1124 case '\007': fputs("\\a", stdout); break; 1124 case '\007': fputs_stdout("\\a"); break;
1125 case '\b': fputs("\\b", stdout); break; 1125 case '\b': fputs_stdout("\\b"); break;
1126 case '\f': fputs("\\f", stdout); break; 1126 case '\f': fputs_stdout("\\f"); break;
1127 case '\n': fputs("\\n", stdout); break; 1127 case '\n': fputs_stdout("\\n"); break;
1128 case '\r': fputs("\\r", stdout); break; 1128 case '\r': fputs_stdout("\\r"); break;
1129 case '\t': fputs("\\t", stdout); break; 1129 case '\t': fputs_stdout("\\t"); break;
1130 case '\v': fputs("\\v", stdout); break; 1130 case '\v': fputs_stdout("\\v"); break;
1131 default: putchar(c); 1131 default: putchar(c);
1132 } 1132 }
1133 } 1133 }