From 6b06cb80be64fcf207bee734cc678c25434ed1a4 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 15 May 2008 21:30:45 +0000 Subject: 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 --- procps/top.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'procps/top.c') 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 { the next. Used for finding deltas. */ typedef struct save_hist { unsigned long ticks; - unsigned pid; + pid_t pid; } save_hist; typedef int (*cmp_funcp)(top_status_t *P, top_status_t *Q); @@ -317,7 +317,7 @@ static unsigned long display_header(int scr_width) fclose(fp); /* output memory info */ - if (scr_width > sizeof(scrbuf)) + if (scr_width > (int)sizeof(scrbuf)) scr_width = sizeof(scrbuf); snprintf(scrbuf, scr_width, "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) , SHOW_STAT(pcpu) #endif ); - if (col + 1 < scr_width) + if ((int)(col + 1) < scr_width) read_cmdline(line_buf + col, scr_width - col - 1, s->pid, s->comm); fputs(line_buf, stdout); /* printf(" %d/%d %lld/%lld", s->pcpu, total_pcpu, @@ -584,7 +584,7 @@ static char *grab_number(char *str, const char *match, unsigned sz) static void display_topmem_header(int scr_width) { char linebuf[128]; - int i; + unsigned i; FILE *fp; union { struct { @@ -703,7 +703,7 @@ static NOINLINE void display_topmem_process_list(int count, int scr_width) ulltoa6_and_space(s->dirty_sh, &line_buf[6*6]); ulltoa6_and_space(s->stack , &line_buf[7*6]); line_buf[8*6] = '\0'; - if (scr_width > MIN_WIDTH) { + if (scr_width > (int)MIN_WIDTH) { read_cmdline(&line_buf[8*6], scr_width - MIN_WIDTH, s->pid, s->comm); } printf("\n""%.*s", scr_width, line_buf); -- cgit v1.2.3