]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111178: Fix function signatures in symtable.c (#130589)
authorVictor Stinner <vstinner@python.org>
Wed, 26 Feb 2025 20:35:24 +0000 (21:35 +0100)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2025 20:35:24 +0000 (21:35 +0100)
Python/symtable.c

index 873576183314e649bdd24a445e1e0360af46cb1c..4d6384f597f1f03ff72068f0bb801d62ea52c8fa 100644 (file)
@@ -163,15 +163,17 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
 }
 
 static PyObject *
-ste_repr(PySTEntryObject *ste)
+ste_repr(PyObject *op)
 {
+    PySTEntryObject *ste = (PySTEntryObject *)op;
     return PyUnicode_FromFormat("<symtable entry %U(%R), line %d>",
                                 ste->ste_name, ste->ste_id, ste->ste_loc.lineno);
 }
 
 static void
-ste_dealloc(PySTEntryObject *ste)
+ste_dealloc(PyObject *op)
 {
+    PySTEntryObject *ste = (PySTEntryObject *)op;
     ste->ste_table = NULL;
     Py_XDECREF(ste->ste_id);
     Py_XDECREF(ste->ste_name);
@@ -203,12 +205,12 @@ PyTypeObject PySTEntry_Type = {
     "symtable entry",
     sizeof(PySTEntryObject),
     0,
-    (destructor)ste_dealloc,                /* tp_dealloc */
-    0,                                      /* tp_vectorcall_offset */
-    0,                                         /* tp_getattr */
+    ste_dealloc,                                /* tp_dealloc */
+    0,                                          /* tp_vectorcall_offset */
+    0,                                          /* tp_getattr */
     0,                                          /* tp_setattr */
     0,                                          /* tp_as_async */
-    (reprfunc)ste_repr,                         /* tp_repr */
+    ste_repr,                                   /* tp_repr */
     0,                                          /* tp_as_number */
     0,                                          /* tp_as_sequence */
     0,                                          /* tp_as_mapping */