[folks] Fix some gcc warnings in the Telepathy test case library
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] Fix some gcc warnings in the Telepathy test case library
- Date: Sat, 30 Oct 2010 09:49:49 +0000 (UTC)
commit 5fc41edc86a142c9c9a26bb9b85253d8a459c005
Author: Philip Withnall <philip tecnocode co uk>
Date: Sat Oct 30 10:49:29 2010 +0100
Fix some gcc warnings in the Telepathy test case library
tests/lib/telepathy/contactlist/account-manager.c | 12 ++++----
tests/lib/telepathy/contactlist/account.c | 32 ++++++++++----------
.../telepathy/contactlist/contact-list-manager.c | 6 +++-
.../telepathy/contactlist/contact-list-manager.h | 5 ++-
tests/lib/telepathy/contactlist/contact-list.c | 20 ++++++------
5 files changed, 40 insertions(+), 35 deletions(-)
---
diff --git a/tests/lib/telepathy/contactlist/account-manager.c b/tests/lib/telepathy/contactlist/account-manager.c
index 1eebc1e..984eee9 100644
--- a/tests/lib/telepathy/contactlist/account-manager.c
+++ b/tests/lib/telepathy/contactlist/account-manager.c
@@ -33,11 +33,11 @@ G_DEFINE_TYPE_WITH_CODE (TpTestAccountManager,
/* TP_IFACE_ACCOUNT_MANAGER is implied */
static const char *ACCOUNT_MANAGER_INTERFACES[] = { NULL };
-static gchar *VALID_ACCOUNTS[] = {
+static const gchar *VALID_ACCOUNTS[] = {
"/org/freedesktop/Telepathy/Account/cm/protocol/account",
NULL };
-static gchar *INVALID_ACCOUNTS[] = {
+static const gchar *INVALID_ACCOUNTS[] = {
"/org/freedesktop/Telepathy/Account/fakecm/fakeproto/invalidaccount",
NULL };
@@ -139,11 +139,11 @@ tp_test_account_manager_class_init (
GParamSpec *param_spec;
static TpDBusPropertiesMixinPropImpl am_props[] = {
- { "Interfaces", "interfaces", NULL },
- { "ValidAccounts", "valid-accounts", NULL },
- { "InvalidAccounts", "invalid-accounts", NULL },
+ { "Interfaces", (gpointer) "interfaces", NULL },
+ { "ValidAccounts", (gpointer) "valid-accounts", NULL },
+ { "InvalidAccounts", (gpointer) "invalid-accounts", NULL },
/*
- { "SupportedAccountProperties", "supported-account-properties", NULL },
+ { "SupportedAccountProperties", (gpointer) "supported-account-properties", NULL },
*/
{ NULL }
};
diff --git a/tests/lib/telepathy/contactlist/account.c b/tests/lib/telepathy/contactlist/account.c
index 1d65f48..06a5893 100644
--- a/tests/lib/telepathy/contactlist/account.c
+++ b/tests/lib/telepathy/contactlist/account.c
@@ -191,22 +191,22 @@ tp_test_account_class_init (TpTestAccountClass *klass)
GParamSpec *param_spec;
static TpDBusPropertiesMixinPropImpl a_props[] = {
- { "Interfaces", "interfaces", NULL },
- { "DisplayName", "display-name", NULL },
- { "Icon", "icon", NULL },
- { "Valid", "valid", NULL },
- { "Enabled", "enabled", NULL },
- { "Nickname", "nickname", NULL },
- { "Parameters", "parameters", NULL },
- { "AutomaticPresence", "automatic-presence", NULL },
- { "ConnectAutomatically", "connect-automatically", NULL },
- { "Connection", "connection", NULL },
- { "ConnectionStatus", "connection-status", NULL },
- { "ConnectionStatusReason", "connection-status-reason", NULL },
- { "CurrentPresence", "current-presence", NULL },
- { "RequestedPresence", "requested-presence", NULL },
- { "NormalizedName", "normalized-name", NULL },
- { "HasBeenOnline", "has-been-online", NULL },
+ { "Interfaces", (gpointer) "interfaces", NULL },
+ { "DisplayName", (gpointer) "display-name", NULL },
+ { "Icon", (gpointer) "icon", NULL },
+ { "Valid", (gpointer) "valid", NULL },
+ { "Enabled", (gpointer) "enabled", NULL },
+ { "Nickname", (gpointer) "nickname", NULL },
+ { "Parameters", (gpointer) "parameters", NULL },
+ { "AutomaticPresence", (gpointer) "automatic-presence", NULL },
+ { "ConnectAutomatically", (gpointer) "connect-automatically", NULL },
+ { "Connection", (gpointer) "connection", NULL },
+ { "ConnectionStatus", (gpointer) "connection-status", NULL },
+ { "ConnectionStatusReason", (gpointer) "connection-status-reason", NULL },
+ { "CurrentPresence", (gpointer) "current-presence", NULL },
+ { "RequestedPresence", (gpointer) "requested-presence", NULL },
+ { "NormalizedName", (gpointer) "normalized-name", NULL },
+ { "HasBeenOnline", (gpointer) "has-been-online", NULL },
{ NULL }
};
diff --git a/tests/lib/telepathy/contactlist/contact-list-manager.c b/tests/lib/telepathy/contactlist/contact-list-manager.c
index b24c8fc..d0438b5 100644
--- a/tests/lib/telepathy/contactlist/contact-list-manager.c
+++ b/tests/lib/telepathy/contactlist/contact-list-manager.c
@@ -655,6 +655,8 @@ status_changed_cb (TpBaseConnection *conn,
tp_test_contact_list_manager_close_all (self);
}
break;
+ default:
+ g_assert_not_reached ();
}
}
@@ -900,7 +902,7 @@ tp_test_contact_list_manager_foreach_channel_class (TpChannelManager *manager,
func (manager, table, allowed_properties, user_data);
- g_hash_table_insert (table, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE,
+ g_hash_table_insert (table, (gpointer) TP_PROP_CHANNEL_TARGET_HANDLE_TYPE,
tp_g_value_slice_new_uint (TP_HANDLE_TYPE_GROUP));
func (manager, table, allowed_properties, user_data);
@@ -1429,6 +1431,7 @@ tp_test_contact_list_manager_add_to_list (TpTestContactListManager *self,
}
return TRUE;
+ case INVALID_TP_TEST_CONTACT_LIST:
default:
g_return_val_if_reached (FALSE);
}
@@ -1598,6 +1601,7 @@ tp_test_contact_list_manager_remove_from_list (TpTestContactListManager *self,
}
return TRUE;
+ case INVALID_TP_TEST_CONTACT_LIST:
default:
g_return_val_if_reached (FALSE);
}
diff --git a/tests/lib/telepathy/contactlist/contact-list-manager.h b/tests/lib/telepathy/contactlist/contact-list-manager.h
index 7dd6c16..586e3f6 100644
--- a/tests/lib/telepathy/contactlist/contact-list-manager.h
+++ b/tests/lib/telepathy/contactlist/contact-list-manager.h
@@ -66,10 +66,11 @@ typedef enum {
INVALID_TP_TEST_CONTACT_LIST,
TP_TEST_CONTACT_LIST_SUBSCRIBE = 1,
TP_TEST_CONTACT_LIST_PUBLISH,
- TP_TEST_CONTACT_LIST_STORED,
- NUM_TP_TEST_CONTACT_LISTS
+ TP_TEST_CONTACT_LIST_STORED
} TpTestContactListHandle;
+#define NUM_TP_TEST_CONTACT_LISTS TP_TEST_CONTACT_LIST_STORED + 1
+
/* this enum must be kept in sync with the array _statuses in
* contact-list-manager.c */
typedef enum {
diff --git a/tests/lib/telepathy/contactlist/contact-list.c b/tests/lib/telepathy/contactlist/contact-list.c
index 0f6eaea..36f922e 100644
--- a/tests/lib/telepathy/contactlist/contact-list.c
+++ b/tests/lib/telepathy/contactlist/contact-list.c
@@ -403,14 +403,14 @@ static void
tp_test_contact_list_base_class_init (TpTestContactListBaseClass *klass)
{
static TpDBusPropertiesMixinPropImpl channel_props[] = {
- { "TargetHandleType", "handle-type", NULL },
- { "TargetHandle", "handle", NULL },
- { "ChannelType", "channel-type", NULL },
- { "Interfaces", "interfaces", NULL },
- { "TargetID", "target-id", NULL },
- { "Requested", "requested", NULL },
- { "InitiatorHandle", "initiator-handle", NULL },
- { "InitiatorID", "initiator-id", NULL },
+ { "TargetHandleType", (gpointer) "handle-type", NULL },
+ { "TargetHandle", (gpointer) "handle", NULL },
+ { "ChannelType", (gpointer) "channel-type", NULL },
+ { "Interfaces", (gpointer) "interfaces", NULL },
+ { "TargetID", (gpointer) "target-id", NULL },
+ { "Requested", (gpointer) "requested", NULL },
+ { "InitiatorHandle", (gpointer) "initiator-handle", NULL },
+ { "InitiatorID", (gpointer) "initiator-id", NULL },
{ NULL }
};
static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
@@ -534,7 +534,7 @@ list_channel_close (TpSvcChannel *iface G_GNUC_UNUSED,
DBusGMethodInvocation *context)
{
GError e = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
- "ContactList channels with handle type LIST may not be closed" };
+ (gchar *) "ContactList channels with handle type LIST may not be closed" };
dbus_g_method_return_error (context, &e);
}
@@ -549,7 +549,7 @@ group_channel_close (TpSvcChannel *iface,
if (tp_handle_set_size (base->group.members) > 0)
{
GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
- "Non-empty groups may not be deleted (closed)" };
+ (gchar *) "Non-empty groups may not be deleted (closed)" };
dbus_g_method_return_error (context, &e);
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]