mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-03-25 10:19:22 +00:00
78c00bd77f983aa22611c9966fbcb7e22453b588
In linux/input.h each section's (e.g. ABS) FOO_MAX is the maximum FOO
value. Recent kernels define FOO_CNT as the maximum number of FOO there
will ever be. Hence using FOO_MAX to size the bit vectors representing
the capabilities of an evdev device is off by one.
Define FOO_CNT values for use with Linux kernels which lack them. Use
FOO_CNT whenever we need to know the number of bits needed -- usually to
calculate the number of longs needed.
When iterating over the values FOO_MAX still seems appropriate however
the loop test should include FOO_MAX rather than skip it.
Signed-off-by: Matt Helsley <matt.helsley@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 4dfd86b220)
Conflicts:
src/evdev.c
Description
No description provided
Languages
C
96.4%
Makefile
2%
M4
1.4%
Shell
0.2%