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 /scripts/basic | |
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>
Diffstat (limited to 'scripts/basic')
-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 |
3 files changed, 16 insertions, 16 deletions
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); |