summaryrefslogtreecommitdiffstats
path: root/glib
diff options
context:
space:
mode:
Diffstat (limited to 'glib')
-rw-r--r--glib/dbus-gvalue-utils.c17
-rw-r--r--glib/dbus-gvalue.c4
2 files changed, 20 insertions, 1 deletions
diff --git a/glib/dbus-gvalue-utils.c b/glib/dbus-gvalue-utils.c
index c7b0d580..4956f222 100644
--- a/glib/dbus-gvalue-utils.c
+++ b/glib/dbus-gvalue-utils.c
@@ -299,6 +299,7 @@ hash_free_from_gtype (GType gtype, GDestroyNotify *func)
case G_TYPE_UINT:
*func = NULL;
return TRUE;
+ case G_TYPE_DOUBLE:
case G_TYPE_STRING:
*func = g_free;
return TRUE;
@@ -308,6 +309,12 @@ hash_free_from_gtype (GType gtype, GDestroyNotify *func)
*func = unset_and_free_g_value;
return TRUE;
}
+ else if (gtype == G_TYPE_VALUE_ARRAY)
+ {
+ *func = g_value_array_free;
+ return TRUE;
+ }
+
return FALSE;
}
}
@@ -387,6 +394,9 @@ gvalue_from_hash_value (GValue *value, gpointer instance)
case G_TYPE_UINT:
g_value_set_uint (value, GPOINTER_TO_UINT (instance));
break;
+ case G_TYPE_DOUBLE:
+ g_value_set_double (value, *(gdouble *) instance);
+ break;
case G_TYPE_STRING:
g_value_set_static_string (value, instance);
break;
@@ -426,6 +436,13 @@ hash_value_from_gvalue (GValue *value)
case G_TYPE_UINT:
return GUINT_TO_POINTER (g_value_get_uint (value));
break;
+ case G_TYPE_DOUBLE:
+ {
+ gdouble *p = (gdouble *) g_malloc0 (sizeof (gdouble));
+ *p = g_value_get_double (value);
+ return (gpointer) p;
+ }
+ break;
case G_TYPE_STRING:
return (gpointer) g_value_get_string (value);
break;
diff --git a/glib/dbus-gvalue.c b/glib/dbus-gvalue.c
index 528f5033..2f6371e3 100644
--- a/glib/dbus-gvalue.c
+++ b/glib/dbus-gvalue.c
@@ -402,7 +402,7 @@ dbus_gvalue_to_signature (const GValue *val)
array = g_value_get_boxed (val);
- str = g_string_new ("");
+ str = g_string_new (DBUS_STRUCT_BEGIN_CHAR_AS_STRING);
for (i = 0; i < array->n_values; i++)
{
char *sig;
@@ -410,6 +410,8 @@ dbus_gvalue_to_signature (const GValue *val)
g_string_append (str, sig);
g_free (sig);
}
+ g_string_append (str, DBUS_STRUCT_END_CHAR_AS_STRING);
+
return g_string_free (str, FALSE);
}
else