Small style fixes:

- ANSIfy prototypes.
- Remove unneeded whitespace.
- Add const keyword to function where it can be used.
This commit is contained in:
Ed Schouten 2010-06-20 12:52:33 +00:00
parent 48790afa7b
commit fafb8f11c0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209366

View File

@ -210,13 +210,11 @@ static void pr_pack(char *, int, struct sockaddr_in *, struct timeval *);
static void pr_retip(struct ip *); static void pr_retip(struct ip *);
static void status(int); static void status(int);
static void stopit(int); static void stopit(int);
static void tvsub(struct timeval *, struct timeval *); static void tvsub(struct timeval *, const struct timeval *);
static void usage(void) __dead2; static void usage(void) __dead2;
int int
main(argc, argv) main(int argc, char *const *argv)
int argc;
char *const *argv;
{ {
struct sockaddr_in from, sock_in; struct sockaddr_in from, sock_in;
struct in_addr ifaddr; struct in_addr ifaddr;
@ -916,8 +914,7 @@ main(argc, argv)
* to be called from a signal handler. * to be called from a signal handler.
*/ */
void void
stopit(sig) stopit(int sig __unused)
int sig __unused;
{ {
/* /*
@ -1012,11 +1009,7 @@ pinger(void)
* program to be run without having intermingled output (or statistics!). * program to be run without having intermingled output (or statistics!).
*/ */
static void static void
pr_pack(buf, cc, from, tv) pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timeval *tv)
char *buf;
int cc;
struct sockaddr_in *from;
struct timeval *tv;
{ {
struct in_addr ina; struct in_addr ina;
u_char *cp, *dp; u_char *cp, *dp;
@ -1280,9 +1273,7 @@ pr_pack(buf, cc, from, tv)
* Checksum routine for Internet Protocol family headers (C Version) * Checksum routine for Internet Protocol family headers (C Version)
*/ */
u_short u_short
in_cksum(addr, len) in_cksum(u_short *addr, int len)
u_short *addr;
int len;
{ {
int nleft, sum; int nleft, sum;
u_short *w; u_short *w;
@ -1326,8 +1317,7 @@ in_cksum(addr, len)
* be >= in. * be >= in.
*/ */
static void static void
tvsub(out, in) tvsub(struct timeval *out, const struct timeval *in)
struct timeval *out, *in;
{ {
if ((out->tv_usec -= in->tv_usec) < 0) { if ((out->tv_usec -= in->tv_usec) < 0) {
@ -1343,15 +1333,14 @@ tvsub(out, in)
*/ */
static void static void
status(sig) status(int sig __unused)
int sig __unused;
{ {
siginfo_p = 1; siginfo_p = 1;
} }
static void static void
check_status() check_status(void)
{ {
if (siginfo_p) { if (siginfo_p) {
@ -1371,7 +1360,7 @@ check_status()
* Print out statistics, and give up. * Print out statistics, and give up.
*/ */
static void static void
finish() finish(void)
{ {
(void)signal(SIGINT, SIG_IGN); (void)signal(SIGINT, SIG_IGN);
@ -1430,8 +1419,7 @@ static char *ttab[] = {
* Print a descriptive string about an ICMP header. * Print a descriptive string about an ICMP header.
*/ */
static void static void
pr_icmph(icp) pr_icmph(struct icmp *icp)
struct icmp *icp;
{ {
switch(icp->icmp_type) { switch(icp->icmp_type) {
@ -1578,8 +1566,7 @@ pr_icmph(icp)
* Print an IP header with options. * Print an IP header with options.
*/ */
static void static void
pr_iph(ip) pr_iph(struct ip *ip)
struct ip *ip;
{ {
u_char *cp; u_char *cp;
int hlen; int hlen;
@ -1611,8 +1598,7 @@ pr_iph(ip)
* a hostname. * a hostname.
*/ */
static char * static char *
pr_addr(ina) pr_addr(struct in_addr ina)
struct in_addr ina;
{ {
struct hostent *hp; struct hostent *hp;
static char buf[16 + 3 + MAXHOSTNAMELEN]; static char buf[16 + 3 + MAXHOSTNAMELEN];
@ -1631,8 +1617,7 @@ pr_addr(ina)
* Dump some info on a returned (via ICMP) IP packet. * Dump some info on a returned (via ICMP) IP packet.
*/ */
static void static void
pr_retip(ip) pr_retip(struct ip *ip)
struct ip *ip;
{ {
u_char *cp; u_char *cp;
int hlen; int hlen;
@ -1650,7 +1635,7 @@ pr_retip(ip)
} }
static char * static char *
pr_ntime (n_time timestamp) pr_ntime(n_time timestamp)
{ {
static char buf[10]; static char buf[10];
int hour, min, sec; int hour, min, sec;
@ -1666,8 +1651,7 @@ pr_ntime (n_time timestamp)
} }
static void static void
fill(bp, patp) fill(char *bp, char *patp)
char *bp, *patp;
{ {
char *cp; char *cp;
int pat[16]; int pat[16];
@ -1703,7 +1687,7 @@ fill(bp, patp)
#define SECOPT "" #define SECOPT ""
#endif #endif
static void static void
usage() usage(void)
{ {
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",