From 7d66b00f293875c505e704ad9171ba1bd20c3c19 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sun, 10 Jul 2005 20:37:51 +0000 Subject: Whitespace normalization. --- Tools/bgen/bgen/bgenBuffer.py | 30 +++++++++++++++--------------- Tools/bgen/bgen/bgenGenerator.py | 4 ++-- Tools/bgen/bgen/bgenHeapBuffer.py | 4 ++-- Tools/bgen/bgen/bgenObjectDefinition.py | 2 +- Tools/bgen/bgen/bgenType.py | 10 +++++----- Tools/bgen/bgen/bgenVariable.py | 6 +++--- Tools/bgen/bgen/scantools.py | 2 +- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Tools/bgen/bgen/bgenBuffer.py b/Tools/bgen/bgen/bgenBuffer.py index a07e8f0..2d3209e 100644 --- a/Tools/bgen/bgen/bgenBuffer.py +++ b/Tools/bgen/bgen/bgenBuffer.py @@ -41,23 +41,23 @@ class FixedInputOutputBufferType(InputOnlyType): def getArgDeclarations(self, name, reference=False, constmode=False): if reference: raise RuntimeError, "Cannot pass buffer types by reference" - return (self.getBufferDeclarations(name, constmode) + + return (self.getBufferDeclarations(name, constmode) + self.getSizeDeclarations(name)) def getBufferDeclarations(self, name, constmode=False): return self.getInputBufferDeclarations(name, constmode) + \ - self.getOutputBufferDeclarations(name, constmode) + self.getOutputBufferDeclarations(name, constmode) def getInputBufferDeclarations(self, name, constmode=False): - if constmode: - const = "const " - else: - const = "" + if constmode: + const = "const " + else: + const = "" return ["%s%s *%s__in__" % (const, self.datatype, name)] def getOutputBufferDeclarations(self, name, constmode=False): - if constmode: - raise RuntimeError, "Cannot use const output buffer" + if constmode: + raise RuntimeError, "Cannot use const output buffer" return ["%s %s__out__[%s]" % (self.datatype, name, self.size)] def getSizeDeclarations(self, name): @@ -194,21 +194,21 @@ class StructInputOutputBufferType(FixedInputOutputBufferType): self.typeName = self.type = type def getInputBufferDeclarations(self, name, constmode=False): - if constmode: - const = "const " - else: - const = "" + if constmode: + const = "const " + else: + const = "" return ["%s%s *%s__in__" % (const, self.type, name)] def getSizeDeclarations(self, name): return [] - + def getAuxDeclarations(self, name): return ["int %s__in_len__" % (name)] def getOutputBufferDeclarations(self, name, constmode=False): - if constmode: - raise RuntimeError, "Cannot use const output buffer" + if constmode: + raise RuntimeError, "Cannot use const output buffer" return ["%s %s__out__" % (self.type, name)] def getargsArgs(self, name): diff --git a/Tools/bgen/bgen/bgenGenerator.py b/Tools/bgen/bgen/bgenGenerator.py index 7311ddc..0cf4002 100644 --- a/Tools/bgen/bgen/bgenGenerator.py +++ b/Tools/bgen/bgen/bgenGenerator.py @@ -32,7 +32,7 @@ class BaseFunctionGenerator: def checkgenerate(self): return True - + def generate(self): if not self.checkgenerate(): return @@ -234,7 +234,7 @@ class FunctionGenerator(BaseFunctionGenerator): return "%s = " % self.rv.name else: return "" - + def checkit(self): for arg in self.argumentList: arg.errorCheck() diff --git a/Tools/bgen/bgen/bgenHeapBuffer.py b/Tools/bgen/bgen/bgenHeapBuffer.py index c9c4232..002a260 100644 --- a/Tools/bgen/bgen/bgenHeapBuffer.py +++ b/Tools/bgen/bgen/bgenHeapBuffer.py @@ -17,8 +17,8 @@ class HeapInputOutputBufferType(FixedInputOutputBufferType): FixedInputOutputBufferType.__init__(self, "0", datatype, sizetype, sizeformat) def getOutputBufferDeclarations(self, name, constmode=False): - if constmode: - raise RuntimeError, "Cannot use const output buffer" + if constmode: + raise RuntimeError, "Cannot use const output buffer" return ["%s *%s__out__" % (self.datatype, name)] def getargsCheck(self, name): diff --git a/Tools/bgen/bgen/bgenObjectDefinition.py b/Tools/bgen/bgen/bgenObjectDefinition.py index da86c75..6fc65ad 100644 --- a/Tools/bgen/bgen/bgenObjectDefinition.py +++ b/Tools/bgen/bgen/bgenObjectDefinition.py @@ -220,7 +220,7 @@ class ObjectDefinition(GeneratorGroup): Output("""Py_INCREF(&%s);""", self.typename) Output("PyModule_AddObject(m, \"%s\", (PyObject *)&%s);", self.name, self.typename); self.outputTypeObjectInitializerCompat() - + def outputTypeObjectInitializerCompat(self): Output("/* Backward-compatible name */") Output("""Py_INCREF(&%s);""", self.typename); diff --git a/Tools/bgen/bgen/bgenType.py b/Tools/bgen/bgen/bgenType.py index 3cbd18f..f47d8ce 100644 --- a/Tools/bgen/bgen/bgenType.py +++ b/Tools/bgen/bgen/bgenType.py @@ -47,7 +47,7 @@ class Type: type, such as helper variables used to hold sizes, etc. These declarations are not part of the C/C++ function call interface.""" return [] - + def getargs(self): return self.getargsFormat(), self.getargsArgs() @@ -68,10 +68,10 @@ class Type: def getargsPreCheck(self, name): """Perform any actions needed before calling getargs(). - + This could include declaring temporary variables and such. """ - + def getargsCheck(self, name): """Perform any needed post-[new]getargs() checks. @@ -133,10 +133,10 @@ class Type: def mkvaluePreCheck(self, name): """Perform any actions needed before calling mkvalue(). - + This could include declaring temporary variables and such. """ - + def cleanup(self, name): """Clean up if necessary. diff --git a/Tools/bgen/bgen/bgenVariable.py b/Tools/bgen/bgen/bgenVariable.py index ef0e6d2..07679f8 100644 --- a/Tools/bgen/bgen/bgenVariable.py +++ b/Tools/bgen/bgen/bgenVariable.py @@ -48,10 +48,10 @@ class Variable: def getArgDeclarations(self, constmode=False): refmode = (self.flags & RefMode) if constmode: - constmode = (self.flags & ConstMode) + constmode = (self.flags & ConstMode) return self.type.getArgDeclarations(self.name, - reference=refmode, constmode=constmode) - + reference=refmode, constmode=constmode) + def getAuxDeclarations(self): return self.type.getAuxDeclarations(self.name) diff --git a/Tools/bgen/bgen/scantools.py b/Tools/bgen/bgen/scantools.py index 777a7dc..4cf1cf9 100644 --- a/Tools/bgen/bgen/scantools.py +++ b/Tools/bgen/bgen/scantools.py @@ -626,7 +626,7 @@ if missing: raise "Missing Types" def destination(self, type, name, arglist): return "FunctionGenerator", "functions" - + def generatemodifiers(self, classname, name, modifiers): pass -- cgit v0.12