655519030b
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> |
||
---|---|---|
.. | ||
kvm | ||
qemu-guest-agent | ||
qemugdb | ||
qmp | ||
tracetool | ||
analyse-9p-simpletrace.py | ||
analyze-migration.py | ||
check-qerror.sh | ||
checkpatch.pl | ||
clean-includes | ||
cleanup-trace-events.pl | ||
cocci-macro-file.h | ||
coverity-model.c | ||
create_config | ||
disas-objdump.pl | ||
dump-guest-memory.py | ||
extract-vsssdk-headers | ||
feature_to_c.sh | ||
get_maintainer.pl | ||
gtester-cat | ||
hxtool | ||
make_device_config.sh | ||
make-release | ||
ordereddict.py | ||
qapi-commands.py | ||
qapi-event.py | ||
qapi-introspect.py | ||
qapi-types.py | ||
qapi-visit.py | ||
qapi.py | ||
qemu-binfmt-conf.sh | ||
qemu-gdb.py | ||
qtest.py | ||
refresh-pxe-roms.sh | ||
shaderinclude.pl | ||
signrom.py | ||
simpletrace.py | ||
switch-timer-api | ||
texi2pod.pl | ||
tracetool.py | ||
update-linux-headers.sh | ||
vmstate-static-checker.py |