summaryrefslogtreecommitdiffstats
path: root/qapi/string-input-visitor.c
diff options
context:
space:
mode:
authorEric Blake2016-02-18 07:48:22 +0100
committerMarkus Armbruster2016-02-19 11:08:57 +0100
commit655519030b5d20967ae3afa1fe91ef5ad4406065 (patch)
tree9de11287cc8e20c11af0335fcdce3fd8f6f6297f /qapi/string-input-visitor.c
parentqapi-visit: Unify struct and union visit (diff)
downloadqemu-655519030b5d20967ae3afa1fe91ef5ad4406065.tar.gz
qemu-655519030b5d20967ae3afa1fe91ef5ad4406065.tar.xz
qemu-655519030b5d20967ae3afa1fe91ef5ad4406065.zip
qapi-visit: Less indirection in visit_type_Foo_fields()
We were passing 'Foo **obj' to the internal helper function, but all uses within the helper were via reads of '*obj'. Refactor things to pass one less level of indirection, by having the callers dereference before calling. For an example of the generated code change: |-static void visit_type_BalloonInfo_fields(Visitor *v, BalloonInfo **obj, Error **errp) |+static void visit_type_BalloonInfo_fields(Visitor *v, BalloonInfo *obj, Error **errp) | { | Error *err = NULL; | |- visit_type_int(v, "actual", &(*obj)->actual, &err); |+ visit_type_int(v, "actual", &obj->actual, &err); | error_propagate(errp, err); | } | |@@ -261,7 +261,7 @@ void visit_type_BalloonInfo(Visitor *v, | if (!*obj) { | goto out_obj; | } |- visit_type_BalloonInfo_fields(v, obj, &err); |+ visit_type_BalloonInfo_fields(v, *obj, &err); | out_obj: The refactoring will also make it easier to reuse the helpers in a future patch when implicit structs are stored directly in the parent struct rather than boxed through a pointer. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1455778109-6278-9-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qapi/string-input-visitor.c')
0 files changed, 0 insertions, 0 deletions