From owner-svn-src-all@freebsd.org Mon May 21 03:58:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7FAAEDB791; Mon, 21 May 2018 03:58:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77AF66AEA5; Mon, 21 May 2018 03:58:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 584061FC8A; Mon, 21 May 2018 03:58:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4L3wGri081511; Mon, 21 May 2018 03:58:16 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4L3wFji081505; Mon, 21 May 2018 03:58:15 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201805210358.w4L3wFji081505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 21 May 2018 03:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333959 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 333959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2018 03:58:17 -0000 Author: eadler Date: Mon May 21 03:58:15 2018 New Revision: 333959 URL: https://svnweb.freebsd.org/changeset/base/333959 Log: top(1): build with WARNS=3 This fixes everything but -Wincompatible-pointer-types-discards-qualifiers Modified: head/usr.bin/top/Makefile head/usr.bin/top/display.c head/usr.bin/top/display.h head/usr.bin/top/machine.h head/usr.bin/top/top.c Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Mon May 21 03:36:16 2018 (r333958) +++ head/usr.bin/top/Makefile Mon May 21 03:58:15 2018 (r333959) @@ -7,7 +7,7 @@ SRCS+= sigdesc.h top.local.h CFLAGS+= -I ${.OBJDIR} MAN= top.1 -WARNS?= 2 +WARNS?= 3 LIBADD= ncursesw m kvm jail Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Mon May 21 03:36:16 2018 (r333958) +++ head/usr.bin/top/display.c Mon May 21 03:58:15 2018 (r333959) @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -1042,14 +1043,16 @@ display_header(int t) } } -/*VARARGS2*/ void -new_message(int type, char *msgfmt, caddr_t a1, caddr_t a2, caddr_t a3) +new_message(int type, char *msgfmt, ...) { - int i; + va_list args; + size_t i; + va_start(args, msgfmt); + /* first, format the message */ - snprintf(next_msg, sizeof(next_msg), msgfmt, a1, a2, a3); + snprintf(next_msg, sizeof(next_msg), msgfmt, args); if (msglen > 0) { Modified: head/usr.bin/top/display.h ============================================================================== --- head/usr.bin/top/display.h Mon May 21 03:36:16 2018 (r333958) +++ head/usr.bin/top/display.h Mon May 21 03:58:15 2018 (r333959) @@ -27,7 +27,7 @@ void i_procstates(int total, int *brkdn); void i_swap(int *stats); void i_timeofday(time_t *tod); void i_uptime(struct timeval *bt, time_t *tod); -void new_message(); +void new_message(int type, char *msgfmt, ...); int readline(char *buffer, int size, int numeric); char *trim_header(char *text); void u_arc(int *stats); Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Mon May 21 03:36:16 2018 (r333958) +++ head/usr.bin/top/machine.h Mon May 21 03:58:15 2018 (r333959) @@ -91,4 +91,8 @@ int proc_owner(int pid); /* non-int routines typically used by the machine dependent module */ char *printable(char *string); +caddr_t +get_process_info(struct system_info *si, struct process_select *sel, + int (*compare)(const void *, const void *)); + #endif /* MACHINE_H */ Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Mon May 21 03:36:16 2018 (r333958) +++ head/usr.bin/top/top.c Mon May 21 03:58:15 2018 (r333959) @@ -221,7 +221,7 @@ char *argv[]; int displays = 0; /* indicates unspecified */ int sel_ret = 0; time_t curr_time; - char *(*get_userid)() = username; + char *(*get_userid)(int) = username; char *uname_field = "USERNAME"; char *header_text; char *env_top; @@ -625,7 +625,7 @@ restart: while ((displays == -1) || (displays-- > 0)) { - int (*compare)(); + int (*compare)(const void * const, const void * const); /* get the current stats */