From 36ae1097e8d0480642d6c8a57330a7b2a690f05e Mon Sep 17 00:00:00 2001 From: joerg Date: Tue, 30 Aug 2011 20:45:31 +0000 Subject: [PATCH] static + ANSIfy + __dead --- usr.sbin/spray/spray.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/usr.sbin/spray/spray.c b/usr.sbin/spray/spray.c index 03b7b9325521..f1d7813cd553 100644 --- a/usr.sbin/spray/spray.c +++ b/usr.sbin/spray/spray.c @@ -1,4 +1,4 @@ -/* $NetBSD: spray.c,v 1.6 2009/04/18 14:01:37 lukem Exp $ */ +/* $NetBSD: spray.c,v 1.7 2011/08/30 20:45:31 joerg Exp $ */ /* * Copyright (c) 1993 Winning Strategies, Inc. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: spray.c,v 1.6 2009/04/18 14:01:37 lukem Exp $"); +__RCSID("$NetBSD: spray.c,v 1.7 2011/08/30 20:45:31 joerg Exp $"); #endif #include @@ -46,22 +46,19 @@ __RCSID("$NetBSD: spray.c,v 1.6 2009/04/18 14:01:37 lukem Exp $"); #define SPRAYOVERHEAD 86 #endif -int main __P((int, char **)); -void print_xferstats __P((int, int, double)); -void usage __P((void)); +static void print_xferstats(int, int, double); +__dead static void usage(void); /* spray buffer */ -char spray_buffer[SPRAYMAX]; +static char spray_buffer[SPRAYMAX]; /* RPC timeouts */ -struct timeval NO_DEFAULT = { -1, -1 }; -struct timeval ONE_WAY = { 0, 0 }; -struct timeval TIMEOUT = { 25, 0 }; +static struct timeval NO_DEFAULT = { -1, -1 }; +static struct timeval ONE_WAY = { 0, 0 }; +static struct timeval TIMEOUT = { 25, 0 }; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { char *progname; spraycumul host_stats; @@ -197,11 +194,8 @@ main(argc, argv) } -void -print_xferstats(packets, packetlen, xfertime) - int packets; - int packetlen; - double xfertime; +static void +print_xferstats(int packets, int packetlen, double xfertime) { int datalen; double pps; /* packets per second */ @@ -221,9 +215,8 @@ print_xferstats(packets, packetlen, xfertime) printf("bytes/sec\n"); } - -void -usage () +static void +usage(void) { fprintf(stderr, "usage: spray [-c count] [-l length] [-d delay] host\n"); exit(1);