Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/vmstat Cast the printf'ing of the 2 size_t vars in d...
details: https://anonhg.NetBSD.org/src/rev/47a61e5c2df8
branches: trunk
changeset: 518242:47a61e5c2df8
user: jmc <jmc%NetBSD.org@localhost>
date: Mon Nov 26 21:04:49 2001 +0000
description:
Cast the printf'ing of the 2 size_t vars in dohashstat to unsigned long long as
some ports have size_t's which are larger than int's.
diffstat:
usr.bin/vmstat/vmstat.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (39 lines):
diff -r bf2bd6cc931c -r 47a61e5c2df8 usr.bin/vmstat/vmstat.c
--- a/usr.bin/vmstat/vmstat.c Mon Nov 26 20:53:07 2001 +0000
+++ b/usr.bin/vmstat/vmstat.c Mon Nov 26 21:04:49 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.90 2001/11/26 14:06:31 lukem Exp $ */
+/* $NetBSD: vmstat.c,v 1.91 2001/11/26 21:04:49 jmc Exp $ */
/*-
* Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95";
#else
-__RCSID("$NetBSD: vmstat.c,v 1.90 2001/11/26 14:06:31 lukem Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.91 2001/11/26 21:04:49 jmc Exp $");
#endif
#endif /* not lint */
@@ -1278,15 +1278,17 @@
&hashaddr, sizeof(hashaddr),
hashnl[curhash->hashtbl].n_name);
if (verbose)
- printf("%s %lu, %s %p, offset %ld, elemsize %d\n",
+ printf("%s %lu, %s %p, offset %ld, elemsize %llu\n",
hashnl[curhash->hashsize].n_name + 1, hashsize,
hashnl[curhash->hashtbl].n_name + 1, hashaddr,
- (long)curhash->offset, elemsize);
+ (long)curhash->offset,
+ (unsigned long long)elemsize);
thissize = hashsize * elemsize;
if (thissize > hashbufsize) {
hashbufsize = thissize;
if ((hashbuf = realloc(hashbuf, hashbufsize)) == NULL)
- errx(1, "malloc hashbuf %d", hashbufsize);
+ errx(1, "malloc hashbuf %llu",
+ (unsigned long long)hashbufsize);
}
deref_kptr(hashaddr, hashbuf, thissize,
hashnl[curhash->hashtbl].n_name);
Home |
Main Index |
Thread Index |
Old Index