[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.5 1/2] input: Avoid CamelCase in InputEven
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH for-2.5 1/2] input: Avoid CamelCase in InputEvent enums |
Date: |
Thu, 12 Nov 2015 09:23:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake <address@hidden> 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 <address@hidden>
> Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
I can take this through my tree if Gerd doesn't object.