diff options
author | Mark Whitley <markw@lineo.com> | 2001-01-23 22:30:04 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2001-01-23 22:30:04 +0000 |
commit | 59ab025363d884deb2013dcaae6c968585a6ec72 (patch) | |
tree | 852d97bdc34c44dbcf29cc8b5cd9257a8c90f7b3 /networking | |
parent | 2b8d07c590249991fae975652aae86f5fca91f81 (diff) | |
download | busybox-w32-59ab025363d884deb2013dcaae6c968585a6ec72.tar.gz busybox-w32-59ab025363d884deb2013dcaae6c968585a6ec72.tar.bz2 busybox-w32-59ab025363d884deb2013dcaae6c968585a6ec72.zip |
#define -> static const int. Also got rid of some big static buffers.
Diffstat (limited to 'networking')
-rw-r--r-- | networking/ping.c | 20 | ||||
-rw-r--r-- | networking/telnet.c | 28 | ||||
-rw-r--r-- | networking/wget.c | 4 |
3 files changed, 28 insertions, 24 deletions
diff --git a/networking/ping.c b/networking/ping.c index 8276dda4b..f5769b74e 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.31 2001/01/22 22:48:42 andersen Exp $ | 3 | * $Id: ping.c,v 1.32 2001/01/23 22:30:04 markw Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -58,7 +58,7 @@ | |||
58 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ | 58 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ |
59 | typedef unsigned int socklen_t; | 59 | typedef unsigned int socklen_t; |
60 | 60 | ||
61 | #define ICMP_MINLEN 8 /* abs minimum */ | 61 | static const int ICMP_MINLEN = 8; /* abs minimum */ |
62 | 62 | ||
63 | struct icmp_ra_addr | 63 | struct icmp_ra_addr |
64 | { | 64 | { |
@@ -134,13 +134,13 @@ struct icmp | |||
134 | }; | 134 | }; |
135 | #endif | 135 | #endif |
136 | 136 | ||
137 | #define DEFDATALEN 56 | 137 | static const int DEFDATALEN = 56; |
138 | #define MAXIPLEN 60 | 138 | static const int MAXIPLEN = 60; |
139 | #define MAXICMPLEN 76 | 139 | static const int MAXICMPLEN = 76; |
140 | #define MAXPACKET 65468 | 140 | static const int MAXPACKET = 65468; |
141 | #define MAX_DUP_CHK (8 * 128) | 141 | #define MAX_DUP_CHK (8 * 128) |
142 | #define MAXWAIT 10 | 142 | static const int MAXWAIT = 10; |
143 | #define PINGINTERVAL 1 /* second */ | 143 | static const int PINGINTERVAL = 1; /* second */ |
144 | 144 | ||
145 | #define O_QUIET (1 << 0) | 145 | #define O_QUIET (1 << 0) |
146 | 146 | ||
@@ -262,7 +262,7 @@ extern int ping_main(int argc, char **argv) | |||
262 | static char *hostname = NULL; | 262 | static char *hostname = NULL; |
263 | static struct sockaddr_in pingaddr; | 263 | static struct sockaddr_in pingaddr; |
264 | static int pingsock = -1; | 264 | static int pingsock = -1; |
265 | static int datalen = DEFDATALEN; | 265 | static int datalen; /* intentionally uninitialized to work around gcc bug */ |
266 | 266 | ||
267 | static long ntransmitted = 0, nreceived = 0, nrepeats = 0, pingcount = 0; | 267 | static long ntransmitted = 0, nreceived = 0, nrepeats = 0, pingcount = 0; |
268 | static int myid = 0, options = 0; | 268 | static int myid = 0, options = 0; |
@@ -508,6 +508,8 @@ extern int ping_main(int argc, char **argv) | |||
508 | { | 508 | { |
509 | char *thisarg; | 509 | char *thisarg; |
510 | 510 | ||
511 | datalen = DEFDATALEN; /* initialized here rather than in global scope to work around gcc bug */ | ||
512 | |||
511 | argc--; | 513 | argc--; |
512 | argv++; | 514 | argv++; |
513 | options = 0; | 515 | options = 0; |
diff --git a/networking/telnet.c b/networking/telnet.c index 76956e9ac..ac6813e29 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -50,7 +50,7 @@ | |||
50 | #include <netdb.h> | 50 | #include <netdb.h> |
51 | 51 | ||
52 | #if 0 | 52 | #if 0 |
53 | #define DOTRACE 1 | 53 | static const int DOTRACE = 1; |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | #ifdef DOTRACE | 56 | #ifdef DOTRACE |
@@ -67,21 +67,23 @@ | |||
67 | #include <sys/time.h> | 67 | #include <sys/time.h> |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | #define DATABUFSIZE 128 | 70 | static const int DATABUFSIZE = 128; |
71 | #define IACBUFSIZE 128 | 71 | static const int IACBUFSIZE = 128; |
72 | 72 | ||
73 | #define CHM_TRY 0 | 73 | static const int CHM_TRY = 0; |
74 | #define CHM_ON 1 | 74 | static const int CHM_ON = 1; |
75 | #define CHM_OFF 2 | 75 | static const int CHM_OFF = 2; |
76 | 76 | ||
77 | #define UF_ECHO 0x01 | 77 | static const int UF_ECHO = 0x01; |
78 | #define UF_SGA 0x02 | 78 | static const int UF_SGA = 0x02; |
79 | 79 | ||
80 | #define TS_0 1 | 80 | enum { |
81 | #define TS_IAC 2 | 81 | TS_0 = 1, |
82 | #define TS_OPT 3 | 82 | TS_IAC = 2, |
83 | #define TS_SUB1 4 | 83 | TS_OPT = 3, |
84 | #define TS_SUB2 5 | 84 | TS_SUB1 = 4, |
85 | TS_SUB2 = 5, | ||
86 | }; | ||
85 | 87 | ||
86 | #define WriteCS(fd, str) write(fd, str, sizeof str -1) | 88 | #define WriteCS(fd, str) write(fd, str, sizeof str -1) |
87 | 89 | ||
diff --git a/networking/wget.c b/networking/wget.c index a5c3e7baf..e3e6eed79 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -49,7 +49,7 @@ static char *curfile; /* Name of current file being transferred. */ | |||
49 | static struct timeval start; /* Time a transfer started. */ | 49 | static struct timeval start; /* Time a transfer started. */ |
50 | volatile unsigned long statbytes; /* Number of bytes transferred so far. */ | 50 | volatile unsigned long statbytes; /* Number of bytes transferred so far. */ |
51 | /* For progressmeter() -- number of seconds before xfer considered "stalled" */ | 51 | /* For progressmeter() -- number of seconds before xfer considered "stalled" */ |
52 | #define STALLTIME 5 | 52 | static const int STALLTIME = 5; |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | int wget_main(int argc, char **argv) | 55 | int wget_main(int argc, char **argv) |
@@ -515,7 +515,7 @@ progressmeter(int flag) | |||
515 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 515 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
516 | * SUCH DAMAGE. | 516 | * SUCH DAMAGE. |
517 | * | 517 | * |
518 | * $Id: wget.c,v 1.17 2001/01/22 22:48:42 andersen Exp $ | 518 | * $Id: wget.c,v 1.18 2001/01/23 22:30:04 markw Exp $ |
519 | */ | 519 | */ |
520 | 520 | ||
521 | 521 | ||