[gspell] Language: fix compil warning (-Wcast-function-type)



commit d08aaebdf3dbe336bd2d534b4c5bf9682979609e
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu May 10 18:54:23 2018 +0200

    Language: fix compil warning (-Wcast-function-type)
    
    This warning is enabled by -Wextra.
    
    Use g_strcmp0() for extra safety.

 gspell/gspell-language.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gspell/gspell-language.c b/gspell/gspell-language.c
index 6a766e5..776c9d8 100644
--- a/gspell/gspell-language.c
+++ b/gspell/gspell-language.c
@@ -309,6 +309,14 @@ spell_language_traverse_cb (const gchar  *code,
        return FALSE;
 }
 
+static gint
+tree_compare_func (gconstpointer a,
+                  gconstpointer b,
+                  gpointer      user_data)
+{
+       return g_strcmp0 (a, b);
+}
+
 /**
  * gspell_language_get_available:
  *
@@ -366,7 +374,7 @@ gspell_language_get_available (void)
        iso_codes_parse (&iso_639_parser, "iso_639.xml", data.iso_639_table);
        iso_codes_parse (&iso_3166_parser, "iso_3166.xml", data.iso_3166_table);
 
-       data.tree = g_tree_new_full ((GCompareDataFunc) strcmp,
+       data.tree = g_tree_new_full (tree_compare_func,
                                     NULL,
                                     (GDestroyNotify) g_free,
                                     (GDestroyNotify) g_free);


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