libnm: fix warnings due to invalid "closure" annotation

The "closure" annotation needs to be set on the callback parameter
instead of on the data for the callback function.

This patch fixes the following warning:

"""
../src/libnm-core-impl/nm-utils.c:3632: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:4778: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:5776: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:5849: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:5976: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6091: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6448: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6521: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6581: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6663: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6728: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:974: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:1014: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:1041: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:974: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:1014: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:1041: Warning: NM: invalid "closure" annotation: only valid on callback parameters
"""
This commit is contained in:
Fernando Fernandez Mancera
2024-11-27 12:51:24 +01:00
parent 3b75577871
commit dd9aca4bd9
3 changed files with 28 additions and 28 deletions

View File

@@ -4774,8 +4774,8 @@ nm_client_save_hostname(NMClient *client,
* @hostname: (nullable): the new persistent hostname to set, or %NULL to * @hostname: (nullable): the new persistent hostname to set, or %NULL to
* clear any existing persistent hostname * clear any existing persistent hostname
* @cancellable: a #GCancellable, or %NULL * @cancellable: a #GCancellable, or %NULL
* @callback: (scope async): callback to be called when the operation completes * @callback: (scope async) (closure user_data): callback to be called when the operation completes
* @user_data: (closure): caller-specific data passed to @callback * @user_data: caller-specific data passed to @callback
* *
* Requests that the machine's persistent hostname be set to the specified value * Requests that the machine's persistent hostname be set to the specified value
* or cleared. * or cleared.
@@ -5772,8 +5772,8 @@ _add_connection_call(NMClient *self,
* added, not the object itself * added, not the object itself
* @save_to_disk: whether to immediately save the connection to disk * @save_to_disk: whether to immediately save the connection to disk
* @cancellable: a #GCancellable, or %NULL * @cancellable: a #GCancellable, or %NULL
* @callback: (scope async): callback to be called when the add operation completes * @callback: (scope async) (closure user_data): callback to be called when the add operation completes
* @user_data: (closure): caller-specific data passed to @callback * @user_data: caller-specific data passed to @callback
* *
* Requests that the remote settings service add the given settings to a new * Requests that the remote settings service add the given settings to a new
* connection. If @save_to_disk is %TRUE, the connection is immediately written * connection. If @save_to_disk is %TRUE, the connection is immediately written
@@ -5845,8 +5845,8 @@ nm_client_add_connection_finish(NMClient *client, GAsyncResult *result, GError *
* not yet provide AddConnection2(). By setting this to %FALSE, the function * not yet provide AddConnection2(). By setting this to %FALSE, the function
* under the hood always calls AddConnection2(). * under the hood always calls AddConnection2().
* @cancellable: a #GCancellable, or %NULL * @cancellable: a #GCancellable, or %NULL
* @callback: (scope async): callback to be called when the add operation completes * @callback: (scope async) (closure user_data): callback to be called when the add operation completes
* @user_data: (closure): caller-specific data passed to @callback * @user_data: caller-specific data passed to @callback
* *
* Call AddConnection2() D-Bus API asynchronously. * Call AddConnection2() D-Bus API asynchronously.
* *
@@ -5972,8 +5972,8 @@ nm_client_load_connections(NMClient *client,
* @client: the %NMClient * @client: the %NMClient
* @filenames: (array zero-terminated=1): %NULL-terminated array of filenames to load * @filenames: (array zero-terminated=1): %NULL-terminated array of filenames to load
* @cancellable: a #GCancellable, or %NULL * @cancellable: a #GCancellable, or %NULL
* @callback: (scope async): callback to be called when the operation completes * @callback: (scope async) (closure user_data): callback to be called when the operation completes
* @user_data: (closure): caller-specific data passed to @callback * @user_data: caller-specific data passed to @callback
* *
* Requests that the remote settings service asynchronously load or reload the * Requests that the remote settings service asynchronously load or reload the
* given files, adding or updating the connections described within. * given files, adding or updating the connections described within.
@@ -6087,8 +6087,8 @@ nm_client_reload_connections(NMClient *client, GCancellable *cancellable, GError
* nm_client_reload_connections_async: * nm_client_reload_connections_async:
* @client: the #NMClient * @client: the #NMClient
* @cancellable: a #GCancellable, or %NULL * @cancellable: a #GCancellable, or %NULL
* @callback: (scope async): callback to be called when the reload operation completes * @callback: (scope async) (closure user_data): callback to be called when the reload operation completes
* @user_data: (closure): caller-specific data passed to @callback * @user_data: caller-specific data passed to @callback
* *
* Requests that the remote settings service begin reloading all connection * Requests that the remote settings service begin reloading all connection
* files from disk, adding, updating, and removing connections until the * files from disk, adding, updating, and removing connections until the
@@ -6444,8 +6444,8 @@ checkpoint_create_cb(GObject *object, GAsyncResult *result, gpointer user_data)
* @rollback_timeout: the rollback timeout in seconds * @rollback_timeout: the rollback timeout in seconds
* @flags: creation flags * @flags: creation flags
* @cancellable: a #GCancellable, or %NULL * @cancellable: a #GCancellable, or %NULL
* @callback: (scope async): callback to be called when the add operation completes * @callback: (scope async) (closure user_data): callback to be called when the add operation completes
* @user_data: (closure): caller-specific data passed to @callback * @user_data: caller-specific data passed to @callback
* *
* Creates a checkpoint of the current networking configuration * Creates a checkpoint of the current networking configuration
* for given interfaces. An empty @devices argument means all * for given interfaces. An empty @devices argument means all
@@ -6517,8 +6517,8 @@ nm_client_checkpoint_create_finish(NMClient *client, GAsyncResult *result, GErro
* @client: the %NMClient * @client: the %NMClient
* @checkpoint_path: the D-Bus path for the checkpoint * @checkpoint_path: the D-Bus path for the checkpoint
* @cancellable: a #GCancellable, or %NULL * @cancellable: a #GCancellable, or %NULL
* @callback: (scope async): callback to be called when the add operation completes * @callback: (scope async) (closure user_data): callback to be called when the add operation completes
* @user_data: (closure): caller-specific data passed to @callback * @user_data: caller-specific data passed to @callback
* *
* Destroys an existing checkpoint without performing a rollback. * Destroys an existing checkpoint without performing a rollback.
* *
@@ -6577,8 +6577,8 @@ nm_client_checkpoint_destroy_finish(NMClient *client, GAsyncResult *result, GErr
* @client: the %NMClient * @client: the %NMClient
* @checkpoint_path: the D-Bus path to the checkpoint * @checkpoint_path: the D-Bus path to the checkpoint
* @cancellable: a #GCancellable, or %NULL * @cancellable: a #GCancellable, or %NULL
* @callback: (scope async): callback to be called when the add operation completes * @callback: (scope async) (closure user_data): callback to be called when the add operation completes
* @user_data: (closure): caller-specific data passed to @callback * @user_data: caller-specific data passed to @callback
* *
* Performs the rollback of a checkpoint before the timeout is reached. * Performs the rollback of a checkpoint before the timeout is reached.
* *
@@ -6659,8 +6659,8 @@ nm_client_checkpoint_rollback_finish(NMClient *client, GAsyncResult *result, GEr
* @add_timeout: the timeout in seconds counting from now. * @add_timeout: the timeout in seconds counting from now.
* Set to zero, to disable the timeout. * Set to zero, to disable the timeout.
* @cancellable: a #GCancellable, or %NULL * @cancellable: a #GCancellable, or %NULL
* @callback: (scope async): callback to be called when the add operation completes * @callback: (scope async) (closure user_data): callback to be called when the add operation completes
* @user_data: (closure): caller-specific data passed to @callback * @user_data: caller-specific data passed to @callback
* *
* Resets the timeout for the checkpoint with path @checkpoint_path * Resets the timeout for the checkpoint with path @checkpoint_path
* to @timeout_add. * to @timeout_add.
@@ -6724,8 +6724,8 @@ nm_client_checkpoint_adjust_rollback_timeout_finish(NMClient *client,
* @client: the %NMClient * @client: the %NMClient
* @flags: flags indicating what to reload. * @flags: flags indicating what to reload.
* @cancellable: a #GCancellable, or %NULL * @cancellable: a #GCancellable, or %NULL
* @callback: (scope async): callback to be called when the add operation completes * @callback: (scope async) (closure user_data): callback to be called when the add operation completes
* @user_data: (closure): caller-specific data passed to @callback * @user_data: caller-specific data passed to @callback
* *
* Reload NetworkManager's configuration and perform certain updates, like * Reload NetworkManager's configuration and perform certain updates, like
* flushing caches or rewriting external state to disk. This is similar to * flushing caches or rewriting external state to disk. This is similar to

View File

@@ -970,8 +970,8 @@ nm_secret_agent_old_unregister_finish(NMSecretAgentOld *self, GAsyncResult *resu
* @setting_name: the name of the secret setting * @setting_name: the name of the secret setting
* @hints: (array zero-terminated=1): hints to the agent * @hints: (array zero-terminated=1): hints to the agent
* @flags: flags that modify the behavior of the request * @flags: flags that modify the behavior of the request
* @callback: (scope async): a callback, to be invoked when the operation is done * @callback: (scope async) (closure user_data): a callback, to be invoked when the operation is done
* @user_data: (closure): caller-specific data to be passed to @callback * @user_data: caller-specific data to be passed to @callback
* *
* Asynchronously retrieves secrets belonging to @connection for the * Asynchronously retrieves secrets belonging to @connection for the
* setting @setting_name. @flags indicate specific behavior that the secret * setting @setting_name. @flags indicate specific behavior that the secret
@@ -1010,8 +1010,8 @@ nm_secret_agent_old_get_secrets(NMSecretAgentOld *self,
* nm_secret_agent_old_save_secrets: (virtual save_secrets) * nm_secret_agent_old_save_secrets: (virtual save_secrets)
* @self: a #NMSecretAgentOld * @self: a #NMSecretAgentOld
* @connection: a #NMConnection * @connection: a #NMConnection
* @callback: (scope async): a callback, to be invoked when the operation is done * @callback: (scope async) (closure user_data): a callback, to be invoked when the operation is done
* @user_data: (closure): caller-specific data to be passed to @callback * @user_data: caller-specific data to be passed to @callback
* *
* Asynchronously ensures that all secrets inside @connection are stored to * Asynchronously ensures that all secrets inside @connection are stored to
* disk. * disk.
@@ -1037,8 +1037,8 @@ nm_secret_agent_old_save_secrets(NMSecretAgentOld *self,
* nm_secret_agent_old_delete_secrets: (virtual delete_secrets) * nm_secret_agent_old_delete_secrets: (virtual delete_secrets)
* @self: a #NMSecretAgentOld * @self: a #NMSecretAgentOld
* @connection: a #NMConnection * @connection: a #NMConnection
* @callback: (scope async): a callback, to be invoked when the operation is done * @callback: (scope async) (closure user_data): a callback, to be invoked when the operation is done
* @user_data: (closure): caller-specific data to be passed to @callback * @user_data: caller-specific data to be passed to @callback
* *
* Asynchronously asks the agent to delete all saved secrets belonging to * Asynchronously asks the agent to delete all saved secrets belonging to
* @connection. * @connection.

View File

@@ -3626,10 +3626,10 @@ _nm_utils_check_module_file(const char *name,
* Can be empty or %NULL, in which case only @try_first is checked. * Can be empty or %NULL, in which case only @try_first is checked.
* @file_test_flags: the flags passed to g_file_test() when searching * @file_test_flags: the flags passed to g_file_test() when searching
* for @progname. Set it to 0 to skip the g_file_test(). * for @progname. Set it to 0 to skip the g_file_test().
* @predicate: (scope call): if given, pass the file name to this function * @predicate: (scope call) (closure user_data): if given, pass the file name to this function
* for additional checks. This check is performed after the check for * for additional checks. This check is performed after the check for
* @file_test_flags. You cannot omit both @file_test_flags and @predicate. * @file_test_flags. You cannot omit both @file_test_flags and @predicate.
* @user_data: (closure) (nullable): user data for @predicate function. * @user_data: (nullable): user data for @predicate function.
* @error: on failure, set a "not found" error %G_IO_ERROR %G_IO_ERROR_NOT_FOUND. * @error: on failure, set a "not found" error %G_IO_ERROR %G_IO_ERROR_NOT_FOUND.
* *
* Searches for a @progname file in a list of search @paths. * Searches for a @progname file in a list of search @paths.