mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Use QNull for a more regular visit_type_null()
Make visit_type_null() take an @obj argument like its buddies. This helps keep the next commit simple. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
006ca09f30
commit
d2f95f4d48
15 changed files with 60 additions and 25 deletions
|
@ -326,14 +326,20 @@ static void parse_type_number(Visitor *v, const char *name, double *obj,
|
|||
*obj = val;
|
||||
}
|
||||
|
||||
static void parse_type_null(Visitor *v, const char *name, Error **errp)
|
||||
static void parse_type_null(Visitor *v, const char *name, QNull **obj,
|
||||
Error **errp)
|
||||
{
|
||||
StringInputVisitor *siv = to_siv(v);
|
||||
|
||||
*obj = NULL;
|
||||
|
||||
if (!siv->string || siv->string[0]) {
|
||||
error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
|
||||
"null");
|
||||
return;
|
||||
}
|
||||
|
||||
*obj = qnull();
|
||||
}
|
||||
|
||||
static void string_input_free(Visitor *v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue