[glib/wip/gvariant-kdbus: 16/17] GVariant: clean up g_variant_get_child_value()
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gvariant-kdbus: 16/17] GVariant: clean up g_variant_get_child_value()
- Date: Wed, 3 Dec 2014 07:17:56 +0000 (UTC)
commit a169f1d1a855b7119178ce372b5bacb314aa3f37
Author: Ryan Lortie <desrt desrt ca>
Date: Wed Dec 3 02:10:24 2014 -0500
GVariant: clean up g_variant_get_child_value()
Remove this one outstanding case of direct construction of GVariant
instances and port it to use g_variant_alloc() like everyone else.
glib/gvariant-core.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c
index 0117add..32b1a88 100644
--- a/glib/gvariant-core.c
+++ b/glib/gvariant-core.c
@@ -1012,15 +1012,10 @@ g_variant_get_child_value (GVariant *value,
s_child = g_variant_serialised_get_child (serialised, index_);
/* create a new serialised instance out of it */
- child = g_slice_new (GVariant);
- child->type_info = s_child.type_info;
- child->state = (value->state & STATE_TRUSTED) |
- STATE_SERIALISED;
- child->size = s_child.size;
- child->ref_count = 1;
- child->contents.serialised.bytes =
- g_bytes_ref (value->contents.serialised.bytes);
- child->contents.serialised.data = s_child.data;
+ child = g_variant_new_serialised (s_child.type_info,
+ g_bytes_ref (value->contents.serialised.bytes),
+ s_child.data, s_child.size,
+ value->state & STATE_TRUSTED);
}
return child;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]