From 71cf7b746f5f6f184ff03e9ec3f49bef4327fe5c Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 16 Feb 2011 09:22:47 -0500 Subject: [PATCH 1/2] fix gcc 4.6 "variable is set but not used" warnings --- telepathy-glib/account.c | 3 --- telepathy-glib/base-contact-list.c | 12 ------------ telepathy-glib/cm-message.c | 4 ---- telepathy-glib/gnio-util.c | 2 +- tests/dbus/contacts.c | 3 +-- tests/dbus/group-mixin.c | 3 +-- tests/dbus/text-channel.c | 1 + 7 files changed, 4 insertions(+), 24 deletions(-) diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c index 4d6d6f3..328e95f 100644 --- a/telepathy-glib/account.c +++ b/telepathy-glib/account.c @@ -2215,14 +2215,11 @@ tp_account_set_enabled_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data) { - TpAccountPrivate *priv; GValue value = {0, }; GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (account)); - priv = account->priv; - result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_set_enabled_finish); diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c index 57740cf..0e43271 100644 --- a/telepathy-glib/base-contact-list.c +++ b/telepathy-glib/base-contact-list.c @@ -4978,13 +4978,10 @@ tp_base_contact_list_get_list_dbus_property (GObject *conn, TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) conn, TP_TYPE_BASE_CONTACT_LIST); ListProp p = GPOINTER_TO_INT (data); - TpBaseContactListClass *cls; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (self->priv->conn != NULL); - cls = TP_BASE_CONTACT_LIST_GET_CLASS (self); - switch (p) { case LP_CONTACT_LIST_STATE: @@ -5022,7 +5019,6 @@ tp_base_contact_list_fill_list_contact_attributes (GObject *obj, { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) obj, TP_TYPE_BASE_CONTACT_LIST); - TpBaseContactListClass *cls; guint i; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); @@ -5032,8 +5028,6 @@ tp_base_contact_list_fill_list_contact_attributes (GObject *obj, if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) return; - cls = TP_BASE_CONTACT_LIST_GET_CLASS (self); - for (i = 0; i < contacts->len; i++) { TpSubscriptionState subscribe = TP_SUBSCRIPTION_STATE_NO; @@ -5504,14 +5498,11 @@ tp_base_contact_list_get_group_dbus_property (GObject *conn, TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) conn, TP_TYPE_BASE_CONTACT_LIST); GroupProp p = GPOINTER_TO_INT (data); - TpBaseContactListClass *cls; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); g_return_if_fail (self->priv->conn != NULL); - cls = TP_BASE_CONTACT_LIST_GET_CLASS (self); - switch (p) { case GP_DISJOINT_GROUPS: @@ -5545,7 +5536,6 @@ tp_base_contact_list_fill_groups_contact_attributes (GObject *obj, { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) obj, TP_TYPE_BASE_CONTACT_LIST); - TpBaseContactListClass *cls; guint i; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); @@ -5556,8 +5546,6 @@ tp_base_contact_list_fill_groups_contact_attributes (GObject *obj, if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) return; - cls = TP_BASE_CONTACT_LIST_GET_CLASS (self); - for (i = 0; i < contacts->len; i++) { TpHandle handle; diff --git a/telepathy-glib/cm-message.c b/telepathy-glib/cm-message.c index 9e2592e..e9945ac 100644 --- a/telepathy-glib/cm-message.c +++ b/telepathy-glib/cm-message.c @@ -145,8 +145,6 @@ tp_cm_message_take_message (TpMessage *self, const gchar *key, TpMessage *message) { - TpCMMessage *cm_message; - g_return_if_fail (self != NULL); g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); @@ -155,8 +153,6 @@ tp_cm_message_take_message (TpMessage *self, g_return_if_fail (TP_IS_CM_MESSAGE (self)); g_return_if_fail (TP_IS_CM_MESSAGE (message)); - cm_message = (TpCMMessage *) message; - g_return_if_fail (TP_CM_MESSAGE (self)->priv->connection == TP_CM_MESSAGE (message)->priv->connection); diff --git a/telepathy-glib/gnio-util.c b/telepathy-glib/gnio-util.c index a254441..6bb2cab 100644 --- a/telepathy-glib/gnio-util.c +++ b/telepathy-glib/gnio-util.c @@ -455,7 +455,7 @@ _tp_unix_connection_receive_credentials_with_byte (GUnixConnection *connection, vector.size = 1; /* ensure the type of GUnixCredentialsMessage has been registered with the type system */ - credentials_message_gtype = G_TYPE_UNIX_CREDENTIALS_MESSAGE; + (void) (credentials_message_gtype = G_TYPE_UNIX_CREDENTIALS_MESSAGE); num_bytes_read = g_socket_receive_message (_socket, NULL, /* GSocketAddress **address */ &vector, diff --git a/tests/dbus/contacts.c b/tests/dbus/contacts.c index 618153b..a01bd53 100644 --- a/tests/dbus/contacts.c +++ b/tests/dbus/contacts.c @@ -265,7 +265,6 @@ test_contact_info (Fixture *f, TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContactFeature features[] = { TP_CONTACT_FEATURE_CONTACT_INFO }; - TpContact *self_contact; TpContact *contact; TpHandle handle; const gchar *field_value[] = { "Foo", NULL }; @@ -308,7 +307,7 @@ test_contact_info (Fixture *f, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); - self_contact = g_object_ref (g_ptr_array_index (result.contacts, 0)); + g_object_ref (g_ptr_array_index (result.contacts, 0)); reset_result (&result); tp_connection_set_contact_info_async (client_conn, info_list, diff --git a/tests/dbus/group-mixin.c b/tests/dbus/group-mixin.c index a5689f3..558be19 100644 --- a/tests/dbus/group-mixin.c +++ b/tests/dbus/group-mixin.c @@ -157,7 +157,6 @@ check_initial_properties (void) { GHashTable *props = NULL; GArray *members; - TpHandle h; gboolean valid; GError *error = NULL; TpChannelGroupFlags flags; @@ -180,7 +179,7 @@ check_initial_properties (void) MYASSERT (members != NULL, ": LocalPendingMembers should be defined"); \ MYASSERT (members->len == 0, ": LocalPendingMembers should be empty initally"); - h = tp_asv_get_uint32 (props, "SelfHandle", &valid); + tp_asv_get_uint32 (props, "SelfHandle", &valid); MYASSERT (valid, ": SelfHandle property should be defined"); flags = tp_asv_get_uint32 (props, "GroupFlags", &valid); diff --git a/tests/dbus/text-channel.c b/tests/dbus/text-channel.c index 80f5de2..decbd1a 100644 --- a/tests/dbus/text-channel.c +++ b/tests/dbus/text-channel.c @@ -62,6 +62,7 @@ create_contact_chan (Test *test) g_assert_no_error (test->error); alf_handle = tp_handle_ensure (test->contact_repo, "alf", NULL, &test->error); + g_assert (alf_handle); g_assert_no_error (test->error); test->chan_service = g_object_new ( -- 1.7.4