diff options
author | José Fonseca <[email protected]> | 2012-03-11 10:47:22 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2012-03-11 16:50:29 +0000 |
commit | 10d3b6500bc36c163bb13783848b201793d268d3 (patch) | |
tree | dd35ad67cc65cf1409510944aa719a5f174bfd4b | |
parent | 7221f52389f788f95ccf5816e2370b5a1acef7f7 (diff) |
glapi/gen: Add support for pointer types.
Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r-- | src/mapi/glapi/gen/gl_API.dtd | 1 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_XML.py | 1 | ||||
-rw-r--r-- | 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 30c646c9244..149a433ca7a 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 4dc2e8fa7fb..340a581f134 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 8ba7de48627..7836b2739aa 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: |