aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-10-29 11:46:52 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-10-29 11:46:52 +0200
commitfb132e47370378474c68ad22c1c0cb2ccee178de (patch)
tree4f78d0fdd1c2fa2341c7d9bb17f9d98d099a238c
parent66cb7bed33da605674c3d24734466b8e8a60e337 (diff)
downloadbusybox-w32-fb132e47370378474c68ad22c1c0cb2ccee178de.tar.gz
busybox-w32-fb132e47370378474c68ad22c1c0cb2ccee178de.tar.bz2
busybox-w32-fb132e47370378474c68ad22c1c0cb2ccee178de.zip
whitespace cleanup
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--archival/ar.c16
-rw-r--r--archival/bz/bzlib.c2
-rw-r--r--archival/bz/compress.c9
-rw-r--r--archival/dpkg.c11
-rw-r--r--archival/dpkg_deb.c10
-rw-r--r--archival/libunarchive/decompress_bunzip2.c4
-rw-r--r--console-tools/kbd_mode.c4
-rw-r--r--console-tools/loadfont.c8
-rw-r--r--console-tools/showkey.c12
-rw-r--r--coreutils/date.c2
-rw-r--r--coreutils/dd.c2
-rw-r--r--coreutils/mv.c2
-rw-r--r--coreutils/nice.c6
-rw-r--r--coreutils/od.c4
-rw-r--r--coreutils/sort.c4
-rw-r--r--coreutils/test.c6
-rw-r--r--coreutils/tr.c8
-rw-r--r--coreutils/wc.c6
-rw-r--r--e2fsprogs/old_e2fsprogs/e2fsck.h2
-rw-r--r--editors/awk.c14
-rw-r--r--editors/diff.c2
-rw-r--r--editors/sed.c6
-rw-r--r--include/grp_.h2
-rw-r--r--include/platform.h2
-rw-r--r--include/pwd_.h2
-rw-r--r--include/rtc_.h4
-rw-r--r--libbb/hash_md5_sha.c8
-rw-r--r--libbb/pw_encrypt_sha.c6
-rw-r--r--libbb/simplify_path.c10
-rw-r--r--libpwdgrp/pwd_grp_internal.c4
-rw-r--r--miscutils/conspy.c8
-rw-r--r--miscutils/ubi_attach_detach.c4
-rw-r--r--modutils/rmmod.c4
-rw-r--r--networking/httpd.c4
-rw-r--r--networking/inetd.c2
-rw-r--r--networking/ip.c4
-rw-r--r--networking/ipcalc.c6
-rw-r--r--networking/libiproute/ip_parse_common_args.c15
-rw-r--r--networking/libiproute/ipaddress.c10
-rw-r--r--networking/libiproute/iplink.c6
-rw-r--r--networking/libiproute/iproute.c15
-rw-r--r--networking/libiproute/iprule.c21
-rw-r--r--networking/libiproute/iptunnel.c10
-rw-r--r--networking/libiproute/libnetlink.c12
-rw-r--r--networking/libiproute/libnetlink.h10
-rw-r--r--networking/libiproute/ll_addr.c12
-rw-r--r--networking/libiproute/ll_map.c15
-rw-r--r--networking/libiproute/ll_proto.c12
-rw-r--r--networking/libiproute/ll_types.c12
-rw-r--r--networking/libiproute/rt_names.c12
-rw-r--r--networking/libiproute/rtm_map.c13
-rw-r--r--networking/libiproute/utils.c4
-rw-r--r--networking/libiproute/utils.h6
-rw-r--r--networking/nameif.c4
-rw-r--r--networking/netstat.c2
-rw-r--r--networking/ntpd.c6
-rw-r--r--networking/ntpd_simple.c2
-rw-r--r--networking/slattach.c4
-rw-r--r--networking/telnetd.c6
-rw-r--r--networking/vconfig.c4
-rw-r--r--networking/wget.c6
-rw-r--r--procps/iostat.c10
-rw-r--r--procps/mpstat.c14
-rw-r--r--procps/sysctl.c2
-rw-r--r--selinux/sestatus.c8
-rw-r--r--shell/ash_test/recho.c13
-rw-r--r--shell/ash_test/zecho.c5
-rw-r--r--util-linux/fbset.c6
-rw-r--r--util-linux/hexdump.c12
69 files changed, 231 insertions, 268 deletions
diff --git a/archival/ar.c b/archival/ar.c
index 05556c6cb..730d7c6c6 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -179,17 +179,17 @@ static void FAST_FUNC header_verbose_list_ar(const file_header_t *file_header)
179 ); 179 );
180} 180}
181 181
182#define AR_OPT_VERBOSE (1 << 0) 182#define AR_OPT_VERBOSE (1 << 0)
183#define AR_OPT_PRESERVE_DATE (1 << 1) 183#define AR_OPT_PRESERVE_DATE (1 << 1)
184/* "ar r" implies create, but warns about it. c suppresses warning. 184/* "ar r" implies create, but warns about it. c suppresses warning.
185 * bbox accepts but ignores it: */ 185 * bbox accepts but ignores it: */
186#define AR_OPT_CREATE (1 << 2) 186#define AR_OPT_CREATE (1 << 2)
187 187
188#define AR_CMD_PRINT (1 << 3) 188#define AR_CMD_PRINT (1 << 3)
189#define FIRST_CMD AR_CMD_PRINT 189#define FIRST_CMD AR_CMD_PRINT
190#define AR_CMD_LIST (1 << 4) 190#define AR_CMD_LIST (1 << 4)
191#define AR_CMD_EXTRACT (1 << 5) 191#define AR_CMD_EXTRACT (1 << 5)
192#define AR_CMD_INSERT (1 << 6) 192#define AR_CMD_INSERT (1 << 6)
193 193
194int ar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 194int ar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
195int ar_main(int argc UNUSED_PARAM, char **argv) 195int ar_main(int argc UNUSED_PARAM, char **argv)
diff --git a/archival/bz/bzlib.c b/archival/bz/bzlib.c
index 834179403..b3beeabed 100644
--- a/archival/bz/bzlib.c
+++ b/archival/bz/bzlib.c
@@ -28,7 +28,7 @@ in the file LICENSE.
28 * 0.9.0a/b -- no changes in this file. 28 * 0.9.0a/b -- no changes in this file.
29 * 0.9.0c -- made zero-length BZ_FLUSH work correctly in bzCompress(). 29 * 0.9.0c -- made zero-length BZ_FLUSH work correctly in bzCompress().
30 * fixed bzWrite/bzRead to ignore zero-length requests. 30 * fixed bzWrite/bzRead to ignore zero-length requests.
31 * fixed bzread to correctly handle read requests after EOF. 31 * fixed bzread to correctly handle read requests after EOF.
32 * wrong parameter order in call to bzDecompressInit in 32 * wrong parameter order in call to bzDecompressInit in
33 * bzBuffToBuffDecompress. Fixed. 33 * bzBuffToBuffDecompress. Fixed.
34 */ 34 */
diff --git a/archival/bz/compress.c b/archival/bz/compress.c
index b9b0949a9..6f1c70a08 100644
--- a/archival/bz/compress.c
+++ b/archival/bz/compress.c
@@ -134,15 +134,14 @@ void generateMTFValues(EState* s)
134 * holds the original block data. 134 * holds the original block data.
135 * 135 *
136 * The first thing to do is generate the MTF values, 136 * The first thing to do is generate the MTF values,
137 * and put them in 137 * and put them in ((uint16_t*)s->arr1)[0 .. s->nblock-1].
138 * ((uint16_t*)s->arr1)[0 .. s->nblock-1]. 138 *
139 * Because there are strictly fewer or equal MTF values 139 * Because there are strictly fewer or equal MTF values
140 * than block values, ptr values in this area are overwritten 140 * than block values, ptr values in this area are overwritten
141 * with MTF values only when they are no longer needed. 141 * with MTF values only when they are no longer needed.
142 * 142 *
143 * The final compressed bitstream is generated into the 143 * The final compressed bitstream is generated into the
144 * area starting at 144 * area starting at &((uint8_t*)s->arr2)[s->nblock]
145 * &((uint8_t*)s->arr2)[s->nblock]
146 * 145 *
147 * These storage aliases are set up in bzCompressInit(), 146 * These storage aliases are set up in bzCompressInit(),
148 * except for the last one, which is arranged in 147 * except for the last one, which is arranged in
@@ -459,7 +458,7 @@ void sendMTFValues(EState* s)
459 } 458 }
460 459
461 AssertH(nGroups < 8, 3002); 460 AssertH(nGroups < 8, 3002);
462 AssertH(nSelectors < 32768 && nSelectors <= (2 + (900000 / BZ_G_SIZE)), 3003); 461 AssertH(nSelectors < 32768 && nSelectors <= (2 + (900000 / BZ_G_SIZE)), 3003);
463 462
464 /*--- Compute MTF values for the selectors. ---*/ 463 /*--- Compute MTF values for the selectors. ---*/
465 { 464 {
diff --git a/archival/dpkg.c b/archival/dpkg.c
index 508b4297b..53e30d541 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -939,8 +939,8 @@ static int package_satisfies_dependency(int package, int depend_type)
939 return 0; 939 return 0;
940 940
941 switch (depend_type) { 941 switch (depend_type) {
942 case EDGE_PRE_DEPENDS: return get_status(status_num, 3) == search_name_hashtable("installed"); 942 case EDGE_PRE_DEPENDS: return get_status(status_num, 3) == search_name_hashtable("installed");
943 case EDGE_DEPENDS: return get_status(status_num, 1) == search_name_hashtable("install"); 943 case EDGE_DEPENDS: return get_status(status_num, 1) == search_name_hashtable("install");
944 } 944 }
945 return 0; 945 return 0;
946} 946}
@@ -967,7 +967,7 @@ static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count
967 conflicts[conflicts_num] = package_num; 967 conflicts[conflicts_num] = package_num;
968 conflicts_num++; 968 conflicts_num++;
969 /* add provides to conflicts list */ 969 /* add provides to conflicts list */
970 for (j = 0; j < package_hashtable[package_num]->num_of_edges; j++) { 970 for (j = 0; j < package_hashtable[package_num]->num_of_edges; j++) {
971 if (package_hashtable[package_num]->edge[j]->type == EDGE_PROVIDES) { 971 if (package_hashtable[package_num]->edge[j]->type == EDGE_PROVIDES) {
972 const int conflicts_package_num = search_package_hashtable( 972 const int conflicts_package_num = search_package_hashtable(
973 package_hashtable[package_num]->edge[j]->name, 973 package_hashtable[package_num]->edge[j]->name,
@@ -1067,12 +1067,13 @@ static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count
1067 1067
1068 if (package_edge->type == EDGE_OR_PRE_DEPENDS 1068 if (package_edge->type == EDGE_OR_PRE_DEPENDS
1069 || package_edge->type == EDGE_OR_DEPENDS 1069 || package_edge->type == EDGE_OR_DEPENDS
1070 ) { /* start an EDGE_OR_ list */ 1070 ) {
1071 /* start an EDGE_OR_ list */
1071 number_of_alternatives = package_edge->version; 1072 number_of_alternatives = package_edge->version;
1072 root_of_alternatives = package_edge; 1073 root_of_alternatives = package_edge;
1073 continue; 1074 continue;
1074 } 1075 }
1075 if (number_of_alternatives == 0) { /* not in the middle of an EDGE_OR_ list */ 1076 if (number_of_alternatives == 0) { /* not in the middle of an EDGE_OR_ list */
1076 number_of_alternatives = 1; 1077 number_of_alternatives = 1;
1077 root_of_alternatives = NULL; 1078 root_of_alternatives = NULL;
1078 } 1079 }
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index 4c627e890..0ce7c02d8 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -7,11 +7,11 @@
7#include "libbb.h" 7#include "libbb.h"
8#include "unarchive.h" 8#include "unarchive.h"
9 9
10#define DPKG_DEB_OPT_CONTENTS 1 10#define DPKG_DEB_OPT_CONTENTS 1
11#define DPKG_DEB_OPT_CONTROL 2 11#define DPKG_DEB_OPT_CONTROL 2
12#define DPKG_DEB_OPT_FIELD 4 12#define DPKG_DEB_OPT_FIELD 4
13#define DPKG_DEB_OPT_EXTRACT 8 13#define DPKG_DEB_OPT_EXTRACT 8
14#define DPKG_DEB_OPT_EXTRACT_VERBOSE 16 14#define DPKG_DEB_OPT_EXTRACT_VERBOSE 16
15 15
16int dpkg_deb_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 16int dpkg_deb_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
17int dpkg_deb_main(int argc, char **argv) 17int dpkg_deb_main(int argc, char **argv)
diff --git a/archival/libunarchive/decompress_bunzip2.c b/archival/libunarchive/decompress_bunzip2.c
index 549c8b19f..cf6e1988f 100644
--- a/archival/libunarchive/decompress_bunzip2.c
+++ b/archival/libunarchive/decompress_bunzip2.c
@@ -86,8 +86,8 @@ struct bunzip_data {
86 86
87 /* Big things go last (register-relative addressing can be larger for big offsets) */ 87 /* Big things go last (register-relative addressing can be larger for big offsets) */
88 uint32_t crc32Table[256]; 88 uint32_t crc32Table[256];
89 unsigned char selectors[32768]; /* nSelectors=15 bits */ 89 unsigned char selectors[32768]; /* nSelectors=15 bits */
90 struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */ 90 struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
91}; 91};
92/* typedef struct bunzip_data bunzip_data; -- done in .h file */ 92/* typedef struct bunzip_data bunzip_data; -- done in .h file */
93 93
diff --git a/console-tools/kbd_mode.c b/console-tools/kbd_mode.c
index 14f2ae516..1481d0dbb 100644
--- a/console-tools/kbd_mode.c
+++ b/console-tools/kbd_mode.c
@@ -16,9 +16,9 @@ int kbd_mode_main(int argc UNUSED_PARAM, char **argv)
16{ 16{
17 enum { 17 enum {
18 SCANCODE = (1 << 0), 18 SCANCODE = (1 << 0),
19 ASCII = (1 << 1), 19 ASCII = (1 << 1),
20 MEDIUMRAW = (1 << 2), 20 MEDIUMRAW = (1 << 2),
21 UNICODE = (1 << 3), 21 UNICODE = (1 << 3),
22 }; 22 };
23 int fd; 23 int fd;
24 unsigned opt; 24 unsigned opt;
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 3c77813b5..079626c20 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -136,7 +136,7 @@ static void do_loadfont(int fd, unsigned char *inbuf, int height, int width, int
136 * Example: 136 * Example:
137 * At the font position for a capital A-ring glyph, we 137 * At the font position for a capital A-ring glyph, we
138 * may have: 138 * may have:
139 * 00C5,212B,FFFE,0041,030A,FFFF 139 * 00C5,212B,FFFE,0041,030A,FFFF
140 * Some font positions may be described by sequences only, 140 * Some font positions may be described by sequences only,
141 * namely when there is no precomposed Unicode value for the glyph. 141 * namely when there is no precomposed Unicode value for the glyph.
142 */ 142 */
@@ -159,7 +159,7 @@ static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize,
159 int glyph; 159 int glyph;
160 uint16_t unicode; 160 uint16_t unicode;
161 161
162 maxct = tailsz; /* more than enough */ 162 maxct = tailsz; /* more than enough */
163 up = xmalloc(maxct * sizeof(*up)); 163 up = xmalloc(maxct * sizeof(*up));
164 164
165 for (glyph = 0; glyph < fontsize; glyph++) { 165 for (glyph = 0; glyph < fontsize; glyph++) {
@@ -255,10 +255,10 @@ static void do_load(int fd, unsigned char *buffer, size_t len)
255 } else 255 } else
256#endif 256#endif
257#if ENABLE_FEATURE_LOADFONT_RAW 257#if ENABLE_FEATURE_LOADFONT_RAW
258 if (len == 9780) { /* file with three code pages? */ 258 if (len == 9780) { /* file with three code pages? */
259 charsize = height = 16; 259 charsize = height = 16;
260 font += 40; 260 font += 40;
261 } else if ((len & 0377) == 0) { /* bare font */ 261 } else if ((len & 0377) == 0) { /* bare font */
262 charsize = height = len / 256; 262 charsize = height = len / 256;
263 } else 263 } else
264#endif 264#endif
diff --git a/console-tools/showkey.c b/console-tools/showkey.c
index b29c84d6a..e7834f702 100644
--- a/console-tools/showkey.c
+++ b/console-tools/showkey.c
@@ -16,9 +16,9 @@ struct globals {
16 struct termios tio, tio0; 16 struct termios tio, tio0;
17}; 17};
18#define G (*ptr_to_globals) 18#define G (*ptr_to_globals)
19#define kbmode (G.kbmode) 19#define kbmode (G.kbmode)
20#define tio (G.tio) 20#define tio (G.tio)
21#define tio0 (G.tio0) 21#define tio0 (G.tio0)
22#define INIT_G() do { \ 22#define INIT_G() do { \
23 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ 23 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
24} while (0) 24} while (0)
@@ -46,9 +46,9 @@ int showkey_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
46int showkey_main(int argc UNUSED_PARAM, char **argv) 46int showkey_main(int argc UNUSED_PARAM, char **argv)
47{ 47{
48 enum { 48 enum {
49 OPT_a = (1<<0), // display the decimal/octal/hex values of the keys 49 OPT_a = (1<<0), // display the decimal/octal/hex values of the keys
50 OPT_k = (1<<1), // display only the interpreted keycodes (default) 50 OPT_k = (1<<1), // display only the interpreted keycodes (default)
51 OPT_s = (1<<2), // display only the raw scan-codes 51 OPT_s = (1<<2), // display only the raw scan-codes
52 }; 52 };
53 53
54 INIT_G(); 54 INIT_G();
diff --git a/coreutils/date.c b/coreutils/date.c
index 87cc8f2ef..a8040757d 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -278,7 +278,7 @@ int date_main(int argc UNUSED_PARAM, char **argv)
278 } 278 }
279 279
280 /* Correct any day of week and day of year etc. fields */ 280 /* Correct any day of week and day of year etc. fields */
281 tm_time.tm_isdst = -1; /* Be sure to recheck dst */ 281 tm_time.tm_isdst = -1; /* Be sure to recheck dst */
282 ts.tv_sec = validate_tm_time(date_str, &tm_time); 282 ts.tv_sec = validate_tm_time(date_str, &tm_time);
283 283
284 maybe_set_utc(opt); 284 maybe_set_utc(opt);
diff --git a/coreutils/dd.c b/coreutils/dd.c
index aa6f765ce..347a19454 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -24,7 +24,7 @@ static const struct suffix_mult dd_suffixes[] = {
24 { "b", 512 }, 24 { "b", 512 },
25 { "kD", 1000 }, 25 { "kD", 1000 },
26 { "k", 1024 }, 26 { "k", 1024 },
27 { "K", 1024 }, /* compat with coreutils dd */ 27 { "K", 1024 }, /* compat with coreutils dd */
28 { "MD", 1000000 }, 28 { "MD", 1000000 },
29 { "M", 1048576 }, 29 { "M", 1048576 },
30 { "GD", 1000000000 }, 30 { "GD", 1000000000 },
diff --git a/coreutils/mv.c b/coreutils/mv.c
index 245639bd0..399f391b2 100644
--- a/coreutils/mv.c
+++ b/coreutils/mv.c
@@ -92,7 +92,7 @@ int mv_main(int argc, char **argv)
92 || (flags & OPT_FILEUTILS_INTERACTIVE)) 92 || (flags & OPT_FILEUTILS_INTERACTIVE))
93 ) { 93 ) {
94 if (fprintf(stderr, "mv: overwrite '%s'? ", dest) < 0) { 94 if (fprintf(stderr, "mv: overwrite '%s'? ", dest) < 0) {
95 goto RET_1; /* Ouch! fprintf failed! */ 95 goto RET_1; /* Ouch! fprintf failed! */
96 } 96 }
97 if (!bb_ask_confirmation()) { 97 if (!bb_ask_confirmation()) {
98 goto RET_0; 98 goto RET_0;
diff --git a/coreutils/nice.c b/coreutils/nice.c
index 6b8fce24d..35d6bf3d9 100644
--- a/coreutils/nice.c
+++ b/coreutils/nice.c
@@ -17,12 +17,12 @@ int nice_main(int argc, char **argv)
17 17
18 old_priority = getpriority(PRIO_PROCESS, 0); 18 old_priority = getpriority(PRIO_PROCESS, 0);
19 19
20 if (!*++argv) { /* No args, so (GNU) output current nice value. */ 20 if (!*++argv) { /* No args, so (GNU) output current nice value. */
21 printf("%d\n", old_priority); 21 printf("%d\n", old_priority);
22 fflush_stdout_and_exit(EXIT_SUCCESS); 22 fflush_stdout_and_exit(EXIT_SUCCESS);
23 } 23 }
24 24
25 adjustment = 10; /* Set default adjustment. */ 25 adjustment = 10; /* Set default adjustment. */
26 26
27 if (argv[0][0] == '-') { 27 if (argv[0][0] == '-') {
28 if (argv[0][1] == 'n') { /* -n */ 28 if (argv[0][1] == 'n') { /* -n */
@@ -32,7 +32,7 @@ int nice_main(int argc, char **argv)
32 } else { /* -NNN (NNN may be negative) == -n NNN */ 32 } else { /* -NNN (NNN may be negative) == -n NNN */
33 argv[0] += 1; argv--; argc++; 33 argv[0] += 1; argv--; argc++;
34 } 34 }
35 if (argc < 4) { /* Missing priority and/or utility! */ 35 if (argc < 4) { /* Missing priority and/or utility! */
36 bb_show_usage(); 36 bb_show_usage();
37 } 37 }
38 adjustment = xatoi_range(argv[1], INT_MIN/2, INT_MAX/2); 38 adjustment = xatoi_range(argv[1], INT_MIN/2, INT_MAX/2);
diff --git a/coreutils/od.c b/coreutils/od.c
index dcd693446..e62711671 100644
--- a/coreutils/od.c
+++ b/coreutils/od.c
@@ -4,7 +4,7 @@
4 * Based on code from util-linux v 2.11l 4 * Based on code from util-linux v 2.11l
5 * 5 *
6 * Copyright (c) 1990 6 * Copyright (c) 1990
7 * The Regents of the University of California. All rights reserved. 7 * The Regents of the University of California. All rights reserved.
8 * 8 *
9 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 * 10 *
@@ -174,7 +174,7 @@ int od_main(int argc, char **argv)
174 bb_dump_add(dumper, "\" \""); 174 bb_dump_add(dumper, "\" \"");
175 } 175 }
176 bb_dump_add(dumper, add_strings[(int)od_o2si[(p - od_opts)]]); 176 bb_dump_add(dumper, add_strings[(int)od_o2si[(p - od_opts)]]);
177 } else { /* P, p, s, w, or other unhandled */ 177 } else { /* P, p, s, w, or other unhandled */
178 bb_show_usage(); 178 bb_show_usage();
179 } 179 }
180 } 180 }
diff --git a/coreutils/sort.c b/coreutils/sort.c
index eccc2d437..3562464d1 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -52,8 +52,8 @@ enum {
52static char key_separator; 52static char key_separator;
53 53
54static struct sort_key { 54static struct sort_key {
55 struct sort_key *next_key; /* linked list */ 55 struct sort_key *next_key; /* linked list */
56 unsigned range[4]; /* start word, start char, end word, end char */ 56 unsigned range[4]; /* start word, start char, end word, end char */
57 unsigned flags; 57 unsigned flags;
58} *key_list; 58} *key_list;
59 59
diff --git a/coreutils/test.c b/coreutils/test.c
index f18e3ae5a..6524c4f07 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -49,9 +49,9 @@
49 * state. */ 49 * state. */
50 50
51/* test(1) accepts the following grammar: 51/* test(1) accepts the following grammar:
52 oexpr ::= aexpr | aexpr "-o" oexpr ; 52 oexpr ::= aexpr | aexpr "-o" oexpr ;
53 aexpr ::= nexpr | nexpr "-a" aexpr ; 53 aexpr ::= nexpr | nexpr "-a" aexpr ;
54 nexpr ::= primary | "!" primary 54 nexpr ::= primary | "!" primary
55 primary ::= unary-operator operand 55 primary ::= unary-operator operand
56 | operand binary-operator operand 56 | operand binary-operator operand
57 | operand 57 | operand
diff --git a/coreutils/tr.c b/coreutils/tr.c
index d6bc7d20a..21d77ef95 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -203,7 +203,7 @@ static unsigned expand(const char *arg, char **buffer_p)
203 buffer[pos++] = *arg; /* copy CHAR */ 203 buffer[pos++] = *arg; /* copy CHAR */
204 if (!arg[0] || arg[1] != '=' || arg[2] != ']') 204 if (!arg[0] || arg[1] != '=' || arg[2] != ']')
205 bb_show_usage(); 205 bb_show_usage();
206 arg += 3; /* skip CHAR=] */ 206 arg += 3; /* skip CHAR=] */
207 continue; 207 continue;
208 } 208 }
209 /* The rest of "[xyz..." cases is treated as normal 209 /* The rest of "[xyz..." cases is treated as normal
@@ -258,9 +258,9 @@ int tr_main(int argc UNUSED_PARAM, char **argv)
258 char *invec = vector + ASCII; 258 char *invec = vector + ASCII;
259 char *outvec = vector + ASCII * 2; 259 char *outvec = vector + ASCII * 2;
260 260
261#define TR_OPT_complement (3 << 0) 261#define TR_OPT_complement (3 << 0)
262#define TR_OPT_delete (1 << 2) 262#define TR_OPT_delete (1 << 2)
263#define TR_OPT_squeeze_reps (1 << 3) 263#define TR_OPT_squeeze_reps (1 << 3)
264 264
265 for (i = 0; i < ASCII; i++) { 265 for (i = 0; i < ASCII; i++) {
266 vector[i] = i; 266 vector[i] = i;
diff --git a/coreutils/wc.c b/coreutils/wc.c
index ecadae59b..fe3f274f8 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -153,7 +153,7 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
153 bb_simple_perror_msg(arg); 153 bb_simple_perror_msg(arg);
154 status = EXIT_FAILURE; 154 status = EXIT_FAILURE;
155 } 155 }
156 goto DO_EOF; /* Treat an EOF as '\r'. */ 156 goto DO_EOF; /* Treat an EOF as '\r'. */
157 } 157 }
158 158
159 /* Cater for -c and -m */ 159 /* Cater for -c and -m */
@@ -179,7 +179,7 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
179 */ 179 */
180 if (c == '\t') { 180 if (c == '\t') {
181 linepos = (linepos | 7) + 1; 181 linepos = (linepos | 7) + 1;
182 } else { /* '\n', '\r', '\f', or '\v' */ 182 } else { /* '\n', '\r', '\f', or '\v' */
183 DO_EOF: 183 DO_EOF:
184 if (linepos > counts[WC_LENGTH]) { 184 if (linepos > counts[WC_LENGTH]) {
185 counts[WC_LENGTH] = linepos; 185 counts[WC_LENGTH] = linepos;
@@ -230,7 +230,7 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
230 * effect of trashing the totals array after outputting it, but that's 230 * effect of trashing the totals array after outputting it, but that's
231 * irrelavent since we no longer need it. */ 231 * irrelavent since we no longer need it. */
232 if (num_files > 1) { 232 if (num_files > 1) {
233 num_files = 0; /* Make sure we don't get here again. */ 233 num_files = 0; /* Make sure we don't get here again. */
234 arg = "total"; 234 arg = "total";
235 pcounts = totals; 235 pcounts = totals;
236 --argv; 236 --argv;
diff --git a/e2fsprogs/old_e2fsprogs/e2fsck.h b/e2fsprogs/old_e2fsprogs/e2fsck.h
index fdfa2d84a..330209d69 100644
--- a/e2fsprogs/old_e2fsprogs/e2fsck.h
+++ b/e2fsprogs/old_e2fsprogs/e2fsck.h
@@ -629,7 +629,7 @@ struct e2fsck_struct {
629}; 629};
630 630
631 631
632#define tid_gt(x, y) ((x - y) > 0) 632#define tid_gt(x, y) ((x - y) > 0)
633 633
634static inline int tid_geq(tid_t x, tid_t y) 634static inline int tid_geq(tid_t x, tid_t y)
635{ 635{
diff --git a/editors/awk.c b/editors/awk.c
index 8bc56756c..2eeb9d77a 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -277,10 +277,10 @@ enum {
277 277
278/* tokens and their corresponding info values */ 278/* tokens and their corresponding info values */
279 279
280#define NTC "\377" /* switch to next token class (tc<<1) */ 280#define NTC "\377" /* switch to next token class (tc<<1) */
281#define NTCC '\377' 281#define NTCC '\377'
282 282
283#define OC_B OC_BUILTIN 283#define OC_B OC_BUILTIN
284 284
285static const char tokenlist[] ALIGN1 = 285static const char tokenlist[] ALIGN1 =
286 "\1(" NTC 286 "\1(" NTC
@@ -368,7 +368,7 @@ static const uint32_t tokeninfo[] = {
368 OC_B|B_ss|P(0x8f), OC_FBLTIN|F_ti, OC_B|B_ti|P(0x0b), OC_B|B_mt|P(0x0b), 368 OC_B|B_ss|P(0x8f), OC_FBLTIN|F_ti, OC_B|B_ti|P(0x0b), OC_B|B_mt|P(0x0b),
369 OC_B|B_lo|P(0x49), OC_B|B_up|P(0x49), 369 OC_B|B_lo|P(0x49), OC_B|B_up|P(0x49),
370 OC_GETLINE|SV|P(0), 370 OC_GETLINE|SV|P(0),
371 0, 0, 371 0, 0,
372 0, 372 0,
373 0 /* END */ 373 0 /* END */
374}; 374};
@@ -380,7 +380,7 @@ enum {
380 ORS, RS, RT, FILENAME, 380 ORS, RS, RT, FILENAME,
381 SUBSEP, F0, ARGIND, ARGC, 381 SUBSEP, F0, ARGIND, ARGC,
382 ARGV, ERRNO, FNR, NR, 382 ARGV, ERRNO, FNR, NR,
383 NF, IGNORECASE, ENVIRON, NUM_INTERNAL_VARS 383 NF, IGNORECASE, ENVIRON, NUM_INTERNAL_VARS
384}; 384};
385 385
386static const char vNames[] ALIGN1 = 386static const char vNames[] ALIGN1 =
@@ -2335,7 +2335,7 @@ static var *evaluate(node *op, var *res)
2335#define fnargs (G.evaluate__fnargs) 2335#define fnargs (G.evaluate__fnargs)
2336/* seed is initialized to 1 */ 2336/* seed is initialized to 1 */
2337#define seed (G.evaluate__seed) 2337#define seed (G.evaluate__seed)
2338#define sreg (G.evaluate__sreg) 2338#define sreg (G.evaluate__sreg)
2339 2339
2340 var *v1; 2340 var *v1;
2341 2341
@@ -2611,7 +2611,7 @@ static var *evaluate(node *op, var *res)
2611 rsm->F = popen(L.s, "r"); 2611 rsm->F = popen(L.s, "r");
2612 rsm->is_pipe = TRUE; 2612 rsm->is_pipe = TRUE;
2613 } else { 2613 } else {
2614 rsm->F = fopen_for_read(L.s); /* not xfopen! */ 2614 rsm->F = fopen_for_read(L.s); /* not xfopen! */
2615 } 2615 }
2616 } 2616 }
2617 } else { 2617 } else {
diff --git a/editors/diff.c b/editors/diff.c
index d9d709db6..cc7ba472e 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -230,7 +230,7 @@ static int search(const int *c, int k, int y, const struct cand *list)
230{ 230{
231 int i, j; 231 int i, j;
232 232
233 if (list[c[k]].y < y) /* quick look for typical case */ 233 if (list[c[k]].y < y) /* quick look for typical case */
234 return k + 1; 234 return k + 1;
235 235
236 for (i = 0, j = k + 1;;) { 236 for (i = 0, j = k + 1;;) {
diff --git a/editors/sed.c b/editors/sed.c
index 964d0405e..b91acfb7f 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -117,9 +117,9 @@ struct globals {
117 char *add_cmd_line; 117 char *add_cmd_line;
118 118
119 struct pipeline { 119 struct pipeline {
120 char *buf; /* Space to hold string */ 120 char *buf; /* Space to hold string */
121 int idx; /* Space used */ 121 int idx; /* Space used */
122 int len; /* Space allocated */ 122 int len; /* Space allocated */
123 } pipeline; 123 } pipeline;
124} FIX_ALIASING; 124} FIX_ALIASING;
125#define G (*(struct globals*)&bb_common_bufsiz1) 125#define G (*(struct globals*)&bb_common_bufsiz1)
diff --git a/include/grp_.h b/include/grp_.h
index 7a95f88a6..5c24d558a 100644
--- a/include/grp_.h
+++ b/include/grp_.h
@@ -18,7 +18,7 @@
18 02111-1307 USA. 18 02111-1307 USA.
19 */ 19 */
20/* 20/*
21 * POSIX Standard: 9.2.1 Group Database Access <grp.h> 21 * POSIX Standard: 9.2.1 Group Database Access <grp.h>
22 */ 22 */
23#ifndef BB_GRP_H 23#ifndef BB_GRP_H
24#define BB_GRP_H 1 24#define BB_GRP_H 1
diff --git a/include/platform.h b/include/platform.h
index 855cb289c..2666eebee 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -155,7 +155,7 @@
155# include <sex.h> 155# include <sex.h>
156#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ 156#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \
157 || defined(__APPLE__) 157 || defined(__APPLE__)
158# include <sys/resource.h> /* rlimit */ 158# include <sys/resource.h> /* rlimit */
159# include <machine/endian.h> 159# include <machine/endian.h>
160# define bswap_64 __bswap64 160# define bswap_64 __bswap64
161# define bswap_32 __bswap32 161# define bswap_32 __bswap32
diff --git a/include/pwd_.h b/include/pwd_.h
index aa63ac940..e40b71dab 100644
--- a/include/pwd_.h
+++ b/include/pwd_.h
@@ -18,7 +18,7 @@
18 02111-1307 USA. */ 18 02111-1307 USA. */
19 19
20/* 20/*
21 * POSIX Standard: 9.2.2 User Database Access <pwd.h> 21 * POSIX Standard: 9.2.2 User Database Access <pwd.h>
22 */ 22 */
23 23
24#ifndef BB_PWD_H 24#ifndef BB_PWD_H
diff --git a/include/rtc_.h b/include/rtc_.h
index bd322c940..750fc20ec 100644
--- a/include/rtc_.h
+++ b/include/rtc_.h
@@ -35,9 +35,9 @@ struct linux_rtc_time {
35}; 35};
36 36
37struct linux_rtc_wkalrm { 37struct linux_rtc_wkalrm {
38 unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */ 38 unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */
39 unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */ 39 unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */
40 struct linux_rtc_time time; /* time the alarm is set to */ 40 struct linux_rtc_time time; /* time the alarm is set to */
41}; 41};
42 42
43/* 43/*
diff --git a/libbb/hash_md5_sha.c b/libbb/hash_md5_sha.c
index e427f6080..b87d1dde8 100644
--- a/libbb/hash_md5_sha.c
+++ b/libbb/hash_md5_sha.c
@@ -158,11 +158,11 @@ static void FAST_FUNC md5_process_block64(md5_ctx_t *ctx)
158 }; 158 };
159 static const char P_array[] ALIGN1 = { 159 static const char P_array[] ALIGN1 = {
160# if MD5_SIZE_VS_SPEED > 1 160# if MD5_SIZE_VS_SPEED > 1
161 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */ 161 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */
162# endif 162# endif
163 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, /* 2 */ 163 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, /* 2 */
164 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, /* 3 */ 164 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, /* 3 */
165 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9 /* 4 */ 165 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9 /* 4 */
166 }; 166 };
167#endif 167#endif
168 uint32_t *words = (void*) ctx->wbuffer; 168 uint32_t *words = (void*) ctx->wbuffer;
diff --git a/libbb/pw_encrypt_sha.c b/libbb/pw_encrypt_sha.c
index 070e0d442..e46848b71 100644
--- a/libbb/pw_encrypt_sha.c
+++ b/libbb/pw_encrypt_sha.c
@@ -196,9 +196,9 @@ sha_crypt(/*const*/ char *key_data, /*const*/ char *salt_data)
196//TODO: replace with something like 196//TODO: replace with something like
197// bb_uuencode(cp, src, length, bb_uuenc_tbl_XXXbase64); 197// bb_uuencode(cp, src, length, bb_uuenc_tbl_XXXbase64);
198#define b64_from_24bit(B2, B1, B0, N) \ 198#define b64_from_24bit(B2, B1, B0, N) \
199do { \ 199do { \
200 unsigned w = ((B2) << 16) | ((B1) << 8) | (B0); \ 200 unsigned w = ((B2) << 16) | ((B1) << 8) | (B0); \
201 resptr = to64(resptr, w, N); \ 201 resptr = to64(resptr, w, N); \
202} while (0) 202} while (0)
203 if (is_sha512 == '5') { 203 if (is_sha512 == '5') {
204 unsigned i = 0; 204 unsigned i = 0;
diff --git a/libbb/simplify_path.c b/libbb/simplify_path.c
index 3818d32be..89dc5bdf2 100644
--- a/libbb/simplify_path.c
+++ b/libbb/simplify_path.c
@@ -15,17 +15,17 @@ char* FAST_FUNC bb_simplify_abs_path_inplace(char *start)
15 p = s = start; 15 p = s = start;
16 do { 16 do {
17 if (*p == '/') { 17 if (*p == '/') {
18 if (*s == '/') { /* skip duplicate (or initial) slash */ 18 if (*s == '/') { /* skip duplicate (or initial) slash */
19 continue; 19 continue;
20 } 20 }
21 if (*s == '.') { 21 if (*s == '.') {
22 if (s[1] == '/' || !s[1]) { /* remove extra '.' */ 22 if (s[1] == '/' || !s[1]) { /* remove extra '.' */
23 continue; 23 continue;
24 } 24 }
25 if ((s[1] == '.') && (s[2] == '/' || !s[2])) { 25 if ((s[1] == '.') && (s[2] == '/' || !s[2])) {
26 ++s; 26 ++s;
27 if (p > start) { 27 if (p > start) {
28 while (*--p != '/') /* omit previous dir */ 28 while (*--p != '/') /* omit previous dir */
29 continue; 29 continue;
30 } 30 }
31 continue; 31 continue;
@@ -35,8 +35,8 @@ char* FAST_FUNC bb_simplify_abs_path_inplace(char *start)
35 *++p = *s; 35 *++p = *s;
36 } while (*++s); 36 } while (*++s);
37 37
38 if ((p == start) || (*p != '/')) { /* not a trailing slash */ 38 if ((p == start) || (*p != '/')) { /* not a trailing slash */
39 ++p; /* so keep last character */ 39 ++p; /* so keep last character */
40 } 40 }
41 *p = '\0'; 41 *p = '\0';
42 return p; 42 return p;
diff --git a/libpwdgrp/pwd_grp_internal.c b/libpwdgrp/pwd_grp_internal.c
index 04e436fae..d6483be84 100644
--- a/libpwdgrp/pwd_grp_internal.c
+++ b/libpwdgrp/pwd_grp_internal.c
@@ -37,12 +37,12 @@ int GETXXKEY_R_FUNC(GETXXKEY_R_KEYTYPE key,
37 while (1) { 37 while (1) {
38 rv = bb__pgsreader(GETXXKEY_R_PARSER, resultbuf, buffer, buflen, stream); 38 rv = bb__pgsreader(GETXXKEY_R_PARSER, resultbuf, buffer, buflen, stream);
39 if (!rv) { 39 if (!rv) {
40 if (GETXXKEY_R_TEST(resultbuf)) { /* Found key? */ 40 if (GETXXKEY_R_TEST(resultbuf)) { /* found key? */
41 *result = resultbuf; 41 *result = resultbuf;
42 break; 42 break;
43 } 43 }
44 } else { 44 } else {
45 if (rv == ENOENT) { /* end-of-file encountered. */ 45 if (rv == ENOENT) { /* EOF encountered */
46 rv = 0; 46 rv = 0;
47 } 47 }
48 break; 48 break;
diff --git a/miscutils/conspy.c b/miscutils/conspy.c
index 040fa86f3..723b4208a 100644
--- a/miscutils/conspy.c
+++ b/miscutils/conspy.c
@@ -420,19 +420,19 @@ int conspy_main(int argc UNUSED_PARAM, char **argv)
420 420
421 if (G.remote.cursor_x < G.x) { 421 if (G.remote.cursor_x < G.x) {
422 G.x = G.remote.cursor_x; 422 G.x = G.remote.cursor_x;
423 i = 0; // force refresh 423 i = 0; // force refresh
424 } 424 }
425 if (nx > G.x) { 425 if (nx > G.x) {
426 G.x = nx; 426 G.x = nx;
427 i = 0; // force refresh 427 i = 0; // force refresh
428 } 428 }
429 if (G.remote.cursor_y < G.y) { 429 if (G.remote.cursor_y < G.y) {
430 G.y = G.remote.cursor_y; 430 G.y = G.remote.cursor_y;
431 i = 0; // force refresh 431 i = 0; // force refresh
432 } 432 }
433 if (ny > G.y) { 433 if (ny > G.y) {
434 G.y = ny; 434 G.y = ny;
435 i = 0; // force refresh 435 i = 0; // force refresh
436 } 436 }
437 } 437 }
438 438
diff --git a/miscutils/ubi_attach_detach.c b/miscutils/ubi_attach_detach.c
index 18ffd4df2..b74d97b68 100644
--- a/miscutils/ubi_attach_detach.c
+++ b/miscutils/ubi_attach_detach.c
@@ -26,8 +26,8 @@
26#include "libbb.h" 26#include "libbb.h"
27#include <mtd/ubi-user.h> 27#include <mtd/ubi-user.h>
28 28
29#define OPTION_M (1 << 0) 29#define OPTION_M (1 << 0)
30#define OPTION_D (1 << 1) 30#define OPTION_D (1 << 1)
31 31
32#define do_attach (ENABLE_UBIATTACH && \ 32#define do_attach (ENABLE_UBIATTACH && \
33 (!ENABLE_UBIDETACH || (applet_name[3] == 'a'))) 33 (!ENABLE_UBIDETACH || (applet_name[3] == 'a')))
diff --git a/modutils/rmmod.c b/modutils/rmmod.c
index dde77731f..2486511d7 100644
--- a/modutils/rmmod.c
+++ b/modutils/rmmod.c
@@ -35,9 +35,9 @@ int rmmod_main(int argc UNUSED_PARAM, char **argv)
35 /* Parse command line. */ 35 /* Parse command line. */
36 n = getopt32(argv, "wfas"); // -s ignored 36 n = getopt32(argv, "wfas"); // -s ignored
37 argv += optind; 37 argv += optind;
38 if (n & 1) // --wait 38 if (n & 1) // --wait
39 flags &= ~O_NONBLOCK; 39 flags &= ~O_NONBLOCK;
40 if (n & 2) // --force 40 if (n & 2) // --force
41 flags |= O_TRUNC; 41 flags |= O_TRUNC;
42 if (n & 4) { 42 if (n & 4) {
43 /* Unload _all_ unused modules via NULL delete_module() call */ 43 /* Unload _all_ unused modules via NULL delete_module() call */
diff --git a/networking/httpd.c b/networking/httpd.c
index c174958e2..fa42d9850 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -231,7 +231,7 @@ struct globals {
231 int verbose; /* must be int (used by getopt32) */ 231 int verbose; /* must be int (used by getopt32) */
232 smallint flg_deny_all; 232 smallint flg_deny_all;
233 233
234 unsigned rmt_ip; /* used for IP-based allow/deny rules */ 234 unsigned rmt_ip; /* used for IP-based allow/deny rules */
235 time_t last_mod; 235 time_t last_mod;
236 char *rmt_ip_str; /* for $REMOTE_ADDR and $REMOTE_PORT */ 236 char *rmt_ip_str; /* for $REMOTE_ADDR and $REMOTE_PORT */
237 const char *bind_addr_or_port; 237 const char *bind_addr_or_port;
@@ -267,7 +267,7 @@ struct globals {
267#if ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR 267#if ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR
268 Htaccess *script_i; /* config script interpreters */ 268 Htaccess *script_i; /* config script interpreters */
269#endif 269#endif
270 char *iobuf; /* [IOBUF_SIZE] */ 270 char *iobuf; /* [IOBUF_SIZE] */
271#define hdr_buf bb_common_bufsiz1 271#define hdr_buf bb_common_bufsiz1
272 char *hdr_ptr; 272 char *hdr_ptr;
273 int hdr_cnt; 273 int hdr_cnt;
diff --git a/networking/inetd.c b/networking/inetd.c
index 7030062b6..ac42c5272 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -295,7 +295,7 @@ struct globals {
295 struct rlimit rlim_ofile; 295 struct rlimit rlim_ofile;
296 servtab_t *serv_list; 296 servtab_t *serv_list;
297 int global_queuelen; 297 int global_queuelen;
298 int maxsock; /* max fd# in allsock, -1: unknown */ 298 int maxsock; /* max fd# in allsock, -1: unknown */
299 /* whenever maxsock grows, prev_maxsock is set to new maxsock, 299 /* whenever maxsock grows, prev_maxsock is set to new maxsock,
300 * but if maxsock is set to -1, prev_maxsock is not changed */ 300 * but if maxsock is set to -1, prev_maxsock is not changed */
301 int prev_maxsock; 301 int prev_maxsock;
diff --git a/networking/ip.c b/networking/ip.c
index 7b1e2eb6a..350656cef 100644
--- a/networking/ip.c
+++ b/networking/ip.c
@@ -1,13 +1,11 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * "ip" utility frontend.
4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 3 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
6 * 4 *
7 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 5 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
8 * 6 *
9 * Changes: 7 * Changes:
10 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses 8 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
11 * Bernhard Reutner-Fischer rewrote to use index_in_substr_array 9 * Bernhard Reutner-Fischer rewrote to use index_in_substr_array
12 */ 10 */
13 11
diff --git a/networking/ipcalc.c b/networking/ipcalc.c
index d4aa885c6..acbaa4ac5 100644
--- a/networking/ipcalc.c
+++ b/networking/ipcalc.c
@@ -15,9 +15,9 @@
15/* After libbb.h, because on some systems it needs other includes */ 15/* After libbb.h, because on some systems it needs other includes */
16#include <arpa/inet.h> 16#include <arpa/inet.h>
17 17
18#define CLASS_A_NETMASK ntohl(0xFF000000) 18#define CLASS_A_NETMASK ntohl(0xFF000000)
19#define CLASS_B_NETMASK ntohl(0xFFFF0000) 19#define CLASS_B_NETMASK ntohl(0xFFFF0000)
20#define CLASS_C_NETMASK ntohl(0xFFFFFF00) 20#define CLASS_C_NETMASK ntohl(0xFFFFFF00)
21 21
22static unsigned long get_netmask(unsigned long ipaddr) 22static unsigned long get_netmask(unsigned long ipaddr)
23{ 23{
diff --git a/networking/libiproute/ip_parse_common_args.c b/networking/libiproute/ip_parse_common_args.c
index bf01528c4..59c759b23 100644
--- a/networking/libiproute/ip_parse_common_args.c
+++ b/networking/libiproute/ip_parse_common_args.c
@@ -1,18 +1,15 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * ip.c "ip" utility frontend. 3 * This program is free software; you can redistribute it and/or
4 * 4 * modify it under the terms of the GNU General Public License
5 * This program is free software; you can redistribute it and/or 5 * as published by the Free Software Foundation; either version
6 * modify it under the terms of the GNU General Public License 6 * 2 of the License, or (at your option) any later version.
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
11 * 7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
12 * 9 *
13 * Changes: 10 * Changes:
14 * 11 *
15 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses 12 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
16 */ 13 */
17 14
18#include "ip_common.h" /* #include "libbb.h" is inside */ 15#include "ip_common.h" /* #include "libbb.h" is inside */
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 1be03a6c3..397a8ee34 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -1,13 +1,11 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * ipaddress.c "ip address".
4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 3 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
6 * 4 *
7 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 5 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
8 * 6 *
9 * Changes: 7 * Changes:
10 * Laszlo Valko <valko@linux.karinthy.hu> 990223: address label must be zero terminated 8 * Laszlo Valko <valko@linux.karinthy.hu> 990223: address label must be zero terminated
11 */ 9 */
12 10
13#include <fnmatch.h> 11#include <fnmatch.h>
@@ -20,7 +18,7 @@
20 18
21#ifndef IFF_LOWER_UP 19#ifndef IFF_LOWER_UP
22/* from linux/if.h */ 20/* from linux/if.h */
23#define IFF_LOWER_UP 0x10000 /* driver signals L1 up*/ 21#define IFF_LOWER_UP 0x10000 /* driver signals L1 up */
24#endif 22#endif
25 23
26struct filter_t { 24struct filter_t {
@@ -365,7 +363,7 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM,
365 363
366struct nlmsg_list { 364struct nlmsg_list {
367 struct nlmsg_list *next; 365 struct nlmsg_list *next;
368 struct nlmsghdr h; 366 struct nlmsghdr h;
369}; 367};
370 368
371static int print_selected_addrinfo(int ifindex, struct nlmsg_list *ainfo) 369static int print_selected_addrinfo(int ifindex, struct nlmsg_list *ainfo)
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index c5ba294aa..5a86ce678 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -296,9 +296,9 @@ static int do_change(char **argv, const unsigned rtm)
296 }; 296 };
297 struct rtnl_handle rth; 297 struct rtnl_handle rth;
298 struct { 298 struct {
299 struct nlmsghdr n; 299 struct nlmsghdr n;
300 struct ifinfomsg i; 300 struct ifinfomsg i;
301 char buf[1024]; 301 char buf[1024];
302 } req; 302 } req;
303 smalluint arg; 303 smalluint arg;
304 char *name_str = NULL, *link_str = NULL, *type_str = NULL, *dev_str = NULL; 304 char *name_str = NULL, *link_str = NULL, *type_str = NULL, *dev_str = NULL;
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index 1696e6a34..f66774afe 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -1,19 +1,16 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * iproute.c "ip route".
4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 3 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
6 * 4 *
7 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 5 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
8 *
9 * 6 *
10 * Changes: 7 * Changes:
11 * 8 *
12 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses 9 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
13 * Kunihiro Ishiguro <kunihiro@zebra.org> 001102: rtnh_ifindex was not initialized 10 * Kunihiro Ishiguro <kunihiro@zebra.org> 001102: rtnh_ifindex was not initialized
14 */ 11 */
15 12
16#include "ip_common.h" /* #include "libbb.h" is inside */ 13#include "ip_common.h" /* #include "libbb.h" is inside */
17#include "rt_names.h" 14#include "rt_names.h"
18#include "utils.h" 15#include "utils.h"
19 16
@@ -327,9 +324,9 @@ IF_FEATURE_IP_RULE(ARG_table,)
327 }; 324 };
328 struct rtnl_handle rth; 325 struct rtnl_handle rth;
329 struct { 326 struct {
330 struct nlmsghdr n; 327 struct nlmsghdr n;
331 struct rtmsg r; 328 struct rtmsg r;
332 char buf[1024]; 329 char buf[1024];
333 } req; 330 } req;
334 char mxbuf[256]; 331 char mxbuf[256];
335 struct rtattr * mxrta = (void*)mxbuf; 332 struct rtattr * mxrta = (void*)mxbuf;
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c
index 3af6a83a8..dd3265c7c 100644
--- a/networking/libiproute/iprule.c
+++ b/networking/libiproute/iprule.c
@@ -1,18 +1,15 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * iprule.c "ip rule". 3 * This program is free software; you can redistribute it and/or
4 * 4 * modify it under the terms of the GNU General Public License
5 * This program is free software; you can redistribute it and/or 5 * as published by the Free Software Foundation; either version
6 * modify it under the terms of the GNU General Public License 6 * 2 of the License, or (at your option) any later version.
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
11 * 7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
12 * 9 *
13 * Changes: 10 * Changes:
14 * 11 *
15 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses 12 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
16 * initially integrated into busybox by Bernhard Reutner-Fischer 13 * initially integrated into busybox by Bernhard Reutner-Fischer
17 */ 14 */
18 15
@@ -191,9 +188,9 @@ static int iprule_modify(int cmd, char **argv)
191 bool table_ok = 0; 188 bool table_ok = 0;
192 struct rtnl_handle rth; 189 struct rtnl_handle rth;
193 struct { 190 struct {
194 struct nlmsghdr n; 191 struct nlmsghdr n;
195 struct rtmsg r; 192 struct rtmsg r;
196 char buf[1024]; 193 char buf[1024];
197 } req; 194 } req;
198 smalluint key; 195 smalluint key;
199 196
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index bce373d05..5942feafc 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -1,16 +1,14 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * iptunnel.c "ip tunnel"
4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 3 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
6 * 4 *
7 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 5 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
8 * 6 *
9 * Changes: 7 * Changes:
10 * 8 *
11 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses 9 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
12 * Rani Assaf <rani@magic.metawire.com> 980930: do not allow key for ipip/sit 10 * Rani Assaf <rani@magic.metawire.com> 980930: do not allow key for ipip/sit
13 * Phil Karn <karn@ka9q.ampr.org> 990408: "pmtudisc" flag 11 * Phil Karn <karn@ka9q.ampr.org> 990408: "pmtudisc" flag
14 */ 12 */
15 13
16#include <netinet/ip.h> 14#include <netinet/ip.h>
diff --git a/networking/libiproute/libnetlink.c b/networking/libiproute/libnetlink.c
index 8da80b2fc..3a37d97f8 100644
--- a/networking/libiproute/libnetlink.c
+++ b/networking/libiproute/libnetlink.c
@@ -74,8 +74,8 @@ int FAST_FUNC rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, in
74 struct iovec iov[2] = { { &nlh, sizeof(nlh) }, { req, len } }; 74 struct iovec iov[2] = { { &nlh, sizeof(nlh) }, { req, len } };
75 struct msghdr msg = { 75 struct msghdr msg = {
76 (void*)&nladdr, sizeof(nladdr), 76 (void*)&nladdr, sizeof(nladdr),
77 iov, 2, 77 iov, 2,
78 NULL, 0, 78 NULL, 0,
79 0 79 0
80 }; 80 };
81 81
@@ -108,8 +108,8 @@ static int rtnl_dump_filter(struct rtnl_handle *rth,
108 108
109 struct msghdr msg = { 109 struct msghdr msg = {
110 (void*)&nladdr, sizeof(nladdr), 110 (void*)&nladdr, sizeof(nladdr),
111 &iov, 1, 111 &iov, 1,
112 NULL, 0, 112 NULL, 0,
113 0 113 0
114 }; 114 };
115 115
@@ -214,8 +214,8 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
214 char *buf = xmalloc(8*1024); /* avoid big stack buffer */ 214 char *buf = xmalloc(8*1024); /* avoid big stack buffer */
215 struct msghdr msg = { 215 struct msghdr msg = {
216 (void*)&nladdr, sizeof(nladdr), 216 (void*)&nladdr, sizeof(nladdr),
217 &iov, 1, 217 &iov, 1,
218 NULL, 0, 218 NULL, 0,
219 0 219 0
220 }; 220 };
221 221
diff --git a/networking/libiproute/libnetlink.h b/networking/libiproute/libnetlink.h
index 4e4d5b7b9..51bee2d67 100644
--- a/networking/libiproute/libnetlink.h
+++ b/networking/libiproute/libnetlink.h
@@ -11,11 +11,11 @@
11PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN 11PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
12 12
13struct rtnl_handle { 13struct rtnl_handle {
14 int fd; 14 int fd;
15 struct sockaddr_nl local; 15 struct sockaddr_nl local;
16 struct sockaddr_nl peer; 16 struct sockaddr_nl peer;
17 uint32_t seq; 17 uint32_t seq;
18 uint32_t dump; 18 uint32_t dump;
19}; 19};
20 20
21extern void xrtnl_open(struct rtnl_handle *rth) FAST_FUNC; 21extern void xrtnl_open(struct rtnl_handle *rth) FAST_FUNC;
diff --git a/networking/libiproute/ll_addr.c b/networking/libiproute/ll_addr.c
index c2c01305d..33a54ea6c 100644
--- a/networking/libiproute/ll_addr.c
+++ b/networking/libiproute/ll_addr.c
@@ -1,13 +1,11 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * ll_addr.c 3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version
6 * 2 of the License, or (at your option) any later version.
4 * 7 *
5 * This program is free software; you can redistribute it and/or 8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
11 */ 9 */
12 10
13#include <net/if_arp.h> 11#include <net/if_arp.h>
diff --git a/networking/libiproute/ll_map.c b/networking/libiproute/ll_map.c
index 246b9e33a..27cd90f34 100644
--- a/networking/libiproute/ll_map.c
+++ b/networking/libiproute/ll_map.c
@@ -1,17 +1,14 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * ll_map.c 3 * This program is free software; you can redistribute it and/or
4 * 4 * modify it under the terms of the GNU General Public License
5 * This program is free software; you can redistribute it and/or 5 * as published by the Free Software Foundation; either version
6 * modify it under the terms of the GNU General Public License 6 * 2 of the License, or (at your option) any later version.
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
11 * 7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
12 */ 9 */
13 10
14#include <net/if.h> /* struct ifreq and co. */ 11#include <net/if.h> /* struct ifreq and co. */
15 12
16#include "libbb.h" 13#include "libbb.h"
17#include "libnetlink.h" 14#include "libnetlink.h"
diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c
index 1cd576f1d..04925ecf6 100644
--- a/networking/libiproute/ll_proto.c
+++ b/networking/libiproute/ll_proto.c
@@ -1,13 +1,11 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * ll_proto.c 3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version
6 * 2 of the License, or (at your option) any later version.
4 * 7 *
5 * This program is free software; you can redistribute it and/or 8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
11 */ 9 */
12 10
13#include "libbb.h" 11#include "libbb.h"
diff --git a/networking/libiproute/ll_types.c b/networking/libiproute/ll_types.c
index 3861c2870..38b6c0516 100644
--- a/networking/libiproute/ll_types.c
+++ b/networking/libiproute/ll_types.c
@@ -1,13 +1,11 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * ll_types.c 3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version
6 * 2 of the License, or (at your option) any later version.
4 * 7 *
5 * This program is free software; you can redistribute it and/or 8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
11 */ 9 */
12#include <arpa/inet.h> 10#include <arpa/inet.h>
13#include <linux/if_arp.h> 11#include <linux/if_arp.h>
diff --git a/networking/libiproute/rt_names.c b/networking/libiproute/rt_names.c
index 8dd16e3d3..c474ab903 100644
--- a/networking/libiproute/rt_names.c
+++ b/networking/libiproute/rt_names.c
@@ -1,13 +1,11 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * rt_names.c rtnetlink names DB. 3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version
6 * 2 of the License, or (at your option) any later version.
4 * 7 *
5 * This program is free software; you can redistribute it and/or 8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
11 */ 9 */
12#include "libbb.h" 10#include "libbb.h"
13#include "rt_names.h" 11#include "rt_names.h"
diff --git a/networking/libiproute/rtm_map.c b/networking/libiproute/rtm_map.c
index 5e358e105..3bab53baf 100644
--- a/networking/libiproute/rtm_map.c
+++ b/networking/libiproute/rtm_map.c
@@ -1,14 +1,11 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * rtm_map.c 3 * This program is free software; you can redistribute it and/or
4 * 4 * modify it under the terms of the GNU General Public License
5 * This program is free software; you can redistribute it and/or 5 * as published by the Free Software Foundation; either version
6 * modify it under the terms of the GNU General Public License 6 * 2 of the License, or (at your option) any later version.
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
11 * 7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
12 */ 9 */
13 10
14#include "libbb.h" 11#include "libbb.h"
diff --git a/networking/libiproute/utils.c b/networking/libiproute/utils.c
index 2b646f0ea..24698864d 100644
--- a/networking/libiproute/utils.c
+++ b/networking/libiproute/utils.c
@@ -4,11 +4,11 @@
4 * 4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 5 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
6 * 6 *
7 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 7 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
8 * 8 *
9 * Changes: 9 * Changes:
10 * 10 *
11 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses 11 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
12 */ 12 */
13 13
14#include "libbb.h" 14#include "libbb.h"
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h
index ed03e785a..93c9d25d6 100644
--- a/networking/libiproute/utils.h
+++ b/networking/libiproute/utils.h
@@ -17,14 +17,14 @@ extern smallint oneline;
17extern char _SL_; 17extern char _SL_;
18 18
19#ifndef IPPROTO_ESP 19#ifndef IPPROTO_ESP
20#define IPPROTO_ESP 50 20#define IPPROTO_ESP 50
21#endif 21#endif
22#ifndef IPPROTO_AH 22#ifndef IPPROTO_AH
23#define IPPROTO_AH 51 23#define IPPROTO_AH 51
24#endif 24#endif
25 25
26#define SPRINT_BSIZE 64 26#define SPRINT_BSIZE 64
27#define SPRINT_BUF(x) char x[SPRINT_BSIZE] 27#define SPRINT_BUF(x) char x[SPRINT_BSIZE]
28 28
29extern void incomplete_command(void) NORETURN; 29extern void incomplete_command(void) NORETURN;
30 30
diff --git a/networking/nameif.c b/networking/nameif.c
index 45a3229f4..d02c2c11b 100644
--- a/networking/nameif.c
+++ b/networking/nameif.c
@@ -21,10 +21,10 @@
21#endif 21#endif
22 22
23/* Taken from linux/sockios.h */ 23/* Taken from linux/sockios.h */
24#define SIOCSIFNAME 0x8923 /* set interface name */ 24#define SIOCSIFNAME 0x8923 /* set interface name */
25 25
26/* Octets in one Ethernet addr, from <linux/if_ether.h> */ 26/* Octets in one Ethernet addr, from <linux/if_ether.h> */
27#define ETH_ALEN 6 27#define ETH_ALEN 6
28 28
29#ifndef ifr_newname 29#ifndef ifr_newname
30#define ifr_newname ifr_ifru.ifru_slave 30#define ifr_newname ifr_ifru.ifru_slave
diff --git a/networking/netstat.c b/networking/netstat.c
index 2a83af3ac..356fb53cb 100644
--- a/networking/netstat.c
+++ b/networking/netstat.c
@@ -699,7 +699,7 @@ int netstat_main(int argc UNUSED_PARAM, char **argv)
699 flags |= opt; 699 flags |= opt;
700 } 700 }
701 if (flags & (NETSTAT_TCP|NETSTAT_UDP|NETSTAT_RAW)) { 701 if (flags & (NETSTAT_TCP|NETSTAT_UDP|NETSTAT_RAW)) {
702 printf("Active Internet connections "); /* xxx */ 702 printf("Active Internet connections "); /* xxx */
703 703
704 if ((flags & (NETSTAT_LISTENING|NETSTAT_CONNECTED)) == (NETSTAT_LISTENING|NETSTAT_CONNECTED)) 704 if ((flags & (NETSTAT_LISTENING|NETSTAT_CONNECTED)) == (NETSTAT_LISTENING|NETSTAT_CONNECTED))
705 printf("(servers and established)"); 705 printf("(servers and established)");
diff --git a/networking/ntpd.c b/networking/ntpd.c
index b7bd239b5..8fe529edb 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -89,7 +89,7 @@
89//UNUSED: #define PANIC_THRESHOLD 1000 /* panic threshold (sec) */ 89//UNUSED: #define PANIC_THRESHOLD 1000 /* panic threshold (sec) */
90 90
91#define FREQ_TOLERANCE 0.000015 /* frequency tolerance (15 PPM) */ 91#define FREQ_TOLERANCE 0.000015 /* frequency tolerance (15 PPM) */
92#define BURSTPOLL 0 /* initial poll */ 92#define BURSTPOLL 0 /* initial poll */
93#define MINPOLL 5 /* minimum poll interval. std ntpd uses 6 (6: 64 sec) */ 93#define MINPOLL 5 /* minimum poll interval. std ntpd uses 6 (6: 64 sec) */
94#define BIGPOLL 10 /* drop to lower poll at any trouble (10: 17 min) */ 94#define BIGPOLL 10 /* drop to lower poll at any trouble (10: 17 min) */
95#define MAXPOLL 12 /* maximum poll interval (12: 1.1h, 17: 36.4h). std ntpd uses 17 */ 95#define MAXPOLL 12 /* maximum poll interval (12: 1.1h, 17: 36.4h). std ntpd uses 17 */
@@ -865,7 +865,7 @@ fit(peer_t *p, double rd)
865 VERB3 bb_error_msg("peer %s unfit for selection: unreachable", p->p_dotted); 865 VERB3 bb_error_msg("peer %s unfit for selection: unreachable", p->p_dotted);
866 return 0; 866 return 0;
867 } 867 }
868#if 0 /* we filter out such packets earlier */ 868#if 0 /* we filter out such packets earlier */
869 if ((p->lastpkt_status & LI_ALARM) == LI_ALARM 869 if ((p->lastpkt_status & LI_ALARM) == LI_ALARM
870 || p->lastpkt_stratum >= MAXSTRAT 870 || p->lastpkt_stratum >= MAXSTRAT
871 ) { 871 ) {
@@ -2110,7 +2110,7 @@ direct_freq(double fp_offset)
2110} 2110}
2111 2111
2112static void 2112static void
2113set_freq(double freq) /* frequency update */ 2113set_freq(double freq) /* frequency update */
2114{ 2114{
2115 char tbuf[80]; 2115 char tbuf[80];
2116 2116
diff --git a/networking/ntpd_simple.c b/networking/ntpd_simple.c
index 5905e54e9..4ad44e4f3 100644
--- a/networking/ntpd_simple.c
+++ b/networking/ntpd_simple.c
@@ -870,7 +870,7 @@ static NOINLINE void ntp_init(char **argv)
870 int prec = 0; 870 int prec = 0;
871 int b; 871 int b;
872# if 0 872# if 0
873 struct timespec tp; 873 struct timespec tp;
874 /* We can use sys_clock_getres but assuming 10ms tick should be fine */ 874 /* We can use sys_clock_getres but assuming 10ms tick should be fine */
875 clock_getres(CLOCK_REALTIME, &tp); 875 clock_getres(CLOCK_REALTIME, &tp);
876 tp.tv_sec = 0; 876 tp.tv_sec = 0;
diff --git a/networking/slattach.c b/networking/slattach.c
index 921ec552d..71edd2f27 100644
--- a/networking/slattach.c
+++ b/networking/slattach.c
@@ -134,9 +134,9 @@ int slattach_main(int argc UNUSED_PARAM, char **argv)
134 int i, encap, opt; 134 int i, encap, opt;
135 struct termios state; 135 struct termios state;
136 const char *proto = "cslip"; 136 const char *proto = "cslip";
137 const char *extcmd; /* Command to execute after hangup */ 137 const char *extcmd; /* Command to execute after hangup */
138 const char *baud_str; 138 const char *baud_str;
139 int baud_code = -1; /* Line baud rate (system code) */ 139 int baud_code = -1; /* Line baud rate (system code) */
140 140
141 enum { 141 enum {
142 OPT_p_proto = 1 << 0, 142 OPT_p_proto = 1 << 0,
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 5c011e15d..671529d37 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -141,7 +141,7 @@ remove_iacs(struct tsession *ts, int *pnum_totty)
141 if (ptr[1] == SB && ptr[2] == TELOPT_NAWS) { 141 if (ptr[1] == SB && ptr[2] == TELOPT_NAWS) {
142 struct winsize ws; 142 struct winsize ws;
143 if ((ptr+8) >= end) 143 if ((ptr+8) >= end)
144 break; /* incomplete, can't process */ 144 break; /* incomplete, can't process */
145 ws.ws_col = (ptr[3] << 8) | ptr[4]; 145 ws.ws_col = (ptr[3] << 8) | ptr[4];
146 ws.ws_row = (ptr[5] << 8) | ptr[6]; 146 ws.ws_row = (ptr[5] << 8) | ptr[6];
147 ioctl(ts->ptyfd, TIOCSWINSZ, (char *)&ws); 147 ioctl(ts->ptyfd, TIOCSWINSZ, (char *)&ws);
@@ -273,8 +273,8 @@ make_new_session(
273 static const char iacs_to_send[] ALIGN1 = { 273 static const char iacs_to_send[] ALIGN1 = {
274 IAC, DO, TELOPT_ECHO, 274 IAC, DO, TELOPT_ECHO,
275 IAC, DO, TELOPT_NAWS, 275 IAC, DO, TELOPT_NAWS,
276 /* This requires telnetd.ctrlSQ.patch (incomplete) */ 276 /* This requires telnetd.ctrlSQ.patch (incomplete) */
277 /* IAC, DO, TELOPT_LFLOW, */ 277 /*IAC, DO, TELOPT_LFLOW,*/
278 IAC, WILL, TELOPT_ECHO, 278 IAC, WILL, TELOPT_ECHO,
279 IAC, WILL, TELOPT_SGA 279 IAC, WILL, TELOPT_SGA
280 }; 280 };
diff --git a/networking/vconfig.c b/networking/vconfig.c
index 1f574d2ad..13c65ad78 100644
--- a/networking/vconfig.c
+++ b/networking/vconfig.c
@@ -47,8 +47,8 @@ struct vlan_ioctl_args {
47 short vlan_qos; 47 short vlan_qos;
48}; 48};
49 49
50#define VLAN_GROUP_ARRAY_LEN 4096 50#define VLAN_GROUP_ARRAY_LEN 4096
51#define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */ 51#define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */
52 52
53/* On entry, table points to the length of the current string 53/* On entry, table points to the length of the current string
54 * plus NUL terminator plus data length for the subsequent entry. 54 * plus NUL terminator plus data length for the subsequent entry.
diff --git a/networking/wget.c b/networking/wget.c
index 4521abfcf..0db9b3365 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -6,7 +6,7 @@
6 * Licensed under GPLv2, see file LICENSE in this source tree. 6 * Licensed under GPLv2, see file LICENSE in this source tree.
7 * 7 *
8 * Copyright (C) 2010 Bradley M. Kuhn <bkuhn@ebb.org> 8 * Copyright (C) 2010 Bradley M. Kuhn <bkuhn@ebb.org>
9 * Kuhn's copyrights are licensed GPLv2-or-later. File as a whole remains GPLv2. 9 * Kuhn's copyrights are licensed GPLv2-or-later. File as a whole remains GPLv2.
10 */ 10 */
11#include "libbb.h" 11#include "libbb.h"
12 12
@@ -48,7 +48,7 @@ struct BUG_G_too_big {
48/* Must match option string! */ 48/* Must match option string! */
49enum { 49enum {
50 WGET_OPT_CONTINUE = (1 << 0), 50 WGET_OPT_CONTINUE = (1 << 0),
51 WGET_OPT_SPIDER = (1 << 1), 51 WGET_OPT_SPIDER = (1 << 1),
52 WGET_OPT_QUIET = (1 << 2), 52 WGET_OPT_QUIET = (1 << 2),
53 WGET_OPT_OUTNAME = (1 << 3), 53 WGET_OPT_OUTNAME = (1 << 3),
54 WGET_OPT_PREFIX = (1 << 4), 54 WGET_OPT_PREFIX = (1 << 4),
@@ -785,7 +785,7 @@ However, in real world it was observed that some web servers
785*/ 785*/
786 case 204: 786 case 204:
787 break; 787 break;
788 case 300: /* redirection */ 788 case 300: /* redirection */
789 case 301: 789 case 301:
790 case 302: 790 case 302:
791 case 303: 791 case 303:
diff --git a/procps/iostat.c b/procps/iostat.c
index 5d829861e..a9ff13a05 100644
--- a/procps/iostat.c
+++ b/procps/iostat.c
@@ -18,14 +18,14 @@
18//config: Report CPU and I/O statistics 18//config: Report CPU and I/O statistics
19 19
20#include "libbb.h" 20#include "libbb.h"
21#include <sys/utsname.h> /* Need struct utsname */ 21#include <sys/utsname.h> /* Need struct utsname */
22 22
23//#define debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__) 23//#define debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
24#define debug(fmt, ...) ((void)0) 24#define debug(fmt, ...) ((void)0)
25 25
26#define MAX_DEVICE_NAME 12 26#define MAX_DEVICE_NAME 12
27#define CURRENT 0 27#define CURRENT 0
28#define LAST 1 28#define LAST 1
29 29
30#if 1 30#if 1
31typedef unsigned long long cputime_t; 31typedef unsigned long long cputime_t;
@@ -327,7 +327,7 @@ static void do_disk_statistics(cputime_t itv)
327 int i = 0; 327 int i = 0;
328 char buf[128]; 328 char buf[128];
329 unsigned major, minor; 329 unsigned major, minor;
330 unsigned long wr_ops, dummy; /* %*lu for suppres the conversion wouldn't work */ 330 unsigned long wr_ops, dummy; /* %*lu for suppress the conversion wouldn't work */
331 unsigned long long rd_sec_or_wr_ops; 331 unsigned long long rd_sec_or_wr_ops;
332 unsigned long long rd_sec_or_dummy, wr_sec_or_dummy, wr_sec; 332 unsigned long long rd_sec_or_dummy, wr_sec_or_dummy, wr_sec;
333 struct stats_dev sd; 333 struct stats_dev sd;
diff --git a/procps/mpstat.c b/procps/mpstat.c
index f1a0b00b8..25efedf62 100644
--- a/procps/mpstat.c
+++ b/procps/mpstat.c
@@ -18,7 +18,7 @@
18//config: Per-processor statistics 18//config: Per-processor statistics
19 19
20#include "libbb.h" 20#include "libbb.h"
21#include <sys/utsname.h> /* struct utsname */ 21#include <sys/utsname.h> /* struct utsname */
22 22
23//#define debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__) 23//#define debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
24#define debug(fmt, ...) ((void)0) 24#define debug(fmt, ...) ((void)0)
@@ -634,7 +634,7 @@ static void get_irqs_from_interrupts(const char *fname,
634 while (irq < irqs_per_cpu) { 634 while (irq < irqs_per_cpu) {
635 /* Number of interrupts per CPU has changed */ 635 /* Number of interrupts per CPU has changed */
636 ic = &per_cpu_stats[current][irq]; 636 ic = &per_cpu_stats[current][irq];
637 ic->irq_name[0] = '\0'; /* False interrupt */ 637 ic->irq_name[0] = '\0'; /* False interrupt */
638 irq++; 638 irq++;
639 } 639 }
640} 640}
@@ -820,7 +820,7 @@ static int get_irqcpu_nr(const char *f, int max_irqs)
820 unsigned irq; 820 unsigned irq;
821 821
822 fp = fopen_for_read(f); 822 fp = fopen_for_read(f);
823 if (!fp) /* No interrupts file */ 823 if (!fp) /* No interrupts file */
824 return 0; 824 return 0;
825 825
826 linelen = INTERRUPTS_LINE + 16 * G.cpu_nr; 826 linelen = INTERRUPTS_LINE + 16 * G.cpu_nr;
@@ -858,10 +858,10 @@ int mpstat_main(int UNUSED_PARAM argc, char **argv)
858 char *opt_set_cpu; 858 char *opt_set_cpu;
859 int i, opt; 859 int i, opt;
860 enum { 860 enum {
861 OPT_ALL = 1 << 0, /* -A */ 861 OPT_ALL = 1 << 0, /* -A */
862 OPT_INTS = 1 << 1, /* -I */ 862 OPT_INTS = 1 << 1, /* -I */
863 OPT_SETCPU = 1 << 2, /* -P */ 863 OPT_SETCPU = 1 << 2, /* -P */
864 OPT_UTIL = 1 << 3, /* -u */ 864 OPT_UTIL = 1 << 3, /* -u */
865 }; 865 };
866 866
867 /* Dont buffer data if redirected to a pipe */ 867 /* Dont buffer data if redirected to a pipe */
diff --git a/procps/sysctl.c b/procps/sysctl.c
index 20b372c54..aba966e7f 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -91,7 +91,7 @@ static int sysctl_act_on_setting(char *setting)
91 retval = EXIT_FAILURE; 91 retval = EXIT_FAILURE;
92 goto end; 92 goto end;
93 } 93 }
94 value = cptr + 1; /* point to the value in name=value */ 94 value = cptr + 1; /* point to the value in name=value */
95 if (setting == cptr || !*value) { 95 if (setting == cptr || !*value) {
96 bb_error_msg("error: malformed setting '%s'", outname); 96 bb_error_msg("error: malformed setting '%s'", outname);
97 retval = EXIT_FAILURE; 97 retval = EXIT_FAILURE;
diff --git a/selinux/sestatus.c b/selinux/sestatus.c
index 7fb2b470b..aa12e806c 100644
--- a/selinux/sestatus.c
+++ b/selinux/sestatus.c
@@ -12,10 +12,10 @@
12 12
13extern char *selinux_mnt; 13extern char *selinux_mnt;
14 14
15#define OPT_VERBOSE (1 << 0) 15#define OPT_VERBOSE (1 << 0)
16#define OPT_BOOLEAN (1 << 1) 16#define OPT_BOOLEAN (1 << 1)
17 17
18#define COL_FMT "%-31s " 18#define COL_FMT "%-31s "
19 19
20static void display_boolean(void) 20static void display_boolean(void)
21{ 21{
@@ -151,7 +151,7 @@ int sestatus_main(int argc UNUSED_PARAM, char **argv)
151 const char *pol_path; 151 const char *pol_path;
152 int rc; 152 int rc;
153 153
154 opt_complementary = "?0"; /* no arguments are required. */ 154 opt_complementary = "?0"; /* no arguments are required. */
155 opts = getopt32(argv, "vb"); 155 opts = getopt32(argv, "vb");
156 156
157 /* SELinux status: line */ 157 /* SELinux status: line */
diff --git a/shell/ash_test/recho.c b/shell/ash_test/recho.c
index fb48d9c48..42a5feafd 100644
--- a/shell/ash_test/recho.c
+++ b/shell/ash_test/recho.c
@@ -29,12 +29,9 @@
29 29
30void strprint(); 30void strprint();
31 31
32int 32int main(int argc, char **argv)
33main(argc, argv)
34int argc;
35char **argv;
36{ 33{
37 register int i; 34 int i;
38 35
39 for (i = 1; i < argc; i++) { 36 for (i = 1; i < argc; i++) {
40 printf("argv[%d] = <", i); 37 printf("argv[%d] = <", i);
@@ -44,11 +41,9 @@ char **argv;
44 exit(EXIT_SUCCESS); 41 exit(EXIT_SUCCESS);
45} 42}
46 43
47void 44void strprint(char *str)
48strprint(str)
49char *str;
50{ 45{
51 register unsigned char *s; 46 unsigned char *s;
52 47
53 for (s = (unsigned char *)str; s && *s; s++) { 48 for (s = (unsigned char *)str; s && *s; s++) {
54 if (*s < ' ') { 49 if (*s < ' ') {
diff --git a/shell/ash_test/zecho.c b/shell/ash_test/zecho.c
index bf876f641..cbaa59b81 100644
--- a/shell/ash_test/zecho.c
+++ b/shell/ash_test/zecho.c
@@ -21,10 +21,7 @@
21#include <stdio.h> 21#include <stdio.h>
22#include <stdlib.h> 22#include <stdlib.h>
23 23
24int 24int main(int argc, char **argv)
25main(argc, argv)
26int argc;
27char **argv;
28{ 25{
29 argv++; 26 argv++;
30 27
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 07c8f55d1..77cc1fc12 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -26,7 +26,7 @@ enum {
26 26
27struct fb_bitfield { 27struct fb_bitfield {
28 uint32_t offset; /* beginning of bitfield */ 28 uint32_t offset; /* beginning of bitfield */
29 uint32_t length; /* length of bitfield */ 29 uint32_t length; /* length of bitfield */
30 uint32_t msb_right; /* !=0: Most significant bit is right */ 30 uint32_t msb_right; /* !=0: Most significant bit is right */
31}; 31};
32struct fb_var_screeninfo { 32struct fb_var_screeninfo {
@@ -52,7 +52,7 @@ struct fb_var_screeninfo {
52 uint32_t height; /* height of picture in mm */ 52 uint32_t height; /* height of picture in mm */
53 uint32_t width; /* width of picture in mm */ 53 uint32_t width; /* width of picture in mm */
54 54
55 uint32_t accel_flags; /* acceleration flags (hints) */ 55 uint32_t accel_flags; /* acceleration flags (hints) */
56 56
57 /* Timing: All values in pixclocks, except pixclock (of course) */ 57 /* Timing: All values in pixclocks, except pixclock (of course) */
58 uint32_t pixclock; /* pixel clock in ps (pico seconds) */ 58 uint32_t pixclock; /* pixel clock in ps (pico seconds) */
@@ -317,7 +317,7 @@ static int read_mode_db(struct fb_var_screeninfo *base, const char *fn,
317 } 317 }
318 case 4: 318 case 4:
319 case 5: 319 case 5:
320 case 6: { 320 case 6: {
321 static const uint32_t syncs[] = {FB_SYNC_VERT_HIGH_ACT, FB_SYNC_HOR_HIGH_ACT, FB_SYNC_COMP_HIGH_ACT}; 321 static const uint32_t syncs[] = {FB_SYNC_VERT_HIGH_ACT, FB_SYNC_HOR_HIGH_ACT, FB_SYNC_COMP_HIGH_ACT};
322 ss(&base->sync, syncs[i-4], p, "low"); 322 ss(&base->sync, syncs[i-4], p, "low");
323//bb_info_msg("SYNC[%s]", p); 323//bb_info_msg("SYNC[%s]", p);
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index 8c4d521ab..a38fe05e7 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -4,7 +4,7 @@
4 * Based on code from util-linux v 2.11l 4 * Based on code from util-linux v 2.11l
5 * 5 *
6 * Copyright (c) 1989 6 * Copyright (c) 1989
7 * The Regents of the University of California. All rights reserved. 7 * The Regents of the University of California. All rights reserved.
8 * 8 *
9 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 */ 10 */
@@ -32,11 +32,11 @@ static void bb_dump_addfile(dumper_t *dumper, char *name)
32} 32}
33 33
34static const char *const add_strings[] = { 34static const char *const add_strings[] = {
35 "\"%07.7_ax \" 16/1 \"%03o \" \"\\n\"", /* b */ 35 "\"%07.7_ax \" 16/1 \"%03o \" \"\\n\"", /* b */
36 "\"%07.7_ax \" 16/1 \"%3_c \" \"\\n\"", /* c */ 36 "\"%07.7_ax \" 16/1 \"%3_c \" \"\\n\"", /* c */
37 "\"%07.7_ax \" 8/2 \" %05u \" \"\\n\"", /* d */ 37 "\"%07.7_ax \" 8/2 \" %05u \" \"\\n\"", /* d */
38 "\"%07.7_ax \" 8/2 \" %06o \" \"\\n\"", /* o */ 38 "\"%07.7_ax \" 8/2 \" %06o \" \"\\n\"", /* o */
39 "\"%07.7_ax \" 8/2 \" %04x \" \"\\n\"", /* x */ 39 "\"%07.7_ax \" 8/2 \" %04x \" \"\\n\"", /* x */
40}; 40};
41 41
42static const char add_first[] ALIGN1 = "\"%07.7_Ax\n\""; 42static const char add_first[] ALIGN1 = "\"%07.7_Ax\n\"";