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:
Peter Hutterer 2013-08-29 11:53:59 +10:00
parent 30a65d20e9
commit 1b7c46b2f1
2 changed files with 2 additions and 2 deletions

View file

@ -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 */

View file

@ -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)