From: Kostiantyn Kostiuk Date: Fri, 27 Mar 2026 13:43:53 +0000 (+0200) Subject: target/riscv: Use glib2 instead of strcasecmp/strncasecmp X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26d10b93c3c7e72dfcd84f3d53eccf8abf6fe4e6;p=thirdparty%2Fqemu.git target/riscv: Use glib2 instead of strcasecmp/strncasecmp 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 Reviewed-by: Chao Liu Reviewed-by: Peter Maydell Link: https://lore.kernel.org/r/20260327134401.270186-8-kkostiuk@redhat.com Signed-off-by: Paolo Bonzini --- diff --git a/target/riscv/monitor.c b/target/riscv/monitor.c index a9d31114442..bca04a7580c 100644 --- a/target/riscv/monitor.c +++ b/target/riscv/monitor.c @@ -303,7 +303,7 @@ static bool reg_is_vreg(const char *name) } for (int i = 0; i < 32; i++) { - if (strcasecmp(name, riscv_rvv_regnames[i]) == 0) { + if (g_ascii_strcasecmp(name, riscv_rvv_regnames[i]) == 0) { return true; } } @@ -358,7 +358,7 @@ int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval) continue; } - if (strcasecmp(csr_ops[csrno].name, name) != 0) { + if (g_ascii_strcasecmp(csr_ops[csrno].name, name) != 0) { continue; }