diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2001-08-18 00:48:58 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2001-08-18 00:48:58 +0000 |
commit | 51c6f5e0f5f6f300b649e518110808b2b6142098 (patch) | |
tree | ef4493f33798663d78e64da953be0b0a0532567b /usr.bin/ktrace | |
parent | fdaeb3d021ec2144bc6bf1bc3bd2686bdf31734a (diff) |
Add lots of missing prototypes, constify a few things. Add explicit ints.
Makes gcc much happier, less warnings.
Diffstat (limited to 'usr.bin/ktrace')
-rw-r--r-- | usr.bin/ktrace/extern.h | 29 | ||||
-rw-r--r-- | usr.bin/ktrace/ktrace.c | 20 | ||||
-rw-r--r-- | usr.bin/ktrace/subr.c | 7 |
3 files changed, 44 insertions, 12 deletions
diff --git a/usr.bin/ktrace/extern.h b/usr.bin/ktrace/extern.h new file mode 100644 index 00000000000..b64675c9a9e --- /dev/null +++ b/usr.bin/ktrace/extern.h @@ -0,0 +1,29 @@ +/* $OpenBSD: extern.h,v 1.1 2001/08/18 00:48:57 espie Exp $ */ + +/* + * Copyright (c) 2001 Marc Espie. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBSD + * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +extern int getpoints __P((const char *)); +extern const char *ioctlname __P((unsigned long)); diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c index a3aa28d606c..349e26cae84 100644 --- a/usr.bin/ktrace/ktrace.c +++ b/usr.bin/ktrace/ktrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ktrace.c,v 1.10 2001/07/12 05:17:13 deraadt Exp $ */ +/* $OpenBSD: ktrace.c,v 1.11 2001/08/18 00:48:57 espie Exp $ */ /* $NetBSD: ktrace.c,v 1.4 1995/08/31 23:01:44 jtc Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ktrace.c 8.2 (Berkeley) 4/28/95"; #endif -static char *rcsid = "$OpenBSD: ktrace.c,v 1.10 2001/07/12 05:17:13 deraadt Exp $"; +static char *rcsid = "$OpenBSD: ktrace.c,v 1.11 2001/08/18 00:48:57 espie Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -61,9 +61,11 @@ static char *rcsid = "$OpenBSD: ktrace.c,v 1.10 2001/07/12 05:17:13 deraadt Exp #include <unistd.h> #include "ktrace.h" +#include "extern.h" -void no_ktrace __P((int)); -void usage __P((void)); +static int rpid __P((const char *)); +static void no_ktrace __P((int)); +static void usage __P((void)); int main(argc, argv) @@ -123,7 +125,7 @@ main(argc, argv) argv += optind; argc -= optind; - if (pidset && *argv || !pidset && !*argv) + if ((pidset && *argv) || (!pidset && !*argv)) usage(); if (inherit) @@ -171,9 +173,9 @@ main(argc, argv) exit(0); } -int +static int rpid(p) - char *p; + const char *p; { static int first; @@ -188,7 +190,7 @@ rpid(p) return(atoi(p)); } -void +static void usage() { (void)fprintf(stderr, @@ -196,7 +198,7 @@ usage() exit(1); } -void +static void no_ktrace(sig) int sig; { diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c index 5965c3c5789..80d51d0f10d 100644 --- a/usr.bin/ktrace/subr.c +++ b/usr.bin/ktrace/subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr.c,v 1.3 2001/07/12 05:17:13 deraadt Exp $ */ +/* $OpenBSD: subr.c,v 1.4 2001/08/18 00:48:57 espie Exp $ */ /* $NetBSD: subr.c,v 1.6 1995/08/31 23:01:45 jtc Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)subr.c 8.2 (Berkeley) 4/28/95"; #endif -static char *rcsid = "$OpenBSD: subr.c,v 1.3 2001/07/12 05:17:13 deraadt Exp $"; +static char *rcsid = "$OpenBSD: subr.c,v 1.4 2001/08/18 00:48:57 espie Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -51,10 +51,11 @@ static char *rcsid = "$OpenBSD: subr.c,v 1.3 2001/07/12 05:17:13 deraadt Exp $"; #include <stdio.h> #include "ktrace.h" +#include "extern.h" int getpoints(s) - char *s; + const char *s; { int facs = 0; |