From b9e4638b9d68a4893b1c5682dd5ea28a569becc3 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 10 Feb 2015 11:15:04 +1000 Subject: [PATCH] test: fix a compiler warning about uninitialized variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flow is so this cannot be unset, we'd abort if we never get an event. The compiler doesn't know that though. In file included from tablet.c:35:0: tablet.c: In function ‘motion’: litest.h:202:45: warning: ‘last_reported_y’ may be used uninitialized in this function [-Wmaybe-uninitialized] ck_assert_int_lt((int)(a_ * 256), (int)(b_ * 256)) ^ tablet.c:158:26: note: ‘last_reported_y’ was declared here double last_reported_x, last_reported_y; ^ In file included from tablet.c:35:0: litest.h:208:45: warning: ‘last_reported_x’ may be used uninitialized in this function [-Wmaybe-uninitialized] ck_assert_int_gt((int)(a_ * 256), (int)(b_ * 256)) ^ tablet.c:158:9: note: ‘last_reported_x’ was declared here double last_reported_x, last_reported_y; Signed-off-by: Peter Hutterer --- test/tablet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tablet.c b/test/tablet.c index cf39597c..c38302af 100644 --- a/test/tablet.c +++ b/test/tablet.c @@ -155,7 +155,7 @@ START_TEST(motion) struct libinput_event_tablet *tablet_event; struct libinput_event *event; int test_x, test_y; - double last_reported_x, last_reported_y; + double last_reported_x = 0, last_reported_y = 0; enum libinput_event_type type; struct axis_replacement axes[] = { { ABS_DISTANCE, 10 },