svn commit: r333949 - head/usr.bin/top

Eitan Adler eadler at FreeBSD.org
Mon May 21 00:32:50 UTC 2018


Author: eadler
Date: Mon May 21 00:32:48 2018
New Revision: 333949
URL: https://svnweb.freebsd.org/changeset/base/333949

Log:
  top(1): build with WARN=2

Modified:
  head/usr.bin/top/Makefile
  head/usr.bin/top/machine.c
  head/usr.bin/top/screen.c

Modified: head/usr.bin/top/Makefile
==============================================================================
--- head/usr.bin/top/Makefile	Mon May 21 00:20:32 2018	(r333948)
+++ head/usr.bin/top/Makefile	Mon May 21 00:32:48 2018	(r333949)
@@ -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
 

Modified: head/usr.bin/top/machine.c
==============================================================================
--- head/usr.bin/top/machine.c	Mon May 21 00:20:32 2018	(r333948)
+++ head/usr.bin/top/machine.c	Mon May 21 00:32:48 2018	(r333949)
@@ -872,7 +872,7 @@ get_process_info(struct system_info *si, struct proces
 		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)

Modified: head/usr.bin/top/screen.c
==============================================================================
--- head/usr.bin/top/screen.c	Mon May 21 00:20:32 2018	(r333948)
+++ head/usr.bin/top/screen.c	Mon May 21 00:32:48 2018	(r333949)
@@ -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


More information about the svn-src-head mailing list