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:
Markus Armbruster 2015-04-29 15:35:04 -06:00 committed by Luiz Capitulino
parent 4cf2d83734
commit a7c3181628
4 changed files with 3 additions and 7 deletions

View file

@ -36,7 +36,7 @@
#include <assert.h>
typedef enum {
QTYPE_NONE,
QTYPE_NONE, /* sentinel value, no QObject has this type code */
QTYPE_QINT,
QTYPE_QSTRING,
QTYPE_QDICT,