diff options
author | Eric Andersen <andersen@codepoet.org> | 2006-01-30 19:48:23 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2006-01-30 19:48:23 +0000 |
commit | 5e678873f9ff7c95d43b278feee547ce989b3b20 (patch) | |
tree | 6b0bab1e0d6df7f659352acc7dc844663c11634c /coreutils/tr.c | |
parent | 2cdd4d56ffc3b467d5ffa76e3c4cd009dc311097 (diff) | |
download | busybox-w32-5e678873f9ff7c95d43b278feee547ce989b3b20.tar.gz busybox-w32-5e678873f9ff7c95d43b278feee547ce989b3b20.tar.bz2 busybox-w32-5e678873f9ff7c95d43b278feee547ce989b3b20.zip |
clean up yet more annoying signed/unsigned mismatches and fixup
yet more incorrect types
Diffstat (limited to 'coreutils/tr.c')
-rw-r--r-- | coreutils/tr.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/coreutils/tr.c b/coreutils/tr.c index e9eca4c60..d6c5e346e 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
@@ -40,7 +40,7 @@ static short in_index, out_index; | |||
40 | /* these last are pointers to static buffers declared in tr_main */ | 40 | /* these last are pointers to static buffers declared in tr_main */ |
41 | static unsigned char *poutput; | 41 | static unsigned char *poutput; |
42 | static unsigned char *pvector; | 42 | static unsigned char *pvector; |
43 | static char *pinvec, *poutvec; | 43 | static unsigned char *pinvec, *poutvec; |
44 | 44 | ||
45 | #define input bb_common_bufsiz1 | 45 | #define input bb_common_bufsiz1 |
46 | 46 | ||
@@ -141,9 +141,9 @@ static unsigned int expand(const char *arg, register unsigned char *buffer) | |||
141 | for (i = 'A'; i <= 'Z'; i++) | 141 | for (i = 'A'; i <= 'Z'; i++) |
142 | *buffer++ = i; | 142 | *buffer++ = i; |
143 | else if (strncmp(arg, "space", 5) == 0) | 143 | else if (strncmp(arg, "space", 5) == 0) |
144 | strcat(buffer, " \f\n\r\t\v"); | 144 | strcat((char*)buffer, " \f\n\r\t\v"); |
145 | else if (strncmp(arg, "blank", 5) == 0) | 145 | else if (strncmp(arg, "blank", 5) == 0) |
146 | strcat(buffer, " \t"); | 146 | strcat((char*)buffer, " \t"); |
147 | /* gcc gives a warning if braces aren't used here */ | 147 | /* gcc gives a warning if braces aren't used here */ |
148 | else if (strncmp(arg, "punct", 5) == 0) { | 148 | else if (strncmp(arg, "punct", 5) == 0) { |
149 | for (i = 0; i <= ASCII; i++) | 149 | for (i = 0; i <= ASCII; i++) |
@@ -156,7 +156,7 @@ static unsigned int expand(const char *arg, register unsigned char *buffer) | |||
156 | *buffer++ = i; | 156 | *buffer++ = i; |
157 | } | 157 | } |
158 | else { | 158 | else { |
159 | strcat(buffer, "[:"); | 159 | strcat((char*)buffer, "[:"); |
160 | arg++; | 160 | arg++; |
161 | continue; | 161 | continue; |
162 | } | 162 | } |
@@ -214,10 +214,10 @@ extern int tr_main(int argc, char **argv) | |||
214 | RESERVE_CONFIG_BUFFER(outvec, ASCII+1); | 214 | RESERVE_CONFIG_BUFFER(outvec, ASCII+1); |
215 | 215 | ||
216 | /* ... but make them available globally */ | 216 | /* ... but make them available globally */ |
217 | poutput = output; | 217 | poutput = (unsigned char*)output; |
218 | pvector = vector; | 218 | pvector = (unsigned char*)vector; |
219 | pinvec = invec; | 219 | pinvec = (unsigned char*)invec; |
220 | poutvec = outvec; | 220 | poutvec = (unsigned char*)outvec; |
221 | 221 | ||
222 | if (argc > 1 && argv[idx][0] == '-') { | 222 | if (argc > 1 && argv[idx][0] == '-') { |
223 | for (ptr = (unsigned char *) &argv[idx][1]; *ptr; ptr++) { | 223 | for (ptr = (unsigned char *) &argv[idx][1]; *ptr; ptr++) { |
@@ -243,14 +243,14 @@ extern int tr_main(int argc, char **argv) | |||
243 | } | 243 | } |
244 | 244 | ||
245 | if (argv[idx] != NULL) { | 245 | if (argv[idx] != NULL) { |
246 | input_length = expand(argv[idx++], input); | 246 | input_length = expand(argv[idx++], (unsigned char*)input); |
247 | if (com_fl) | 247 | if (com_fl) |
248 | input_length = complement(input, input_length); | 248 | input_length = complement((unsigned char*)input, input_length); |
249 | if (argv[idx] != NULL) { | 249 | if (argv[idx] != NULL) { |
250 | if (*argv[idx] == '\0') | 250 | if (*argv[idx] == '\0') |
251 | bb_error_msg_and_die("STRING2 cannot be empty"); | 251 | bb_error_msg_and_die("STRING2 cannot be empty"); |
252 | output_length = expand(argv[idx], output); | 252 | output_length = expand(argv[idx], (unsigned char*)output); |
253 | map(input, input_length, output, output_length); | 253 | map((unsigned char*)input, input_length, (unsigned char*)output, output_length); |
254 | } | 254 | } |
255 | for (i = 0; i < input_length; i++) | 255 | for (i = 0; i < input_length; i++) |
256 | invec[(unsigned char)input[i]] = TRUE; | 256 | invec[(unsigned char)input[i]] = TRUE; |