]> git.cworth.org Git - apitrace/blobdiff - specs/stdapi.py
Allow float-based attrib_lists as found in WGL.
[apitrace] / specs / stdapi.py
index 5d5d57004a148d66a0e96885ed16f0dd266a71b6..5cf1a37def1295c08620014332487f5539298876 100644 (file)
@@ -272,14 +272,21 @@ class Array(Type):
 
 class AttribArray(Type):
 
-    def __init__(self, keyType, valueTypes, isConst = True):
+    def __init__(self, keyType, valueTypes, isConst = True, punType = None, terminator = '0'):
+        self.baseType = Int
+        if punType is not None:
+            self.baseType = punType
         if isConst:
-            Type.__init__(self, (Pointer(Const(Int))).expr)
+            Type.__init__(self, (Pointer(Const(self.baseType))).expr)
         else:
-            Type.__init__(self, (Pointer(Int)).expr)
-        self.type = (Pointer(Const(Int))) # for function prototypes and such
+            Type.__init__(self, (Pointer(self.baseType)).expr)
         self.keyType = keyType
         self.valueTypes = valueTypes
+        self.terminator = terminator
+        self.hasKeysWithoutValues = False
+        for key, value in valueTypes:
+            if value is None:
+                self.hasKeysWithoutValues = True
 
     def visit(self, visitor, *args, **kwargs):
         return visitor.visitAttribArray(self, *args, **kwargs)
@@ -796,7 +803,8 @@ class Traverser(Visitor):
 
     def visitAttribArray(self, attribs, *args, **kwargs):
         for key, valueType in attribs.valueTypes:
-            self.visit(valueType, *args, **kwargs)
+            if valueType is not None:
+                self.visit(valueType, *args, **kwargs)
 
     def visitBlob(self, array, *args, **kwargs):
         pass