diff options
author | Johan Bilien <jobi@litl.com> | 2009-02-24 15:19:07 +0000 |
---|---|---|
committer | Johan Bilien <jobi@litl.com> | 2009-02-24 15:22:59 +0000 |
commit | 7bd4bc6807dc829f6e8ea4db1b58a85e365b8b97 (patch) | |
tree | 375d55911dfa24000a86f5ff8855deb33ce7bef4 /girepository/ginvoke.c | |
parent | 15610cae80648a870d6838c86f96fe727c3009c8 (diff) | |
download | gobject-introspection-7bd4bc6807dc829f6e8ea4db1b58a85e365b8b97.tar.gz |
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.
Diffstat (limited to 'girepository/ginvoke.c')
-rw-r--r-- | girepository/ginvoke.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/girepository/ginvoke.c b/girepository/ginvoke.c index e83a8200..70d81f8e 100644 --- a/girepository/ginvoke.c +++ b/girepository/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++) |