Code cleanup
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Mon, 20 Jul 2015 01:27:09 +0000 (03:27 +0200)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 20 Jul 2015 01:30:06 +0000 (11:30 +1000)
Removes some dead assignments, an unused function, and
uses %d format specifier for int.

Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-mt-touchpad-buttons.c
test/gestures.c
test/litest.c
test/pointer.c
tools/libinput-list-devices.c

index 5ecdccd..6aa74c3 100644 (file)
@@ -971,7 +971,6 @@ tp_post_clickpadbutton_buttons(struct tp_dispatch *tp, uint64_t time)
 
        current = tp->buttons.state;
        old = tp->buttons.old_state;
-       button = 0;
        is_top = 0;
 
        if (!tp->buttons.click_pending && current == old)
index 3d20bf2..8b6639f 100644 (file)
@@ -223,8 +223,6 @@ START_TEST(gestures_pinch)
 
        libinput_event_destroy(event);
 
-       dir_x = cardinals[cardinal][0];
-       dir_y = cardinals[cardinal][1];
        while ((event = libinput_get_event(li)) != NULL) {
                gevent = litest_is_gesture_event(event,
                                                 LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
@@ -324,8 +322,6 @@ START_TEST(gestures_spread)
 
        libinput_event_destroy(event);
 
-       dir_x = cardinals[cardinal][0];
-       dir_y = cardinals[cardinal][1];
        while ((event = libinput_get_event(li)) != NULL) {
                gevent = litest_is_gesture_event(event,
                                                 LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
index 1fa8f23..db93bbe 100644 (file)
@@ -214,13 +214,13 @@ litest_backtrace(void)
                }
 
                if (have_lineno) {
-                       litest_log("%u: %s() (%s:%d)\n",
+                       litest_log("%d: %s() (%s:%d)\n",
                                   i,
                                   procname,
                                   file,
                                   line);
                } else  {
-                       litest_log("%u: %s (%s%s+%#x) [%p]\n",
+                       litest_log("%d: %s (%s%s+%#x) [%p]\n",
                                   i,
                                   filename,
                                   procname,
index c781505..c0a7392 100644 (file)
@@ -251,7 +251,6 @@ START_TEST(pointer_absolute_initial_state)
        struct libinput_event_pointer *p1, *p2;
        int axis = _i; /* looped test */
 
-       dev = litest_current_device();
        libinput1 = dev->libinput;
        litest_touch_down(dev, 0, 40, 60);
        litest_touch_up(dev, 0);
index 6d162e2..f9ce7e4 100644 (file)
 
 #include "shared.h"
 
-static inline const char*
-bool_to_str(bool b)
-{
-       if (b)
-               return "yes";
-       else
-               return "no";
-}
-
 static const char *
 tap_default(struct libinput_device *device)
 {