[gjs] Revert "Skip only user_data in callbacks"



commit 1774b8ca893508a7d5a181946fca7d0bc2c69929
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Mon Feb 6 21:06:54 2012 +0100

    Revert "Skip only user_data in callbacks"
    
    This reverts commit 97e08e590609c2777910c3b89b6b0e7f64a7aa08.
    This commit is an API break for callbacks that were previously
    passed void* pointers, and started to find an undefined argument
    there.

 gi/function.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/gi/function.c b/gi/function.c
index b2cfa07..9834ab3 100644
--- a/gi/function.c
+++ b/gi/function.c
@@ -230,6 +230,10 @@ gjs_callback_closure(ffi_cif *cif,
         g_callable_info_load_arg(trampoline->info, i, &arg_info);
         g_arg_info_load_type(&arg_info, &type_info);
 
+        /* Skip void * arguments */
+        if (g_type_info_get_tag(&type_info) == GI_TYPE_TAG_VOID)
+            continue;
+
         if (g_arg_info_get_direction(&arg_info) == GI_DIRECTION_OUT) {
             n_outargs++;
             continue;
@@ -449,7 +453,6 @@ gjs_callback_trampoline_new(JSContext      *context,
         GIArgInfo arg_info;
         GITypeInfo type_info;
         GITypeTag type_tag;
-        gint closure;
 
         if (trampoline->param_types[i] == PARAM_SKIPPED)
             continue;
@@ -465,14 +468,6 @@ gjs_callback_trampoline_new(JSContext      *context,
             continue;
         }
 
-        closure = g_arg_info_get_closure(&arg_info);
-        if (closure == i) {
-            /* A closure id equal to current parameter is used to signal the user_data
-               argument in a callback */
-            trampoline->param_types[i] = PARAM_SKIPPED;
-            continue;
-        }
-
         if (type_tag == GI_TYPE_TAG_INTERFACE) {
             GIBaseInfo* interface_info;
             GIInfoType interface_type;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]