[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 23/49] qapi: rename allow_dict to allow_implicit
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v3 23/49] qapi: rename allow_dict to allow_implicit |
Date: |
Wed, 21 Mar 2018 12:51:45 +0100 |
This makes it a bit clearer what is the intent of the dictionnary for
the check_type() function, since there was some confusion on a
previous iteration of this series.
Suggested-by: Markus Armbruster <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
---
scripts/qapi/common.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 22ea286191..9eb2b0cc37 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -660,7 +660,7 @@ def check_if(expr, info):
def check_type(info, source, value, allow_array=False,
- allow_dict=False, allow_optional=False,
+ allow_implicit=False, allow_optional=False,
allow_metas=[]):
global all_names
@@ -687,7 +687,7 @@ def check_type(info, source, value, allow_array=False,
(source, all_names[value], value))
return
- if not allow_dict:
+ if not allow_implicit:
raise QAPISemError(info, "%s should be a type name" % source)
if not isinstance(value, OrderedDict):
@@ -717,7 +717,7 @@ def check_command(expr, info):
if boxed:
args_meta += ['union', 'alternate']
check_type(info, "'data' for command '%s'" % name,
- expr.get('data'), allow_dict=not boxed, allow_optional=True,
+ expr.get('data'), allow_implicit=not boxed, allow_optional=True,
allow_metas=args_meta)
returns_meta = ['union', 'struct']
if name in returns_whitelist:
@@ -735,7 +735,7 @@ def check_event(expr, info):
if boxed:
meta += ['union', 'alternate']
check_type(info, "'data' for event '%s'" % name,
- expr.get('data'), allow_dict=not boxed, allow_optional=True,
+ expr.get('data'), allow_implicit=not boxed, allow_optional=True,
allow_metas=meta)
@@ -763,7 +763,7 @@ def check_union(expr, info):
else:
# The object must have a string or dictionary 'base'.
check_type(info, "'base' for union '%s'" % name,
- base, allow_dict=True, allow_optional=True,
+ base, allow_implicit=True, allow_optional=True,
allow_metas=['struct'])
if not base:
raise QAPISemError(info, "Flat union '%s' must have a base"
@@ -894,7 +894,7 @@ def check_struct(expr, info):
members = expr['data']
check_type(info, "'data' for struct '%s'" % name, members,
- allow_dict=True, allow_optional=True)
+ allow_implicit=True, allow_optional=True)
check_type(info, "'base' for struct '%s'" % name, expr.get('base'),
allow_metas=['struct'])
--
2.16.2.521.g9aa15f885a
- [Qemu-devel] [PATCH v3 13/49] qapi-types: refactor variants handling, (continued)
- [Qemu-devel] [PATCH v3 13/49] qapi-types: refactor variants handling, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 14/49] qapi-types: add #if conditions to types & visitors, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 15/49] qapi: do not define enumeration value explicitely, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 16/49] qapi: rename QAPISchemaEnumType.values to .members, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 17/49] qapi: change enum visitor to take QAPISchemaMember, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 18/49] tests: modify visit_enum_type() in test-qapi to print members, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 19/49] qapi: factor out check_known_keys(), Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 20/49] qapi: add a dictionnary form with 'name' key for enum members, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 21/49] qapi: add 'if' to enum members, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 22/49] qapi-event: add 'if' condition to implicit event enum, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 23/49] qapi: rename allow_dict to allow_implicit,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v3 25/49] qapi: add 'if' to implicit struct members, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 24/49] qapi: add a dictionary form with 'type' key for members, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 26/49] qapi: add an error in case a discriminator is conditionnal, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 27/49] qapi: add 'if' on union members, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 28/49] qapi: add 'if' to alternate members, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 29/49] qapi: add #if conditions to generated code members, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 32/49] qapi2texi: add 'If:' condition to enum values, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 30/49] docs: document schema configuration, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 31/49] qapi2texi: add 'If:' section to generated documentation, Marc-André Lureau, 2018/03/21
- [Qemu-devel] [PATCH v3 33/49] qapi2texi: add 'If:' condition to struct members, Marc-André Lureau, 2018/03/21