From 0ed8f442f49136d73045c29147f1e55b93dc80f1 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 27 May 2014 16:49:02 +0200 Subject: dbus-tube-channel: no need to set result twice --- telepathy-glib/dbus-tube-channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telepathy-glib/dbus-tube-channel.c b/telepathy-glib/dbus-tube-channel.c index 60dc2c013..2dfbf78b4 100644 --- a/telepathy-glib/dbus-tube-channel.c +++ b/telepathy-glib/dbus-tube-channel.c @@ -166,7 +166,7 @@ static void complete_operation (TpDBusTubeChannel *self) { TpDBusTubeChannelPrivate *priv = self->priv; - GSimpleAsyncResult *result = priv->result; + GSimpleAsyncResult *result; /* This dance is to ensure that we don't accidentally manipulate priv->result * while calling out to user code. For instance, someone might call -- cgit v1.2.1 From db351c38e4822acf29086dc706a6129219b453cb Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 27 May 2014 17:42:49 +0200 Subject: fix signature of TpProxy::invalidated callbacks --- telepathy-glib/account.c | 5 +++-- telepathy-glib/channel.c | 2 +- telepathy-glib/connection.c | 6 +++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c index c245b6bc9..cec883c76 100644 --- a/telepathy-glib/account.c +++ b/telepathy-glib/account.c @@ -395,8 +395,9 @@ tp_account_init (TpAccount *self) static void _tp_account_invalidated_cb (TpAccount *self, guint domain, - guint code, - gchar *message) + gint code, + gchar *message, + gpointer user_data) { TpAccountPrivate *priv = self->priv; diff --git a/telepathy-glib/channel.c b/telepathy-glib/channel.c index a35b4372e..d7df915aa 100644 --- a/telepathy-glib/channel.c +++ b/telepathy-glib/channel.c @@ -880,7 +880,7 @@ tp_channel_closed_cb (TpChannel *self, static void tp_channel_connection_invalidated_cb (TpConnection *conn, guint domain, - guint code, + gint code, gchar *message, TpChannel *self) { diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index f88611f50..15a3be6dc 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -1027,7 +1027,11 @@ tp_connection_status_changed_cb (TpConnection *self, } static void -tp_connection_invalidated (TpConnection *self) +tp_connection_invalidated (TpConnection *self, + guint domain, + gint code, + gchar *message, + gpointer user_data) { if (self->priv->introspection_call != NULL) { -- cgit v1.2.1 From 6ceefe0457cfd7c04f736dd1825f4c8e87cbc3b8 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 27 May 2014 17:43:06 +0200 Subject: tp_handle_ensure: annotate @context with (nullable) --- telepathy-glib/handle-repo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telepathy-glib/handle-repo.c b/telepathy-glib/handle-repo.c index 955cbe91c..886bf1e5a 100644 --- a/telepathy-glib/handle-repo.c +++ b/telepathy-glib/handle-repo.c @@ -162,7 +162,7 @@ tp_handle_inspect (TpHandleRepoIface *self, * tp_handle_ensure: * @self: A handle repository implementation * @id: A string whose handle is required - * @context: User data to be passed to the normalization callback + * @context: (nullable): User data to be passed to the normalization callback * @error: Used to return an error if 0 is returned * * Return a handle for the given string, creating one if necessary. The string -- cgit v1.2.1 From f9d7fedf6adefa4252753727118e81dc8cd39ad7 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 27 May 2014 17:43:39 +0200 Subject: tp_simple_async_report_success_in_idle: annotate @source_tag with (nullable) --- telepathy-glib/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telepathy-glib/util.c b/telepathy-glib/util.c index a3f36d7a0..8faca040a 100644 --- a/telepathy-glib/util.c +++ b/telepathy-glib/util.c @@ -755,7 +755,7 @@ tp_weak_ref_destroy (TpWeakRef *self) * @source: (allow-none): the source object * @callback: (scope async): the callback * @user_data: (closure): user data for @callback - * @source_tag: the source tag for the #GSimpleAsyncResult + * @source_tag: (nullable): the source tag for the #GSimpleAsyncResult * * Create a new #GSimpleAsyncResult with no operation result, and call * g_simple_async_result_complete_in_idle() on it. -- cgit v1.2.1 From efa85d688723d795a3b59561ffd37158ad6fc47b Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 27 May 2014 17:57:06 +0200 Subject: tp_handle_ensure: add some pre-conditions --- telepathy-glib/handle-repo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telepathy-glib/handle-repo.c b/telepathy-glib/handle-repo.c index 886bf1e5a..3601e50f6 100644 --- a/telepathy-glib/handle-repo.c +++ b/telepathy-glib/handle-repo.c @@ -178,6 +178,9 @@ tp_handle_ensure (TpHandleRepoIface *self, gpointer context, GError **error) { + g_return_val_if_fail (TP_IS_HANDLE_REPO_IFACE (self), 0); + g_return_val_if_fail (id != NULL, 0); + return TP_HANDLE_REPO_IFACE_GET_CLASS (self)->ensure_handle (self, id, context, error); } -- cgit v1.2.1 From a62cac2c611669a0e7e8defa6b73f38e946720cc Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 28 May 2014 11:43:16 +0200 Subject: debug: @flags_string and @ignored are (nullable) --- telepathy-glib/debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/telepathy-glib/debug.c b/telepathy-glib/debug.c index f8ffc66da..0bb6316ab 100644 --- a/telepathy-glib/debug.c +++ b/telepathy-glib/debug.c @@ -146,8 +146,8 @@ static DebugKeyToDomain key_to_domain[] = { /** * tp_debug_set_flags: - * @flags_string: The flags to set, comma-separated. If %NULL or empty, - * no additional flags are set. + * @flags_string: (nullable): The flags to set, comma-separated. If %NULL or + * empty, no additional flags are set. * * Set the debug flags indicated by @flags_string, in addition to any already * set. @@ -345,7 +345,7 @@ tp_debug_divert_messages (const gchar *filename) * @log_domain: the message's log domain * @log_level: the log level of the message * @message: the message to process - * @ignored: not used + * @ignored: (nullable): not used * * A #GLogFunc that prepends the UTC time (currently in ISO 8601 format, * with microsecond resolution) to the message, then calls -- cgit v1.2.1 From fa55e3d1127f9046c7a1e5202472a2a3a64df9d8 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 28 May 2014 11:53:15 +0200 Subject: tp_handles_are_valid_variant: add some pre-condition checks --- telepathy-glib/handle-repo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telepathy-glib/handle-repo.c b/telepathy-glib/handle-repo.c index 3601e50f6..8633453b7 100644 --- a/telepathy-glib/handle-repo.c +++ b/telepathy-glib/handle-repo.c @@ -121,6 +121,8 @@ tp_handles_are_valid_variant (TpHandleRepoIface *self, GArray *arr; gboolean result; + g_return_val_if_fail (TP_IS_HANDLE_REPO_IFACE (self), FALSE); + g_return_val_if_fail (handles != NULL, FALSE); g_return_val_if_fail (g_variant_is_of_type (handles, G_VARIANT_TYPE ("au")), FALSE); -- cgit v1.2.1 From 3f154e2f027baab1c990a15f8d91185bc4e18116 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 28 May 2014 11:59:45 +0200 Subject: dbus.c: add some safe pre-condition checks --- telepathy-glib/dbus.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/telepathy-glib/dbus.c b/telepathy-glib/dbus.c index 552e0fd42..0e3bf2697 100644 --- a/telepathy-glib/dbus.c +++ b/telepathy-glib/dbus.c @@ -527,6 +527,7 @@ tp_dbus_connection_request_name (GDBusConnection *dbus_connection, guint32 result; g_return_val_if_fail (G_IS_DBUS_CONNECTION (dbus_connection), FALSE); + g_return_val_if_fail (well_known_name != NULL, FALSE); g_return_val_if_fail (tp_dbus_check_valid_bus_name (well_known_name, TP_DBUS_NAME_TYPE_WELL_KNOWN, error), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); @@ -609,6 +610,7 @@ tp_dbus_connection_release_name (GDBusConnection *dbus_connection, GVariant *tuple; g_return_val_if_fail (G_IS_DBUS_CONNECTION (dbus_connection), FALSE); + g_return_val_if_fail (well_known_name != NULL, FALSE); g_return_val_if_fail (tp_dbus_check_valid_bus_name (well_known_name, TP_DBUS_NAME_TYPE_WELL_KNOWN, error), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); @@ -777,6 +779,10 @@ tp_dbus_connection_register_object (GDBusConnection *dbus_connection, { GError *error = NULL; + g_return_if_fail (G_IS_DBUS_CONNECTION (dbus_connection)); + g_return_if_fail (object_path != NULL); + g_return_if_fail (object != NULL); + if (!tp_dbus_connection_try_register_object (dbus_connection, object_path, object, &error)) { @@ -909,6 +915,7 @@ tp_dbus_connection_try_register_object (GDBusConnection *dbus_connection, gpointer iface_name_p; g_return_val_if_fail (G_IS_DBUS_CONNECTION (dbus_connection), FALSE); + g_return_val_if_fail (object_path != NULL, FALSE); g_return_val_if_fail (tp_dbus_check_valid_object_path (object_path, error), FALSE); g_return_val_if_fail (G_IS_OBJECT (object), FALSE); -- cgit v1.2.1 From e09bcc915acc87f8f0422e08db2ff6ca94068ba7 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 28 May 2014 11:53:33 +0200 Subject: tp_simple_async_report_success_in_idle: @user_data is nullable --- telepathy-glib/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telepathy-glib/util.c b/telepathy-glib/util.c index 8faca040a..502e50c2e 100644 --- a/telepathy-glib/util.c +++ b/telepathy-glib/util.c @@ -752,9 +752,9 @@ tp_weak_ref_destroy (TpWeakRef *self) /** * tp_simple_async_report_success_in_idle: - * @source: (allow-none): the source object + * @source: (nullable): the source object * @callback: (scope async): the callback - * @user_data: (closure): user data for @callback + * @user_data: (nullable) (closure): user data for @callback * @source_tag: (nullable): the source tag for the #GSimpleAsyncResult * * Create a new #GSimpleAsyncResult with no operation result, and call -- cgit v1.2.1 From 87bf064d5f7a8d58724fb458c44ef1bb41b96fcc Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 29 May 2014 15:08:59 +0200 Subject: dbus-tube offerer example: fix type error --- examples/client/dbus-tubes/offerer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/client/dbus-tubes/offerer.c b/examples/client/dbus-tubes/offerer.c index db5165ca1..73d5c58ee 100644 --- a/examples/client/dbus-tubes/offerer.c +++ b/examples/client/dbus-tubes/offerer.c @@ -56,7 +56,7 @@ handle_method_call ( } else /* hooray! */ { - guint x, y; + gint x, y; gboolean ret; g_variant_get (parameters, "(ii)", &x, &y); -- cgit v1.2.1 From 122f428cfe103a36ffd72a54178b73ace42855c4 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 29 May 2014 15:09:35 +0200 Subject: media-observer: ref the channel before connecting the signal g_object_ref() returns a gpointer so Tartan can't check if the signal we are connecting to actually exists. --- examples/client/media-observer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/client/media-observer.c b/examples/client/media-observer.c index 0fe95e53f..5e4300522 100644 --- a/examples/client/media-observer.c +++ b/examples/client/media-observer.c @@ -51,7 +51,9 @@ observe_channel_cb (TpSimpleObserver *self, requested? "to": "from", tp_channel_get_identifier (channel)); - g_signal_connect (g_object_ref (channel), "invalidated", + g_object_ref (channel); + + g_signal_connect (channel, "invalidated", G_CALLBACK (chan_invalidated_cb), NULL); tp_observe_channel_context_accept (context); -- cgit v1.2.1 From 0d3268b8727a9d704501a74007fb23ad44e46f89 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 29 May 2014 15:11:15 +0200 Subject: test-account: fix callback signature --- tests/dbus/account.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/dbus/account.c b/tests/dbus/account.c index 036d485d2..34922de55 100644 --- a/tests/dbus/account.c +++ b/tests/dbus/account.c @@ -154,9 +154,9 @@ test_get_times_notified (Test *test, } static void -test_notify_cb (Test *test, +test_notify_cb (TpAccount *account, GParamSpec *pspec, - TpAccount *account) + Test *test) { guint counter = test_get_times_notified (test, pspec->name); @@ -176,7 +176,7 @@ test_set_up_account_notify (Test *test) g_signal_handler_disconnect (test->account, test->notify_id); } - test->notify_id = g_signal_connect_swapped (test->account, "notify", + test->notify_id = g_signal_connect (test->account, "notify", G_CALLBACK (test_notify_cb), test); } -- cgit v1.2.1 From c7da17f6d08eee0d308eb12e5755da0543371a3d Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 29 May 2014 15:11:35 +0200 Subject: test-cli-group: use a proper callback Makes Tartan happier. --- tests/dbus/cli-group.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/dbus/cli-group.c b/tests/dbus/cli-group.c index 609e75638..f2dcc1b8d 100644 --- a/tests/dbus/cli-group.c +++ b/tests/dbus/cli-group.c @@ -209,14 +209,27 @@ check_invalidated_unknown_error_cb (TpProxy *proxy, REMOVED_MESSAGE); } +static void +quit_cb (TpChannel *chan_, + GPtrArray *added, + GPtrArray *removed, + GPtrArray *local_pending, + GPtrArray *remote_pending, + TpContact *actor, + GVariant *details, + GMainLoop *loop) +{ + g_main_loop_quit (loop); +} + static void run_until_members_changed (TpChannel *channel) { GMainLoop *loop = g_main_loop_new (NULL, FALSE); gulong id; - id = g_signal_connect_swapped (channel, "group-members-changed", - G_CALLBACK (g_main_loop_quit), loop); + id = g_signal_connect (channel, "group-members-changed", + G_CALLBACK (quit_cb), loop); g_main_loop_run (loop); -- cgit v1.2.1 From 6c60e63821be453089110b30208f214a98cc51f8 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 29 May 2014 15:45:27 +0200 Subject: logger: annotate tpl_debug_set_flags() --- telepathy-logger/debug.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/telepathy-logger/debug.c b/telepathy-logger/debug.c index 10f9bb4c2..3639f301d 100644 --- a/telepathy-logger/debug.c +++ b/telepathy-logger/debug.c @@ -41,6 +41,18 @@ static GDebugKey keys[] = { { 0, }, }; +/** + * tpl_debug_set_flags: + * @flags_string: (nullable): The flags to set, comma-separated. + * If %NULL or empty, no additional flags are set. + * + * Set the debug flags indicated by flags_string, in addition to any + * already set. + * + * The parsing matches that of g_parse_debug_string(). + * + * Since: UNRELEASED + */ void tpl_debug_set_flags (const gchar *flags_string) { -- cgit v1.2.1 From 8db1e09a7be58897e944269de2ad4c2c20e51f55 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 29 May 2014 15:46:00 +0200 Subject: tp_debug_timestamped_log_handler: add some preconditions --- telepathy-glib/debug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telepathy-glib/debug.c b/telepathy-glib/debug.c index 0bb6316ab..efc902a18 100644 --- a/telepathy-glib/debug.c +++ b/telepathy-glib/debug.c @@ -375,6 +375,9 @@ tp_debug_timestamped_log_handler (const gchar *log_domain, GTimeVal now; gchar *tmp, *now_str; + g_return_if_fail (log_domain != NULL); + g_return_if_fail (message != NULL); + g_get_current_time (&now); now_str = g_time_val_to_iso8601 (&now); tmp = g_strdup_printf ("%s: %s", now_str, message); -- cgit v1.2.1 From c1421325f924100d485e180d9092a7311e14caee Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 29 May 2014 15:52:15 +0200 Subject: test-dbus-tube: fix type error --- tests/dbus/dbus-tube.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dbus/dbus-tube.c b/tests/dbus/dbus-tube.c index fd72421a6..a8ff9f9e0 100644 --- a/tests/dbus/dbus-tube.c +++ b/tests/dbus/dbus-tube.c @@ -265,7 +265,7 @@ handle_double_call (GDBusConnection *connection, { if (!tp_strdiff (method_name, "Double")) { - guint value; + gint value; g_variant_get (parameters, "(i)", &value); -- cgit v1.2.1 From 22ce928565f6b6897fb73ed80e597fed890dc189 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 30 May 2014 15:32:30 +0200 Subject: logger: log-store-pidgin: g_variant_lookup() can't look more than one key This regression has been introduced in next when switching to GVariant API. --- telepathy-logger/log-store-pidgin.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/telepathy-logger/log-store-pidgin.c b/telepathy-logger/log-store-pidgin.c index 2aff34fe4..22e82a201 100644 --- a/telepathy-logger/log-store-pidgin.c +++ b/telepathy-logger/log-store-pidgin.c @@ -500,16 +500,15 @@ log_store_pidgin_dup_account (TplLogStorePidgin *self, { TpAccount *acc = (TpAccount *) l->data; GVariant *params; - const gchar *account_param, *server_param; + const gchar *account_param = NULL, *server_param = NULL; if (tp_strdiff (tp_account_get_protocol_name (acc), protocol)) continue; params = tp_account_dup_parameters (acc); - g_variant_lookup (params, - "account", "&s", &account_param, - "server", "&s", &server_param); + g_variant_lookup (params, "account", "&s", &account_param); + g_variant_lookup (params, "server", "&s", &server_param); if (!tp_strdiff (username, account_param)) { -- cgit v1.2.1