closes bpo-39922: Remove unused args from four functions. (GH-18893)

This commit is contained in:
Andy Lester 2020-03-10 21:18:12 -05:00 committed by GitHub
parent bd87a7fda0
commit 76d5877b72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 17 deletions

View File

@ -179,7 +179,7 @@ struct compiler {
static int compiler_enter_scope(struct compiler *, identifier, int, void *, int); static int compiler_enter_scope(struct compiler *, identifier, int, void *, int);
static void compiler_free(struct compiler *); static void compiler_free(struct compiler *);
static basicblock *compiler_new_block(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(struct compiler *, int);
static int compiler_addop_i(struct compiler *, int, Py_ssize_t); static int compiler_addop_i(struct compiler *, int, Py_ssize_t);
static int compiler_addop_j(struct compiler *, int, basicblock *, int); static int compiler_addop_j(struct compiler *, int, basicblock *, int);
@ -196,7 +196,7 @@ static int compiler_annassign(struct compiler *, stmt_ty);
static int compiler_subscript(struct compiler *, expr_ty); static int compiler_subscript(struct compiler *, expr_ty);
static int compiler_slice(struct compiler *, expr_ty); static int compiler_slice(struct compiler *, expr_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 are_all_items_const(asdl_seq *, Py_ssize_t, Py_ssize_t);
static int expr_constant(expr_ty); static int expr_constant(expr_ty);
@ -803,7 +803,7 @@ compiler_use_next_block(struct compiler *c, basicblock *block)
*/ */
static int static int
compiler_next_instr(struct compiler *c, basicblock *b) compiler_next_instr(basicblock *b)
{ {
assert(b != NULL); assert(b != NULL);
if (b->b_instr == NULL) { if (b->b_instr == NULL) {
@ -1159,7 +1159,7 @@ compiler_addop(struct compiler *c, int opcode)
if (c->c_do_not_emit_bytecode) { if (c->c_do_not_emit_bytecode) {
return 1; return 1;
} }
off = compiler_next_instr(c, c->u->u_curblock); off = compiler_next_instr(c->u->u_curblock);
if (off < 0) if (off < 0)
return 0; return 0;
b = c->u->u_curblock; b = c->u->u_curblock;
@ -1173,7 +1173,7 @@ compiler_addop(struct compiler *c, int opcode)
} }
static Py_ssize_t static Py_ssize_t
compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o) compiler_add_o(PyObject *dict, PyObject *o)
{ {
PyObject *v; PyObject *v;
Py_ssize_t arg; Py_ssize_t arg;
@ -1321,7 +1321,7 @@ compiler_add_const(struct compiler *c, PyObject *o)
return -1; 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); Py_DECREF(key);
return arg; return arg;
} }
@ -1347,7 +1347,7 @@ compiler_addop_o(struct compiler *c, int opcode, PyObject *dict,
return 1; return 1;
} }
Py_ssize_t arg = compiler_add_o(c, dict, o); Py_ssize_t arg = compiler_add_o(dict, o);
if (arg < 0) if (arg < 0)
return 0; return 0;
return compiler_addop_i(c, opcode, arg); return compiler_addop_i(c, opcode, arg);
@ -1366,7 +1366,7 @@ compiler_addop_name(struct compiler *c, int opcode, PyObject *dict,
PyObject *mangled = _Py_Mangle(c->u->u_private, o); PyObject *mangled = _Py_Mangle(c->u->u_private, o);
if (!mangled) if (!mangled)
return 0; return 0;
arg = compiler_add_o(c, dict, mangled); arg = compiler_add_o(dict, mangled);
Py_DECREF(mangled); Py_DECREF(mangled);
if (arg < 0) if (arg < 0)
return 0; return 0;
@ -1397,7 +1397,7 @@ compiler_addop_i(struct compiler *c, int opcode, Py_ssize_t oparg)
assert(HAS_ARG(opcode)); assert(HAS_ARG(opcode));
assert(0 <= oparg && oparg <= 2147483647); 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) if (off < 0)
return 0; return 0;
i = &c->u->u_curblock->b_instr[off]; i = &c->u->u_curblock->b_instr[off];
@ -1419,7 +1419,7 @@ compiler_addop_j(struct compiler *c, int opcode, basicblock *b, int absolute)
assert(HAS_ARG(opcode)); assert(HAS_ARG(opcode));
assert(b != NULL); assert(b != NULL);
off = compiler_next_instr(c, c->u->u_curblock); off = compiler_next_instr(c->u->u_curblock);
if (off < 0) if (off < 0)
return 0; return 0;
i = &c->u->u_curblock->b_instr[off]; i = &c->u->u_curblock->b_instr[off];
@ -3439,7 +3439,7 @@ unaryop(unaryop_ty op)
} }
static int static int
binop(struct compiler *c, operator_ty op) binop(operator_ty op)
{ {
switch (op) { switch (op) {
case Add: case Add:
@ -3476,7 +3476,7 @@ binop(struct compiler *c, operator_ty op)
} }
static int static int
inplace_binop(struct compiler *c, operator_ty op) inplace_binop(operator_ty op)
{ {
switch (op) { switch (op) {
case Add: case Add:
@ -3637,7 +3637,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
} }
assert(op); assert(op);
arg = compiler_add_o(c, dict, mangled); arg = compiler_add_o(dict, mangled);
Py_DECREF(mangled); Py_DECREF(mangled);
if (arg < 0) if (arg < 0)
return 0; return 0;
@ -4961,7 +4961,7 @@ compiler_visit_expr1(struct compiler *c, expr_ty e)
case BinOp_kind: case BinOp_kind:
VISIT(c, expr, e->v.BinOp.left); VISIT(c, expr, e->v.BinOp.left);
VISIT(c, expr, e->v.BinOp.right); VISIT(c, expr, e->v.BinOp.right);
ADDOP(c, binop(c, e->v.BinOp.op)); ADDOP(c, binop(e->v.BinOp.op));
break; break;
case UnaryOp_kind: case UnaryOp_kind:
VISIT(c, expr, e->v.UnaryOp.operand); VISIT(c, expr, e->v.UnaryOp.operand);
@ -5130,7 +5130,7 @@ compiler_augassign(struct compiler *c, stmt_ty s)
return 0; return 0;
VISIT(c, expr, auge); VISIT(c, expr, auge);
VISIT(c, expr, s->v.AugAssign.value); 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; auge->v.Attribute.ctx = AugStore;
VISIT(c, expr, auge); VISIT(c, expr, auge);
break; break;
@ -5142,7 +5142,7 @@ compiler_augassign(struct compiler *c, stmt_ty s)
return 0; return 0;
VISIT(c, expr, auge); VISIT(c, expr, auge);
VISIT(c, expr, s->v.AugAssign.value); 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; auge->v.Subscript.ctx = AugStore;
VISIT(c, expr, auge); VISIT(c, expr, auge);
break; break;
@ -5150,7 +5150,7 @@ compiler_augassign(struct compiler *c, stmt_ty s)
if (!compiler_nameop(c, e->v.Name.id, Load)) if (!compiler_nameop(c, e->v.Name.id, Load))
return 0; return 0;
VISIT(c, expr, s->v.AugAssign.value); 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); return compiler_nameop(c, e->v.Name.id, Store);
default: default:
PyErr_Format(PyExc_SystemError, PyErr_Format(PyExc_SystemError,