diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2018-02-07 18:08:58 +0000 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2018-02-08 17:11:46 +0100 |
commit | ee916a1e9ec3f06f8c88dc3d95058a6bd1561c7d (patch) | |
tree | 27173326f40a8e8170664b26d5a333730eacc6af /libnm-glib | |
parent | 3113e193c0821cb181f8a97b170144aed444fe62 (diff) |
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.
Diffstat (limited to 'libnm-glib')
-rw-r--r-- | libnm-glib/nm-remote-connection.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c index a9702236d..7e60ea953 100644 --- a/libnm-glib/nm-remote-connection.c +++ b/libnm-glib/nm-remote-connection.c @@ -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; |