mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-24 01:50:12 +01:00
Shut up compiler warning
Triggered with -O ../libevdev/libevdev.c: In function ‘libevdev_has_event_code’: ../libevdev/libevdev-util.h:58:20: warning: ‘mask’ may be used uninitialized in this function [-Wmaybe-uninitialized] Optimisation clearly shuffles things around here: in the code, if no max is found, we return -1 and bail out before we access mask. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
parent
b7bc345b40
commit
ab4fdcc0d5
1 changed files with 1 additions and 1 deletions
|
|
@ -1078,7 +1078,7 @@ libevdev_has_event_type(const struct libevdev *dev, unsigned int type)
|
||||||
LIBEVDEV_EXPORT int
|
LIBEVDEV_EXPORT int
|
||||||
libevdev_has_event_code(const struct libevdev *dev, unsigned int type, unsigned int code)
|
libevdev_has_event_code(const struct libevdev *dev, unsigned int type, unsigned int code)
|
||||||
{
|
{
|
||||||
const unsigned long *mask;
|
const unsigned long *mask = NULL;
|
||||||
int max;
|
int max;
|
||||||
|
|
||||||
if (!libevdev_has_event_type(dev, type))
|
if (!libevdev_has_event_type(dev, type))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue