Module Name: src
Committed By: lukem
Date: Thu Apr 16 06:14:13 UTC 2009
Modified Files:
src/usr.sbin/lockstat: elf32.c main.c
Log Message:
Fix -Wsign-compare issues
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/lockstat/elf32.c
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/lockstat/main.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/lockstat/elf32.c
diff -u src/usr.sbin/lockstat/elf32.c:1.7 src/usr.sbin/lockstat/elf32.c:1.8
--- src/usr.sbin/lockstat/elf32.c:1.7 Mon Apr 28 20:24:16 2008
+++ src/usr.sbin/lockstat/elf32.c Thu Apr 16 06:14:13 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: elf32.c,v 1.7 2008/04/28 20:24:16 martin Exp $ */
+/* $NetBSD: elf32.c,v 1.8 2009/04/16 06:14:13 lukem Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
-__RCSID("$NetBSD: elf32.c,v 1.7 2008/04/28 20:24:16 martin Exp $");
+__RCSID("$NetBSD: elf32.c,v 1.8 2009/04/16 06:14:13 lukem Exp $");
#endif
#ifndef ELFSIZE
@@ -168,7 +168,8 @@
{
static int lastptr[FIND_MAX];
uintptr_t sa, ea;
- int i, rv, st, off;
+ int i, rv, off;
+ Elf_Byte st;
switch (find) {
case LOCK_BYNAME:
Index: src/usr.sbin/lockstat/main.c
diff -u src/usr.sbin/lockstat/main.c:1.16 src/usr.sbin/lockstat/main.c:1.17
--- src/usr.sbin/lockstat/main.c:1.16 Sat Mar 21 13:02:19 2009
+++ src/usr.sbin/lockstat/main.c Thu Apr 16 06:14:13 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.16 2009/03/21 13:02:19 ad Exp $ */
+/* $NetBSD: main.c,v 1.17 2009/04/16 06:14:13 lukem Exp $ */
/*-
* Copyright (c) 2006, 2007, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.16 2009/03/21 13:02:19 ad Exp $");
+__RCSID("$NetBSD: main.c,v 1.17 2009/04/16 06:14:13 lukem Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -159,7 +159,8 @@
int
main(int argc, char **argv)
{
- int eventtype, locktype, ch, nlfd, fd, i;
+ int eventtype, locktype, ch, nlfd, fd;
+ size_t i;
bool sflag, pflag, mflag, Mflag;
const char *nlistf, *outf;
char *lockname, *funcname;
@@ -327,7 +328,7 @@
}
if ((bufs = malloc(ld.ld_size)) == NULL)
err(EXIT_FAILURE, "cannot allocate memory for user buffers");
- if (read(lsfd, bufs, ld.ld_size) != ld.ld_size)
+ if ((size_t)read(lsfd, bufs, ld.ld_size) != ld.ld_size)
err(EXIT_FAILURE, "reading from " _PATH_DEV_LOCKSTAT);
if (close(lsfd))
err(EXIT_FAILURE, "close(" _PATH_DEV_LOCKSTAT ")");
@@ -554,7 +555,7 @@
lock_t *
morelocks(void)
{
- const static int batch = 32;
+ const int batch = 32;
lock_t *l, *lp, *max;
l = (lock_t *)malloc(sizeof(*l) * batch);