aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2018-02-01 12:18:34 +0100
committerMarkus Armbruster <armbru@redhat.com>2018-02-09 13:52:15 +0100
commit9f5c734d591e26186a71f9e36d752f4798df3672 (patch)
tree7730a734ae8c34ddef0b4e6a5424c1a0477c2a35
parentabb297ed4408e3859776a1a3c91d99225b9795b9 (diff)
Typedef the subtypes of QObject in qemu/typedefs.h, too
This renders many inclusions of qapi/qmp/q*.h superfluous. They'll be dropped in the next few commits. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-8-armbru@redhat.com>
-rw-r--r--include/qapi/qmp/qbool.h4
-rw-r--r--include/qapi/qmp/qdict.h4
-rw-r--r--include/qapi/qmp/qlist.h4
-rw-r--r--include/qapi/qmp/qnum.h4
-rw-r--r--include/qapi/qmp/qstring.h4
-rw-r--r--include/qemu/typedefs.h7
6 files changed, 16 insertions, 11 deletions
diff --git a/include/qapi/qmp/qbool.h b/include/qapi/qmp/qbool.h
index f77ea86c4e..629c508d34 100644
--- a/include/qapi/qmp/qbool.h
+++ b/include/qapi/qmp/qbool.h
@@ -16,10 +16,10 @@
#include "qapi/qmp/qobject.h"
-typedef struct QBool {
+struct QBool {
QObject base;
bool value;
-} QBool;
+};
QBool *qbool_from_bool(bool value);
bool qbool_get_bool(const QBool *qb);
diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h
index fc218e7be6..d0c298114e 100644
--- a/include/qapi/qmp/qdict.h
+++ b/include/qapi/qmp/qdict.h
@@ -27,11 +27,11 @@ typedef struct QDictEntry {
QLIST_ENTRY(QDictEntry) next;
} QDictEntry;
-typedef struct QDict {
+struct QDict {
QObject base;
size_t size;
QLIST_HEAD(,QDictEntry) table[QDICT_BUCKET_MAX];
-} QDict;
+};
/* Object API */
QDict *qdict_new(void);
diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h
index ec3fcc1a4c..632b7ef2c1 100644
--- a/include/qapi/qmp/qlist.h
+++ b/include/qapi/qmp/qlist.h
@@ -23,10 +23,10 @@ typedef struct QListEntry {
QTAILQ_ENTRY(QListEntry) next;
} QListEntry;
-typedef struct QList {
+struct QList {
QObject base;
QTAILQ_HEAD(,QListEntry) head;
-} QList;
+};
#define qlist_append(qlist, obj) \
qlist_append_obj(qlist, QOBJECT(obj))
diff --git a/include/qapi/qmp/qnum.h b/include/qapi/qmp/qnum.h
index c3d86794bb..15e3971c7f 100644
--- a/include/qapi/qmp/qnum.h
+++ b/include/qapi/qmp/qnum.h
@@ -44,7 +44,7 @@ typedef enum {
* in range: qnum_get_try_int() / qnum_get_try_uint() check range and
* convert under the hood.
*/
-typedef struct QNum {
+struct QNum {
QObject base;
QNumKind kind;
union {
@@ -52,7 +52,7 @@ typedef struct QNum {
uint64_t u64;
double dbl;
} u;
-} QNum;
+};
QNum *qnum_from_int(int64_t value);
QNum *qnum_from_uint(uint64_t value);
diff --git a/include/qapi/qmp/qstring.h b/include/qapi/qmp/qstring.h
index 65c05a9be5..98070ef3d6 100644
--- a/include/qapi/qmp/qstring.h
+++ b/include/qapi/qmp/qstring.h
@@ -15,12 +15,12 @@
#include "qapi/qmp/qobject.h"
-typedef struct QString {
+struct QString {
QObject base;
char *string;
size_t length;
size_t capacity;
-} QString;
+};
QString *qstring_new(void);
QString *qstring_from_str(const char *str);
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 5923849cdd..a46b0b347b 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -96,8 +96,13 @@ typedef struct QemuSpin QemuSpin;
typedef struct QEMUSGList QEMUSGList;
typedef struct QEMUTimer QEMUTimer;
typedef struct QEMUTimerListGroup QEMUTimerListGroup;
-typedef struct QObject QObject;
+typedef struct QBool QBool;
+typedef struct QDict QDict;
+typedef struct QList QList;
typedef struct QNull QNull;
+typedef struct QNum QNum;
+typedef struct QObject QObject;
+typedef struct QString QString;
typedef struct RAMBlock RAMBlock;
typedef struct Range Range;
typedef struct SerialState SerialState;