X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=specs%2Fstdapi.py;h=5cf1a37def1295c08620014332487f5539298876;hb=edea899194c441353943c22577bc22bf0e64d187;hp=795f0cfa2776f7e7f24c7cf0803f85cad2e8f8b8;hpb=ba7bb0d584f82da2de0db2af720c037ca386c945;p=apitrace diff --git a/specs/stdapi.py b/specs/stdapi.py index 795f0cf..5cf1a37 100644 --- a/specs/stdapi.py +++ b/specs/stdapi.py @@ -272,11 +272,21 @@ class Array(Type): class AttribArray(Type): - def __init__(self, keyType, valueTypes): - Type.__init__(self, (Pointer(Const(Int))).expr) - self.type = (Pointer(Const(Int))) # for function prototypes and such + 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(self.baseType))).expr) + else: + 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) @@ -793,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