]> xenbits.xensource.com Git - xen.git/commitdiff
Fix error: array subscript has type 'char'
authorManuel Bouyer <bouyer@netbsd.org>
Tue, 12 Jan 2021 18:12:21 +0000 (19:12 +0100)
committerIan Jackson <iwj@xenproject.org>
Thu, 28 Jan 2021 16:36:48 +0000 (16:36 +0000)
Use unsigned char variable, or cast to (unsigned char), for
tolower()/islower() and friends. Fix compiler error
array subscript has type 'char' [-Werror=char-subscripts]

Signed-off-by: Manuel Bouyer <bouyer@netbsd.org>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libs/light/libxl_qmp.c
tools/xentrace/xentrace.c
xen/tools/symbols.c

index c394000ea9d04e75e36289a66d98ebbe690e01d8..9b638e6f5442f21101bbb42ad9dac2a746d3bd0d 100644 (file)
@@ -1249,7 +1249,7 @@ static int qmp_error_class_to_libxl_error_code(libxl__gc *gc,
                 se++;
                 continue;
             }
-            if (tolower(*s) != tolower(*se))
+            if (tolower((unsigned char)*s) != tolower((unsigned char)*se))
                 break;
             s++, se++;
         }
index 4b50b8a53e05803b0baa9d5349c4383180736dd5..a8903ebf4625efb73e59818de4fb83ef3e55ce71 100644 (file)
@@ -957,7 +957,7 @@ static int parse_cpumask_range(const char *mask_str, xc_cpumap_t map)
 {
     unsigned int a, b;
     int nmaskbits;
-    char c;
+    unsigned char c;
     int in_range;
     const char *s;
 
index 9f9e2c99006120d7d84c973b627c9f4e42094fcb..0b124526165dcae2efbd232816f3398abd82d7c4 100644 (file)
@@ -173,11 +173,11 @@ static int read_symbol(FILE *in, struct sym_entry *s)
        /* include the type field in the symbol name, so that it gets
         * compressed together */
        s->len = strlen(str) + 1;
-       if (islower(stype) && filename)
+       if (islower((unsigned char)stype) && filename)
                s->len += strlen(filename) + 1;
        s->sym = malloc(s->len + 1);
        sym = SYMBOL_NAME(s);
-       if (islower(stype) && filename) {
+       if (islower((unsigned char)stype) && filename) {
                sym = stpcpy(sym, filename);
                *sym++ = '#';
        }