From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMdKb-0005Li-Ec for qemu-devel@nongnu.org; Tue, 04 Aug 2015 10:36:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMdKY-0004Lw-86 for qemu-devel@nongnu.org; Tue, 04 Aug 2015 10:36:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMdKY-0004Ld-2z for qemu-devel@nongnu.org; Tue, 04 Aug 2015 10:36:38 -0400 From: Markus Armbruster References: <1435782155-31412-1-git-send-email-armbru@redhat.com> <1435782155-31412-20-git-send-email-armbru@redhat.com> <55AE84BA.3070807@redhat.com> <874mkqt453.fsf@blackfin.pond.sub.org> <871tfje80d.fsf@blackfin.pond.sub.org> <55C0B08A.8070802@redhat.com> Date: Tue, 04 Aug 2015 16:35:36 +0200 In-Reply-To: <55C0B08A.8070802@redhat.com> (Eric Blake's message of "Tue, 4 Aug 2015 06:31:06 -0600") Message-ID: <87lhdr86kn.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH RFC v2 19/47] qapi: Generated code cleanup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, berto@igalia.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake writes: > On 08/04/2015 03:08 AM, Markus Armbruster wrote: >> Markus Armbruster writes: >> >>> Eric Blake 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.