From owner-svn-src-all@FreeBSD.ORG Sat Dec 17 19:22:24 2011 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 C4D311065672; Sat, 17 Dec 2011 19:22:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9941B8FC15; Sat, 17 Dec 2011 19:22:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBHJMOB7073244; Sat, 17 Dec 2011 19:22:24 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBHJMOq8073242; Sat, 17 Dec 2011 19:22:24 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201112171922.pBHJMOq8073242@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Dec 2011 19:22:24 +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: r228654 - head/usr.bin/vmstat 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: Sat, 17 Dec 2011 19:22:24 -0000 Author: dim Date: Sat Dec 17 19:22:24 2011 New Revision: 228654 URL: http://svn.freebsd.org/changeset/base/228654 Log: In usr.bin/vmstat/vmstat.c, cast several printf field widths to int, and use printf format specifiers from inttypes.h for uint64_t's. MFC after: 1 week Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Sat Dec 17 19:21:40 2011 (r228653) +++ head/usr.bin/vmstat/vmstat.c Sat Dec 17 19:22:24 2011 (r228654) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1185,18 +1186,18 @@ dointr(void) istrnamlen = clen; tintrname += clen + 1; } - (void)printf("%-*s %20s %10s\n", istrnamlen, "interrupt", "total", + (void)printf("%-*s %20s %10s\n", (int)istrnamlen, "interrupt", "total", "rate"); inttotal = 0; for (i = 0; i < nintr; i++) { if (intrname[0] != '\0' && (*intrcnt != 0 || aflag)) - (void)printf("%-*s %20lu %10lu\n", istrnamlen, intrname, - *intrcnt, *intrcnt / uptime); + (void)printf("%-*s %20lu %10lu\n", (int)istrnamlen, + intrname, *intrcnt, *intrcnt / uptime); intrname += strlen(intrname) + 1; inttotal += *intrcnt++; } - (void)printf("%-*s %20llu %10llu\n", istrnamlen, "Total", - (long long)inttotal, (long long)(inttotal / uptime)); + (void)printf("%-*s %20" PRIu64 " %10" PRIu64 "\n", (int)istrnamlen, + "Total", inttotal, inttotal / uptime); } static void @@ -1235,9 +1236,9 @@ domemstat_malloc(void) if (memstat_get_numallocs(mtp) == 0 && memstat_get_count(mtp) == 0) continue; - printf("%13s %5lld %5lldK %7s %8lld ", + printf("%13s %5" PRIu64 " %5" PRIu64 "K %7s %8" PRIu64 " ", memstat_get_name(mtp), memstat_get_count(mtp), - ((int64_t)memstat_get_bytes(mtp) + 1023) / 1024, "-", + (memstat_get_bytes(mtp) + 1023) / 1024, "-", memstat_get_numallocs(mtp)); first = 1; for (i = 0; i < 32; i++) { @@ -1289,7 +1290,8 @@ domemstat_zone(void) mtp = memstat_mtl_next(mtp)) { strlcpy(name, memstat_get_name(mtp), MEMTYPE_MAXNAME); strcat(name, ":"); - printf("%-20s %6llu, %6llu,%8llu,%8llu,%8llu,%4llu,%4llu\n",name, + printf("%-20s %6" PRIu64 ", %6" PRIu64 ",%8" PRIu64 ",%8" PRIu64 + ",%8" PRIu64 ",%4" PRIu64 ",%4" PRIu64 "\n", name, memstat_get_size(mtp), memstat_get_countlimit(mtp), memstat_get_count(mtp), memstat_get_free(mtp), memstat_get_numallocs(mtp), memstat_get_failures(mtp),