aboutsummaryrefslogtreecommitdiff
path: root/procps/top.c
diff options
context:
space:
mode:
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 {
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);