summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Matthew <jonathan@d14n.org>2011-02-06 14:48:58 +1000
committerJonathan Matthew <jonathan@d14n.org>2011-02-09 07:52:53 +1000
commitf19d2461234417f5ae10533f12fb05e9f003dbaa (patch)
tree4560ec237aa8c44d9fd755aaa6c77abfda9cc849
parente96b41af838116e8a5be385ba373d7576e37407a (diff)
downloadgobject-introspection-f19d2461234417f5ae10533f12fb05e9f003dbaa.tar.gz
Account for arg direction in g_callable_info_get_ffi_arg_types
https://bugzilla.gnome.org/show_bug.cgi?id=641647
-rw-r--r--girepository/girffi.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/girepository/girffi.c b/girepository/girffi.c
index d2afca0a..b7c1ceae 100644
--- a/girepository/girffi.c
+++ b/girepository/girffi.c
@@ -130,7 +130,18 @@ g_callable_info_get_ffi_arg_types (GICallableInfo *callable_info)
{
GIArgInfo *arg_info = g_callable_info_get_arg (callable_info, i);
GITypeInfo *arg_type = g_arg_info_get_type (arg_info);
- arg_types[i] = g_type_info_get_ffi_type (arg_type);
+ switch (g_arg_info_get_direction (arg_info))
+ {
+ case GI_DIRECTION_IN:
+ arg_types[i] = g_type_info_get_ffi_type (arg_type);
+ break;
+ case GI_DIRECTION_OUT:
+ case GI_DIRECTION_INOUT:
+ arg_types[i] = &ffi_type_pointer;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
g_base_info_unref ((GIBaseInfo *)arg_info);
g_base_info_unref ((GIBaseInfo *)arg_type);
}