diff options
author | Kohei Tokunaga <ktokunaga.mail@gmail.com> | 2025-04-28 15:38:53 +0900 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-05-06 16:02:04 +0200 |
commit | 44d3ec593b0afd2f8cfaf2ba2149465ee3541695 (patch) | |
tree | d838b02e40ebd43d4b2d0e95ca8f7cbad082121c | |
parent | 821ee1c31427a4e08af030469311c2d8ed96f1d1 (diff) | |
download | qemu-44d3ec593b0afd2f8cfaf2ba2149465ee3541695.zip qemu-44d3ec593b0afd2f8cfaf2ba2149465ee3541695.tar.gz qemu-44d3ec593b0afd2f8cfaf2ba2149465ee3541695.tar.bz2 |
target/arm/helper.c: Fix type conflict of GLib function pointers
On Emscripten, function pointer casts can result in runtime failures due to
strict function signature checks. This affects the use of g_list_sort and
g_slist_sort, which internally perform function pointer casts that are not
supported by Emscripten. To avoid these issues, g_list_sort_with_data and
g_slist_sort_with_data should be used instead, as they do not rely on
function pointer casting.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
Link: https://lore.kernel.org/r/7d56c82382e8b4f1694b6d7883b2ce3084fdc72d.1745820062.git.ktokunaga.mail@gmail.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | target/arm/helper.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c index 7fb6e88..c7ff9f6 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -222,7 +222,7 @@ static void count_cpreg(gpointer key, gpointer opaque) } } -static gint cpreg_key_compare(gconstpointer a, gconstpointer b) +static gint cpreg_key_compare(gconstpointer a, gconstpointer b, gpointer d) { uint64_t aidx = cpreg_to_kvm_id((uintptr_t)a); uint64_t bidx = cpreg_to_kvm_id((uintptr_t)b); @@ -246,7 +246,7 @@ void init_cpreg_list(ARMCPU *cpu) int arraylen; keys = g_hash_table_get_keys(cpu->cp_regs); - keys = g_list_sort(keys, cpreg_key_compare); + keys = g_list_sort_with_data(keys, cpreg_key_compare, NULL); cpu->cpreg_array_len = 0; |