Minor refactoring and code tweaking. The only notable chage is that
authorIan Romanick <idr@us.ibm.com>
Thu, 17 Mar 2005 20:56:13 +0000 (20:56 +0000)
committerIan Romanick <idr@us.ibm.com>
Thu, 17 Mar 2005 20:56:13 +0000 (20:56 +0000)
FilterGLAPISpecBase::xref is replaced by
FilterGLAPISpecBase::functions_by_name.  The notable difference between the
two is that ::functions_by_name includes all functions, whether they have an
assigned offset or not.  This feature will be useful (necessary) when more
server-side code is generated.

src/mesa/glapi/glX_XML.py
src/mesa/glapi/gl_XML.py

index 3f6f841d78411e0cb75c2ac9ff9492d6a971efc4..98be9965704ea7248482bbee8d9e683570b2ad3a 100644 (file)
@@ -416,10 +416,9 @@ class glXFunction(gl_XML.glFunction):
 
 
        def variable_length_parameter(self):
-               for param in self.fn_parameters:
-                       if param.is_variable_length_array():
-                               return param
-                       
+               if len(self.variable_length_parameters):
+                       return self.variable_length_parameters[0]
+
                return None
 
 
index 3f87a5712a34c7f3136b86b9fed693f55980aded..1c4e734f85fd72ef84b28a4077394a41fbdf1ef2 100644 (file)
@@ -529,22 +529,18 @@ class glFunctionIterator:
 class FilterGLAPISpecBase(saxutils.XMLFilterBase):
        name = "a"
        license = "The license for this file is unspecified."
-       functions = {}
        next_alias = -2
-       types = {}
-       xref = {}
        current_object = None
-       factory = None
-       current_category = ""
 
        def __init__(self):
                saxutils.XMLFilterBase.__init__(self)
                self.functions = {}
                self.types = {}
-               self.xref = {}
+               self.functions_by_name = {}
                self.factory = glItemFactory()
                self.header_tag = None
                self.undef_list = []
+               self.current_category = ""
 
 
        def find_type(self,type_name):
@@ -556,8 +552,7 @@ class FilterGLAPISpecBase(saxutils.XMLFilterBase):
 
 
        def find_function(self,function_name):
-               index = self.xref[function_name]
-               return self.functions[index]
+               return self.functions_by_name[function_name]
 
 
        def functionIterator(self):
@@ -626,7 +621,9 @@ class FilterGLAPISpecBase(saxutils.XMLFilterBase):
                                        self.next_alias -= 1
 
                                self.functions[index] = obj
-                               self.xref[obj.name] = index
+
+                       self.functions_by_name[obj.name] = obj
+
                elif object_type == "type":
                        self.types[obj.name] = obj