[gtksourceview] CompletionWords: fix comparison between signed and unsigned integers



commit b20d9b6358d339d9a3d29de31f8a13a706ce7e73
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Jun 5 11:09:02 2016 +0200

    CompletionWords: fix comparison between signed and unsigned integers
    
    It's strange that on my machine (Fedora 24) this didn't trigger any
    warnings or errors. -Wsign-compare is present on the command line.
    
    g_utf8_strlen() returns a glong. minimum_word_size is a guint. So cast
    the latter to glong. This should make the error to disappear, but there
    are maybe other places in GtkSourceView where a glong is compared to a
    guint. So finding a way to reproduce the warning/error would be better.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767254

 .../words/gtksourcecompletionwords.c               |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/completion-providers/words/gtksourcecompletionwords.c 
b/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
index 11091ea..5c4b129 100644
--- a/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
+++ b/gtksourceview/completion-providers/words/gtksourcecompletionwords.c
@@ -236,7 +236,7 @@ gtk_source_completion_words_populate (GtkSourceCompletionProvider *provider,
 
        if (word == NULL ||
            (activation == GTK_SOURCE_COMPLETION_ACTIVATION_INTERACTIVE &&
-            g_utf8_strlen (word, -1) < words->priv->minimum_word_size))
+            g_utf8_strlen (word, -1) < (glong)words->priv->minimum_word_size))
        {
                g_free (word);
                gtk_source_completion_context_add_proposals (context, provider, NULL, TRUE);


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