summaryrefslogtreecommitdiff
path: root/socket/udp-turn.c
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2018-05-26 15:58:21 +0000
committerOlivier CrĂȘte <olivier.crete@collabora.com>2018-06-12 16:57:03 +0200
commit23b5926885683987ac8706dddd8cbc195ba40d18 (patch)
treeab490e59e5bd29a0619243d77267e3d0f63253dc /socket/udp-turn.c
parenta353ab3beb5182857f24b9bf8771da2fa3f8c79a (diff)
downloadlibnice-23b5926885683987ac8706dddd8cbc195ba40d18.tar.gz
Fix cast-function-type warning introduced in GCC 8
This is new warning introduced with GCC 8. This is being fixed by using appropriate function, like g_queue_free_full/g_list_free_full or by casting to GCallback before casting to the target function signature. Closes: #46
Diffstat (limited to 'socket/udp-turn.c')
-rw-r--r--socket/udp-turn.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/socket/udp-turn.c b/socket/udp-turn.c
index 190a9ea..c6bd803 100644
--- a/socket/udp-turn.c
+++ b/socket/udp-turn.c
@@ -274,9 +274,7 @@ socket_close (NiceSocket *sock)
}
g_list_free (priv->channels);
- g_list_foreach (priv->pending_bindings, (GFunc) nice_address_free,
- NULL);
- g_list_free (priv->pending_bindings);
+ g_list_free_full (priv->pending_bindings, (GDestroyNotify) nice_address_free);
if (priv->tick_source_channel_bind != NULL) {
g_source_destroy (priv->tick_source_channel_bind);
@@ -305,8 +303,7 @@ socket_close (NiceSocket *sock)
g_queue_free (priv->send_requests);
priv_clear_permissions (priv);
- g_list_foreach (priv->sent_permissions, (GFunc) nice_address_free, NULL);
- g_list_free (priv->sent_permissions);
+ g_list_free_full (priv->sent_permissions, (GDestroyNotify) nice_address_free);
g_hash_table_destroy (priv->send_data_queues);
if (priv->permission_timeout_source) {
@@ -320,8 +317,7 @@ socket_close (NiceSocket *sock)
g_free (priv->current_binding);
g_free (priv->current_binding_msg);
- g_list_foreach (priv->pending_permissions, (GFunc) g_free, NULL);
- g_list_free(priv->pending_permissions);
+ g_list_free_full (priv->pending_permissions, g_free);
g_free (priv->username);
g_free (priv->password);
g_free (priv->cached_realm);
@@ -546,8 +542,7 @@ priv_remove_sent_permission_for_peer (UdpTurnPriv *priv, const NiceAddress *peer
static void
priv_clear_permissions (UdpTurnPriv *priv)
{
- g_list_foreach (priv->permissions, (GFunc) nice_address_free, NULL);
- g_list_free (priv->permissions);
+ g_list_free_full (priv->permissions, (GDestroyNotify) nice_address_free);
priv->permissions = NULL;
}