]> git.cworth.org Git - apitrace/blobdiff - specs/scripts/cdecl.py
Specify constant array lengths as integers.
[apitrace] / specs / scripts / cdecl.py
index 4f3a6b9163f2f8501ead807ae01e5afefd1db7c1..613561c9f72fdd10d46f57a360e7428994b61513 100755 (executable)
@@ -275,7 +275,11 @@ class Parser:
             self.consume()
             length = self.consume()
             self.consume(']')
-            type = 'Array(%s, "%s")' % (type, length)
+            try:
+                int(length)
+            except ValueError:
+                length = "%s" % length
+            type = 'Array(%s, %s)' % (type, length)
         return type, name
 
     int_tokens = ('unsigned', 'signed', 'int', 'long', 'short', 'char')