qapi: Fix Visitor contract for start_alternate()
The contract demands v->start_alternate() for input and dealloc visitors, but visit_start_alternate() actually requires it for input and clone visitors. Fix the contract, and delete superfluous qapi_dealloc_start_alternate(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200424084338.26803-8-armbru@redhat.com>
This commit is contained in:
parent
8e08bf4ea2
commit
8b7ce95b46
@ -67,13 +67,12 @@ struct Visitor
|
|||||||
/* Must be set */
|
/* Must be set */
|
||||||
void (*end_list)(Visitor *v, void **list);
|
void (*end_list)(Visitor *v, void **list);
|
||||||
|
|
||||||
/* Must be set by input and dealloc visitors to visit alternates;
|
/* Must be set by input and clone visitors to visit alternates */
|
||||||
* optional for output visitors. */
|
|
||||||
void (*start_alternate)(Visitor *v, const char *name,
|
void (*start_alternate)(Visitor *v, const char *name,
|
||||||
GenericAlternate **obj, size_t size,
|
GenericAlternate **obj, size_t size,
|
||||||
Error **errp);
|
Error **errp);
|
||||||
|
|
||||||
/* Optional, needed for dealloc visitor */
|
/* Optional */
|
||||||
void (*end_alternate)(Visitor *v, void **obj);
|
void (*end_alternate)(Visitor *v, void **obj);
|
||||||
|
|
||||||
/* Must be set */
|
/* Must be set */
|
||||||
|
@ -34,12 +34,6 @@ static void qapi_dealloc_end_struct(Visitor *v, void **obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qapi_dealloc_start_alternate(Visitor *v, const char *name,
|
|
||||||
GenericAlternate **obj, size_t size,
|
|
||||||
Error **errp)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void qapi_dealloc_end_alternate(Visitor *v, void **obj)
|
static void qapi_dealloc_end_alternate(Visitor *v, void **obj)
|
||||||
{
|
{
|
||||||
if (obj) {
|
if (obj) {
|
||||||
@ -123,7 +117,6 @@ Visitor *qapi_dealloc_visitor_new(void)
|
|||||||
v->visitor.type = VISITOR_DEALLOC;
|
v->visitor.type = VISITOR_DEALLOC;
|
||||||
v->visitor.start_struct = qapi_dealloc_start_struct;
|
v->visitor.start_struct = qapi_dealloc_start_struct;
|
||||||
v->visitor.end_struct = qapi_dealloc_end_struct;
|
v->visitor.end_struct = qapi_dealloc_end_struct;
|
||||||
v->visitor.start_alternate = qapi_dealloc_start_alternate;
|
|
||||||
v->visitor.end_alternate = qapi_dealloc_end_alternate;
|
v->visitor.end_alternate = qapi_dealloc_end_alternate;
|
||||||
v->visitor.start_list = qapi_dealloc_start_list;
|
v->visitor.start_list = qapi_dealloc_start_list;
|
||||||
v->visitor.next_list = qapi_dealloc_next_list;
|
v->visitor.next_list = qapi_dealloc_next_list;
|
||||||
|
Loading…
Reference in New Issue
Block a user