]> granicus.if.org Git - python/commitdiff
Whitespace normalization.
authorTim Peters <tim.peters@gmail.com>
Sun, 10 Jul 2005 20:37:51 +0000 (20:37 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 10 Jul 2005 20:37:51 +0000 (20:37 +0000)
Tools/bgen/bgen/bgenBuffer.py
Tools/bgen/bgen/bgenGenerator.py
Tools/bgen/bgen/bgenHeapBuffer.py
Tools/bgen/bgen/bgenObjectDefinition.py
Tools/bgen/bgen/bgenType.py
Tools/bgen/bgen/bgenVariable.py
Tools/bgen/bgen/scantools.py

index a07e8f0e92ab19ff63b8a9bcab7220afcd16257a..2d3209e3726c694e5c2153fa3410f7c069bb31ad 100644 (file)
@@ -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):
index 7311ddc1f878d49d871c95643e2a0c628c80c866..0cf4002cab7b616e1c9f9df14e75d435b3ade59c 100644 (file)
@@ -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()
index c9c4232a734d79cc50b7981c844caf26bdf49ce4..002a2606f6e4a682a23da4ef5e8d66ef0726ea9b 100644 (file)
@@ -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):
index da86c75d7f5455b29b99a08961c340e327114bf1..6fc65ad3bd70dd75ff41f3f6fc81e725442c7eab 100644 (file)
@@ -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);
index 3cbd18ffd5e3689cfd267754900ea4bb42a0cf1e..f47d8ce9cce0b0894e24ae4d825072a2f082f5df 100644 (file)
@@ -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.
 
index ef0e6d2a3eb554b17a50a619c6bd97fa68c24d2b..07679f8c9c96fdc953194866cc5a11061dc33884 100644 (file)
@@ -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)
 
index 777a7dcda400e1fa113e3812c80b910e458a5319..4cf1cf97c84661e2f48a10401e86131f78860eab 100644 (file)
@@ -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