From ff574d2f5ccc117884ca98dad2827620b7d0f35f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 22 Nov 2016 10:59:18 +1000 Subject: [PATCH] test: fix maybe-uninitialized compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit touchpad-tap.c: In function ‘touchpad_3fg_tap_btntool_inverted’: touchpad-tap.c:1548:2: warning: ‘button’ may be used uninitialized in this function [-Wmaybe-uninitialized] and similar False positive, if button isn't set by now we would've abort()-ed before we even get here. Signed-off-by: Peter Hutterer --- test/touchpad-tap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/touchpad-tap.c b/test/touchpad-tap.c index d648e797..0fe26236 100644 --- a/test/touchpad-tap.c +++ b/test/touchpad-tap.c @@ -919,7 +919,7 @@ START_TEST(touchpad_2fg_tap) struct litest_device *dev = litest_current_device(); struct libinput *li = dev->libinput; enum libinput_config_tap_button_map map = _i; /* ranged test */ - unsigned int button; + unsigned int button = 0; litest_enable_tap(dev->libinput_device); litest_set_tap_map(dev->libinput_device, map); @@ -959,7 +959,7 @@ START_TEST(touchpad_2fg_tap_inverted) struct litest_device *dev = litest_current_device(); struct libinput *li = dev->libinput; enum libinput_config_tap_button_map map = _i; /* ranged test */ - unsigned int button; + unsigned int button = 0; litest_enable_tap(dev->libinput_device); litest_set_tap_map(dev->libinput_device, map); @@ -1362,7 +1362,7 @@ START_TEST(touchpad_3fg_tap) struct libinput *li = dev->libinput; struct libinput_event *event; enum libinput_config_tap_button_map map = _i; /* ranged test */ - unsigned int button; + unsigned int button = 0; int i; if (libevdev_get_abs_maximum(dev->evdev, @@ -1454,7 +1454,7 @@ START_TEST(touchpad_3fg_tap_btntool) struct libinput *li = dev->libinput; struct libinput_event *event; enum libinput_config_tap_button_map map = _i; /* ranged test */ - unsigned int button; + unsigned int button = 0; if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) > 2) @@ -1507,7 +1507,7 @@ START_TEST(touchpad_3fg_tap_btntool_inverted) struct libinput *li = dev->libinput; struct libinput_event *event; enum libinput_config_tap_button_map map = _i; /* ranged test */ - unsigned int button; + unsigned int button = 0; if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) > 2)