gjs r82 - trunk/gi



Author: tko
Date: Tue Nov 11 18:02:06 2008
New Revision: 82
URL: http://svn.gnome.org/viewvc/gjs?rev=82&view=rev

Log:
rearrange code to get GITypeInfo for in args as well

	* gi/function.c (gjs_invoke_c_function): rearrange code to get
	GITypeInfo for in args as well

Modified:
   trunk/gi/function.c

Modified: trunk/gi/function.c
==============================================================================
--- trunk/gi/function.c	(original)
+++ trunk/gi/function.c	Tue Nov 11 18:02:06 2008
@@ -292,44 +292,44 @@
 
             arg_info = g_callable_info_get_arg( (GICallableInfo*) info, i);
             direction = g_arg_info_get_direction(arg_info);
-            if (direction == GI_DIRECTION_IN) {
-                g_assert(in_args_pos < expected_in_argc);
-                ++in_args_pos;
-                g_base_info_unref( (GIBaseInfo*) arg_info);
-                continue;
-            }
 
-            /* INOUT or OUT */
             arg_type_info = g_arg_info_get_type(arg_info);
 
-            if (direction == GI_DIRECTION_INOUT)
+            if (direction == GI_DIRECTION_IN) {
                 g_assert(in_args_pos < expected_in_argc);
-            g_assert(next_rval < n_return_values);
-            g_assert(out_args_pos < expected_out_argc);
 
-            if (!gjs_value_from_g_arg(context,
-                                      &return_values[next_rval],
-                                      arg_type_info,
-                                      out_args[out_args_pos].v_pointer)) {
-                failed = TRUE;
-            }
+                ++in_args_pos;
+            } else {
+                /* INOUT or OUT */
+                if (direction == GI_DIRECTION_INOUT)
+                    g_assert(in_args_pos < expected_in_argc);
+                g_assert(next_rval < n_return_values);
+                g_assert(out_args_pos < expected_out_argc);
+
+                if (!gjs_value_from_g_arg(context,
+                                          &return_values[next_rval],
+                                          arg_type_info,
+                                          out_args[out_args_pos].v_pointer)) {
+                    failed = TRUE;
+                }
 
-            /* Free GArgument, the jsval should have ref'd or copied it */
-            if (!gjs_g_arg_release(context,
-                                   g_arg_info_get_ownership_transfer(arg_info),
-                                   arg_type_info,
-                                   out_args[out_args_pos].v_pointer))
-                failed = TRUE;
+                /* Free GArgument, the jsval should have ref'd or copied it */
+                if (!gjs_g_arg_release(context,
+                                       g_arg_info_get_ownership_transfer(arg_info),
+                                       arg_type_info,
+                                       out_args[out_args_pos].v_pointer))
+                    failed = TRUE;
 
-            if (direction == GI_DIRECTION_INOUT)
-                ++in_args_pos;
+                if (direction == GI_DIRECTION_INOUT)
+                    ++in_args_pos;
 
-            ++out_args_pos;
+                ++out_args_pos;
+
+                ++next_rval;
+            }
 
             g_base_info_unref( (GIBaseInfo*) arg_type_info);
             g_base_info_unref( (GIBaseInfo*) arg_info);
-
-            ++next_rval;
         }
 
         g_assert(next_rval == n_return_values);



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