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