mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 15:15:46 +00:00
qobject: Clean up around qtype_code
QTYPE_NONE is a sentinel value. No QObject has this type code. Document it properly. Fix dump_qobject() to abort() on QTYPE_NONE, just like for any other invalid type code. Fix to_json() to abort() on all invalid type codes, not just QTYPE_MAX. Clean up Property member qtype's type: it's a qtype_code. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
committed by
Luiz Capitulino
parent
4cf2d83734
commit
a7c3181628
@ -260,9 +260,8 @@ static void to_json(const QObject *obj, QString *str, int pretty, int indent)
|
||||
}
|
||||
case QTYPE_QERROR:
|
||||
/* XXX: should QError be emitted? */
|
||||
case QTYPE_NONE:
|
||||
break;
|
||||
case QTYPE_MAX:
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user