From 3b33ffa0a250a645189f65271d7407bb6a87bd9e Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 17 Sep 2013 15:09:43 +0200 Subject: [PATCH 4/5] factor out add_always_present_connection_interfaces() https://bugs.freedesktop.org/show_bug.cgi?id=69466 --- src/connection.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/connection.c b/src/connection.c index 1b4a729..9413519 100644 --- a/src/connection.c +++ b/src/connection.c @@ -113,18 +113,25 @@ haze_connection_get_implemented_interfaces (void) return implemented_interfaces; } +static void +add_always_present_connection_interfaces (GPtrArray *interfaces) +{ + const gchar **iter; + + for (iter = implemented_interfaces + HAZE_NUM_CONDITIONAL_INTERFACES; + *iter != NULL; iter++) + g_ptr_array_add (interfaces, (gchar *) *iter); +} + static GPtrArray * haze_connection_get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; - const gchar **iter; interfaces = TP_BASE_CONNECTION_CLASS ( haze_connection_parent_class)->get_interfaces_always_present (base); - for (iter = implemented_interfaces + HAZE_NUM_CONDITIONAL_INTERFACES; - *iter != NULL; iter++) - g_ptr_array_add (interfaces, (gchar *) *iter); + add_always_present_connection_interfaces (interfaces); return interfaces; } -- 1.8.3.1