diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2008-08-07 16:57:06 +0930 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-08-08 15:51:09 +0930 |
commit | 4e121b297ee0a9b179f8188926564fb8b2c3f6c8 (patch) | |
tree | 0cbe00b75183b0c676f43b79f824ded64d9fb854 /src/evdev.c | |
parent | 9793de81373bb78b9ddbb2487e0af5d2ddd0b246 (diff) |
Add EVDEV_MAXBUTTONS instead of checking against 32.
Numbers are so lame, defines are all the rage now I've heard.
Diffstat (limited to 'src/evdev.c')
-rw-r--r-- | src/evdev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/evdev.c b/src/evdev.c index 540738c..a383d7b 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -854,11 +854,11 @@ EvdevInitButtonMapping(InputInfoPtr pInfo) int btn = 0; xf86Msg(X_CONFIG, "%s: ButtonMapping '%s'\n", pInfo->name, mapping); - while (s && *s != '\0' && nbuttons < 32) + while (s && *s != '\0' && nbuttons < EVDEV_MAXBUTTONS) { btn = strtol(mapping, &s, 10); - if (s == mapping || btn < 0 || btn > 32) + if (s == mapping || btn < 0 || btn > EVDEV_MAXBUTTONS) { xf86Msg(X_ERROR, "%s: ... Invalid button mapping. Using defaults\n", @@ -1256,7 +1256,7 @@ EvdevUtilButtonEventToButtonNumber(int code) } } - if (button > 32) + if (button > EVDEV_MAXBUTTONS) return 0; return button; |