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) |
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) perror(real_filename); } while (fgets(line, MAXLINESZ, fp)) { - char *p; - char *e; - if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != 0) || - ((p = strstr(line, "EXPORT_SYMBOL")) != 0)) { + unsigned char *p; + unsigned char *e; + if (((p = (unsigned char *)strstr(line, "EXPORT_SYMBOL_GPL")) != 0) || + ((p = (unsigned char *)strstr(line, "EXPORT_SYMBOL")) != 0)) { /* Skip EXPORT_SYMBOL{_GPL} */ while (isalnum(*p) || *p == '_') p++; @@ -202,7 +202,7 @@ void find_export_symbols(char * filename) while (isalnum(*e) || *e == '_') e++; *e = '\0'; - add_new_symbol(sym, p); + add_new_symbol(sym, (char*)p); } } fclose(fp); @@ -266,7 +266,7 @@ void singfunc(char * filename, char * line) /* Split line up in individual parameters preceded by FUNCTION */ for (i=0; line[i]; i++) { - if (isspace(line[i])) { + if (isspace((unsigned char) line[i])) { line[i] = '\0'; startofsym = 1; continue; @@ -293,10 +293,10 @@ void singfunc(char * filename, char * line) void parse_file(FILE *infile) { char line[MAXLINESZ]; - char * s; + unsigned char * s; while (fgets(line, MAXLINESZ, infile)) { if (line[0] == '!') { - s = line + 2; + s = (unsigned char *)line + 2; switch (line[1]) { case 'E': while (*s && !isspace(*s)) s++; @@ -320,7 +320,7 @@ void parse_file(FILE *infile) /* function names */ while (isspace(*s)) s++; - singlefunctions(line +2, s); + singlefunctions(line +2, (char*)s); break; default: 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) void parse_config_file(char *map, size_t len) { /* modified for bbox */ - char *end_3 = map + len - 3; /* 3 == length of "IF_" */ - char *end_7 = map + len - 7; - char *p = map; - char *q; + unsigned char *end_3 = (unsigned char *)map + len - 3; /* 3 == length of "IF_" */ + unsigned char *end_7 = (unsigned char *)map + len - 7; + unsigned char *p = (unsigned char *)map; + unsigned char *q; int off; for (; p <= end_3; p++) { @@ -263,7 +263,7 @@ void parse_config_file(char *map, size_t len) break; } if (q != p) { - use_config(p, q-p); + use_config((char*)p, q - p); } } } @@ -335,7 +335,7 @@ void parse_dep_file(void *map, size_t len) p = m; while (p < end && *p != ' ') p++; if (p == end) { - do p--; while (!isalnum(*p)); + do p--; while (!isalnum((unsigned char)*p)); p++; } 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 []) /* We found #define CONFIG_foo or #undef CONFIG_foo. * Make the output file name. */ str_config += sizeof(" CONFIG_") - 1; - for (itarget = 0; !isspace(str_config[itarget]); itarget++) + for (itarget = 0; !isspace((unsigned char)str_config[itarget]); itarget++) { int c = (unsigned char) str_config[itarget]; if (isupper(c)) c = tolower(c); |