diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-03-21 07:34:27 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-03-21 07:34:27 +0000 |
commit | 181385da6b3577bb300bcda2653623ae46928ad4 (patch) | |
tree | d1f07be4de0004fe5e30b44320e10285147e7944 /coreutils | |
parent | 0ccb1013f6746540ee25e7f070982d043e3ca949 (diff) | |
download | busybox-w32-181385da6b3577bb300bcda2653623ae46928ad4.tar.gz busybox-w32-181385da6b3577bb300bcda2653623ae46928ad4.tar.bz2 busybox-w32-181385da6b3577bb300bcda2653623ae46928ad4.zip |
A nice patch from Larry Doolittle that adds -Wshadow and
cleans up most of the now-revealed problems.
git-svn-id: svn://busybox.net/trunk/busybox@2177 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/dd.c | 6 | ||||
-rw-r--r-- | coreutils/echo.c | 6 | ||||
-rw-r--r-- | coreutils/tr.c | 10 |
3 files changed, 11 insertions, 11 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index 1618dd102..3f58929ba 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -45,7 +45,7 @@ static const struct suffix_mult dd_suffixes[] = { | |||
45 | 45 | ||
46 | int dd_main(int argc, char **argv) | 46 | int dd_main(int argc, char **argv) |
47 | { | 47 | { |
48 | int i, ifd, ofd, oflag, sync = FALSE, trunc = TRUE; | 48 | int i, ifd, ofd, oflag, sync_flag = FALSE, trunc = TRUE; |
49 | size_t in_full = 0, in_part = 0, out_full = 0, out_part = 0; | 49 | size_t in_full = 0, in_part = 0, out_full = 0, out_part = 0; |
50 | size_t bs = 512, count = -1; | 50 | size_t bs = 512, count = -1; |
51 | ssize_t n; | 51 | ssize_t n; |
@@ -73,7 +73,7 @@ int dd_main(int argc, char **argv) | |||
73 | trunc = FALSE; | 73 | trunc = FALSE; |
74 | buf += 7; | 74 | buf += 7; |
75 | } else if (strncmp("sync", buf, 4) == 0) { | 75 | } else if (strncmp("sync", buf, 4) == 0) { |
76 | sync = TRUE; | 76 | sync_flag = TRUE; |
77 | buf += 4; | 77 | buf += 4; |
78 | } else { | 78 | } else { |
79 | error_msg_and_die("invalid conversion `%s'", argv[i]+5); | 79 | error_msg_and_die("invalid conversion `%s'", argv[i]+5); |
@@ -138,7 +138,7 @@ int dd_main(int argc, char **argv) | |||
138 | in_full++; | 138 | in_full++; |
139 | else | 139 | else |
140 | in_part++; | 140 | in_part++; |
141 | if (sync) { | 141 | if (sync_flag) { |
142 | memset(buf + n, '\0', bs - n); | 142 | memset(buf + n, '\0', bs - n); |
143 | n = bs; | 143 | n = bs; |
144 | } | 144 | } |
diff --git a/coreutils/echo.c b/coreutils/echo.c index e9bc50a15..1ca373467 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c | |||
@@ -40,7 +40,7 @@ echo_main(int argc, char** argv) | |||
40 | while (argc > 0 && *argv[0] == '-') | 40 | while (argc > 0 && *argv[0] == '-') |
41 | { | 41 | { |
42 | register char *temp; | 42 | register char *temp; |
43 | register int index; | 43 | register int ix; |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * If it appears that we are handling options, then make sure | 46 | * If it appears that we are handling options, then make sure |
@@ -49,9 +49,9 @@ echo_main(int argc, char** argv) | |||
49 | */ | 49 | */ |
50 | temp = argv[0] + 1; | 50 | temp = argv[0] + 1; |
51 | 51 | ||
52 | for (index = 0; temp[index]; index++) | 52 | for (ix = 0; temp[ix]; ix++) |
53 | { | 53 | { |
54 | if (strrchr("neE", temp[index]) == 0) | 54 | if (strrchr("neE", temp[ix]) == 0) |
55 | goto just_echo; | 55 | goto just_echo; |
56 | } | 56 | } |
57 | 57 | ||
diff --git a/coreutils/tr.c b/coreutils/tr.c index b7a6009c8..ddb73873d 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
@@ -123,19 +123,19 @@ static unsigned int expand(char *arg, register unsigned char *buffer) | |||
123 | 123 | ||
124 | static int complement(unsigned char *buffer, int buffer_len) | 124 | static int complement(unsigned char *buffer, int buffer_len) |
125 | { | 125 | { |
126 | register short i, j, index; | 126 | register short i, j, ix; |
127 | char conv[ASCII + 2]; | 127 | char conv[ASCII + 2]; |
128 | 128 | ||
129 | index = 0; | 129 | ix = 0; |
130 | for (i = 0; i <= ASCII; i++) { | 130 | for (i = 0; i <= ASCII; i++) { |
131 | for (j = 0; j < buffer_len; j++) | 131 | for (j = 0; j < buffer_len; j++) |
132 | if (buffer[j] == i) | 132 | if (buffer[j] == i) |
133 | break; | 133 | break; |
134 | if (j == buffer_len) | 134 | if (j == buffer_len) |
135 | conv[index++] = i & ASCII; | 135 | conv[ix++] = i & ASCII; |
136 | } | 136 | } |
137 | memcpy(buffer, conv, index); | 137 | memcpy(buffer, conv, ix); |
138 | return index; | 138 | return ix; |
139 | } | 139 | } |
140 | 140 | ||
141 | extern int tr_main(int argc, char **argv) | 141 | extern int tr_main(int argc, char **argv) |