diff options
author | Victor Stinner <vstinner@python.org> | 2022-05-03 19:42:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 19:42:14 (GMT) |
commit | 804f2529d8e545a8d59eaf260ee032d014e681ba (patch) | |
tree | aab0f479960e57753df3789313363dd0e3e6bafc /Modules/_struct.c | |
parent | 551d02b3e697098236bb3a6e0a855b2ad8dc0424 (diff) | |
download | cpython-804f2529d8e545a8d59eaf260ee032d014e681ba.zip cpython-804f2529d8e545a8d59eaf260ee032d014e681ba.tar.gz cpython-804f2529d8e545a8d59eaf260ee032d014e681ba.tar.bz2 |
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")
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r-- | Modules/_struct.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c index 7cd0ef8..4daf952 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -2049,8 +2049,8 @@ s_sizeof(PyStructObject *self, void *unused) static struct PyMethodDef s_methods[] = { STRUCT_ITER_UNPACK_METHODDEF - {"pack", (PyCFunction)(void(*)(void))s_pack, METH_FASTCALL, s_pack__doc__}, - {"pack_into", (PyCFunction)(void(*)(void))s_pack_into, METH_FASTCALL, s_pack_into__doc__}, + {"pack", _PyCFunction_CAST(s_pack), METH_FASTCALL, s_pack__doc__}, + {"pack_into", _PyCFunction_CAST(s_pack_into), METH_FASTCALL, s_pack_into__doc__}, STRUCT_UNPACK_METHODDEF STRUCT_UNPACK_FROM_METHODDEF {"__sizeof__", (PyCFunction)s_sizeof, METH_NOARGS, s_sizeof__doc__}, @@ -2298,8 +2298,8 @@ static struct PyMethodDef module_functions[] = { _CLEARCACHE_METHODDEF CALCSIZE_METHODDEF ITER_UNPACK_METHODDEF - {"pack", (PyCFunction)(void(*)(void))pack, METH_FASTCALL, pack_doc}, - {"pack_into", (PyCFunction)(void(*)(void))pack_into, METH_FASTCALL, pack_into_doc}, + {"pack", _PyCFunction_CAST(pack), METH_FASTCALL, pack_doc}, + {"pack_into", _PyCFunction_CAST(pack_into), METH_FASTCALL, pack_into_doc}, UNPACK_METHODDEF UNPACK_FROM_METHODDEF {NULL, NULL} /* sentinel */ |