mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2026-02-03 18:20:27 +01:00
Fix two signed vs unsigned int warnings
dev->num_slots is -1 if we don't have ABS_MT_SLOT. Set dev->grabbed to the right field type. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
30a65d20e9
commit
1b7c46b2f1
2 changed files with 2 additions and 2 deletions
|
|
@ -99,7 +99,7 @@ struct libevdev {
|
|||
int rep_values[REP_CNT];
|
||||
|
||||
enum SyncState sync_state;
|
||||
int grabbed;
|
||||
enum libevdev_grab_mode grabbed;
|
||||
|
||||
struct input_event *queue;
|
||||
size_t queue_size; /**< size of queue in elements */
|
||||
|
|
|
|||
|
|
@ -936,7 +936,7 @@ libevdev_set_slot_value(struct libevdev *dev, unsigned int slot, unsigned int co
|
|||
if (!libevdev_has_event_type(dev, EV_ABS) || !libevdev_has_event_code(dev, EV_ABS, code))
|
||||
return -1;
|
||||
|
||||
if (slot >= dev->num_slots || slot >= MAX_SLOTS)
|
||||
if (dev->num_slots == -1 || slot >= (unsigned int)dev->num_slots || slot >= MAX_SLOTS)
|
||||
return -1;
|
||||
|
||||
if (code > ABS_MT_MAX || code < ABS_MT_MIN)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue