summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchl <chl@openbsd.org>2007-12-28 19:22:07 +0000
committerchl <chl@openbsd.org>2007-12-28 19:22:07 +0000
commite9cb8ef5db7e8b54839e01050858cceeb39c0b4b (patch)
treecabbfc3b1621d95cd5d5799803da573ddcbe9a18
parentprintf field widths are always int, so add a cast to remove (diff)
downloadwireguard-openbsd-e9cb8ef5db7e8b54839e01050858cceeb39c0b4b.tar.xz
wireguard-openbsd-e9cb8ef5db7e8b54839e01050858cceeb39c0b4b.zip
printf field widths are always int, so add casts to remove
"warning: field width is not type int" "looks good" otto@
-rw-r--r--usr.sbin/pstat/pstat.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c
index d7c10939292..58cbeeaa03c 100644
--- a/usr.sbin/pstat/pstat.c
+++ b/usr.sbin/pstat/pstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pstat.c,v 1.71 2007/12/08 18:23:24 deraadt Exp $ */
+/* $OpenBSD: pstat.c,v 1.72 2007/12/28 19:22:07 chl Exp $ */
/* $NetBSD: pstat.c,v 1.27 1996/10/23 22:50:06 cgd Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
from: static char sccsid[] = "@(#)pstat.c 8.9 (Berkeley) 2/16/94";
#else
-static char *rcsid = "$OpenBSD: pstat.c,v 1.71 2007/12/08 18:23:24 deraadt Exp $";
+static char *rcsid = "$OpenBSD: pstat.c,v 1.72 2007/12/28 19:22:07 chl Exp $";
#endif
#endif /* not lint */
@@ -395,7 +395,7 @@ vnodemode(void)
void
vnode_header(void)
{
- (void)printf("%*s TYP VFLAG USE HOLD", 2 * sizeof(long), "ADDR");
+ (void)printf("%*s TYP VFLAG USE HOLD", 2 * (int)sizeof(long), "ADDR");
}
void
@@ -459,7 +459,7 @@ vnode_print(struct vnode *avnode, struct vnode *vp)
if (flag == 0)
*fp++ = '-';
*fp = '\0';
- (void)printf("%0*lx %s %5s %4d %4u", 2 * sizeof(long),
+ (void)printf("%0*lx %s %5s %4d %4u", 2 * (int)sizeof(long),
(long)avnode, type, flags, vp->v_usecount, vp->v_holdcnt);
}
@@ -1033,12 +1033,12 @@ filemode(void)
(void)printf("%d/%d open files\n", nfile, maxfile);
(void)printf("%*s TYPE FLG CNT MSG %*s OFFSET\n",
- 2 * sizeof(long), "LOC", 2 * sizeof(long), "DATA");
+ 2 * (int)sizeof(long), "LOC", 2 * (int)sizeof(long), "DATA");
for (; (char *)ffp < buf + len; addr = LIST_NEXT(ffp, f_list), ffp++) {
memmove(&fp, ffp, sizeof fp);
if ((unsigned)fp.f_type > DTYPE_SOCKET)
continue;
- (void)printf("%0*lx ", 2 * sizeof(long), (long)addr);
+ (void)printf("%0*lx ", 2 * (int)sizeof(long), (long)addr);
(void)printf("%-8.8s", dtypes[fp.f_type]);
fbp = flagbuf;
if (fp.f_flag & FREAD)
@@ -1054,7 +1054,7 @@ filemode(void)
*fbp = '\0';
(void)printf("%6s %3ld", flagbuf, fp.f_count);
(void)printf(" %3ld", fp.f_msgcount);
- (void)printf(" %0*lx", 2 * sizeof(long), (long)fp.f_data);
+ (void)printf(" %0*lx", 2 * (int)sizeof(long), (long)fp.f_data);
if (fp.f_offset < 0)
(void)printf(" %llx\n", (long long)fp.f_offset);