diff options
author | markm <markm@FreeBSD.org> | 2002-04-28 13:00:16 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2002-04-28 13:00:16 +0000 |
commit | a735b516ebec1518595a2eb97a5ae183fd23eb76 (patch) | |
tree | 5c65f0d45ed0409c5af85c8f07289379f48a6eca | |
parent | 2f918abe2e1548bd71fae31eb0fda40c5b8d3e4b (diff) | |
download | FreeBSD-src-a735b516ebec1518595a2eb97a5ae183fd23eb76.zip FreeBSD-src-a735b516ebec1518595a2eb97a5ae183fd23eb76.tar.gz |
Warnings fix; ANSIfy, constify, mark unused function parameter(s).
-rw-r--r-- | usr.bin/ktrace/ktrace.c | 17 | ||||
-rw-r--r-- | usr.bin/ktrace/ktrace.h | 2 | ||||
-rw-r--r-- | usr.bin/ktrace/subr.c | 12 |
3 files changed, 13 insertions, 18 deletions
diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c index a9e2252..a71136b 100644 --- a/usr.bin/ktrace/ktrace.c +++ b/usr.bin/ktrace/ktrace.c @@ -55,20 +55,21 @@ __FBSDID("$FreeBSD$"); #include <sys/ktrace.h> #include <err.h> +#include <stdlib.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "ktrace.h" +static char def_tracefile[] = DEF_TRACEFILE; + static void no_ktrace(int); static int rpid(char *); static void usage(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { enum { NOTSET, CLEAR, CLEARALL } clear; int append, ch, fd, inherit, ops, pid, pidset, trpoints; @@ -79,7 +80,7 @@ main(argc, argv) clear = NOTSET; append = ops = pidset = inherit = 0; trpoints = DEF_POINTS; - tracefile = DEF_TRACEFILE; + tracefile = def_tracefile; while ((ch = getopt(argc,argv,"aCcdf:g:ip:t:")) != -1) switch((char)ch) { case 'a': @@ -171,8 +172,7 @@ main(argc, argv) } static int -rpid(p) - char *p; +rpid(char *p) { static int first; @@ -188,7 +188,7 @@ rpid(p) } static void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n", "usage: ktrace [-aCcdi] [-f trfile] [-g pgrp | -p pid] [-t cnisuw]", @@ -197,8 +197,7 @@ usage() } static void -no_ktrace(sig) - int sig __unused; +no_ktrace(int sig __unused) { (void)fprintf(stderr, "error:\tktrace() system call not supported in the running kernel\n\tre-compile kernel with 'options KTRACE'\n"); diff --git a/usr.bin/ktrace/ktrace.h b/usr.bin/ktrace/ktrace.h index 2f22ce3..058fbd7 100644 --- a/usr.bin/ktrace/ktrace.h +++ b/usr.bin/ktrace/ktrace.h @@ -41,4 +41,4 @@ #define DEF_TRACEFILE "ktrace.out" -int getpoints __P((char *)); +int getpoints(char *); diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c index f7c324c..3996914 100644 --- a/usr.bin/ktrace/subr.c +++ b/usr.bin/ktrace/subr.c @@ -56,8 +56,7 @@ void timevalsub(struct timeval *, struct timeval *); void timevalfix(struct timeval *); int -getpoints(s) - char *s; +getpoints(char *s) { int facs = 0; @@ -93,8 +92,7 @@ getpoints(s) } void -timevaladd(t1, t2) - struct timeval *t1, *t2; +timevaladd(struct timeval *t1, struct timeval *t2) { t1->tv_sec += t2->tv_sec; t1->tv_usec += t2->tv_usec; @@ -102,8 +100,7 @@ timevaladd(t1, t2) } void -timevalsub(t1, t2) - struct timeval *t1, *t2; +timevalsub(struct timeval *t1, struct timeval *t2) { t1->tv_sec -= t2->tv_sec; t1->tv_usec -= t2->tv_usec; @@ -111,8 +108,7 @@ timevalsub(t1, t2) } void -timevalfix(t1) - struct timeval *t1; +timevalfix(struct timeval *t1) { if (t1->tv_usec < 0) { t1->tv_sec--; |