[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 00/30] qapi: Elide redundant has_FOO in generated C
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v3 00/30] qapi: Elide redundant has_FOO in generated C |
Date: |
Fri, 04 Nov 2022 17:15:06 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Markus Armbruster <armbru@redhat.com> writes:
> In QAPI, absent optional members are distinct from any present value.
> We thus represent an optional schema member FOO as two C members: a
> FOO with the member's type, and a bool has_FOO. Likewise for function
> arguments.
>
> However, the has_FOO is actually redundant for a pointer-valued FOO,
> which can be null only when has_FOO is false, i.e. has_FOO == !!FOO.
> Except for arrays, where we a null FOO can also be a present empty
> array.
>
> The redundant has_FOO are a nuisance to work with. Improve the
> generator to elide them.
>
> PATCH 01+02 are trivial documentation cleanups.
>
> PATCH 03 tweaks an example in documentation so it'll show the change.
>
> PATCH 04 improves the code generator, but nerfs the change for the
> schema modules where handwritten code needs to be updated.
>
> PATCH 05-07,10-29 un-nerf in reviewable chunks. Their commit messages
> refer back to PATCH 04 for an explanation of the transformation.
> Please read that first. Note that these patches combine the
> mechanical transformation with obvious, local follow-up
> simplifications. If you want them separate for easier review, let me
> know.
>
> PATCH 08+09 clean up in preparation for PATCH 10.
>
> PATCH 28 drops the nerfing code.
PATCH 30, of course.
- [PATCH v3 11/30] qapi chardev: Elide redundant has_FOO in generated C, (continued)
- [PATCH v3 11/30] qapi chardev: Elide redundant has_FOO in generated C, Markus Armbruster, 2022/11/04
- [PATCH v3 09/30] nbd/server: Clean up abuse of BlockExportOptionsNbd member @arg, Markus Armbruster, 2022/11/04
- [PATCH v3 02/30] qapi: Tidy up whitespace in generated code, Markus Armbruster, 2022/11/04
- [PATCH v3 29/30] qapi qga: Elide redundant has_FOO in generated C, Markus Armbruster, 2022/11/04
- [PATCH v3 22/30] qapi rocker: Elide redundant has_FOO in generated C, Markus Armbruster, 2022/11/04
- [PATCH v3 14/30] qapi job: Elide redundant has_FOO in generated C, Markus Armbruster, 2022/11/04
- Re: [PATCH v3 00/30] qapi: Elide redundant has_FOO in generated C,
Markus Armbruster <=