]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/xtensa: Use glib2 instead of strcasecmp/strncasecmp
authorKostiantyn Kostiuk <kkostiuk@redhat.com>
Fri, 27 Mar 2026 13:43:55 +0000 (15:43 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Apr 2026 10:27:27 +0000 (12:27 +0200)
This is a change in semantics. g_ascii_strcasecmp() doesn't honour
locale but strcasecmp() does. But this is OK for at least one reason:
 (1) QEMU always runs with the C locale so there's not an actual
     behaviour change here

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20260327134401.270186-10-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/xtensa/xtensa-isa.c

index 630b4f9da1b554190eaec13fd9dce0b915bf85c3..c564af340fa9208452bbc03b811bf7588727041f 100644 (file)
@@ -370,7 +370,7 @@ int xtensa_isa_name_compare(const void *v1, const void *v2)
     xtensa_lookup_entry *e1 = (xtensa_lookup_entry *)v1;
     xtensa_lookup_entry *e2 = (xtensa_lookup_entry *)v2;
 
-    return strcasecmp(e1->key, e2->key);
+    return g_ascii_strcasecmp(e1->key, e2->key);
 }
 
 
@@ -513,7 +513,7 @@ xtensa_format xtensa_format_lookup(xtensa_isa isa, const char *fmtname)
     }
 
     for (fmt = 0; fmt < intisa->num_formats; fmt++) {
-        if (strcasecmp(fmtname, intisa->formats[fmt].name) == 0) {
+        if (g_ascii_strcasecmp(fmtname, intisa->formats[fmt].name) == 0) {
             return fmt;
         }
     }