Make smart_ulltoa return pointer to end (allows for code shink in callers)

function                                             old     new   delta
smart_ulltoa5                                        405     408      +3
smart_ulltoa4                                        273     276      +3
list_table                                          1113    1114      +1
scale                                                 36      34      -2
put_lu                                                55      53      -2
ulltoa6_and_space                                     19      14      -5
powertop_main                                       1470    1461      -9

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2013-09-06 12:53:14 +02:00
parent d6ae4fb446
commit a407cf74cc
7 changed files with 14 additions and 20 deletions

View File

@ -627,7 +627,6 @@ static void show_timerstats(void)
int i, n = 0;
char strbuf6[6];
strbuf6[5] = '\0';
puts("\nTop causes for wakeups:");
for (i = 0; i < G.lines_cnt; i++) {
if ((G.lines[i].count > 0 /*|| G.lines[i].disk_count > 0*/)
@ -639,7 +638,7 @@ static void show_timerstats(void)
/*char c = ' ';
if (G.lines[i].disk_count)
c = 'D';*/
smart_ulltoa5(G.lines[i].count, strbuf6, " KMGTPEZY");
smart_ulltoa5(G.lines[i].count, strbuf6, " KMGTPEZY")[0] = '\0';
printf(/*" %5.1f%% (%s)%c %s\n"*/
" %5.1f%% (%s) %s\n",
G.lines[i].count * 100.0 / G.lines_cumulative_count,