Skip to content
  • Jason Gerecke's avatar
    fallback: Fix ubsan runtime error · f589f496
    Jason Gerecke authored and Peter Hutterer's avatar Peter Hutterer committed
    
    
    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: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    f589f496