@@ -80,10 +80,8 @@ def outputStructMembers(self):
8080
8181 def outputNew (self ):
8282 Output ()
83- Output ("%sPyObject *%s_New(itself)" , self .static , self .prefix )
84- IndentLevel ()
85- Output ("%s %sitself;" , self .itselftype , self .argref )
86- DedentLevel ()
83+ Output ("%sPyObject *%s_New(%s %sitself)" , self .static , self .prefix ,
84+ self .itselftype , self .argref )
8785 OutLbrace ()
8886 Output ("%s *it;" , self .objecttype )
8987 self .outputCheckNewArg ()
@@ -100,11 +98,8 @@ def outputCheckNewArg(self):
10098 "Override this method to apply additional checks/conversions"
10199
102100 def outputConvert (self ):
103- Output ("%s%s_Convert(v, p_itself)" , self .static , self .prefix )
104- IndentLevel ()
105- Output ("PyObject *v;" )
106- Output ("%s *p_itself;" , self .itselftype )
107- DedentLevel ()
101+ Output ("%s%s_Convert(PyObject *v, %s *p_itself)" , self .static , self .prefix ,
102+ self .itselftype )
108103 OutLbrace ()
109104 self .outputCheckConvertArg ()
110105 Output ("if (!%s_Check(v))" , self .prefix )
@@ -121,10 +116,7 @@ def outputCheckConvertArg(self):
121116
122117 def outputDealloc (self ):
123118 Output ()
124- Output ("static void %s_dealloc(self)" , self .prefix )
125- IndentLevel ()
126- Output ("%s *self;" , self .objecttype )
127- DedentLevel ()
119+ Output ("static void %s_dealloc(%s *self)" , self .prefix , self .objecttype )
128120 OutLbrace ()
129121 self .outputCleanupStructMembers ()
130122 Output ("PyMem_DEL(self);" )
@@ -138,11 +130,7 @@ def outputFreeIt(self, name):
138130
139131 def outputGetattr (self ):
140132 Output ()
141- Output ("static PyObject *%s_getattr(self, name)" , self .prefix )
142- IndentLevel ()
143- Output ("%s *self;" , self .objecttype )
144- Output ("char *name;" )
145- DedentLevel ()
133+ Output ("static PyObject *%s_getattr(%s *self, char *name)" , self .prefix , self .objecttype )
146134 OutLbrace ()
147135 self .outputGetattrBody ()
148136 OutRbrace ()
@@ -226,10 +214,8 @@ class ObjectIdentityMixin:
226214
227215 def outputCompare (self ):
228216 Output ()
229- Output ("static int %s_compare(self, other)" , self .prefix )
230- IndentLevel ()
231- Output ("%s *self, *other;" , self .objecttype )
232- DedentLevel ()
217+ Output ("static int %s_compare(%s *self, %s *other)" , self .prefix , self .objecttype ,
218+ self .objecttype )
233219 OutLbrace ()
234220 Output ("unsigned long v, w;" )
235221 Output ()
@@ -250,10 +236,7 @@ def outputCompare(self):
250236
251237 def outputHash (self ):
252238 Output ()
253- Output ("static long %s_hash(self)" , self .prefix )
254- IndentLevel ()
255- Output ("%s *self;" , self .objecttype )
256- DedentLevel ()
239+ Output ("static long %s_hash(%s *self)" , self .prefix , self .objecttype )
257240 OutLbrace ()
258241 Output ("return (long)self->ob_itself;" )
259242 OutRbrace ()
0 commit comments