Eric Blake <ebl...@redhat.com> writes: > Our documentation states that we prefer 'lower-case', rather than > 'CamelCase', for qapi enum values. The InputButton and InputAxis > enums violated this convention. However, they are currently used > primarily for generating code that is used internally; their only > exposure through QMP is via the experimental 'x-input-send-event' > command. Since this is experimental, changing the QMP wire format > for that command is acceptable. > > The existing c_enum_const() code in the generator for turning the > enum names into C constants happens to munge both pre- and > post-patch spellings to the same C code, which means making the > change now touches very few files. But we are considering a > future patch which would change c_enum_const() to use > c_name(V).upper() rather than camel_to_upper(), which would render > 'WheelUp' as INPUT_BUTTON_WHEELUP instead of its current > INPUT_BUTTON_WHEEL_UP. Making the change to the enum values now > will isolate these enums from any impact if the generator munging > algorithm is changed. > > Note that SDL code uses the spelling WHEELUP rather than WHEEL_UP > in its constants, but that shouldn't drive our decision. > > Fix a typo in the qapi docs for InputAxis while at it. > > CC: Gerd Hoffmann <kra...@redhat.com> > Signed-off-by: Eric Blake <ebl...@redhat.com>
Reviewed-by: Markus Armbruster <arm...@redhat.com> I can take this through my tree if Gerd doesn't object.