Skip to content

Commit 355fea6

Browse files
Use booleans.
1 parent 06b0abd commit 355fea6

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Python/ast.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "pythonrun.h"
1212

1313
#include <assert.h>
14+
#include <stdbool.h>
1415

1516
static int validate_stmts(asdl_seq *);
1617
static int validate_exprs(asdl_seq *, expr_context_ty, int);
@@ -611,7 +612,7 @@ static stmt_ty ast_for_with_stmt(struct compiling *, const node *, int);
611612
static stmt_ty ast_for_for_stmt(struct compiling *, const node *, int);
612613

613614
/* Note different signature for ast_for_call */
614-
static expr_ty ast_for_call(struct compiling *, const node *, expr_ty, int);
615+
static expr_ty ast_for_call(struct compiling *, const node *, expr_ty, bool);
615616

616617
static PyObject *parsenumber(struct compiling *, const char *);
617618
static expr_ty parsestrplus(struct compiling *, const node *n);
@@ -1545,7 +1546,7 @@ ast_for_decorator(struct compiling *c, const node *n)
15451546
name_expr = NULL;
15461547
}
15471548
else {
1548-
d = ast_for_call(c, CHILD(n, 3), name_expr, 0);
1549+
d = ast_for_call(c, CHILD(n, 3), name_expr, false);
15491550
if (!d)
15501551
return NULL;
15511552
name_expr = NULL;
@@ -2368,7 +2369,7 @@ ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr)
23682369
return Call(left_expr, NULL, NULL, LINENO(n),
23692370
n->n_col_offset, c->c_arena);
23702371
else
2371-
return ast_for_call(c, CHILD(n, 1), left_expr, 1);
2372+
return ast_for_call(c, CHILD(n, 1), left_expr, true);
23722373
}
23732374
else if (TYPE(CHILD(n, 0)) == DOT) {
23742375
PyObject *attr_id = NEW_IDENTIFIER(CHILD(n, 1));
@@ -2705,7 +2706,7 @@ ast_for_expr(struct compiling *c, const node *n)
27052706
}
27062707

27072708
static expr_ty
2708-
ast_for_call(struct compiling *c, const node *n, expr_ty func, int allowgen)
2709+
ast_for_call(struct compiling *c, const node *n, expr_ty func, bool allowgen)
27092710
{
27102711
/*
27112712
arglist: argument (',' argument)* [',']
@@ -3977,7 +3978,7 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
39773978
if (!dummy_name)
39783979
return NULL;
39793980
dummy = Name(dummy_name, Load, LINENO(n), n->n_col_offset, c->c_arena);
3980-
call = ast_for_call(c, CHILD(n, 3), dummy, 0);
3981+
call = ast_for_call(c, CHILD(n, 3), dummy, false);
39813982
if (!call)
39823983
return NULL;
39833984
}

0 commit comments

Comments
 (0)