[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 08/20] target/ppc: Fix type conflict of GLib function pointers
From: |
Kohei Tokunaga |
Subject: |
[PATCH v3 08/20] target/ppc: Fix type conflict of GLib function pointers |
Date: |
Mon, 28 Apr 2025 15:38:57 +0900 |
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>
---
target/ppc/cpu_init.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index fde7d71fc6..b070fcb637 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -7115,7 +7115,7 @@ PowerPCCPUClass *ppc_cpu_get_family_class(PowerPCCPUClass
*pcc)
}
/* Sort by PVR, ordering special case "host" last. */
-static gint ppc_cpu_list_compare(gconstpointer a, gconstpointer b)
+static gint ppc_cpu_list_compare(gconstpointer a, gconstpointer b, gpointer d)
{
ObjectClass *oc_a = (ObjectClass *)a;
ObjectClass *oc_b = (ObjectClass *)b;
@@ -7183,7 +7183,7 @@ void ppc_cpu_list(void)
qemu_printf("Available CPUs:\n");
list = object_class_get_list(TYPE_POWERPC_CPU, false);
- list = g_slist_sort(list, ppc_cpu_list_compare);
+ list = g_slist_sort_with_data(list, ppc_cpu_list_compare, NULL);
g_slist_foreach(list, ppc_cpu_list_entry, NULL);
g_slist_free(list);
--
2.43.0
- [PATCH v3 00/20] Enable QEMU TCI to run 32bit guests on browsers, Kohei Tokunaga, 2025/04/28
- [PATCH v3 01/20] hw/core/loader.c: Fix type conflict of GLib function pointers, Kohei Tokunaga, 2025/04/28
- [PATCH v3 02/20] qom/object.c: Fix type conflict of GLib function pointers, Kohei Tokunaga, 2025/04/28
- [PATCH v3 03/20] system/vl.c: Fix type conflict of GLib function pointers, Kohei Tokunaga, 2025/04/28
- [PATCH v3 04/20] target/arm/helper.c: Fix type conflict of GLib function pointers, Kohei Tokunaga, 2025/04/28
- [PATCH v3 06/20] contrib/plugins: Fix type conflict of GLib function pointers, Kohei Tokunaga, 2025/04/28
- [PATCH v3 05/20] target/i386/cpu.c: Fix type conflict of GLib function pointers, Kohei Tokunaga, 2025/04/28
- [PATCH v3 07/20] hw/net/can: Fix type conflict of GLib function pointers, Kohei Tokunaga, 2025/04/28
- [PATCH v3 08/20] target/ppc: Fix type conflict of GLib function pointers,
Kohei Tokunaga <=
- [PATCH v3 09/20] target/s390x: Fix type conflict of GLib function pointers, Kohei Tokunaga, 2025/04/28
- [PATCH v3 10/20] include/glib-compat.h: Poison g_list_sort and g_slist_sort, Kohei Tokunaga, 2025/04/28
- [PATCH v3 11/20] util/cacheflush.c: Update cache flushing mechanism for Emscripten, Kohei Tokunaga, 2025/04/28
- [PATCH v3 14/20] include/qemu/osdep.h: Add Emscripten-specific OS dependencies, Kohei Tokunaga, 2025/04/28
- [PATCH v3 12/20] block: Add including of ioctl header for Emscripten build, Kohei Tokunaga, 2025/04/28
- [PATCH v3 16/20] util: exclude mmap-alloc.c from compilation target on Emscripten, Kohei Tokunaga, 2025/04/28
- [PATCH v3 13/20] block: Fix type confict of the copy_file_range stub, Kohei Tokunaga, 2025/04/28
- [PATCH v3 15/20] Disable options unsupported on Emscripten, Kohei Tokunaga, 2025/04/28
- [PATCH v3 18/20] meson: Add wasm build in build scripts, Kohei Tokunaga, 2025/04/28
- [PATCH v3 19/20] tests: Add Dockerfile containing dependencies for Emscripten build, Kohei Tokunaga, 2025/04/28