Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/vmstat Use u_long to avoid negative value outputs.



details:   https://anonhg.NetBSD.org/src/rev/742ee44f5db4
branches:  trunk
changeset: 797277:742ee44f5db4
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Sat Jul 12 20:04:31 2014 +0000

description:
Use u_long to avoid negative value outputs.

diffstat:

 usr.bin/vmstat/vmstat.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r fb0aabd42b53 -r 742ee44f5db4 usr.bin/vmstat/vmstat.c
--- a/usr.bin/vmstat/vmstat.c   Sat Jul 12 20:03:19 2014 +0000
+++ b/usr.bin/vmstat/vmstat.c   Sat Jul 12 20:04:31 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.202 2014/06/14 04:06:54 joerg Exp $ */
+/* $NetBSD: vmstat.c,v 1.203 2014/07/12 20:04:31 nakayama Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
 #if 0
 static char sccsid[] = "@(#)vmstat.c   8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.202 2014/06/14 04:06:54 joerg Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.203 2014/07/12 20:04:31 nakayama Exp $");
 #endif
 #endif /* not lint */
 
@@ -304,7 +304,7 @@
 void   getnlist(int);
 long   getuptime(void);
 void   printhdr(void);
-long   pct(long, long);
+long   pct(u_long, u_long);
 __dead static void     usage(void);
 void   doforkst(void);
 
@@ -852,7 +852,7 @@
 }
 
 long
-pct(long top, long bot)
+pct(u_long top, u_long bot)
 {
        long ans;
 
@@ -862,7 +862,7 @@
        return (ans);
 }
 
-#define        PCT(top, bot) (int)pct((long)(top), (long)(bot))
+#define        PCT(top, bot) (int)pct((u_long)(top), (u_long)(bot))
 
 void
 dosum(void)



Home | Main Index | Thread Index | Old Index