diff options
author | Matt Helsley <matt.helsley@gmail.com> | 2009-01-13 11:03:04 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-01-13 11:36:13 +1000 |
commit | 78c00bd77f983aa22611c9966fbcb7e22453b588 (patch) | |
tree | 4d9424dd923cbf4bbc5e93c39c5abd18b265d3af /configure.ac | |
parent | rename NBITS to NLONGS to reflect its actual meaning (diff) | |
download | xf86-input-evdev-78c00bd77f983aa22611c9966fbcb7e22453b588.tar.gz xf86-input-evdev-78c00bd77f983aa22611c9966fbcb7e22453b588.tar.bz2 xf86-input-evdev-78c00bd77f983aa22611c9966fbcb7e22453b588.zip |
Fix FOO_MAX off-by-one
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 4dfd86b2201b2b19761a1abb3c580cecf0060224)
Conflicts:
src/evdev.c
Diffstat (limited to 'configure.ac')
0 files changed, 0 insertions, 0 deletions