From 6c4c09eb449fb3bd4bc32f835e05cc9467850b74 Mon Sep 17 00:00:00 2001 From: simbit18 <101105604+simbit18@users.noreply.github.com> Date: Wed, 25 Oct 2023 15:07:33 +0200 Subject: [PATCH] =?UTF-8?q?tools/cfgdefine.c:=20Resolve=20compile=20warnin?= =?UTF-8?q?g=20array=20subscript=20has=20type=20=E2=80=98char=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In file included from cfgdefine.c:26: cfgdefine.c: In function ‘skip_space’: cfgdefine.c:91:26: warning: array subscript has type ‘char’ [-Wchar-subscripts] 91 | while (*ptr && isspace(*ptr)) ptr++; | ^~~~ cfgdefine.c: In function ‘find_name_end’: cfgdefine.c:99:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] 99 | while (*ptr && (isalnum(*ptr) || *ptr == '_')) ptr++; | ^~~~ cfgdefine.c: In function ‘find_value_end’: cfgdefine.c:107:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] 107 | while (*ptr && !isspace(*ptr)) | ^~~~ cfgdefine.c:116:45: warning: array subscript has type ‘char’ [-Wchar-subscripts] 116 | do ptr++; while (*ptr && !isspace(*ptr) && *ptr != '"'); | --- tools/cfgdefine.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/cfgdefine.c b/tools/cfgdefine.c index b872b849e6..091a53172d 100644 --- a/tools/cfgdefine.c +++ b/tools/cfgdefine.c @@ -88,7 +88,7 @@ static const char *dequote_list[] = static char *skip_space(char *ptr) { - while (*ptr && isspace(*ptr)) ptr++; + while (*ptr && isspace((int)*ptr)) ptr++; return ptr; } @@ -96,7 +96,7 @@ static char *skip_space(char *ptr) static char *find_name_end(char *ptr) { - while (*ptr && (isalnum(*ptr) || *ptr == '_')) ptr++; + while (*ptr && (isalnum((int)*ptr) || *ptr == '_')) ptr++; return ptr; } @@ -104,7 +104,7 @@ static char *find_name_end(char *ptr) static char *find_value_end(char *ptr) { - while (*ptr && !isspace(*ptr)) + while (*ptr && !isspace((int)*ptr)) { if (*ptr == '"') { @@ -113,7 +113,7 @@ static char *find_value_end(char *ptr) } else { - do ptr++; while (*ptr && !isspace(*ptr) && *ptr != '"'); + do ptr++; while (*ptr && !isspace((int)*ptr) && *ptr != '"'); } }