Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 787cddc

Browse files
committed
Merged revisions 86545 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ........ r86545 | benjamin.peterson | 2010-11-19 22:31:07 -0600 (Fri, 19 Nov 2010) | 1 line new plan: functions that want 'tmp' can declare it ........
1 parent fdd52be commit 787cddc

2 files changed

Lines changed: 6 additions & 23 deletions

File tree

Parser/asdl_c.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,7 @@ def funcHeader(self, name):
365365
self.emit("int", 0)
366366
self.emit("obj2ast_%s(PyObject* obj, %s* out, PyArena* arena)" % (name, ctype), 0)
367367
self.emit("{", 0)
368-
self.emit("PyObject* tmp = NULL;", 1)
369368
self.emit("int isinstance;", 1)
370-
# Prevent compiler warnings about unused variable.
371-
self.emit("tmp = tmp;", 1)
372369
self.emit("", 0)
373370

374371
def sumTrailer(self, name, add_label=False):
@@ -403,6 +400,7 @@ def buildArgs(self, fields):
403400

404401
def complexSum(self, sum, name):
405402
self.funcHeader(name)
403+
self.emit("PyObject *tmp = NULL;", 1)
406404
for a in sum.attributes:
407405
self.visitAttributeDeclaration(a, name, sum=sum)
408406
self.emit("", 0)

Python/Python-ast.c

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,10 +3378,9 @@ ast2obj_alias(void* _o)
33783378
int
33793379
obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
33803380
{
3381-
PyObject* tmp = NULL;
33823381
int isinstance;
3383-
tmp = tmp;
33843382

3383+
PyObject *tmp = NULL;
33853384

33863385
if (obj == Py_None) {
33873386
*out = NULL;
@@ -3527,10 +3526,9 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
35273526
int
35283527
obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
35293528
{
3530-
PyObject* tmp = NULL;
35313529
int isinstance;
3532-
tmp = tmp;
35333530

3531+
PyObject *tmp = NULL;
35343532
int lineno;
35353533
int col_offset;
35363534

@@ -4724,10 +4722,9 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
47244722
int
47254723
obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
47264724
{
4727-
PyObject* tmp = NULL;
47284725
int isinstance;
4729-
tmp = tmp;
47304726

4727+
PyObject *tmp = NULL;
47314728
int lineno;
47324729
int col_offset;
47334730

@@ -5840,9 +5837,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
58405837
int
58415838
obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena)
58425839
{
5843-
PyObject* tmp = NULL;
58445840
int isinstance;
5845-
tmp = tmp;
58465841

58475842
isinstance = PyObject_IsInstance(obj, (PyObject *)Load_type);
58485843
if (isinstance == -1) {
@@ -5900,10 +5895,9 @@ obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena)
59005895
int
59015896
obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
59025897
{
5903-
PyObject* tmp = NULL;
59045898
int isinstance;
5905-
tmp = tmp;
59065899

5900+
PyObject *tmp = NULL;
59075901

59085902
if (obj == Py_None) {
59095903
*out = NULL;
@@ -6023,9 +6017,7 @@ obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
60236017
int
60246018
obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena)
60256019
{
6026-
PyObject* tmp = NULL;
60276020
int isinstance;
6028-
tmp = tmp;
60296021

60306022
isinstance = PyObject_IsInstance(obj, (PyObject *)And_type);
60316023
if (isinstance == -1) {
@@ -6051,9 +6043,7 @@ obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena)
60516043
int
60526044
obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena)
60536045
{
6054-
PyObject* tmp = NULL;
60556046
int isinstance;
6056-
tmp = tmp;
60576047

60586048
isinstance = PyObject_IsInstance(obj, (PyObject *)Add_type);
60596049
if (isinstance == -1) {
@@ -6159,9 +6149,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena)
61596149
int
61606150
obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena)
61616151
{
6162-
PyObject* tmp = NULL;
61636152
int isinstance;
6164-
tmp = tmp;
61656153

61666154
isinstance = PyObject_IsInstance(obj, (PyObject *)Invert_type);
61676155
if (isinstance == -1) {
@@ -6203,9 +6191,7 @@ obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena)
62036191
int
62046192
obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena)
62056193
{
6206-
PyObject* tmp = NULL;
62076194
int isinstance;
6208-
tmp = tmp;
62096195

62106196
isinstance = PyObject_IsInstance(obj, (PyObject *)Eq_type);
62116197
if (isinstance == -1) {
@@ -6359,10 +6345,9 @@ obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena)
63596345
int
63606346
obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
63616347
{
6362-
PyObject* tmp = NULL;
63636348
int isinstance;
6364-
tmp = tmp;
63656349

6350+
PyObject *tmp = NULL;
63666351
int lineno;
63676352
int col_offset;
63686353

0 commit comments

Comments
 (0)