Blacklist SW_MAX so it doesn't shadow SW_PEN_INSERTED
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 26 Feb 2018 07:02:41 +0000 (17:02 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 26 Feb 2018 07:12:08 +0000 (17:12 +1000)
commit6ff816163e97589371bf345fd6a307ee9d799d5e
tree6a9cbed847cb508098df99b3f1a44e0497595ac7
parenta67d1964ffa53622322736d32b48162d94c4208a
Blacklist SW_MAX so it doesn't shadow SW_PEN_INSERTED

They have the same value, so the _MAX code would shadow the real code, causing
issues in any client that needs to get all event names from libevdev.
Specifically, the loop of:
  for each code in 0 to max-for-type:
      print(name)
would not show up the code (but the _MAX) code instead. This causes issues
with clients that rely on name resolution that works. And the _MAX values are
special values anyway.

Blacklist it in the script here, causing it to resolve from name to code, but
not from code to name (like other duplicated codes).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
libevdev/make-event-names.py
test/test-event-codes.c
test/test-event-names.c