Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ struct compiler {
static int compiler_enter_scope(struct compiler *, identifier, int, void *, int);
static void compiler_free(struct compiler *);
static basicblock *compiler_new_block(struct compiler *);
static int compiler_next_instr(struct compiler *, basicblock *);
static int compiler_next_instr(basicblock *);
static int compiler_addop(struct compiler *, int);
static int compiler_addop_i(struct compiler *, int, Py_ssize_t);
static int compiler_addop_j(struct compiler *, int, basicblock *, int);
Expand All @@ -196,7 +196,7 @@ static int compiler_annassign(struct compiler *, stmt_ty);
static int compiler_visit_slice(struct compiler *, slice_ty,
expr_context_ty);

static int inplace_binop(struct compiler *, operator_ty);
static int inplace_binop(operator_ty);
static int are_all_items_const(asdl_seq *, Py_ssize_t, Py_ssize_t);
static int expr_constant(expr_ty);

Expand Down Expand Up @@ -803,7 +803,7 @@ compiler_use_next_block(struct compiler *c, basicblock *block)
*/

static int
compiler_next_instr(struct compiler *c, basicblock *b)
compiler_next_instr(basicblock *b)
{
assert(b != NULL);
if (b->b_instr == NULL) {
Expand Down Expand Up @@ -1159,7 +1159,7 @@ compiler_addop(struct compiler *c, int opcode)
if (c->c_do_not_emit_bytecode) {
return 1;
}
off = compiler_next_instr(c, c->u->u_curblock);
off = compiler_next_instr(c->u->u_curblock);
if (off < 0)
return 0;
b = c->u->u_curblock;
Expand All @@ -1173,7 +1173,7 @@ compiler_addop(struct compiler *c, int opcode)
}

static Py_ssize_t
compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
compiler_add_o(PyObject *dict, PyObject *o)
{
PyObject *v;
Py_ssize_t arg;
Expand Down Expand Up @@ -1321,7 +1321,7 @@ compiler_add_const(struct compiler *c, PyObject *o)
return -1;
}

Py_ssize_t arg = compiler_add_o(c, c->u->u_consts, key);
Py_ssize_t arg = compiler_add_o(c->u->u_consts, key);
Py_DECREF(key);
return arg;
}
Expand All @@ -1347,7 +1347,7 @@ compiler_addop_o(struct compiler *c, int opcode, PyObject *dict,
return 1;
}

Py_ssize_t arg = compiler_add_o(c, dict, o);
Py_ssize_t arg = compiler_add_o(dict, o);
if (arg < 0)
return 0;
return compiler_addop_i(c, opcode, arg);
Expand All @@ -1366,7 +1366,7 @@ compiler_addop_name(struct compiler *c, int opcode, PyObject *dict,
PyObject *mangled = _Py_Mangle(c->u->u_private, o);
if (!mangled)
return 0;
arg = compiler_add_o(c, dict, mangled);
arg = compiler_add_o(dict, mangled);
Py_DECREF(mangled);
if (arg < 0)
return 0;
Expand Down Expand Up @@ -1397,7 +1397,7 @@ compiler_addop_i(struct compiler *c, int opcode, Py_ssize_t oparg)
assert(HAS_ARG(opcode));
assert(0 <= oparg && oparg <= 2147483647);

off = compiler_next_instr(c, c->u->u_curblock);
off = compiler_next_instr(c->u->u_curblock);
if (off < 0)
return 0;
i = &c->u->u_curblock->b_instr[off];
Expand All @@ -1419,7 +1419,7 @@ compiler_addop_j(struct compiler *c, int opcode, basicblock *b, int absolute)

assert(HAS_ARG(opcode));
assert(b != NULL);
off = compiler_next_instr(c, c->u->u_curblock);
off = compiler_next_instr(c->u->u_curblock);
if (off < 0)
return 0;
i = &c->u->u_curblock->b_instr[off];
Expand Down Expand Up @@ -3439,7 +3439,7 @@ unaryop(unaryop_ty op)
}

static int
binop(struct compiler *c, operator_ty op)
binop(operator_ty op)
{
switch (op) {
case Add:
Expand Down Expand Up @@ -3476,7 +3476,7 @@ binop(struct compiler *c, operator_ty op)
}

static int
inplace_binop(struct compiler *c, operator_ty op)
inplace_binop(operator_ty op)
{
switch (op) {
case Add:
Expand Down Expand Up @@ -3637,7 +3637,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
}

assert(op);
arg = compiler_add_o(c, dict, mangled);
arg = compiler_add_o(dict, mangled);
Py_DECREF(mangled);
if (arg < 0)
return 0;
Expand Down Expand Up @@ -4964,7 +4964,7 @@ compiler_visit_expr1(struct compiler *c, expr_ty e)
case BinOp_kind:
VISIT(c, expr, e->v.BinOp.left);
VISIT(c, expr, e->v.BinOp.right);
ADDOP(c, binop(c, e->v.BinOp.op));
ADDOP(c, binop(e->v.BinOp.op));
break;
case UnaryOp_kind:
VISIT(c, expr, e->v.UnaryOp.operand);
Expand Down Expand Up @@ -5162,7 +5162,7 @@ compiler_augassign(struct compiler *c, stmt_ty s)
return 0;
VISIT(c, expr, auge);
VISIT(c, expr, s->v.AugAssign.value);
ADDOP(c, inplace_binop(c, s->v.AugAssign.op));
ADDOP(c, inplace_binop(s->v.AugAssign.op));
auge->v.Attribute.ctx = AugStore;
VISIT(c, expr, auge);
break;
Expand All @@ -5174,15 +5174,15 @@ compiler_augassign(struct compiler *c, stmt_ty s)
return 0;
VISIT(c, expr, auge);
VISIT(c, expr, s->v.AugAssign.value);
ADDOP(c, inplace_binop(c, s->v.AugAssign.op));
ADDOP(c, inplace_binop(s->v.AugAssign.op));
auge->v.Subscript.ctx = AugStore;
VISIT(c, expr, auge);
break;
case Name_kind:
if (!compiler_nameop(c, e->v.Name.id, Load))
return 0;
VISIT(c, expr, s->v.AugAssign.value);
ADDOP(c, inplace_binop(c, s->v.AugAssign.op));
ADDOP(c, inplace_binop(s->v.AugAssign.op));
return compiler_nameop(c, e->v.Name.id, Store);
default:
PyErr_Format(PyExc_SystemError,
Expand Down