[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v2 19/47] qapi: Generated code cleanup
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH RFC v2 19/47] qapi: Generated code cleanup |
Date: |
Tue, 04 Aug 2015 16:35:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 08/04/2015 03:08 AM, Markus Armbruster wrote:
>> Markus Armbruster <address@hidden> writes:
>>
>>> Eric Blake <address@hidden> writes:
>>>
>>>> On 07/01/2015 02:22 PM, Markus Armbruster wrote:
>> [...]
>>>>> @@ -105,7 +103,8 @@ struct %(name)s
>>>>>
>>>>> def generate_enum_lookup(name, values):
>>>>> ret = mcgen('''
>>>>> -const char * const %(name)s_lookup[] = {
>>>>> +
>>>>> +const char *const %(name)s_lookup[] = {
>>>>
>>>> [2] generated diffs like this:
>>>>
>>>> qapi-types.c:
>>>> -const char * const OnOffAuto_lookup[] = {
>>>> +const char *const OnOffAuto_lookup[] = {
>>>>
>>>> Hmm - we already failed to update docs/qapi-code-gen.txt in the past; we
>>>> added a const in commit 2e4450ff that is missing from the documentation.
>>>
>>> Minor review fail. Not the first time.
>>
>> I take that back, it's actually not visible in qapi-code-gen.txt.
>
> Oh, you're right - the only mention of *_lookup[] in the docs file is
> the array generated for all events, and that one was output with correct
> spacing (until the rest of your series fixes it to share code rather
> than duplicate things with slight differences).
>
> Maybe we SHOULD be showing what the generators do for enums, unions, and
> alternates (by expanding the example-schema.json that is then fed to all
> the example script usage). But that's fine as a project for another day.
The place where we try to exercise all the schema features is
qapi-schema-test.json.