mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
qdict: Add qdict_put_null() helper, and put it to use
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170825105913.4060-2-marcandre.lureau@redhat.com> [Update to qobject.cocci squashed in, commit message tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
f90cb2846a
commit
0f9afc2a8b
3 changed files with 8 additions and 3 deletions
|
@ -53,13 +53,15 @@ void qdict_destroy_obj(QObject *obj);
|
|||
#define qdict_put(qdict, key, obj) \
|
||||
qdict_put_obj(qdict, key, QOBJECT(obj))
|
||||
|
||||
/* Helpers for int, bool, and string */
|
||||
/* Helpers for int, bool, null, and string */
|
||||
#define qdict_put_int(qdict, key, value) \
|
||||
qdict_put(qdict, key, qnum_from_int(value))
|
||||
#define qdict_put_bool(qdict, key, value) \
|
||||
qdict_put(qdict, key, qbool_from_bool(value))
|
||||
#define qdict_put_str(qdict, key, value) \
|
||||
qdict_put(qdict, key, qstring_from_str(value))
|
||||
#define qdict_put_null(qdict, key) \
|
||||
qdict_put(qdict, key, qnull())
|
||||
|
||||
/* High level helpers */
|
||||
double qdict_get_double(const QDict *qdict, const char *key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue