summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2005-07-01 15:44:12 +0000
committerColin Walters <walters@verbum.org>2005-07-01 15:44:12 +0000
commit249c5ea945b7f87307e4af6ae95faf76b2549423 (patch)
tree4f51f53b7740864b5cb262b899e254169ba6b04e
parent03d040311afd4b988b9a277a8aa360fa20243c92 (diff)
2005-07-01 Colin Walters <walters@verbum.org>
Patch from Jonathan Matthew <jonathan@kaolin.hn.org> * glib/dbus-gvalue.c (basic_typecode_to_gtype): Fix return type. (dbus_g_value_types_init): Marshal G_TYPE_CHAR as DBUS_TYPE_BYTE, G_TYPE_LONG as DBUS_TYPE_INT32, G_TYPE_ULONG as DBUS_TYPE_UINT32, and G_TYPE_FLOAT as DBUS_TYPE_DOUBLE.
-rw-r--r--ChangeLog9
-rw-r--r--glib/dbus-gvalue.c33
2 files changed, 40 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0476f339..f88b16d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-07-01 Colin Walters <walters@verbum.org>
+
+ Patch from Jonathan Matthew <jonathan@kaolin.hn.org>
+
+ * glib/dbus-gvalue.c (basic_typecode_to_gtype): Fix return type.
+ (dbus_g_value_types_init): Marshal G_TYPE_CHAR as DBUS_TYPE_BYTE,
+ G_TYPE_LONG as DBUS_TYPE_INT32, G_TYPE_ULONG as DBUS_TYPE_UINT32,
+ and G_TYPE_FLOAT as DBUS_TYPE_DOUBLE.
+
2005-06-30 Colin Walters <walters@verbum.org>
* test/glib/test-dbus-glib.c:
diff --git a/glib/dbus-gvalue.c b/glib/dbus-gvalue.c
index d8ce3d2b..e2786c48 100644
--- a/glib/dbus-gvalue.c
+++ b/glib/dbus-gvalue.c
@@ -170,7 +170,7 @@ dbus_typecode_maps_to_basic (int typecode)
return typecode_to_gtype (typecode) != G_TYPE_INVALID;
}
-static gboolean
+static GType
basic_typecode_to_gtype (int typecode)
{
g_assert (dbus_type_is_basic (typecode));
@@ -306,7 +306,36 @@ dbus_g_value_types_init (void)
};
register_basic (DBUS_TYPE_STRING, &typedata);
}
-
+ /* fundamental GTypes that don't map 1:1 with D-BUS types */
+ {
+ static const DBusGTypeMarshalData typedata = {
+ DBUS_TYPE_BYTE_AS_STRING,
+ &basic_vtable,
+ };
+ set_type_metadata (G_TYPE_CHAR, &typedata);
+ }
+ {
+ static const DBusGTypeMarshalData typedata = {
+ DBUS_TYPE_INT32_AS_STRING,
+ &basic_vtable,
+ };
+ set_type_metadata (G_TYPE_LONG, &typedata);
+ }
+ {
+ static const DBusGTypeMarshalData typedata = {
+ DBUS_TYPE_UINT32_AS_STRING,
+ &basic_vtable,
+ };
+ set_type_metadata (G_TYPE_ULONG, &typedata);
+ }
+ {
+ static const DBusGTypeMarshalData typedata = {
+ DBUS_TYPE_DOUBLE_AS_STRING,
+ &basic_vtable,
+ };
+ set_type_metadata (G_TYPE_FLOAT, &typedata);
+ }
+
/* Register complex types with builtin GType mappings */
{
static const DBusGTypeMarshalVtable vtable = {