With -Werror=sign-compare (not enabled by default), gcc shows these errors:

ui/gtk.c: In function ‘gtk_release_modifiers’:
ui/gtk.c:288:19: error:
 comparison between signed and unsigned integer expressions 
[-Werror=sign-compare]
ui/gtk.c: In function ‘gd_key_event’:
ui/gtk.c:746:19: error:
 comparison between signed and unsigned integer expressions 
[-Werror=sign-compare]

Signed-off-by: Stefan Weil <s...@weilnetz.de>
---
 ui/gtk.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index b5f4f0b..79efda1 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -273,7 +273,8 @@ static void gd_update_full_redraw(GtkDisplayState *s)
 
 static void gtk_release_modifiers(GtkDisplayState *s)
 {
-    int i, keycode;
+    unsigned i;
+    int keycode;
 
     if (!gd_on_vga(s)) {
         return;
@@ -714,7 +715,7 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey 
*key, void *opaque)
     GtkDisplayState *s = opaque;
     int gdk_keycode;
     int qemu_keycode;
-    int i;
+    unsigned i;
 
     gdk_keycode = key->hardware_keycode;
 
-- 
1.7.10.4


Reply via email to