Module Name: src
Committed By: lukem
Date: Sat Apr 18 13:37:05 UTC 2009
Modified Files:
src/usr.sbin/sa: main.c pdb.c
Log Message:
Fix WARNS=4 issues (-Wcast-qual -Wsign-compare).
XXX: could improve parsing of -v option and store "cutoff" as a uint64_t.
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/sa/main.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sa/pdb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/sa/main.c
diff -u src/usr.sbin/sa/main.c:1.22 src/usr.sbin/sa/main.c:1.23
--- src/usr.sbin/sa/main.c:1.22 Mon Jul 21 13:36:59 2008
+++ src/usr.sbin/sa/main.c Sat Apr 18 13:37:04 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.22 2008/07/21 13:36:59 lukem Exp $ */
+/* $NetBSD: main.c,v 1.23 2009/04/18 13:37:04 lukem Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -39,7 +39,7 @@
__COPYRIGHT("@(#) Copyright (c) 1994\
Christopher G. Demetriou. All rights reserved.");
-__RCSID("$NetBSD: main.c,v 1.22 2008/07/21 13:36:59 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.23 2009/04/18 13:37:04 lukem Exp $");
#endif
/*
@@ -76,7 +76,7 @@
int Kflag, lflag, mflag, qflag, rflag, sflag, tflag, uflag, vflag;
int cutoff = 1;
-static char *dfltargv[] = { _PATH_ACCT };
+static char *dfltargv[] = { __UNCONST(_PATH_ACCT), 0 };
static int dfltargc = (sizeof(dfltargv)/sizeof(char *));
/* default to comparing by sum of user + system time */
@@ -303,7 +303,7 @@
{
struct acct ac;
struct cmdinfo ci;
- int i;
+ size_t i;
FILE *fp;
/*
Index: src/usr.sbin/sa/pdb.c
diff -u src/usr.sbin/sa/pdb.c:1.12 src/usr.sbin/sa/pdb.c:1.13
--- src/usr.sbin/sa/pdb.c:1.12 Wed Nov 12 13:31:08 2003
+++ src/usr.sbin/sa/pdb.c Sat Apr 18 13:37:04 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pdb.c,v 1.12 2003/11/12 13:31:08 grant Exp $ */
+/* $NetBSD: pdb.c,v 1.13 2009/04/18 13:37:04 lukem Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: pdb.c,v 1.12 2003/11/12 13:31:08 grant Exp $");
+__RCSID("$NetBSD: pdb.c,v 1.13 2009/04/18 13:37:04 lukem Exp $");
#endif
#include <sys/types.h>
@@ -261,7 +261,7 @@
/* add to total */
add_ci(&ci, &ci_total);
- if (vflag && ci.ci_calls <= cutoff &&
+ if (vflag && ci.ci_calls <= (unsigned)cutoff &&
(fflag || check_junk(&ci))) {
/* put it into **junk** */
add_ci(&ci, &ci_junk);