aboutsummaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-03-03 13:32:35 +0100
committerMarkus Armbruster <armbru@redhat.com>2017-03-05 09:14:19 +0100
commita8aec6de2ac1a5e36989fdfba29067b361009b75 (patch)
treea6c6c8a5fcff76f81a7ed167e1c1aa9a77ae107d /qapi
parenta9fc37f6bc3f2ab90585cb16493da9f6dcfbfbcf (diff)
qapi: Drop string input visitor method optional()
visit_optional() is to be called only between visit_start_struct() and visit_end_struct(). Visitors that don't support struct visits, i.e. don't implement start_struct(), end_struct(), have no use for it. Clarify documentation. The string input visitor doesn't support struct visits. Its parse_optional() is therefore useless. Drop it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1488544368-30622-16-git-send-email-armbru@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/string-input-visitor.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c
index 8dfa561252..1a855c5474 100644
--- a/qapi/string-input-visitor.c
+++ b/qapi/string-input-visitor.c
@@ -314,18 +314,6 @@ static void parse_type_number(Visitor *v, const char *name, double *obj,
*obj = val;
}
-static void parse_optional(Visitor *v, const char *name, bool *present)
-{
- StringInputVisitor *siv = to_siv(v);
-
- if (!siv->string) {
- *present = false;
- return;
- }
-
- *present = true;
-}
-
static void string_input_free(Visitor *v)
{
StringInputVisitor *siv = to_siv(v);
@@ -351,7 +339,6 @@ Visitor *string_input_visitor_new(const char *str)
v->visitor.start_list = start_list;
v->visitor.next_list = next_list;
v->visitor.end_list = end_list;
- v->visitor.optional = parse_optional;
v->visitor.free = string_input_free;
v->string = str;