mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 01:40:16 +01:00
all: fix -Wcast-function-type warnings
GCC 8.0's -Wcast-function-type objects casting function pointers to ones with incompatible prototypes. Sometimes we do that on purpose though. Notably, the g_source_set_callback()'s func argument can point to functions of various prototypes. Also, libnm-glib/nm-remote-connection is perhaps just not worth reworking, that would just be a waste of time. A cast to void(*)(void) avoids the GCC warning, let's use it. (cherry picked from commitee916a1e9e) (cherry picked from commit42913505a3) (cherry picked from commit3cd8c64c6d)
This commit is contained in:
parent
81e4bc5e01
commit
e2796cda0d
2 changed files with 8 additions and 8 deletions
|
|
@ -360,7 +360,7 @@ nmt_newt_form_real_show (NmtNewtForm *form)
|
|||
keypress_source = g_io_create_watch (io, G_IO_IN);
|
||||
g_source_set_can_recurse (keypress_source, TRUE);
|
||||
g_source_set_callback (keypress_source,
|
||||
(GSourceFunc) nmt_newt_form_keypress_callback,
|
||||
(GSourceFunc)(void (*) (void)) nmt_newt_form_keypress_callback,
|
||||
NULL, NULL);
|
||||
g_source_attach (keypress_source, NULL);
|
||||
g_io_channel_unref (io);
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ proxy_destroy_cb (DBusGProxy* proxy, gpointer user_data) {
|
|||
static void
|
||||
result_cb (RemoteCall *call, DBusGProxyCall *proxy_call, GError *error)
|
||||
{
|
||||
NMRemoteConnectionResultFunc func = (NMRemoteConnectionResultFunc) call->callback;
|
||||
NMRemoteConnectionResultFunc func = (NMRemoteConnectionResultFunc)(void (*) (void)) call->callback;
|
||||
GError *local_error = NULL;
|
||||
|
||||
if (!error) {
|
||||
|
|
@ -254,7 +254,7 @@ nm_remote_connection_commit_changes (NMRemoteConnection *self,
|
|||
|
||||
priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);
|
||||
|
||||
call = remote_call_new (self, result_cb, (GFunc) callback, user_data);
|
||||
call = remote_call_new (self, result_cb, (GFunc)(void (*) (void)) callback, user_data);
|
||||
if (!call)
|
||||
return;
|
||||
|
||||
|
|
@ -294,7 +294,7 @@ nm_remote_connection_commit_changes_unsaved (NMRemoteConnection *connection,
|
|||
|
||||
priv = NM_REMOTE_CONNECTION_GET_PRIVATE (connection);
|
||||
|
||||
call = remote_call_new (connection, result_cb, (GFunc) callback, user_data);
|
||||
call = remote_call_new (connection, result_cb, (GFunc)(void (*) (void)) callback, user_data);
|
||||
if (!call)
|
||||
return;
|
||||
|
||||
|
|
@ -331,7 +331,7 @@ nm_remote_connection_save (NMRemoteConnection *connection,
|
|||
|
||||
priv = NM_REMOTE_CONNECTION_GET_PRIVATE (connection);
|
||||
|
||||
call = remote_call_new (connection, result_cb, (GFunc) callback, user_data);
|
||||
call = remote_call_new (connection, result_cb, (GFunc)(void (*) (void)) callback, user_data);
|
||||
if (!call)
|
||||
return;
|
||||
|
||||
|
|
@ -359,7 +359,7 @@ nm_remote_connection_delete (NMRemoteConnection *self,
|
|||
|
||||
priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);
|
||||
|
||||
call = remote_call_new (self, result_cb, (GFunc) callback, user_data);
|
||||
call = remote_call_new (self, result_cb, (GFunc)(void (*) (void)) callback, user_data);
|
||||
if (!call)
|
||||
return;
|
||||
|
||||
|
|
@ -372,7 +372,7 @@ nm_remote_connection_delete (NMRemoteConnection *self,
|
|||
static void
|
||||
get_secrets_cb (RemoteCall *call, DBusGProxyCall *proxy_call, GError *error)
|
||||
{
|
||||
NMRemoteConnectionGetSecretsFunc func = (NMRemoteConnectionGetSecretsFunc) call->callback;
|
||||
NMRemoteConnectionGetSecretsFunc func = (NMRemoteConnectionGetSecretsFunc)(void (*) (void)) call->callback;
|
||||
GHashTable *secrets = NULL;
|
||||
GError *local_error = NULL;
|
||||
|
||||
|
|
@ -415,7 +415,7 @@ nm_remote_connection_get_secrets (NMRemoteConnection *self,
|
|||
|
||||
priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);
|
||||
|
||||
call = remote_call_new (self, get_secrets_cb, (GFunc) callback, user_data);
|
||||
call = remote_call_new (self, get_secrets_cb, (GFunc)(void (*) (void)) callback, user_data);
|
||||
if (!call)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue