More egcs warning fixes:

o main returns int not void
	o use braces to avoid potentially ambiguous else

Note: The fix to natd is potentially functional in nature since I used
the indentation as the right thing rather than the struct semantics.
Someone more familiar with the code should double check me on this one.

Reviewed by: obrien and chuckr
This commit is contained in:
Warner Losh 1999-04-25 22:33:30 +00:00
parent dcb0ae4ed8
commit ebe70c8f68
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46080
3 changed files with 10 additions and 9 deletions

View File

@ -30,7 +30,7 @@
#ifndef lint #ifndef lint
static const char rcsid[] = static const char rcsid[] =
"$Id: fsdb.c,v 1.10 1998/06/15 07:12:19 charnier Exp $"; "$Id: fsdb.c,v 1.11 1998/11/09 03:43:55 truckman Exp $";
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
@ -69,7 +69,7 @@ char nflag = 0;
* fsreadfd is set up to read from the file system, fswritefd to write to * fsreadfd is set up to read from the file system, fswritefd to write to
* the file system. * the file system.
*/ */
void int
main(argc, argv) main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];

View File

@ -9,7 +9,7 @@
* *
* Ari Suutari <suutari@iki.fi> * Ari Suutari <suutari@iki.fi>
* *
* $Id: natd.c,v 1.13 1999/03/24 20:30:48 brian Exp $ * $Id: natd.c,v 1.14 1999/03/30 10:11:21 brian Exp $
*/ */
#define SYSLOG_NAMES #define SYSLOG_NAMES
@ -480,14 +480,14 @@ static void DoAliasing (int fd, int direction)
* This is a IP packet. * This is a IP packet.
*/ */
ip = (struct ip*) packetBuf; ip = (struct ip*) packetBuf;
if (direction == DONT_KNOW) if (direction == DONT_KNOW) {
if (packetAddr.sin_addr.s_addr == INADDR_ANY) if (packetAddr.sin_addr.s_addr == INADDR_ANY)
direction = OUTPUT; direction = OUTPUT;
else else
direction = INPUT; direction = INPUT;
}
if (verbose) { if (verbose) {
/* /*
* Print packet direction and protocol type. * Print packet direction and protocol type.
*/ */
@ -1406,10 +1406,10 @@ void SetupPortRedirect (const char* parms)
ptr = strtok (NULL, " \t"); ptr = strtok (NULL, " \t");
if (ptr) { if (ptr) {
separator = strchr (ptr, ':'); separator = strchr (ptr, ':');
if (separator) if (separator) {
if (StrToAddrAndPortRange (ptr, &remoteAddr, protoName, &portRange) != 0) if (StrToAddrAndPortRange (ptr, &remoteAddr, protoName, &portRange) != 0)
errx (1, "redirect_port: invalid remote port range"); errx (1, "redirect_port: invalid remote port range");
else { } else {
SETLOPORT(portRange, 0); SETLOPORT(portRange, 0);
SETNUMPORTS(portRange, 1); SETNUMPORTS(portRange, 1);
StrToAddr (ptr, &remoteAddr); StrToAddr (ptr, &remoteAddr);

View File

@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
#endif #endif
static const char rcsid[] = static const char rcsid[] =
"$Id: ping.c,v 1.41 1998/08/26 18:51:37 des Exp $"; "$Id: ping.c,v 1.42 1999/01/06 07:54:28 imp Exp $";
#endif /* not lint */ #endif /* not lint */
/* /*
@ -1013,13 +1013,14 @@ finish()
(void)printf("%ld packets received, ", nreceived); (void)printf("%ld packets received, ", nreceived);
if (nrepeats) if (nrepeats)
(void)printf("+%ld duplicates, ", nrepeats); (void)printf("+%ld duplicates, ", nrepeats);
if (ntransmitted) if (ntransmitted) {
if (nreceived > ntransmitted) if (nreceived > ntransmitted)
(void)printf("-- somebody's printing up packets!"); (void)printf("-- somebody's printing up packets!");
else else
(void)printf("%d%% packet loss", (void)printf("%d%% packet loss",
(int) (((ntransmitted - nreceived) * 100) / (int) (((ntransmitted - nreceived) * 100) /
ntransmitted)); ntransmitted));
}
(void)putchar('\n'); (void)putchar('\n');
if (nreceived && timing) { if (nreceived && timing) {
double n = nreceived + nrepeats; double n = nreceived + nrepeats;