Warnings fix; ANSIfy, constify, mark unused function parameter(s).

This commit is contained in:
Mark Murray 2002-04-28 13:00:16 +00:00
parent a53809fd7e
commit 01588bbd2b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95649
3 changed files with 13 additions and 18 deletions

View File

@ -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");

View File

@ -41,4 +41,4 @@
#define DEF_TRACEFILE "ktrace.out"
int getpoints __P((char *));
int getpoints(char *);

View File

@ -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--;