mirror of
https://github.com/xemu-project/xemu.git
synced 2025-01-31 00:53:10 +00:00
qapi/types.py: remove one-letter variables
"John, if pylint told you to jump off a bridge, would you?" Hey, if it looked like fun, I might. Now that this file is clean, enable pylint checks on this file. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20201009161558.107041-34-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
cd073c8fb0
commit
dec44d3d65
@ -6,7 +6,6 @@ ignore-patterns=error.py,
|
|||||||
expr.py,
|
expr.py,
|
||||||
parser.py,
|
parser.py,
|
||||||
schema.py,
|
schema.py,
|
||||||
types.py,
|
|
||||||
visit.py,
|
visit.py,
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,14 +49,14 @@ const QEnumLookup %(c_name)s_lookup = {
|
|||||||
.array = (const char *const[]) {
|
.array = (const char *const[]) {
|
||||||
''',
|
''',
|
||||||
c_name=c_name(name))
|
c_name=c_name(name))
|
||||||
for m in members:
|
for memb in members:
|
||||||
ret += gen_if(m.ifcond)
|
ret += gen_if(memb.ifcond)
|
||||||
index = c_enum_const(name, m.name, prefix)
|
index = c_enum_const(name, memb.name, prefix)
|
||||||
ret += mcgen('''
|
ret += mcgen('''
|
||||||
[%(index)s] = "%(name)s",
|
[%(index)s] = "%(name)s",
|
||||||
''',
|
''',
|
||||||
index=index, name=m.name)
|
index=index, name=memb.name)
|
||||||
ret += gen_endif(m.ifcond)
|
ret += gen_endif(memb.ifcond)
|
||||||
|
|
||||||
ret += mcgen('''
|
ret += mcgen('''
|
||||||
},
|
},
|
||||||
@ -79,13 +79,13 @@ typedef enum %(c_name)s {
|
|||||||
''',
|
''',
|
||||||
c_name=c_name(name))
|
c_name=c_name(name))
|
||||||
|
|
||||||
for m in enum_members:
|
for memb in enum_members:
|
||||||
ret += gen_if(m.ifcond)
|
ret += gen_if(memb.ifcond)
|
||||||
ret += mcgen('''
|
ret += mcgen('''
|
||||||
%(c_enum)s,
|
%(c_enum)s,
|
||||||
''',
|
''',
|
||||||
c_enum=c_enum_const(name, m.name, prefix))
|
c_enum=c_enum_const(name, memb.name, prefix))
|
||||||
ret += gen_endif(m.ifcond)
|
ret += gen_endif(memb.ifcond)
|
||||||
|
|
||||||
ret += mcgen('''
|
ret += mcgen('''
|
||||||
} %(c_name)s;
|
} %(c_name)s;
|
||||||
@ -148,11 +148,12 @@ def gen_object(name: str, ifcond: List[str],
|
|||||||
objects_seen.add(name)
|
objects_seen.add(name)
|
||||||
|
|
||||||
ret = ''
|
ret = ''
|
||||||
if variants:
|
for var in variants.variants if variants else ():
|
||||||
for v in variants.variants:
|
obj = var.type
|
||||||
if isinstance(v.type, QAPISchemaObjectType):
|
if not isinstance(obj, QAPISchemaObjectType):
|
||||||
ret += gen_object(v.type.name, v.type.ifcond, v.type.base,
|
continue
|
||||||
v.type.local_members, v.type.variants)
|
ret += gen_object(obj.name, obj.ifcond, obj.base,
|
||||||
|
obj.local_members, obj.variants)
|
||||||
|
|
||||||
ret += mcgen('''
|
ret += mcgen('''
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user