aboutsummaryrefslogtreecommitdiff
path: root/procps/top.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-05-15 21:30:45 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-05-15 21:30:45 +0000
commit6b06cb80be64fcf207bee734cc678c25434ed1a4 (patch)
treeaebc37ae3a2658fba3f57003102fa0dfb1a10ac8 /procps/top.c
parent43d5d429fd7a80ca02eb8388f058fd9654cc118d (diff)
downloadbusybox-w32-6b06cb80be64fcf207bee734cc678c25434ed1a4.tar.gz
busybox-w32-6b06cb80be64fcf207bee734cc678c25434ed1a4.tar.bz2
busybox-w32-6b06cb80be64fcf207bee734cc678c25434ed1a4.zip
more of -Wall fixes from Cristian Ionescu-Idbohrn.
Some are fixing real bugs. function old new delta syslogd_main 938 958 +20 get_signum 136 143 +7 obj_load 777 782 +5 recv_from_to 210 214 +4 get_next_block 1795 1799 +4 display_topmem_process_list 1117 1121 +4 logread_main 484 487 +3 buffer_fill_and_print 73 76 +3 kill_main 687 689 +2 ll_remember_index 240 241 +1 do_stats 452 453 +1 if_readconf 166 165 -1 display_process_list 1192 1191 -1 run_applet_and_exit 507 505 -2 print_signames 33 31 -2 parse_one_line 1092 1090 -2 find_out_spec 57 55 -2 add_ksymoops_symbols 421 419 -2 ash_main 1407 1402 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 11/8 up/down: 54/-17) Total: 37 bytes
Diffstat (limited to 'procps/top.c')
-rw-r--r--procps/top.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/procps/top.c b/procps/top.c
index 206f9e8be..ca43376ac 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -53,7 +53,7 @@ typedef struct jiffy_counts_t {
53 the next. Used for finding deltas. */ 53 the next. Used for finding deltas. */
54typedef struct save_hist { 54typedef struct save_hist {
55 unsigned long ticks; 55 unsigned long ticks;
56 unsigned pid; 56 pid_t pid;
57} save_hist; 57} save_hist;
58 58
59typedef int (*cmp_funcp)(top_status_t *P, top_status_t *Q); 59typedef int (*cmp_funcp)(top_status_t *P, top_status_t *Q);
@@ -317,7 +317,7 @@ static unsigned long display_header(int scr_width)
317 fclose(fp); 317 fclose(fp);
318 318
319 /* output memory info */ 319 /* output memory info */
320 if (scr_width > sizeof(scrbuf)) 320 if (scr_width > (int)sizeof(scrbuf))
321 scr_width = sizeof(scrbuf); 321 scr_width = sizeof(scrbuf);
322 snprintf(scrbuf, scr_width, 322 snprintf(scrbuf, scr_width,
323 "Mem: %luK used, %luK free, %luK shrd, %luK buff, %luK cached", 323 "Mem: %luK used, %luK free, %luK shrd, %luK buff, %luK cached",
@@ -481,7 +481,7 @@ static NOINLINE void display_process_list(int count, int scr_width)
481 , SHOW_STAT(pcpu) 481 , SHOW_STAT(pcpu)
482#endif 482#endif
483 ); 483 );
484 if (col + 1 < scr_width) 484 if ((int)(col + 1) < scr_width)
485 read_cmdline(line_buf + col, scr_width - col - 1, s->pid, s->comm); 485 read_cmdline(line_buf + col, scr_width - col - 1, s->pid, s->comm);
486 fputs(line_buf, stdout); 486 fputs(line_buf, stdout);
487 /* printf(" %d/%d %lld/%lld", s->pcpu, total_pcpu, 487 /* printf(" %d/%d %lld/%lld", s->pcpu, total_pcpu,
@@ -584,7 +584,7 @@ static char *grab_number(char *str, const char *match, unsigned sz)
584static void display_topmem_header(int scr_width) 584static void display_topmem_header(int scr_width)
585{ 585{
586 char linebuf[128]; 586 char linebuf[128];
587 int i; 587 unsigned i;
588 FILE *fp; 588 FILE *fp;
589 union { 589 union {
590 struct { 590 struct {
@@ -703,7 +703,7 @@ static NOINLINE void display_topmem_process_list(int count, int scr_width)
703 ulltoa6_and_space(s->dirty_sh, &line_buf[6*6]); 703 ulltoa6_and_space(s->dirty_sh, &line_buf[6*6]);
704 ulltoa6_and_space(s->stack , &line_buf[7*6]); 704 ulltoa6_and_space(s->stack , &line_buf[7*6]);
705 line_buf[8*6] = '\0'; 705 line_buf[8*6] = '\0';
706 if (scr_width > MIN_WIDTH) { 706 if (scr_width > (int)MIN_WIDTH) {
707 read_cmdline(&line_buf[8*6], scr_width - MIN_WIDTH, s->pid, s->comm); 707 read_cmdline(&line_buf[8*6], scr_width - MIN_WIDTH, s->pid, s->comm);
708 } 708 }
709 printf("\n""%.*s", scr_width, line_buf); 709 printf("\n""%.*s", scr_width, line_buf);