summary refs log tree commit diff stats
path: root/qapi/qapi-dealloc-visitor.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-01-29 06:48:38 -0700
committerMarkus Armbruster <armbru@redhat.com>2016-02-08 17:29:54 +0100
commitd7bea75d35a44023efc9d481d3a1a2600677b2ef (patch)
tree2aee9398b3fe56a8d13897ae09a6ca2595f2b385 /qapi/qapi-dealloc-visitor.c
parent6e8e5cb9aa663ba59d4ca0f4cb8307d75163e31a (diff)
downloadfocaccia-qemu-d7bea75d35a44023efc9d481d3a1a2600677b2ef.tar.gz
focaccia-qemu-d7bea75d35a44023efc9d481d3a1a2600677b2ef.zip
qapi: Avoid use of misnamed DO_UPCAST()
The macro DO_UPCAST() is incorrectly named: it converts from a
parent class to a derived class (which is a downcast).  Better,
and more consistent with some of the other qapi visitors, is
to use the container_of() macro through a to_FOO() helper.  Names
like 'to_ov()' may be a bit short, but for a static helper it
doesn't hurt too much, and matches existing practice in files
like qmp-input-visitor.c.

Our current definition of container_of() is weaker than
DO_UPCAST(), in that it does not require the derived class to
have Visitor as its first member, but this does not hurt our
usage patterns in qapi visitors.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1454075341-13658-3-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qapi/qapi-dealloc-visitor.c')
0 files changed, 0 insertions, 0 deletions