diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-04-29 15:35:04 -0600 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2015-05-11 08:59:07 -0400 |
commit | a7c31816288a8f20fc387d69d441413e7a8c9ff1 (patch) | |
tree | c66deef69b36736bc7b77fa372c1efd54ba12881 /include | |
parent | 4cf2d837340589155acfda993c51e66eb5800416 (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/qdev-core.h | 2 | ||||
-rw-r--r-- | include/qapi/qmp/qobject.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 4e673f9d29..9a0ee30db5 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -226,7 +226,7 @@ struct Property { PropertyInfo *info; int offset; uint8_t bitnr; - uint8_t qtype; + qtype_code qtype; int64_t defval; int arrayoffset; PropertyInfo *arrayinfo; diff --git a/include/qapi/qmp/qobject.h b/include/qapi/qmp/qobject.h index d0bbc7c4a6..099129657a 100644 --- a/include/qapi/qmp/qobject.h +++ b/include/qapi/qmp/qobject.h @@ -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, |