From 952b562d0c21d014dabc6f869dcf8516c9a1113f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 5 Dec 2016 20:31:31 +1000 Subject: [PATCH] tools: fix signed/unsigned comparison warnings Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad-tap.c | 2 +- tools/event-gui.c | 5 +++-- tools/shared.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c index ddda44ca..cb4abf24 100644 --- a/src/evdev-mt-touchpad-tap.c +++ b/src/evdev-mt-touchpad-tap.c @@ -896,7 +896,7 @@ tp_tap_config_count(struct libinput_device *device) dispatch = ((struct evdev_device *) device)->dispatch; tp = container_of(dispatch, tp, base); - return min(tp->ntouches, 3); /* we only do up to 3 finger tap */ + return min(tp->ntouches, 3U); /* we only do up to 3 finger tap */ } static enum libinput_config_status diff --git a/tools/event-gui.c b/tools/event-gui.c index 36be8746..8a98630c 100644 --- a/tools/event-gui.c +++ b/tools/event-gui.c @@ -242,7 +242,8 @@ static inline void draw_tablet(struct window *w, cairo_t *cr) { double x, y; - int first, last, mask; + int first, last; + size_t mask; int i; /* tablet tool, square for prox-in location */ @@ -485,7 +486,7 @@ handle_event_device_notify(struct libinput_event *ev) struct libinput *li; struct window *w; const char *type; - int i; + size_t i; if (libinput_event_get_type(ev) == LIBINPUT_EVENT_DEVICE_ADDED) type = "added"; diff --git a/tools/shared.c b/tools/shared.c index 0a110eec..0d00b96c 100644 --- a/tools/shared.c +++ b/tools/shared.c @@ -469,7 +469,7 @@ tools_device_apply_config(struct libinput_device *device, { if (options->tapping != -1) libinput_device_config_tap_set_enabled(device, options->tapping); - if (options->tap_map != -1) + if (options->tap_map != (enum libinput_config_tap_button_map)-1) libinput_device_config_tap_set_button_map(device, options->tap_map); if (options->drag != -1) @@ -490,10 +490,10 @@ tools_device_apply_config(struct libinput_device *device, if (options->dwt != -1) libinput_device_config_dwt_set_enabled(device, options->dwt); - if (options->click_method != -1) + if (options->click_method != (enum libinput_config_click_method)-1) libinput_device_config_click_set_method(device, options->click_method); - if (options->scroll_method != -1) + if (options->scroll_method != (enum libinput_config_scroll_method)-1) libinput_device_config_scroll_set_method(device, options->scroll_method); if (options->scroll_button != -1)