mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-25 14:26:57 +00:00
qapi: Separate type QNull from QObject
Backports commit 006ca09f3027d86346fce707e9295975c6558f42 from qemu
This commit is contained in:
parent
566b097b85
commit
3fd0ff8aa7
|
@ -99,11 +99,15 @@ static inline QType qobject_type(const QObject *obj)
|
||||||
return obj->type;
|
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_;
|
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)
|
static void qobject_output_type_null(Visitor *v, const char *name, Error **errp)
|
||||||
{
|
{
|
||||||
QObjectOutputVisitor *qov = to_qov(v);
|
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.
|
/* Finish building, and return the root object.
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
#include "qemu-common.h"
|
#include "qemu-common.h"
|
||||||
#include "qapi/qmp/qobject.h"
|
#include "qapi/qmp/qobject.h"
|
||||||
|
|
||||||
QObject qnull_ = {
|
QNull qnull_ = {
|
||||||
|
{
|
||||||
QTYPE_QNULL,
|
QTYPE_QNULL,
|
||||||
1,
|
1,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue