[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v12 35/36] qapi: Simplify visits of optional fie
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v12 35/36] qapi: Simplify visits of optional fields |
Date: |
Wed, 18 Nov 2015 19:54:49 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake <address@hidden> writes:
> None of the visitor callbacks would set an error when testing
> if an optional field was present; make this part of the interface
> contract by eliminating the errp argument.
>
> The resulting generated code has a nice diff:
>
> |- visit_optional(v, &has_fdset_id, "fdset-id", &err);
> |- if (err) {
> |- goto out;
> |- }
> |- if (has_fdset_id) {
> |+ visit_optional(v, &has_fdset_id, "fdset-id");
> |+ if (has_fdset_id) {
> | visit_type_int(v, &fdset_id, "fdset-id", &err);
> | if (err) {
> | goto out;
> | }
> | }
I think this should be
|- visit_optional(v, &has_fdset_id, "fdset-id", &err);
|- if (err) {
|- goto out;
|- }
|+ visit_optional(v, &has_fdset_id, "fdset-id");
| if (has_fdset_id) {
| visit_type_int(v, &fdset_id, "fdset-id", &err);
| if (err) {
| goto out;
| }
| }
>
> Signed-off-by: Eric Blake <address@hidden>
Patch looks good.
- Re: [Qemu-devel] [PATCH v12 27/36] qapi: Forbid case-insensitive clashes, (continued)
[Qemu-devel] [PATCH v12 35/36] qapi: Simplify visits of optional fields, Eric Blake, 2015/11/18
- Re: [Qemu-devel] [PATCH v12 35/36] qapi: Simplify visits of optional fields,
Markus Armbruster <=
[Qemu-devel] [PATCH v12 33/36] qapi: Fix alternates that accept 'number' but not 'int', Eric Blake, 2015/11/18
[Qemu-devel] [PATCH v12 29/36] qobject: Rename qtype_code to QType, Eric Blake, 2015/11/18
[Qemu-devel] [PATCH v12 31/36] qapi: Simplify visiting of alternate types, Eric Blake, 2015/11/18