mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
qapi: Clean up qobject_input_type_number() control flow
Use the more common pattern to error out. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-6-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Commit message tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
c1214ad3dc
commit
58634047b7
1 changed files with 4 additions and 4 deletions
|
@ -547,13 +547,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_number_keyval(Visitor *v, const char *name,
|
||||
|
|
Loading…
Reference in a new issue