[gtksourceview] Version macros: silence a compilation warning when MINOR_VERSION == 0



commit b3dffc39fa5064c49b219cb55b97f6a4070a872a
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Apr 26 12:15:16 2018 +0200

    Version macros: silence a compilation warning when MINOR_VERSION == 0
    
    The warning was:
    
    In file included from gtksourceversion.c:25:0:
    gtksourceversion.c: In function ‘gtk_source_check_version’:
    gtksourceversion.h:77:67: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
      (GTK_SOURCE_MAJOR_VERSION == (major) && GTK_SOURCE_MINOR_VERSION > (minor)) || \
                                                                       ^
    gtksourceversion.c:117:9: note: in expansion of macro ‘GTK_SOURCE_CHECK_VERSION’
      return GTK_SOURCE_CHECK_VERSION (major, minor, micro);
             ^~~~~~~~~~~~~~~~~~~~~~~~
    
    Because gtk_source_check_version() takes guint args.

 gtksourceview/gtksourceversion.h.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourceversion.h.in b/gtksourceview/gtksourceversion.h.in
index 7e41ede..032bc3b 100644
--- a/gtksourceview/gtksourceversion.h.in
+++ b/gtksourceview/gtksourceversion.h.in
@@ -74,7 +74,7 @@ G_BEGIN_DECLS
  */
 #define GTK_SOURCE_CHECK_VERSION(major, minor, micro) \
        (GTK_SOURCE_MAJOR_VERSION > (major) || \
-       (GTK_SOURCE_MAJOR_VERSION == (major) && GTK_SOURCE_MINOR_VERSION > (minor)) || \
+       (GTK_SOURCE_MAJOR_VERSION == (major) && GTK_SOURCE_MINOR_VERSION > ((gint) (minor))) || \
        (GTK_SOURCE_MAJOR_VERSION == (major) && GTK_SOURCE_MINOR_VERSION == (minor) && \
         GTK_SOURCE_MICRO_VERSION >= (micro)))
 


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