From 411fe9c42f1e4617ddbdd5207998b67abe036806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 6 Nov 2024 14:46:31 +0100 Subject: [PATCH] st: Fix closure annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quoting Ebassi https://www.bassi.io/articles/2023/02/20/bindable-api-2023/: Whenever you’re describing a function that takes a callback, you should always annotate the callback argument with the argument that contains the user data using the (closure argument) annotation You should not annotate the data argument with a unary (closure). The unary (closure) is meant to be used when annotating the callback type Recently gobject-introspection became a bit more strict with this and that generated some warnings: Warning: St: invalid "closure" annotation: only valid on callback parameters This commit fix all the closure annotations. Part-of: --- src/st/st-icon-theme.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/st/st-icon-theme.c b/src/st/st-icon-theme.c index 7223c33ab..4563c0df0 100644 --- a/src/st/st-icon-theme.c +++ b/src/st/st-icon-theme.c @@ -3494,9 +3494,9 @@ load_icon_thread (GTask *task, * st_icon_info_load_icon_async: * @icon_info: a #StIconInfo * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore - * @callback: (scope async): a #GAsyncReadyCallback to call when the + * @callback: (scope async) (closure user_data): a #GAsyncReadyCallback to call when the * request is satisfied - * @user_data: (closure): the data to pass to callback function + * @user_data: the data to pass to callback function * * Asynchronously load, render and scale an icon previously looked up * from the icon theme using [method@St.IconTheme.lookup_icon]. @@ -4039,9 +4039,9 @@ load_symbolic_icon_thread (GTask *task, * success colors of the icon * @cancellable: (allow-none): optional #GCancellable object, * %NULL to ignore - * @callback: (scope async): a #GAsyncReadyCallback to call when the + * @callback: (scope async) (closure user_data): a #GAsyncReadyCallback to call when the * request is satisfied - * @user_data: (closure): the data to pass to callback function + * @user_data: the data to pass to callback function * * Asynchronously load, render and scale a symbolic icon previously looked up * from the icon theme using [method@St.IconTheme.lookup_icon].