[gnome-commander] Fixed compiler warning 'Wsign-compare'



commit 129a22c7f9d2dc14f1f9c96a49c7d131be14de58
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Sun Mar 1 00:07:48 2015 +0100

    Fixed compiler warning 'Wsign-compare'
    
    A cast from guint to gint was introduced at two places here. This will
    not be problematic, as lists of devices or favourite programs should never
    be as long as UINT_MAX.

 src/dialogs/gnome-cmd-options-dialog.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-options-dialog.cc b/src/dialogs/gnome-cmd-options-dialog.cc
index 3816780..1f589e7 100644
--- a/src/dialogs/gnome-cmd-options-dialog.cc
+++ b/src/dialogs/gnome-cmd-options-dialog.cc
@@ -1499,7 +1499,7 @@ static void on_app_moved (GtkCList *clist, gint arg1, gint arg2, GtkWidget *fram
     GList *apps = gnome_cmd_data.options.fav_apps;
 
     if (!apps
-        || MAX (arg1, arg2) >= g_list_length (apps)
+        || MAX (arg1, arg2) >= (gint) g_list_length (apps) // cast will only be problematic for incredibly 
large lists
         || MIN (arg1, arg2) < 0
         || arg1 == arg2)
         return;
@@ -1898,7 +1898,7 @@ static void on_device_moved (GtkCList *clist, gint arg1, gint arg2, GtkWidget *f
     GList *list = gnome_cmd_con_list_get_all_dev (gnome_cmd_con_list_get ());
 
     if (!list
-        || MAX (arg1, arg2) >= g_list_length (list)
+        || MAX (arg1, arg2) >= (gint) g_list_length (list) // cast will only be problematic for incredibly 
large lists
         || MIN (arg1, arg2) < 0
         || arg1 == arg2)
         return;


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