dbus/glib dbus-gobject.c,1.34,1.35
Colin Walters
walters at freedesktop.org
Mon Jun 27 11:20:23 PDT 2005
Update of /cvs/dbus/dbus/glib
In directory gabe:/tmp/cvs-serv3685/glib
Modified Files:
dbus-gobject.c
Log Message:
2005-06-27 Colin Walters <walters at verbum.org>
* test/glib/test-dbus-glib.c:
* test/glib/test-service-glib.c:
* test/glib/test-service-glib.xml:
Test hash table signal emitting.
* glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller): Convert
types to their fundamental basis types, since this is what
marshallers operate on. Also add an entry for VOID__BOXED.
(dbus_g_object_register_marshaller_array): Convert to fundamental.
Index: dbus-gobject.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gobject.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- dbus-gobject.c 26 Jun 2005 17:02:09 -0000 1.34
+++ dbus-gobject.c 27 Jun 2005 18:20:20 -0000 1.35
@@ -1429,10 +1429,18 @@
{
GClosureMarshal ret;
DBusGFuncSignature sig;
+ GType *params;
+ guint i;
+
+ /* Convert to fundamental types */
+ rettype = G_TYPE_FUNDAMENTAL (rettype);
+ params = g_new (GType, n_params);
+ for (i = 0; i < n_params; i++)
+ params[i] = G_TYPE_FUNDAMENTAL (param_types[i]);
sig.rettype = rettype;
sig.n_params = n_params;
- sig.params = (GType*) param_types;
+ sig.params = params;
g_static_rw_lock_reader_lock (&globals_lock);
@@ -1451,7 +1459,7 @@
ret = g_cclosure_marshal_VOID__VOID;
else if (n_params == 1)
{
- switch (param_types[0])
+ switch (params[0])
{
case G_TYPE_BOOLEAN:
ret = g_cclosure_marshal_VOID__BOOLEAN;
@@ -1471,18 +1479,22 @@
case G_TYPE_STRING:
ret = g_cclosure_marshal_VOID__STRING;
break;
+ case G_TYPE_BOXED:
+ ret = g_cclosure_marshal_VOID__BOXED;
+ break;
}
}
}
else if (n_params == 3
- && param_types[0] == G_TYPE_STRING
- && param_types[1] == G_TYPE_STRING
- && param_types[2] == G_TYPE_STRING)
+ && params[0] == G_TYPE_STRING
+ && params[1] == G_TYPE_STRING
+ && params[2] == G_TYPE_STRING)
{
ret = _dbus_g_marshal_NONE__STRING_STRING_STRING;
}
}
+ g_free (params);
return ret;
}
@@ -1536,6 +1548,7 @@
const GType* types)
{
DBusGFuncSignature *sig;
+ guint i;
g_static_rw_lock_writer_lock (&globals_lock);
@@ -1545,10 +1558,11 @@
g_free,
NULL);
sig = g_new0 (DBusGFuncSignature, 1);
- sig->rettype = rettype;
+ sig->rettype = G_TYPE_FUNDAMENTAL (rettype);
sig->n_params = n_types;
sig->params = g_new (GType, n_types);
- memcpy (sig->params, types, n_types * sizeof (GType));
+ for (i = 0; i < n_types; i++)
+ sig->params[i] = G_TYPE_FUNDAMENTAL (types[i]);
g_hash_table_insert (marshal_table, sig, marshaller);
More information about the dbus-commit
mailing list