mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
tests: Use proper functions types instead of void (*fn)
We have several function parameters declared as void (*fn). This is just a stupid way to write void *, and the only purpose writing it like that could serve is obscuring the sin of bypassing the type system without need. The original sin is commit49ee359
: its qtest_add_func() is a wrapper for g_test_add_func(). Fix the parameter type to match g_test_add_func()'s. This uncovers type errors in ide-test.c; fix them. Commit7949c0e
faithfully repeated the sin for qtest_add_data_func(). Fix it the same way, along with a harmless type error uncovered in vhost-user-test.c. Commit063c23d
repeated it for qtest_add_abrt_handler(). The screwy parameter gets assigned to GHook member func, so change its type to match. Requires wrapping kill_qemu() to keep the type checker happy. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [AF/armbru: Inline GTestFunc/GTestDataFunc typedef for old GLib] Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
70ae0b6d0e
commit
041088c719
4 changed files with 18 additions and 10 deletions
|
@ -173,8 +173,9 @@ static void wait_for_fds(TestServer *s)
|
|||
g_mutex_unlock(&s->data_mutex);
|
||||
}
|
||||
|
||||
static void read_guest_mem(TestServer *s)
|
||||
static void read_guest_mem(const void *data)
|
||||
{
|
||||
TestServer *s = (void *)data;
|
||||
uint32_t *guest_mem;
|
||||
int i, j;
|
||||
size_t size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue