gh-91320: Use _PyCFunction_CAST() (#92251)

Replace "(PyCFunction)(void(*)(void))func" cast with
_PyCFunction_CAST(func).

Change generated by the command:

sed -i -e \
  's!(PyCFunction)(void(\*)(void)) *\([A-Za-z0-9_]\+\)!_PyCFunction_CAST(\1)!g' \
  $(find -name "*.c")
This commit is contained in:
Victor Stinner 2022-05-03 21:42:14 +02:00 committed by GitHub
parent 551d02b3e6
commit 804f2529d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 146 additions and 146 deletions

View file

@ -1704,11 +1704,11 @@ PyDoc_STRVAR(csv_register_dialect_doc,
" dialect = csv.register_dialect(name[, dialect[, **fmtparams]])");
static struct PyMethodDef csv_methods[] = {
{ "reader", (PyCFunction)(void(*)(void))csv_reader,
{ "reader", _PyCFunction_CAST(csv_reader),
METH_VARARGS | METH_KEYWORDS, csv_reader_doc},
{ "writer", (PyCFunction)(void(*)(void))csv_writer,
{ "writer", _PyCFunction_CAST(csv_writer),
METH_VARARGS | METH_KEYWORDS, csv_writer_doc},
{ "register_dialect", (PyCFunction)(void(*)(void))csv_register_dialect,
{ "register_dialect", _PyCFunction_CAST(csv_register_dialect),
METH_VARARGS | METH_KEYWORDS, csv_register_dialect_doc},
_CSV_LIST_DIALECTS_METHODDEF
_CSV_UNREGISTER_DIALECT_METHODDEF