fallback: Fix ubsan runtime error
authorJason Gerecke <jason.gerecke@wacom.com>
Wed, 10 Apr 2019 16:55:25 +0000 (09:55 -0700)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 11 Apr 2019 05:07:53 +0000 (15:07 +1000)
commitf589f4968fc0f08590655f69dc518c080df16be7
tree06b418c795d681795b4d4ae3a91724fcb2a8426e
parent8040c459c9f8ed629b67c14421a0a25364cd6869
fallback: Fix ubsan runtime error

Running libinput-test-suite with -fsanitize=undefined highlights the two
following errors. Force C to realize we want an unsigned result by making
the '1' literal unsigned.

../src/evdev-fallback.c:314:22 runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
../src/evdev-fallback.c:377:24 runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

v2: use bit() instead of manual shift 1U<<1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-fallback.c