diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-04-14 19:12:43 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-04-14 19:12:43 +0200 |
commit | 1a45b2ccea94b0fc123798f276a0801413597880 (patch) | |
tree | 3368e80011c915cc19d3a83463fd9c0f7c9c6180 | |
parent | eb1b2902b8b7b7effdba711645288c64884fd3e7 (diff) | |
download | busybox-w32-1a45b2ccea94b0fc123798f276a0801413597880.tar.gz busybox-w32-1a45b2ccea94b0fc123798f276a0801413597880.tar.bz2 busybox-w32-1a45b2ccea94b0fc123798f276a0801413597880.zip |
fix "warning array subscript has type 'char'"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | applets/applet_tables.c | 2 | ||||
-rw-r--r-- | scripts/basic/docproc.c | 18 | ||||
-rw-r--r-- | scripts/basic/fixdep.c | 12 | ||||
-rw-r--r-- | scripts/basic/split-include.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/conf.c | 6 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/mconf.c | 2 |
7 files changed, 22 insertions, 22 deletions
diff --git a/applets/applet_tables.c b/applets/applet_tables.c index 7ba929b12..66ef7e4ac 100644 --- a/applets/applet_tables.c +++ b/applets/applet_tables.c | |||
@@ -56,7 +56,7 @@ static int cmp_name(const void *a, const void *b) | |||
56 | static int str_isalnum_(const char *s) | 56 | static int str_isalnum_(const char *s) |
57 | { | 57 | { |
58 | while (*s) { | 58 | while (*s) { |
59 | if (!isalnum(*s) && *s != '_') | 59 | if (!isalnum((unsigned char)*s) && *s != '_') |
60 | return 0; | 60 | return 0; |
61 | s++; | 61 | s++; |
62 | } | 62 | } |
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c index 720098a23..4464e1874 100644 --- a/scripts/basic/docproc.c +++ b/scripts/basic/docproc.c | |||
@@ -182,10 +182,10 @@ void find_export_symbols(char * filename) | |||
182 | perror(real_filename); | 182 | perror(real_filename); |
183 | } | 183 | } |
184 | while (fgets(line, MAXLINESZ, fp)) { | 184 | while (fgets(line, MAXLINESZ, fp)) { |
185 | char *p; | 185 | unsigned char *p; |
186 | char *e; | 186 | unsigned char *e; |
187 | if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != 0) || | 187 | if (((p = (unsigned char *)strstr(line, "EXPORT_SYMBOL_GPL")) != 0) || |
188 | ((p = strstr(line, "EXPORT_SYMBOL")) != 0)) { | 188 | ((p = (unsigned char *)strstr(line, "EXPORT_SYMBOL")) != 0)) { |
189 | /* Skip EXPORT_SYMBOL{_GPL} */ | 189 | /* Skip EXPORT_SYMBOL{_GPL} */ |
190 | while (isalnum(*p) || *p == '_') | 190 | while (isalnum(*p) || *p == '_') |
191 | p++; | 191 | p++; |
@@ -202,7 +202,7 @@ void find_export_symbols(char * filename) | |||
202 | while (isalnum(*e) || *e == '_') | 202 | while (isalnum(*e) || *e == '_') |
203 | e++; | 203 | e++; |
204 | *e = '\0'; | 204 | *e = '\0'; |
205 | add_new_symbol(sym, p); | 205 | add_new_symbol(sym, (char*)p); |
206 | } | 206 | } |
207 | } | 207 | } |
208 | fclose(fp); | 208 | fclose(fp); |
@@ -266,7 +266,7 @@ void singfunc(char * filename, char * line) | |||
266 | 266 | ||
267 | /* Split line up in individual parameters preceded by FUNCTION */ | 267 | /* Split line up in individual parameters preceded by FUNCTION */ |
268 | for (i=0; line[i]; i++) { | 268 | for (i=0; line[i]; i++) { |
269 | if (isspace(line[i])) { | 269 | if (isspace((unsigned char) line[i])) { |
270 | line[i] = '\0'; | 270 | line[i] = '\0'; |
271 | startofsym = 1; | 271 | startofsym = 1; |
272 | continue; | 272 | continue; |
@@ -293,10 +293,10 @@ void singfunc(char * filename, char * line) | |||
293 | void parse_file(FILE *infile) | 293 | void parse_file(FILE *infile) |
294 | { | 294 | { |
295 | char line[MAXLINESZ]; | 295 | char line[MAXLINESZ]; |
296 | char * s; | 296 | unsigned char * s; |
297 | while (fgets(line, MAXLINESZ, infile)) { | 297 | while (fgets(line, MAXLINESZ, infile)) { |
298 | if (line[0] == '!') { | 298 | if (line[0] == '!') { |
299 | s = line + 2; | 299 | s = (unsigned char *)line + 2; |
300 | switch (line[1]) { | 300 | switch (line[1]) { |
301 | case 'E': | 301 | case 'E': |
302 | while (*s && !isspace(*s)) s++; | 302 | while (*s && !isspace(*s)) s++; |
@@ -320,7 +320,7 @@ void parse_file(FILE *infile) | |||
320 | /* function names */ | 320 | /* function names */ |
321 | while (isspace(*s)) | 321 | while (isspace(*s)) |
322 | s++; | 322 | s++; |
323 | singlefunctions(line +2, s); | 323 | singlefunctions(line +2, (char*)s); |
324 | break; | 324 | break; |
325 | default: | 325 | default: |
326 | defaultline(line); | 326 | defaultline(line); |
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 19f82df09..426b4888b 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -226,10 +226,10 @@ void use_config(char *m, int slen) | |||
226 | void parse_config_file(char *map, size_t len) | 226 | void parse_config_file(char *map, size_t len) |
227 | { | 227 | { |
228 | /* modified for bbox */ | 228 | /* modified for bbox */ |
229 | char *end_3 = map + len - 3; /* 3 == length of "IF_" */ | 229 | unsigned char *end_3 = (unsigned char *)map + len - 3; /* 3 == length of "IF_" */ |
230 | char *end_7 = map + len - 7; | 230 | unsigned char *end_7 = (unsigned char *)map + len - 7; |
231 | char *p = map; | 231 | unsigned char *p = (unsigned char *)map; |
232 | char *q; | 232 | unsigned char *q; |
233 | int off; | 233 | int off; |
234 | 234 | ||
235 | for (; p <= end_3; p++) { | 235 | for (; p <= end_3; p++) { |
@@ -263,7 +263,7 @@ void parse_config_file(char *map, size_t len) | |||
263 | break; | 263 | break; |
264 | } | 264 | } |
265 | if (q != p) { | 265 | if (q != p) { |
266 | use_config(p, q-p); | 266 | use_config((char*)p, q - p); |
267 | } | 267 | } |
268 | } | 268 | } |
269 | } | 269 | } |
@@ -335,7 +335,7 @@ void parse_dep_file(void *map, size_t len) | |||
335 | p = m; | 335 | p = m; |
336 | while (p < end && *p != ' ') p++; | 336 | while (p < end && *p != ' ') p++; |
337 | if (p == end) { | 337 | if (p == end) { |
338 | do p--; while (!isalnum(*p)); | 338 | do p--; while (!isalnum((unsigned char)*p)); |
339 | p++; | 339 | p++; |
340 | } | 340 | } |
341 | memcpy(s, m, p-m); s[p-m] = 0; | 341 | memcpy(s, m, p-m); s[p-m] = 0; |
diff --git a/scripts/basic/split-include.c b/scripts/basic/split-include.c index a38ac3427..6ef29195e 100644 --- a/scripts/basic/split-include.c +++ b/scripts/basic/split-include.c | |||
@@ -116,7 +116,7 @@ int main(int argc, const char * argv []) | |||
116 | /* We found #define CONFIG_foo or #undef CONFIG_foo. | 116 | /* We found #define CONFIG_foo or #undef CONFIG_foo. |
117 | * Make the output file name. */ | 117 | * Make the output file name. */ |
118 | str_config += sizeof(" CONFIG_") - 1; | 118 | str_config += sizeof(" CONFIG_") - 1; |
119 | for (itarget = 0; !isspace(str_config[itarget]); itarget++) | 119 | for (itarget = 0; !isspace((unsigned char)str_config[itarget]); itarget++) |
120 | { | 120 | { |
121 | int c = (unsigned char) str_config[itarget]; | 121 | int c = (unsigned char) str_config[itarget]; |
122 | if (isupper(c)) c = tolower(c); | 122 | if (isupper(c)) c = tolower(c); |
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 866a7c544..39ec1cdb6 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -44,7 +44,7 @@ static void strip(char *str) | |||
44 | char *p = str; | 44 | char *p = str; |
45 | int l; | 45 | int l; |
46 | 46 | ||
47 | while ((isspace(*p))) | 47 | while ((isspace((unsigned char)*p))) |
48 | p++; | 48 | p++; |
49 | l = strlen(p); | 49 | l = strlen(p); |
50 | if (p != str) | 50 | if (p != str) |
@@ -52,7 +52,7 @@ static void strip(char *str) | |||
52 | if (!l) | 52 | if (!l) |
53 | return; | 53 | return; |
54 | p = str + l - 1; | 54 | p = str + l - 1; |
55 | while ((isspace(*p))) | 55 | while ((isspace((unsigned char)*p))) |
56 | *p-- = 0; | 56 | *p-- = 0; |
57 | } | 57 | } |
58 | 58 | ||
@@ -401,7 +401,7 @@ static int conf_choice(struct menu *menu) | |||
401 | } | 401 | } |
402 | if (!line[0]) | 402 | if (!line[0]) |
403 | cnt = def; | 403 | cnt = def; |
404 | else if (isdigit(line[0])) | 404 | else if (isdigit((unsigned char)line[0])) |
405 | cnt = atoi(line); | 405 | cnt = atoi(line); |
406 | else | 406 | else |
407 | continue; | 407 | continue; |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index b05b96e45..9976011a9 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -54,7 +54,7 @@ static char *conf_expand_value(const char *in) | |||
54 | strncat(res_value, in, src - in); | 54 | strncat(res_value, in, src - in); |
55 | src++; | 55 | src++; |
56 | dst = name; | 56 | dst = name; |
57 | while (isalnum(*src) || *src == '_') | 57 | while (isalnum((unsigned char)*src) || *src == '_') |
58 | *dst++ = *src++; | 58 | *dst++ = *src++; |
59 | *dst = 0; | 59 | *dst = 0; |
60 | sym = sym_lookup(name, 0); | 60 | sym = sym_lookup(name, 0); |
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index c3a837a14..aaf82820e 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -771,7 +771,7 @@ static void conf(struct menu *menu) | |||
771 | if (!type) | 771 | if (!type) |
772 | continue; | 772 | continue; |
773 | 773 | ||
774 | for (i = 0; input_buf[i] && !isspace(input_buf[i]); i++) | 774 | for (i = 0; input_buf[i] && !isspace((unsigned char)input_buf[i]); i++) |
775 | ; | 775 | ; |
776 | if (i >= sizeof(active_entry)) | 776 | if (i >= sizeof(active_entry)) |
777 | i = sizeof(active_entry) - 1; | 777 | i = sizeof(active_entry) - 1; |