mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
qobject: Use 'bool' inside qdict
Now that qbool is fixed, let's fix getting and setting a bool value to a qdict member to also use C99 bool rather than int. I audited all callers to ensure that the changed return type will not cause any changed semantics. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
fc48ffc39e
commit
34acbc9522
6 changed files with 28 additions and 28 deletions
|
@ -241,7 +241,7 @@ int64_t qdict_get_int(const QDict *qdict, const char *key)
|
|||
*
|
||||
* Return bool mapped by 'key'.
|
||||
*/
|
||||
int qdict_get_bool(const QDict *qdict, const char *key)
|
||||
bool qdict_get_bool(const QDict *qdict, const char *key)
|
||||
{
|
||||
QObject *obj = qdict_get_obj(qdict, key, QTYPE_QBOOL);
|
||||
return qbool_get_bool(qobject_to_qbool(obj));
|
||||
|
@ -314,7 +314,7 @@ int64_t qdict_get_try_int(const QDict *qdict, const char *key,
|
|||
* dictionary or if the stored object is not of QBool type
|
||||
* 'def_value' will be returned.
|
||||
*/
|
||||
int qdict_get_try_bool(const QDict *qdict, const char *key, int def_value)
|
||||
bool qdict_get_try_bool(const QDict *qdict, const char *key, bool def_value)
|
||||
{
|
||||
QObject *obj;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue