mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
Bug 572965 – Allow generic marshaller to be called without parameters
girepository/ginvoke.c: handle the case where n_param_values == 0. tests/invoke/genericmarshaller.c: add a test case for this.
This commit is contained in:
parent
86c1c58917
commit
f13354f9ea
24
ginvoke.c
24
ginvoke.c
@ -407,18 +407,26 @@ gi_cclosure_marshal_generic (GClosure *closure,
|
||||
atypes = g_alloca (sizeof (ffi_type *) * n_args);
|
||||
args = g_alloca (sizeof (gpointer) * n_args);
|
||||
|
||||
if (G_CCLOSURE_SWAP_DATA (closure))
|
||||
if (n_param_values > 0)
|
||||
{
|
||||
atypes[n_args-1] = value_to_ffi_type (param_values + 0,
|
||||
&args[n_args-1]);
|
||||
atypes[0] = &ffi_type_pointer;
|
||||
args[0] = &closure->data;
|
||||
if (G_CCLOSURE_SWAP_DATA (closure))
|
||||
{
|
||||
atypes[n_args-1] = value_to_ffi_type (param_values + 0,
|
||||
&args[n_args-1]);
|
||||
atypes[0] = &ffi_type_pointer;
|
||||
args[0] = &closure->data;
|
||||
}
|
||||
else
|
||||
{
|
||||
atypes[0] = value_to_ffi_type (param_values + 0, &args[0]);
|
||||
atypes[n_args-1] = &ffi_type_pointer;
|
||||
args[n_args-1] = &closure->data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
atypes[0] = value_to_ffi_type (param_values + 0, &args[0]);
|
||||
atypes[n_args-1] = &ffi_type_pointer;
|
||||
args[n_args-1] = &closure->data;
|
||||
atypes[0] = &ffi_type_pointer;
|
||||
args[0] = &closure->data;
|
||||
}
|
||||
|
||||
for (i = 1; i < n_args - 1; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user