[gtksourceview] CompletionModel: fix compil warning (-Wcast-function-type)



commit da50491c8afcb253913f9ddfd0726b8f83abdd9e
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu May 10 21:13:30 2018 +0200

    CompletionModel: fix compil warning (-Wcast-function-type)

 gtksourceview/gtksourcecompletionmodel.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletionmodel.c b/gtksourceview/gtksourcecompletionmodel.c
index d94e102..73facc7 100644
--- a/gtksourceview/gtksourcecompletionmodel.c
+++ b/gtksourceview/gtksourcecompletionmodel.c
@@ -881,6 +881,13 @@ gtk_source_completion_model_add_proposals (GtkSourceCompletionModel    *model,
 
 /* Other public functions */
 
+static gpointer
+provider_copy_func (gconstpointer src,
+                   gpointer      data)
+{
+       return g_object_ref ((gpointer) src);
+}
+
 void
 gtk_source_completion_model_set_visible_providers (GtkSourceCompletionModel *model,
                                                    GList                    *providers)
@@ -897,7 +904,7 @@ gtk_source_completion_model_set_visible_providers (GtkSourceCompletionModel *mod
        g_list_free_full (model->priv->visible_providers, g_object_unref);
 
        model->priv->visible_providers = g_list_copy_deep (providers,
-                                                          (GCopyFunc)g_object_ref,
+                                                          provider_copy_func,
                                                           NULL);
 
        for (l = model->priv->providers; l != NULL; l = l->next)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]