From 3856ac407a34f70a14c296687550287c3a39197a Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 16 Feb 2011 09:23:48 -0500 Subject: [PATCH 2/2] fix gcc 4.6 "comparison is always true" warnings --- telepathy-glib/base-contact-list.c | 4 ++-- telepathy-glib/connection.c | 2 +- telepathy-glib/message.c | 6 ++++-- telepathy-glib/text-channel.c | 2 +- tests/dbus/channel-introspect.c | 2 +- tests/dbus/handle-set.c | 4 ++-- tests/dbus/stream-tube.c | 6 +++--- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c index 0e43271..4851f40 100644 --- a/telepathy-glib/base-contact-list.c +++ b/telepathy-glib/base-contact-list.c @@ -5208,8 +5208,8 @@ tp_base_contact_list_mixin_set_contact_groups ( context = NULL; /* ownership transferred to callback */ finally: - tp_clear_pointer (&group_set, tp_handle_set_destroy); - tp_clear_pointer (&normalized_groups, g_ptr_array_unref); + tp_handle_set_destroy (group_set); + g_ptr_array_unref (normalized_groups); if (context != NULL) tp_base_contact_list_mixin_return_void (context, error); diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index 0a9815f..f9ace14 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -496,7 +496,7 @@ tp_connection_set_self_contact (TpConnection *self, TpContact *tmp = self->priv->self_contact; self->priv->self_contact = g_object_ref (contact); - tp_clear_object (&tmp); + g_object_unref (tmp); g_object_notify ((GObject *) self, "self-contact"); g_object_notify ((GObject *) self, "self-handle"); } diff --git a/telepathy-glib/message.c b/telepathy-glib/message.c index 18508f4..b661119 100644 --- a/telepathy-glib/message.c +++ b/telepathy-glib/message.c @@ -755,7 +755,8 @@ tp_message_to_text (TpMessage *message, * that counts as "non-text content" I think */ DEBUG ("... didn't understand it, setting NON_TEXT_CONTENT"); flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT; - tp_clear_pointer (&alternatives_needed, g_hash_table_destroy); + g_hash_table_destroy (alternatives_needed); + alternatives_needed = NULL; } } else if ((flags & TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT) == 0) @@ -769,7 +770,8 @@ tp_message_to_text (TpMessage *message, * (attached image or something, perhaps) */ DEBUG ("... ... yes, no possibility of a text alternative"); flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT; - tp_clear_pointer (&alternatives_needed, g_hash_table_destroy); + g_hash_table_destroy (alternatives_needed); + alternatives_needed = NULL; } else if (alternatives_used != NULL && g_hash_table_lookup (alternatives_used, (gpointer) alternative) diff --git a/telepathy-glib/text-channel.c b/telepathy-glib/text-channel.c index bd0a54d..5d6b6b8 100644 --- a/telepathy-glib/text-channel.c +++ b/telepathy-glib/text-channel.c @@ -223,7 +223,7 @@ message_sent_cb (TpChannel *channel, tp_str_empty (token) ? NULL : token); g_object_unref (msg); - tp_clear_object (&contact); + g_object_unref (contact); } static void diff --git a/tests/dbus/channel-introspect.c b/tests/dbus/channel-introspect.c index 985b065..b2f4859 100644 --- a/tests/dbus/channel-introspect.c +++ b/tests/dbus/channel-introspect.c @@ -758,7 +758,7 @@ main (int argc, MYASSERT (!tp_proxy_prepare_finish (chan, prepare_result, &error), ""); g_assert_error (error, invalidated->domain, invalidated->code); g_assert_cmpstr (error->message, ==, invalidated->message); - tp_clear_object (&prepare_result); + g_object_unref (prepare_result); g_clear_error (&error); g_clear_error (&invalidated); diff --git a/tests/dbus/handle-set.c b/tests/dbus/handle-set.c index 201ab0c..0fc6913 100644 --- a/tests/dbus/handle-set.c +++ b/tests/dbus/handle-set.c @@ -95,7 +95,7 @@ main (int argc, other = tp_handle_set_new_from_intset (repo, result); g_assert (tp_intset_is_equal (tp_handle_set_peek (other), result)); - tp_clear_pointer (&other, tp_handle_set_destroy); + tp_handle_set_destroy (other); tp_intset_destroy (result); @@ -110,7 +110,7 @@ main (int argc, other = tp_handle_set_new_containing (repo, h3); g_assert (tp_intset_is_equal (tp_handle_set_peek (set), tp_handle_set_peek (other))); - tp_clear_pointer (&other, tp_handle_set_destroy); + tp_handle_set_destroy (other); /* can't really assert about the contents */ s = tp_handle_set_dump (set); diff --git a/tests/dbus/stream-tube.c b/tests/dbus/stream-tube.c index 534bdc4..183f909 100644 --- a/tests/dbus/stream-tube.c +++ b/tests/dbus/stream-tube.c @@ -1003,9 +1003,9 @@ denied: ret = FALSE; finally: - tp_clear_object (&sock); - tp_clear_object (&address); - tp_clear_object (&socket_address); + g_object_unref (sock); + g_object_unref (address); + g_object_unref (socket_address); g_clear_error (&error); return ret; } -- 1.7.4