mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-03-25 09:59:16 +00:00
Silence a compiler warning
../src/xf86libinput.c: In function ‘prop_draglock_set_pairs’: ../src/xf86libinput.c:5153:30: warning: comparison is always false due to limited range of data type [-Wtype-limits] 5153 | if (pairs[i] > MAX_BUTTONS) MAX_BUTTONS is defined by the server so let's use a temporary local variable to silence the compiler. Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/61>
This commit is contained in:
@@ -5132,6 +5132,7 @@ prop_draglock_set_pairs(struct xf86libinput *driver_data,
|
||||
int data[MAX_BUTTONS + 1] = {0};
|
||||
int i;
|
||||
int highest = 0;
|
||||
const unsigned int max = MAX_BUTTONS;
|
||||
|
||||
if (len >= ARRAY_SIZE(data))
|
||||
return BadMatch;
|
||||
@@ -5142,7 +5143,7 @@ prop_draglock_set_pairs(struct xf86libinput *driver_data,
|
||||
dl = (checkonly) ? &dummy : &driver_data->draglock;
|
||||
|
||||
for (i = 0; i < len; i += 2) {
|
||||
if (pairs[i] > MAX_BUTTONS)
|
||||
if (pairs[i] > max)
|
||||
return BadValue;
|
||||
|
||||
data[pairs[i]] = pairs[i+1];
|
||||
|
||||
Reference in New Issue
Block a user