seed r77 - trunk/libseed
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r77 - trunk/libseed
- Date: Mon, 3 Nov 2008 08:22:07 +0000 (UTC)
Author: racarr
Date: Mon Nov 3 08:22:07 2008
New Revision: 77
URL: http://svn.gnome.org/viewvc/seed?rev=77&view=rev
Log:
Fix signal marshalling of boxed types. Free bonus commit: Allocate
signal arguments on the stack.
Modified:
trunk/libseed/seed-signals.c
trunk/libseed/seed-structs.c
trunk/libseed/seed-types.c
Modified: trunk/libseed/seed-signals.c
==============================================================================
--- trunk/libseed/seed-signals.c (original)
+++ trunk/libseed/seed-signals.c Mon Nov 3 08:22:07 2008
@@ -132,11 +132,12 @@
JSValueRef * args;
int i;
- args = g_new0(JSValueRef, n_param_values);
+ args = g_newa(JSValueRef, n_param_values);
for (i = 0; i < n_param_values; i++)
{
args[i] = seed_value_from_gvalue((GValue *)¶m_values[i]);
+
if (!args[i])
g_error("Error in signal marshal. "
"Unable to convert argument of type: %s \n",
@@ -147,7 +148,6 @@
JSObjectCallAsFunction(eng->context, seed_closure->function,
seed_closure->this,
n_param_values, args, 0);
- g_free(args);
}
static JSValueRef
Modified: trunk/libseed/seed-structs.c
==============================================================================
--- trunk/libseed/seed-structs.c (original)
+++ trunk/libseed/seed-structs.c Mon Nov 3 08:22:07 2008
@@ -60,18 +60,21 @@
object = JSObjectMake(eng->context, seed_struct_class, younion);
- n_methods =
- g_struct_info_get_n_methods((GIStructInfo *)info);
- for (i = 0; i < n_methods; i++)
+ if (info)
{
- GIFunctionInfo *finfo;
-
- finfo = g_struct_info_get_method(
- (GIStructInfo*)info, i);
-
- seed_gobject_define_property_from_function_info((GIFunctionInfo *)finfo,
- object,
- TRUE);
+ n_methods =
+ g_struct_info_get_n_methods((GIStructInfo *)info);
+ for (i = 0; i < n_methods; i++)
+ {
+ GIFunctionInfo *finfo;
+
+ finfo = g_struct_info_get_method(
+ (GIStructInfo*)info, i);
+
+ seed_gobject_define_property_from_function_info((GIFunctionInfo *)finfo,
+ object,
+ TRUE);
+ }
}
seed_value_set_property(object, "test", seed_value_from_int(5));
return object;
Modified: trunk/libseed/seed-types.c
==============================================================================
--- trunk/libseed/seed-types.c (original)
+++ trunk/libseed/seed-types.c Mon Nov 3 08:22:07 2008
@@ -410,7 +410,6 @@
{
return false;
}
-
switch(G_VALUE_TYPE(gval))
{
case G_TYPE_BOOLEAN:
@@ -437,6 +436,8 @@
return seed_value_from_double(g_value_get_double(gval));
case G_TYPE_STRING:
return seed_value_from_string((gchar*)g_value_get_string(gval));
+ case G_TYPE_POINTER:
+ return seed_make_struct(g_value_get_pointer(gval), 0);
}
if(g_type_is_a(G_VALUE_TYPE(gval), G_TYPE_ENUM))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]