summaryrefslogtreecommitdiff
path: root/agent
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 /agent
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 'agent')
-rw-r--r--agent/agent.c6
-rw-r--r--agent/component.c6
-rw-r--r--agent/outputstream.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/agent/agent.c b/agent/agent.c
index 89e3514..ddad077 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -2933,8 +2933,7 @@ nice_agent_gather_candidates (
}
}
- g_list_foreach (addresses, (GFunc) g_free, NULL);
- g_list_free (addresses);
+ g_list_free_full (addresses, (GDestroyNotify) g_free);
} else {
for (i = agent->local_addresses; i; i = i->next) {
NiceAddress *addr = i->data;
@@ -4449,7 +4448,8 @@ nice_agent_recv_messages_blocking_or_nonblocking (NiceAgent *agent,
if (cancellable != NULL) {
cancellable_source = g_cancellable_source_new (cancellable);
g_source_set_callback (cancellable_source,
- (GSourceFunc) nice_agent_recv_cancelled_cb, &child_error, NULL);
+ (GSourceFunc) G_CALLBACK (nice_agent_recv_cancelled_cb), &child_error,
+ NULL);
g_source_attach (cancellable_source, context);
}
diff --git a/agent/component.c b/agent/component.c
index 6eee90e..3794c3d 100644
--- a/agent/component.c
+++ b/agent/component.c
@@ -115,7 +115,7 @@ socket_source_attach (SocketSource *socket_source, GMainContext *context)
/* Create a source. */
source = g_socket_create_source (socket_source->socket->fileno,
G_IO_IN, NULL);
- g_source_set_callback (source, (GSourceFunc) component_io_cb,
+ g_source_set_callback (source, (GSourceFunc) G_CALLBACK (component_io_cb),
socket_source, NULL);
/* Add the source. */
@@ -1300,7 +1300,7 @@ component_source_dispatch (GSource *source, GSourceFunc callback,
gpointer user_data)
{
ComponentSource *component_source = (ComponentSource *) source;
- GPollableSourceFunc func = (GPollableSourceFunc) callback;
+ GPollableSourceFunc func = (GPollableSourceFunc) G_CALLBACK (callback);
return func (component_source->pollable_stream, user_data);
}
@@ -1349,7 +1349,7 @@ static GSourceFuncs component_source_funcs = {
NULL, /* check */
component_source_dispatch,
component_source_finalize,
- (GSourceFunc) component_source_closure_callback,
+ (GSourceFunc) G_CALLBACK (component_source_closure_callback),
};
/**
diff --git a/agent/outputstream.c b/agent/outputstream.c
index 4c918a7..391ab33 100644
--- a/agent/outputstream.c
+++ b/agent/outputstream.c
@@ -418,7 +418,7 @@ nice_output_stream_write (GOutputStream *stream, const void *buffer, gsize count
writeable_id = g_signal_connect_data (G_OBJECT (agent),
"reliable-transport-writable",
(GCallback) reliable_transport_writeable_cb, write_data_ref (write_data),
- (GClosureNotify) write_data_unref, 0);
+ (GClosureNotify) G_CALLBACK (write_data_unref), 0);
do {