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: Markus Armbruster <armbru@redhat.com>
Message-Id: <1444918537-18107-2-git-send-email-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Markus Armbruster 2015-10-15 16:15:32 +02:00
parent 7bc8e0c967
commit c7c462123c
7 changed files with 6 additions and 10 deletions

View file

@ -18,7 +18,7 @@
#include "qapi/qmp/qobject.h" #include "qapi/qmp/qobject.h"
typedef struct QBool { typedef struct QBool {
QObject_HEAD; QObject base;
bool value; bool value;
} QBool; } QBool;

View file

@ -28,7 +28,7 @@ typedef struct QDictEntry {
} QDictEntry; } QDictEntry;
typedef struct QDict { typedef struct QDict {
QObject_HEAD; QObject base;
size_t size; size_t size;
QLIST_HEAD(,QDictEntry) table[QDICT_BUCKET_MAX]; QLIST_HEAD(,QDictEntry) table[QDICT_BUCKET_MAX];
} QDict; } QDict;

View file

@ -18,7 +18,7 @@
#include "qapi/qmp/qobject.h" #include "qapi/qmp/qobject.h"
typedef struct QFloat { typedef struct QFloat {
QObject_HEAD; QObject base;
double value; double value;
} QFloat; } QFloat;

View file

@ -17,7 +17,7 @@
#include "qapi/qmp/qobject.h" #include "qapi/qmp/qobject.h"
typedef struct QInt { typedef struct QInt {
QObject_HEAD; QObject base;
int64_t value; int64_t value;
} QInt; } QInt;

View file

@ -22,7 +22,7 @@ typedef struct QListEntry {
} QListEntry; } QListEntry;
typedef struct QList { typedef struct QList {
QObject_HEAD; QObject base;
QTAILQ_HEAD(,QListEntry) head; QTAILQ_HEAD(,QListEntry) head;
} QList; } QList;

View file

@ -59,10 +59,6 @@ typedef struct QObject {
size_t refcnt; size_t refcnt;
} QObject; } QObject;
/* Objects definitions must include this */
#define QObject_HEAD \
QObject base
/* Get the 'base' part of an object */ /* Get the 'base' part of an object */
#define QOBJECT(obj) (&(obj)->base) #define QOBJECT(obj) (&(obj)->base)

View file

@ -17,7 +17,7 @@
#include "qapi/qmp/qobject.h" #include "qapi/qmp/qobject.h"
typedef struct QString { typedef struct QString {
QObject_HEAD; QObject base;
char *string; char *string;
size_t length; size_t length;
size_t capacity; size_t capacity;