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.

Backports commit 9f5c734d591e26186a71f9e36d752f4798df3672 from qemu
This commit is contained in:
Markus Armbruster 2018-03-07 12:29:30 -05:00 committed by Lioncash
parent 5d554fefeb
commit bbc9bcbb44
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
6 changed files with 15 additions and 10 deletions

View File

@ -17,10 +17,10 @@
#include "unicorn/platform.h"
#include "qapi/qmp/qobject.h"
typedef struct QBool {
struct QBool {
QObject_HEAD;
bool value;
} QBool;
};
QBool *qbool_from_bool(bool value);
bool qbool_get_bool(const QBool *qb);

View File

@ -27,11 +27,11 @@ typedef struct QDictEntry {
QLIST_ENTRY(QDictEntry) next;
} QDictEntry;
typedef struct QDict {
struct QDict {
QObject_HEAD;
size_t size;
QLIST_HEAD(,QDictEntry) table[QDICT_BUCKET_MAX];
} QDict;
};
/* Object API */
QDict *qdict_new(void);

View File

@ -22,10 +22,10 @@ typedef struct QListEntry {
QTAILQ_ENTRY(QListEntry) next;
} QListEntry;
typedef struct QList {
struct QList {
QObject_HEAD;
QTAILQ_HEAD(,QListEntry) head;
} QList;
};
#define qlist_append(qlist, obj) \
qlist_append_obj(qlist, QOBJECT(obj))

View File

@ -23,7 +23,7 @@ typedef enum {
QNUM_DOUBLE
} QNumKind;
typedef struct QNum {
struct QNum {
QObject base;
QNumKind kind;
union {
@ -31,7 +31,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);

View File

@ -16,12 +16,12 @@
#include "unicorn/platform.h"
#include "qapi/qmp/qobject.h"
typedef struct QString {
struct QString {
QObject_HEAD;
char *string;
size_t length;
size_t capacity;
} QString;
};
QString *qstring_new(void);
QString *qstring_from_str(const char *str);

View File

@ -69,7 +69,12 @@ typedef struct QEMUSizedBuffer QEMUSizedBuffer;
typedef struct QEMUTimer QEMUTimer;
typedef struct QEMUTimerListGroup QEMUTimerListGroup;
typedef struct QemuConsole QemuConsole;
typedef struct QBool QBool;
typedef struct QDict QDict;
typedef struct QList QList;
typedef struct QNum QNum;
typedef struct QObject QObject;
typedef struct QString QString;
typedef struct RAMBlock RAMBlock;
typedef struct Range Range;
typedef struct SHPCDevice SHPCDevice;