mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-04 02:40:16 +01:00
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>
This commit is contained in:
parent
8040c459c9
commit
f589f4968f
1 changed files with 6 additions and 6 deletions
|
|
@ -311,7 +311,7 @@ fallback_flush_mt_down(struct fallback_dispatch *dispatch,
|
|||
if (seat_slot == -1)
|
||||
return false;
|
||||
|
||||
seat->slot_map |= 1 << seat_slot;
|
||||
seat->slot_map |= bit(seat_slot);
|
||||
point = slot->point;
|
||||
slot->hysteresis_center = point;
|
||||
evdev_transform_absolute(device, &point);
|
||||
|
|
@ -374,7 +374,7 @@ fallback_flush_mt_up(struct fallback_dispatch *dispatch,
|
|||
if (seat_slot == -1)
|
||||
return false;
|
||||
|
||||
seat->slot_map &= ~(1 << seat_slot);
|
||||
seat->slot_map &= ~bit(seat_slot);
|
||||
|
||||
touch_notify_touch_up(base, time, slot_idx, seat_slot);
|
||||
|
||||
|
|
@ -402,7 +402,7 @@ fallback_flush_mt_cancel(struct fallback_dispatch *dispatch,
|
|||
if (seat_slot == -1)
|
||||
return false;
|
||||
|
||||
seat->slot_map &= ~(1 << seat_slot);
|
||||
seat->slot_map &= ~bit(seat_slot);
|
||||
|
||||
touch_notify_touch_cancel(base, time, slot_idx, seat_slot);
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ fallback_flush_st_down(struct fallback_dispatch *dispatch,
|
|||
if (seat_slot == -1)
|
||||
return false;
|
||||
|
||||
seat->slot_map |= 1 << seat_slot;
|
||||
seat->slot_map |= bit(seat_slot);
|
||||
|
||||
point = dispatch->abs.point;
|
||||
evdev_transform_absolute(device, &point);
|
||||
|
|
@ -484,7 +484,7 @@ fallback_flush_st_up(struct fallback_dispatch *dispatch,
|
|||
if (seat_slot == -1)
|
||||
return false;
|
||||
|
||||
seat->slot_map &= ~(1 << seat_slot);
|
||||
seat->slot_map &= ~bit(seat_slot);
|
||||
|
||||
touch_notify_touch_up(base, time, -1, seat_slot);
|
||||
|
||||
|
|
@ -509,7 +509,7 @@ fallback_flush_st_cancel(struct fallback_dispatch *dispatch,
|
|||
if (seat_slot == -1)
|
||||
return false;
|
||||
|
||||
seat->slot_map &= ~(1 << seat_slot);
|
||||
seat->slot_map &= ~bit(seat_slot);
|
||||
|
||||
touch_notify_touch_cancel(base, time, -1, seat_slot);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue