提交 c7c46212 编写于 作者: M Markus Armbruster

qobject: Drop QObject_HEAD

QObject_HEAD is a macro expanding into the common part of structs that
are sub-types of QObject.  It's always been just QObject base, and
unlikely to change.  Drop the macro, because the code is clearer with
out it.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Message-Id: <1444918537-18107-2-git-send-email-armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 7bc8e0c9
......@@ -18,7 +18,7 @@
#include "qapi/qmp/qobject.h"
typedef struct QBool {
QObject_HEAD;
QObject base;
bool value;
} QBool;
......
......@@ -28,7 +28,7 @@ typedef struct QDictEntry {
} QDictEntry;
typedef struct QDict {
QObject_HEAD;
QObject base;
size_t size;
QLIST_HEAD(,QDictEntry) table[QDICT_BUCKET_MAX];
} QDict;
......
......@@ -18,7 +18,7 @@
#include "qapi/qmp/qobject.h"
typedef struct QFloat {
QObject_HEAD;
QObject base;
double value;
} QFloat;
......
......@@ -17,7 +17,7 @@
#include "qapi/qmp/qobject.h"
typedef struct QInt {
QObject_HEAD;
QObject base;
int64_t value;
} QInt;
......
......@@ -22,7 +22,7 @@ typedef struct QListEntry {
} QListEntry;
typedef struct QList {
QObject_HEAD;
QObject base;
QTAILQ_HEAD(,QListEntry) head;
} QList;
......
......@@ -59,10 +59,6 @@ typedef struct QObject {
size_t refcnt;
} QObject;
/* Objects definitions must include this */
#define QObject_HEAD \
QObject base
/* Get the 'base' part of an object */
#define QOBJECT(obj) (&(obj)->base)
......
......@@ -17,7 +17,7 @@
#include "qapi/qmp/qobject.h"
typedef struct QString {
QObject_HEAD;
QObject base;
char *string;
size_t length;
size_t capacity;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册