test: fix a compiler warning about uninitialized variable

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 <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2015-02-10 11:15:04 +10:00
parent f571ccc829
commit b9e4638b9d

View file

@ -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 },