tools/spec: avoid shadowing variable 'type'
This commit is contained in:
parent
401b084306
commit
d288fe9b91
@ -178,12 +178,12 @@ class Bitmask(Type):
|
||||
assert node.tag == 'type'
|
||||
assert node.attrib['category'] == 'bitmask'
|
||||
|
||||
name = node.find('name').text
|
||||
type = node.find('type').text
|
||||
n = node.find('name').text
|
||||
t = node.find('type').text
|
||||
|
||||
super().__init__(name,depends=[type])
|
||||
super().__init__(n, depends=[t])
|
||||
|
||||
self.type = type
|
||||
self.type = t
|
||||
self.requires = node.attrib.get('requires')
|
||||
if self.requires:
|
||||
self.depends.append(self.requires)
|
||||
@ -207,17 +207,16 @@ class Handle(Type):
|
||||
assert node.tag == 'type'
|
||||
assert node.attrib['category'] == 'handle'
|
||||
|
||||
name = node.find('name').text
|
||||
type = node.find('type').text
|
||||
n = node.find('name').text
|
||||
t = node.find('type').text
|
||||
assert t
|
||||
|
||||
super().__init__(name, depends=[type])
|
||||
self.type = type
|
||||
super().__init__(n, depends=[t])
|
||||
self.type = t
|
||||
|
||||
parents = node.attrib.get('parent', None)
|
||||
self.parents = parents.split(',') if parents else []
|
||||
|
||||
assert type
|
||||
|
||||
def declare(self):
|
||||
return "struct %(name)s_t; using %(name)s = %(name)s_t*;" % {
|
||||
"name": self.name,
|
||||
@ -323,8 +322,8 @@ class POD(Type):
|
||||
self._members = []
|
||||
|
||||
for member in node.findall('./member'):
|
||||
type = member.find('type').text
|
||||
name = member.find('name').text
|
||||
t = member.find('type').text
|
||||
n = member.find('name').text
|
||||
|
||||
comment = member.find('comment')
|
||||
if not comment is None:
|
||||
@ -337,7 +336,7 @@ class POD(Type):
|
||||
#code = map(lambda x: "".join(x), code)
|
||||
#code = "".join(code)
|
||||
|
||||
self._members.append({'code': code, 'type': type, 'name': name})
|
||||
self._members.append({'code': code, 'type': t, 'name': n})
|
||||
|
||||
def declare(self):
|
||||
return "%(category)s %(name)s;" % {
|
||||
|
Loading…
Reference in New Issue
Block a user