mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-22 12:30:05 +01:00
Avoid initializer index range
This is a GNU C extension, and is not available in ISO C. Instead, just explicitly initialize other indices to -1. Signed-off-by: Michael Forney <mforney@mforney.org>
This commit is contained in:
parent
06ef34c86b
commit
2f300eb6b5
1 changed files with 7 additions and 5 deletions
|
|
@ -94,11 +94,13 @@ def print_map(bits):
|
|||
print("#pragma GCC diagnostic ignored \"-Woverride-init\"")
|
||||
print("#endif")
|
||||
print("static const int ev_max[EV_MAX + 1] = {")
|
||||
print(" [0 ... EV_MAX] = -1,")
|
||||
for prefix in prefixes:
|
||||
if prefix in ["BTN_", "EV_", "INPUT_PROP_", "MT_TOOL_"]:
|
||||
for val in range(bits.max_codes["EV_MAX"] + 1):
|
||||
if val in bits.ev:
|
||||
prefix = bits.ev[val][3:]
|
||||
if prefix + "_" in prefixes:
|
||||
print(" %s_MAX," % prefix)
|
||||
continue
|
||||
print(" [EV_%s] = %s_MAX," % (prefix[:-1], prefix[:-1]))
|
||||
print(" -1,")
|
||||
print("};")
|
||||
print("#if __clang__")
|
||||
print("#pragma clang diagnostic pop /* \"-Winitializer-overrides\" */")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue