[PATCH libinput] Code cleanup

Thomas Hindoe Paaboel Andersen phomes at gmail.com
Sat Jul 18 11:27:11 PDT 2015


Removes some dead assignments, an unused function, and
uses %d format specifier for int.
---
 src/evdev-mt-touchpad-buttons.c | 1 -
 test/gestures.c                 | 4 ----
 test/litest.c                   | 4 ++--
 test/pointer.c                  | 2 +-
 tools/libinput-list-devices.c   | 9 ---------
 5 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index 5ecdccd..6aa74c3 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -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)
diff --git a/test/gestures.c b/test/gestures.c
index 3d20bf2..8b6639f 100644
--- a/test/gestures.c
+++ b/test/gestures.c
@@ -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,
diff --git a/test/litest.c b/test/litest.c
index 1fa8f23..db93bbe 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -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,
diff --git a/test/pointer.c b/test/pointer.c
index 28d7c9a..29ebac5 100644
--- a/test/pointer.c
+++ b/test/pointer.c
@@ -245,7 +245,7 @@ END_TEST
 
 START_TEST(pointer_absolute_initial_state)
 {
-	struct litest_device *dev = litest_current_device();
+	struct litest_device *dev;
 	struct libinput *libinput1, *libinput2;
 	struct libinput_event *ev1, *ev2;
 	struct libinput_event_pointer *p1, *p2;
diff --git a/tools/libinput-list-devices.c b/tools/libinput-list-devices.c
index 6d162e2..f9ce7e4 100644
--- a/tools/libinput-list-devices.c
+++ b/tools/libinput-list-devices.c
@@ -35,15 +35,6 @@
 
 #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)
 {
-- 
2.4.3



More information about the wayland-devel mailing list