mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 19:10:57 +00:00
qapi: rename QAPISchemaEnumType.values to .members
Rename QAPISchemaEnumType.values and related variables to members. Makes sense ever since commit 93bda4dd4 changed .values from list of string to list of QAPISchemaMember. Obvious no-op. Backports commit 57516863644817ca59fab023e0c68d139929f3e0 from qemu
This commit is contained in:
parent
8f69c83634
commit
5998dbcd67
|
@ -1173,22 +1173,22 @@ class QAPISchemaBuiltinType(QAPISchemaType):
|
|||
|
||||
|
||||
class QAPISchemaEnumType(QAPISchemaType):
|
||||
def __init__(self, name, info, doc, ifcond, values, prefix):
|
||||
def __init__(self, name, info, doc, ifcond, members, prefix):
|
||||
QAPISchemaType.__init__(self, name, info, doc, ifcond)
|
||||
for v in values:
|
||||
assert isinstance(v, QAPISchemaMember)
|
||||
v.set_owner(name)
|
||||
for m in members:
|
||||
assert isinstance(m, QAPISchemaMember)
|
||||
m.set_owner(name)
|
||||
assert prefix is None or isinstance(prefix, str)
|
||||
self.values = values
|
||||
self.members = members
|
||||
self.prefix = prefix
|
||||
|
||||
def check(self, schema):
|
||||
QAPISchemaType.check(self, schema)
|
||||
seen = {}
|
||||
for v in self.values:
|
||||
v.check_clash(self.info, seen)
|
||||
for m in self.members:
|
||||
m.check_clash(self.info, seen)
|
||||
if self.doc:
|
||||
self.doc.connect_member(v)
|
||||
self.doc.connect_member(m)
|
||||
|
||||
def is_implicit(self):
|
||||
# See QAPISchema._make_implicit_enum_type() and ._def_predefineds()
|
||||
|
@ -1198,7 +1198,7 @@ class QAPISchemaEnumType(QAPISchemaType):
|
|||
return c_name(self.name)
|
||||
|
||||
def member_names(self):
|
||||
return [v.name for v in self.values]
|
||||
return [m.name for m in self.members]
|
||||
|
||||
def json_type(self):
|
||||
return 'string'
|
||||
|
@ -1415,9 +1415,9 @@ class QAPISchemaObjectTypeVariants(object):
|
|||
if self._tag_name: # flat union
|
||||
# branches that are not explicitly covered get an empty type
|
||||
cases = set([v.name for v in self.variants])
|
||||
for val in self.tag_member.type.values:
|
||||
if val.name not in cases:
|
||||
v = QAPISchemaObjectTypeVariant(val.name, 'q_empty')
|
||||
for m in self.tag_member.type.members:
|
||||
if m.name not in cases:
|
||||
v = QAPISchemaObjectTypeVariant(m.name, 'q_empty')
|
||||
v.set_owner(self.tag_member.owner)
|
||||
self.variants.append(v)
|
||||
for v in self.variants:
|
||||
|
|
Loading…
Reference in a new issue