From owner-svn-src-all@FreeBSD.ORG Thu Jun 11 09:02:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 972071065679; Thu, 11 Jun 2009 09:02:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 851CB8FC1C; Thu, 11 Jun 2009 09:02:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5B92MRX041207; Thu, 11 Jun 2009 09:02:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5B92MoH041206; Thu, 11 Jun 2009 09:02:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906110902.n5B92MoH041206@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Jun 2009 09:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193978 - head/usr.sbin/pstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 11 Jun 2009 09:02:23 -0000 Author: ed Date: Thu Jun 11 09:02:22 2009 New Revision: 193978 URL: http://svn.freebsd.org/changeset/base/193978 Log: Make most of pstat(8) build with WARNS=6. There is still an issue with the nlists, which I'm not quite sure how to solve, so I'm leaving WARNS set to 3 right now. Modified: head/usr.sbin/pstat/pstat.c Modified: head/usr.sbin/pstat/pstat.c ============================================================================== --- head/usr.sbin/pstat/pstat.c Thu Jun 11 07:52:35 2009 (r193977) +++ head/usr.sbin/pstat/pstat.c Thu Jun 11 09:02:22 2009 (r193978) @@ -95,7 +95,7 @@ static char *nlistf; static char *memf; static kvm_t *kd; -static char *usagestr; +static const char *usagestr; static void filemode(void); static int getfiles(char **, size_t *); @@ -109,7 +109,8 @@ main(int argc, char *argv[]) { int ch, i, quit, ret; int fileflag, ttyflag; - char buf[_POSIX2_LINE_MAX],*opts; + char buf[_POSIX2_LINE_MAX]; + const char *opts; fileflag = swapflag = ttyflag = 0; @@ -358,8 +359,8 @@ filemode(void) char *buf, flagbuf[16], *fbp; int maxf, openf; size_t len; - static char *dtypes[] = { "???", "inode", "socket", "pipe", - "fifo", "kqueue", "crypto" }; + static const char *dtypes[] = { "???", "inode", "socket", + "pipe", "fifo", "kqueue", "crypto" }; int i; int wid; @@ -466,7 +467,7 @@ print_swap_header(void) } static void -print_swap_line(const char *devname, intmax_t nblks, intmax_t bused, +print_swap_line(const char *swdevname, intmax_t nblks, intmax_t bused, intmax_t bavail, float bpercent) { char usedbuf[5]; @@ -477,7 +478,7 @@ print_swap_line(const char *devname, int pagesize = getpagesize(); getbsize(&hlen, &blocksize); - printf("%-15s %*jd ", devname, hlen, CONVERT(nblks)); + printf("%-15s %*jd ", swdevname, hlen, CONVERT(nblks)); if (humanflag) { humanize_number(usedbuf, sizeof(usedbuf), CONVERT(blocksize * bused), "",