unicorn/msvc/unicorn
Eric Blake f5c93aa7ab
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.

Backports commit 655519030b5d20967ae3afa1fe91ef5ad4406065 from qemu
2018-02-20 16:00:37 -05:00
..
aarch64-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
aarch64eb-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
arm-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
armeb-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
m68k-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
mips-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
mips64-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
mips64el-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
mipsel-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
sparc-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
sparc64-softmmu Update MSVC projects 2018-02-17 15:23:57 -05:00
unicorn qobject: Simplify QObject 2018-02-19 21:37:48 -05:00
unicorn_static qobject: Simplify QObject 2018-02-19 21:37:48 -05:00
x86_64-softmmu target-i386: Enable control registers for MPX 2018-02-20 13:27:46 -05:00
config-host.h Added armbe support to MSVC branch. (#801) 2017-04-21 15:26:21 +08:00
prebuild_script.bat Added MSVC support for arm64eb. 2017-04-25 14:23:58 +10:00
qapi-types.c qom: Swap 'name' next to visitor in ObjectPropertyAccessor 2018-02-19 23:14:37 -05:00
qapi-types.h qapi: Convert QType into QAPI built-in enum type 2018-02-19 21:47:05 -05:00
qapi-visit.c qapi-visit: Less indirection in visit_type_Foo_fields() 2018-02-20 16:00:37 -05:00
qapi-visit.h qom: Swap 'name' next to visitor in ObjectPropertyAccessor 2018-02-19 23:14:37 -05:00