summaryrefslogtreecommitdiffstats
path: root/hw/xen/xen_backend.c
diff options
context:
space:
mode:
authorPeter Maydell2018-05-24 18:48:01 +0200
committerPeter Maydell2018-05-24 18:48:01 +0200
commit62b9b076d9d37117696ec64f0b3544c1205ff7f9 (patch)
treecb56b7f7ee9b99669b51fc2cd5354e5330057e26 /hw/xen/xen_backend.c
parentMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (diff)
parentMAINTAINERS: add vga entries (diff)
downloadqemu-62b9b076d9d37117696ec64f0b3544c1205ff7f9.tar.gz
qemu-62b9b076d9d37117696ec64f0b3544c1205ff7f9.tar.xz
qemu-62b9b076d9d37117696ec64f0b3544c1205ff7f9.zip
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20180524-pull-request' into staging
vga: catch depth 0 hw/display: add new bochs-display device some cleanups. # gpg: Signature made Thu 24 May 2018 16:45:46 BST # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/vga-20180524-pull-request: MAINTAINERS: add vga entries bochs-display: add pcie support bochs-display: add dirty tracking support hw/display: add new bochs-display device vga-pci: use PCI_VGA_MMIO_SIZE vga: move bochs vbe defines to header file vga: catch depth 0 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/xen/xen_backend.c')
0 files changed, 0 insertions, 0 deletions
7.8%;'/> -rw-r--r--block/qcow.c2
-rw-r--r--block/qcow2.c2
-rw-r--r--block/qed.c2
-rw-r--r--block/rbd.c8
-rw-r--r--block/sheepdog.c2
-rw-r--r--block/vhdx.c2
-rw-r--r--block/vpc.c2
-rw-r--r--blockdev.c7
-rw-r--r--hw/i386/acpi-build.c16
-rw-r--r--monitor.c8
-rw-r--r--qapi/qmp-dispatch.c2
-rw-r--r--qapi/qobject-input-visitor.c20
-rw-r--r--qapi/qobject-output-visitor.c4
-rw-r--r--qga/main.c2
-rw-r--r--qmp.c2
-rw-r--r--qobject/json-parser.c2
-rw-r--r--qobject/qbool.c4
-rw-r--r--qobject/qdict.c38
-rw-r--r--qobject/qjson.c10
-rw-r--r--qobject/qlist.c6
-rw-r--r--qobject/qlit.c10
-rw-r--r--qobject/qnum.c6
-rw-r--r--qobject/qstring.c6
-rw-r--r--qom/object.c8
-rw-r--r--target/i386/cpu.c2
-rw-r--r--target/s390x/cpu_models.c2
-rw-r--r--tests/check-qdict.c20
-rw-r--r--tests/check-qjson.c41
-rw-r--r--tests/check-qlist.c4
-rw-r--r--tests/check-qlit.c10
-rw-r--r--tests/check-qnum.c4
-rw-r--r--tests/check-qobject.c2
-rw-r--r--tests/check-qstring.c2
-rw-r--r--tests/device-introspect-test.c14
-rw-r--r--tests/libqtest.c6
-rw-r--r--tests/numa-test.c8
-rw-r--r--tests/qom-test.c4
-rw-r--r--tests/test-char.c2
-rw-r--r--tests/test-keyval.c8
-rw-r--r--tests/test-qga.c19
-rw-r--r--tests/test-qmp-cmds.c12
-rw-r--r--tests/test-qmp-event.c16
-rw-r--r--tests/test-qobject-input-visitor.c10
-rw-r--r--tests/test-qobject-output-visitor.c54
-rw-r--r--tests/test-x86-cpuid-compat.c17
-rw-r--r--util/keyval.c4
-rw-r--r--util/qemu-config.c2
-rw-r--r--util/qemu-option.c6
51 files changed, 231 insertions, 227 deletions
diff --git a/block.c b/block.c
index f7f9d8eca7..fd33d5ec43 100644
--- a/block.c
+++ b/block.c
@@ -1457,7 +1457,7 @@ static QDict *parse_json_filename(const char *filename, Error **errp)
return NULL;
}
- options = qobject_to_qdict(options_obj);
+ options = qobject_to(QDict, options_obj);
if (!options) {
qobject_decref(options_obj);
error_setg(errp, "Invalid JSON object given");
@@ -2433,7 +2433,7 @@ BlockDriverState *bdrv_open_blockdev_ref(BlockdevRef *ref, Error **errp)
}
visit_complete(v, &obj);
- qdict = qobject_to_qdict(obj);
+ qdict = qobject_to(QDict, obj);
qdict_flatten(qdict);
/* bdrv_open_inherit() defaults to the values in bdrv_flags (for
diff --git a/block/parallels.c b/block/parallels.c
index 2da5e56a9d..e2515dec81 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -647,7 +647,7 @@ static int coroutine_fn parallels_co_create_opts(const char *filename,
qobj = qdict_crumple(qdict, errp);
QDECREF(qdict);
- qdict = qobject_to_qdict(qobj);
+ qdict = qobject_to(QDict, qobj);
if (qdict == NULL) {
ret = -EINVAL;
goto done;
diff --git a/block/qapi.c b/block/qapi.c
index 4c9923d262..f2e0aa2cbe 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -647,29 +647,29 @@ static void dump_qobject(fprintf_function func_fprintf, void *f,
{
switch (qobject_type(obj)) {
case QTYPE_QNUM: {
- QNum *value = qobject_to_qnum(obj);
+ QNum *value = qobject_to(QNum, obj);
char *tmp = qnum_to_string(value);
func_fprintf(f, "%s", tmp);
g_free(tmp);
break;
}
case QTYPE_QSTRING: {
- QString *value = qobject_to_qstring(obj);
+ QString *value = qobject_to(QString, obj);
func_fprintf(f, "%s", qstring_get_str(value));
break;
}
case QTYPE_QDICT: {
- QDict *value = qobject_to_qdict(obj);
+ QDict *value = qobject_to(QDict, obj);
dump_qdict(func_fprintf, f, comp_indent, value);
break;
}
case QTYPE_QLIST: {
- QList *value = qobject_to_qlist(obj);
+ QList *value = qobject_to(QList, obj);
dump_qlist(func_fprintf, f, comp_indent, value);
break;
}
case QTYPE_QBOOL: {
- QBool *value = qobject_to_qbool(obj);
+ QBool *value = qobject_to(QBool, obj);
func_fprintf(f, "%s", qbool_get_bool(value) ? "true" : "false");
break;
}
@@ -730,7 +730,7 @@ void bdrv_image_info_specific_dump(fprintf_function func_fprintf, void *f,
visit_type_ImageInfoSpecific(v, NULL, &info_spec, &error_abort);
visit_complete(v, &obj);
- data = qdict_get(qobject_to_qdict(obj), "data");
+ data = qdict_get(qobject_to(QDict, obj), "data");
dump_qobject(func_fprintf, f, 1, data);
qobject_decref(obj);
visit_free(v);
diff --git a/block/qcow.c b/block/qcow.c
index 2e3770ca63..f92891676c 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -996,7 +996,7 @@ static int coroutine_fn qcow_co_create_opts(const char *filename,
qobj = qdict_crumple(qdict, errp);
QDECREF(qdict);
- qdict = qobject_to_qdict(qobj);
+ qdict = qobject_to(QDict, qobj);
if (qdict == NULL) {
ret = -EINVAL;
goto fail;
diff --git a/block/qcow2.c b/block/qcow2.c
index 7472af6931..cf4f3becae 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3125,7 +3125,7 @@ static int coroutine_fn qcow2_co_create_opts(const char *filename, QemuOpts *opt
/* Now get the QAPI type BlockdevCreateOptions */
qobj = qdict_crumple(qdict, errp);
QDECREF(qdict);
- qdict = qobject_to_qdict(qobj);
+ qdict = qobject_to(QDict, qobj);
if (qdict == NULL) {
ret = -EINVAL;
goto finish;
diff --git a/block/qed.c b/block/qed.c
index 46a84beeed..35ff505066 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -764,7 +764,7 @@ static int coroutine_fn bdrv_qed_co_create_opts(const char *filename,
qobj = qdict_crumple(qdict, errp);
QDECREF(qdict);
- qdict = qobject_to_qdict(qobj);
+ qdict = qobject_to(QDict, qobj);
if (qdict == NULL) {
ret = -EINVAL;
goto fail;
diff --git a/block/rbd.c b/block/rbd.c
index 294ed07ac4..5b64849dc6 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -263,14 +263,14 @@ static int qemu_rbd_set_keypairs(rados_t cluster, const char *keypairs_json,
if (!keypairs_json) {
return ret;
}
- keypairs = qobject_to_qlist(qobject_from_json(keypairs_json,
- &error_abort));
+ keypairs = qobject_to(QList,
+ qobject_from_json(keypairs_json, &error_abort));
remaining = qlist_size(keypairs) / 2;
assert(remaining);
while (remaining--) {
- name = qobject_to_qstring(qlist_pop(keypairs));
- value = qobject_to_qstring(qlist_pop(keypairs));
+ name = qobject_to(QString, qlist_pop(keypairs));
+ value = qobject_to(QString, qlist_pop(keypairs));
assert(name && value);
key = qstring_get_str(name);
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 797ea5953b..387f59c8aa 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -1887,7 +1887,7 @@ static int sd_create_prealloc(BlockdevOptionsSheepdog *location, int64_t size,
return -EINVAL;
}
- qdict = qobject_to_qdict(obj);
+ qdict = qobject_to(QDict, obj);
qdict_flatten(qdict);
qdict_put_str(qdict, "driver", "sheepdog");
diff --git a/block/vhdx.c b/block/vhdx.c
index f1b97f4b49..d2c54b7891 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1997,7 +1997,7 @@ static int coroutine_fn vhdx_co_create_opts(const char *filename,
qobj = qdict_crumple(qdict, errp);
QDECREF(qdict);
- qdict = qobject_to_qdict(qobj);
+ qdict = qobject_to(QDict, qobj);
if (qdict == NULL) {
ret = -EINVAL;
goto fail;
diff --git a/block/vpc.c b/block/vpc.c
index 28ffa0d2f8..44f99a4d1b 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -1120,7 +1120,7 @@ static int coroutine_fn vpc_co_create_opts(const char *filename,
qobj = qdict_crumple(qdict, errp);
QDECREF(qdict);
- qdict = qobject_to_qdict(qobj);
+ qdict = qobject_to(QDict, qobj);
if (qdict == NULL) {
ret = -EINVAL;
goto fail;
diff --git a/blockdev.c b/blockdev.c
index a6758c1220..6067792e41 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -334,7 +334,8 @@ static bool parse_stats_intervals(BlockAcctStats *stats, QList *intervals,
case QTYPE_QSTRING: {
unsigned long long length;
- const char *str = qstring_get_str(qobject_to_qstring(entry->value));
+ const char *str = qstring_get_str(qobject_to(QString,
+ entry->value));
if (parse_uint_full(str, &length, 10) == 0 &&
length > 0 && length <= UINT_MAX) {
block_acct_add_interval(stats, (unsigned) length);
@@ -346,7 +347,7 @@ static bool parse_stats_intervals(BlockAcctStats *stats, QList *intervals,
}
case QTYPE_QNUM: {
- int64_t length = qnum_get_int(qobject_to_qnum(entry->value));
+ int64_t length = qnum_get_int(qobject_to(QNum, entry->value));
if (length > 0 && length <= UINT_MAX) {
block_acct_add_interval(stats, (unsigned) length);
@@ -4054,7 +4055,7 @@ void qmp_blockdev_add(BlockdevOptions *options, Error **errp)
}
visit_complete(v, &obj);
- qdict = qobject_to_qdict(obj);
+ qdict = qobject_to(QDict, obj);
qdict_flatten(qdict);
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index deb440f286..a66fb2dcd2 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -154,21 +154,21 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
/* Fill in optional s3/s4 related properties */
o = object_property_get_qobject(obj, ACPI_PM_PROP_S3_DISABLED, NULL);
if (o) {
- pm->s3_disabled = qnum_get_uint(qobject_to_qnum(o));
+ pm->s3_disabled = qnum_get_uint(qobject_to(QNum, o));
} else {
pm->s3_disabled = false;
}
qobject_decref(o);
o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_DISABLED, NULL);
if (o) {
- pm->s4_disabled = qnum_get_uint(qobject_to_qnum(o));
+ pm->s4_disabled = qnum_get_uint(qobject_to(QNum, o));
} else {
pm->s4_disabled = false;
}
qobject_decref(o);
o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_VAL, NULL);
if (o) {
- pm->s4_val = qnum_get_uint(qobject_to_qnum(o));
+ pm->s4_val = qnum_get_uint(qobject_to(QNum, o));
} else {
pm->s4_val = false;
}
@@ -507,14 +507,14 @@ static void build_append_pcihp_notify_entry(Aml *method, int slot)
static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
bool pcihp_bridge_en)
{
- Aml *dev, *notify_method, *method;
+ Aml *dev, *notify_method = NULL, *method;
QObject *bsel;
PCIBus *sec;
int i;
bsel = object_property_get_qobject(OBJECT(bus), ACPI_PCIHP_PROP_BSEL, NULL);
if (bsel) {
- uint64_t bsel_val = qnum_get_uint(qobject_to_qnum(bsel));
+ uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
aml_append(parent_scope, aml_name_decl("BSEL", aml_int(bsel_val)));
notify_method = aml_method("DVNT", 2, AML_NOTSERIALIZED);
@@ -624,7 +624,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
/* If bus supports hotplug select it and notify about local events */
if (bsel) {
- uint64_t bsel_val = qnum_get_uint(qobject_to_qnum(bsel));
+ uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
aml_append(method,
@@ -2638,12 +2638,12 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg)
if (!o) {
return false;
}
- mcfg->mcfg_base = qnum_get_uint(qobject_to_qnum(o));
+ mcfg->mcfg_base = qnum_get_uint(qobject_to(QNum, o));
qobject_decref(o);
o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_SIZE, NULL);
assert(o);
- mcfg->mcfg_size = qnum_get_uint(qobject_to_qnum(o));
+ mcfg->mcfg_size = qnum_get_uint(qobject_to(QNum, o));
qobject_decref(o);
return true;
}
diff --git a/monitor.c b/monitor.c
index d92f02d98c..aeabb859f2 100644
--- a/monitor.c
+++ b/monitor.c
@@ -447,7 +447,7 @@ monitor_qapi_event_queue(QAPIEvent event, QDict *qdict, Error **errp)
/* Unthrottled event */
monitor_qapi_event_emit(event, qdict);
} else {
- QDict *data = qobject_to_qdict(qdict_get(qdict, "data"));
+ QDict *data = qobject_to(QDict, qdict_get(qdict, "data"));
MonitorQAPIEventState key = { .event = event, .data = data };
evstate = g_hash_table_lookup(monitor_qapi_event_state, &key);
@@ -3777,7 +3777,7 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
goto err_out;
}
- qdict = qobject_to_qdict(req);
+ qdict = qobject_to(QDict, req);
if (qdict) {
id = qdict_get(qdict, "id");
qobject_incref(id);
@@ -3793,7 +3793,7 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
rsp = qmp_dispatch(cur_mon->qmp.commands, req);
if (mon->qmp.commands == &qmp_cap_negotiation_commands) {
- qdict = qdict_get_qdict(qobject_to_qdict(rsp), "error");
+ qdict = qdict_get_qdict(qobject_to(QDict, rsp), "error");
if (qdict
&& !g_strcmp0(qdict_get_try_str(qdict, "class"),
QapiErrorClass_str(ERROR_CLASS_COMMAND_NOT_FOUND))) {
@@ -3814,7 +3814,7 @@ err_out:
if (rsp) {
if (id) {
- qdict_put_obj(qobject_to_qdict(rsp), "id", id);
+ qdict_put_obj(qobject_to(QDict, rsp), "id", id);
id = NULL;
}
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index e31ac4be1f..af537f3d7d 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -26,7 +26,7 @@ static QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp)
bool has_exec_key = false;
QDict *dict = NULL;
- dict = qobject_to_qdict(request);
+ dict = qobject_to(QDict, request);
if (!dict) {
error_setg(errp, "QMP input must be a JSON object");
return NULL;
diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c
index 023317b05f..0b5293385e 100644
--- a/qapi/qobject-input-visitor.c
+++ b/qapi/qobject-input-visitor.c
@@ -137,7 +137,7 @@ static QObject *qobject_input_try_get_object(QObjectInputVisitor *qiv,
if (qobject_type(qobj) == QTYPE_QDICT) {
assert(name);
- ret = qdict_get(qobject_to_qdict(qobj), name);
+ ret = qdict_get(qobject_to(QDict, qobj), name);
if (tos->h && consume && ret) {
bool removed = g_hash_table_remove(tos->h, name);
assert(removed);
@@ -185,7 +185,7 @@ static const char *qobject_input_get_keyval(QObjectInputVisitor *qiv,
return NULL;
}
- qstr = qobject_to_qstring(qobj);
+ qstr = qobject_to(QString, qobj);
if (!qstr) {
switch (qobject_type(qobj)) {
case QTYPE_QDICT:
@@ -224,11 +224,11 @@ static const QListEntry *qobject_input_push(QObjectInputVisitor *qiv,
if (qobject_type(obj) == QTYPE_QDICT) {
h = g_hash_table_new(g_str_hash, g_str_equal);
- qdict_iter(qobject_to_qdict(obj), qdict_add_key, h);
+ qdict_iter(qobject_to(QDict, obj), qdict_add_key, h);
tos->h = h;
} else {
assert(qobject_type(obj) == QTYPE_QLIST);
- tos->entry = qlist_first(qobject_to_qlist(obj));
+ tos->entry = qlist_first(qobject_to(QList, obj));
tos->index = -1;
}
@@ -395,7 +395,7 @@ static void qobject_input_type_int64(Visitor *v, const char *name, int64_t *obj,
if (!qobj) {
return;
}
- qnum = qobject_to_qnum(qobj);
+ qnum = qobject_to(QNum, qobj);
if (!qnum || !qnum_get_try_int(qnum, obj)) {
error_setg(errp, QERR_INVALID_PARAMETER_TYPE,
full_name(qiv, name), "integer");
@@ -430,7 +430,7 @@ static void qobject_input_type_uint64(Visitor *v, const char *name,
if (!qobj) {
return;
}
- qnum = qobject_to_qnum(qobj);
+ qnum = qobject_to(QNum, qobj);
if (!qnum) {
goto err;
}
@@ -477,7 +477,7 @@ static void qobject_input_type_bool(Visitor *v, const char *name, bool *obj,
if (!qobj) {
return;
}
- qbool = qobject_to_qbool(qobj);
+ qbool = qobject_to(QBool, qobj);
if (!qbool) {
error_setg(errp, QERR_INVALID_PARAMETER_TYPE,
full_name(qiv, name), "boolean");
@@ -518,7 +518,7 @@ static void qobject_input_type_str(Visitor *v, const char *name, char **obj,
if (!qobj) {
return;
}
- qstr = qobject_to_qstring(qobj);
+ qstr = qobject_to(QString, qobj);
if (!qstr) {
error_setg(errp, QERR_INVALID_PARAMETER_TYPE,
full_name(qiv, name), "string");
@@ -547,7 +547,7 @@ static void qobject_input_type_number(Visitor *v, const char *name, double *obj,
if (!qobj) {
return;
}
- qnum = qobject_to_qnum(qobj);
+ qnum = qobject_to(QNum, qobj);
if (!qnum) {
error_setg(errp, QERR_INVALID_PARAMETER_TYPE,
full_name(qiv, name), "number");
@@ -734,7 +734,7 @@ Visitor *qobject_input_visitor_new_str(const char *str,
}
return NULL;
}
- args = qobject_to_qdict(obj);
+ args = qobject_to(QDict, obj);
assert(args);
v = qobject_input_visitor_new(QOBJECT(args));
} else {
diff --git a/qapi/qobject-output-visitor.c b/qapi/qobject-output-visitor.c
index 7c3b42cfe2..877e37eeb8 100644
--- a/qapi/qobject-output-visitor.c
+++ b/qapi/qobject-output-visitor.c
@@ -92,11 +92,11 @@ static void qobject_output_add_obj(QObjectOutputVisitor *qov, const char *name,
switch (qobject_type(cur)) {
case QTYPE_QDICT:
assert(name);
- qdict_put_obj(qobject_to_qdict(cur), name, value);
+ qdict_put_obj(qobject_to(QDict, cur), name, value);
break;
case QTYPE_QLIST:
assert(!name);
- qlist_append_obj(qobject_to_qlist(cur), value);
+ qlist_append_obj(qobject_to(QList, cur), value);
break;
default:
g_assert_not_reached();
diff --git a/qga/main.c b/qga/main.c
index 837a75a46a..df1888edc1 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -607,7 +607,7 @@ static void process_event(JSONMessageParser *parser, GQueue *tokens)
g_assert(s && parser);
g_debug("process_event: called");
- qdict = qobject_to_qdict(json_parser_parse_err(tokens, NULL, &err));
+ qdict = qobject_to(QDict, json_parser_parse_err(tokens, NULL, &err));
if (err || !qdict) {
QDECREF(qdict);
qdict = qdict_new();
diff --git a/qmp.c b/qmp.c
index 8c7d1cc479..7e606d8486 100644
--- a/qmp.c
+++ b/qmp.c
@@ -705,7 +705,7 @@ void qmp_object_add(const char *type, const char *id,
Object *obj;
if (props) {
- pdict = qobject_to_qdict(props);
+ pdict = qobject_to(QDict, props);
if (!pdict) {
error_setg(errp, QERR_INVALID_PARAMETER_TYPE, "props", "dict");
return;
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index b724562415..055c7f0272 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -308,7 +308,7 @@ static int parse_pair(JSONParserContext *ctxt, QDict *dict, va_list *ap)
goto out;
}
- qdict_put_obj(dict, qstring_get_str(qobject_to_qstring(key)), value);
+ qdict_put_obj(dict, qstring_get_str(qobject_to(QString, key)), value);
qobject_decref(key);
diff --git a/qobject/qbool.c b/qobject/qbool.c
index e5a7a53879..5be6277cca 100644
--- a/qobject/qbool.c
+++ b/qobject/qbool.c
@@ -55,7 +55,7 @@ QBool *qobject_to_qbool(const QObject *obj)
*/
bool qbool_is_equal(const QObject *x, const QObject *y)
{
- return qobject_to_qbool(x)->value == qobject_to_qbool(y)->value;
+ return qobject_to(QBool, x)->value == qobject_to(QBool, y)->value;
}
/**
@@ -65,5 +65,5 @@ bool qbool_is_equal(const QObject *x, const QObject *y)
void qbool_destroy_obj(QObject *obj)
{
assert(obj != NULL);
- g_free(qobject_to_qbool(obj));
+ g_free(qobject_to(QBool, obj));
}
diff --git a/qobject/qdict.c b/qobject/qdict.c
index 229b8c840b..1e588123d0 100644
--- a/qobject/qdict.c
+++ b/qobject/qdict.c
@@ -206,7 +206,7 @@ size_t qdict_size(const QDict *qdict)
*/
double qdict_get_double(const QDict *qdict, const char *key)
{
- return qnum_get_double(qobject_to_qnum(qdict_get(qdict, key)));
+ return qnum_get_double(qobject_to(QNum, qdict_get(qdict, key)));
}
/**
@@ -219,7 +219,7 @@ double qdict_get_double(const QDict *qdict, const char *key)
*/
int64_t qdict_get_int(const QDict *qdict, const char *key)
{
- return qnum_get_int(qobject_to_qnum(qdict_get(qdict, key)));
+ return qnum_get_int(qobject_to(QNum, qdict_get(qdict, key)));
}
/**
@@ -232,7 +232,7 @@ int64_t qdict_get_int(const QDict *qdict, const char *key)
*/
bool qdict_get_bool(const QDict *qdict, const char *key)
{
- return qbool_get_bool(qobject_to_qbool(qdict_get(qdict, key)));
+ return qbool_get_bool(qobject_to(QBool, qdict_get(qdict, key)));
}
/**
@@ -240,7 +240,7 @@ bool qdict_get_bool(const QDict *qdict, const char *key)
*/
QList *qdict_get_qlist(const QDict *qdict, const char *key)
{
- return qobject_to_qlist(qdict_get(qdict, key));
+ return qobject_to(QList, qdict_get(qdict, key));
}
/**
@@ -248,7 +248,7 @@ QList *qdict_get_qlist(const QDict *qdict, const char *key)
*/
QDict *qdict_get_qdict(const QDict *qdict, const char *key)
{
- return qobject_to_qdict(qdict_get(qdict, key));
+ return qobject_to(QDict, qdict_get(qdict, key));
}
/**
@@ -262,7 +262,7 @@ QDict *qdict_get_qdict(const QDict *qdict, const char *key)
*/
const char *qdict_get_str(const QDict *qdict, const char *key)
{
- return qstring_get_str(qobject_to_qstring(qdict_get(qdict, key)));
+ return qstring_get_str(qobject_to(QString, qdict_get(qdict, key)));
}
/**
@@ -275,7 +275,7 @@ const char *qdict_get_str(const QDict *qdict, const char *key)
int64_t qdict_get_try_int(const QDict *qdict, const char *key,
int64_t def_value)
{
- QNum *qnum = qobject_to_qnum(qdict_get(qdict, key));
+ QNum *qnum = qobject_to(QNum, qdict_get(qdict, key));
int64_t val;
if (!qnum || !qnum_get_try_int(qnum, &val)) {