[folks] tests: Fix some C warnings in the Telepathy tests library



commit 645095eebbf3a2b772ad99c9fcf60acc63f14a0f
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed Mar 28 14:18:28 2012 +0100

    tests: Fix some C warnings in the Telepathy tests library

 .../telepathy/contactlist/contact-list-manager.c   |    6 ++
 tests/lib/telepathy/contactlist/contacts-conn.c    |    4 +-
 .../telepathy/contactlist/simple-account-manager.c |    6 +-
 tests/lib/telepathy/contactlist/simple-account.c   |   51 +++++++++++---------
 tests/lib/telepathy/contactlist/textchan-null.c    |   16 +++---
 tests/lib/telepathy/contactlist/util.c             |    9 ++++
 6 files changed, 56 insertions(+), 36 deletions(-)
---
diff --git a/tests/lib/telepathy/contactlist/contact-list-manager.c b/tests/lib/telepathy/contactlist/contact-list-manager.c
index 0b78281..a7b8f83 100644
--- a/tests/lib/telepathy/contactlist/contact-list-manager.c
+++ b/tests/lib/telepathy/contactlist/contact-list-manager.c
@@ -531,6 +531,12 @@ status_changed_cb (TpBaseConnection *conn,
           close_all (self);
         }
       break;
+
+    default:
+        {
+          g_assert_not_reached ();
+        }
+      break;
     }
 }
 
diff --git a/tests/lib/telepathy/contactlist/contacts-conn.c b/tests/lib/telepathy/contactlist/contacts-conn.c
index bd434fd..aa8f928 100644
--- a/tests/lib/telepathy/contactlist/contacts-conn.c
+++ b/tests/lib/telepathy/contactlist/contacts-conn.c
@@ -487,7 +487,7 @@ my_get_contact_statuses (GObject *object,
           g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free);
 
       if (presence_message != NULL)
-        g_hash_table_insert (parameters, "message",
+        g_hash_table_insert (parameters, (gpointer) "message",
             tp_g_value_slice_new_string (presence_message));
 
       g_hash_table_insert (result, key,
@@ -683,7 +683,7 @@ tp_tests_contacts_connection_change_presences (
           g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free);
 
       if (messages[i] != NULL && messages[i][0] != '\0')
-        g_hash_table_insert (parameters, "message",
+        g_hash_table_insert (parameters, (gpointer) "message",
             tp_g_value_slice_new_string (messages[i]));
 
       g_hash_table_insert (presences, key, tp_presence_status_new (indexes[i],
diff --git a/tests/lib/telepathy/contactlist/simple-account-manager.c b/tests/lib/telepathy/contactlist/simple-account-manager.c
index 8df364a..ab4a795 100644
--- a/tests/lib/telepathy/contactlist/simple-account-manager.c
+++ b/tests/lib/telepathy/contactlist/simple-account-manager.c
@@ -137,9 +137,9 @@ tp_tests_simple_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 },
         */
diff --git a/tests/lib/telepathy/contactlist/simple-account.c b/tests/lib/telepathy/contactlist/simple-account.c
index 934643d..8036474 100644
--- a/tests/lib/telepathy/contactlist/simple-account.c
+++ b/tests/lib/telepathy/contactlist/simple-account.c
@@ -287,45 +287,50 @@ tp_tests_simple_account_class_init (TpTestsSimpleAccountClass *klass)
   GObjectClass *object_class = (GObjectClass *) klass;
   GParamSpec *param_spec;
 
+#define MIXIN_PROP(N, g) \
+        { N, (gpointer) g, NULL }
+
   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 },
-        { "Supersedes", "supersedes", NULL },
+        MIXIN_PROP ("Interfaces", "interfaces"),
+        MIXIN_PROP ("DisplayName", "display-name"),
+        MIXIN_PROP ("Icon", "icon"),
+        MIXIN_PROP ("Valid", "valid"),
+        MIXIN_PROP ("Enabled", "enabled"),
+        MIXIN_PROP ("Nickname", "nickname"),
+        MIXIN_PROP ("Parameters", "parameters"),
+        MIXIN_PROP ("AutomaticPresence", "automatic-presence"),
+        MIXIN_PROP ("ConnectAutomatically", "connect-automatically"),
+        MIXIN_PROP ("Connection", "connection"),
+        MIXIN_PROP ("ConnectionStatus", "connection-status"),
+        MIXIN_PROP ("ConnectionStatusReason", "connection-status-reason"),
+        MIXIN_PROP ("CurrentPresence", "current-presence"),
+        MIXIN_PROP ("RequestedPresence", "requested-presence"),
+        MIXIN_PROP ("NormalizedName", "normalized-name"),
+        MIXIN_PROP ("HasBeenOnline", "has-been-online"),
+        MIXIN_PROP ("Supersedes", "supersedes"),
         { NULL }
   };
 
   static TpDBusPropertiesMixinPropImpl ais_props[] = {
-        { "StorageProvider", "storage-provider", NULL },
-        { "StorageIdentifier", "storage-identifier", NULL },
-        { "StorageSpecificInformation", "storage-specific-information", NULL },
-        { "StorageRestrictions", "storage-restrictions", NULL },
+        MIXIN_PROP ("StorageProvider", "storage-provider"),
+        MIXIN_PROP ("StorageIdentifier", "storage-identifier"),
+        MIXIN_PROP ("StorageSpecificInformation", "storage-specific-information"),
+        MIXIN_PROP ("StorageRestrictions", "storage-restrictions"),
         { NULL },
   };
 
   static TpDBusPropertiesMixinPropImpl aia_props[] = {
-        { "URISchemes", "uri-schemes", NULL },
+        MIXIN_PROP ("URISchemes", "uri-schemes"),
         { NULL },
   };
 
   static TpDBusPropertiesMixinPropImpl avatar_props[] = {
-        { "Avatar", "avatar", NULL },
+        MIXIN_PROP ("Avatar", "avatar"),
         { NULL },
   };
 
+#undef MIXIN_PROP
+
   static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
         { TP_IFACE_ACCOUNT,
           tp_dbus_properties_mixin_getter_gobject_properties,
diff --git a/tests/lib/telepathy/contactlist/textchan-null.c b/tests/lib/telepathy/contactlist/textchan-null.c
index 5765944..d7fe630 100644
--- a/tests/lib/telepathy/contactlist/textchan-null.c
+++ b/tests/lib/telepathy/contactlist/textchan-null.c
@@ -343,14 +343,14 @@ tp_tests_props_text_channel_class_init (TpTestsPropsTextChannelClass *klass)
 {
   GObjectClass *object_class = (GObjectClass *) 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[] = {
diff --git a/tests/lib/telepathy/contactlist/util.c b/tests/lib/telepathy/contactlist/util.c
index b14fa42..6713182 100644
--- a/tests/lib/telepathy/contactlist/util.c
+++ b/tests/lib/telepathy/contactlist/util.c
@@ -375,6 +375,7 @@ _tp_create_local_socket (TpSocketAddressType address_type,
       case TP_SOCKET_ACCESS_CONTROL_PORT:
         break;
 
+      case TP_SOCKET_ACCESS_CONTROL_NETMASK:
       default:
         g_assert_not_reached ();
     }
@@ -403,6 +404,10 @@ _tp_create_local_socket (TpSocketAddressType address_type,
           break;
         }
 
+#ifndef HAVE_GIO_UNIX
+      case TP_SOCKET_ADDRESS_TYPE_UNIX:
+#endif
+      case TP_SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX:
       default:
         g_assert_not_reached ();
     }
@@ -447,6 +452,10 @@ _tp_create_local_socket (TpSocketAddressType address_type,
             G_MAXUINT);
         break;
 
+#ifndef HAVE_GIO_UNIX
+      case TP_SOCKET_ADDRESS_TYPE_UNIX:
+#endif
+      case TP_SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX:
       default:
         g_assert_not_reached ();
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]