mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-27 13:45:07 +00:00
qapi: Clean up qobject_input_type_number() control flow
Use the more common pattern to error out. Backports commit 58634047b7deeab36e4b07c4744e44d698975561 from qemu
This commit is contained in:
parent
d70f3bfc6b
commit
f1dbfe6be6
|
@ -441,13 +441,13 @@ static void qobject_input_type_number(Visitor *v, const char *name, double *obj,
|
|||
}
|
||||
|
||||
qfloat = qobject_to_qfloat(qobj);
|
||||
if (qfloat) {
|
||||
*obj = qfloat_get_double(qobject_to_qfloat(qobj));
|
||||
if (!qfloat) {
|
||||
error_setg(errp, QERR_INVALID_PARAMETER_TYPE,
|
||||
full_name(qiv, name), "number");
|
||||
return;
|
||||
}
|
||||
|
||||
error_setg(errp, QERR_INVALID_PARAMETER_TYPE,
|
||||
full_name(qiv, name), "number");
|
||||
*obj = qfloat_get_double(qobject_to_qfloat(qobj));
|
||||
}
|
||||
|
||||
static void qobject_input_type_any(Visitor *v, const char *name, QObject **obj,
|
||||
|
|
Loading…
Reference in a new issue