summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-05-10 14:16:54 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-05-10 20:20:08 +0100
commit3e6a3e363f6486dc35fb2e1fbf4de04946e60594 (patch)
tree70d3d307bb405ee6262cc087f4160885bee91a0b /src
parentc3de9e89b571782e393d0f3b1a8236d34beec9d5 (diff)
downloadtelepathy-idle-3e6a3e363f6486dc35fb2e1fbf4de04946e60594.tar.gz
Fix some confusing variable-shadowing by just reusing the variables
This code is a bit of a mess, and it implements Telepathy 0.x Properties by hand, without even using the (now deprecated!) mixin, but I'm not going to fix that right now. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/idle-muc-channel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/idle-muc-channel.c b/src/idle-muc-channel.c
index c27c704..028ca40 100644
--- a/src/idle-muc-channel.c
+++ b/src/idle-muc-channel.c
@@ -907,12 +907,13 @@ static void change_mode_state(IdleMUCChannel *obj, guint add, guint remove) {
1, val,
G_MAXUINT);
+ /* ownership of prop's contents is given to
+ * the GPtrArray */
g_ptr_array_add(tp_props_to_change, g_value_get_boxed(&prop));
if (add & i) {
- GValue prop = {0, };
- GValue val_auto_is_fine = {0, };
- GValue *val = &val_auto_is_fine;
+ /* this re-uses prop and val by
+ * re-initializing them */
g_value_init(&prop, TP_STRUCT_TYPE_PROPERTY_VALUE);
g_value_take_boxed(&prop, dbus_g_type_specialized_construct(TP_STRUCT_TYPE_PROPERTY_VALUE));
@@ -934,6 +935,8 @@ static void change_mode_state(IdleMUCChannel *obj, guint add, guint remove) {
1, val,
G_MAXUINT);
+ /* ownership of prop's contents is
+ * given to the GPtrArray */
g_ptr_array_add(tp_props_to_change, g_value_get_boxed(&prop));
}
}