mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-05 01:48:02 +02:00
dix: silence compiler warning
inpututils.c:243:26: warning: comparison of constant 256 with expression of
type 'KeyCode' (aka 'unsigned char') is always false
[-Wtautological-constant-out-of-range-compare]
if (modkeymap[i] >= MAP_LENGTH)
~~~~~~~~~~~~ ^ ~~~~~~~~~~
MAP_LENGTH depends on MAX_BUTTONS which is somewhat arbitrarily chosen. We
don't expect this to ever change, but just in case leave the condition there
so the code is correct if we drop the number down.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
79b9d33545
commit
04ca169979
1 changed files with 2 additions and 0 deletions
|
|
@ -239,8 +239,10 @@ build_modmap_from_modkeymap(CARD8 *modmap, KeyCode *modkeymap,
|
|||
if (!modkeymap[i])
|
||||
continue;
|
||||
|
||||
#if MAP_LENGTH < 256
|
||||
if (modkeymap[i] >= MAP_LENGTH)
|
||||
return BadValue;
|
||||
#endif
|
||||
|
||||
if (modmap[modkeymap[i]])
|
||||
return BadValue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue