summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/gl_XML.py
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-01-24 21:29:13 +0000
committerIan Romanick <[email protected]>2005-01-24 21:29:13 +0000
commit5ff2b94630e89da1586628f14eb869b513071154 (patch)
tree8f79ca30adeaf39f72d8bf1fdb5f041dca8e37d3 /src/mesa/glapi/gl_XML.py
parent0246b2a5c0f45788a5c418d62ccf5a3a72d16d4a (diff)
Remove glEnum::startElement, but refactor out some of the common code from
there and glXEnum::startElement to glEnum::process_attributes.
Diffstat (limited to 'src/mesa/glapi/gl_XML.py')
-rw-r--r--src/mesa/glapi/gl_XML.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py
index 538756ea0c2..bc7d27befe3 100644
--- a/src/mesa/glapi/gl_XML.py
+++ b/src/mesa/glapi/gl_XML.py
@@ -86,18 +86,21 @@ class glEnum( glItem ):
def __init__(self, context, name, attrs):
self.value = int(attrs.get('value', "0x0000"), 0)
- self.functions = {}
enum_name = "GL_" + attrs.get('name', None)
glItem.__init__(self, name, enum_name, context)
- def startElement(self, name, attrs):
- if name == "size":
- name = attrs.get('name', None)
- count = int(attrs.get('count', "0"), 0)
- self.functions[name] = count
- return
+ def process_attributes(self, attrs):
+ name = attrs.get('name', None)
+
+ temp = attrs.get('count', None)
+ try:
+ c = int(temp)
+ except Exception,e:
+ raise RuntimeError('Invalid count value "%s" for enum "%s" in function "%s" when an integer was expected.' % (temp, self.name, n))
+
+ return [name, c]
class glType( glItem ):