summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-11-20 04:31:07 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-11-20 04:31:07 (GMT)
commitd8f65973185f3603f4079f189eee6ec22d1ebcf5 (patch)
tree5aeaac045988f228b6aa38dbe1242bbb7768da05 /Parser
parentb304d0b46f69b16f73b429293a606253cc4c35d3 (diff)
downloadcpython-d8f65973185f3603f4079f189eee6ec22d1ebcf5.zip
cpython-d8f65973185f3603f4079f189eee6ec22d1ebcf5.tar.gz
cpython-d8f65973185f3603f4079f189eee6ec22d1ebcf5.tar.bz2
new plan: functions that want 'tmp' can declare it
Diffstat (limited to 'Parser')
-rwxr-xr-xParser/asdl_c.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 60b53e9..c5fd365 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -365,10 +365,7 @@ class Obj2ModVisitor(PickleVisitor):
self.emit("int", 0)
self.emit("obj2ast_%s(PyObject* obj, %s* out, PyArena* arena)" % (name, ctype), 0)
self.emit("{", 0)
- self.emit("PyObject* tmp = NULL;", 1)
self.emit("int isinstance;", 1)
- # Prevent compiler warnings about unused variable.
- self.emit("tmp = tmp;", 1)
self.emit("", 0)
def sumTrailer(self, name, add_label=False):
@@ -403,6 +400,7 @@ class Obj2ModVisitor(PickleVisitor):
def complexSum(self, sum, name):
self.funcHeader(name)
+ self.emit("PyObject *tmp = NULL;", 1)
for a in sum.attributes:
self.visitAttributeDeclaration(a, name, sum=sum)
self.emit("", 0)