Change wl_closure_invoke to take an opcode instead of an actual function pointer

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Jason Ekstrand 2013-03-08 22:26:12 -06:00 committed by Kristian Høgsberg
parent cb73bffed5
commit ca5b1946cb
6 changed files with 17 additions and 14 deletions

View file

@ -862,12 +862,13 @@ convert_arguments_to_ffi(const char *signature, uint32_t flags,
void
wl_closure_invoke(struct wl_closure *closure, uint32_t flags,
struct wl_object *target, void (*func)(void), void *data)
struct wl_object *target, uint32_t opcode, void *data)
{
int count;
ffi_cif cif;
ffi_type *ffi_types[WL_CLOSURE_MAX_ARGS + 2];
void * ffi_args[WL_CLOSURE_MAX_ARGS + 2];
void (* const *implementation)(void);
count = arg_count_for_signature(closure->message->signature);
@ -882,7 +883,8 @@ wl_closure_invoke(struct wl_closure *closure, uint32_t flags,
ffi_prep_cif(&cif, FFI_DEFAULT_ABI,
count + 2, &ffi_type_void, ffi_types);
ffi_call(&cif, func, NULL, ffi_args);
implementation = target->implementation;
ffi_call(&cif, implementation[opcode], NULL, ffi_args);
}
static int