diff options
author | Victor Stinner <vstinner@python.org> | 2024-10-04 09:59:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-04 09:59:08 (GMT) |
commit | 6c7d5c6415fc22d35c7b8410533eb1831d46ba72 (patch) | |
tree | 08365be2b3861ec556d06d59642fe6c3bfaa79d8 /Python/Python-ast.c | |
parent | f66d785861d3a210f1b6b14ebd129728b24f95bf (diff) | |
download | cpython-6c7d5c6415fc22d35c7b8410533eb1831d46ba72.zip cpython-6c7d5c6415fc22d35c7b8410533eb1831d46ba72.tar.gz cpython-6c7d5c6415fc22d35c7b8410533eb1831d46ba72.tar.bz2 |
gh-111178: Fix function signatures in Python-ast.c (#124942)
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r-- | Python/Python-ast.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 860447e..4a58c09 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -19,7 +19,7 @@ struct validator { }; // Forward declaration -static int init_types(struct ast_state *state); +static int init_types(void *arg); static struct ast_state* get_ast_state(void) @@ -5044,8 +5044,9 @@ typedef struct { } AST_object; static void -ast_dealloc(AST_object *self) +ast_dealloc(PyObject *op) { + AST_object *self = (AST_object*)op; /* bpo-31095: UnTrack is needed before calling any callbacks */ PyTypeObject *tp = Py_TYPE(self); PyObject_GC_UnTrack(self); @@ -5057,16 +5058,18 @@ ast_dealloc(AST_object *self) } static int -ast_traverse(AST_object *self, visitproc visit, void *arg) +ast_traverse(PyObject *op, visitproc visit, void *arg) { + AST_object *self = (AST_object*)op; Py_VISIT(Py_TYPE(self)); Py_VISIT(self->dict); return 0; } static int -ast_clear(AST_object *self) +ast_clear(PyObject *op) { + AST_object *self = (AST_object*)op; Py_CLEAR(self->dict); return 0; } @@ -5852,9 +5855,9 @@ error: } static PyObject * -ast_repr(AST_object *self) +ast_repr(PyObject *self) { - return ast_repr_max_depth(self, 3); + return ast_repr_max_depth((AST_object*)self, 3); } static PyType_Slot AST_type_slots[] = { @@ -6047,8 +6050,9 @@ static int add_ast_fields(struct ast_state *state) static int -init_types(struct ast_state *state) +init_types(void *arg) { + struct ast_state *state = arg; if (init_identifiers(state) < 0) { return -1; } |