mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-09 23:35:29 +00:00
f5c93aa7ab
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. Backports commit 655519030b5d20967ae3afa1fe91ef5ad4406065 from qemu |
||
---|---|---|
.. | ||
aarch64-softmmu | ||
aarch64eb-softmmu | ||
arm-softmmu | ||
armeb-softmmu | ||
m68k-softmmu | ||
mips-softmmu | ||
mips64-softmmu | ||
mips64el-softmmu | ||
mipsel-softmmu | ||
sparc-softmmu | ||
sparc64-softmmu | ||
unicorn | ||
unicorn_static | ||
x86_64-softmmu | ||
config-host.h | ||
prebuild_script.bat | ||
qapi-types.c | ||
qapi-types.h | ||
qapi-visit.c | ||
qapi-visit.h |