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
}
}
- 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;
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);
}
/* 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. */
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);
}
NULL, /* check */
component_source_dispatch,
component_source_finalize,
- (GSourceFunc) component_source_closure_callback,
+ (GSourceFunc) G_CALLBACK (component_source_closure_callback),
};
/**
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 {
src->mainctx = NULL;
if (src->outbufs) {
- g_queue_foreach (src->outbufs, (GFunc) gst_buffer_unref, NULL);
- g_queue_free (src->outbufs);
+ g_queue_free_full (src->outbufs, (GDestroyNotify) gst_buffer_unref);
}
src->outbufs = NULL;
nice_agent_attach_recv (src->agent, src->stream_id, src->component_id,
src->mainctx, NULL, NULL);
GST_OBJECT_LOCK (src);
- g_queue_foreach (src->outbufs, (GFunc) gst_buffer_unref, NULL);
- g_queue_clear (src->outbufs);
+ g_queue_free_full (src->outbufs, (GDestroyNotify) gst_buffer_unref);
GST_OBJECT_UNLOCK (src);
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
void nice_socket_queue_send_with_callback (GQueue *send_queue,
const NiceOutputMessage *message, gsize message_offset, gsize message_len,
gboolean head, GSocket *gsock, GSource **io_source, GMainContext *context,
- GSourceFunc cb, gpointer user_data);
+ GSocketSourceFunc cb, gpointer user_data);
/**
* nice_socket_flush_send_queue:
void nice_socket_queue_send_with_callback (GQueue *send_queue,
const NiceOutputMessage *message, gsize message_offset, gsize message_len,
gboolean head, GSocket *gsock, GSource **io_source, GMainContext *context,
- GSourceFunc cb, gpointer user_data)
+ GSocketSourceFunc cb, gpointer user_data)
{
NiceSocketQueuedSend *tbs;
guint j;
if (io_source && gsock && context && cb && *io_source == NULL) {
*io_source = g_socket_create_source(gsock, G_IO_OUT, NULL);
- g_source_set_callback (*io_source, (GSourceFunc) cb, user_data, NULL);
+ g_source_set_callback (*io_source, (GSourceFunc) G_CALLBACK (cb), user_data, NULL);
g_source_attach (*io_source, context);
}
void
nice_socket_free_send_queue (GQueue *send_queue)
{
- g_queue_foreach (send_queue, (GFunc) nice_socket_free_queued_send, NULL);
- g_queue_clear (send_queue);
+ g_queue_free_full (send_queue, (GDestroyNotify) nice_socket_free_queued_send);
}
/* Queue the message and send it later. */
nice_socket_queue_send_with_callback (&priv->send_queue,
message, 0, message_len, FALSE, sock->fileno, &priv->io_source,
- priv->context, (GSourceFunc) socket_send_more, sock);
+ priv->context, socket_send_more, sock);
ret = message_len;
}
/* Partial send. */
nice_socket_queue_send_with_callback (&priv->send_queue,
message, ret, message_len, TRUE, sock->fileno, &priv->io_source,
- priv->context, (GSourceFunc) socket_send_more, sock);
+ priv->context, socket_send_more, sock);
ret = message_len;
}
} else {
/* Queue the message and send it later. */
nice_socket_queue_send_with_callback (&priv->send_queue,
message, 0, message_len, FALSE, sock->fileno, &priv->io_source,
- priv->context, (GSourceFunc) socket_send_more, sock);
+ priv->context, socket_send_more, sock);
ret = message_len;
} else {
/* non reliable send, so we shouldn't queue the message */
}
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);
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) {
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);
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;
}