diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-04-26 17:28:05 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-05-04 08:27:53 +0200 |
commit | 46cfbf13b06d551072ed17fbfca67c103edf814f (patch) | |
tree | 7ae2860ef2b9484563ea9e08c5bb7a01da856834 /qobject/qobject.c | |
parent | 59255887e6cafeff747250d2613003a41d1d9dff (diff) | |
download | qemu-46cfbf13b06d551072ed17fbfca67c103edf814f.zip qemu-46cfbf13b06d551072ed17fbfca67c103edf814f.tar.gz qemu-46cfbf13b06d551072ed17fbfca67c103edf814f.tar.bz2 |
qobject: Use qobject_to() instead of type cast
The proper way to convert from (abstract) QObject to a (concrete)
subtype is qobject_to(). Look for offenders that type cast instead:
$ git-grep '(Q[A-Z][a-z]* \*)'
hmp.c: qmp_device_add((QDict *)qdict, NULL, &err);
include/qapi/qmp/qobject.h: return (QObject *)obj;
qobject/qobject.c:static void (*qdestroy[QTYPE__MAX])(QObject *) = {
tests/check-qdict.c: dst = (QDict *)qdict_crumple(src, &error_abort);
The first two cast away const, the third isn't a type cast. Fix the
fourth.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180426152805.8469-1-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'qobject/qobject.c')
0 files changed, 0 insertions, 0 deletions