From 2eed19721721e7deb6198b26700bad2cc33404a6 Mon Sep 17 00:00:00 2001 From: guenther Date: Sun, 14 Aug 2016 22:47:26 +0000 Subject: [PATCH] Convert %q to %ll and cast opaque system values to long long. Use uint64_t for the KERN_INTRCNT_CNT sysctl() ok krw@ --- usr.bin/vmstat/vmstat.c | 11 +++++------ usr.sbin/pstat/pstat.c | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 71246fb85fb..10f1d74572d 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1,5 +1,5 @@ /* $NetBSD: vmstat.c,v 1.29.4.1 1996/06/05 00:21:05 cgd Exp $ */ -/* $OpenBSD: vmstat.c,v 1.140 2016/07/27 14:44:59 tedu Exp $ */ +/* $OpenBSD: vmstat.c,v 1.141 2016/08/14 22:47:26 guenther Exp $ */ /* * Copyright (c) 1980, 1986, 1991, 1993 @@ -424,9 +424,8 @@ printhdr(void) /* * Force a header to be prepended to the next output. */ -/* ARGSUSED */ void -needhdr(int signo) +needhdr(__unused int signo) { hdrcnt = 1; @@ -689,7 +688,7 @@ dointr(void) inttotal = 0; for (i = 0; i < nintr; i++) { char name[128]; - u_quad_t cnt; + uint64_t cnt; int vector; mib[0] = CTL_KERN; @@ -747,7 +746,7 @@ domem(void) int i, j, len, size, first, mib[4]; u_long totuse = 0, totfree = 0; char buf[BUFSIZ], *bufp, *ap; - quad_t totreq = 0; + unsigned long long totreq = 0; const char *name; size_t siz; @@ -893,7 +892,7 @@ domem(void) totreq += ks->ks_calls; } (void)printf("\nMemory Totals: In Use Free Requests\n"); - (void)printf(" %7luK %6luK %8qu\n", + (void)printf(" %7luK %6luK %8llu\n", (totuse + 1023) / 1024, (totfree + 1023) / 1024, totreq); } diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index a282e77e803..2c555476aa7 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pstat.c,v 1.107 2016/07/18 11:48:55 guenther Exp $ */ +/* $OpenBSD: pstat.c,v 1.108 2016/08/14 22:47:26 guenther Exp $ */ /* $NetBSD: pstat.c,v 1.27 1996/10/23 22:50:06 cgd Exp $ */ /*- @@ -530,7 +530,7 @@ ufs_print(struct vnode *vp) else (void)printf(" %7s", name); else - (void)printf(" %7qd", ip->i_ffs1_size); + (void)printf(" %7lld", (long long)ip->i_ffs1_size); return (0); } @@ -630,7 +630,7 @@ nfs_print(struct vnode *vp) else (void)printf(" %7s", name); else - (void)printf(" %7qd", np->n_size); + (void)printf(" %7lld", (long long)np->n_size); return (0); } -- 2.20.1