From c3afa0fa3d074c34ff2201a8b999170f9fa27f46 Mon Sep 17 00:00:00 2001 From: Michal Novotny Date: Mon, 12 Mar 2012 18:10:10 +0100 Subject: [PATCH 1/3] Revert "notifier: Pass data argument to callback" RH-Reverts: 6c32b2fde579bdaa9fed33b2f79cdada3c57eee5 RH-Reverts-patchwork-id: 37477 Bugzilla-related: 734426 Signed-off-by: Michal Novotny --- hw/fw_cfg.c | 2 +- migration.c | 10 +++++----- notify.c | 4 ++-- notify.h | 4 ++-- sdl.c | 2 +- ui/spice-core.c | 2 +- ui/spice-input.c | 4 ++-- vl.c | 6 +++--- vnc.c | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c index 89e4beb..d0519e8 100644 --- a/hw/fw_cfg.c +++ b/hw/fw_cfg.c @@ -313,7 +313,7 @@ int fw_cfg_add_file(FWCfgState *s, const char *filename, uint8_t *data, return 1; } -static void fw_cfg_machine_ready(struct Notifier *n, void *data) +static void fw_cfg_machine_ready(struct Notifier* n) { uint32_t len; FWCfgState *s = container_of(n, FWCfgState, machine_ready); diff --git a/migration.c b/migration.c index fc17c57..0f73a68 100644 --- a/migration.c +++ b/migration.c @@ -140,7 +140,7 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data) } current_migration = s; - notifier_list_notify(&migration_state_notifiers, NULL); + notifier_list_notify(&migration_state_notifiers); return 0; } @@ -294,7 +294,7 @@ void migrate_fd_error(FdMigrationState *s) DPRINTF("setting error state\n"); s->state = MIG_STATE_ERROR; migrate_fd_cleanup(s); - notifier_list_notify(&migration_state_notifiers, NULL); + notifier_list_notify(&migration_state_notifiers); } int migrate_fd_cleanup(FdMigrationState *s) @@ -422,7 +422,7 @@ void migrate_fd_put_ready(void *opaque) s->state = MIG_STATE_COMPLETED; runstate_set(RUN_STATE_POSTMIGRATE); } - notifier_list_notify(&migration_state_notifiers, NULL); + notifier_list_notify(&migration_state_notifiers); } } @@ -444,7 +444,7 @@ void migrate_fd_cancel(MigrationState *mig_state) s->state = MIG_STATE_CANCELLED; qemu_savevm_state_cancel(s->mon, s->file); migrate_fd_cleanup(s); - notifier_list_notify(&migration_state_notifiers, NULL); + notifier_list_notify(&migration_state_notifiers); } void migrate_fd_release(MigrationState *mig_state) @@ -456,7 +456,7 @@ void migrate_fd_release(MigrationState *mig_state) if (s->state == MIG_STATE_ACTIVE) { s->state = MIG_STATE_CANCELLED; migrate_fd_cleanup(s); - notifier_list_notify(&migration_state_notifiers, NULL); + notifier_list_notify(&migration_state_notifiers); } free(s); } diff --git a/notify.c b/notify.c index a6bac1f..bcd3fc5 100644 --- a/notify.c +++ b/notify.c @@ -29,11 +29,11 @@ void notifier_list_remove(NotifierList *list, Notifier *notifier) QTAILQ_REMOVE(&list->notifiers, notifier, node); } -void notifier_list_notify(NotifierList *list, void *data) +void notifier_list_notify(NotifierList *list) { Notifier *notifier, *next; QTAILQ_FOREACH_SAFE(notifier, &list->notifiers, node, next) { - notifier->notify(notifier, data); + notifier->notify(notifier); } } diff --git a/notify.h b/notify.h index 54fc57c..b40522f 100644 --- a/notify.h +++ b/notify.h @@ -20,7 +20,7 @@ typedef struct Notifier Notifier; struct Notifier { - void (*notify)(Notifier *notifier, void *data); + void (*notify)(Notifier *notifier); QTAILQ_ENTRY(Notifier) node; }; @@ -38,6 +38,6 @@ void notifier_list_add(NotifierList *list, Notifier *notifier); void notifier_list_remove(NotifierList *list, Notifier *notifier); -void notifier_list_notify(NotifierList *list, void *data); +void notifier_list_notify(NotifierList *list); #endif diff --git a/sdl.c b/sdl.c index ff4655c..ca114e7 100644 --- a/sdl.c +++ b/sdl.c @@ -486,7 +486,7 @@ static void sdl_grab_end(void) sdl_update_caption(); } -static void sdl_mouse_mode_change(Notifier *notify, void *data) +static void sdl_mouse_mode_change(Notifier *notify) { if (kbd_mouse_is_absolute()) { if (!absolute_enabled) { diff --git a/ui/spice-core.c b/ui/spice-core.c index 6a91762..a880bf1 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -530,7 +530,7 @@ void do_info_spice(Monitor *mon, QObject **ret_data) *ret_data = QOBJECT(server); } -static void migration_state_notifier(Notifier *notifier, void *data) +static void migration_state_notifier(Notifier *notifier) { int state = get_migration_state(); if (state == MIG_STATE_ACTIVE) { diff --git a/ui/spice-input.c b/ui/spice-input.c index 75abf5f..37c8578 100644 --- a/ui/spice-input.c +++ b/ui/spice-input.c @@ -178,7 +178,7 @@ static const SpiceTabletInterface tablet_interface = { .buttons = tablet_buttons, }; -static void mouse_mode_notifier(Notifier *notifier, void *data) +static void mouse_mode_notifier(Notifier *notifier) { QemuSpicePointer *pointer = container_of(notifier, QemuSpicePointer, mouse_mode); bool is_absolute = kbd_mouse_is_absolute(); @@ -213,5 +213,5 @@ void qemu_spice_input_init(void) pointer->absolute = false; pointer->mouse_mode.notify = mouse_mode_notifier; qemu_add_mouse_mode_change_notifier(&pointer->mouse_mode); - mouse_mode_notifier(&pointer->mouse_mode, NULL); + mouse_mode_notifier(&pointer->mouse_mode); } diff --git a/vl.c b/vl.c index 1244885..ed7ec85 100644 --- a/vl.c +++ b/vl.c @@ -552,7 +552,7 @@ static void check_mode_change(void) if (is_absolute != current_is_absolute || has_absolute != current_has_absolute) { - notifier_list_notify(&mouse_mode_notifiers, NULL); + notifier_list_notify(&mouse_mode_notifiers); } current_is_absolute = is_absolute; @@ -4998,7 +4998,7 @@ void qemu_add_machine_init_done_notifier(Notifier *notify) static void qemu_run_machine_init_done_notifiers(void) { - notifier_list_notify(&machine_init_done_notifiers, NULL); + notifier_list_notify(&machine_init_done_notifiers); } void qemu_add_exit_notifier(Notifier *notify) @@ -5013,7 +5013,7 @@ void qemu_remove_exit_notifier(Notifier *notify) static void qemu_run_exit_notifiers(void) { - notifier_list_notify(&exit_notifiers, NULL); + notifier_list_notify(&exit_notifiers); } static const QEMUOption *lookup_opt(int argc, char **argv, diff --git a/vnc.c b/vnc.c index 0d0b4a1..daeffe8 100644 --- a/vnc.c +++ b/vnc.c @@ -1435,7 +1435,7 @@ static void client_cut_text(VncState *vs, size_t len, uint8_t *text) { } -static void check_pointer_type_change(Notifier *notifier, void *data) +static void check_pointer_type_change(Notifier *notifier) { VncState *vs = container_of(notifier, VncState, mouse_mode_notifier); int absolute = kbd_mouse_is_absolute(); @@ -1822,7 +1822,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings) } vnc_desktop_resize(vs); - check_pointer_type_change(&vs->mouse_mode_notifier, NULL); + check_pointer_type_change(&vs->mouse_mode_notifier); } static void set_pixel_conversion(VncState *vs) -- 1.7.7.6