top(1): build with WARN=2

This commit is contained in:
Eitan Adler 2018-05-21 00:32:48 +00:00
parent 2877df8d84
commit 4901ca088d
3 changed files with 3 additions and 5 deletions

View File

@ -7,7 +7,7 @@ SRCS+= sigdesc.h top.local.h
CFLAGS+= -I ${.OBJDIR}
MAN= top.1
WARNS?= 1
WARNS?= 2
LIBADD= ncursesw m kvm jail

View File

@ -872,7 +872,7 @@ get_process_info(struct system_info *si, struct process_select *sel,
total_oublock += p_oublock;
total_majflt += p_majflt;
total_procs++;
process_states[pp->ki_stat]++;
process_states[(unsigned char)pp->ki_stat]++;
if (pp->ki_stat == SZOMB)
/* skip zombies */
@ -1316,7 +1316,7 @@ static int sorted_state[] = {
} while (0)
#define ORDERKEY_STATE(a, b) do { \
int diff = sorted_state[(b)->ki_stat] - sorted_state[(a)->ki_stat]; \
int diff = sorted_state[(unsigned char)(b)->ki_stat] - sorted_state[(unsigned char)(a)->ki_stat]; \
if (diff != 0) \
return (diff > 0 ? 1 : -1); \
} while (0)

View File

@ -59,8 +59,6 @@ char *terminal_end;
static struct termios old_settings;
static struct termios new_settings;
static char is_a_terminal = No;
static int old_lword;
static int new_lword;
#define STDIN 0
#define STDOUT 1