From 6ffdaf6e36768e833164714d538c27c1b002ee03 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 26 Sep 2013 14:37:41 +0100 Subject: [PATCH 5/7] Use tp_value_array_free instead of g_value_array_free Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 --- examples/cm/contactlist/conn.c | 2 +- telepathy-glib/base-call-channel.c | 12 ++++++------ telepathy-glib/base-call-content.c | 2 +- telepathy-glib/base-call-stream.c | 6 +++--- telepathy-glib/base-connection-manager.c | 2 +- telepathy-glib/base-connection.c | 4 ++-- telepathy-glib/base-contact-list.c | 2 +- telepathy-glib/base-media-call-stream.c | 4 ++-- telepathy-glib/base-protocol.c | 2 +- telepathy-glib/call-content-media-description.c | 8 ++++---- telepathy-glib/call-stream-endpoint.c | 4 ++-- telepathy-glib/connection-contact-info.c | 2 +- telepathy-glib/group-mixin.c | 2 +- telepathy-glib/message-mixin.c | 2 +- telepathy-glib/presence-mixin.c | 13 ++++++++----- telepathy-glib/proxy-methods.c | 5 +++-- telepathy-glib/proxy-signals.c | 3 ++- telepathy-glib/text-mixin.c | 2 +- telepathy-glib/util.c | 2 +- tests/dbus/contacts.c | 2 +- tests/lib/broken-client-types-conn.c | 5 ++++- tests/lib/contacts-conn.c | 2 +- tests/lib/room-list-chan.c | 2 +- tests/util.c | 2 +- 24 files changed, 50 insertions(+), 42 deletions(-) diff --git a/examples/cm/contactlist/conn.c b/examples/cm/contactlist/conn.c index bc7876c..3c48f3a 100644 --- a/examples/cm/contactlist/conn.c +++ b/examples/cm/contactlist/conn.c @@ -174,7 +174,7 @@ alias_updated_cb (ExampleContactList *contact_list, tp_svc_connection_interface_aliasing_emit_aliases_changed (self, aliases); g_ptr_array_unref (aliases); - g_value_array_free (pair); + tp_value_array_free (pair); } static void diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c index 045a2b3..b9d053c 100644 --- a/telepathy-glib/base-call-channel.c +++ b/telepathy-glib/base-call-channel.c @@ -287,7 +287,7 @@ tp_base_call_channel_finalize (GObject *object) TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (object); g_hash_table_unref (self->priv->details); - g_value_array_free (self->priv->reason); + tp_value_array_free (self->priv->reason); g_free (self->priv->initial_audio_name); g_free (self->priv->initial_video_name); g_free (self->priv->initial_tones); @@ -761,7 +761,7 @@ tp_base_call_channel_flags_changed (TpBaseCallChannel *self, const gchar *dbus_reason, const gchar *message) { - g_value_array_free (self->priv->reason); + tp_value_array_free (self->priv->reason); self->priv->reason = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); @@ -806,7 +806,7 @@ tp_base_call_channel_set_state (TpBaseCallChannel *self, old_state = self->priv->state; self->priv->state = state; - g_value_array_free (self->priv->reason); + tp_value_array_free (self->priv->reason); self->priv->reason = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); @@ -1021,7 +1021,7 @@ tp_base_call_channel_remove_content (TpBaseCallChannel *self, _tp_base_call_channel_remove_content_internal (self, content, reason_array); - g_value_array_free (reason_array); + tp_value_array_free (reason_array); } /** @@ -1151,7 +1151,7 @@ tp_base_call_channel_update_member_flags (TpBaseCallChannel *self, g_hash_table_unref (updates); g_hash_table_unref (identifiers); g_array_unref (empty_array); - g_value_array_free (reason_array); + tp_value_array_free (reason_array); } /** @@ -1203,7 +1203,7 @@ tp_base_call_channel_remove_member (TpBaseCallChannel *self, g_hash_table_unref (empty_table); g_array_unref (removed); - g_value_array_free (reason_array); + tp_value_array_free (reason_array); } /** diff --git a/telepathy-glib/base-call-content.c b/telepathy-glib/base-call-content.c index 2f572c5..89e263b 100644 --- a/telepathy-glib/base-call-content.c +++ b/telepathy-glib/base-call-content.c @@ -751,7 +751,7 @@ tp_base_call_content_remove_stream (TpBaseCallContent *self, _tp_base_call_content_remove_stream_internal (self, stream, reason_array); - g_value_array_free (reason_array); + tp_value_array_free (reason_array); } static void diff --git a/telepathy-glib/base-call-stream.c b/telepathy-glib/base-call-stream.c index f4d72db..415e0ef 100644 --- a/telepathy-glib/base-call-stream.c +++ b/telepathy-glib/base-call-stream.c @@ -573,7 +573,7 @@ tp_base_call_stream_update_local_sending_state (TpBaseCallStream *self, tp_svc_call_stream_emit_local_sending_state_changed ( TP_SVC_CALL_STREAM (self), new_state, reason_array); - g_value_array_free (reason_array); + tp_value_array_free (reason_array); return TRUE; } @@ -677,7 +677,7 @@ tp_base_call_stream_update_remote_sending_state (TpBaseCallStream *self, removed_empty, reason_array); g_array_unref (removed_empty); - g_value_array_free (reason_array); + tp_value_array_free (reason_array); g_hash_table_unref (updates); g_hash_table_unref (identifiers); @@ -732,7 +732,7 @@ tp_base_call_stream_remove_member (TpBaseCallStream *self, tp_svc_call_stream_emit_remote_members_changed (self, empty_table, empty_table, removed_array, reason_array); - g_value_array_free (reason_array); + tp_value_array_free (reason_array); g_hash_table_unref (empty_table); g_array_unref (removed_array); diff --git a/telepathy-glib/base-connection-manager.c b/telepathy-glib/base-connection-manager.c index 662db99..a533bb2 100644 --- a/telepathy-glib/base-connection-manager.c +++ b/telepathy-glib/base-connection-manager.c @@ -956,7 +956,7 @@ tp_base_connection_manager_get_parameters (TpSvcConnectionManager *iface, for (i = 0; i < ret->len; i++) { - g_value_array_free (g_ptr_array_index (ret, i)); + tp_value_array_free (g_ptr_array_index (ret, i)); } g_ptr_array_unref (ret); diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c index 20c4440..c440279 100644 --- a/telepathy-glib/base-connection.c +++ b/telepathy-glib/base-connection.c @@ -938,7 +938,7 @@ factory_satisfy_requests (TpBaseConnection *conn, g_ptr_array_add (array, get_channel_details (G_OBJECT (chan))); tp_svc_connection_interface_requests_emit_new_channels (conn, array); - g_value_array_free (g_ptr_array_index (array, 0)); + tp_value_array_free (g_ptr_array_index (array, 0)); g_ptr_array_unref (array); tp_svc_connection_emit_new_channel (conn, object_path, channel_type, @@ -1173,7 +1173,7 @@ manager_new_channels_cb (TpChannelManager *manager, tp_svc_connection_interface_requests_emit_new_channels (self, array); - g_ptr_array_foreach (array, (GFunc) g_value_array_free, NULL); + g_ptr_array_foreach (array, (GFunc) tp_value_array_free, NULL); g_ptr_array_unref (array); /* Emit NewChannel */ diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c index d24e5ce..d66717b 100644 --- a/telepathy-glib/base-contact-list.c +++ b/telepathy-glib/base-contact-list.c @@ -2129,7 +2129,7 @@ tp_base_contact_list_contacts_changed_internal (TpBaseContactList *self, store = tp_intset_new (); changes = g_hash_table_new_full (NULL, NULL, NULL, - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); change_ids = g_hash_table_new (NULL, NULL); if (changed != NULL) diff --git a/telepathy-glib/base-media-call-stream.c b/telepathy-glib/base-media-call-stream.c index b0cf366..09e3f7a 100644 --- a/telepathy-glib/base-media-call-stream.c +++ b/telepathy-glib/base-media-call-stream.c @@ -235,7 +235,7 @@ tp_base_media_call_stream_init (TpBaseMediaCallStream *self) TP_TYPE_BASE_MEDIA_CALL_STREAM, TpBaseMediaCallStreamPrivate); self->priv->local_candidates = g_ptr_array_new_with_free_func ( - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); self->priv->username = g_strdup (""); self->priv->password = g_strdup (""); self->priv->receiving_requests = tp_intset_new (); @@ -1392,7 +1392,7 @@ tp_base_media_call_stream_set_credentials (TpSvcCallStreamInterfaceMedia *iface, tp_clear_pointer (&self->priv->local_candidates, g_ptr_array_unref); self->priv->local_candidates = g_ptr_array_new_with_free_func ( - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); g_object_notify (G_OBJECT (self), "local-candidates"); g_object_notify (G_OBJECT (self), "local-credentials"); diff --git a/telepathy-glib/base-protocol.c b/telepathy-glib/base-protocol.c index 926cdcd..3f16449 100644 --- a/telepathy-glib/base-protocol.c +++ b/telepathy-glib/base-protocol.c @@ -964,7 +964,7 @@ protocol_prop_presence_getter (GObject *object, tp_base_protocol_get_statuses (self); GHashTable *ret = g_hash_table_new_full ( g_str_hash, g_str_equal, - g_free, (GDestroyNotify) g_value_array_free); + g_free, (GDestroyNotify) tp_value_array_free); for (; status->name != NULL; status++) { diff --git a/telepathy-glib/call-content-media-description.c b/telepathy-glib/call-content-media-description.c index bc8339c..854b7fe 100644 --- a/telepathy-glib/call-content-media-description.c +++ b/telepathy-glib/call-content-media-description.c @@ -157,12 +157,12 @@ tp_call_content_media_description_init (TpCallContentMediaDescription *self) self->priv->ssrcs = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_array_unref); self->priv->codecs = g_ptr_array_new_with_free_func ( - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); self->priv->header_extensions = g_ptr_array_new_with_free_func ( - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); self->priv->feedback_messages = g_hash_table_new_full (NULL, NULL, NULL, - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); } static void @@ -922,7 +922,7 @@ ensure_rtcp_feedback_properties (TpCallContentMediaDescription *self, if (properties == NULL) { messages_array = g_ptr_array_new_with_free_func ( - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); properties = tp_value_array_build (2, G_TYPE_UINT, G_MAXUINT, G_TYPE_PTR_ARRAY, messages_array, diff --git a/telepathy-glib/call-stream-endpoint.c b/telepathy-glib/call-stream-endpoint.c index 2f87d2d..08d65d1 100644 --- a/telepathy-glib/call-stream-endpoint.c +++ b/telepathy-glib/call-stream-endpoint.c @@ -134,9 +134,9 @@ tp_call_stream_endpoint_init (TpCallStreamEndpoint *self) self->priv->username = g_strdup (""); self->priv->password = g_strdup (""); self->priv->remote_candidates = g_ptr_array_new_with_free_func ( - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); self->priv->selected_candidate_pairs = g_ptr_array_new_with_free_func ( - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); self->priv->endpoint_state = g_hash_table_new (NULL, NULL); } diff --git a/telepathy-glib/connection-contact-info.c b/telepathy-glib/connection-contact-info.c index b2008df..0f2d695 100644 --- a/telepathy-glib/connection-contact-info.c +++ b/telepathy-glib/connection-contact-info.c @@ -581,7 +581,7 @@ tp_connection_set_contact_info_async (TpConnection *self, tp_cli_connection_interface_contact_info_call_set_contact_info (self, -1, contact_info, set_info_cb, result, g_object_unref, NULL); - g_ptr_array_foreach (contact_info, (GFunc) g_value_array_free, NULL); + g_ptr_array_foreach (contact_info, (GFunc) tp_value_array_free, NULL); g_ptr_array_unref (contact_info); } diff --git a/telepathy-glib/group-mixin.c b/telepathy-glib/group-mixin.c index 5907d74..0910cee 100644 --- a/telepathy-glib/group-mixin.c +++ b/telepathy-glib/group-mixin.c @@ -956,7 +956,7 @@ tp_group_mixin_get_local_pending_members_with_info_async ( tp_svc_channel_interface_group_return_from_get_local_pending_members_with_info ( context, ret); for (i = 0 ; i < ret->len; i++) { - g_value_array_free (g_ptr_array_index (ret,i)); + tp_value_array_free (g_ptr_array_index (ret,i)); } g_ptr_array_unref (ret); } diff --git a/telepathy-glib/message-mixin.c b/telepathy-glib/message-mixin.c index ac4683b..10af055 100644 --- a/telepathy-glib/message-mixin.c +++ b/telepathy-glib/message-mixin.c @@ -735,7 +735,7 @@ tp_message_mixin_list_pending_messages_async (TpSvcChannelTypeText *iface, messages); for (i = 0; i < messages->len; i++) - g_value_array_free (g_ptr_array_index (messages, i)); + tp_value_array_free (g_ptr_array_index (messages, i)); g_ptr_array_unref (messages); } diff --git a/telepathy-glib/presence-mixin.c b/telepathy-glib/presence-mixin.c index 8bb5ac4..e954b47 100644 --- a/telepathy-glib/presence-mixin.c +++ b/telepathy-glib/presence-mixin.c @@ -556,7 +556,7 @@ construct_presence_hash (const TpPresenceStatusSpec *supported_statuses, GHashTable *contact_statuses) { GHashTable *presence_hash = g_hash_table_new_full (NULL, NULL, NULL, - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); GHashTableIter iter; gpointer key, value; @@ -840,7 +840,7 @@ tp_presence_mixin_get_statuses (TpSvcConnectionInterfacePresence *iface, TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); ret = g_hash_table_new_full (g_str_hash, g_str_equal, - NULL, (GDestroyNotify) g_value_array_free); + NULL, (GDestroyNotify) tp_value_array_free); for (i=0; mixin_cls->statuses[i].name != NULL; i++) { @@ -1241,7 +1241,7 @@ tp_presence_mixin_get_simple_presence_dbus_property (GObject *object, g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); ret = g_hash_table_new_full (g_str_hash, g_str_equal, - NULL, (GDestroyNotify) g_value_array_free); + NULL, (GDestroyNotify) tp_value_array_free); for (i=0; mixin_cls->statuses[i].name != NULL; i++) { @@ -1423,7 +1423,7 @@ construct_simple_presence_hash (const TpPresenceStatusSpec *supported_statuses, GHashTable *contact_statuses) { GHashTable *presence_hash = g_hash_table_new_full (NULL, NULL, NULL, - (GDestroyNotify) g_value_array_free); + (GDestroyNotify) tp_value_array_free); GHashTableIter iter; gpointer key, value; @@ -1541,6 +1541,9 @@ tp_presence_mixin_simple_presence_fill_contact_attributes (GObject *obj, { GHashTableIter iter; gpointer key, value; + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + GType type = G_TYPE_VALUE_ARRAY; + G_GNUC_END_IGNORE_DEPRECATIONS g_hash_table_iter_init (&iter, contact_statuses); while (g_hash_table_iter_next (&iter, &key, &value)) @@ -1552,7 +1555,7 @@ tp_presence_mixin_simple_presence_fill_contact_attributes (GObject *obj, tp_contacts_mixin_set_contact_attribute (attributes_hash, handle, TP_TOKEN_CONNECTION_INTERFACE_SIMPLE_PRESENCE_PRESENCE, - tp_g_value_slice_new_take_boxed (G_TYPE_VALUE_ARRAY, presence)); + tp_g_value_slice_new_take_boxed (type, presence)); } g_hash_table_unref (contact_statuses); diff --git a/telepathy-glib/proxy-methods.c b/telepathy-glib/proxy-methods.c index a7472bd..3e0609a 100644 --- a/telepathy-glib/proxy-methods.c +++ b/telepathy-glib/proxy-methods.c @@ -24,6 +24,7 @@ #define DEBUG_FLAG TP_DEBUG_PROXY #include "telepathy-glib/debug-internal.h" +#include #if 0 #define MORE_DEBUG DEBUG @@ -314,7 +315,7 @@ tp_proxy_pending_call_cancel (TpProxyPendingCall *pc) if (pc->args != NULL) { - g_value_array_free (pc->args); + tp_value_array_free (pc->args); pc->args = NULL; } } @@ -363,7 +364,7 @@ tp_proxy_pending_call_free (TpProxyPendingCall *pc) pc->error = NULL; if (pc->args != NULL) - g_value_array_free (pc->args); + tp_value_array_free (pc->args); pc->args = NULL; diff --git a/telepathy-glib/proxy-signals.c b/telepathy-glib/proxy-signals.c index 2af1e38..b90bba2 100644 --- a/telepathy-glib/proxy-signals.c +++ b/telepathy-glib/proxy-signals.c @@ -23,6 +23,7 @@ #define DEBUG_FLAG TP_DEBUG_PROXY #include "telepathy-glib/debug-internal.h" +#include #if 0 #define MORE_DEBUG DEBUG @@ -249,7 +250,7 @@ tp_proxy_signal_invocation_free (gpointer p) g_assert (invocation->proxy == NULL); if (invocation->args != NULL) - g_value_array_free (invocation->args); + tp_value_array_free (invocation->args); g_slice_free (TpProxySignalInvocation, invocation); } diff --git a/telepathy-glib/text-mixin.c b/telepathy-glib/text-mixin.c index 7d6364f..54b3fd7 100644 --- a/telepathy-glib/text-mixin.c +++ b/telepathy-glib/text-mixin.c @@ -559,7 +559,7 @@ tp_text_mixin_list_pending_messages_async (TpSvcChannelTypeText *iface, context, ret); for (i = 0; i < ret->len; i++) - g_value_array_free (g_ptr_array_index (ret, i)); + tp_value_array_free (g_ptr_array_index (ret, i)); g_ptr_array_unref (ret); } diff --git a/telepathy-glib/util.c b/telepathy-glib/util.c index 7dca706..2582624 100644 --- a/telepathy-glib/util.c +++ b/telepathy-glib/util.c @@ -1130,7 +1130,7 @@ tp_value_array_build (gsize length, CRITICAL ("%s", error); g_free (error); - g_value_array_free (arr); + tp_value_array_free (arr); va_end (var_args); return NULL; } diff --git a/tests/dbus/contacts.c b/tests/dbus/contacts.c index 9a4e9cc..0155cd2 100644 --- a/tests/dbus/contacts.c +++ b/tests/dbus/contacts.c @@ -326,7 +326,7 @@ test_contact_info (Fixture *f, GCancellable *cancellable; /* Create fake info fields */ - info = g_ptr_array_new_with_free_func ((GDestroyNotify) g_value_array_free); + info = g_ptr_array_new_with_free_func ((GDestroyNotify) tp_value_array_free); g_ptr_array_add (info, tp_value_array_build (3, G_TYPE_STRING, "n", G_TYPE_STRV, NULL, diff --git a/tests/lib/broken-client-types-conn.c b/tests/lib/broken-client-types-conn.c index cdc273a..1c6f3af 100644 --- a/tests/lib/broken-client-types-conn.c +++ b/tests/lib/broken-client-types-conn.c @@ -36,6 +36,9 @@ broken_fill_client_types ( GHashTable *attributes) { guint i; + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + GType type = G_TYPE_VALUE_ARRAY; + G_GNUC_END_IGNORE_DEPRECATIONS for (i = 0; i < contacts->len; i++) { @@ -50,7 +53,7 @@ broken_fill_client_types ( tp_contacts_mixin_set_contact_attribute (attributes, handle, TP_TOKEN_CONNECTION_INTERFACE_SIMPLE_PRESENCE_PRESENCE, - tp_g_value_slice_new_take_boxed (G_TYPE_VALUE_ARRAY, presence)); + tp_g_value_slice_new_take_boxed (type, presence)); } } diff --git a/tests/lib/contacts-conn.c b/tests/lib/contacts-conn.c index 9d4387b..e90612e 100644 --- a/tests/lib/contacts-conn.c +++ b/tests/lib/contacts-conn.c @@ -653,7 +653,7 @@ tp_tests_contacts_connection_change_aliases (TpTestsContactsConnection *self, tp_svc_connection_interface_aliasing_emit_aliases_changed (self, structs); - g_ptr_array_foreach (structs, (GFunc) g_value_array_free, NULL); + g_ptr_array_foreach (structs, (GFunc) tp_value_array_free, NULL); g_ptr_array_unref (structs); } diff --git a/tests/lib/room-list-chan.c b/tests/lib/room-list-chan.c index e6134a3..cc5f15f 100644 --- a/tests/lib/room-list-chan.c +++ b/tests/lib/room-list-chan.c @@ -190,7 +190,7 @@ find_rooms (gpointer data) TpTestsRoomListChan *self = TP_TESTS_ROOM_LIST_CHAN (data); GPtrArray *rooms; - rooms = g_ptr_array_new_with_free_func ((GDestroyNotify) g_value_array_free); + rooms = g_ptr_array_new_with_free_func ((GDestroyNotify) tp_value_array_free); /* Find 2 rooms */ add_room (rooms); diff --git a/tests/util.c b/tests/util.c index dad995c..44fee02 100644 --- a/tests/util.c +++ b/tests/util.c @@ -49,7 +49,7 @@ test_value_array_build (void) g_assert_cmpstr (host_out, ==, host); g_assert_cmpuint (port_out, ==, port); - g_value_array_free (arr); + tp_value_array_free (arr); } static void -- 1.8.4.rc3