From 41e61c1c13aca3e5fed0cb83ef16422a0bfa7158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Wed, 23 Nov 2022 18:50:38 +0100 Subject: [PATCH] test: fix uninitialized variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the warnings generated: [232/243] Compiling C object libinput-test-suite.p/test_test-pad.c.o ../test/test-pad.c:211:3: warning: variable 'count' is uninitialized when used here [-Wuninitialized] count++; ^~~~~ ../test/test-pad.c:261:3: warning: variable 'count' is uninitialized when used here [-Wuninitialized] count++; ^~~~~ When building with Clang v15 and without libwacom: $ CC=clang CXX=clang++ meson builddir -Dlibwacom=false Signed-off-by: José Expósito --- test/test-pad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test-pad.c b/test/test-pad.c index 0c52a9dc..334558ed 100644 --- a/test/test-pad.c +++ b/test/test-pad.c @@ -183,7 +183,7 @@ START_TEST(pad_button_intuos) unsigned int expected_number = 0; struct libinput_event *ev; struct libinput_event_tablet_pad *pev; - unsigned int count; + unsigned int count = 0; /* Intuos button mapping is sequential up from BTN_0 and continues * with BTN_A */ @@ -243,7 +243,7 @@ START_TEST(pad_button_bamboo) unsigned int expected_number = 0; struct libinput_event *ev; struct libinput_event_tablet_pad *pev; - unsigned int count; + unsigned int count = 0; if (!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_LEFT)) return;