[Mesa-dev] [PATCH 3/4] glapi/gen: Add support for pointer types.

jose.r.fonseca at gmail.com jose.r.fonseca at gmail.com
Sun Mar 11 03:47:22 PDT 2012


From: José Fonseca <jose.r.fonseca at gmail.com>

---
 src/mapi/glapi/gen/gl_API.dtd  |    1 +
 src/mapi/glapi/gen/gl_XML.py   |    1 +
 src/mapi/glapi/gen/typeexpr.py |    6 +++---
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_API.dtd b/src/mapi/glapi/gen/gl_API.dtd
index 30c646c..149a433 100644
--- a/src/mapi/glapi/gen/gl_API.dtd
+++ b/src/mapi/glapi/gen/gl_API.dtd
@@ -26,6 +26,7 @@
                    size                NMTOKEN #REQUIRED
 		   float               (true | false) "false"
 		   unsigned            (true | false) "false"
+		   pointer             (true | false) "false"
                    glx_name            NMTOKEN #IMPLIED>
 <!ATTLIST enum     name                NMTOKEN #REQUIRED
                    count               CDATA   #IMPLIED
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index 4dc2e8f..340a581 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -340,6 +340,7 @@ class gl_type( gl_item ):
 		tn.size = int( element.nsProp( "size", None ), 0 )
 		tn.integer = not is_attr_true( element, "float" )
 		tn.unsigned = is_attr_true( element, "unsigned" )
+		tn.pointer = is_attr_true( element, "pointer" )
 		tn.name = "GL" + self.name
 		te.set_base_type_node( tn )
 
diff --git a/src/mapi/glapi/gen/typeexpr.py b/src/mapi/glapi/gen/typeexpr.py
index 8ba7de4..7836b27 100644
--- a/src/mapi/glapi/gen/typeexpr.py
+++ b/src/mapi/glapi/gen/typeexpr.py
@@ -252,7 +252,7 @@ class type_expression:
 
 
 	def get_stack_size(self):
-		tn = self.expr[ len(self.expr) - 1 ]
+		tn = self.expr[ -1 ]
 
 		if tn.elements or tn.pointer:
 			return 4
@@ -263,12 +263,12 @@ class type_expression:
 
 
 	def is_pointer(self):
-		tn = self.expr[ len(self.expr) - 1 ]
+		tn = self.expr[ -1 ]
 		return tn.pointer
 
 
 	def format_string(self):
-		tn = self.expr[ len(self.expr) - 1 ]
+		tn = self.expr[ -1 ]
 		if tn.pointer:
 			return "%p"
 		elif not tn.integer:
-- 
1.7.9.1



More information about the mesa-dev mailing list