mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-24 21:48:26 +00:00
qapi: Separate type QNull from QObject
Backports commit 006ca09f3027d86346fce707e9295975c6558f42 from qemu
This commit is contained in:
parent
566b097b85
commit
3fd0ff8aa7
3 changed files with 13 additions and 7 deletions
|
@ -99,11 +99,15 @@ static inline QType qobject_type(const QObject *obj)
|
|||
return obj->type;
|
||||
}
|
||||
|
||||
extern QObject qnull_;
|
||||
typedef struct QNull {
|
||||
QObject base;
|
||||
} QNull;
|
||||
|
||||
static inline QObject *qnull(void)
|
||||
extern QNull qnull_;
|
||||
|
||||
static inline QNull *qnull(void)
|
||||
{
|
||||
qobject_incref(&qnull_);
|
||||
QINCREF(&qnull_);
|
||||
return &qnull_;
|
||||
}
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ static void qobject_output_type_any(Visitor *v, const char *name, QObject **obj,
|
|||
static void qobject_output_type_null(Visitor *v, const char *name, Error **errp)
|
||||
{
|
||||
QObjectOutputVisitor *qov = to_qov(v);
|
||||
qobject_output_add_obj(qov, name, qnull());
|
||||
qobject_output_add(qov, name, qnull());
|
||||
}
|
||||
|
||||
/* Finish building, and return the root object.
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
#include "qemu-common.h"
|
||||
#include "qapi/qmp/qobject.h"
|
||||
|
||||
QObject qnull_ = {
|
||||
QTYPE_QNULL,
|
||||
1,
|
||||
QNull qnull_ = {
|
||||
{
|
||||
QTYPE_QNULL,
|
||||
1,
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue