From ea6e46b51856f50af2591389e496c46117389aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Thu, 20 Mar 2025 17:58:29 +0100 Subject: [PATCH 01/12] remove unused casts by clinic --- Lib/test/clinic.test.c | 76 +++---- Lib/test/test_clinic.py | 8 +- Modules/_ctypes/clinic/callproc.c.h | 6 +- Modules/_io/clinic/bufferedio.c.h | 36 ++-- Modules/_io/clinic/bytesio.c.h | 24 +-- Modules/_io/clinic/fileio.c.h | 16 +- Modules/_io/clinic/iobase.c.h | 20 +- Modules/_io/clinic/stringio.c.h | 20 +- Modules/_io/clinic/textio.c.h | 28 +-- Modules/_io/clinic/winconsoleio.c.h | 12 +- .../clinic/multiprocessing.c.h | 6 +- .../_multiprocessing/clinic/posixshmem.c.h | 4 +- Modules/_multiprocessing/clinic/semaphore.c.h | 18 +- Modules/_sqlite/clinic/blob.c.h | 10 +- Modules/_sqlite/clinic/connection.c.h | 20 +- Modules/_sqlite/clinic/cursor.c.h | 12 +- Modules/_sqlite/clinic/module.c.h | 4 +- Modules/_sqlite/clinic/row.c.h | 4 +- Modules/_sre/clinic/sre.c.h | 20 +- Modules/_ssl/clinic/cert.c.h | 4 +- Modules/_testcapi/clinic/exceptions.c.h | 8 +- Modules/_testcapi/clinic/file.c.h | 4 +- Modules/_testcapi/clinic/long.c.h | 4 +- Modules/_testcapi/clinic/vectorcall.c.h | 6 +- Modules/_testclinic.c | 46 +++-- Modules/_testlimitedcapi/clinic/file.c.h | 4 +- Modules/_testlimitedcapi/clinic/long.c.h | 18 +- .../clinic/vectorcall_limited.c.h | 6 +- Modules/cjkcodecs/clinic/multibytecodec.c.h | 18 +- Modules/clinic/_abc.c.h | 12 +- Modules/clinic/_asynciomodule.c.h | 36 ++-- Modules/clinic/_bz2module.c.h | 6 +- Modules/clinic/_codecsmodule.c.h | 14 +- Modules/clinic/_collectionsmodule.c.h | 32 +-- Modules/clinic/_contextvarsmodule.c.h | 4 +- Modules/clinic/_csv.c.h | 4 +- Modules/clinic/_curses_panel.c.h | 18 +- Modules/clinic/_cursesmodule.c.h | 188 +++++++++--------- Modules/clinic/_datetimemodule.c.h | 4 +- Modules/clinic/_dbmmodule.c.h | 4 +- Modules/clinic/_elementtree.c.h | 32 +-- Modules/clinic/_functoolsmodule.c.h | 6 +- Modules/clinic/_gdbmmodule.c.h | 4 +- Modules/clinic/_hashopenssl.c.h | 18 +- Modules/clinic/_heapqmodule.c.h | 10 +- Modules/clinic/_localemodule.c.h | 16 +- Modules/clinic/_lsprof.c.h | 6 +- Modules/clinic/_lzmamodule.c.h | 8 +- Modules/clinic/_opcode.c.h | 12 +- Modules/clinic/_operator.c.h | 22 +- Modules/clinic/_pickle.c.h | 20 +- Modules/clinic/_queuemodule.c.h | 6 +- Modules/clinic/_randommodule.c.h | 10 +- Modules/clinic/_ssl.c.h | 58 +++--- Modules/clinic/_struct.c.h | 10 +- Modules/clinic/_sysconfig.c.h | 4 +- Modules/clinic/_testclinic.c.h | 152 ++++++++------ Modules/clinic/_testclinic_limited.c.h | 8 +- Modules/clinic/_testinternalcapi.c.h | 6 +- Modules/clinic/_threadmodule.c.h | 4 +- Modules/clinic/_tkinter.c.h | 50 ++--- Modules/clinic/_tracemalloc.c.h | 20 +- Modules/clinic/_typingmodule.c.h | 4 +- Modules/clinic/_weakref.c.h | 6 +- Modules/clinic/_winapi.c.h | 32 +-- Modules/clinic/arraymodule.c.h | 36 ++-- Modules/clinic/binascii.c.h | 8 +- Modules/clinic/blake2module.c.h | 10 +- Modules/clinic/cmathmodule.c.h | 42 ++-- Modules/clinic/gcmodule.c.h | 30 +-- Modules/clinic/grpmodule.c.h | 4 +- Modules/clinic/itertoolsmodule.c.h | 4 +- Modules/clinic/mathmodule.c.h | 34 ++-- Modules/clinic/md5module.c.h | 8 +- Modules/clinic/overlapped.c.h | 16 +- Modules/clinic/posixmodule.c.h | 162 +++++++-------- Modules/clinic/pwdmodule.c.h | 8 +- Modules/clinic/pyexpat.c.h | 16 +- Modules/clinic/readline.c.h | 38 ++-- Modules/clinic/resource.c.h | 8 +- Modules/clinic/selectmodule.c.h | 28 +-- Modules/clinic/sha1module.c.h | 8 +- Modules/clinic/sha2module.c.h | 14 +- Modules/clinic/sha3module.c.h | 14 +- Modules/clinic/signalmodule.c.h | 22 +- Modules/clinic/socketmodule.c.h | 14 +- Modules/clinic/syslogmodule.c.h | 12 +- Modules/clinic/termios.c.h | 8 +- Modules/clinic/timemodule.c.h | 6 +- Modules/clinic/unicodedata.c.h | 16 +- Objects/clinic/bytearrayobject.c.h | 32 +-- Objects/clinic/bytesobject.c.h | 16 +- Objects/clinic/classobject.c.h | 4 +- Objects/clinic/complexobject.c.h | 12 +- Objects/clinic/dictobject.c.h | 20 +- Objects/clinic/exceptions.c.h | 16 +- Objects/clinic/floatobject.c.h | 26 +-- Objects/clinic/listobject.c.h | 20 +- Objects/clinic/longobject.c.h | 16 +- Objects/clinic/memoryobject.c.h | 10 +- Objects/clinic/setobject.c.h | 32 +-- Objects/clinic/tupleobject.c.h | 6 +- Objects/clinic/typeobject.c.h | 26 +-- Objects/clinic/typevarobject.c.h | 22 +- Objects/clinic/unicodeobject.c.h | 58 +++--- Objects/stringlib/clinic/transmogrify.h.h | 4 +- PC/clinic/msvcrtmodule.c.h | 30 +-- PC/clinic/winreg.c.h | 22 +- Python/clinic/_warnings.c.h | 8 +- Python/clinic/bltinmodule.c.h | 36 ++-- Python/clinic/context.c.h | 16 +- Python/clinic/import.c.h | 30 +-- Python/clinic/instruction_sequence.c.h | 8 +- Python/clinic/instrumentation.c.h | 14 +- Python/clinic/sysmodule.c.h | 98 ++++----- Tools/clinic/libclinic/dsl_parser.py | 10 + Tools/clinic/libclinic/function.py | 1 + Tools/clinic/libclinic/parse_args.py | 9 +- 118 files changed, 1265 insertions(+), 1211 deletions(-) diff --git a/Lib/test/clinic.test.c b/Lib/test/clinic.test.c index cf7cff857a538c..7097e284be49ea 100644 --- a/Lib/test/clinic.test.c +++ b/Lib/test/clinic.test.c @@ -133,11 +133,11 @@ PyDoc_STRVAR(test_object_converter_one_arg__doc__, "\n"); #define TEST_OBJECT_CONVERTER_ONE_ARG_METHODDEF \ - {"test_object_converter_one_arg", (PyCFunction)test_object_converter_one_arg, METH_O, test_object_converter_one_arg__doc__}, + {"test_object_converter_one_arg", test_object_converter_one_arg, METH_O, test_object_converter_one_arg__doc__}, static PyObject * test_object_converter_one_arg(PyObject *module, PyObject *a) -/*[clinic end generated code: output=6da755f8502139df input=d635d92a421f1ca3]*/ +/*[clinic end generated code: output=a1272d4a621e3280 input=d635d92a421f1ca3]*/ /*[clinic input] @@ -315,7 +315,7 @@ PyDoc_STRVAR(test_PyBytesObject_converter__doc__, "\n"); #define TEST_PYBYTESOBJECT_CONVERTER_METHODDEF \ - {"test_PyBytesObject_converter", (PyCFunction)test_PyBytesObject_converter, METH_O, test_PyBytesObject_converter__doc__}, + {"test_PyBytesObject_converter", test_PyBytesObject_converter, METH_O, test_PyBytesObject_converter__doc__}, static PyObject * test_PyBytesObject_converter_impl(PyObject *module, PyBytesObject *a); @@ -339,7 +339,7 @@ test_PyBytesObject_converter(PyObject *module, PyObject *arg) static PyObject * test_PyBytesObject_converter_impl(PyObject *module, PyBytesObject *a) -/*[clinic end generated code: output=7539d628e6fceace input=12b10c7cb5750400]*/ +/*[clinic end generated code: output=a1f2b92832ee6372 input=12b10c7cb5750400]*/ /*[clinic input] @@ -356,7 +356,7 @@ PyDoc_STRVAR(test_PyByteArrayObject_converter__doc__, "\n"); #define TEST_PYBYTEARRAYOBJECT_CONVERTER_METHODDEF \ - {"test_PyByteArrayObject_converter", (PyCFunction)test_PyByteArrayObject_converter, METH_O, test_PyByteArrayObject_converter__doc__}, + {"test_PyByteArrayObject_converter", test_PyByteArrayObject_converter, METH_O, test_PyByteArrayObject_converter__doc__}, static PyObject * test_PyByteArrayObject_converter_impl(PyObject *module, PyByteArrayObject *a); @@ -380,7 +380,7 @@ test_PyByteArrayObject_converter(PyObject *module, PyObject *arg) static PyObject * test_PyByteArrayObject_converter_impl(PyObject *module, PyByteArrayObject *a) -/*[clinic end generated code: output=1245af9f5b3e355e input=5a657da535d194ae]*/ +/*[clinic end generated code: output=745c66001160f9cf input=5a657da535d194ae]*/ /*[clinic input] @@ -397,7 +397,7 @@ PyDoc_STRVAR(test_unicode_converter__doc__, "\n"); #define TEST_UNICODE_CONVERTER_METHODDEF \ - {"test_unicode_converter", (PyCFunction)test_unicode_converter, METH_O, test_unicode_converter__doc__}, + {"test_unicode_converter", test_unicode_converter, METH_O, test_unicode_converter__doc__}, static PyObject * test_unicode_converter_impl(PyObject *module, PyObject *a); @@ -421,7 +421,7 @@ test_unicode_converter(PyObject *module, PyObject *arg) static PyObject * test_unicode_converter_impl(PyObject *module, PyObject *a) -/*[clinic end generated code: output=8c1625cc272c1f3d input=aa33612df92aa9c5]*/ +/*[clinic end generated code: output=d3eba4040b357127 input=aa33612df92aa9c5]*/ /*[clinic input] @@ -1857,7 +1857,7 @@ PyDoc_STRVAR(test_Py_complex_converter__doc__, "\n"); #define TEST_PY_COMPLEX_CONVERTER_METHODDEF \ - {"test_Py_complex_converter", (PyCFunction)test_Py_complex_converter, METH_O, test_Py_complex_converter__doc__}, + {"test_Py_complex_converter", test_Py_complex_converter, METH_O, test_Py_complex_converter__doc__}, static PyObject * test_Py_complex_converter_impl(PyObject *module, Py_complex a); @@ -1880,7 +1880,7 @@ test_Py_complex_converter(PyObject *module, PyObject *arg) static PyObject * test_Py_complex_converter_impl(PyObject *module, Py_complex a) -/*[clinic end generated code: output=c2ecbec2144ca540 input=070f216a515beb79]*/ +/*[clinic end generated code: output=86f47ff04e11183c input=070f216a515beb79]*/ /*[clinic input] @@ -4001,7 +4001,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_condition_a__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF \ - {"test_preprocessor_guarded_condition_a", (PyCFunction)test_preprocessor_guarded_condition_a, METH_NOARGS, test_preprocessor_guarded_condition_a__doc__}, + {"test_preprocessor_guarded_condition_a", test_preprocessor_guarded_condition_a, METH_NOARGS, test_preprocessor_guarded_condition_a__doc__}, static PyObject * test_preprocessor_guarded_condition_a(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4019,7 +4019,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_elif_condition_b__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF \ - {"test_preprocessor_guarded_elif_condition_b", (PyCFunction)test_preprocessor_guarded_elif_condition_b, METH_NOARGS, test_preprocessor_guarded_elif_condition_b__doc__}, + {"test_preprocessor_guarded_elif_condition_b", test_preprocessor_guarded_elif_condition_b, METH_NOARGS, test_preprocessor_guarded_elif_condition_b__doc__}, static PyObject * test_preprocessor_guarded_elif_condition_b(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4037,7 +4037,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_else__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF \ - {"test_preprocessor_guarded_else", (PyCFunction)test_preprocessor_guarded_else, METH_NOARGS, test_preprocessor_guarded_else__doc__}, + {"test_preprocessor_guarded_else", test_preprocessor_guarded_else, METH_NOARGS, test_preprocessor_guarded_else__doc__}, static PyObject * test_preprocessor_guarded_else(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4055,7 +4055,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_ifndef_condition_c__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_IFNDEF_CONDITION_C_METHODDEF \ - {"test_preprocessor_guarded_ifndef_condition_c", (PyCFunction)test_preprocessor_guarded_ifndef_condition_c, METH_NOARGS, test_preprocessor_guarded_ifndef_condition_c__doc__}, + {"test_preprocessor_guarded_ifndef_condition_c", test_preprocessor_guarded_ifndef_condition_c, METH_NOARGS, test_preprocessor_guarded_ifndef_condition_c__doc__}, static PyObject * test_preprocessor_guarded_ifndef_condition_c(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4073,7 +4073,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_ifndef_not_condition_c__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_IFNDEF_NOT_CONDITION_C_METHODDEF \ - {"test_preprocessor_guarded_ifndef_not_condition_c", (PyCFunction)test_preprocessor_guarded_ifndef_not_condition_c, METH_NOARGS, test_preprocessor_guarded_ifndef_not_condition_c__doc__}, + {"test_preprocessor_guarded_ifndef_not_condition_c", test_preprocessor_guarded_ifndef_not_condition_c, METH_NOARGS, test_preprocessor_guarded_ifndef_not_condition_c__doc__}, static PyObject * test_preprocessor_guarded_ifndef_not_condition_c(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4091,7 +4091,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_if_with_continuation__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_IF_WITH_CONTINUATION_METHODDEF \ - {"test_preprocessor_guarded_if_with_continuation", (PyCFunction)test_preprocessor_guarded_if_with_continuation, METH_NOARGS, test_preprocessor_guarded_if_with_continuation__doc__}, + {"test_preprocessor_guarded_if_with_continuation", test_preprocessor_guarded_if_with_continuation, METH_NOARGS, test_preprocessor_guarded_if_with_continuation__doc__}, static PyObject * test_preprocessor_guarded_if_with_continuation(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4110,7 +4110,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_if_e_or_f__doc__, "Makes sure cpp.Monitor handles other directives than preprocessor conditionals."); #define TEST_PREPROCESSOR_GUARDED_IF_E_OR_F_METHODDEF \ - {"test_preprocessor_guarded_if_e_or_f", (PyCFunction)test_preprocessor_guarded_if_e_or_f, METH_NOARGS, test_preprocessor_guarded_if_e_or_f__doc__}, + {"test_preprocessor_guarded_if_e_or_f", test_preprocessor_guarded_if_e_or_f, METH_NOARGS, test_preprocessor_guarded_if_e_or_f__doc__}, static PyObject * test_preprocessor_guarded_if_e_or_f(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4147,7 +4147,7 @@ test_preprocessor_guarded_if_e_or_f(PyObject *module, PyObject *Py_UNUSED(ignore #ifndef TEST_PREPROCESSOR_GUARDED_IF_E_OR_F_METHODDEF #define TEST_PREPROCESSOR_GUARDED_IF_E_OR_F_METHODDEF #endif /* !defined(TEST_PREPROCESSOR_GUARDED_IF_E_OR_F_METHODDEF) */ -/*[clinic end generated code: output=fcfae7cac7a99e62 input=3fc80c9989d2f2e1]*/ +/*[clinic end generated code: output=e693034dd5190490 input=3fc80c9989d2f2e1]*/ /*[clinic input] test_vararg_and_posonly @@ -4934,7 +4934,7 @@ PyDoc_STRVAR(Test_metho_not_default_return_converter__doc__, "\n"); #define TEST_METHO_NOT_DEFAULT_RETURN_CONVERTER_METHODDEF \ - {"metho_not_default_return_converter", (PyCFunction)Test_metho_not_default_return_converter, METH_O, Test_metho_not_default_return_converter__doc__}, + {"metho_not_default_return_converter", Test_metho_not_default_return_converter, METH_O, Test_metho_not_default_return_converter__doc__}, static int Test_metho_not_default_return_converter_impl(TestObj *self, PyObject *a); @@ -4957,7 +4957,7 @@ Test_metho_not_default_return_converter(PyObject *self, PyObject *a) static int Test_metho_not_default_return_converter_impl(TestObj *self, PyObject *a) -/*[clinic end generated code: output=8b03f5213c312138 input=428657129b521177]*/ +/*[clinic end generated code: output=463ed281a4a3746b input=428657129b521177]*/ /*[clinic input] @@ -4977,7 +4977,7 @@ PyDoc_STRVAR(Test_an_metho_arg_named_arg__doc__, " Name should be mangled to \'arg_\' in generated output."); #define TEST_AN_METHO_ARG_NAMED_ARG_METHODDEF \ - {"an_metho_arg_named_arg", (PyCFunction)Test_an_metho_arg_named_arg, METH_O, Test_an_metho_arg_named_arg__doc__}, + {"an_metho_arg_named_arg", Test_an_metho_arg_named_arg, METH_O, Test_an_metho_arg_named_arg__doc__}, static PyObject * Test_an_metho_arg_named_arg_impl(TestObj *self, int arg); @@ -5000,7 +5000,7 @@ Test_an_metho_arg_named_arg(PyObject *self, PyObject *arg_) static PyObject * Test_an_metho_arg_named_arg_impl(TestObj *self, int arg) -/*[clinic end generated code: output=38554f09950d07e7 input=2a53a57cf5624f95]*/ +/*[clinic end generated code: output=bc7ffcb6f7243cdd input=2a53a57cf5624f95]*/ /*[clinic input] @@ -5229,7 +5229,7 @@ PyDoc_STRVAR(Test_class_method__doc__, "\n"); #define TEST_CLASS_METHOD_METHODDEF \ - {"class_method", (PyCFunction)Test_class_method, METH_NOARGS|METH_CLASS, Test_class_method__doc__}, + {"class_method", Test_class_method, METH_NOARGS|METH_CLASS, Test_class_method__doc__}, static PyObject * Test_class_method_impl(PyTypeObject *type); @@ -5242,7 +5242,7 @@ Test_class_method(PyObject *type, PyObject *Py_UNUSED(ignored)) static PyObject * Test_class_method_impl(PyTypeObject *type) -/*[clinic end generated code: output=64f93e6252bde409 input=43bc4a0494547b80]*/ +/*[clinic end generated code: output=dbf944c1125c4c79 input=43bc4a0494547b80]*/ /*[clinic input] @@ -5256,7 +5256,7 @@ PyDoc_STRVAR(Test_static_method__doc__, "\n"); #define TEST_STATIC_METHOD_METHODDEF \ - {"static_method", (PyCFunction)Test_static_method, METH_NOARGS|METH_STATIC, Test_static_method__doc__}, + {"static_method", Test_static_method, METH_NOARGS|METH_STATIC, Test_static_method__doc__}, static PyObject * Test_static_method_impl(); @@ -5269,7 +5269,7 @@ Test_static_method(PyObject *null, PyObject *Py_UNUSED(ignored)) static PyObject * Test_static_method_impl() -/*[clinic end generated code: output=9e401fb6ed56a4f3 input=dae892fac55ae72b]*/ +/*[clinic end generated code: output=e21462ae93b4645c input=dae892fac55ae72b]*/ /*[clinic input] @@ -5283,7 +5283,7 @@ PyDoc_STRVAR(Test_meth_coexist__doc__, "\n"); #define TEST_METH_COEXIST_METHODDEF \ - {"meth_coexist", (PyCFunction)Test_meth_coexist, METH_NOARGS|METH_COEXIST, Test_meth_coexist__doc__}, + {"meth_coexist", Test_meth_coexist, METH_NOARGS|METH_COEXIST, Test_meth_coexist__doc__}, static PyObject * Test_meth_coexist_impl(TestObj *self); @@ -5296,7 +5296,7 @@ Test_meth_coexist(PyObject *self, PyObject *Py_UNUSED(ignored)) static PyObject * Test_meth_coexist_impl(TestObj *self) -/*[clinic end generated code: output=7edf4e95b29f06fa input=2a1d75b5e6fec6dd]*/ +/*[clinic end generated code: output=9e43248bae46ad30 input=2a1d75b5e6fec6dd]*/ /*[clinic input] @getter @@ -5563,7 +5563,7 @@ PyDoc_STRVAR(bool_return__doc__, "\n"); #define BOOL_RETURN_METHODDEF \ - {"bool_return", (PyCFunction)bool_return, METH_NOARGS, bool_return__doc__}, + {"bool_return", bool_return, METH_NOARGS, bool_return__doc__}, static int bool_return_impl(PyObject *module); @@ -5586,7 +5586,7 @@ bool_return(PyObject *module, PyObject *Py_UNUSED(ignored)) static int bool_return_impl(PyObject *module) -/*[clinic end generated code: output=3a65f07830e48e98 input=93ba95d39ee98f39]*/ +/*[clinic end generated code: output=6c8ef775e67e345f input=93ba95d39ee98f39]*/ /*[clinic input] @@ -5599,7 +5599,7 @@ PyDoc_STRVAR(double_return__doc__, "\n"); #define DOUBLE_RETURN_METHODDEF \ - {"double_return", (PyCFunction)double_return, METH_NOARGS, double_return__doc__}, + {"double_return", double_return, METH_NOARGS, double_return__doc__}, static double double_return_impl(PyObject *module); @@ -5622,7 +5622,7 @@ double_return(PyObject *module, PyObject *Py_UNUSED(ignored)) static double double_return_impl(PyObject *module) -/*[clinic end generated code: output=076dc72595d3f66d input=da11b6255e4cbfd7]*/ +/*[clinic end generated code: output=9730b7e722925cec input=da11b6255e4cbfd7]*/ /*[clinic input] @@ -5912,7 +5912,7 @@ PyDoc_STRVAR(test_critical_section__doc__, "\n"); #define TEST_CRITICAL_SECTION_METHODDEF \ - {"test_critical_section", (PyCFunction)test_critical_section, METH_NOARGS, test_critical_section__doc__}, + {"test_critical_section", test_critical_section, METH_NOARGS, test_critical_section__doc__}, static PyObject * test_critical_section_impl(PyObject *module); @@ -5931,7 +5931,7 @@ test_critical_section(PyObject *module, PyObject *Py_UNUSED(ignored)) static PyObject * test_critical_section_impl(PyObject *module) -/*[clinic end generated code: output=9d5a87bb28aa3f0c input=8c58956d6ff00f80]*/ +/*[clinic end generated code: output=94a82ca7cb65a84a input=8c58956d6ff00f80]*/ /*[clinic input] @@ -5947,7 +5947,7 @@ PyDoc_STRVAR(test_critical_section_meth_o__doc__, "\n"); #define TEST_CRITICAL_SECTION_METH_O_METHODDEF \ - {"test_critical_section_meth_o", (PyCFunction)test_critical_section_meth_o, METH_O, test_critical_section_meth_o__doc__}, + {"test_critical_section_meth_o", test_critical_section_meth_o, METH_O, test_critical_section_meth_o__doc__}, static PyObject * test_critical_section_meth_o_impl(PyObject *module, PyObject *a); @@ -5973,7 +5973,7 @@ test_critical_section_meth_o(PyObject *module, PyObject *arg) static PyObject * test_critical_section_meth_o_impl(PyObject *module, PyObject *a) -/*[clinic end generated code: output=7a9d7420802d1202 input=376533f51eceb6c3]*/ +/*[clinic end generated code: output=6276bd911b60c196 input=376533f51eceb6c3]*/ /*[clinic input] @critical_section a @@ -5990,7 +5990,7 @@ PyDoc_STRVAR(test_critical_section_object__doc__, "test_critical_section_object"); #define TEST_CRITICAL_SECTION_OBJECT_METHODDEF \ - {"test_critical_section_object", (PyCFunction)test_critical_section_object, METH_O, test_critical_section_object__doc__}, + {"test_critical_section_object", test_critical_section_object, METH_O, test_critical_section_object__doc__}, static PyObject * test_critical_section_object_impl(PyObject *module, PyObject *a); @@ -6016,7 +6016,7 @@ test_critical_section_object(PyObject *module, PyObject *arg) static PyObject * test_critical_section_object_impl(PyObject *module, PyObject *a) -/*[clinic end generated code: output=ec06df92232b0fb5 input=6f67f91b523c875f]*/ +/*[clinic end generated code: output=975dc9674e9c5bfa input=6f67f91b523c875f]*/ PyDoc_STRVAR(test_critical_section_object__doc__, "test_critical_section_object($module, a, /)\n" diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py index b45b9ee89ee3de..82d7e99add13ee 100644 --- a/Lib/test/test_clinic.py +++ b/Lib/test/test_clinic.py @@ -432,11 +432,11 @@ def test_dest_buffer_not_empty_at_eof(self): "\\n"); #define FN_METHODDEF \\ - {"fn", (PyCFunction)fn, METH_O, fn__doc__}, + {"fn", fn, METH_O, fn__doc__}, static PyObject * fn(PyObject *module, PyObject *a) - /*[clinic end generated code: output=be6798b148ab4e53 input=524ce2e021e4eba6]*/ + /*[clinic end generated code: output=9ca52938037af908 input=524ce2e021e4eba6]*/ """) block = dedent(""" /*[clinic input] @@ -2930,11 +2930,11 @@ def test_file_dest(self): "\\n"); #define FUNC_METHODDEF \\ - {"func", (PyCFunction)func, METH_O, func__doc__}, + {"func", func, METH_O, func__doc__}, static PyObject * func(PyObject *module, PyObject *a) - /*[clinic end generated code: output=3dde2d13002165b9 input=a9049054013a1b77]*/ + /*[clinic end generated code: output=c710c5cbbd6f0a2f input=a9049054013a1b77]*/ """) with os_helper.temp_dir() as tmp_dir: in_fn = os.path.join(tmp_dir, "test.c") diff --git a/Modules/_ctypes/clinic/callproc.c.h b/Modules/_ctypes/clinic/callproc.c.h index a787693ae67cd8..e42ffe15b21097 100644 --- a/Modules/_ctypes/clinic/callproc.c.h +++ b/Modules/_ctypes/clinic/callproc.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(create_pointer_type__doc__, "so calling this function repeatedly is cheap."); #define CREATE_POINTER_TYPE_METHODDEF \ - {"POINTER", (PyCFunction)create_pointer_type, METH_O, create_pointer_type__doc__}, + {"POINTER", create_pointer_type, METH_O, create_pointer_type__doc__}, PyDoc_STRVAR(create_pointer_inst__doc__, "pointer($module, obj, /)\n" @@ -28,5 +28,5 @@ PyDoc_STRVAR(create_pointer_inst__doc__, "should use byref(obj) which is much faster."); #define CREATE_POINTER_INST_METHODDEF \ - {"pointer", (PyCFunction)create_pointer_inst, METH_O, create_pointer_inst__doc__}, -/*[clinic end generated code: output=51b311ea369e5adf input=a9049054013a1b77]*/ + {"pointer", create_pointer_inst, METH_O, create_pointer_inst__doc__}, +/*[clinic end generated code: output=a3affa6de5689703 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index 3345ae4c7f805f..76073ee9f25564 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(_io__BufferedIOBase_readinto__doc__, "\n"); #define _IO__BUFFEREDIOBASE_READINTO_METHODDEF \ - {"readinto", (PyCFunction)_io__BufferedIOBase_readinto, METH_O, _io__BufferedIOBase_readinto__doc__}, + {"readinto", _io__BufferedIOBase_readinto, METH_O, _io__BufferedIOBase_readinto__doc__}, static PyObject * _io__BufferedIOBase_readinto_impl(PyObject *self, Py_buffer *buffer); @@ -50,7 +50,7 @@ PyDoc_STRVAR(_io__BufferedIOBase_readinto1__doc__, "\n"); #define _IO__BUFFEREDIOBASE_READINTO1_METHODDEF \ - {"readinto1", (PyCFunction)_io__BufferedIOBase_readinto1, METH_O, _io__BufferedIOBase_readinto1__doc__}, + {"readinto1", _io__BufferedIOBase_readinto1, METH_O, _io__BufferedIOBase_readinto1__doc__}, static PyObject * _io__BufferedIOBase_readinto1_impl(PyObject *self, Py_buffer *buffer); @@ -282,7 +282,7 @@ PyDoc_STRVAR(_io__Buffered___sizeof____doc__, "\n"); #define _IO__BUFFERED___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)_io__Buffered___sizeof__, METH_NOARGS, _io__Buffered___sizeof____doc__}, + {"__sizeof__", _io__Buffered___sizeof__, METH_NOARGS, _io__Buffered___sizeof____doc__}, static PyObject * _io__Buffered___sizeof___impl(buffered *self); @@ -305,7 +305,7 @@ PyDoc_STRVAR(_io__Buffered__dealloc_warn__doc__, "\n"); #define _IO__BUFFERED__DEALLOC_WARN_METHODDEF \ - {"_dealloc_warn", (PyCFunction)_io__Buffered__dealloc_warn, METH_O, _io__Buffered__dealloc_warn__doc__}, + {"_dealloc_warn", _io__Buffered__dealloc_warn, METH_O, _io__Buffered__dealloc_warn__doc__}, static PyObject * _io__Buffered__dealloc_warn_impl(buffered *self, PyObject *source); @@ -326,7 +326,7 @@ PyDoc_STRVAR(_io__Buffered_simple_flush__doc__, "\n"); #define _IO__BUFFERED_SIMPLE_FLUSH_METHODDEF \ - {"flush", (PyCFunction)_io__Buffered_simple_flush, METH_NOARGS, _io__Buffered_simple_flush__doc__}, + {"flush", _io__Buffered_simple_flush, METH_NOARGS, _io__Buffered_simple_flush__doc__}, static PyObject * _io__Buffered_simple_flush_impl(buffered *self); @@ -374,7 +374,7 @@ PyDoc_STRVAR(_io__Buffered_close__doc__, "\n"); #define _IO__BUFFERED_CLOSE_METHODDEF \ - {"close", (PyCFunction)_io__Buffered_close, METH_NOARGS, _io__Buffered_close__doc__}, + {"close", _io__Buffered_close, METH_NOARGS, _io__Buffered_close__doc__}, static PyObject * _io__Buffered_close_impl(buffered *self); @@ -397,7 +397,7 @@ PyDoc_STRVAR(_io__Buffered_detach__doc__, "\n"); #define _IO__BUFFERED_DETACH_METHODDEF \ - {"detach", (PyCFunction)_io__Buffered_detach, METH_NOARGS, _io__Buffered_detach__doc__}, + {"detach", _io__Buffered_detach, METH_NOARGS, _io__Buffered_detach__doc__}, static PyObject * _io__Buffered_detach_impl(buffered *self); @@ -420,7 +420,7 @@ PyDoc_STRVAR(_io__Buffered_seekable__doc__, "\n"); #define _IO__BUFFERED_SEEKABLE_METHODDEF \ - {"seekable", (PyCFunction)_io__Buffered_seekable, METH_NOARGS, _io__Buffered_seekable__doc__}, + {"seekable", _io__Buffered_seekable, METH_NOARGS, _io__Buffered_seekable__doc__}, static PyObject * _io__Buffered_seekable_impl(buffered *self); @@ -443,7 +443,7 @@ PyDoc_STRVAR(_io__Buffered_readable__doc__, "\n"); #define _IO__BUFFERED_READABLE_METHODDEF \ - {"readable", (PyCFunction)_io__Buffered_readable, METH_NOARGS, _io__Buffered_readable__doc__}, + {"readable", _io__Buffered_readable, METH_NOARGS, _io__Buffered_readable__doc__}, static PyObject * _io__Buffered_readable_impl(buffered *self); @@ -466,7 +466,7 @@ PyDoc_STRVAR(_io__Buffered_writable__doc__, "\n"); #define _IO__BUFFERED_WRITABLE_METHODDEF \ - {"writable", (PyCFunction)_io__Buffered_writable, METH_NOARGS, _io__Buffered_writable__doc__}, + {"writable", _io__Buffered_writable, METH_NOARGS, _io__Buffered_writable__doc__}, static PyObject * _io__Buffered_writable_impl(buffered *self); @@ -539,7 +539,7 @@ PyDoc_STRVAR(_io__Buffered_fileno__doc__, "\n"); #define _IO__BUFFERED_FILENO_METHODDEF \ - {"fileno", (PyCFunction)_io__Buffered_fileno, METH_NOARGS, _io__Buffered_fileno__doc__}, + {"fileno", _io__Buffered_fileno, METH_NOARGS, _io__Buffered_fileno__doc__}, static PyObject * _io__Buffered_fileno_impl(buffered *self); @@ -562,7 +562,7 @@ PyDoc_STRVAR(_io__Buffered_isatty__doc__, "\n"); #define _IO__BUFFERED_ISATTY_METHODDEF \ - {"isatty", (PyCFunction)_io__Buffered_isatty, METH_NOARGS, _io__Buffered_isatty__doc__}, + {"isatty", _io__Buffered_isatty, METH_NOARGS, _io__Buffered_isatty__doc__}, static PyObject * _io__Buffered_isatty_impl(buffered *self); @@ -585,7 +585,7 @@ PyDoc_STRVAR(_io__Buffered_flush__doc__, "\n"); #define _IO__BUFFERED_FLUSH_METHODDEF \ - {"flush", (PyCFunction)_io__Buffered_flush, METH_NOARGS, _io__Buffered_flush__doc__}, + {"flush", _io__Buffered_flush, METH_NOARGS, _io__Buffered_flush__doc__}, static PyObject * _io__Buffered_flush_impl(buffered *self); @@ -731,7 +731,7 @@ PyDoc_STRVAR(_io__Buffered_readinto__doc__, "\n"); #define _IO__BUFFERED_READINTO_METHODDEF \ - {"readinto", (PyCFunction)_io__Buffered_readinto, METH_O, _io__Buffered_readinto__doc__}, + {"readinto", _io__Buffered_readinto, METH_O, _io__Buffered_readinto__doc__}, static PyObject * _io__Buffered_readinto_impl(buffered *self, Py_buffer *buffer); @@ -765,7 +765,7 @@ PyDoc_STRVAR(_io__Buffered_readinto1__doc__, "\n"); #define _IO__BUFFERED_READINTO1_METHODDEF \ - {"readinto1", (PyCFunction)_io__Buffered_readinto1, METH_O, _io__Buffered_readinto1__doc__}, + {"readinto1", _io__Buffered_readinto1, METH_O, _io__Buffered_readinto1__doc__}, static PyObject * _io__Buffered_readinto1_impl(buffered *self, Py_buffer *buffer); @@ -834,7 +834,7 @@ PyDoc_STRVAR(_io__Buffered_tell__doc__, "\n"); #define _IO__BUFFERED_TELL_METHODDEF \ - {"tell", (PyCFunction)_io__Buffered_tell, METH_NOARGS, _io__Buffered_tell__doc__}, + {"tell", _io__Buffered_tell, METH_NOARGS, _io__Buffered_tell__doc__}, static PyObject * _io__Buffered_tell_impl(buffered *self); @@ -1096,7 +1096,7 @@ PyDoc_STRVAR(_io_BufferedWriter_write__doc__, "\n"); #define _IO_BUFFEREDWRITER_WRITE_METHODDEF \ - {"write", (PyCFunction)_io_BufferedWriter_write, METH_O, _io_BufferedWriter_write__doc__}, + {"write", _io_BufferedWriter_write, METH_O, _io_BufferedWriter_write__doc__}, static PyObject * _io_BufferedWriter_write_impl(buffered *self, Py_buffer *buffer); @@ -1259,4 +1259,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=1a0562c66776fd53 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c9f9d2206eaf7514 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index dc481603d1e8a2..434f78bd1489fd 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(_io_BytesIO_readable__doc__, "Returns True if the IO object can be read."); #define _IO_BYTESIO_READABLE_METHODDEF \ - {"readable", (PyCFunction)_io_BytesIO_readable, METH_NOARGS, _io_BytesIO_readable__doc__}, + {"readable", _io_BytesIO_readable, METH_NOARGS, _io_BytesIO_readable__doc__}, static PyObject * _io_BytesIO_readable_impl(bytesio *self); @@ -34,7 +34,7 @@ PyDoc_STRVAR(_io_BytesIO_writable__doc__, "Returns True if the IO object can be written."); #define _IO_BYTESIO_WRITABLE_METHODDEF \ - {"writable", (PyCFunction)_io_BytesIO_writable, METH_NOARGS, _io_BytesIO_writable__doc__}, + {"writable", _io_BytesIO_writable, METH_NOARGS, _io_BytesIO_writable__doc__}, static PyObject * _io_BytesIO_writable_impl(bytesio *self); @@ -52,7 +52,7 @@ PyDoc_STRVAR(_io_BytesIO_seekable__doc__, "Returns True if the IO object can be seeked."); #define _IO_BYTESIO_SEEKABLE_METHODDEF \ - {"seekable", (PyCFunction)_io_BytesIO_seekable, METH_NOARGS, _io_BytesIO_seekable__doc__}, + {"seekable", _io_BytesIO_seekable, METH_NOARGS, _io_BytesIO_seekable__doc__}, static PyObject * _io_BytesIO_seekable_impl(bytesio *self); @@ -70,7 +70,7 @@ PyDoc_STRVAR(_io_BytesIO_flush__doc__, "Does nothing."); #define _IO_BYTESIO_FLUSH_METHODDEF \ - {"flush", (PyCFunction)_io_BytesIO_flush, METH_NOARGS, _io_BytesIO_flush__doc__}, + {"flush", _io_BytesIO_flush, METH_NOARGS, _io_BytesIO_flush__doc__}, static PyObject * _io_BytesIO_flush_impl(bytesio *self); @@ -110,7 +110,7 @@ PyDoc_STRVAR(_io_BytesIO_getvalue__doc__, "Retrieve the entire contents of the BytesIO object."); #define _IO_BYTESIO_GETVALUE_METHODDEF \ - {"getvalue", (PyCFunction)_io_BytesIO_getvalue, METH_NOARGS, _io_BytesIO_getvalue__doc__}, + {"getvalue", _io_BytesIO_getvalue, METH_NOARGS, _io_BytesIO_getvalue__doc__}, static PyObject * _io_BytesIO_getvalue_impl(bytesio *self); @@ -130,7 +130,7 @@ PyDoc_STRVAR(_io_BytesIO_isatty__doc__, "BytesIO objects are not connected to a TTY-like device."); #define _IO_BYTESIO_ISATTY_METHODDEF \ - {"isatty", (PyCFunction)_io_BytesIO_isatty, METH_NOARGS, _io_BytesIO_isatty__doc__}, + {"isatty", _io_BytesIO_isatty, METH_NOARGS, _io_BytesIO_isatty__doc__}, static PyObject * _io_BytesIO_isatty_impl(bytesio *self); @@ -148,7 +148,7 @@ PyDoc_STRVAR(_io_BytesIO_tell__doc__, "Current file position, an integer."); #define _IO_BYTESIO_TELL_METHODDEF \ - {"tell", (PyCFunction)_io_BytesIO_tell, METH_NOARGS, _io_BytesIO_tell__doc__}, + {"tell", _io_BytesIO_tell, METH_NOARGS, _io_BytesIO_tell__doc__}, static PyObject * _io_BytesIO_tell_impl(bytesio *self); @@ -317,7 +317,7 @@ PyDoc_STRVAR(_io_BytesIO_readinto__doc__, "is set not to block and has no data to read."); #define _IO_BYTESIO_READINTO_METHODDEF \ - {"readinto", (PyCFunction)_io_BytesIO_readinto, METH_O, _io_BytesIO_readinto__doc__}, + {"readinto", _io_BytesIO_readinto, METH_O, _io_BytesIO_readinto__doc__}, static PyObject * _io_BytesIO_readinto_impl(bytesio *self, Py_buffer *buffer); @@ -443,7 +443,7 @@ PyDoc_STRVAR(_io_BytesIO_write__doc__, "Return the number of bytes written."); #define _IO_BYTESIO_WRITE_METHODDEF \ - {"write", (PyCFunction)_io_BytesIO_write, METH_O, _io_BytesIO_write__doc__}, + {"write", _io_BytesIO_write, METH_O, _io_BytesIO_write__doc__}, static PyObject * _io_BytesIO_write_impl(bytesio *self, PyObject *b); @@ -469,7 +469,7 @@ PyDoc_STRVAR(_io_BytesIO_writelines__doc__, "each element."); #define _IO_BYTESIO_WRITELINES_METHODDEF \ - {"writelines", (PyCFunction)_io_BytesIO_writelines, METH_O, _io_BytesIO_writelines__doc__}, + {"writelines", _io_BytesIO_writelines, METH_O, _io_BytesIO_writelines__doc__}, static PyObject * _io_BytesIO_writelines_impl(bytesio *self, PyObject *lines); @@ -491,7 +491,7 @@ PyDoc_STRVAR(_io_BytesIO_close__doc__, "Disable all I/O operations."); #define _IO_BYTESIO_CLOSE_METHODDEF \ - {"close", (PyCFunction)_io_BytesIO_close, METH_NOARGS, _io_BytesIO_close__doc__}, + {"close", _io_BytesIO_close, METH_NOARGS, _io_BytesIO_close__doc__}, static PyObject * _io_BytesIO_close_impl(bytesio *self); @@ -561,4 +561,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=477217b2bc464110 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=094ee2072ceab962 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index bc816ea030fc80..5038561391581c 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -145,7 +145,7 @@ PyDoc_STRVAR(_io_FileIO_fileno__doc__, "Return the underlying file descriptor (an integer)."); #define _IO_FILEIO_FILENO_METHODDEF \ - {"fileno", (PyCFunction)_io_FileIO_fileno, METH_NOARGS, _io_FileIO_fileno__doc__}, + {"fileno", _io_FileIO_fileno, METH_NOARGS, _io_FileIO_fileno__doc__}, static PyObject * _io_FileIO_fileno_impl(fileio *self); @@ -163,7 +163,7 @@ PyDoc_STRVAR(_io_FileIO_readable__doc__, "True if file was opened in a read mode."); #define _IO_FILEIO_READABLE_METHODDEF \ - {"readable", (PyCFunction)_io_FileIO_readable, METH_NOARGS, _io_FileIO_readable__doc__}, + {"readable", _io_FileIO_readable, METH_NOARGS, _io_FileIO_readable__doc__}, static PyObject * _io_FileIO_readable_impl(fileio *self); @@ -181,7 +181,7 @@ PyDoc_STRVAR(_io_FileIO_writable__doc__, "True if file was opened in a write mode."); #define _IO_FILEIO_WRITABLE_METHODDEF \ - {"writable", (PyCFunction)_io_FileIO_writable, METH_NOARGS, _io_FileIO_writable__doc__}, + {"writable", _io_FileIO_writable, METH_NOARGS, _io_FileIO_writable__doc__}, static PyObject * _io_FileIO_writable_impl(fileio *self); @@ -199,7 +199,7 @@ PyDoc_STRVAR(_io_FileIO_seekable__doc__, "True if file supports random-access."); #define _IO_FILEIO_SEEKABLE_METHODDEF \ - {"seekable", (PyCFunction)_io_FileIO_seekable, METH_NOARGS, _io_FileIO_seekable__doc__}, + {"seekable", _io_FileIO_seekable, METH_NOARGS, _io_FileIO_seekable__doc__}, static PyObject * _io_FileIO_seekable_impl(fileio *self); @@ -275,7 +275,7 @@ PyDoc_STRVAR(_io_FileIO_readall__doc__, "data is available (EAGAIN is returned before bytes are read) returns None."); #define _IO_FILEIO_READALL_METHODDEF \ - {"readall", (PyCFunction)_io_FileIO_readall, METH_NOARGS, _io_FileIO_readall__doc__}, + {"readall", _io_FileIO_readall, METH_NOARGS, _io_FileIO_readall__doc__}, static PyObject * _io_FileIO_readall_impl(fileio *self); @@ -454,7 +454,7 @@ PyDoc_STRVAR(_io_FileIO_tell__doc__, "Can raise OSError for non seekable files."); #define _IO_FILEIO_TELL_METHODDEF \ - {"tell", (PyCFunction)_io_FileIO_tell, METH_NOARGS, _io_FileIO_tell__doc__}, + {"tell", _io_FileIO_tell, METH_NOARGS, _io_FileIO_tell__doc__}, static PyObject * _io_FileIO_tell_impl(fileio *self); @@ -527,7 +527,7 @@ PyDoc_STRVAR(_io_FileIO_isatty__doc__, "True if the file is connected to a TTY device."); #define _IO_FILEIO_ISATTY_METHODDEF \ - {"isatty", (PyCFunction)_io_FileIO_isatty, METH_NOARGS, _io_FileIO_isatty__doc__}, + {"isatty", _io_FileIO_isatty, METH_NOARGS, _io_FileIO_isatty__doc__}, static PyObject * _io_FileIO_isatty_impl(fileio *self); @@ -541,4 +541,4 @@ _io_FileIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=f4e1f74c03d4ecdf input=a9049054013a1b77]*/ +/*[clinic end generated code: output=472dfa3229b4e10f input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/iobase.c.h b/Modules/_io/clinic/iobase.c.h index 402448545dfc51..2b310d6b651bbe 100644 --- a/Modules/_io/clinic/iobase.c.h +++ b/Modules/_io/clinic/iobase.c.h @@ -86,7 +86,7 @@ PyDoc_STRVAR(_io__IOBase_tell__doc__, "Return current stream position."); #define _IO__IOBASE_TELL_METHODDEF \ - {"tell", (PyCFunction)_io__IOBase_tell, METH_NOARGS, _io__IOBase_tell__doc__}, + {"tell", _io__IOBase_tell, METH_NOARGS, _io__IOBase_tell__doc__}, static PyObject * _io__IOBase_tell_impl(PyObject *self); @@ -158,7 +158,7 @@ PyDoc_STRVAR(_io__IOBase_flush__doc__, "This is not implemented for read-only and non-blocking streams."); #define _IO__IOBASE_FLUSH_METHODDEF \ - {"flush", (PyCFunction)_io__IOBase_flush, METH_NOARGS, _io__IOBase_flush__doc__}, + {"flush", _io__IOBase_flush, METH_NOARGS, _io__IOBase_flush__doc__}, static PyObject * _io__IOBase_flush_impl(PyObject *self); @@ -178,7 +178,7 @@ PyDoc_STRVAR(_io__IOBase_close__doc__, "This method has no effect if the file is already closed."); #define _IO__IOBASE_CLOSE_METHODDEF \ - {"close", (PyCFunction)_io__IOBase_close, METH_NOARGS, _io__IOBase_close__doc__}, + {"close", _io__IOBase_close, METH_NOARGS, _io__IOBase_close__doc__}, static PyObject * _io__IOBase_close_impl(PyObject *self); @@ -199,7 +199,7 @@ PyDoc_STRVAR(_io__IOBase_seekable__doc__, "This method may need to do a test seek()."); #define _IO__IOBASE_SEEKABLE_METHODDEF \ - {"seekable", (PyCFunction)_io__IOBase_seekable, METH_NOARGS, _io__IOBase_seekable__doc__}, + {"seekable", _io__IOBase_seekable, METH_NOARGS, _io__IOBase_seekable__doc__}, static PyObject * _io__IOBase_seekable_impl(PyObject *self); @@ -219,7 +219,7 @@ PyDoc_STRVAR(_io__IOBase_readable__doc__, "If False, read() will raise OSError."); #define _IO__IOBASE_READABLE_METHODDEF \ - {"readable", (PyCFunction)_io__IOBase_readable, METH_NOARGS, _io__IOBase_readable__doc__}, + {"readable", _io__IOBase_readable, METH_NOARGS, _io__IOBase_readable__doc__}, static PyObject * _io__IOBase_readable_impl(PyObject *self); @@ -239,7 +239,7 @@ PyDoc_STRVAR(_io__IOBase_writable__doc__, "If False, write() will raise OSError."); #define _IO__IOBASE_WRITABLE_METHODDEF \ - {"writable", (PyCFunction)_io__IOBase_writable, METH_NOARGS, _io__IOBase_writable__doc__}, + {"writable", _io__IOBase_writable, METH_NOARGS, _io__IOBase_writable__doc__}, static PyObject * _io__IOBase_writable_impl(PyObject *self); @@ -283,7 +283,7 @@ PyDoc_STRVAR(_io__IOBase_isatty__doc__, "Return False if it can\'t be determined."); #define _IO__IOBASE_ISATTY_METHODDEF \ - {"isatty", (PyCFunction)_io__IOBase_isatty, METH_NOARGS, _io__IOBase_isatty__doc__}, + {"isatty", _io__IOBase_isatty, METH_NOARGS, _io__IOBase_isatty__doc__}, static PyObject * _io__IOBase_isatty_impl(PyObject *self); @@ -382,7 +382,7 @@ PyDoc_STRVAR(_io__IOBase_writelines__doc__, "lines provided to have a line separator at the end."); #define _IO__IOBASE_WRITELINES_METHODDEF \ - {"writelines", (PyCFunction)_io__IOBase_writelines, METH_O, _io__IOBase_writelines__doc__}, + {"writelines", _io__IOBase_writelines, METH_O, _io__IOBase_writelines__doc__}, PyDoc_STRVAR(_io__RawIOBase_read__doc__, "read($self, size=-1, /)\n" @@ -433,7 +433,7 @@ PyDoc_STRVAR(_io__RawIOBase_readall__doc__, "Read until EOF, using multiple read() call."); #define _IO__RAWIOBASE_READALL_METHODDEF \ - {"readall", (PyCFunction)_io__RawIOBase_readall, METH_NOARGS, _io__RawIOBase_readall__doc__}, + {"readall", _io__RawIOBase_readall, METH_NOARGS, _io__RawIOBase_readall__doc__}, static PyObject * _io__RawIOBase_readall_impl(PyObject *self); @@ -443,4 +443,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _io__RawIOBase_readall_impl(self); } -/*[clinic end generated code: output=9359e74d95534bef input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6081b57d56063953 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h index 2c5757f668e93d..dde54cbaaf8994 100644 --- a/Modules/_io/clinic/stringio.c.h +++ b/Modules/_io/clinic/stringio.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(_io_StringIO_getvalue__doc__, "Retrieve the entire contents of the object."); #define _IO_STRINGIO_GETVALUE_METHODDEF \ - {"getvalue", (PyCFunction)_io_StringIO_getvalue, METH_NOARGS, _io_StringIO_getvalue__doc__}, + {"getvalue", _io_StringIO_getvalue, METH_NOARGS, _io_StringIO_getvalue__doc__}, static PyObject * _io_StringIO_getvalue_impl(stringio *self); @@ -41,7 +41,7 @@ PyDoc_STRVAR(_io_StringIO_tell__doc__, "Tell the current file position."); #define _IO_STRINGIO_TELL_METHODDEF \ - {"tell", (PyCFunction)_io_StringIO_tell, METH_NOARGS, _io_StringIO_tell__doc__}, + {"tell", _io_StringIO_tell, METH_NOARGS, _io_StringIO_tell__doc__}, static PyObject * _io_StringIO_tell_impl(stringio *self); @@ -241,7 +241,7 @@ PyDoc_STRVAR(_io_StringIO_write__doc__, "the length of the string."); #define _IO_STRINGIO_WRITE_METHODDEF \ - {"write", (PyCFunction)_io_StringIO_write, METH_O, _io_StringIO_write__doc__}, + {"write", _io_StringIO_write, METH_O, _io_StringIO_write__doc__}, static PyObject * _io_StringIO_write_impl(stringio *self, PyObject *obj); @@ -270,7 +270,7 @@ PyDoc_STRVAR(_io_StringIO_close__doc__, "This method has no effect if the file is already closed."); #define _IO_STRINGIO_CLOSE_METHODDEF \ - {"close", (PyCFunction)_io_StringIO_close, METH_NOARGS, _io_StringIO_close__doc__}, + {"close", _io_StringIO_close, METH_NOARGS, _io_StringIO_close__doc__}, static PyObject * _io_StringIO_close_impl(stringio *self); @@ -365,7 +365,7 @@ PyDoc_STRVAR(_io_StringIO_readable__doc__, "Returns True if the IO object can be read."); #define _IO_STRINGIO_READABLE_METHODDEF \ - {"readable", (PyCFunction)_io_StringIO_readable, METH_NOARGS, _io_StringIO_readable__doc__}, + {"readable", _io_StringIO_readable, METH_NOARGS, _io_StringIO_readable__doc__}, static PyObject * _io_StringIO_readable_impl(stringio *self); @@ -389,7 +389,7 @@ PyDoc_STRVAR(_io_StringIO_writable__doc__, "Returns True if the IO object can be written."); #define _IO_STRINGIO_WRITABLE_METHODDEF \ - {"writable", (PyCFunction)_io_StringIO_writable, METH_NOARGS, _io_StringIO_writable__doc__}, + {"writable", _io_StringIO_writable, METH_NOARGS, _io_StringIO_writable__doc__}, static PyObject * _io_StringIO_writable_impl(stringio *self); @@ -413,7 +413,7 @@ PyDoc_STRVAR(_io_StringIO_seekable__doc__, "Returns True if the IO object can be seeked."); #define _IO_STRINGIO_SEEKABLE_METHODDEF \ - {"seekable", (PyCFunction)_io_StringIO_seekable, METH_NOARGS, _io_StringIO_seekable__doc__}, + {"seekable", _io_StringIO_seekable, METH_NOARGS, _io_StringIO_seekable__doc__}, static PyObject * _io_StringIO_seekable_impl(stringio *self); @@ -436,7 +436,7 @@ PyDoc_STRVAR(_io_StringIO___getstate____doc__, "\n"); #define _IO_STRINGIO___GETSTATE___METHODDEF \ - {"__getstate__", (PyCFunction)_io_StringIO___getstate__, METH_NOARGS, _io_StringIO___getstate____doc__}, + {"__getstate__", _io_StringIO___getstate__, METH_NOARGS, _io_StringIO___getstate____doc__}, static PyObject * _io_StringIO___getstate___impl(stringio *self); @@ -459,7 +459,7 @@ PyDoc_STRVAR(_io_StringIO___setstate____doc__, "\n"); #define _IO_STRINGIO___SETSTATE___METHODDEF \ - {"__setstate__", (PyCFunction)_io_StringIO___setstate__, METH_O, _io_StringIO___setstate____doc__}, + {"__setstate__", _io_StringIO___setstate__, METH_O, _io_StringIO___setstate____doc__}, static PyObject * _io_StringIO___setstate___impl(stringio *self, PyObject *state); @@ -550,4 +550,4 @@ _io_StringIO_newlines_get(PyObject *self, void *Py_UNUSED(context)) return return_value; } -/*[clinic end generated code: output=69c9b100a359cbd5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6914ca11bef4bc35 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index fd84198b1036de..c70620088e3d00 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -438,7 +438,7 @@ PyDoc_STRVAR(_io_IncrementalNewlineDecoder_getstate__doc__, "\n"); #define _IO_INCREMENTALNEWLINEDECODER_GETSTATE_METHODDEF \ - {"getstate", (PyCFunction)_io_IncrementalNewlineDecoder_getstate, METH_NOARGS, _io_IncrementalNewlineDecoder_getstate__doc__}, + {"getstate", _io_IncrementalNewlineDecoder_getstate, METH_NOARGS, _io_IncrementalNewlineDecoder_getstate__doc__}, static PyObject * _io_IncrementalNewlineDecoder_getstate_impl(nldecoder_object *self); @@ -455,7 +455,7 @@ PyDoc_STRVAR(_io_IncrementalNewlineDecoder_setstate__doc__, "\n"); #define _IO_INCREMENTALNEWLINEDECODER_SETSTATE_METHODDEF \ - {"setstate", (PyCFunction)_io_IncrementalNewlineDecoder_setstate, METH_O, _io_IncrementalNewlineDecoder_setstate__doc__}, + {"setstate", _io_IncrementalNewlineDecoder_setstate, METH_O, _io_IncrementalNewlineDecoder_setstate__doc__}, static PyObject * _io_IncrementalNewlineDecoder_setstate_impl(nldecoder_object *self, @@ -477,7 +477,7 @@ PyDoc_STRVAR(_io_IncrementalNewlineDecoder_reset__doc__, "\n"); #define _IO_INCREMENTALNEWLINEDECODER_RESET_METHODDEF \ - {"reset", (PyCFunction)_io_IncrementalNewlineDecoder_reset, METH_NOARGS, _io_IncrementalNewlineDecoder_reset__doc__}, + {"reset", _io_IncrementalNewlineDecoder_reset, METH_NOARGS, _io_IncrementalNewlineDecoder_reset__doc__}, static PyObject * _io_IncrementalNewlineDecoder_reset_impl(nldecoder_object *self); @@ -752,7 +752,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_detach__doc__, "\n"); #define _IO_TEXTIOWRAPPER_DETACH_METHODDEF \ - {"detach", (PyCFunction)_io_TextIOWrapper_detach, METH_NOARGS, _io_TextIOWrapper_detach__doc__}, + {"detach", _io_TextIOWrapper_detach, METH_NOARGS, _io_TextIOWrapper_detach__doc__}, static PyObject * _io_TextIOWrapper_detach_impl(textio *self); @@ -775,7 +775,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_write__doc__, "\n"); #define _IO_TEXTIOWRAPPER_WRITE_METHODDEF \ - {"write", (PyCFunction)_io_TextIOWrapper_write, METH_O, _io_TextIOWrapper_write__doc__}, + {"write", _io_TextIOWrapper_write, METH_O, _io_TextIOWrapper_write__doc__}, static PyObject * _io_TextIOWrapper_write_impl(textio *self, PyObject *text); @@ -944,7 +944,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_tell__doc__, "previous stream position."); #define _IO_TEXTIOWRAPPER_TELL_METHODDEF \ - {"tell", (PyCFunction)_io_TextIOWrapper_tell, METH_NOARGS, _io_TextIOWrapper_tell__doc__}, + {"tell", _io_TextIOWrapper_tell, METH_NOARGS, _io_TextIOWrapper_tell__doc__}, static PyObject * _io_TextIOWrapper_tell_impl(textio *self); @@ -1000,7 +1000,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_fileno__doc__, "\n"); #define _IO_TEXTIOWRAPPER_FILENO_METHODDEF \ - {"fileno", (PyCFunction)_io_TextIOWrapper_fileno, METH_NOARGS, _io_TextIOWrapper_fileno__doc__}, + {"fileno", _io_TextIOWrapper_fileno, METH_NOARGS, _io_TextIOWrapper_fileno__doc__}, static PyObject * _io_TextIOWrapper_fileno_impl(textio *self); @@ -1023,7 +1023,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_seekable__doc__, "\n"); #define _IO_TEXTIOWRAPPER_SEEKABLE_METHODDEF \ - {"seekable", (PyCFunction)_io_TextIOWrapper_seekable, METH_NOARGS, _io_TextIOWrapper_seekable__doc__}, + {"seekable", _io_TextIOWrapper_seekable, METH_NOARGS, _io_TextIOWrapper_seekable__doc__}, static PyObject * _io_TextIOWrapper_seekable_impl(textio *self); @@ -1046,7 +1046,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_readable__doc__, "\n"); #define _IO_TEXTIOWRAPPER_READABLE_METHODDEF \ - {"readable", (PyCFunction)_io_TextIOWrapper_readable, METH_NOARGS, _io_TextIOWrapper_readable__doc__}, + {"readable", _io_TextIOWrapper_readable, METH_NOARGS, _io_TextIOWrapper_readable__doc__}, static PyObject * _io_TextIOWrapper_readable_impl(textio *self); @@ -1069,7 +1069,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_writable__doc__, "\n"); #define _IO_TEXTIOWRAPPER_WRITABLE_METHODDEF \ - {"writable", (PyCFunction)_io_TextIOWrapper_writable, METH_NOARGS, _io_TextIOWrapper_writable__doc__}, + {"writable", _io_TextIOWrapper_writable, METH_NOARGS, _io_TextIOWrapper_writable__doc__}, static PyObject * _io_TextIOWrapper_writable_impl(textio *self); @@ -1092,7 +1092,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_isatty__doc__, "\n"); #define _IO_TEXTIOWRAPPER_ISATTY_METHODDEF \ - {"isatty", (PyCFunction)_io_TextIOWrapper_isatty, METH_NOARGS, _io_TextIOWrapper_isatty__doc__}, + {"isatty", _io_TextIOWrapper_isatty, METH_NOARGS, _io_TextIOWrapper_isatty__doc__}, static PyObject * _io_TextIOWrapper_isatty_impl(textio *self); @@ -1115,7 +1115,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_flush__doc__, "\n"); #define _IO_TEXTIOWRAPPER_FLUSH_METHODDEF \ - {"flush", (PyCFunction)_io_TextIOWrapper_flush, METH_NOARGS, _io_TextIOWrapper_flush__doc__}, + {"flush", _io_TextIOWrapper_flush, METH_NOARGS, _io_TextIOWrapper_flush__doc__}, static PyObject * _io_TextIOWrapper_flush_impl(textio *self); @@ -1138,7 +1138,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_close__doc__, "\n"); #define _IO_TEXTIOWRAPPER_CLOSE_METHODDEF \ - {"close", (PyCFunction)_io_TextIOWrapper_close, METH_NOARGS, _io_TextIOWrapper_close__doc__}, + {"close", _io_TextIOWrapper_close, METH_NOARGS, _io_TextIOWrapper_close__doc__}, static PyObject * _io_TextIOWrapper_close_impl(textio *self); @@ -1304,4 +1304,4 @@ _io_TextIOWrapper__CHUNK_SIZE_set(PyObject *self, PyObject *value, void *Py_UNUS return return_value; } -/*[clinic end generated code: output=dad68d8c33d676e6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fa7f387a4f8689a4 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index ba6dcde6e01064..33df4370af7955 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -148,7 +148,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_fileno__doc__, "Return the underlying file descriptor (an integer)."); #define _IO__WINDOWSCONSOLEIO_FILENO_METHODDEF \ - {"fileno", (PyCFunction)_io__WindowsConsoleIO_fileno, METH_NOARGS, _io__WindowsConsoleIO_fileno__doc__}, + {"fileno", _io__WindowsConsoleIO_fileno, METH_NOARGS, _io__WindowsConsoleIO_fileno__doc__}, static PyObject * _io__WindowsConsoleIO_fileno_impl(winconsoleio *self); @@ -170,7 +170,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_readable__doc__, "True if console is an input buffer."); #define _IO__WINDOWSCONSOLEIO_READABLE_METHODDEF \ - {"readable", (PyCFunction)_io__WindowsConsoleIO_readable, METH_NOARGS, _io__WindowsConsoleIO_readable__doc__}, + {"readable", _io__WindowsConsoleIO_readable, METH_NOARGS, _io__WindowsConsoleIO_readable__doc__}, static PyObject * _io__WindowsConsoleIO_readable_impl(winconsoleio *self); @@ -192,7 +192,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_writable__doc__, "True if console is an output buffer."); #define _IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF \ - {"writable", (PyCFunction)_io__WindowsConsoleIO_writable, METH_NOARGS, _io__WindowsConsoleIO_writable__doc__}, + {"writable", _io__WindowsConsoleIO_writable, METH_NOARGS, _io__WindowsConsoleIO_writable__doc__}, static PyObject * _io__WindowsConsoleIO_writable_impl(winconsoleio *self); @@ -273,7 +273,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_readall__doc__, "Return an empty bytes object at EOF."); #define _IO__WINDOWSCONSOLEIO_READALL_METHODDEF \ - {"readall", (PyCFunction)_io__WindowsConsoleIO_readall, METH_NOARGS, _io__WindowsConsoleIO_readall__doc__}, + {"readall", _io__WindowsConsoleIO_readall, METH_NOARGS, _io__WindowsConsoleIO_readall__doc__}, static PyObject * _io__WindowsConsoleIO_readall_impl(winconsoleio *self); @@ -413,7 +413,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_isatty__doc__, "Always True."); #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF \ - {"isatty", (PyCFunction)_io__WindowsConsoleIO_isatty, METH_NOARGS, _io__WindowsConsoleIO_isatty__doc__}, + {"isatty", _io__WindowsConsoleIO_isatty, METH_NOARGS, _io__WindowsConsoleIO_isatty__doc__}, static PyObject * _io__WindowsConsoleIO_isatty_impl(winconsoleio *self); @@ -461,4 +461,4 @@ _io__WindowsConsoleIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=edc47f5c49589045 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=10c53819f68d4b50 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/multiprocessing.c.h b/Modules/_multiprocessing/clinic/multiprocessing.c.h index 6d4f5c2afcfd39..192a86f8819144 100644 --- a/Modules/_multiprocessing/clinic/multiprocessing.c.h +++ b/Modules/_multiprocessing/clinic/multiprocessing.c.h @@ -12,7 +12,7 @@ PyDoc_STRVAR(_multiprocessing_closesocket__doc__, "\n"); #define _MULTIPROCESSING_CLOSESOCKET_METHODDEF \ - {"closesocket", (PyCFunction)_multiprocessing_closesocket, METH_O, _multiprocessing_closesocket__doc__}, + {"closesocket", _multiprocessing_closesocket, METH_O, _multiprocessing_closesocket__doc__}, static PyObject * _multiprocessing_closesocket_impl(PyObject *module, HANDLE handle); @@ -123,7 +123,7 @@ PyDoc_STRVAR(_multiprocessing_sem_unlink__doc__, "\n"); #define _MULTIPROCESSING_SEM_UNLINK_METHODDEF \ - {"sem_unlink", (PyCFunction)_multiprocessing_sem_unlink, METH_O, _multiprocessing_sem_unlink__doc__}, + {"sem_unlink", _multiprocessing_sem_unlink, METH_O, _multiprocessing_sem_unlink__doc__}, static PyObject * _multiprocessing_sem_unlink_impl(PyObject *module, const char *name); @@ -164,4 +164,4 @@ _multiprocessing_sem_unlink(PyObject *module, PyObject *arg) #ifndef _MULTIPROCESSING_SEND_METHODDEF #define _MULTIPROCESSING_SEND_METHODDEF #endif /* !defined(_MULTIPROCESSING_SEND_METHODDEF) */ -/*[clinic end generated code: output=73b4cb8428d816da input=a9049054013a1b77]*/ +/*[clinic end generated code: output=978917b569b6ffb0 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/posixshmem.c.h b/Modules/_multiprocessing/clinic/posixshmem.c.h index a545ff4d80f067..2d0d4f17e55274 100644 --- a/Modules/_multiprocessing/clinic/posixshmem.c.h +++ b/Modules/_multiprocessing/clinic/posixshmem.c.h @@ -55,7 +55,7 @@ PyDoc_STRVAR(_posixshmem_shm_unlink__doc__, "region."); #define _POSIXSHMEM_SHM_UNLINK_METHODDEF \ - {"shm_unlink", (PyCFunction)_posixshmem_shm_unlink, METH_O, _posixshmem_shm_unlink__doc__}, + {"shm_unlink", _posixshmem_shm_unlink, METH_O, _posixshmem_shm_unlink__doc__}, static PyObject * _posixshmem_shm_unlink_impl(PyObject *module, PyObject *path); @@ -86,4 +86,4 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *arg) #ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF #define _POSIXSHMEM_SHM_UNLINK_METHODDEF #endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */ -/*[clinic end generated code: output=74588a5abba6e36c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=69688922c0d9548a input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/semaphore.c.h b/Modules/_multiprocessing/clinic/semaphore.c.h index 74a9daa3c67ad2..ee96ab2c731ed8 100644 --- a/Modules/_multiprocessing/clinic/semaphore.c.h +++ b/Modules/_multiprocessing/clinic/semaphore.c.h @@ -96,7 +96,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock_release__doc__, "Release the semaphore/lock."); #define _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF \ - {"release", (PyCFunction)_multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__}, + {"release", _multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__}, static PyObject * _multiprocessing_SemLock_release_impl(SemLockObject *self); @@ -202,7 +202,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock_release__doc__, "Release the semaphore/lock."); #define _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF \ - {"release", (PyCFunction)_multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__}, + {"release", _multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__}, static PyObject * _multiprocessing_SemLock_release_impl(SemLockObject *self); @@ -352,7 +352,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock__count__doc__, "Num of `acquire()`s minus num of `release()`s for this process."); #define _MULTIPROCESSING_SEMLOCK__COUNT_METHODDEF \ - {"_count", (PyCFunction)_multiprocessing_SemLock__count, METH_NOARGS, _multiprocessing_SemLock__count__doc__}, + {"_count", _multiprocessing_SemLock__count, METH_NOARGS, _multiprocessing_SemLock__count__doc__}, static PyObject * _multiprocessing_SemLock__count_impl(SemLockObject *self); @@ -380,7 +380,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock__is_mine__doc__, "Whether the lock is owned by this thread."); #define _MULTIPROCESSING_SEMLOCK__IS_MINE_METHODDEF \ - {"_is_mine", (PyCFunction)_multiprocessing_SemLock__is_mine, METH_NOARGS, _multiprocessing_SemLock__is_mine__doc__}, + {"_is_mine", _multiprocessing_SemLock__is_mine, METH_NOARGS, _multiprocessing_SemLock__is_mine__doc__}, static PyObject * _multiprocessing_SemLock__is_mine_impl(SemLockObject *self); @@ -402,7 +402,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock__get_value__doc__, "Get the value of the semaphore."); #define _MULTIPROCESSING_SEMLOCK__GET_VALUE_METHODDEF \ - {"_get_value", (PyCFunction)_multiprocessing_SemLock__get_value, METH_NOARGS, _multiprocessing_SemLock__get_value__doc__}, + {"_get_value", _multiprocessing_SemLock__get_value, METH_NOARGS, _multiprocessing_SemLock__get_value__doc__}, static PyObject * _multiprocessing_SemLock__get_value_impl(SemLockObject *self); @@ -424,7 +424,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock__is_zero__doc__, "Return whether semaphore has value zero."); #define _MULTIPROCESSING_SEMLOCK__IS_ZERO_METHODDEF \ - {"_is_zero", (PyCFunction)_multiprocessing_SemLock__is_zero, METH_NOARGS, _multiprocessing_SemLock__is_zero__doc__}, + {"_is_zero", _multiprocessing_SemLock__is_zero, METH_NOARGS, _multiprocessing_SemLock__is_zero__doc__}, static PyObject * _multiprocessing_SemLock__is_zero_impl(SemLockObject *self); @@ -446,7 +446,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock__after_fork__doc__, "Rezero the net acquisition count after fork()."); #define _MULTIPROCESSING_SEMLOCK__AFTER_FORK_METHODDEF \ - {"_after_fork", (PyCFunction)_multiprocessing_SemLock__after_fork, METH_NOARGS, _multiprocessing_SemLock__after_fork__doc__}, + {"_after_fork", _multiprocessing_SemLock__after_fork, METH_NOARGS, _multiprocessing_SemLock__after_fork__doc__}, static PyObject * _multiprocessing_SemLock__after_fork_impl(SemLockObject *self); @@ -468,7 +468,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock___enter____doc__, "Enter the semaphore/lock."); #define _MULTIPROCESSING_SEMLOCK___ENTER___METHODDEF \ - {"__enter__", (PyCFunction)_multiprocessing_SemLock___enter__, METH_NOARGS, _multiprocessing_SemLock___enter____doc__}, + {"__enter__", _multiprocessing_SemLock___enter__, METH_NOARGS, _multiprocessing_SemLock___enter____doc__}, static PyObject * _multiprocessing_SemLock___enter___impl(SemLockObject *self); @@ -576,4 +576,4 @@ _multiprocessing_SemLock___exit__(PyObject *self, PyObject *const *args, Py_ssiz #ifndef _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF #define _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF #endif /* !defined(_MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF) */ -/*[clinic end generated code: output=dddd8e989525f565 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5fb620cdc3ae67af input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/blob.c.h b/Modules/_sqlite/clinic/blob.c.h index 921e7cbd7ffcab..3e3e655ed2706f 100644 --- a/Modules/_sqlite/clinic/blob.c.h +++ b/Modules/_sqlite/clinic/blob.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(blob_close__doc__, "Close the blob."); #define BLOB_CLOSE_METHODDEF \ - {"close", (PyCFunction)blob_close, METH_NOARGS, blob_close__doc__}, + {"close", blob_close, METH_NOARGS, blob_close__doc__}, static PyObject * blob_close_impl(pysqlite_Blob *self); @@ -74,7 +74,7 @@ PyDoc_STRVAR(blob_write__doc__, "blob will result in an exception being raised."); #define BLOB_WRITE_METHODDEF \ - {"write", (PyCFunction)blob_write, METH_O, blob_write__doc__}, + {"write", blob_write, METH_O, blob_write__doc__}, static PyObject * blob_write_impl(pysqlite_Blob *self, Py_buffer *data); @@ -150,7 +150,7 @@ PyDoc_STRVAR(blob_tell__doc__, "Return the current access position for the blob."); #define BLOB_TELL_METHODDEF \ - {"tell", (PyCFunction)blob_tell, METH_NOARGS, blob_tell__doc__}, + {"tell", blob_tell, METH_NOARGS, blob_tell__doc__}, static PyObject * blob_tell_impl(pysqlite_Blob *self); @@ -168,7 +168,7 @@ PyDoc_STRVAR(blob_enter__doc__, "Blob context manager enter."); #define BLOB_ENTER_METHODDEF \ - {"__enter__", (PyCFunction)blob_enter, METH_NOARGS, blob_enter__doc__}, + {"__enter__", blob_enter, METH_NOARGS, blob_enter__doc__}, static PyObject * blob_enter_impl(pysqlite_Blob *self); @@ -211,4 +211,4 @@ blob_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=f03f4ba622b67ae0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bbd981c41a4b42e3 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/connection.c.h b/Modules/_sqlite/clinic/connection.c.h index bbdefe24a01370..dd525158a3f940 100644 --- a/Modules/_sqlite/clinic/connection.c.h +++ b/Modules/_sqlite/clinic/connection.c.h @@ -366,7 +366,7 @@ PyDoc_STRVAR(pysqlite_connection_close__doc__, "Any pending transaction is not committed implicitly."); #define PYSQLITE_CONNECTION_CLOSE_METHODDEF \ - {"close", (PyCFunction)pysqlite_connection_close, METH_NOARGS, pysqlite_connection_close__doc__}, + {"close", pysqlite_connection_close, METH_NOARGS, pysqlite_connection_close__doc__}, static PyObject * pysqlite_connection_close_impl(pysqlite_Connection *self); @@ -386,7 +386,7 @@ PyDoc_STRVAR(pysqlite_connection_commit__doc__, "If there is no open transaction, this method is a no-op."); #define PYSQLITE_CONNECTION_COMMIT_METHODDEF \ - {"commit", (PyCFunction)pysqlite_connection_commit, METH_NOARGS, pysqlite_connection_commit__doc__}, + {"commit", pysqlite_connection_commit, METH_NOARGS, pysqlite_connection_commit__doc__}, static PyObject * pysqlite_connection_commit_impl(pysqlite_Connection *self); @@ -406,7 +406,7 @@ PyDoc_STRVAR(pysqlite_connection_rollback__doc__, "If there is no open transaction, this method is a no-op."); #define PYSQLITE_CONNECTION_ROLLBACK_METHODDEF \ - {"rollback", (PyCFunction)pysqlite_connection_rollback, METH_NOARGS, pysqlite_connection_rollback__doc__}, + {"rollback", pysqlite_connection_rollback, METH_NOARGS, pysqlite_connection_rollback__doc__}, static PyObject * pysqlite_connection_rollback_impl(pysqlite_Connection *self); @@ -990,7 +990,7 @@ PyDoc_STRVAR(pysqlite_connection_enable_load_extension__doc__, "Enable dynamic loading of SQLite extension modules."); #define PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF \ - {"enable_load_extension", (PyCFunction)pysqlite_connection_enable_load_extension, METH_O, pysqlite_connection_enable_load_extension__doc__}, + {"enable_load_extension", pysqlite_connection_enable_load_extension, METH_O, pysqlite_connection_enable_load_extension__doc__}, static PyObject * pysqlite_connection_enable_load_extension_impl(pysqlite_Connection *self, @@ -1193,7 +1193,7 @@ PyDoc_STRVAR(pysqlite_connection_executescript__doc__, "Executes multiple SQL statements at once."); #define PYSQLITE_CONNECTION_EXECUTESCRIPT_METHODDEF \ - {"executescript", (PyCFunction)pysqlite_connection_executescript, METH_O, pysqlite_connection_executescript__doc__}, + {"executescript", pysqlite_connection_executescript, METH_O, pysqlite_connection_executescript__doc__}, static PyObject * pysqlite_connection_executescript_impl(pysqlite_Connection *self, @@ -1216,7 +1216,7 @@ PyDoc_STRVAR(pysqlite_connection_interrupt__doc__, "Abort any pending database operation."); #define PYSQLITE_CONNECTION_INTERRUPT_METHODDEF \ - {"interrupt", (PyCFunction)pysqlite_connection_interrupt, METH_NOARGS, pysqlite_connection_interrupt__doc__}, + {"interrupt", pysqlite_connection_interrupt, METH_NOARGS, pysqlite_connection_interrupt__doc__}, static PyObject * pysqlite_connection_interrupt_impl(pysqlite_Connection *self); @@ -1674,7 +1674,7 @@ PyDoc_STRVAR(pysqlite_connection_enter__doc__, "Returns itself as a convenience to the caller."); #define PYSQLITE_CONNECTION_ENTER_METHODDEF \ - {"__enter__", (PyCFunction)pysqlite_connection_enter, METH_NOARGS, pysqlite_connection_enter__doc__}, + {"__enter__", pysqlite_connection_enter, METH_NOARGS, pysqlite_connection_enter__doc__}, static PyObject * pysqlite_connection_enter_impl(pysqlite_Connection *self); @@ -1776,7 +1776,7 @@ PyDoc_STRVAR(getlimit__doc__, " The limit category to be queried."); #define GETLIMIT_METHODDEF \ - {"getlimit", (PyCFunction)getlimit, METH_O, getlimit__doc__}, + {"getlimit", getlimit, METH_O, getlimit__doc__}, static PyObject * getlimit_impl(pysqlite_Connection *self, int category); @@ -1850,7 +1850,7 @@ PyDoc_STRVAR(getconfig__doc__, " The configuration verb; one of the sqlite3.SQLITE_DBCONFIG codes."); #define GETCONFIG_METHODDEF \ - {"getconfig", (PyCFunction)getconfig, METH_O, getconfig__doc__}, + {"getconfig", getconfig, METH_O, getconfig__doc__}, static int getconfig_impl(pysqlite_Connection *self, int op); @@ -1895,4 +1895,4 @@ getconfig(PyObject *self, PyObject *arg) #ifndef DESERIALIZE_METHODDEF #define DESERIALIZE_METHODDEF #endif /* !defined(DESERIALIZE_METHODDEF) */ -/*[clinic end generated code: output=fc4857f09ad563b1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bd39929e8cd492bd input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/cursor.c.h b/Modules/_sqlite/clinic/cursor.c.h index 832ba2e43f02bb..276d2ad74f0e90 100644 --- a/Modules/_sqlite/clinic/cursor.c.h +++ b/Modules/_sqlite/clinic/cursor.c.h @@ -119,7 +119,7 @@ PyDoc_STRVAR(pysqlite_cursor_executescript__doc__, "Executes multiple SQL statements at once."); #define PYSQLITE_CURSOR_EXECUTESCRIPT_METHODDEF \ - {"executescript", (PyCFunction)pysqlite_cursor_executescript, METH_O, pysqlite_cursor_executescript__doc__}, + {"executescript", pysqlite_cursor_executescript, METH_O, pysqlite_cursor_executescript__doc__}, static PyObject * pysqlite_cursor_executescript_impl(pysqlite_Cursor *self, @@ -157,7 +157,7 @@ PyDoc_STRVAR(pysqlite_cursor_fetchone__doc__, "Fetches one row from the resultset."); #define PYSQLITE_CURSOR_FETCHONE_METHODDEF \ - {"fetchone", (PyCFunction)pysqlite_cursor_fetchone, METH_NOARGS, pysqlite_cursor_fetchone__doc__}, + {"fetchone", pysqlite_cursor_fetchone, METH_NOARGS, pysqlite_cursor_fetchone__doc__}, static PyObject * pysqlite_cursor_fetchone_impl(pysqlite_Cursor *self); @@ -242,7 +242,7 @@ PyDoc_STRVAR(pysqlite_cursor_fetchall__doc__, "Fetches all rows from the resultset."); #define PYSQLITE_CURSOR_FETCHALL_METHODDEF \ - {"fetchall", (PyCFunction)pysqlite_cursor_fetchall, METH_NOARGS, pysqlite_cursor_fetchall__doc__}, + {"fetchall", pysqlite_cursor_fetchall, METH_NOARGS, pysqlite_cursor_fetchall__doc__}, static PyObject * pysqlite_cursor_fetchall_impl(pysqlite_Cursor *self); @@ -260,7 +260,7 @@ PyDoc_STRVAR(pysqlite_cursor_setinputsizes__doc__, "Required by DB-API. Does nothing in sqlite3."); #define PYSQLITE_CURSOR_SETINPUTSIZES_METHODDEF \ - {"setinputsizes", (PyCFunction)pysqlite_cursor_setinputsizes, METH_O, pysqlite_cursor_setinputsizes__doc__}, + {"setinputsizes", pysqlite_cursor_setinputsizes, METH_O, pysqlite_cursor_setinputsizes__doc__}, static PyObject * pysqlite_cursor_setinputsizes_impl(pysqlite_Cursor *self, PyObject *sizes); @@ -317,7 +317,7 @@ PyDoc_STRVAR(pysqlite_cursor_close__doc__, "Closes the cursor."); #define PYSQLITE_CURSOR_CLOSE_METHODDEF \ - {"close", (PyCFunction)pysqlite_cursor_close, METH_NOARGS, pysqlite_cursor_close__doc__}, + {"close", pysqlite_cursor_close, METH_NOARGS, pysqlite_cursor_close__doc__}, static PyObject * pysqlite_cursor_close_impl(pysqlite_Cursor *self); @@ -327,4 +327,4 @@ pysqlite_cursor_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { return pysqlite_cursor_close_impl((pysqlite_Cursor *)self); } -/*[clinic end generated code: output=02831aed7377f5f6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e611823c9419a283 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/module.c.h b/Modules/_sqlite/clinic/module.c.h index 5569c45451647f..e7117ba2f88dd1 100644 --- a/Modules/_sqlite/clinic/module.c.h +++ b/Modules/_sqlite/clinic/module.c.h @@ -149,7 +149,7 @@ PyDoc_STRVAR(pysqlite_enable_callback_trace__doc__, "Enable or disable callback functions throwing errors to stderr."); #define PYSQLITE_ENABLE_CALLBACK_TRACE_METHODDEF \ - {"enable_callback_tracebacks", (PyCFunction)pysqlite_enable_callback_trace, METH_O, pysqlite_enable_callback_trace__doc__}, + {"enable_callback_tracebacks", pysqlite_enable_callback_trace, METH_O, pysqlite_enable_callback_trace__doc__}, static PyObject * pysqlite_enable_callback_trace_impl(PyObject *module, int enable); @@ -209,4 +209,4 @@ pysqlite_adapt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=db9bf7ecad197343 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e435309143741fb9 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/row.c.h b/Modules/_sqlite/clinic/row.c.h index 068906744e445f..cf89d4f20448fa 100644 --- a/Modules/_sqlite/clinic/row.c.h +++ b/Modules/_sqlite/clinic/row.c.h @@ -46,7 +46,7 @@ PyDoc_STRVAR(pysqlite_row_keys__doc__, "Returns the keys of the row."); #define PYSQLITE_ROW_KEYS_METHODDEF \ - {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS, pysqlite_row_keys__doc__}, + {"keys", pysqlite_row_keys, METH_NOARGS, pysqlite_row_keys__doc__}, static PyObject * pysqlite_row_keys_impl(pysqlite_Row *self); @@ -56,4 +56,4 @@ pysqlite_row_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) { return pysqlite_row_keys_impl((pysqlite_Row *)self); } -/*[clinic end generated code: output=6c1acbb48f386468 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=06ac9c8ba2f45699 input=a9049054013a1b77]*/ diff --git a/Modules/_sre/clinic/sre.c.h b/Modules/_sre/clinic/sre.c.h index 1f7e037351d1c6..a443b93b9b26f5 100644 --- a/Modules/_sre/clinic/sre.c.h +++ b/Modules/_sre/clinic/sre.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(_sre_getcodesize__doc__, "\n"); #define _SRE_GETCODESIZE_METHODDEF \ - {"getcodesize", (PyCFunction)_sre_getcodesize, METH_NOARGS, _sre_getcodesize__doc__}, + {"getcodesize", _sre_getcodesize, METH_NOARGS, _sre_getcodesize__doc__}, static int _sre_getcodesize_impl(PyObject *module); @@ -42,7 +42,7 @@ PyDoc_STRVAR(_sre_ascii_iscased__doc__, "\n"); #define _SRE_ASCII_ISCASED_METHODDEF \ - {"ascii_iscased", (PyCFunction)_sre_ascii_iscased, METH_O, _sre_ascii_iscased__doc__}, + {"ascii_iscased", _sre_ascii_iscased, METH_O, _sre_ascii_iscased__doc__}, static int _sre_ascii_iscased_impl(PyObject *module, int character); @@ -74,7 +74,7 @@ PyDoc_STRVAR(_sre_unicode_iscased__doc__, "\n"); #define _SRE_UNICODE_ISCASED_METHODDEF \ - {"unicode_iscased", (PyCFunction)_sre_unicode_iscased, METH_O, _sre_unicode_iscased__doc__}, + {"unicode_iscased", _sre_unicode_iscased, METH_O, _sre_unicode_iscased__doc__}, static int _sre_unicode_iscased_impl(PyObject *module, int character); @@ -106,7 +106,7 @@ PyDoc_STRVAR(_sre_ascii_tolower__doc__, "\n"); #define _SRE_ASCII_TOLOWER_METHODDEF \ - {"ascii_tolower", (PyCFunction)_sre_ascii_tolower, METH_O, _sre_ascii_tolower__doc__}, + {"ascii_tolower", _sre_ascii_tolower, METH_O, _sre_ascii_tolower__doc__}, static int _sre_ascii_tolower_impl(PyObject *module, int character); @@ -138,7 +138,7 @@ PyDoc_STRVAR(_sre_unicode_tolower__doc__, "\n"); #define _SRE_UNICODE_TOLOWER_METHODDEF \ - {"unicode_tolower", (PyCFunction)_sre_unicode_tolower, METH_O, _sre_unicode_tolower__doc__}, + {"unicode_tolower", _sre_unicode_tolower, METH_O, _sre_unicode_tolower__doc__}, static int _sre_unicode_tolower_impl(PyObject *module, int character); @@ -966,7 +966,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern___copy____doc__, "\n"); #define _SRE_SRE_PATTERN___COPY___METHODDEF \ - {"__copy__", (PyCFunction)_sre_SRE_Pattern___copy__, METH_NOARGS, _sre_SRE_Pattern___copy____doc__}, + {"__copy__", _sre_SRE_Pattern___copy__, METH_NOARGS, _sre_SRE_Pattern___copy____doc__}, static PyObject * _sre_SRE_Pattern___copy___impl(PatternObject *self); @@ -983,7 +983,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern___deepcopy____doc__, "\n"); #define _SRE_SRE_PATTERN___DEEPCOPY___METHODDEF \ - {"__deepcopy__", (PyCFunction)_sre_SRE_Pattern___deepcopy__, METH_O, _sre_SRE_Pattern___deepcopy____doc__}, + {"__deepcopy__", _sre_SRE_Pattern___deepcopy__, METH_O, _sre_SRE_Pattern___deepcopy____doc__}, static PyObject * _sre_SRE_Pattern___deepcopy___impl(PatternObject *self, PyObject *memo); @@ -1465,7 +1465,7 @@ PyDoc_STRVAR(_sre_SRE_Match___copy____doc__, "\n"); #define _SRE_SRE_MATCH___COPY___METHODDEF \ - {"__copy__", (PyCFunction)_sre_SRE_Match___copy__, METH_NOARGS, _sre_SRE_Match___copy____doc__}, + {"__copy__", _sre_SRE_Match___copy__, METH_NOARGS, _sre_SRE_Match___copy____doc__}, static PyObject * _sre_SRE_Match___copy___impl(MatchObject *self); @@ -1482,7 +1482,7 @@ PyDoc_STRVAR(_sre_SRE_Match___deepcopy____doc__, "\n"); #define _SRE_SRE_MATCH___DEEPCOPY___METHODDEF \ - {"__deepcopy__", (PyCFunction)_sre_SRE_Match___deepcopy__, METH_O, _sre_SRE_Match___deepcopy____doc__}, + {"__deepcopy__", _sre_SRE_Match___deepcopy__, METH_O, _sre_SRE_Match___deepcopy____doc__}, static PyObject * _sre_SRE_Match___deepcopy___impl(MatchObject *self, PyObject *memo); @@ -1542,4 +1542,4 @@ _sre_SRE_Scanner_search(PyObject *self, PyTypeObject *cls, PyObject *const *args #ifndef _SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF #define _SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF #endif /* !defined(_SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF) */ -/*[clinic end generated code: output=45baae8bdfafdc51 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=66dba0de5f21cfef input=a9049054013a1b77]*/ diff --git a/Modules/_ssl/clinic/cert.c.h b/Modules/_ssl/clinic/cert.c.h index 3e0c5b405092db..86a5fbb19b075b 100644 --- a/Modules/_ssl/clinic/cert.c.h +++ b/Modules/_ssl/clinic/cert.c.h @@ -77,7 +77,7 @@ PyDoc_STRVAR(_ssl_Certificate_get_info__doc__, "\n"); #define _SSL_CERTIFICATE_GET_INFO_METHODDEF \ - {"get_info", (PyCFunction)_ssl_Certificate_get_info, METH_NOARGS, _ssl_Certificate_get_info__doc__}, + {"get_info", _ssl_Certificate_get_info, METH_NOARGS, _ssl_Certificate_get_info__doc__}, static PyObject * _ssl_Certificate_get_info_impl(PySSLCertificate *self); @@ -87,4 +87,4 @@ _ssl_Certificate_get_info(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _ssl_Certificate_get_info_impl((PySSLCertificate *)self); } -/*[clinic end generated code: output=51365b498b975ee0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4a086ea89162137f input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/exceptions.c.h b/Modules/_testcapi/clinic/exceptions.c.h index 7c18bac0f686e2..bf6c432551426f 100644 --- a/Modules/_testcapi/clinic/exceptions.c.h +++ b/Modules/_testcapi/clinic/exceptions.c.h @@ -14,7 +14,7 @@ PyDoc_STRVAR(_testcapi_err_set_raised__doc__, "\n"); #define _TESTCAPI_ERR_SET_RAISED_METHODDEF \ - {"err_set_raised", (PyCFunction)_testcapi_err_set_raised, METH_O, _testcapi_err_set_raised__doc__}, + {"err_set_raised", _testcapi_err_set_raised, METH_O, _testcapi_err_set_raised__doc__}, PyDoc_STRVAR(_testcapi_exception_print__doc__, "exception_print($module, exception, legacy=False, /)\n" @@ -316,7 +316,7 @@ PyDoc_STRVAR(_testcapi_raise_memoryerror__doc__, "\n"); #define _TESTCAPI_RAISE_MEMORYERROR_METHODDEF \ - {"raise_memoryerror", (PyCFunction)_testcapi_raise_memoryerror, METH_NOARGS, _testcapi_raise_memoryerror__doc__}, + {"raise_memoryerror", _testcapi_raise_memoryerror, METH_NOARGS, _testcapi_raise_memoryerror__doc__}, static PyObject * _testcapi_raise_memoryerror_impl(PyObject *module); @@ -394,7 +394,7 @@ PyDoc_STRVAR(_testcapi_set_exception__doc__, "\n"); #define _TESTCAPI_SET_EXCEPTION_METHODDEF \ - {"set_exception", (PyCFunction)_testcapi_set_exception, METH_O, _testcapi_set_exception__doc__}, + {"set_exception", _testcapi_set_exception, METH_O, _testcapi_set_exception__doc__}, PyDoc_STRVAR(_testcapi_traceback_print__doc__, "traceback_print($module, traceback, file, /)\n" @@ -457,4 +457,4 @@ _testcapi_unstable_exc_prep_reraise_star(PyObject *module, PyObject *const *args exit: return return_value; } -/*[clinic end generated code: output=d917e9ec082e69ee input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c47d4b239c0cb5fc input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/file.c.h b/Modules/_testcapi/clinic/file.c.h index 6efb6b47353443..01b0618e941e5d 100644 --- a/Modules/_testcapi/clinic/file.c.h +++ b/Modules/_testcapi/clinic/file.c.h @@ -10,7 +10,7 @@ PyDoc_STRVAR(_testcapi_pyfile_newstdprinter__doc__, "\n"); #define _TESTCAPI_PYFILE_NEWSTDPRINTER_METHODDEF \ - {"pyfile_newstdprinter", (PyCFunction)_testcapi_pyfile_newstdprinter, METH_O, _testcapi_pyfile_newstdprinter__doc__}, + {"pyfile_newstdprinter", _testcapi_pyfile_newstdprinter, METH_O, _testcapi_pyfile_newstdprinter__doc__}, static PyObject * _testcapi_pyfile_newstdprinter_impl(PyObject *module, int fd); @@ -61,4 +61,4 @@ _testcapi_py_fopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=e943bbd7f181d079 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9a88e7c10f6c58d5 input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/long.c.h b/Modules/_testcapi/clinic/long.c.h index 767c671abb8eae..3e43c9959e8c2e 100644 --- a/Modules/_testcapi/clinic/long.c.h +++ b/Modules/_testcapi/clinic/long.c.h @@ -8,5 +8,5 @@ PyDoc_STRVAR(_testcapi_call_long_compact_api__doc__, "\n"); #define _TESTCAPI_CALL_LONG_COMPACT_API_METHODDEF \ - {"call_long_compact_api", (PyCFunction)_testcapi_call_long_compact_api, METH_O, _testcapi_call_long_compact_api__doc__}, -/*[clinic end generated code: output=0ddcbc6ea06e5e21 input=a9049054013a1b77]*/ + {"call_long_compact_api", _testcapi_call_long_compact_api, METH_O, _testcapi_call_long_compact_api__doc__}, +/*[clinic end generated code: output=45f2a3cf1aa74fbb input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/vectorcall.c.h b/Modules/_testcapi/clinic/vectorcall.c.h index c6049a438dc8fc..a110e24c0497cb 100644 --- a/Modules/_testcapi/clinic/vectorcall.c.h +++ b/Modules/_testcapi/clinic/vectorcall.c.h @@ -111,7 +111,7 @@ PyDoc_STRVAR(_testcapi_VectorCallClass_set_vectorcall__doc__, "Set self\'s vectorcall function for `type` to one that returns \"vectorcall\""); #define _TESTCAPI_VECTORCALLCLASS_SET_VECTORCALL_METHODDEF \ - {"set_vectorcall", (PyCFunction)_testcapi_VectorCallClass_set_vectorcall, METH_O, _testcapi_VectorCallClass_set_vectorcall__doc__}, + {"set_vectorcall", _testcapi_VectorCallClass_set_vectorcall, METH_O, _testcapi_VectorCallClass_set_vectorcall__doc__}, static PyObject * _testcapi_VectorCallClass_set_vectorcall_impl(PyObject *self, @@ -180,7 +180,7 @@ PyDoc_STRVAR(_testcapi_has_vectorcall_flag__doc__, "Return true iff Py_TPFLAGS_HAVE_VECTORCALL is set on the class."); #define _TESTCAPI_HAS_VECTORCALL_FLAG_METHODDEF \ - {"has_vectorcall_flag", (PyCFunction)_testcapi_has_vectorcall_flag, METH_O, _testcapi_has_vectorcall_flag__doc__}, + {"has_vectorcall_flag", _testcapi_has_vectorcall_flag, METH_O, _testcapi_has_vectorcall_flag__doc__}, static int _testcapi_has_vectorcall_flag_impl(PyObject *module, PyTypeObject *type); @@ -206,4 +206,4 @@ _testcapi_has_vectorcall_flag(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=210ae67caab177ba input=a9049054013a1b77]*/ +/*[clinic end generated code: output=02ce0c764988bb3e input=a9049054013a1b77]*/ diff --git a/Modules/_testclinic.c b/Modules/_testclinic.c index a5c4a4c40b3949..7b937191490237 100644 --- a/Modules/_testclinic.c +++ b/Modules/_testclinic.c @@ -1444,8 +1444,9 @@ _testclinic_TestClass_defclass_posonly_varpos_impl(PyObject *self, /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as varpos_no_fastcall +_testclinic.TestClass.class_method as varpos_no_fastcall *args: tuple @@ -1453,15 +1454,16 @@ _testclinic.TestClass.__new__ as varpos_no_fastcall static PyObject * varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) -/*[clinic end generated code: output=04e94f2898bb2dde input=c5d3d30a6589f97f]*/ +/*[clinic end generated code: output=04e94f2898bb2dde input=10c2251e9ac6baf3]*/ { return Py_NewRef(args); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_varpos_no_fastcall +_testclinic.TestClass.class_method as posonly_varpos_no_fastcall a: object b: object @@ -1473,15 +1475,16 @@ _testclinic.TestClass.__new__ as posonly_varpos_no_fastcall static PyObject * posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=b0a0425719f69f5a input=10f29f2c2c6bfdc4]*/ +/*[clinic end generated code: output=b0a0425719f69f5a input=f7c75501a787c7af]*/ { return pack_arguments_newref(3, a, b, args); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_req_opt_varpos_no_fastcall +_testclinic.TestClass.class_method as posonly_req_opt_varpos_no_fastcall a: object b: object = False @@ -1493,15 +1496,16 @@ _testclinic.TestClass.__new__ as posonly_req_opt_varpos_no_fastcall static PyObject * posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=3c44915b1a554e2d input=d319302a8748147c]*/ +/*[clinic end generated code: output=3c44915b1a554e2d input=701bf93e7572e6b3]*/ { return pack_arguments_newref(3, a, b, args); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_poskw_varpos_no_fastcall +_testclinic.TestClass.class_method as posonly_poskw_varpos_no_fastcall a: object / @@ -1513,15 +1517,16 @@ _testclinic.TestClass.__new__ as posonly_poskw_varpos_no_fastcall static PyObject * posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=6ad74bed4bdc7f96 input=1f8c113e749414a3]*/ +/*[clinic end generated code: output=6ad74bed4bdc7f96 input=2bbbc74dc92ba7ba]*/ { return pack_arguments_newref(3, a, b, args); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as varpos_array_no_fastcall +_testclinic.TestClass.class_method as varpos_array_no_fastcall *args: array @@ -1530,15 +1535,16 @@ _testclinic.TestClass.__new__ as varpos_array_no_fastcall static PyObject * varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=f99d984346c60d42 input=368d8eea6de48c12]*/ +/*[clinic end generated code: output=f99d984346c60d42 input=de625878254ecac0]*/ { return _PyTuple_FromArray(args, args_length); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_varpos_array_no_fastcall +_testclinic.TestClass.class_method as posonly_varpos_array_no_fastcall a: object b: object @@ -1551,15 +1557,16 @@ static PyObject * posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=1eec4da1fb5b5978 input=7330c8d819a23548]*/ +/*[clinic end generated code: output=1eec4da1fb5b5978 input=15adeb514423f485]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_req_opt_varpos_array_no_fastcall +_testclinic.TestClass.class_method as posonly_req_opt_varpos_array_no_fastcall a: object b: object = False @@ -1573,15 +1580,16 @@ posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=88041c2176135218 input=7f5fd34ee5f9e0bf]*/ +/*[clinic end generated code: output=88041c2176135218 input=445ff173a49709d5]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_poskw_varpos_array_no_fastcall +_testclinic.TestClass.class_method as posonly_poskw_varpos_array_no_fastcall a: object / @@ -1595,7 +1603,7 @@ posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=70eda18c3667681e input=2b0fcd7bd9bb865c]*/ +/*[clinic end generated code: output=70eda18c3667681e input=c0ac0f6b990f553c]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } @@ -1607,11 +1615,11 @@ static struct PyMethodDef test_class_methods[] = { _TESTCLINIC_TESTCLASS_DEFCLASS_POSONLY_VARPOS_METHODDEF {"varpos_no_fastcall", _PyCFunction_CAST(varpos_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + METH_VARARGS|METH_CLASS, ""}, {"posonly_varpos_no_fastcall", _PyCFunction_CAST(posonly_varpos_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + METH_VARARGS|METH_CLASS, ""}, {"posonly_req_opt_varpos_no_fastcall", _PyCFunction_CAST(posonly_req_opt_varpos_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + METH_VARARGS|METH_CLASS, ""}, {"posonly_poskw_varpos_no_fastcall", _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, diff --git a/Modules/_testlimitedcapi/clinic/file.c.h b/Modules/_testlimitedcapi/clinic/file.c.h index 663619eead2a3a..a8dd9db9d876c6 100644 --- a/Modules/_testlimitedcapi/clinic/file.c.h +++ b/Modules/_testlimitedcapi/clinic/file.c.h @@ -77,5 +77,5 @@ PyDoc_STRVAR(_testcapi_pyobject_asfiledescriptor__doc__, "\n"); #define _TESTCAPI_PYOBJECT_ASFILEDESCRIPTOR_METHODDEF \ - {"pyobject_asfiledescriptor", (PyCFunction)_testcapi_pyobject_asfiledescriptor, METH_O, _testcapi_pyobject_asfiledescriptor__doc__}, -/*[clinic end generated code: output=ea572aaaa01aec7b input=a9049054013a1b77]*/ + {"pyobject_asfiledescriptor", _testcapi_pyobject_asfiledescriptor, METH_O, _testcapi_pyobject_asfiledescriptor__doc__}, +/*[clinic end generated code: output=fb0d76fd0f7d8035 input=a9049054013a1b77]*/ diff --git a/Modules/_testlimitedcapi/clinic/long.c.h b/Modules/_testlimitedcapi/clinic/long.c.h index ebaeb53921a82f..c98e3b1151cef1 100644 --- a/Modules/_testlimitedcapi/clinic/long.c.h +++ b/Modules/_testlimitedcapi/clinic/long.c.h @@ -8,7 +8,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_api__doc__, "\n"); #define _TESTLIMITEDCAPI_TEST_LONG_API_METHODDEF \ - {"test_long_api", (PyCFunction)_testlimitedcapi_test_long_api, METH_NOARGS, _testlimitedcapi_test_long_api__doc__}, + {"test_long_api", _testlimitedcapi_test_long_api, METH_NOARGS, _testlimitedcapi_test_long_api__doc__}, static PyObject * _testlimitedcapi_test_long_api_impl(PyObject *module); @@ -25,7 +25,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_longlong_api__doc__, "\n"); #define _TESTLIMITEDCAPI_TEST_LONGLONG_API_METHODDEF \ - {"test_longlong_api", (PyCFunction)_testlimitedcapi_test_longlong_api, METH_NOARGS, _testlimitedcapi_test_longlong_api__doc__}, + {"test_longlong_api", _testlimitedcapi_test_longlong_api, METH_NOARGS, _testlimitedcapi_test_longlong_api__doc__}, static PyObject * _testlimitedcapi_test_longlong_api_impl(PyObject *module); @@ -46,7 +46,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_and_overflow__doc__, "This test will concentrate on proper handling of overflow."); #define _TESTLIMITEDCAPI_TEST_LONG_AND_OVERFLOW_METHODDEF \ - {"test_long_and_overflow", (PyCFunction)_testlimitedcapi_test_long_and_overflow, METH_NOARGS, _testlimitedcapi_test_long_and_overflow__doc__}, + {"test_long_and_overflow", _testlimitedcapi_test_long_and_overflow, METH_NOARGS, _testlimitedcapi_test_long_and_overflow__doc__}, static PyObject * _testlimitedcapi_test_long_and_overflow_impl(PyObject *module); @@ -67,7 +67,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_long_and_overflow__doc__, "This test will concentrate on proper handling of overflow."); #define _TESTLIMITEDCAPI_TEST_LONG_LONG_AND_OVERFLOW_METHODDEF \ - {"test_long_long_and_overflow", (PyCFunction)_testlimitedcapi_test_long_long_and_overflow, METH_NOARGS, _testlimitedcapi_test_long_long_and_overflow__doc__}, + {"test_long_long_and_overflow", _testlimitedcapi_test_long_long_and_overflow, METH_NOARGS, _testlimitedcapi_test_long_long_and_overflow__doc__}, static PyObject * _testlimitedcapi_test_long_long_and_overflow_impl(PyObject *module); @@ -88,7 +88,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_as_size_t__doc__, "It should be extended to test overflow handling."); #define _TESTLIMITEDCAPI_TEST_LONG_AS_SIZE_T_METHODDEF \ - {"test_long_as_size_t", (PyCFunction)_testlimitedcapi_test_long_as_size_t, METH_NOARGS, _testlimitedcapi_test_long_as_size_t__doc__}, + {"test_long_as_size_t", _testlimitedcapi_test_long_as_size_t, METH_NOARGS, _testlimitedcapi_test_long_as_size_t__doc__}, static PyObject * _testlimitedcapi_test_long_as_size_t_impl(PyObject *module); @@ -105,7 +105,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_as_unsigned_long_long_mask__doc__, "\n"); #define _TESTLIMITEDCAPI_TEST_LONG_AS_UNSIGNED_LONG_LONG_MASK_METHODDEF \ - {"test_long_as_unsigned_long_long_mask", (PyCFunction)_testlimitedcapi_test_long_as_unsigned_long_long_mask, METH_NOARGS, _testlimitedcapi_test_long_as_unsigned_long_long_mask__doc__}, + {"test_long_as_unsigned_long_long_mask", _testlimitedcapi_test_long_as_unsigned_long_long_mask, METH_NOARGS, _testlimitedcapi_test_long_as_unsigned_long_long_mask__doc__}, static PyObject * _testlimitedcapi_test_long_as_unsigned_long_long_mask_impl(PyObject *module); @@ -122,7 +122,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_as_double__doc__, "\n"); #define _TESTLIMITEDCAPI_TEST_LONG_AS_DOUBLE_METHODDEF \ - {"test_long_as_double", (PyCFunction)_testlimitedcapi_test_long_as_double, METH_NOARGS, _testlimitedcapi_test_long_as_double__doc__}, + {"test_long_as_double", _testlimitedcapi_test_long_as_double, METH_NOARGS, _testlimitedcapi_test_long_as_double__doc__}, static PyObject * _testlimitedcapi_test_long_as_double_impl(PyObject *module); @@ -139,5 +139,5 @@ PyDoc_STRVAR(_testlimitedcapi_PyLong_AsInt__doc__, "\n"); #define _TESTLIMITEDCAPI_PYLONG_ASINT_METHODDEF \ - {"PyLong_AsInt", (PyCFunction)_testlimitedcapi_PyLong_AsInt, METH_O, _testlimitedcapi_PyLong_AsInt__doc__}, -/*[clinic end generated code: output=bc52b73c599f96c2 input=a9049054013a1b77]*/ + {"PyLong_AsInt", _testlimitedcapi_PyLong_AsInt, METH_O, _testlimitedcapi_PyLong_AsInt__doc__}, +/*[clinic end generated code: output=b2d9fb30e9c058f5 input=a9049054013a1b77]*/ diff --git a/Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h b/Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h index 6631a9c42deab0..4babbdd592b970 100644 --- a/Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h +++ b/Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h @@ -8,7 +8,7 @@ PyDoc_STRVAR(_testlimitedcapi_call_vectorcall__doc__, "\n"); #define _TESTLIMITEDCAPI_CALL_VECTORCALL_METHODDEF \ - {"call_vectorcall", (PyCFunction)_testlimitedcapi_call_vectorcall, METH_O, _testlimitedcapi_call_vectorcall__doc__}, + {"call_vectorcall", _testlimitedcapi_call_vectorcall, METH_O, _testlimitedcapi_call_vectorcall__doc__}, PyDoc_STRVAR(_testlimitedcapi_call_vectorcall_method__doc__, "call_vectorcall_method($module, callable, /)\n" @@ -16,5 +16,5 @@ PyDoc_STRVAR(_testlimitedcapi_call_vectorcall_method__doc__, "\n"); #define _TESTLIMITEDCAPI_CALL_VECTORCALL_METHOD_METHODDEF \ - {"call_vectorcall_method", (PyCFunction)_testlimitedcapi_call_vectorcall_method, METH_O, _testlimitedcapi_call_vectorcall_method__doc__}, -/*[clinic end generated code: output=5976b9b360e1ff30 input=a9049054013a1b77]*/ + {"call_vectorcall_method", _testlimitedcapi_call_vectorcall_method, METH_O, _testlimitedcapi_call_vectorcall_method__doc__}, +/*[clinic end generated code: output=7d87830093608031 input=a9049054013a1b77]*/ diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index d77bbd48066354..fe26a110bbdde7 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -262,7 +262,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_getstate__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_GETSTATE_METHODDEF \ - {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_getstate__doc__}, + {"getstate", _multibytecodec_MultibyteIncrementalEncoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_getstate__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEncoderObject *self); @@ -279,7 +279,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_setstate__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_SETSTATE_METHODDEF \ - {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalEncoder_setstate__doc__}, + {"setstate", _multibytecodec_MultibyteIncrementalEncoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalEncoder_setstate__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalEncoder_setstate_impl(MultibyteIncrementalEncoderObject *self, @@ -308,7 +308,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_reset__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF \ - {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__}, + {"reset", _multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self); @@ -399,7 +399,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_getstate__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_GETSTATE_METHODDEF \ - {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_getstate__doc__}, + {"getstate", _multibytecodec_MultibyteIncrementalDecoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_getstate__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDecoderObject *self); @@ -416,7 +416,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_setstate__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_SETSTATE_METHODDEF \ - {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalDecoder_setstate__doc__}, + {"setstate", _multibytecodec_MultibyteIncrementalDecoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalDecoder_setstate__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDecoderObject *self, @@ -445,7 +445,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_reset__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF \ - {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__}, + {"reset", _multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self); @@ -558,7 +558,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_reset__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_RESET_METHODDEF \ - {"reset", (PyCFunction)_multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__}, + {"reset", _multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__}, static PyObject * _multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self); @@ -687,5 +687,5 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, "\n"); #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ - {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=6571941b8e45b013 input=a9049054013a1b77]*/ + {"__create_codec", _multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, +/*[clinic end generated code: output=9c591aee2ee1a3bf input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_abc.c.h b/Modules/clinic/_abc.c.h index 04681fa2206a2a..3f8a3ca34cb690 100644 --- a/Modules/clinic/_abc.c.h +++ b/Modules/clinic/_abc.c.h @@ -13,7 +13,7 @@ PyDoc_STRVAR(_abc__reset_registry__doc__, "Should be only used by refleak.py"); #define _ABC__RESET_REGISTRY_METHODDEF \ - {"_reset_registry", (PyCFunction)_abc__reset_registry, METH_O, _abc__reset_registry__doc__}, + {"_reset_registry", _abc__reset_registry, METH_O, _abc__reset_registry__doc__}, PyDoc_STRVAR(_abc__reset_caches__doc__, "_reset_caches($module, self, /)\n" @@ -24,7 +24,7 @@ PyDoc_STRVAR(_abc__reset_caches__doc__, "Should be only used by refleak.py"); #define _ABC__RESET_CACHES_METHODDEF \ - {"_reset_caches", (PyCFunction)_abc__reset_caches, METH_O, _abc__reset_caches__doc__}, + {"_reset_caches", _abc__reset_caches, METH_O, _abc__reset_caches__doc__}, PyDoc_STRVAR(_abc__get_dump__doc__, "_get_dump($module, self, /)\n" @@ -37,7 +37,7 @@ PyDoc_STRVAR(_abc__get_dump__doc__, "instead use ABC._dump_registry() for a nice repr."); #define _ABC__GET_DUMP_METHODDEF \ - {"_get_dump", (PyCFunction)_abc__get_dump, METH_O, _abc__get_dump__doc__}, + {"_get_dump", _abc__get_dump, METH_O, _abc__get_dump__doc__}, PyDoc_STRVAR(_abc__abc_init__doc__, "_abc_init($module, self, /)\n" @@ -46,7 +46,7 @@ PyDoc_STRVAR(_abc__abc_init__doc__, "Internal ABC helper for class set-up. Should be never used outside abc module."); #define _ABC__ABC_INIT_METHODDEF \ - {"_abc_init", (PyCFunction)_abc__abc_init, METH_O, _abc__abc_init__doc__}, + {"_abc_init", _abc__abc_init, METH_O, _abc__abc_init__doc__}, PyDoc_STRVAR(_abc__abc_register__doc__, "_abc_register($module, self, subclass, /)\n" @@ -151,7 +151,7 @@ PyDoc_STRVAR(_abc_get_cache_token__doc__, "with every call to register() on any ABC."); #define _ABC_GET_CACHE_TOKEN_METHODDEF \ - {"get_cache_token", (PyCFunction)_abc_get_cache_token, METH_NOARGS, _abc_get_cache_token__doc__}, + {"get_cache_token", _abc_get_cache_token, METH_NOARGS, _abc_get_cache_token__doc__}, static PyObject * _abc_get_cache_token_impl(PyObject *module); @@ -161,4 +161,4 @@ _abc_get_cache_token(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _abc_get_cache_token_impl(module); } -/*[clinic end generated code: output=1989b6716c950e17 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a180fd3274c1a4f7 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_asynciomodule.c.h b/Modules/clinic/_asynciomodule.c.h index d529b09bd1529f..0480e06234fbc1 100644 --- a/Modules/clinic/_asynciomodule.c.h +++ b/Modules/clinic/_asynciomodule.c.h @@ -91,7 +91,7 @@ PyDoc_STRVAR(_asyncio_Future_result__doc__, "the future is done and has an exception set, this exception is raised."); #define _ASYNCIO_FUTURE_RESULT_METHODDEF \ - {"result", (PyCFunction)_asyncio_Future_result, METH_NOARGS, _asyncio_Future_result__doc__}, + {"result", _asyncio_Future_result, METH_NOARGS, _asyncio_Future_result__doc__}, static PyObject * _asyncio_Future_result_impl(FutureObj *self); @@ -436,7 +436,7 @@ PyDoc_STRVAR(_asyncio_Future_cancelled__doc__, "Return True if the future was cancelled."); #define _ASYNCIO_FUTURE_CANCELLED_METHODDEF \ - {"cancelled", (PyCFunction)_asyncio_Future_cancelled, METH_NOARGS, _asyncio_Future_cancelled__doc__}, + {"cancelled", _asyncio_Future_cancelled, METH_NOARGS, _asyncio_Future_cancelled__doc__}, static PyObject * _asyncio_Future_cancelled_impl(FutureObj *self); @@ -463,7 +463,7 @@ PyDoc_STRVAR(_asyncio_Future_done__doc__, "future was cancelled."); #define _ASYNCIO_FUTURE_DONE_METHODDEF \ - {"done", (PyCFunction)_asyncio_Future_done, METH_NOARGS, _asyncio_Future_done__doc__}, + {"done", _asyncio_Future_done, METH_NOARGS, _asyncio_Future_done__doc__}, static PyObject * _asyncio_Future_done_impl(FutureObj *self); @@ -845,7 +845,7 @@ PyDoc_STRVAR(_asyncio_Future__make_cancelled_error__doc__, "it erases the context exception value."); #define _ASYNCIO_FUTURE__MAKE_CANCELLED_ERROR_METHODDEF \ - {"_make_cancelled_error", (PyCFunction)_asyncio_Future__make_cancelled_error, METH_NOARGS, _asyncio_Future__make_cancelled_error__doc__}, + {"_make_cancelled_error", _asyncio_Future__make_cancelled_error, METH_NOARGS, _asyncio_Future__make_cancelled_error__doc__}, static PyObject * _asyncio_Future__make_cancelled_error_impl(FutureObj *self); @@ -1085,7 +1085,7 @@ PyDoc_STRVAR(_asyncio_Task__make_cancelled_error__doc__, "it erases the context exception value."); #define _ASYNCIO_TASK__MAKE_CANCELLED_ERROR_METHODDEF \ - {"_make_cancelled_error", (PyCFunction)_asyncio_Task__make_cancelled_error, METH_NOARGS, _asyncio_Task__make_cancelled_error__doc__}, + {"_make_cancelled_error", _asyncio_Task__make_cancelled_error, METH_NOARGS, _asyncio_Task__make_cancelled_error__doc__}, static PyObject * _asyncio_Task__make_cancelled_error_impl(TaskObj *self); @@ -1194,7 +1194,7 @@ PyDoc_STRVAR(_asyncio_Task_cancelling__doc__, "and may be decremented using .uncancel()."); #define _ASYNCIO_TASK_CANCELLING_METHODDEF \ - {"cancelling", (PyCFunction)_asyncio_Task_cancelling, METH_NOARGS, _asyncio_Task_cancelling__doc__}, + {"cancelling", _asyncio_Task_cancelling, METH_NOARGS, _asyncio_Task_cancelling__doc__}, static PyObject * _asyncio_Task_cancelling_impl(TaskObj *self); @@ -1223,7 +1223,7 @@ PyDoc_STRVAR(_asyncio_Task_uncancel__doc__, "Returns the remaining number of cancellation requests."); #define _ASYNCIO_TASK_UNCANCEL_METHODDEF \ - {"uncancel", (PyCFunction)_asyncio_Task_uncancel, METH_NOARGS, _asyncio_Task_uncancel__doc__}, + {"uncancel", _asyncio_Task_uncancel, METH_NOARGS, _asyncio_Task_uncancel__doc__}, static PyObject * _asyncio_Task_uncancel_impl(TaskObj *self); @@ -1401,7 +1401,7 @@ PyDoc_STRVAR(_asyncio_Task_set_result__doc__, "\n"); #define _ASYNCIO_TASK_SET_RESULT_METHODDEF \ - {"set_result", (PyCFunction)_asyncio_Task_set_result, METH_O, _asyncio_Task_set_result__doc__}, + {"set_result", _asyncio_Task_set_result, METH_O, _asyncio_Task_set_result__doc__}, static PyObject * _asyncio_Task_set_result_impl(TaskObj *self, PyObject *result); @@ -1422,7 +1422,7 @@ PyDoc_STRVAR(_asyncio_Task_set_exception__doc__, "\n"); #define _ASYNCIO_TASK_SET_EXCEPTION_METHODDEF \ - {"set_exception", (PyCFunction)_asyncio_Task_set_exception, METH_O, _asyncio_Task_set_exception__doc__}, + {"set_exception", _asyncio_Task_set_exception, METH_O, _asyncio_Task_set_exception__doc__}, static PyObject * _asyncio_Task_set_exception_impl(TaskObj *self, PyObject *exception); @@ -1443,7 +1443,7 @@ PyDoc_STRVAR(_asyncio_Task_get_coro__doc__, "\n"); #define _ASYNCIO_TASK_GET_CORO_METHODDEF \ - {"get_coro", (PyCFunction)_asyncio_Task_get_coro, METH_NOARGS, _asyncio_Task_get_coro__doc__}, + {"get_coro", _asyncio_Task_get_coro, METH_NOARGS, _asyncio_Task_get_coro__doc__}, static PyObject * _asyncio_Task_get_coro_impl(TaskObj *self); @@ -1466,7 +1466,7 @@ PyDoc_STRVAR(_asyncio_Task_get_context__doc__, "\n"); #define _ASYNCIO_TASK_GET_CONTEXT_METHODDEF \ - {"get_context", (PyCFunction)_asyncio_Task_get_context, METH_NOARGS, _asyncio_Task_get_context__doc__}, + {"get_context", _asyncio_Task_get_context, METH_NOARGS, _asyncio_Task_get_context__doc__}, static PyObject * _asyncio_Task_get_context_impl(TaskObj *self); @@ -1483,7 +1483,7 @@ PyDoc_STRVAR(_asyncio_Task_get_name__doc__, "\n"); #define _ASYNCIO_TASK_GET_NAME_METHODDEF \ - {"get_name", (PyCFunction)_asyncio_Task_get_name, METH_NOARGS, _asyncio_Task_get_name__doc__}, + {"get_name", _asyncio_Task_get_name, METH_NOARGS, _asyncio_Task_get_name__doc__}, static PyObject * _asyncio_Task_get_name_impl(TaskObj *self); @@ -1506,7 +1506,7 @@ PyDoc_STRVAR(_asyncio_Task_set_name__doc__, "\n"); #define _ASYNCIO_TASK_SET_NAME_METHODDEF \ - {"set_name", (PyCFunction)_asyncio_Task_set_name, METH_O, _asyncio_Task_set_name__doc__}, + {"set_name", _asyncio_Task_set_name, METH_O, _asyncio_Task_set_name__doc__}, static PyObject * _asyncio_Task_set_name_impl(TaskObj *self, PyObject *value); @@ -1533,7 +1533,7 @@ PyDoc_STRVAR(_asyncio__get_running_loop__doc__, "This function is thread-specific."); #define _ASYNCIO__GET_RUNNING_LOOP_METHODDEF \ - {"_get_running_loop", (PyCFunction)_asyncio__get_running_loop, METH_NOARGS, _asyncio__get_running_loop__doc__}, + {"_get_running_loop", _asyncio__get_running_loop, METH_NOARGS, _asyncio__get_running_loop__doc__}, static PyObject * _asyncio__get_running_loop_impl(PyObject *module); @@ -1554,7 +1554,7 @@ PyDoc_STRVAR(_asyncio__set_running_loop__doc__, "This function is thread-specific."); #define _ASYNCIO__SET_RUNNING_LOOP_METHODDEF \ - {"_set_running_loop", (PyCFunction)_asyncio__set_running_loop, METH_O, _asyncio__set_running_loop__doc__}, + {"_set_running_loop", _asyncio__set_running_loop, METH_O, _asyncio__set_running_loop__doc__}, PyDoc_STRVAR(_asyncio_get_event_loop__doc__, "get_event_loop($module, /)\n" @@ -1570,7 +1570,7 @@ PyDoc_STRVAR(_asyncio_get_event_loop__doc__, "the result of `get_event_loop_policy().get_event_loop()` call."); #define _ASYNCIO_GET_EVENT_LOOP_METHODDEF \ - {"get_event_loop", (PyCFunction)_asyncio_get_event_loop, METH_NOARGS, _asyncio_get_event_loop__doc__}, + {"get_event_loop", _asyncio_get_event_loop, METH_NOARGS, _asyncio_get_event_loop__doc__}, static PyObject * _asyncio_get_event_loop_impl(PyObject *module); @@ -1590,7 +1590,7 @@ PyDoc_STRVAR(_asyncio_get_running_loop__doc__, "This function is thread-specific."); #define _ASYNCIO_GET_RUNNING_LOOP_METHODDEF \ - {"get_running_loop", (PyCFunction)_asyncio_get_running_loop, METH_NOARGS, _asyncio_get_running_loop__doc__}, + {"get_running_loop", _asyncio_get_running_loop, METH_NOARGS, _asyncio_get_running_loop__doc__}, static PyObject * _asyncio_get_running_loop_impl(PyObject *module); @@ -2200,4 +2200,4 @@ _asyncio_future_discard_from_awaited_by(PyObject *module, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=b1060b180d9dd54c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=02be76f30a66fa14 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index a599bd1a8be96a..01f1030997aefb 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -21,7 +21,7 @@ PyDoc_STRVAR(_bz2_BZ2Compressor_compress__doc__, "flush() method to finish the compression process."); #define _BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF \ - {"compress", (PyCFunction)_bz2_BZ2Compressor_compress, METH_O, _bz2_BZ2Compressor_compress__doc__}, + {"compress", _bz2_BZ2Compressor_compress, METH_O, _bz2_BZ2Compressor_compress__doc__}, static PyObject * _bz2_BZ2Compressor_compress_impl(BZ2Compressor *self, Py_buffer *data); @@ -57,7 +57,7 @@ PyDoc_STRVAR(_bz2_BZ2Compressor_flush__doc__, "The compressor object may not be used after this method is called."); #define _BZ2_BZ2COMPRESSOR_FLUSH_METHODDEF \ - {"flush", (PyCFunction)_bz2_BZ2Compressor_flush, METH_NOARGS, _bz2_BZ2Compressor_flush__doc__}, + {"flush", _bz2_BZ2Compressor_flush, METH_NOARGS, _bz2_BZ2Compressor_flush__doc__}, static PyObject * _bz2_BZ2Compressor_flush_impl(BZ2Compressor *self); @@ -235,4 +235,4 @@ _bz2_BZ2Decompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=0fc5a6292c5fd2c5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=95641908220cc58a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_codecsmodule.c.h b/Modules/clinic/_codecsmodule.c.h index 46476a948b66d9..95f5d7873f829b 100644 --- a/Modules/clinic/_codecsmodule.c.h +++ b/Modules/clinic/_codecsmodule.c.h @@ -19,7 +19,7 @@ PyDoc_STRVAR(_codecs_register__doc__, "(encoder, decoder, stream_reader, stream_writer) (or a CodecInfo object)."); #define _CODECS_REGISTER_METHODDEF \ - {"register", (PyCFunction)_codecs_register, METH_O, _codecs_register__doc__}, + {"register", _codecs_register, METH_O, _codecs_register__doc__}, PyDoc_STRVAR(_codecs_unregister__doc__, "unregister($module, search_function, /)\n" @@ -30,7 +30,7 @@ PyDoc_STRVAR(_codecs_unregister__doc__, "If the search function is not registered, do nothing."); #define _CODECS_UNREGISTER_METHODDEF \ - {"unregister", (PyCFunction)_codecs_unregister, METH_O, _codecs_unregister__doc__}, + {"unregister", _codecs_unregister, METH_O, _codecs_unregister__doc__}, PyDoc_STRVAR(_codecs_lookup__doc__, "lookup($module, encoding, /)\n" @@ -39,7 +39,7 @@ PyDoc_STRVAR(_codecs_lookup__doc__, "Looks up a codec tuple in the Python codec registry and returns a CodecInfo object."); #define _CODECS_LOOKUP_METHODDEF \ - {"lookup", (PyCFunction)_codecs_lookup, METH_O, _codecs_lookup__doc__}, + {"lookup", _codecs_lookup, METH_O, _codecs_lookup__doc__}, static PyObject * _codecs_lookup_impl(PyObject *module, const char *encoding); @@ -2436,7 +2436,7 @@ PyDoc_STRVAR(_codecs_charmap_build__doc__, "\n"); #define _CODECS_CHARMAP_BUILD_METHODDEF \ - {"charmap_build", (PyCFunction)_codecs_charmap_build, METH_O, _codecs_charmap_build__doc__}, + {"charmap_build", _codecs_charmap_build, METH_O, _codecs_charmap_build__doc__}, static PyObject * _codecs_charmap_build_impl(PyObject *module, PyObject *map); @@ -2700,7 +2700,7 @@ PyDoc_STRVAR(_codecs__unregister_error__doc__, "handling exists."); #define _CODECS__UNREGISTER_ERROR_METHODDEF \ - {"_unregister_error", (PyCFunction)_codecs__unregister_error, METH_O, _codecs__unregister_error__doc__}, + {"_unregister_error", _codecs__unregister_error, METH_O, _codecs__unregister_error__doc__}, static int _codecs__unregister_error_impl(PyObject *module, const char *errors); @@ -2745,7 +2745,7 @@ PyDoc_STRVAR(_codecs_lookup_error__doc__, "LookupError, if no handler exists under this name."); #define _CODECS_LOOKUP_ERROR_METHODDEF \ - {"lookup_error", (PyCFunction)_codecs_lookup_error, METH_O, _codecs_lookup_error__doc__}, + {"lookup_error", _codecs_lookup_error, METH_O, _codecs_lookup_error__doc__}, static PyObject * _codecs_lookup_error_impl(PyObject *module, const char *name); @@ -2798,4 +2798,4 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF #define _CODECS_CODE_PAGE_ENCODE_METHODDEF #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ -/*[clinic end generated code: output=f8a7fdd0b7edc0c4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6bae21e542af78dc input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_collectionsmodule.c.h b/Modules/clinic/_collectionsmodule.c.h index c7dc639ce87ad8..5411ca31f5e73e 100644 --- a/Modules/clinic/_collectionsmodule.c.h +++ b/Modules/clinic/_collectionsmodule.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(deque_pop__doc__, "Remove and return the rightmost element."); #define DEQUE_POP_METHODDEF \ - {"pop", (PyCFunction)deque_pop, METH_NOARGS, deque_pop__doc__}, + {"pop", deque_pop, METH_NOARGS, deque_pop__doc__}, static PyObject * deque_pop_impl(dequeobject *deque); @@ -41,7 +41,7 @@ PyDoc_STRVAR(deque_popleft__doc__, "Remove and return the leftmost element."); #define DEQUE_POPLEFT_METHODDEF \ - {"popleft", (PyCFunction)deque_popleft, METH_NOARGS, deque_popleft__doc__}, + {"popleft", deque_popleft, METH_NOARGS, deque_popleft__doc__}, static PyObject * deque_popleft_impl(dequeobject *deque); @@ -65,7 +65,7 @@ PyDoc_STRVAR(deque_append__doc__, "Add an element to the right side of the deque."); #define DEQUE_APPEND_METHODDEF \ - {"append", (PyCFunction)deque_append, METH_O, deque_append__doc__}, + {"append", deque_append, METH_O, deque_append__doc__}, static PyObject * deque_append_impl(dequeobject *deque, PyObject *item); @@ -89,7 +89,7 @@ PyDoc_STRVAR(deque_appendleft__doc__, "Add an element to the left side of the deque."); #define DEQUE_APPENDLEFT_METHODDEF \ - {"appendleft", (PyCFunction)deque_appendleft, METH_O, deque_appendleft__doc__}, + {"appendleft", deque_appendleft, METH_O, deque_appendleft__doc__}, static PyObject * deque_appendleft_impl(dequeobject *deque, PyObject *item); @@ -113,7 +113,7 @@ PyDoc_STRVAR(deque_extend__doc__, "Extend the right side of the deque with elements from the iterable."); #define DEQUE_EXTEND_METHODDEF \ - {"extend", (PyCFunction)deque_extend, METH_O, deque_extend__doc__}, + {"extend", deque_extend, METH_O, deque_extend__doc__}, static PyObject * deque_extend_impl(dequeobject *deque, PyObject *iterable); @@ -137,7 +137,7 @@ PyDoc_STRVAR(deque_extendleft__doc__, "Extend the left side of the deque with elements from the iterable."); #define DEQUE_EXTENDLEFT_METHODDEF \ - {"extendleft", (PyCFunction)deque_extendleft, METH_O, deque_extendleft__doc__}, + {"extendleft", deque_extendleft, METH_O, deque_extendleft__doc__}, static PyObject * deque_extendleft_impl(dequeobject *deque, PyObject *iterable); @@ -161,7 +161,7 @@ PyDoc_STRVAR(deque_copy__doc__, "Return a shallow copy of a deque."); #define DEQUE_COPY_METHODDEF \ - {"copy", (PyCFunction)deque_copy, METH_NOARGS, deque_copy__doc__}, + {"copy", deque_copy, METH_NOARGS, deque_copy__doc__}, static PyObject * deque_copy_impl(dequeobject *deque); @@ -185,7 +185,7 @@ PyDoc_STRVAR(deque___copy____doc__, "Return a shallow copy of a deque."); #define DEQUE___COPY___METHODDEF \ - {"__copy__", (PyCFunction)deque___copy__, METH_NOARGS, deque___copy____doc__}, + {"__copy__", deque___copy__, METH_NOARGS, deque___copy____doc__}, static PyObject * deque___copy___impl(dequeobject *deque); @@ -209,7 +209,7 @@ PyDoc_STRVAR(deque_clearmethod__doc__, "Remove all elements from the deque."); #define DEQUE_CLEARMETHOD_METHODDEF \ - {"clear", (PyCFunction)deque_clearmethod, METH_NOARGS, deque_clearmethod__doc__}, + {"clear", deque_clearmethod, METH_NOARGS, deque_clearmethod__doc__}, static PyObject * deque_clearmethod_impl(dequeobject *deque); @@ -278,7 +278,7 @@ PyDoc_STRVAR(deque_reverse__doc__, "Reverse *IN PLACE*."); #define DEQUE_REVERSE_METHODDEF \ - {"reverse", (PyCFunction)deque_reverse, METH_NOARGS, deque_reverse__doc__}, + {"reverse", deque_reverse, METH_NOARGS, deque_reverse__doc__}, static PyObject * deque_reverse_impl(dequeobject *deque); @@ -302,7 +302,7 @@ PyDoc_STRVAR(deque_count__doc__, "Return number of occurrences of value."); #define DEQUE_COUNT_METHODDEF \ - {"count", (PyCFunction)deque_count, METH_O, deque_count__doc__}, + {"count", deque_count, METH_O, deque_count__doc__}, static PyObject * deque_count_impl(dequeobject *deque, PyObject *v); @@ -417,7 +417,7 @@ PyDoc_STRVAR(deque_remove__doc__, "Remove first occurrence of value."); #define DEQUE_REMOVE_METHODDEF \ - {"remove", (PyCFunction)deque_remove, METH_O, deque_remove__doc__}, + {"remove", deque_remove, METH_O, deque_remove__doc__}, static PyObject * deque_remove_impl(dequeobject *deque, PyObject *value); @@ -441,7 +441,7 @@ PyDoc_STRVAR(deque___reduce____doc__, "Return state information for pickling."); #define DEQUE___REDUCE___METHODDEF \ - {"__reduce__", (PyCFunction)deque___reduce__, METH_NOARGS, deque___reduce____doc__}, + {"__reduce__", deque___reduce__, METH_NOARGS, deque___reduce____doc__}, static PyObject * deque___reduce___impl(dequeobject *deque); @@ -528,7 +528,7 @@ PyDoc_STRVAR(deque___sizeof____doc__, "Return the size of the deque in memory, in bytes."); #define DEQUE___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)deque___sizeof__, METH_NOARGS, deque___sizeof____doc__}, + {"__sizeof__", deque___sizeof__, METH_NOARGS, deque___sizeof____doc__}, static PyObject * deque___sizeof___impl(dequeobject *deque); @@ -552,7 +552,7 @@ PyDoc_STRVAR(deque___reversed____doc__, "Return a reverse iterator over the deque."); #define DEQUE___REVERSED___METHODDEF \ - {"__reversed__", (PyCFunction)deque___reversed__, METH_NOARGS, deque___reversed____doc__}, + {"__reversed__", deque___reversed__, METH_NOARGS, deque___reversed____doc__}, static PyObject * deque___reversed___impl(dequeobject *deque); @@ -630,4 +630,4 @@ tuplegetter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=1eb3634d5ef8b407 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=850f240cebed2699 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_contextvarsmodule.c.h b/Modules/clinic/_contextvarsmodule.c.h index b1885e41c355d2..74fbc90b87bcce 100644 --- a/Modules/clinic/_contextvarsmodule.c.h +++ b/Modules/clinic/_contextvarsmodule.c.h @@ -8,7 +8,7 @@ PyDoc_STRVAR(_contextvars_copy_context__doc__, "\n"); #define _CONTEXTVARS_COPY_CONTEXT_METHODDEF \ - {"copy_context", (PyCFunction)_contextvars_copy_context, METH_NOARGS, _contextvars_copy_context__doc__}, + {"copy_context", _contextvars_copy_context, METH_NOARGS, _contextvars_copy_context__doc__}, static PyObject * _contextvars_copy_context_impl(PyObject *module); @@ -18,4 +18,4 @@ _contextvars_copy_context(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _contextvars_copy_context_impl(module); } -/*[clinic end generated code: output=26e07024451baf52 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3ae2d989e71f46d0 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_csv.c.h b/Modules/clinic/_csv.c.h index b5608c850b6a97..cc6347ebfb0435 100644 --- a/Modules/clinic/_csv.c.h +++ b/Modules/clinic/_csv.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(_csv_list_dialects__doc__, " names = csv.list_dialects()"); #define _CSV_LIST_DIALECTS_METHODDEF \ - {"list_dialects", (PyCFunction)_csv_list_dialects, METH_NOARGS, _csv_list_dialects__doc__}, + {"list_dialects", _csv_list_dialects, METH_NOARGS, _csv_list_dialects__doc__}, static PyObject * _csv_list_dialects_impl(PyObject *module); @@ -209,4 +209,4 @@ _csv_field_size_limit(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=9c7314c2434156b3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d90bf490ee38eb9f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_curses_panel.c.h b/Modules/clinic/_curses_panel.c.h index 6f4966825ec4bf..44f0dff2469378 100644 --- a/Modules/clinic/_curses_panel.c.h +++ b/Modules/clinic/_curses_panel.c.h @@ -104,7 +104,7 @@ PyDoc_STRVAR(_curses_panel_panel_above__doc__, "Return the panel above the current panel."); #define _CURSES_PANEL_PANEL_ABOVE_METHODDEF \ - {"above", (PyCFunction)_curses_panel_panel_above, METH_NOARGS, _curses_panel_panel_above__doc__}, + {"above", _curses_panel_panel_above, METH_NOARGS, _curses_panel_panel_above__doc__}, static PyObject * _curses_panel_panel_above_impl(PyCursesPanelObject *self); @@ -122,7 +122,7 @@ PyDoc_STRVAR(_curses_panel_panel_below__doc__, "Return the panel below the current panel."); #define _CURSES_PANEL_PANEL_BELOW_METHODDEF \ - {"below", (PyCFunction)_curses_panel_panel_below, METH_NOARGS, _curses_panel_panel_below__doc__}, + {"below", _curses_panel_panel_below, METH_NOARGS, _curses_panel_panel_below__doc__}, static PyObject * _curses_panel_panel_below_impl(PyCursesPanelObject *self); @@ -140,7 +140,7 @@ PyDoc_STRVAR(_curses_panel_panel_hidden__doc__, "Return True if the panel is hidden (not visible), False otherwise."); #define _CURSES_PANEL_PANEL_HIDDEN_METHODDEF \ - {"hidden", (PyCFunction)_curses_panel_panel_hidden, METH_NOARGS, _curses_panel_panel_hidden__doc__}, + {"hidden", _curses_panel_panel_hidden, METH_NOARGS, _curses_panel_panel_hidden__doc__}, static PyObject * _curses_panel_panel_hidden_impl(PyCursesPanelObject *self); @@ -211,7 +211,7 @@ PyDoc_STRVAR(_curses_panel_panel_window__doc__, "Return the window object associated with the panel."); #define _CURSES_PANEL_PANEL_WINDOW_METHODDEF \ - {"window", (PyCFunction)_curses_panel_panel_window, METH_NOARGS, _curses_panel_panel_window__doc__}, + {"window", _curses_panel_panel_window, METH_NOARGS, _curses_panel_panel_window__doc__}, static PyObject * _curses_panel_panel_window_impl(PyCursesPanelObject *self); @@ -347,7 +347,7 @@ PyDoc_STRVAR(_curses_panel_bottom_panel__doc__, "Return the bottom panel in the panel stack."); #define _CURSES_PANEL_BOTTOM_PANEL_METHODDEF \ - {"bottom_panel", (PyCFunction)_curses_panel_bottom_panel, METH_NOARGS, _curses_panel_bottom_panel__doc__}, + {"bottom_panel", _curses_panel_bottom_panel, METH_NOARGS, _curses_panel_bottom_panel__doc__}, static PyObject * _curses_panel_bottom_panel_impl(PyObject *module); @@ -365,7 +365,7 @@ PyDoc_STRVAR(_curses_panel_new_panel__doc__, "Return a panel object, associating it with the given window win."); #define _CURSES_PANEL_NEW_PANEL_METHODDEF \ - {"new_panel", (PyCFunction)_curses_panel_new_panel, METH_O, _curses_panel_new_panel__doc__}, + {"new_panel", _curses_panel_new_panel, METH_O, _curses_panel_new_panel__doc__}, static PyObject * _curses_panel_new_panel_impl(PyObject *module, PyCursesWindowObject *win); @@ -394,7 +394,7 @@ PyDoc_STRVAR(_curses_panel_top_panel__doc__, "Return the top panel in the panel stack."); #define _CURSES_PANEL_TOP_PANEL_METHODDEF \ - {"top_panel", (PyCFunction)_curses_panel_top_panel, METH_NOARGS, _curses_panel_top_panel__doc__}, + {"top_panel", _curses_panel_top_panel, METH_NOARGS, _curses_panel_top_panel__doc__}, static PyObject * _curses_panel_top_panel_impl(PyObject *module); @@ -414,7 +414,7 @@ PyDoc_STRVAR(_curses_panel_update_panels__doc__, "This does not call curses.doupdate(), so you\'ll have to do this yourself."); #define _CURSES_PANEL_UPDATE_PANELS_METHODDEF \ - {"update_panels", (PyCFunction)_curses_panel_update_panels, METH_NOARGS, _curses_panel_update_panels__doc__}, + {"update_panels", _curses_panel_update_panels, METH_NOARGS, _curses_panel_update_panels__doc__}, static PyObject * _curses_panel_update_panels_impl(PyObject *module); @@ -424,4 +424,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _curses_panel_update_panels_impl(module); } -/*[clinic end generated code: output=36853ecb4a979814 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7d7290f8008d8d11 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index 769d75c09010bd..37d2528180da84 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -27,7 +27,7 @@ PyDoc_STRVAR(_curses_window_addch__doc__, "current settings for the window object."); #define _CURSES_WINDOW_ADDCH_METHODDEF \ - {"addch", (PyCFunction)_curses_window_addch, METH_VARARGS, _curses_window_addch__doc__}, + {"addch", _curses_window_addch, METH_VARARGS, _curses_window_addch__doc__}, static PyObject * _curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, @@ -99,7 +99,7 @@ PyDoc_STRVAR(_curses_window_addstr__doc__, "current settings for the window object."); #define _CURSES_WINDOW_ADDSTR_METHODDEF \ - {"addstr", (PyCFunction)_curses_window_addstr, METH_VARARGS, _curses_window_addstr__doc__}, + {"addstr", _curses_window_addstr, METH_VARARGS, _curses_window_addstr__doc__}, static PyObject * _curses_window_addstr_impl(PyCursesWindowObject *self, int group_left_1, @@ -173,7 +173,7 @@ PyDoc_STRVAR(_curses_window_addnstr__doc__, "current settings for the window object."); #define _CURSES_WINDOW_ADDNSTR_METHODDEF \ - {"addnstr", (PyCFunction)_curses_window_addnstr, METH_VARARGS, _curses_window_addnstr__doc__}, + {"addnstr", _curses_window_addnstr, METH_VARARGS, _curses_window_addnstr__doc__}, static PyObject * _curses_window_addnstr_impl(PyCursesWindowObject *self, int group_left_1, @@ -276,7 +276,7 @@ PyDoc_STRVAR(_curses_window_attroff__doc__, "Remove attribute attr from the \"background\" set."); #define _CURSES_WINDOW_ATTROFF_METHODDEF \ - {"attroff", (PyCFunction)_curses_window_attroff, METH_O, _curses_window_attroff__doc__}, + {"attroff", _curses_window_attroff, METH_O, _curses_window_attroff__doc__}, static PyObject * _curses_window_attroff_impl(PyCursesWindowObject *self, long attr); @@ -304,7 +304,7 @@ PyDoc_STRVAR(_curses_window_attron__doc__, "Add attribute attr from the \"background\" set."); #define _CURSES_WINDOW_ATTRON_METHODDEF \ - {"attron", (PyCFunction)_curses_window_attron, METH_O, _curses_window_attron__doc__}, + {"attron", _curses_window_attron, METH_O, _curses_window_attron__doc__}, static PyObject * _curses_window_attron_impl(PyCursesWindowObject *self, long attr); @@ -332,7 +332,7 @@ PyDoc_STRVAR(_curses_window_attrset__doc__, "Set the \"background\" set of attributes."); #define _CURSES_WINDOW_ATTRSET_METHODDEF \ - {"attrset", (PyCFunction)_curses_window_attrset, METH_O, _curses_window_attrset__doc__}, + {"attrset", _curses_window_attrset, METH_O, _curses_window_attrset__doc__}, static PyObject * _curses_window_attrset_impl(PyCursesWindowObject *self, long attr); @@ -504,7 +504,7 @@ PyDoc_STRVAR(_curses_window_box__doc__, "horch. The default corner characters are always used by this function."); #define _CURSES_WINDOW_BOX_METHODDEF \ - {"box", (PyCFunction)_curses_window_box, METH_VARARGS, _curses_window_box__doc__}, + {"box", _curses_window_box, METH_VARARGS, _curses_window_box__doc__}, static PyObject * _curses_window_box_impl(PyCursesWindowObject *self, int group_right_1, @@ -547,7 +547,7 @@ PyDoc_STRVAR(_curses_window_delch__doc__, " X-coordinate."); #define _CURSES_WINDOW_DELCH_METHODDEF \ - {"delch", (PyCFunction)_curses_window_delch, METH_VARARGS, _curses_window_delch__doc__}, + {"delch", _curses_window_delch, METH_VARARGS, _curses_window_delch__doc__}, static PyObject * _curses_window_delch_impl(PyCursesWindowObject *self, int group_right_1, @@ -598,7 +598,7 @@ PyDoc_STRVAR(_curses_window_derwin__doc__, "screen."); #define _CURSES_WINDOW_DERWIN_METHODDEF \ - {"derwin", (PyCFunction)_curses_window_derwin, METH_VARARGS, _curses_window_derwin__doc__}, + {"derwin", _curses_window_derwin, METH_VARARGS, _curses_window_derwin__doc__}, static PyObject * _curses_window_derwin_impl(PyCursesWindowObject *self, int group_left_1, @@ -731,7 +731,7 @@ PyDoc_STRVAR(_curses_window_getbkgd__doc__, "Return the window\'s current background character/attribute pair."); #define _CURSES_WINDOW_GETBKGD_METHODDEF \ - {"getbkgd", (PyCFunction)_curses_window_getbkgd, METH_NOARGS, _curses_window_getbkgd__doc__}, + {"getbkgd", _curses_window_getbkgd, METH_NOARGS, _curses_window_getbkgd__doc__}, static long _curses_window_getbkgd_impl(PyCursesWindowObject *self); @@ -766,7 +766,7 @@ PyDoc_STRVAR(_curses_window_getch__doc__, "is returned if there is no input, else getch() waits until a key is pressed."); #define _CURSES_WINDOW_GETCH_METHODDEF \ - {"getch", (PyCFunction)_curses_window_getch, METH_VARARGS, _curses_window_getch__doc__}, + {"getch", _curses_window_getch, METH_VARARGS, _curses_window_getch__doc__}, static int _curses_window_getch_impl(PyCursesWindowObject *self, int group_right_1, @@ -818,7 +818,7 @@ PyDoc_STRVAR(_curses_window_getkey__doc__, "key name. In no-delay mode, an exception is raised if there is no input."); #define _CURSES_WINDOW_GETKEY_METHODDEF \ - {"getkey", (PyCFunction)_curses_window_getkey, METH_VARARGS, _curses_window_getkey__doc__}, + {"getkey", _curses_window_getkey, METH_VARARGS, _curses_window_getkey__doc__}, static PyObject * _curses_window_getkey_impl(PyCursesWindowObject *self, int group_right_1, @@ -866,7 +866,7 @@ PyDoc_STRVAR(_curses_window_get_wch__doc__, "keypad keys, and other special keys."); #define _CURSES_WINDOW_GET_WCH_METHODDEF \ - {"get_wch", (PyCFunction)_curses_window_get_wch, METH_VARARGS, _curses_window_get_wch__doc__}, + {"get_wch", _curses_window_get_wch, METH_VARARGS, _curses_window_get_wch__doc__}, static PyObject * _curses_window_get_wch_impl(PyCursesWindowObject *self, int group_right_1, @@ -917,7 +917,7 @@ PyDoc_STRVAR(_curses_window_hline__doc__, " Attributes for the characters."); #define _CURSES_WINDOW_HLINE_METHODDEF \ - {"hline", (PyCFunction)_curses_window_hline, METH_VARARGS, _curses_window_hline__doc__}, + {"hline", _curses_window_hline, METH_VARARGS, _curses_window_hline__doc__}, static PyObject * _curses_window_hline_impl(PyCursesWindowObject *self, int group_left_1, @@ -988,7 +988,7 @@ PyDoc_STRVAR(_curses_window_insch__doc__, "the rightmost characters on the line being lost."); #define _CURSES_WINDOW_INSCH_METHODDEF \ - {"insch", (PyCFunction)_curses_window_insch, METH_VARARGS, _curses_window_insch__doc__}, + {"insch", _curses_window_insch, METH_VARARGS, _curses_window_insch__doc__}, static PyObject * _curses_window_insch_impl(PyCursesWindowObject *self, int group_left_1, @@ -1053,7 +1053,7 @@ PyDoc_STRVAR(_curses_window_inch__doc__, "The bottom 8 bits are the character proper, and upper bits are the attributes."); #define _CURSES_WINDOW_INCH_METHODDEF \ - {"inch", (PyCFunction)_curses_window_inch, METH_VARARGS, _curses_window_inch__doc__}, + {"inch", _curses_window_inch, METH_VARARGS, _curses_window_inch__doc__}, static unsigned long _curses_window_inch_impl(PyCursesWindowObject *self, int group_right_1, @@ -1111,7 +1111,7 @@ PyDoc_STRVAR(_curses_window_insstr__doc__, "if specified)."); #define _CURSES_WINDOW_INSSTR_METHODDEF \ - {"insstr", (PyCFunction)_curses_window_insstr, METH_VARARGS, _curses_window_insstr__doc__}, + {"insstr", _curses_window_insstr, METH_VARARGS, _curses_window_insstr__doc__}, static PyObject * _curses_window_insstr_impl(PyCursesWindowObject *self, int group_left_1, @@ -1187,7 +1187,7 @@ PyDoc_STRVAR(_curses_window_insnstr__doc__, "specified)."); #define _CURSES_WINDOW_INSNSTR_METHODDEF \ - {"insnstr", (PyCFunction)_curses_window_insnstr, METH_VARARGS, _curses_window_insnstr__doc__}, + {"insnstr", _curses_window_insnstr, METH_VARARGS, _curses_window_insnstr__doc__}, static PyObject * _curses_window_insnstr_impl(PyCursesWindowObject *self, int group_left_1, @@ -1253,7 +1253,7 @@ PyDoc_STRVAR(_curses_window_is_linetouched__doc__, "Raise a curses.error exception if line is not valid for the given window."); #define _CURSES_WINDOW_IS_LINETOUCHED_METHODDEF \ - {"is_linetouched", (PyCFunction)_curses_window_is_linetouched, METH_O, _curses_window_is_linetouched__doc__}, + {"is_linetouched", _curses_window_is_linetouched, METH_O, _curses_window_is_linetouched__doc__}, static PyObject * _curses_window_is_linetouched_impl(PyCursesWindowObject *self, int line); @@ -1285,7 +1285,7 @@ PyDoc_STRVAR(_curses_window_noutrefresh__doc__, "that, call doupdate()."); #define _CURSES_WINDOW_NOUTREFRESH_METHODDEF \ - {"noutrefresh", (PyCFunction)_curses_window_noutrefresh, METH_VARARGS, _curses_window_noutrefresh__doc__}, + {"noutrefresh", _curses_window_noutrefresh, METH_VARARGS, _curses_window_noutrefresh__doc__}, static PyObject * _curses_window_noutrefresh_impl(PyCursesWindowObject *self, @@ -1339,7 +1339,7 @@ PyDoc_STRVAR(_curses_window_noutrefresh__doc__, "that, call doupdate()."); #define _CURSES_WINDOW_NOUTREFRESH_METHODDEF \ - {"noutrefresh", (PyCFunction)_curses_window_noutrefresh, METH_NOARGS, _curses_window_noutrefresh__doc__}, + {"noutrefresh", _curses_window_noutrefresh, METH_NOARGS, _curses_window_noutrefresh__doc__}, static PyObject * _curses_window_noutrefresh_impl(PyCursesWindowObject *self); @@ -1366,7 +1366,7 @@ PyDoc_STRVAR(_curses_window_overlay__doc__, "destination window."); #define _CURSES_WINDOW_OVERLAY_METHODDEF \ - {"overlay", (PyCFunction)_curses_window_overlay, METH_VARARGS, _curses_window_overlay__doc__}, + {"overlay", _curses_window_overlay, METH_VARARGS, _curses_window_overlay__doc__}, static PyObject * _curses_window_overlay_impl(PyCursesWindowObject *self, @@ -1424,7 +1424,7 @@ PyDoc_STRVAR(_curses_window_overwrite__doc__, "window."); #define _CURSES_WINDOW_OVERWRITE_METHODDEF \ - {"overwrite", (PyCFunction)_curses_window_overwrite, METH_VARARGS, _curses_window_overwrite__doc__}, + {"overwrite", _curses_window_overwrite, METH_VARARGS, _curses_window_overwrite__doc__}, static PyObject * _curses_window_overwrite_impl(PyCursesWindowObject *self, @@ -1477,7 +1477,7 @@ PyDoc_STRVAR(_curses_window_putwin__doc__, "This information can be later retrieved using the getwin() function."); #define _CURSES_WINDOW_PUTWIN_METHODDEF \ - {"putwin", (PyCFunction)_curses_window_putwin, METH_O, _curses_window_putwin__doc__}, + {"putwin", _curses_window_putwin, METH_O, _curses_window_putwin__doc__}, static PyObject * _curses_window_putwin_impl(PyCursesWindowObject *self, PyObject *file); @@ -1552,7 +1552,7 @@ PyDoc_STRVAR(_curses_window_refresh__doc__, "sminrow, or smincol are treated as if they were zero."); #define _CURSES_WINDOW_REFRESH_METHODDEF \ - {"refresh", (PyCFunction)_curses_window_refresh, METH_VARARGS, _curses_window_refresh__doc__}, + {"refresh", _curses_window_refresh, METH_VARARGS, _curses_window_refresh__doc__}, static PyObject * _curses_window_refresh_impl(PyCursesWindowObject *self, int group_right_1, @@ -1651,7 +1651,7 @@ PyDoc_STRVAR(_curses_window_subwin__doc__, "lower right corner of the window."); #define _CURSES_WINDOW_SUBWIN_METHODDEF \ - {"subwin", (PyCFunction)_curses_window_subwin, METH_VARARGS, _curses_window_subwin__doc__}, + {"subwin", _curses_window_subwin, METH_VARARGS, _curses_window_subwin__doc__}, static PyObject * _curses_window_subwin_impl(PyCursesWindowObject *self, int group_left_1, @@ -1699,7 +1699,7 @@ PyDoc_STRVAR(_curses_window_scroll__doc__, "Scroll upward if the argument is positive and downward if it is negative."); #define _CURSES_WINDOW_SCROLL_METHODDEF \ - {"scroll", (PyCFunction)_curses_window_scroll, METH_VARARGS, _curses_window_scroll__doc__}, + {"scroll", _curses_window_scroll, METH_VARARGS, _curses_window_scroll__doc__}, static PyObject * _curses_window_scroll_impl(PyCursesWindowObject *self, int group_right_1, @@ -1739,7 +1739,7 @@ PyDoc_STRVAR(_curses_window_touchline__doc__, "as having been changed (changed=True) or unchanged (changed=False)."); #define _CURSES_WINDOW_TOUCHLINE_METHODDEF \ - {"touchline", (PyCFunction)_curses_window_touchline, METH_VARARGS, _curses_window_touchline__doc__}, + {"touchline", _curses_window_touchline, METH_VARARGS, _curses_window_touchline__doc__}, static PyObject * _curses_window_touchline_impl(PyCursesWindowObject *self, int start, @@ -1792,7 +1792,7 @@ PyDoc_STRVAR(_curses_window_vline__doc__, " Attributes for the character."); #define _CURSES_WINDOW_VLINE_METHODDEF \ - {"vline", (PyCFunction)_curses_window_vline, METH_VARARGS, _curses_window_vline__doc__}, + {"vline", _curses_window_vline, METH_VARARGS, _curses_window_vline__doc__}, static PyObject * _curses_window_vline_impl(PyCursesWindowObject *self, int group_left_1, @@ -1854,7 +1854,7 @@ PyDoc_STRVAR(_curses_filter__doc__, "\n"); #define _CURSES_FILTER_METHODDEF \ - {"filter", (PyCFunction)_curses_filter, METH_NOARGS, _curses_filter__doc__}, + {"filter", _curses_filter, METH_NOARGS, _curses_filter__doc__}, static PyObject * _curses_filter_impl(PyObject *module); @@ -1874,7 +1874,7 @@ PyDoc_STRVAR(_curses_baudrate__doc__, "Return the output speed of the terminal in bits per second."); #define _CURSES_BAUDRATE_METHODDEF \ - {"baudrate", (PyCFunction)_curses_baudrate, METH_NOARGS, _curses_baudrate__doc__}, + {"baudrate", _curses_baudrate, METH_NOARGS, _curses_baudrate__doc__}, static PyObject * _curses_baudrate_impl(PyObject *module); @@ -1892,7 +1892,7 @@ PyDoc_STRVAR(_curses_beep__doc__, "Emit a short attention sound."); #define _CURSES_BEEP_METHODDEF \ - {"beep", (PyCFunction)_curses_beep, METH_NOARGS, _curses_beep__doc__}, + {"beep", _curses_beep, METH_NOARGS, _curses_beep__doc__}, static PyObject * _curses_beep_impl(PyObject *module); @@ -1910,7 +1910,7 @@ PyDoc_STRVAR(_curses_can_change_color__doc__, "Return True if the programmer can change the colors displayed by the terminal."); #define _CURSES_CAN_CHANGE_COLOR_METHODDEF \ - {"can_change_color", (PyCFunction)_curses_can_change_color, METH_NOARGS, _curses_can_change_color__doc__}, + {"can_change_color", _curses_can_change_color, METH_NOARGS, _curses_can_change_color__doc__}, static PyObject * _curses_can_change_color_impl(PyObject *module); @@ -1978,7 +1978,7 @@ PyDoc_STRVAR(_curses_color_content__doc__, "which will be between 0 (no component) and 1000 (maximum amount of component)."); #define _CURSES_COLOR_CONTENT_METHODDEF \ - {"color_content", (PyCFunction)_curses_color_content, METH_O, _curses_color_content__doc__}, + {"color_content", _curses_color_content, METH_O, _curses_color_content__doc__}, static PyObject * _curses_color_content_impl(PyObject *module, int color_number); @@ -2011,7 +2011,7 @@ PyDoc_STRVAR(_curses_color_pair__doc__, "other A_* attributes. pair_number() is the counterpart to this function."); #define _CURSES_COLOR_PAIR_METHODDEF \ - {"color_pair", (PyCFunction)_curses_color_pair, METH_O, _curses_color_pair__doc__}, + {"color_pair", _curses_color_pair, METH_O, _curses_color_pair__doc__}, static PyObject * _curses_color_pair_impl(PyObject *module, int pair_number); @@ -2047,7 +2047,7 @@ PyDoc_STRVAR(_curses_curs_set__doc__, "a block cursor."); #define _CURSES_CURS_SET_METHODDEF \ - {"curs_set", (PyCFunction)_curses_curs_set, METH_O, _curses_curs_set__doc__}, + {"curs_set", _curses_curs_set, METH_O, _curses_curs_set__doc__}, static PyObject * _curses_curs_set_impl(PyObject *module, int visibility); @@ -2079,7 +2079,7 @@ PyDoc_STRVAR(_curses_def_prog_mode__doc__, "Subsequent calls to reset_prog_mode() will restore this mode."); #define _CURSES_DEF_PROG_MODE_METHODDEF \ - {"def_prog_mode", (PyCFunction)_curses_def_prog_mode, METH_NOARGS, _curses_def_prog_mode__doc__}, + {"def_prog_mode", _curses_def_prog_mode, METH_NOARGS, _curses_def_prog_mode__doc__}, static PyObject * _curses_def_prog_mode_impl(PyObject *module); @@ -2101,7 +2101,7 @@ PyDoc_STRVAR(_curses_def_shell_mode__doc__, "Subsequent calls to reset_shell_mode() will restore this mode."); #define _CURSES_DEF_SHELL_MODE_METHODDEF \ - {"def_shell_mode", (PyCFunction)_curses_def_shell_mode, METH_NOARGS, _curses_def_shell_mode__doc__}, + {"def_shell_mode", _curses_def_shell_mode, METH_NOARGS, _curses_def_shell_mode__doc__}, static PyObject * _curses_def_shell_mode_impl(PyObject *module); @@ -2122,7 +2122,7 @@ PyDoc_STRVAR(_curses_delay_output__doc__, " Duration in milliseconds."); #define _CURSES_DELAY_OUTPUT_METHODDEF \ - {"delay_output", (PyCFunction)_curses_delay_output, METH_O, _curses_delay_output__doc__}, + {"delay_output", _curses_delay_output, METH_O, _curses_delay_output__doc__}, static PyObject * _curses_delay_output_impl(PyObject *module, int ms); @@ -2150,7 +2150,7 @@ PyDoc_STRVAR(_curses_doupdate__doc__, "Update the physical screen to match the virtual screen."); #define _CURSES_DOUPDATE_METHODDEF \ - {"doupdate", (PyCFunction)_curses_doupdate, METH_NOARGS, _curses_doupdate__doc__}, + {"doupdate", _curses_doupdate, METH_NOARGS, _curses_doupdate__doc__}, static PyObject * _curses_doupdate_impl(PyObject *module); @@ -2208,7 +2208,7 @@ PyDoc_STRVAR(_curses_endwin__doc__, "De-initialize the library, and return terminal to normal status."); #define _CURSES_ENDWIN_METHODDEF \ - {"endwin", (PyCFunction)_curses_endwin, METH_NOARGS, _curses_endwin__doc__}, + {"endwin", _curses_endwin, METH_NOARGS, _curses_endwin__doc__}, static PyObject * _curses_endwin_impl(PyObject *module); @@ -2226,7 +2226,7 @@ PyDoc_STRVAR(_curses_erasechar__doc__, "Return the user\'s current erase character."); #define _CURSES_ERASECHAR_METHODDEF \ - {"erasechar", (PyCFunction)_curses_erasechar, METH_NOARGS, _curses_erasechar__doc__}, + {"erasechar", _curses_erasechar, METH_NOARGS, _curses_erasechar__doc__}, static PyObject * _curses_erasechar_impl(PyObject *module); @@ -2246,7 +2246,7 @@ PyDoc_STRVAR(_curses_flash__doc__, "That is, change it to reverse-video and then change it back in a short interval."); #define _CURSES_FLASH_METHODDEF \ - {"flash", (PyCFunction)_curses_flash, METH_NOARGS, _curses_flash__doc__}, + {"flash", _curses_flash, METH_NOARGS, _curses_flash__doc__}, static PyObject * _curses_flash_impl(PyObject *module); @@ -2267,7 +2267,7 @@ PyDoc_STRVAR(_curses_flushinp__doc__, "yet been processed by the program."); #define _CURSES_FLUSHINP_METHODDEF \ - {"flushinp", (PyCFunction)_curses_flushinp, METH_NOARGS, _curses_flushinp__doc__}, + {"flushinp", _curses_flushinp, METH_NOARGS, _curses_flushinp__doc__}, static PyObject * _curses_flushinp_impl(PyObject *module); @@ -2289,7 +2289,7 @@ PyDoc_STRVAR(_curses_getsyx__doc__, "Return a (y, x) tuple. If leaveok is currently true, return (-1, -1)."); #define _CURSES_GETSYX_METHODDEF \ - {"getsyx", (PyCFunction)_curses_getsyx, METH_NOARGS, _curses_getsyx__doc__}, + {"getsyx", _curses_getsyx, METH_NOARGS, _curses_getsyx__doc__}, static PyObject * _curses_getsyx_impl(PyObject *module); @@ -2314,7 +2314,7 @@ PyDoc_STRVAR(_curses_getmouse__doc__, "returns a 5-tuple (id, x, y, z, bstate)."); #define _CURSES_GETMOUSE_METHODDEF \ - {"getmouse", (PyCFunction)_curses_getmouse, METH_NOARGS, _curses_getmouse__doc__}, + {"getmouse", _curses_getmouse, METH_NOARGS, _curses_getmouse__doc__}, static PyObject * _curses_getmouse_impl(PyObject *module); @@ -2411,7 +2411,7 @@ PyDoc_STRVAR(_curses_getwin__doc__, "returning the new window object."); #define _CURSES_GETWIN_METHODDEF \ - {"getwin", (PyCFunction)_curses_getwin, METH_O, _curses_getwin__doc__}, + {"getwin", _curses_getwin, METH_O, _curses_getwin__doc__}, PyDoc_STRVAR(_curses_halfdelay__doc__, "halfdelay($module, tenths, /)\n" @@ -2425,7 +2425,7 @@ PyDoc_STRVAR(_curses_halfdelay__doc__, "Use nocbreak() to leave half-delay mode."); #define _CURSES_HALFDELAY_METHODDEF \ - {"halfdelay", (PyCFunction)_curses_halfdelay, METH_O, _curses_halfdelay__doc__}, + {"halfdelay", _curses_halfdelay, METH_O, _curses_halfdelay__doc__}, static PyObject * _curses_halfdelay_impl(PyObject *module, unsigned char tenths); @@ -2468,7 +2468,7 @@ PyDoc_STRVAR(_curses_has_colors__doc__, "Return True if the terminal can display colors; otherwise, return False."); #define _CURSES_HAS_COLORS_METHODDEF \ - {"has_colors", (PyCFunction)_curses_has_colors, METH_NOARGS, _curses_has_colors__doc__}, + {"has_colors", _curses_has_colors, METH_NOARGS, _curses_has_colors__doc__}, static PyObject * _curses_has_colors_impl(PyObject *module); @@ -2486,7 +2486,7 @@ PyDoc_STRVAR(_curses_has_ic__doc__, "Return True if the terminal has insert- and delete-character capabilities."); #define _CURSES_HAS_IC_METHODDEF \ - {"has_ic", (PyCFunction)_curses_has_ic, METH_NOARGS, _curses_has_ic__doc__}, + {"has_ic", _curses_has_ic, METH_NOARGS, _curses_has_ic__doc__}, static PyObject * _curses_has_ic_impl(PyObject *module); @@ -2504,7 +2504,7 @@ PyDoc_STRVAR(_curses_has_il__doc__, "Return True if the terminal has insert- and delete-line capabilities."); #define _CURSES_HAS_IL_METHODDEF \ - {"has_il", (PyCFunction)_curses_has_il, METH_NOARGS, _curses_has_il__doc__}, + {"has_il", _curses_has_il, METH_NOARGS, _curses_has_il__doc__}, static PyObject * _curses_has_il_impl(PyObject *module); @@ -2527,7 +2527,7 @@ PyDoc_STRVAR(_curses_has_key__doc__, " Key number."); #define _CURSES_HAS_KEY_METHODDEF \ - {"has_key", (PyCFunction)_curses_has_key, METH_O, _curses_has_key__doc__}, + {"has_key", _curses_has_key, METH_O, _curses_has_key__doc__}, static PyObject * _curses_has_key_impl(PyObject *module, int key); @@ -2663,7 +2663,7 @@ PyDoc_STRVAR(_curses_initscr__doc__, "Return a WindowObject which represents the whole screen."); #define _CURSES_INITSCR_METHODDEF \ - {"initscr", (PyCFunction)_curses_initscr, METH_NOARGS, _curses_initscr__doc__}, + {"initscr", _curses_initscr, METH_NOARGS, _curses_initscr__doc__}, static PyObject * _curses_initscr_impl(PyObject *module); @@ -2782,7 +2782,7 @@ PyDoc_STRVAR(_curses_get_escdelay__doc__, "keyboard from escape sequences sent by cursor and function keys."); #define _CURSES_GET_ESCDELAY_METHODDEF \ - {"get_escdelay", (PyCFunction)_curses_get_escdelay, METH_NOARGS, _curses_get_escdelay__doc__}, + {"get_escdelay", _curses_get_escdelay, METH_NOARGS, _curses_get_escdelay__doc__}, static PyObject * _curses_get_escdelay_impl(PyObject *module); @@ -2811,7 +2811,7 @@ PyDoc_STRVAR(_curses_set_escdelay__doc__, "keyboard from escape sequences sent by cursor and function keys."); #define _CURSES_SET_ESCDELAY_METHODDEF \ - {"set_escdelay", (PyCFunction)_curses_set_escdelay, METH_O, _curses_set_escdelay__doc__}, + {"set_escdelay", _curses_set_escdelay, METH_O, _curses_set_escdelay__doc__}, static PyObject * _curses_set_escdelay_impl(PyObject *module, int ms); @@ -2846,7 +2846,7 @@ PyDoc_STRVAR(_curses_get_tabsize__doc__, "character to spaces as it adds the tab to a window."); #define _CURSES_GET_TABSIZE_METHODDEF \ - {"get_tabsize", (PyCFunction)_curses_get_tabsize, METH_NOARGS, _curses_get_tabsize__doc__}, + {"get_tabsize", _curses_get_tabsize, METH_NOARGS, _curses_get_tabsize__doc__}, static PyObject * _curses_get_tabsize_impl(PyObject *module); @@ -2874,7 +2874,7 @@ PyDoc_STRVAR(_curses_set_tabsize__doc__, "character to spaces as it adds the tab to a window."); #define _CURSES_SET_TABSIZE_METHODDEF \ - {"set_tabsize", (PyCFunction)_curses_set_tabsize, METH_O, _curses_set_tabsize__doc__}, + {"set_tabsize", _curses_set_tabsize, METH_O, _curses_set_tabsize__doc__}, static PyObject * _curses_set_tabsize_impl(PyObject *module, int size); @@ -2903,7 +2903,7 @@ PyDoc_STRVAR(_curses_intrflush__doc__, "\n"); #define _CURSES_INTRFLUSH_METHODDEF \ - {"intrflush", (PyCFunction)_curses_intrflush, METH_O, _curses_intrflush__doc__}, + {"intrflush", _curses_intrflush, METH_O, _curses_intrflush__doc__}, static PyObject * _curses_intrflush_impl(PyObject *module, int flag); @@ -2931,7 +2931,7 @@ PyDoc_STRVAR(_curses_isendwin__doc__, "Return True if endwin() has been called."); #define _CURSES_ISENDWIN_METHODDEF \ - {"isendwin", (PyCFunction)_curses_isendwin, METH_NOARGS, _curses_isendwin__doc__}, + {"isendwin", _curses_isendwin, METH_NOARGS, _curses_isendwin__doc__}, static PyObject * _curses_isendwin_impl(PyObject *module); @@ -2997,7 +2997,7 @@ PyDoc_STRVAR(_curses_keyname__doc__, " Key number."); #define _CURSES_KEYNAME_METHODDEF \ - {"keyname", (PyCFunction)_curses_keyname, METH_O, _curses_keyname__doc__}, + {"keyname", _curses_keyname, METH_O, _curses_keyname__doc__}, static PyObject * _curses_keyname_impl(PyObject *module, int key); @@ -3025,7 +3025,7 @@ PyDoc_STRVAR(_curses_killchar__doc__, "Return the user\'s current line kill character."); #define _CURSES_KILLCHAR_METHODDEF \ - {"killchar", (PyCFunction)_curses_killchar, METH_NOARGS, _curses_killchar__doc__}, + {"killchar", _curses_killchar, METH_NOARGS, _curses_killchar__doc__}, static PyObject * _curses_killchar_impl(PyObject *module); @@ -3046,7 +3046,7 @@ PyDoc_STRVAR(_curses_longname__doc__, "only after the call to initscr()."); #define _CURSES_LONGNAME_METHODDEF \ - {"longname", (PyCFunction)_curses_longname, METH_NOARGS, _curses_longname__doc__}, + {"longname", _curses_longname, METH_NOARGS, _curses_longname__doc__}, static PyObject * _curses_longname_impl(PyObject *module); @@ -3067,7 +3067,7 @@ PyDoc_STRVAR(_curses_meta__doc__, "allow only 7-bit characters."); #define _CURSES_META_METHODDEF \ - {"meta", (PyCFunction)_curses_meta, METH_O, _curses_meta__doc__}, + {"meta", _curses_meta, METH_O, _curses_meta__doc__}, static PyObject * _curses_meta_impl(PyObject *module, int yes); @@ -3104,7 +3104,7 @@ PyDoc_STRVAR(_curses_mouseinterval__doc__, "value."); #define _CURSES_MOUSEINTERVAL_METHODDEF \ - {"mouseinterval", (PyCFunction)_curses_mouseinterval, METH_O, _curses_mouseinterval__doc__}, + {"mouseinterval", _curses_mouseinterval, METH_O, _curses_mouseinterval__doc__}, static PyObject * _curses_mouseinterval_impl(PyObject *module, int interval); @@ -3141,7 +3141,7 @@ PyDoc_STRVAR(_curses_mousemask__doc__, "If this function is never called, no mouse events are ever reported."); #define _CURSES_MOUSEMASK_METHODDEF \ - {"mousemask", (PyCFunction)_curses_mousemask, METH_O, _curses_mousemask__doc__}, + {"mousemask", _curses_mousemask, METH_O, _curses_mousemask__doc__}, static PyObject * _curses_mousemask_impl(PyObject *module, unsigned long newmask); @@ -3175,7 +3175,7 @@ PyDoc_STRVAR(_curses_napms__doc__, " Duration in milliseconds."); #define _CURSES_NAPMS_METHODDEF \ - {"napms", (PyCFunction)_curses_napms, METH_O, _curses_napms__doc__}, + {"napms", _curses_napms, METH_O, _curses_napms__doc__}, static int _curses_napms_impl(PyObject *module, int ms); @@ -3259,7 +3259,7 @@ PyDoc_STRVAR(_curses_newwin__doc__, "right corner of the screen."); #define _CURSES_NEWWIN_METHODDEF \ - {"newwin", (PyCFunction)_curses_newwin, METH_VARARGS, _curses_newwin__doc__}, + {"newwin", _curses_newwin, METH_VARARGS, _curses_newwin__doc__}, static PyObject * _curses_newwin_impl(PyObject *module, int nlines, int ncols, @@ -3347,7 +3347,7 @@ PyDoc_STRVAR(_curses_nocbreak__doc__, "Return to normal \"cooked\" mode with line buffering."); #define _CURSES_NOCBREAK_METHODDEF \ - {"nocbreak", (PyCFunction)_curses_nocbreak, METH_NOARGS, _curses_nocbreak__doc__}, + {"nocbreak", _curses_nocbreak, METH_NOARGS, _curses_nocbreak__doc__}, static PyObject * _curses_nocbreak_impl(PyObject *module); @@ -3367,7 +3367,7 @@ PyDoc_STRVAR(_curses_noecho__doc__, "Echoing of input characters is turned off."); #define _CURSES_NOECHO_METHODDEF \ - {"noecho", (PyCFunction)_curses_noecho, METH_NOARGS, _curses_noecho__doc__}, + {"noecho", _curses_noecho, METH_NOARGS, _curses_noecho__doc__}, static PyObject * _curses_noecho_impl(PyObject *module); @@ -3388,7 +3388,7 @@ PyDoc_STRVAR(_curses_nonl__doc__, "translation of newline into newline/return on output."); #define _CURSES_NONL_METHODDEF \ - {"nonl", (PyCFunction)_curses_nonl, METH_NOARGS, _curses_nonl__doc__}, + {"nonl", _curses_nonl, METH_NOARGS, _curses_nonl__doc__}, static PyObject * _curses_nonl_impl(PyObject *module); @@ -3409,7 +3409,7 @@ PyDoc_STRVAR(_curses_noqiflush__doc__, "associated with the INTR, QUIT and SUSP characters will not be done."); #define _CURSES_NOQIFLUSH_METHODDEF \ - {"noqiflush", (PyCFunction)_curses_noqiflush, METH_NOARGS, _curses_noqiflush__doc__}, + {"noqiflush", _curses_noqiflush, METH_NOARGS, _curses_noqiflush__doc__}, static PyObject * _curses_noqiflush_impl(PyObject *module); @@ -3429,7 +3429,7 @@ PyDoc_STRVAR(_curses_noraw__doc__, "Return to normal \"cooked\" mode with line buffering."); #define _CURSES_NORAW_METHODDEF \ - {"noraw", (PyCFunction)_curses_noraw, METH_NOARGS, _curses_noraw__doc__}, + {"noraw", _curses_noraw, METH_NOARGS, _curses_noraw__doc__}, static PyObject * _curses_noraw_impl(PyObject *module); @@ -3450,7 +3450,7 @@ PyDoc_STRVAR(_curses_pair_content__doc__, " The number of the color pair (0 - (COLOR_PAIRS-1))."); #define _CURSES_PAIR_CONTENT_METHODDEF \ - {"pair_content", (PyCFunction)_curses_pair_content, METH_O, _curses_pair_content__doc__}, + {"pair_content", _curses_pair_content, METH_O, _curses_pair_content__doc__}, static PyObject * _curses_pair_content_impl(PyObject *module, int pair_number); @@ -3479,7 +3479,7 @@ PyDoc_STRVAR(_curses_pair_number__doc__, "color_pair() is the counterpart to this function."); #define _CURSES_PAIR_NUMBER_METHODDEF \ - {"pair_number", (PyCFunction)_curses_pair_number, METH_O, _curses_pair_number__doc__}, + {"pair_number", _curses_pair_number, METH_O, _curses_pair_number__doc__}, static PyObject * _curses_pair_number_impl(PyObject *module, int attr); @@ -3509,7 +3509,7 @@ PyDoc_STRVAR(_curses_putp__doc__, "Note that the output of putp() always goes to standard output."); #define _CURSES_PUTP_METHODDEF \ - {"putp", (PyCFunction)_curses_putp, METH_O, _curses_putp__doc__}, + {"putp", _curses_putp, METH_O, _curses_putp__doc__}, static PyObject * _curses_putp_impl(PyObject *module, const char *string); @@ -3578,7 +3578,7 @@ PyDoc_STRVAR(_curses_update_lines_cols__doc__, "\n"); #define _CURSES_UPDATE_LINES_COLS_METHODDEF \ - {"update_lines_cols", (PyCFunction)_curses_update_lines_cols, METH_NOARGS, _curses_update_lines_cols__doc__}, + {"update_lines_cols", _curses_update_lines_cols, METH_NOARGS, _curses_update_lines_cols__doc__}, static PyObject * _curses_update_lines_cols_impl(PyObject *module); @@ -3640,7 +3640,7 @@ PyDoc_STRVAR(_curses_reset_prog_mode__doc__, "Restore the terminal to \"program\" mode, as previously saved by def_prog_mode()."); #define _CURSES_RESET_PROG_MODE_METHODDEF \ - {"reset_prog_mode", (PyCFunction)_curses_reset_prog_mode, METH_NOARGS, _curses_reset_prog_mode__doc__}, + {"reset_prog_mode", _curses_reset_prog_mode, METH_NOARGS, _curses_reset_prog_mode__doc__}, static PyObject * _curses_reset_prog_mode_impl(PyObject *module); @@ -3658,7 +3658,7 @@ PyDoc_STRVAR(_curses_reset_shell_mode__doc__, "Restore the terminal to \"shell\" mode, as previously saved by def_shell_mode()."); #define _CURSES_RESET_SHELL_MODE_METHODDEF \ - {"reset_shell_mode", (PyCFunction)_curses_reset_shell_mode, METH_NOARGS, _curses_reset_shell_mode__doc__}, + {"reset_shell_mode", _curses_reset_shell_mode, METH_NOARGS, _curses_reset_shell_mode__doc__}, static PyObject * _curses_reset_shell_mode_impl(PyObject *module); @@ -3676,7 +3676,7 @@ PyDoc_STRVAR(_curses_resetty__doc__, "Restore terminal mode."); #define _CURSES_RESETTY_METHODDEF \ - {"resetty", (PyCFunction)_curses_resetty, METH_NOARGS, _curses_resetty__doc__}, + {"resetty", _curses_resetty, METH_NOARGS, _curses_resetty__doc__}, static PyObject * _curses_resetty_impl(PyObject *module); @@ -3853,7 +3853,7 @@ PyDoc_STRVAR(_curses_savetty__doc__, "Save terminal mode."); #define _CURSES_SAVETTY_METHODDEF \ - {"savetty", (PyCFunction)_curses_savetty, METH_NOARGS, _curses_savetty__doc__}, + {"savetty", _curses_savetty, METH_NOARGS, _curses_savetty__doc__}, static PyObject * _curses_savetty_impl(PyObject *module); @@ -3925,7 +3925,7 @@ PyDoc_STRVAR(_curses_start_color__doc__, "terminal was just turned on."); #define _CURSES_START_COLOR_METHODDEF \ - {"start_color", (PyCFunction)_curses_start_color, METH_NOARGS, _curses_start_color__doc__}, + {"start_color", _curses_start_color, METH_NOARGS, _curses_start_color__doc__}, static PyObject * _curses_start_color_impl(PyObject *module); @@ -3943,7 +3943,7 @@ PyDoc_STRVAR(_curses_termattrs__doc__, "Return a logical OR of all video attributes supported by the terminal."); #define _CURSES_TERMATTRS_METHODDEF \ - {"termattrs", (PyCFunction)_curses_termattrs, METH_NOARGS, _curses_termattrs__doc__}, + {"termattrs", _curses_termattrs, METH_NOARGS, _curses_termattrs__doc__}, static PyObject * _curses_termattrs_impl(PyObject *module); @@ -3961,7 +3961,7 @@ PyDoc_STRVAR(_curses_termname__doc__, "Return the value of the environment variable TERM, truncated to 14 characters."); #define _CURSES_TERMNAME_METHODDEF \ - {"termname", (PyCFunction)_curses_termname, METH_NOARGS, _curses_termname__doc__}, + {"termname", _curses_termname, METH_NOARGS, _curses_termname__doc__}, static PyObject * _curses_termname_impl(PyObject *module); @@ -3985,7 +3985,7 @@ PyDoc_STRVAR(_curses_tigetflag__doc__, "it is canceled or absent from the terminal description."); #define _CURSES_TIGETFLAG_METHODDEF \ - {"tigetflag", (PyCFunction)_curses_tigetflag, METH_O, _curses_tigetflag__doc__}, + {"tigetflag", _curses_tigetflag, METH_O, _curses_tigetflag__doc__}, static PyObject * _curses_tigetflag_impl(PyObject *module, const char *capname); @@ -4028,7 +4028,7 @@ PyDoc_STRVAR(_curses_tigetnum__doc__, "it is canceled or absent from the terminal description."); #define _CURSES_TIGETNUM_METHODDEF \ - {"tigetnum", (PyCFunction)_curses_tigetnum, METH_O, _curses_tigetnum__doc__}, + {"tigetnum", _curses_tigetnum, METH_O, _curses_tigetnum__doc__}, static PyObject * _curses_tigetnum_impl(PyObject *module, const char *capname); @@ -4071,7 +4071,7 @@ PyDoc_STRVAR(_curses_tigetstr__doc__, "absent from the terminal description."); #define _CURSES_TIGETSTR_METHODDEF \ - {"tigetstr", (PyCFunction)_curses_tigetstr, METH_O, _curses_tigetstr__doc__}, + {"tigetstr", _curses_tigetstr, METH_O, _curses_tigetstr__doc__}, static PyObject * _curses_tigetstr_impl(PyObject *module, const char *capname); @@ -4157,7 +4157,7 @@ PyDoc_STRVAR(_curses_typeahead__doc__, "If fd is -1, then no typeahead checking is done."); #define _CURSES_TYPEAHEAD_METHODDEF \ - {"typeahead", (PyCFunction)_curses_typeahead, METH_O, _curses_typeahead__doc__}, + {"typeahead", _curses_typeahead, METH_O, _curses_typeahead__doc__}, static PyObject * _curses_typeahead_impl(PyObject *module, int fd); @@ -4190,7 +4190,7 @@ PyDoc_STRVAR(_curses_unctrl__doc__, "for example as ^C. Printing characters are left as they are."); #define _CURSES_UNCTRL_METHODDEF \ - {"unctrl", (PyCFunction)_curses_unctrl, METH_O, _curses_unctrl__doc__}, + {"unctrl", _curses_unctrl, METH_O, _curses_unctrl__doc__}, PyDoc_STRVAR(_curses_ungetch__doc__, "ungetch($module, ch, /)\n" @@ -4199,7 +4199,7 @@ PyDoc_STRVAR(_curses_ungetch__doc__, "Push ch so the next getch() will return it."); #define _CURSES_UNGETCH_METHODDEF \ - {"ungetch", (PyCFunction)_curses_ungetch, METH_O, _curses_ungetch__doc__}, + {"ungetch", _curses_ungetch, METH_O, _curses_ungetch__doc__}, #if defined(HAVE_NCURSESW) @@ -4210,7 +4210,7 @@ PyDoc_STRVAR(_curses_unget_wch__doc__, "Push ch so the next get_wch() will return it."); #define _CURSES_UNGET_WCH_METHODDEF \ - {"unget_wch", (PyCFunction)_curses_unget_wch, METH_O, _curses_unget_wch__doc__}, + {"unget_wch", _curses_unget_wch, METH_O, _curses_unget_wch__doc__}, #endif /* defined(HAVE_NCURSESW) */ @@ -4232,7 +4232,7 @@ PyDoc_STRVAR(_curses_use_env__doc__, "not set)."); #define _CURSES_USE_ENV_METHODDEF \ - {"use_env", (PyCFunction)_curses_use_env, METH_O, _curses_use_env__doc__}, + {"use_env", _curses_use_env, METH_O, _curses_use_env__doc__}, static PyObject * _curses_use_env_impl(PyObject *module, int flag); @@ -4267,7 +4267,7 @@ PyDoc_STRVAR(_curses_use_default_colors__doc__, "is assigned to the color number -1."); #define _CURSES_USE_DEFAULT_COLORS_METHODDEF \ - {"use_default_colors", (PyCFunction)_curses_use_default_colors, METH_NOARGS, _curses_use_default_colors__doc__}, + {"use_default_colors", _curses_use_default_colors, METH_NOARGS, _curses_use_default_colors__doc__}, static PyObject * _curses_use_default_colors_impl(PyObject *module); @@ -4290,7 +4290,7 @@ PyDoc_STRVAR(_curses_has_extended_color_support__doc__, "that support more than 16 colors (e.g. xterm-256color)."); #define _CURSES_HAS_EXTENDED_COLOR_SUPPORT_METHODDEF \ - {"has_extended_color_support", (PyCFunction)_curses_has_extended_color_support, METH_NOARGS, _curses_has_extended_color_support__doc__}, + {"has_extended_color_support", _curses_has_extended_color_support, METH_NOARGS, _curses_has_extended_color_support__doc__}, static PyObject * _curses_has_extended_color_support_impl(PyObject *module); @@ -4392,4 +4392,4 @@ _curses_has_extended_color_support(PyObject *module, PyObject *Py_UNUSED(ignored #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF #define _CURSES_USE_DEFAULT_COLORS_METHODDEF #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */ -/*[clinic end generated code: output=ce2d19df9e20bfa3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c03ac7b812675584 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_datetimemodule.c.h b/Modules/clinic/_datetimemodule.c.h index d200c9cfd1888b..a9d720ff53d62d 100644 --- a/Modules/clinic/_datetimemodule.c.h +++ b/Modules/clinic/_datetimemodule.c.h @@ -18,7 +18,7 @@ PyDoc_STRVAR(datetime_date_fromtimestamp__doc__, "as local time."); #define DATETIME_DATE_FROMTIMESTAMP_METHODDEF \ - {"fromtimestamp", (PyCFunction)datetime_date_fromtimestamp, METH_O|METH_CLASS, datetime_date_fromtimestamp__doc__}, + {"fromtimestamp", datetime_date_fromtimestamp, METH_O|METH_CLASS, datetime_date_fromtimestamp__doc__}, static PyObject * datetime_date_fromtimestamp_impl(PyTypeObject *type, PyObject *timestamp); @@ -514,4 +514,4 @@ datetime_datetime_replace(PyObject *self, PyObject *const *args, Py_ssize_t narg exit: return return_value; } -/*[clinic end generated code: output=7b55f2d9a4596b58 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=84badd5e306602b6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h index 5e503194408776..4b13df326b2b9c 100644 --- a/Modules/clinic/_dbmmodule.c.h +++ b/Modules/clinic/_dbmmodule.c.h @@ -14,7 +14,7 @@ PyDoc_STRVAR(_dbm_dbm_close__doc__, "Close the database."); #define _DBM_DBM_CLOSE_METHODDEF \ - {"close", (PyCFunction)_dbm_dbm_close, METH_NOARGS, _dbm_dbm_close__doc__}, + {"close", _dbm_dbm_close, METH_NOARGS, _dbm_dbm_close__doc__}, static PyObject * _dbm_dbm_close_impl(dbmobject *self); @@ -221,4 +221,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=3b456118f231b160 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=eafa31670cd71bae input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index e79f20d86204bb..6b8a35aadc24e2 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -63,7 +63,7 @@ PyDoc_STRVAR(_elementtree_Element_clear__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_CLEAR_METHODDEF \ - {"clear", (PyCFunction)_elementtree_Element_clear, METH_NOARGS, _elementtree_Element_clear__doc__}, + {"clear", _elementtree_Element_clear, METH_NOARGS, _elementtree_Element_clear__doc__}, static PyObject * _elementtree_Element_clear_impl(ElementObject *self); @@ -101,7 +101,7 @@ PyDoc_STRVAR(_elementtree_Element___deepcopy____doc__, "\n"); #define _ELEMENTTREE_ELEMENT___DEEPCOPY___METHODDEF \ - {"__deepcopy__", (PyCFunction)_elementtree_Element___deepcopy__, METH_O, _elementtree_Element___deepcopy____doc__}, + {"__deepcopy__", _elementtree_Element___deepcopy__, METH_O, _elementtree_Element___deepcopy____doc__}, static PyObject * _elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo); @@ -129,7 +129,7 @@ PyDoc_STRVAR(_elementtree_Element___sizeof____doc__, "\n"); #define _ELEMENTTREE_ELEMENT___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)_elementtree_Element___sizeof__, METH_NOARGS, _elementtree_Element___sizeof____doc__}, + {"__sizeof__", _elementtree_Element___sizeof__, METH_NOARGS, _elementtree_Element___sizeof____doc__}, static size_t _elementtree_Element___sizeof___impl(ElementObject *self); @@ -156,7 +156,7 @@ PyDoc_STRVAR(_elementtree_Element___getstate____doc__, "\n"); #define _ELEMENTTREE_ELEMENT___GETSTATE___METHODDEF \ - {"__getstate__", (PyCFunction)_elementtree_Element___getstate__, METH_NOARGS, _elementtree_Element___getstate____doc__}, + {"__getstate__", _elementtree_Element___getstate__, METH_NOARGS, _elementtree_Element___getstate____doc__}, static PyObject * _elementtree_Element___getstate___impl(ElementObject *self); @@ -711,7 +711,7 @@ PyDoc_STRVAR(_elementtree_Element_items__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_ITEMS_METHODDEF \ - {"items", (PyCFunction)_elementtree_Element_items, METH_NOARGS, _elementtree_Element_items__doc__}, + {"items", _elementtree_Element_items, METH_NOARGS, _elementtree_Element_items__doc__}, static PyObject * _elementtree_Element_items_impl(ElementObject *self); @@ -728,7 +728,7 @@ PyDoc_STRVAR(_elementtree_Element_keys__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_KEYS_METHODDEF \ - {"keys", (PyCFunction)_elementtree_Element_keys, METH_NOARGS, _elementtree_Element_keys__doc__}, + {"keys", _elementtree_Element_keys, METH_NOARGS, _elementtree_Element_keys__doc__}, static PyObject * _elementtree_Element_keys_impl(ElementObject *self); @@ -795,7 +795,7 @@ PyDoc_STRVAR(_elementtree_Element_remove__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_REMOVE_METHODDEF \ - {"remove", (PyCFunction)_elementtree_Element_remove, METH_O, _elementtree_Element_remove__doc__}, + {"remove", _elementtree_Element_remove, METH_O, _elementtree_Element_remove__doc__}, static PyObject * _elementtree_Element_remove_impl(ElementObject *self, PyObject *subelement); @@ -982,7 +982,7 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_data__doc__, "\n"); #define _ELEMENTTREE_TREEBUILDER_DATA_METHODDEF \ - {"data", (PyCFunction)_elementtree_TreeBuilder_data, METH_O, _elementtree_TreeBuilder_data__doc__}, + {"data", _elementtree_TreeBuilder_data, METH_O, _elementtree_TreeBuilder_data__doc__}, static PyObject * _elementtree_TreeBuilder_data_impl(TreeBuilderObject *self, PyObject *data); @@ -1003,7 +1003,7 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_end__doc__, "\n"); #define _ELEMENTTREE_TREEBUILDER_END_METHODDEF \ - {"end", (PyCFunction)_elementtree_TreeBuilder_end, METH_O, _elementtree_TreeBuilder_end__doc__}, + {"end", _elementtree_TreeBuilder_end, METH_O, _elementtree_TreeBuilder_end__doc__}, static PyObject * _elementtree_TreeBuilder_end_impl(TreeBuilderObject *self, PyObject *tag); @@ -1024,7 +1024,7 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_comment__doc__, "\n"); #define _ELEMENTTREE_TREEBUILDER_COMMENT_METHODDEF \ - {"comment", (PyCFunction)_elementtree_TreeBuilder_comment, METH_O, _elementtree_TreeBuilder_comment__doc__}, + {"comment", _elementtree_TreeBuilder_comment, METH_O, _elementtree_TreeBuilder_comment__doc__}, static PyObject * _elementtree_TreeBuilder_comment_impl(TreeBuilderObject *self, @@ -1080,7 +1080,7 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_close__doc__, "\n"); #define _ELEMENTTREE_TREEBUILDER_CLOSE_METHODDEF \ - {"close", (PyCFunction)_elementtree_TreeBuilder_close, METH_NOARGS, _elementtree_TreeBuilder_close__doc__}, + {"close", _elementtree_TreeBuilder_close, METH_NOARGS, _elementtree_TreeBuilder_close__doc__}, static PyObject * _elementtree_TreeBuilder_close_impl(TreeBuilderObject *self); @@ -1210,7 +1210,7 @@ PyDoc_STRVAR(_elementtree_XMLParser_close__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER_CLOSE_METHODDEF \ - {"close", (PyCFunction)_elementtree_XMLParser_close, METH_NOARGS, _elementtree_XMLParser_close__doc__}, + {"close", _elementtree_XMLParser_close, METH_NOARGS, _elementtree_XMLParser_close__doc__}, static PyObject * _elementtree_XMLParser_close_impl(XMLParserObject *self); @@ -1227,7 +1227,7 @@ PyDoc_STRVAR(_elementtree_XMLParser_flush__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER_FLUSH_METHODDEF \ - {"flush", (PyCFunction)_elementtree_XMLParser_flush, METH_NOARGS, _elementtree_XMLParser_flush__doc__}, + {"flush", _elementtree_XMLParser_flush, METH_NOARGS, _elementtree_XMLParser_flush__doc__}, static PyObject * _elementtree_XMLParser_flush_impl(XMLParserObject *self); @@ -1244,7 +1244,7 @@ PyDoc_STRVAR(_elementtree_XMLParser_feed__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER_FEED_METHODDEF \ - {"feed", (PyCFunction)_elementtree_XMLParser_feed, METH_O, _elementtree_XMLParser_feed__doc__}, + {"feed", _elementtree_XMLParser_feed, METH_O, _elementtree_XMLParser_feed__doc__}, static PyObject * _elementtree_XMLParser_feed_impl(XMLParserObject *self, PyObject *data); @@ -1265,7 +1265,7 @@ PyDoc_STRVAR(_elementtree_XMLParser__parse_whole__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER__PARSE_WHOLE_METHODDEF \ - {"_parse_whole", (PyCFunction)_elementtree_XMLParser__parse_whole, METH_O, _elementtree_XMLParser__parse_whole__doc__}, + {"_parse_whole", _elementtree_XMLParser__parse_whole, METH_O, _elementtree_XMLParser__parse_whole__doc__}, static PyObject * _elementtree_XMLParser__parse_whole_impl(XMLParserObject *self, @@ -1315,4 +1315,4 @@ _elementtree_XMLParser__setevents(PyObject *self, PyObject *const *args, Py_ssiz exit: return return_value; } -/*[clinic end generated code: output=0eed58350c3c1832 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b3b1fa09802c069f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_functoolsmodule.c.h b/Modules/clinic/_functoolsmodule.c.h index afd5eb4eb12b78..6046686a03fe2d 100644 --- a/Modules/clinic/_functoolsmodule.c.h +++ b/Modules/clinic/_functoolsmodule.c.h @@ -148,7 +148,7 @@ PyDoc_STRVAR(_functools__lru_cache_wrapper_cache_info__doc__, "Report cache statistics"); #define _FUNCTOOLS__LRU_CACHE_WRAPPER_CACHE_INFO_METHODDEF \ - {"cache_info", (PyCFunction)_functools__lru_cache_wrapper_cache_info, METH_NOARGS, _functools__lru_cache_wrapper_cache_info__doc__}, + {"cache_info", _functools__lru_cache_wrapper_cache_info, METH_NOARGS, _functools__lru_cache_wrapper_cache_info__doc__}, static PyObject * _functools__lru_cache_wrapper_cache_info_impl(PyObject *self); @@ -172,7 +172,7 @@ PyDoc_STRVAR(_functools__lru_cache_wrapper_cache_clear__doc__, "Clear the cache and cache statistics"); #define _FUNCTOOLS__LRU_CACHE_WRAPPER_CACHE_CLEAR_METHODDEF \ - {"cache_clear", (PyCFunction)_functools__lru_cache_wrapper_cache_clear, METH_NOARGS, _functools__lru_cache_wrapper_cache_clear__doc__}, + {"cache_clear", _functools__lru_cache_wrapper_cache_clear, METH_NOARGS, _functools__lru_cache_wrapper_cache_clear__doc__}, static PyObject * _functools__lru_cache_wrapper_cache_clear_impl(PyObject *self); @@ -188,4 +188,4 @@ _functools__lru_cache_wrapper_cache_clear(PyObject *self, PyObject *Py_UNUSED(ig return return_value; } -/*[clinic end generated code: output=e6edcc01f0720daf input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cd7afa547ff66d08 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index 00950f18e53541..f2d604ab02e327 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -83,7 +83,7 @@ PyDoc_STRVAR(_gdbm_gdbm_close__doc__, "Close the database."); #define _GDBM_GDBM_CLOSE_METHODDEF \ - {"close", (PyCFunction)_gdbm_gdbm_close, METH_NOARGS, _gdbm_gdbm_close__doc__}, + {"close", _gdbm_gdbm_close, METH_NOARGS, _gdbm_gdbm_close__doc__}, static PyObject * _gdbm_gdbm_close_impl(gdbmobject *self); @@ -343,4 +343,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=d974cb39e4ee5d67 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=54dc05a2b1a17c4b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index 7bf6af1eeeba24..1b32294dd5926e 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(EVP_copy__doc__, "Return a copy of the hash object."); #define EVP_COPY_METHODDEF \ - {"copy", (PyCFunction)EVP_copy, METH_NOARGS, EVP_copy__doc__}, + {"copy", EVP_copy, METH_NOARGS, EVP_copy__doc__}, static PyObject * EVP_copy_impl(EVPobject *self); @@ -34,7 +34,7 @@ PyDoc_STRVAR(EVP_digest__doc__, "Return the digest value as a bytes object."); #define EVP_DIGEST_METHODDEF \ - {"digest", (PyCFunction)EVP_digest, METH_NOARGS, EVP_digest__doc__}, + {"digest", EVP_digest, METH_NOARGS, EVP_digest__doc__}, static PyObject * EVP_digest_impl(EVPobject *self); @@ -52,7 +52,7 @@ PyDoc_STRVAR(EVP_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define EVP_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)EVP_hexdigest, METH_NOARGS, EVP_hexdigest__doc__}, + {"hexdigest", EVP_hexdigest, METH_NOARGS, EVP_hexdigest__doc__}, static PyObject * EVP_hexdigest_impl(EVPobject *self); @@ -70,7 +70,7 @@ PyDoc_STRVAR(EVP_update__doc__, "Update this hash object\'s state with the provided string."); #define EVP_UPDATE_METHODDEF \ - {"update", (PyCFunction)EVP_update, METH_O, EVP_update__doc__}, + {"update", EVP_update, METH_O, EVP_update__doc__}, static PyObject * EVP_update_impl(EVPobject *self, PyObject *obj); @@ -1641,7 +1641,7 @@ PyDoc_STRVAR(_hashlib_HMAC_copy__doc__, "Return a copy (\"clone\") of the HMAC object."); #define _HASHLIB_HMAC_COPY_METHODDEF \ - {"copy", (PyCFunction)_hashlib_HMAC_copy, METH_NOARGS, _hashlib_HMAC_copy__doc__}, + {"copy", _hashlib_HMAC_copy, METH_NOARGS, _hashlib_HMAC_copy__doc__}, static PyObject * _hashlib_HMAC_copy_impl(HMACobject *self); @@ -1715,7 +1715,7 @@ PyDoc_STRVAR(_hashlib_HMAC_digest__doc__, "Return the digest of the bytes passed to the update() method so far."); #define _HASHLIB_HMAC_DIGEST_METHODDEF \ - {"digest", (PyCFunction)_hashlib_HMAC_digest, METH_NOARGS, _hashlib_HMAC_digest__doc__}, + {"digest", _hashlib_HMAC_digest, METH_NOARGS, _hashlib_HMAC_digest__doc__}, static PyObject * _hashlib_HMAC_digest_impl(HMACobject *self); @@ -1736,7 +1736,7 @@ PyDoc_STRVAR(_hashlib_HMAC_hexdigest__doc__, "environments."); #define _HASHLIB_HMAC_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)_hashlib_HMAC_hexdigest, METH_NOARGS, _hashlib_HMAC_hexdigest__doc__}, + {"hexdigest", _hashlib_HMAC_hexdigest, METH_NOARGS, _hashlib_HMAC_hexdigest__doc__}, static PyObject * _hashlib_HMAC_hexdigest_impl(HMACobject *self); @@ -1761,7 +1761,7 @@ PyDoc_STRVAR(_hashlib_get_fips_mode__doc__, "values other than 1 may have additional significance."); #define _HASHLIB_GET_FIPS_MODE_METHODDEF \ - {"get_fips_mode", (PyCFunction)_hashlib_get_fips_mode, METH_NOARGS, _hashlib_get_fips_mode__doc__}, + {"get_fips_mode", _hashlib_get_fips_mode, METH_NOARGS, _hashlib_get_fips_mode__doc__}, static int _hashlib_get_fips_mode_impl(PyObject *module); @@ -1857,4 +1857,4 @@ _hashlib_compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t narg #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=e9624853a73bb65a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=26fd290225cb8d0a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_heapqmodule.c.h b/Modules/clinic/_heapqmodule.c.h index 9046307990773b..eec5c6c918322b 100644 --- a/Modules/clinic/_heapqmodule.c.h +++ b/Modules/clinic/_heapqmodule.c.h @@ -45,7 +45,7 @@ PyDoc_STRVAR(_heapq_heappop__doc__, "Pop the smallest item off the heap, maintaining the heap invariant."); #define _HEAPQ_HEAPPOP_METHODDEF \ - {"heappop", (PyCFunction)_heapq_heappop, METH_O, _heapq_heappop__doc__}, + {"heappop", _heapq_heappop, METH_O, _heapq_heappop__doc__}, static PyObject * _heapq_heappop_impl(PyObject *module, PyObject *heap); @@ -153,7 +153,7 @@ PyDoc_STRVAR(_heapq_heapify__doc__, "Transform list into a heap, in-place, in O(len(heap)) time."); #define _HEAPQ_HEAPIFY_METHODDEF \ - {"heapify", (PyCFunction)_heapq_heapify, METH_O, _heapq_heapify__doc__}, + {"heapify", _heapq_heapify, METH_O, _heapq_heapify__doc__}, static PyObject * _heapq_heapify_impl(PyObject *module, PyObject *heap); @@ -182,7 +182,7 @@ PyDoc_STRVAR(_heapq__heappop_max__doc__, "Maxheap variant of heappop."); #define _HEAPQ__HEAPPOP_MAX_METHODDEF \ - {"_heappop_max", (PyCFunction)_heapq__heappop_max, METH_O, _heapq__heappop_max__doc__}, + {"_heappop_max", _heapq__heappop_max, METH_O, _heapq__heappop_max__doc__}, static PyObject * _heapq__heappop_max_impl(PyObject *module, PyObject *heap); @@ -246,7 +246,7 @@ PyDoc_STRVAR(_heapq__heapify_max__doc__, "Maxheap variant of heapify."); #define _HEAPQ__HEAPIFY_MAX_METHODDEF \ - {"_heapify_max", (PyCFunction)_heapq__heapify_max, METH_O, _heapq__heapify_max__doc__}, + {"_heapify_max", _heapq__heapify_max, METH_O, _heapq__heapify_max__doc__}, static PyObject * _heapq__heapify_max_impl(PyObject *module, PyObject *heap); @@ -267,4 +267,4 @@ _heapq__heapify_max(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=05f2afdf3bc54c9d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=06ad2cf6ef705d99 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_localemodule.c.h b/Modules/clinic/_localemodule.c.h index 5e0880b0d0bb4c..73ac47aaf0b45c 100644 --- a/Modules/clinic/_localemodule.c.h +++ b/Modules/clinic/_localemodule.c.h @@ -65,7 +65,7 @@ PyDoc_STRVAR(_locale_localeconv__doc__, "Returns numeric and monetary locale-specific parameters."); #define _LOCALE_LOCALECONV_METHODDEF \ - {"localeconv", (PyCFunction)_locale_localeconv, METH_NOARGS, _locale_localeconv__doc__}, + {"localeconv", _locale_localeconv, METH_NOARGS, _locale_localeconv__doc__}, static PyObject * _locale_localeconv_impl(PyObject *module); @@ -127,7 +127,7 @@ PyDoc_STRVAR(_locale_strxfrm__doc__, "Return a string that can be used as a key for locale-aware comparisons."); #define _LOCALE_STRXFRM_METHODDEF \ - {"strxfrm", (PyCFunction)_locale_strxfrm, METH_O, _locale_strxfrm__doc__}, + {"strxfrm", _locale_strxfrm, METH_O, _locale_strxfrm__doc__}, static PyObject * _locale_strxfrm_impl(PyObject *module, PyObject *str); @@ -159,7 +159,7 @@ PyDoc_STRVAR(_locale__getdefaultlocale__doc__, "\n"); #define _LOCALE__GETDEFAULTLOCALE_METHODDEF \ - {"_getdefaultlocale", (PyCFunction)_locale__getdefaultlocale, METH_NOARGS, _locale__getdefaultlocale__doc__}, + {"_getdefaultlocale", _locale__getdefaultlocale, METH_NOARGS, _locale__getdefaultlocale__doc__}, static PyObject * _locale__getdefaultlocale_impl(PyObject *module); @@ -181,7 +181,7 @@ PyDoc_STRVAR(_locale_nl_langinfo__doc__, "Return the value for the locale information associated with key."); #define _LOCALE_NL_LANGINFO_METHODDEF \ - {"nl_langinfo", (PyCFunction)_locale_nl_langinfo, METH_O, _locale_nl_langinfo__doc__}, + {"nl_langinfo", _locale_nl_langinfo, METH_O, _locale_nl_langinfo__doc__}, static PyObject * _locale_nl_langinfo_impl(PyObject *module, int item); @@ -215,7 +215,7 @@ PyDoc_STRVAR(_locale_gettext__doc__, "Return translation of msg."); #define _LOCALE_GETTEXT_METHODDEF \ - {"gettext", (PyCFunction)_locale_gettext, METH_O, _locale_gettext__doc__}, + {"gettext", _locale_gettext, METH_O, _locale_gettext__doc__}, static PyObject * _locale_gettext_impl(PyObject *module, const char *in); @@ -390,7 +390,7 @@ PyDoc_STRVAR(_locale_textdomain__doc__, "Set the C library\'s textdmain to domain, returning the new domain."); #define _LOCALE_TEXTDOMAIN_METHODDEF \ - {"textdomain", (PyCFunction)_locale_textdomain, METH_O, _locale_textdomain__doc__}, + {"textdomain", _locale_textdomain, METH_O, _locale_textdomain__doc__}, static PyObject * _locale_textdomain_impl(PyObject *module, const char *domain); @@ -545,7 +545,7 @@ PyDoc_STRVAR(_locale_getencoding__doc__, "Get the current locale encoding."); #define _LOCALE_GETENCODING_METHODDEF \ - {"getencoding", (PyCFunction)_locale_getencoding, METH_NOARGS, _locale_getencoding__doc__}, + {"getencoding", _locale_getencoding, METH_NOARGS, _locale_getencoding__doc__}, static PyObject * _locale_getencoding_impl(PyObject *module); @@ -595,4 +595,4 @@ _locale_getencoding(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF #define _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF #endif /* !defined(_LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF) */ -/*[clinic end generated code: output=034a3c219466d207 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ec091fccbb896f06 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lsprof.c.h b/Modules/clinic/_lsprof.c.h index 6a75a8f9833d1e..d817b68c0b8d46 100644 --- a/Modules/clinic/_lsprof.c.h +++ b/Modules/clinic/_lsprof.c.h @@ -277,7 +277,7 @@ PyDoc_STRVAR(_lsprof_Profiler_disable__doc__, "Stop collecting profiling information."); #define _LSPROF_PROFILER_DISABLE_METHODDEF \ - {"disable", (PyCFunction)_lsprof_Profiler_disable, METH_NOARGS, _lsprof_Profiler_disable__doc__}, + {"disable", _lsprof_Profiler_disable, METH_NOARGS, _lsprof_Profiler_disable__doc__}, static PyObject * _lsprof_Profiler_disable_impl(ProfilerObject *self); @@ -295,7 +295,7 @@ PyDoc_STRVAR(_lsprof_Profiler_clear__doc__, "Clear all profiling information collected so far."); #define _LSPROF_PROFILER_CLEAR_METHODDEF \ - {"clear", (PyCFunction)_lsprof_Profiler_clear, METH_NOARGS, _lsprof_Profiler_clear__doc__}, + {"clear", _lsprof_Profiler_clear, METH_NOARGS, _lsprof_Profiler_clear__doc__}, static PyObject * _lsprof_Profiler_clear_impl(ProfilerObject *self); @@ -407,4 +407,4 @@ profiler_init(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=d983dbf23fd8ac3b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=72fb758bc5e5e6f9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index c7c81d8d1f1b9d..1e779e9b129cd5 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -21,7 +21,7 @@ PyDoc_STRVAR(_lzma_LZMACompressor_compress__doc__, "flush() method to finish the compression process."); #define _LZMA_LZMACOMPRESSOR_COMPRESS_METHODDEF \ - {"compress", (PyCFunction)_lzma_LZMACompressor_compress, METH_O, _lzma_LZMACompressor_compress__doc__}, + {"compress", _lzma_LZMACompressor_compress, METH_O, _lzma_LZMACompressor_compress__doc__}, static PyObject * _lzma_LZMACompressor_compress_impl(Compressor *self, Py_buffer *data); @@ -57,7 +57,7 @@ PyDoc_STRVAR(_lzma_LZMACompressor_flush__doc__, "The compressor object may not be used after this method is called."); #define _LZMA_LZMACOMPRESSOR_FLUSH_METHODDEF \ - {"flush", (PyCFunction)_lzma_LZMACompressor_flush, METH_NOARGS, _lzma_LZMACompressor_flush__doc__}, + {"flush", _lzma_LZMACompressor_flush, METH_NOARGS, _lzma_LZMACompressor_flush__doc__}, static PyObject * _lzma_LZMACompressor_flush_impl(Compressor *self); @@ -267,7 +267,7 @@ PyDoc_STRVAR(_lzma_is_check_supported__doc__, "Always returns True for CHECK_NONE and CHECK_CRC32."); #define _LZMA_IS_CHECK_SUPPORTED_METHODDEF \ - {"is_check_supported", (PyCFunction)_lzma_is_check_supported, METH_O, _lzma_is_check_supported__doc__}, + {"is_check_supported", _lzma_is_check_supported, METH_O, _lzma_is_check_supported__doc__}, static PyObject * _lzma_is_check_supported_impl(PyObject *module, int check_id); @@ -329,4 +329,4 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz return return_value; } -/*[clinic end generated code: output=19ed9b1182f5ddf9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=88187d95393f0c22 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_opcode.c.h b/Modules/clinic/_opcode.c.h index e61762e124ad72..f0bc801833e837 100644 --- a/Modules/clinic/_opcode.c.h +++ b/Modules/clinic/_opcode.c.h @@ -611,7 +611,7 @@ PyDoc_STRVAR(_opcode_get_specialization_stats__doc__, "Return the specialization stats"); #define _OPCODE_GET_SPECIALIZATION_STATS_METHODDEF \ - {"get_specialization_stats", (PyCFunction)_opcode_get_specialization_stats, METH_NOARGS, _opcode_get_specialization_stats__doc__}, + {"get_specialization_stats", _opcode_get_specialization_stats, METH_NOARGS, _opcode_get_specialization_stats__doc__}, static PyObject * _opcode_get_specialization_stats_impl(PyObject *module); @@ -631,7 +631,7 @@ PyDoc_STRVAR(_opcode_get_nb_ops__doc__, "Indexed by the BINARY_OP oparg value."); #define _OPCODE_GET_NB_OPS_METHODDEF \ - {"get_nb_ops", (PyCFunction)_opcode_get_nb_ops, METH_NOARGS, _opcode_get_nb_ops__doc__}, + {"get_nb_ops", _opcode_get_nb_ops, METH_NOARGS, _opcode_get_nb_ops__doc__}, static PyObject * _opcode_get_nb_ops_impl(PyObject *module); @@ -649,7 +649,7 @@ PyDoc_STRVAR(_opcode_get_intrinsic1_descs__doc__, "Return a list of names of the unary intrinsics."); #define _OPCODE_GET_INTRINSIC1_DESCS_METHODDEF \ - {"get_intrinsic1_descs", (PyCFunction)_opcode_get_intrinsic1_descs, METH_NOARGS, _opcode_get_intrinsic1_descs__doc__}, + {"get_intrinsic1_descs", _opcode_get_intrinsic1_descs, METH_NOARGS, _opcode_get_intrinsic1_descs__doc__}, static PyObject * _opcode_get_intrinsic1_descs_impl(PyObject *module); @@ -667,7 +667,7 @@ PyDoc_STRVAR(_opcode_get_intrinsic2_descs__doc__, "Return a list of names of the binary intrinsics."); #define _OPCODE_GET_INTRINSIC2_DESCS_METHODDEF \ - {"get_intrinsic2_descs", (PyCFunction)_opcode_get_intrinsic2_descs, METH_NOARGS, _opcode_get_intrinsic2_descs__doc__}, + {"get_intrinsic2_descs", _opcode_get_intrinsic2_descs, METH_NOARGS, _opcode_get_intrinsic2_descs__doc__}, static PyObject * _opcode_get_intrinsic2_descs_impl(PyObject *module); @@ -685,7 +685,7 @@ PyDoc_STRVAR(_opcode_get_special_method_names__doc__, "Return a list of special method names."); #define _OPCODE_GET_SPECIAL_METHOD_NAMES_METHODDEF \ - {"get_special_method_names", (PyCFunction)_opcode_get_special_method_names, METH_NOARGS, _opcode_get_special_method_names__doc__}, + {"get_special_method_names", _opcode_get_special_method_names, METH_NOARGS, _opcode_get_special_method_names__doc__}, static PyObject * _opcode_get_special_method_names_impl(PyObject *module); @@ -756,4 +756,4 @@ _opcode_get_executor(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=2e0c39286d0253e7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a02840cf31912b4d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_operator.c.h b/Modules/clinic/_operator.c.h index 48a8ea8c3379ab..9b5f4b03737a9f 100644 --- a/Modules/clinic/_operator.c.h +++ b/Modules/clinic/_operator.c.h @@ -12,7 +12,7 @@ PyDoc_STRVAR(_operator_truth__doc__, "Return True if a is true, False otherwise."); #define _OPERATOR_TRUTH_METHODDEF \ - {"truth", (PyCFunction)_operator_truth, METH_O, _operator_truth__doc__}, + {"truth", _operator_truth, METH_O, _operator_truth__doc__}, static int _operator_truth_impl(PyObject *module, PyObject *a); @@ -250,7 +250,7 @@ PyDoc_STRVAR(_operator_neg__doc__, "Same as -a."); #define _OPERATOR_NEG_METHODDEF \ - {"neg", (PyCFunction)_operator_neg, METH_O, _operator_neg__doc__}, + {"neg", _operator_neg, METH_O, _operator_neg__doc__}, PyDoc_STRVAR(_operator_pos__doc__, "pos($module, a, /)\n" @@ -259,7 +259,7 @@ PyDoc_STRVAR(_operator_pos__doc__, "Same as +a."); #define _OPERATOR_POS_METHODDEF \ - {"pos", (PyCFunction)_operator_pos, METH_O, _operator_pos__doc__}, + {"pos", _operator_pos, METH_O, _operator_pos__doc__}, PyDoc_STRVAR(_operator_abs__doc__, "abs($module, a, /)\n" @@ -268,7 +268,7 @@ PyDoc_STRVAR(_operator_abs__doc__, "Same as abs(a)."); #define _OPERATOR_ABS_METHODDEF \ - {"abs", (PyCFunction)_operator_abs, METH_O, _operator_abs__doc__}, + {"abs", _operator_abs, METH_O, _operator_abs__doc__}, PyDoc_STRVAR(_operator_inv__doc__, "inv($module, a, /)\n" @@ -277,7 +277,7 @@ PyDoc_STRVAR(_operator_inv__doc__, "Same as ~a."); #define _OPERATOR_INV_METHODDEF \ - {"inv", (PyCFunction)_operator_inv, METH_O, _operator_inv__doc__}, + {"inv", _operator_inv, METH_O, _operator_inv__doc__}, PyDoc_STRVAR(_operator_invert__doc__, "invert($module, a, /)\n" @@ -286,7 +286,7 @@ PyDoc_STRVAR(_operator_invert__doc__, "Same as ~a."); #define _OPERATOR_INVERT_METHODDEF \ - {"invert", (PyCFunction)_operator_invert, METH_O, _operator_invert__doc__}, + {"invert", _operator_invert, METH_O, _operator_invert__doc__}, PyDoc_STRVAR(_operator_lshift__doc__, "lshift($module, a, b, /)\n" @@ -355,7 +355,7 @@ PyDoc_STRVAR(_operator_not___doc__, "Same as not a."); #define _OPERATOR_NOT__METHODDEF \ - {"not_", (PyCFunction)_operator_not_, METH_O, _operator_not___doc__}, + {"not_", _operator_not_, METH_O, _operator_not___doc__}, static int _operator_not__impl(PyObject *module, PyObject *a); @@ -1331,7 +1331,7 @@ PyDoc_STRVAR(_operator_index__doc__, "Same as a.__index__()"); #define _OPERATOR_INDEX_METHODDEF \ - {"index", (PyCFunction)_operator_index, METH_O, _operator_index__doc__}, + {"index", _operator_index, METH_O, _operator_index__doc__}, PyDoc_STRVAR(_operator_is___doc__, "is_($module, a, b, /)\n" @@ -1400,7 +1400,7 @@ PyDoc_STRVAR(_operator_is_none__doc__, "Same as a is None."); #define _OPERATOR_IS_NONE_METHODDEF \ - {"is_none", (PyCFunction)_operator_is_none, METH_O, _operator_is_none__doc__}, + {"is_none", _operator_is_none, METH_O, _operator_is_none__doc__}, PyDoc_STRVAR(_operator_is_not_none__doc__, "is_not_none($module, a, /)\n" @@ -1409,7 +1409,7 @@ PyDoc_STRVAR(_operator_is_not_none__doc__, "Same as a is not None."); #define _OPERATOR_IS_NOT_NONE_METHODDEF \ - {"is_not_none", (PyCFunction)_operator_is_not_none, METH_O, _operator_is_not_none__doc__}, + {"is_not_none", _operator_is_not_none, METH_O, _operator_is_not_none__doc__}, PyDoc_STRVAR(_operator_length_hint__doc__, "length_hint($module, obj, default=0, /)\n" @@ -1507,4 +1507,4 @@ _operator__compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t na exit: return return_value; } -/*[clinic end generated code: output=972e2543c4fcf1ba input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5b58ed7c1fee66b5 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index 91d355c5afb353..479dcbd03ac6f6 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -20,7 +20,7 @@ PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__, "re-using picklers."); #define _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF \ - {"clear_memo", (PyCFunction)_pickle_Pickler_clear_memo, METH_NOARGS, _pickle_Pickler_clear_memo__doc__}, + {"clear_memo", _pickle_Pickler_clear_memo, METH_NOARGS, _pickle_Pickler_clear_memo__doc__}, static PyObject * _pickle_Pickler_clear_memo_impl(PicklerObject *self); @@ -83,7 +83,7 @@ PyDoc_STRVAR(_pickle_Pickler___sizeof____doc__, "Returns size in memory, in bytes."); #define _PICKLE_PICKLER___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)_pickle_Pickler___sizeof__, METH_NOARGS, _pickle_Pickler___sizeof____doc__}, + {"__sizeof__", _pickle_Pickler___sizeof__, METH_NOARGS, _pickle_Pickler___sizeof____doc__}, static size_t _pickle_Pickler___sizeof___impl(PicklerObject *self); @@ -221,7 +221,7 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy_clear__doc__, "Remove all items from memo."); #define _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF \ - {"clear", (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__}, + {"clear", _pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__}, static PyObject * _pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self); @@ -239,7 +239,7 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__, "Copy the memo to a new object."); #define _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF \ - {"copy", (PyCFunction)_pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__}, + {"copy", _pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__}, static PyObject * _pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self); @@ -257,7 +257,7 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__, "Implement pickle support."); #define _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF \ - {"__reduce__", (PyCFunction)_pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__}, + {"__reduce__", _pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__}, static PyObject * _pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self); @@ -400,7 +400,7 @@ PyDoc_STRVAR(_pickle_Unpickler___sizeof____doc__, "Returns size in memory, in bytes."); #define _PICKLE_UNPICKLER___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)_pickle_Unpickler___sizeof__, METH_NOARGS, _pickle_Unpickler___sizeof____doc__}, + {"__sizeof__", _pickle_Unpickler___sizeof__, METH_NOARGS, _pickle_Unpickler___sizeof____doc__}, static size_t _pickle_Unpickler___sizeof___impl(UnpicklerObject *self); @@ -560,7 +560,7 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_clear__doc__, "Remove all items from memo."); #define _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF \ - {"clear", (PyCFunction)_pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__}, + {"clear", _pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__}, static PyObject * _pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self); @@ -578,7 +578,7 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__, "Copy the memo to a new object."); #define _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF \ - {"copy", (PyCFunction)_pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__}, + {"copy", _pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__}, static PyObject * _pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self); @@ -596,7 +596,7 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__, "Implement pickling support."); #define _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF \ - {"__reduce__", (PyCFunction)_pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__}, + {"__reduce__", _pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__}, static PyObject * _pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self); @@ -1086,4 +1086,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=d71dc73af298ebe8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=602519519b7ae911 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_queuemodule.c.h b/Modules/clinic/_queuemodule.c.h index 2dfc3e6be1984e..4b9f498212b96a 100644 --- a/Modules/clinic/_queuemodule.c.h +++ b/Modules/clinic/_queuemodule.c.h @@ -300,7 +300,7 @@ PyDoc_STRVAR(_queue_SimpleQueue_empty__doc__, "Return True if the queue is empty, False otherwise (not reliable!)."); #define _QUEUE_SIMPLEQUEUE_EMPTY_METHODDEF \ - {"empty", (PyCFunction)_queue_SimpleQueue_empty, METH_NOARGS, _queue_SimpleQueue_empty__doc__}, + {"empty", _queue_SimpleQueue_empty, METH_NOARGS, _queue_SimpleQueue_empty__doc__}, static int _queue_SimpleQueue_empty_impl(simplequeueobject *self); @@ -330,7 +330,7 @@ PyDoc_STRVAR(_queue_SimpleQueue_qsize__doc__, "Return the approximate size of the queue (not reliable!)."); #define _QUEUE_SIMPLEQUEUE_QSIZE_METHODDEF \ - {"qsize", (PyCFunction)_queue_SimpleQueue_qsize, METH_NOARGS, _queue_SimpleQueue_qsize__doc__}, + {"qsize", _queue_SimpleQueue_qsize, METH_NOARGS, _queue_SimpleQueue_qsize__doc__}, static Py_ssize_t _queue_SimpleQueue_qsize_impl(simplequeueobject *self); @@ -352,4 +352,4 @@ _queue_SimpleQueue_qsize(PyObject *self, PyObject *Py_UNUSED(ignored)) exit: return return_value; } -/*[clinic end generated code: output=e04e15a1b959c700 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8fff3ab8db9c6127 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_randommodule.c.h b/Modules/clinic/_randommodule.c.h index 1e989e970c9de5..67b927d4546540 100644 --- a/Modules/clinic/_randommodule.c.h +++ b/Modules/clinic/_randommodule.c.h @@ -12,7 +12,7 @@ PyDoc_STRVAR(_random_Random_random__doc__, "random() -> x in the interval [0, 1)."); #define _RANDOM_RANDOM_RANDOM_METHODDEF \ - {"random", (PyCFunction)_random_Random_random, METH_NOARGS, _random_Random_random__doc__}, + {"random", _random_Random_random, METH_NOARGS, _random_Random_random__doc__}, static PyObject * _random_Random_random_impl(RandomObject *self); @@ -73,7 +73,7 @@ PyDoc_STRVAR(_random_Random_getstate__doc__, "getstate() -> tuple containing the current state."); #define _RANDOM_RANDOM_GETSTATE_METHODDEF \ - {"getstate", (PyCFunction)_random_Random_getstate, METH_NOARGS, _random_Random_getstate__doc__}, + {"getstate", _random_Random_getstate, METH_NOARGS, _random_Random_getstate__doc__}, static PyObject * _random_Random_getstate_impl(RandomObject *self); @@ -97,7 +97,7 @@ PyDoc_STRVAR(_random_Random_setstate__doc__, "setstate(state) -> None. Restores generator state."); #define _RANDOM_RANDOM_SETSTATE_METHODDEF \ - {"setstate", (PyCFunction)_random_Random_setstate, METH_O, _random_Random_setstate__doc__}, + {"setstate", _random_Random_setstate, METH_O, _random_Random_setstate__doc__}, static PyObject * _random_Random_setstate_impl(RandomObject *self, PyObject *state); @@ -121,7 +121,7 @@ PyDoc_STRVAR(_random_Random_getrandbits__doc__, "getrandbits(k) -> x. Generates an int with k random bits."); #define _RANDOM_RANDOM_GETRANDBITS_METHODDEF \ - {"getrandbits", (PyCFunction)_random_Random_getrandbits, METH_O, _random_Random_getrandbits__doc__}, + {"getrandbits", _random_Random_getrandbits, METH_O, _random_Random_getrandbits__doc__}, static PyObject * _random_Random_getrandbits_impl(RandomObject *self, int k); @@ -143,4 +143,4 @@ _random_Random_getrandbits(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=4458b5a69201ebea input=a9049054013a1b77]*/ +/*[clinic end generated code: output=46631c9da5aacd1d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index 9656f09c471931..f28329126c5048 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_do_handshake__doc__, "\n"); #define _SSL__SSLSOCKET_DO_HANDSHAKE_METHODDEF \ - {"do_handshake", (PyCFunction)_ssl__SSLSocket_do_handshake, METH_NOARGS, _ssl__SSLSocket_do_handshake__doc__}, + {"do_handshake", _ssl__SSLSocket_do_handshake, METH_NOARGS, _ssl__SSLSocket_do_handshake__doc__}, static PyObject * _ssl__SSLSocket_do_handshake_impl(PySSLSocket *self); @@ -38,7 +38,7 @@ PyDoc_STRVAR(_ssl__test_decode_cert__doc__, "\n"); #define _SSL__TEST_DECODE_CERT_METHODDEF \ - {"_test_decode_cert", (PyCFunction)_ssl__test_decode_cert, METH_O, _ssl__test_decode_cert__doc__}, + {"_test_decode_cert", _ssl__test_decode_cert, METH_O, _ssl__test_decode_cert__doc__}, static PyObject * _ssl__test_decode_cert_impl(PyObject *module, PyObject *path); @@ -109,7 +109,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_get_verified_chain__doc__, "\n"); #define _SSL__SSLSOCKET_GET_VERIFIED_CHAIN_METHODDEF \ - {"get_verified_chain", (PyCFunction)_ssl__SSLSocket_get_verified_chain, METH_NOARGS, _ssl__SSLSocket_get_verified_chain__doc__}, + {"get_verified_chain", _ssl__SSLSocket_get_verified_chain, METH_NOARGS, _ssl__SSLSocket_get_verified_chain__doc__}, static PyObject * _ssl__SSLSocket_get_verified_chain_impl(PySSLSocket *self); @@ -132,7 +132,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_get_unverified_chain__doc__, "\n"); #define _SSL__SSLSOCKET_GET_UNVERIFIED_CHAIN_METHODDEF \ - {"get_unverified_chain", (PyCFunction)_ssl__SSLSocket_get_unverified_chain, METH_NOARGS, _ssl__SSLSocket_get_unverified_chain__doc__}, + {"get_unverified_chain", _ssl__SSLSocket_get_unverified_chain, METH_NOARGS, _ssl__SSLSocket_get_unverified_chain__doc__}, static PyObject * _ssl__SSLSocket_get_unverified_chain_impl(PySSLSocket *self); @@ -155,7 +155,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_shared_ciphers__doc__, "\n"); #define _SSL__SSLSOCKET_SHARED_CIPHERS_METHODDEF \ - {"shared_ciphers", (PyCFunction)_ssl__SSLSocket_shared_ciphers, METH_NOARGS, _ssl__SSLSocket_shared_ciphers__doc__}, + {"shared_ciphers", _ssl__SSLSocket_shared_ciphers, METH_NOARGS, _ssl__SSLSocket_shared_ciphers__doc__}, static PyObject * _ssl__SSLSocket_shared_ciphers_impl(PySSLSocket *self); @@ -178,7 +178,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_cipher__doc__, "\n"); #define _SSL__SSLSOCKET_CIPHER_METHODDEF \ - {"cipher", (PyCFunction)_ssl__SSLSocket_cipher, METH_NOARGS, _ssl__SSLSocket_cipher__doc__}, + {"cipher", _ssl__SSLSocket_cipher, METH_NOARGS, _ssl__SSLSocket_cipher__doc__}, static PyObject * _ssl__SSLSocket_cipher_impl(PySSLSocket *self); @@ -201,7 +201,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_version__doc__, "\n"); #define _SSL__SSLSOCKET_VERSION_METHODDEF \ - {"version", (PyCFunction)_ssl__SSLSocket_version, METH_NOARGS, _ssl__SSLSocket_version__doc__}, + {"version", _ssl__SSLSocket_version, METH_NOARGS, _ssl__SSLSocket_version__doc__}, static PyObject * _ssl__SSLSocket_version_impl(PySSLSocket *self); @@ -224,7 +224,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_selected_alpn_protocol__doc__, "\n"); #define _SSL__SSLSOCKET_SELECTED_ALPN_PROTOCOL_METHODDEF \ - {"selected_alpn_protocol", (PyCFunction)_ssl__SSLSocket_selected_alpn_protocol, METH_NOARGS, _ssl__SSLSocket_selected_alpn_protocol__doc__}, + {"selected_alpn_protocol", _ssl__SSLSocket_selected_alpn_protocol, METH_NOARGS, _ssl__SSLSocket_selected_alpn_protocol__doc__}, static PyObject * _ssl__SSLSocket_selected_alpn_protocol_impl(PySSLSocket *self); @@ -247,7 +247,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_compression__doc__, "\n"); #define _SSL__SSLSOCKET_COMPRESSION_METHODDEF \ - {"compression", (PyCFunction)_ssl__SSLSocket_compression, METH_NOARGS, _ssl__SSLSocket_compression__doc__}, + {"compression", _ssl__SSLSocket_compression, METH_NOARGS, _ssl__SSLSocket_compression__doc__}, static PyObject * _ssl__SSLSocket_compression_impl(PySSLSocket *self); @@ -451,7 +451,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_write__doc__, "Returns the number of bytes written."); #define _SSL__SSLSOCKET_WRITE_METHODDEF \ - {"write", (PyCFunction)_ssl__SSLSocket_write, METH_O, _ssl__SSLSocket_write__doc__}, + {"write", _ssl__SSLSocket_write, METH_O, _ssl__SSLSocket_write__doc__}, static PyObject * _ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b); @@ -485,7 +485,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_pending__doc__, "Returns the number of already decrypted bytes available for read, pending on the connection."); #define _SSL__SSLSOCKET_PENDING_METHODDEF \ - {"pending", (PyCFunction)_ssl__SSLSocket_pending, METH_NOARGS, _ssl__SSLSocket_pending__doc__}, + {"pending", _ssl__SSLSocket_pending, METH_NOARGS, _ssl__SSLSocket_pending__doc__}, static PyObject * _ssl__SSLSocket_pending_impl(PySSLSocket *self); @@ -507,7 +507,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_read__doc__, "Read up to size bytes from the SSL socket."); #define _SSL__SSLSOCKET_READ_METHODDEF \ - {"read", (PyCFunction)_ssl__SSLSocket_read, METH_VARARGS, _ssl__SSLSocket_read__doc__}, + {"read", _ssl__SSLSocket_read, METH_VARARGS, _ssl__SSLSocket_read__doc__}, static PyObject * _ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len, @@ -557,7 +557,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_shutdown__doc__, "Does the SSL shutdown handshake with the remote end."); #define _SSL__SSLSOCKET_SHUTDOWN_METHODDEF \ - {"shutdown", (PyCFunction)_ssl__SSLSocket_shutdown, METH_NOARGS, _ssl__SSLSocket_shutdown__doc__}, + {"shutdown", _ssl__SSLSocket_shutdown, METH_NOARGS, _ssl__SSLSocket_shutdown__doc__}, static PyObject * _ssl__SSLSocket_shutdown_impl(PySSLSocket *self); @@ -661,7 +661,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_verify_client_post_handshake__doc__, "Initiate TLS 1.3 post-handshake authentication"); #define _SSL__SSLSOCKET_VERIFY_CLIENT_POST_HANDSHAKE_METHODDEF \ - {"verify_client_post_handshake", (PyCFunction)_ssl__SSLSocket_verify_client_post_handshake, METH_NOARGS, _ssl__SSLSocket_verify_client_post_handshake__doc__}, + {"verify_client_post_handshake", _ssl__SSLSocket_verify_client_post_handshake, METH_NOARGS, _ssl__SSLSocket_verify_client_post_handshake__doc__}, static PyObject * _ssl__SSLSocket_verify_client_post_handshake_impl(PySSLSocket *self); @@ -802,7 +802,7 @@ PyDoc_STRVAR(_ssl__SSLContext_set_ciphers__doc__, "\n"); #define _SSL__SSLCONTEXT_SET_CIPHERS_METHODDEF \ - {"set_ciphers", (PyCFunction)_ssl__SSLContext_set_ciphers, METH_O, _ssl__SSLContext_set_ciphers__doc__}, + {"set_ciphers", _ssl__SSLContext_set_ciphers, METH_O, _ssl__SSLContext_set_ciphers__doc__}, static PyObject * _ssl__SSLContext_set_ciphers_impl(PySSLContext *self, const char *cipherlist); @@ -840,7 +840,7 @@ PyDoc_STRVAR(_ssl__SSLContext_get_ciphers__doc__, "\n"); #define _SSL__SSLCONTEXT_GET_CIPHERS_METHODDEF \ - {"get_ciphers", (PyCFunction)_ssl__SSLContext_get_ciphers, METH_NOARGS, _ssl__SSLContext_get_ciphers__doc__}, + {"get_ciphers", _ssl__SSLContext_get_ciphers, METH_NOARGS, _ssl__SSLContext_get_ciphers__doc__}, static PyObject * _ssl__SSLContext_get_ciphers_impl(PySSLContext *self); @@ -863,7 +863,7 @@ PyDoc_STRVAR(_ssl__SSLContext__set_alpn_protocols__doc__, "\n"); #define _SSL__SSLCONTEXT__SET_ALPN_PROTOCOLS_METHODDEF \ - {"_set_alpn_protocols", (PyCFunction)_ssl__SSLContext__set_alpn_protocols, METH_O, _ssl__SSLContext__set_alpn_protocols__doc__}, + {"_set_alpn_protocols", _ssl__SSLContext__set_alpn_protocols, METH_O, _ssl__SSLContext__set_alpn_protocols__doc__}, static PyObject * _ssl__SSLContext__set_alpn_protocols_impl(PySSLContext *self, @@ -1514,7 +1514,7 @@ PyDoc_STRVAR(_ssl__SSLContext_load_dh_params__doc__, "\n"); #define _SSL__SSLCONTEXT_LOAD_DH_PARAMS_METHODDEF \ - {"load_dh_params", (PyCFunction)_ssl__SSLContext_load_dh_params, METH_O, _ssl__SSLContext_load_dh_params__doc__}, + {"load_dh_params", _ssl__SSLContext_load_dh_params, METH_O, _ssl__SSLContext_load_dh_params__doc__}, static PyObject * _ssl__SSLContext_load_dh_params_impl(PySSLContext *self, PyObject *filepath); @@ -1732,7 +1732,7 @@ PyDoc_STRVAR(_ssl__SSLContext_session_stats__doc__, "\n"); #define _SSL__SSLCONTEXT_SESSION_STATS_METHODDEF \ - {"session_stats", (PyCFunction)_ssl__SSLContext_session_stats, METH_NOARGS, _ssl__SSLContext_session_stats__doc__}, + {"session_stats", _ssl__SSLContext_session_stats, METH_NOARGS, _ssl__SSLContext_session_stats__doc__}, static PyObject * _ssl__SSLContext_session_stats_impl(PySSLContext *self); @@ -1755,7 +1755,7 @@ PyDoc_STRVAR(_ssl__SSLContext_set_default_verify_paths__doc__, "\n"); #define _SSL__SSLCONTEXT_SET_DEFAULT_VERIFY_PATHS_METHODDEF \ - {"set_default_verify_paths", (PyCFunction)_ssl__SSLContext_set_default_verify_paths, METH_NOARGS, _ssl__SSLContext_set_default_verify_paths__doc__}, + {"set_default_verify_paths", _ssl__SSLContext_set_default_verify_paths, METH_NOARGS, _ssl__SSLContext_set_default_verify_paths__doc__}, static PyObject * _ssl__SSLContext_set_default_verify_paths_impl(PySSLContext *self); @@ -1778,7 +1778,7 @@ PyDoc_STRVAR(_ssl__SSLContext_set_ecdh_curve__doc__, "\n"); #define _SSL__SSLCONTEXT_SET_ECDH_CURVE_METHODDEF \ - {"set_ecdh_curve", (PyCFunction)_ssl__SSLContext_set_ecdh_curve, METH_O, _ssl__SSLContext_set_ecdh_curve__doc__}, + {"set_ecdh_curve", _ssl__SSLContext_set_ecdh_curve, METH_O, _ssl__SSLContext_set_ecdh_curve__doc__}, static PyObject * _ssl__SSLContext_set_ecdh_curve_impl(PySSLContext *self, PyObject *name); @@ -1870,7 +1870,7 @@ PyDoc_STRVAR(_ssl__SSLContext_cert_store_stats__doc__, "been used at least once."); #define _SSL__SSLCONTEXT_CERT_STORE_STATS_METHODDEF \ - {"cert_store_stats", (PyCFunction)_ssl__SSLContext_cert_store_stats, METH_NOARGS, _ssl__SSLContext_cert_store_stats__doc__}, + {"cert_store_stats", _ssl__SSLContext_cert_store_stats, METH_NOARGS, _ssl__SSLContext_cert_store_stats__doc__}, static PyObject * _ssl__SSLContext_cert_store_stats_impl(PySSLContext *self); @@ -2240,7 +2240,7 @@ PyDoc_STRVAR(_ssl_MemoryBIO_write__doc__, "Returns the number of bytes written."); #define _SSL_MEMORYBIO_WRITE_METHODDEF \ - {"write", (PyCFunction)_ssl_MemoryBIO_write, METH_O, _ssl_MemoryBIO_write__doc__}, + {"write", _ssl_MemoryBIO_write, METH_O, _ssl_MemoryBIO_write__doc__}, static PyObject * _ssl_MemoryBIO_write_impl(PySSLMemoryBIO *self, Py_buffer *b); @@ -2276,7 +2276,7 @@ PyDoc_STRVAR(_ssl_MemoryBIO_write_eof__doc__, "When all data has been read, the \"eof\" property will be True."); #define _SSL_MEMORYBIO_WRITE_EOF_METHODDEF \ - {"write_eof", (PyCFunction)_ssl_MemoryBIO_write_eof, METH_NOARGS, _ssl_MemoryBIO_write_eof__doc__}, + {"write_eof", _ssl_MemoryBIO_write_eof, METH_NOARGS, _ssl_MemoryBIO_write_eof__doc__}, static PyObject * _ssl_MemoryBIO_write_eof_impl(PySSLMemoryBIO *self); @@ -2523,7 +2523,7 @@ PyDoc_STRVAR(_ssl_RAND_bytes__doc__, "Generate n cryptographically strong pseudo-random bytes."); #define _SSL_RAND_BYTES_METHODDEF \ - {"RAND_bytes", (PyCFunction)_ssl_RAND_bytes, METH_O, _ssl_RAND_bytes__doc__}, + {"RAND_bytes", _ssl_RAND_bytes, METH_O, _ssl_RAND_bytes__doc__}, static PyObject * _ssl_RAND_bytes_impl(PyObject *module, int n); @@ -2556,7 +2556,7 @@ PyDoc_STRVAR(_ssl_RAND_status__doc__, "using the ssl() function."); #define _SSL_RAND_STATUS_METHODDEF \ - {"RAND_status", (PyCFunction)_ssl_RAND_status, METH_NOARGS, _ssl_RAND_status__doc__}, + {"RAND_status", _ssl_RAND_status, METH_NOARGS, _ssl_RAND_status__doc__}, static PyObject * _ssl_RAND_status_impl(PyObject *module); @@ -2582,7 +2582,7 @@ PyDoc_STRVAR(_ssl_get_default_verify_paths__doc__, "The values are \'cert_file_env\', \'cert_file\', \'cert_dir_env\', \'cert_dir\'."); #define _SSL_GET_DEFAULT_VERIFY_PATHS_METHODDEF \ - {"get_default_verify_paths", (PyCFunction)_ssl_get_default_verify_paths, METH_NOARGS, _ssl_get_default_verify_paths__doc__}, + {"get_default_verify_paths", _ssl_get_default_verify_paths, METH_NOARGS, _ssl_get_default_verify_paths__doc__}, static PyObject * _ssl_get_default_verify_paths_impl(PyObject *module); @@ -2689,7 +2689,7 @@ PyDoc_STRVAR(_ssl_nid2obj__doc__, "Lookup NID, short name, long name and OID of an ASN1_OBJECT by NID."); #define _SSL_NID2OBJ_METHODDEF \ - {"nid2obj", (PyCFunction)_ssl_nid2obj, METH_O, _ssl_nid2obj__doc__}, + {"nid2obj", _ssl_nid2obj, METH_O, _ssl_nid2obj__doc__}, static PyObject * _ssl_nid2obj_impl(PyObject *module, int nid); @@ -2878,4 +2878,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=c402c53dc30a14fa input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d0981b8b5ea94ae1 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h index 0e50395f70d827..2e35b5575d1784 100644 --- a/Modules/clinic/_struct.c.h +++ b/Modules/clinic/_struct.c.h @@ -81,7 +81,7 @@ PyDoc_STRVAR(Struct_unpack__doc__, "See help(struct) for more on format strings."); #define STRUCT_UNPACK_METHODDEF \ - {"unpack", (PyCFunction)Struct_unpack, METH_O, Struct_unpack__doc__}, + {"unpack", Struct_unpack, METH_O, Struct_unpack__doc__}, static PyObject * Struct_unpack_impl(PyStructObject *self, Py_buffer *buffer); @@ -207,7 +207,7 @@ PyDoc_STRVAR(Struct_iter_unpack__doc__, "Requires that the bytes length be a multiple of the struct size."); #define STRUCT_ITER_UNPACK_METHODDEF \ - {"iter_unpack", (PyCFunction)Struct_iter_unpack, METH_O, Struct_iter_unpack__doc__}, + {"iter_unpack", Struct_iter_unpack, METH_O, Struct_iter_unpack__doc__}, static PyObject * Struct_iter_unpack_impl(PyStructObject *self, PyObject *buffer); @@ -229,7 +229,7 @@ PyDoc_STRVAR(_clearcache__doc__, "Clear the internal cache."); #define _CLEARCACHE_METHODDEF \ - {"_clearcache", (PyCFunction)_clearcache, METH_NOARGS, _clearcache__doc__}, + {"_clearcache", _clearcache, METH_NOARGS, _clearcache__doc__}, static PyObject * _clearcache_impl(PyObject *module); @@ -247,7 +247,7 @@ PyDoc_STRVAR(calcsize__doc__, "Return size in bytes of the struct described by the format string."); #define CALCSIZE_METHODDEF \ - {"calcsize", (PyCFunction)calcsize, METH_O, calcsize__doc__}, + {"calcsize", calcsize, METH_O, calcsize__doc__}, static Py_ssize_t calcsize_impl(PyObject *module, PyStructObject *s_object); @@ -452,4 +452,4 @@ iter_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=c7c051850b7ad427 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e1d169d3c17deaae input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_sysconfig.c.h b/Modules/clinic/_sysconfig.c.h index eb3d396298bb21..5ceddd925ae30a 100644 --- a/Modules/clinic/_sysconfig.c.h +++ b/Modules/clinic/_sysconfig.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(_sysconfig_config_vars__doc__, "Returns a dictionary containing build variables intended to be exposed by sysconfig."); #define _SYSCONFIG_CONFIG_VARS_METHODDEF \ - {"config_vars", (PyCFunction)_sysconfig_config_vars, METH_NOARGS, _sysconfig_config_vars__doc__}, + {"config_vars", _sysconfig_config_vars, METH_NOARGS, _sysconfig_config_vars__doc__}, static PyObject * _sysconfig_config_vars_impl(PyObject *module); @@ -19,4 +19,4 @@ _sysconfig_config_vars(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _sysconfig_config_vars_impl(module); } -/*[clinic end generated code: output=25d395cf02eced1f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=63b2681222d333d9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testclinic.c.h b/Modules/clinic/_testclinic.c.h index 434488adbbb77c..96c3541cc0c248 100644 --- a/Modules/clinic/_testclinic.c.h +++ b/Modules/clinic/_testclinic.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(test_empty_function__doc__, "\n"); #define TEST_EMPTY_FUNCTION_METHODDEF \ - {"test_empty_function", (PyCFunction)test_empty_function, METH_NOARGS, test_empty_function__doc__}, + {"test_empty_function", test_empty_function, METH_NOARGS, test_empty_function__doc__}, static PyObject * test_empty_function_impl(PyObject *module); @@ -67,7 +67,7 @@ PyDoc_STRVAR(bytes_object_converter__doc__, "\n"); #define BYTES_OBJECT_CONVERTER_METHODDEF \ - {"bytes_object_converter", (PyCFunction)bytes_object_converter, METH_O, bytes_object_converter__doc__}, + {"bytes_object_converter", bytes_object_converter, METH_O, bytes_object_converter__doc__}, static PyObject * bytes_object_converter_impl(PyObject *module, PyBytesObject *a); @@ -95,7 +95,7 @@ PyDoc_STRVAR(byte_array_object_converter__doc__, "\n"); #define BYTE_ARRAY_OBJECT_CONVERTER_METHODDEF \ - {"byte_array_object_converter", (PyCFunction)byte_array_object_converter, METH_O, byte_array_object_converter__doc__}, + {"byte_array_object_converter", byte_array_object_converter, METH_O, byte_array_object_converter__doc__}, static PyObject * byte_array_object_converter_impl(PyObject *module, PyByteArrayObject *a); @@ -123,7 +123,7 @@ PyDoc_STRVAR(unicode_converter__doc__, "\n"); #define UNICODE_CONVERTER_METHODDEF \ - {"unicode_converter", (PyCFunction)unicode_converter, METH_O, unicode_converter__doc__}, + {"unicode_converter", unicode_converter, METH_O, unicode_converter__doc__}, static PyObject * unicode_converter_impl(PyObject *module, PyObject *a); @@ -1309,7 +1309,7 @@ PyDoc_STRVAR(py_complex_converter__doc__, "\n"); #define PY_COMPLEX_CONVERTER_METHODDEF \ - {"py_complex_converter", (PyCFunction)py_complex_converter, METH_O, py_complex_converter__doc__}, + {"py_complex_converter", py_complex_converter, METH_O, py_complex_converter__doc__}, static PyObject * py_complex_converter_impl(PyObject *module, Py_complex a); @@ -4005,48 +4005,53 @@ _testclinic_TestClass_defclass_posonly_varpos(PyObject *self, PyTypeObject *cls, return return_value; } +PyDoc_STRVAR(varpos_no_fastcall__doc__, +"class_method($type, /, *args)\n" +"--\n" +"\n"); + +#define VARPOS_NO_FASTCALL_METHODDEF \ + {"class_method", varpos_no_fastcall, METH_VARARGS|METH_CLASS, varpos_no_fastcall__doc__}, + static PyObject * varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args); static PyObject * -varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +varpos_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *__clinic_args = NULL; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } __clinic_args = Py_NewRef(args); - return_value = varpos_no_fastcall_impl(type, __clinic_args); + return_value = varpos_no_fastcall_impl((PyTypeObject *)type, __clinic_args); -exit: /* Cleanup for args */ Py_XDECREF(__clinic_args); return return_value; } +PyDoc_STRVAR(posonly_varpos_no_fastcall__doc__, +"class_method($type, a, b, /, *args)\n" +"--\n" +"\n"); + +#define POSONLY_VARPOS_NO_FASTCALL_METHODDEF \ + {"class_method", posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_no_fastcall__doc__}, + static PyObject * posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args); static PyObject * -posonly_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_varpos_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b; PyObject *__clinic_args = NULL; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } - if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4055,7 +4060,7 @@ posonly_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) if (!__clinic_args) { goto exit; } - return_value = posonly_varpos_no_fastcall_impl(type, a, b, __clinic_args); + return_value = posonly_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4064,24 +4069,27 @@ posonly_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) return return_value; } +PyDoc_STRVAR(posonly_req_opt_varpos_no_fastcall__doc__, +"class_method($type, a, b=False, /, *args)\n" +"--\n" +"\n"); + +#define POSONLY_REQ_OPT_VARPOS_NO_FASTCALL_METHODDEF \ + {"class_method", posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_no_fastcall__doc__}, + static PyObject * posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args); static PyObject * -posonly_req_opt_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b = Py_False; PyObject *__clinic_args = NULL; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } - if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4094,7 +4102,7 @@ posonly_req_opt_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject if (!__clinic_args) { goto exit; } - return_value = posonly_req_opt_varpos_no_fastcall_impl(type, a, b, __clinic_args); + return_value = posonly_req_opt_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4103,12 +4111,20 @@ posonly_req_opt_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject return return_value; } +PyDoc_STRVAR(posonly_poskw_varpos_no_fastcall__doc__, +"class_method($type, a, /, b, *args)\n" +"--\n" +"\n"); + +#define POSONLY_POSKW_VARPOS_NO_FASTCALL_METHODDEF \ + {"class_method", _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_no_fastcall__doc__}, + static PyObject * posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args); static PyObject * -posonly_poskw_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) @@ -4132,7 +4148,7 @@ posonly_poskw_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *k static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, - .fname = "TestClass", + .fname = "class_method", .kwtuple = KWTUPLE, }; #undef KWTUPLE @@ -4154,7 +4170,7 @@ posonly_poskw_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *k if (!__clinic_args) { goto exit; } - return_value = posonly_poskw_varpos_no_fastcall_impl(type, a, b, __clinic_args); + return_value = posonly_poskw_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4163,62 +4179,75 @@ posonly_poskw_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *k return return_value; } +PyDoc_STRVAR(varpos_array_no_fastcall__doc__, +"class_method($type, /, *args)\n" +"--\n" +"\n"); + +#define VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"class_method", varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, varpos_array_no_fastcall__doc__}, + static PyObject * varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, Py_ssize_t args_length); static PyObject * -varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +varpos_array_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject * const *__clinic_args; Py_ssize_t args_length; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } __clinic_args = _PyTuple_ITEMS(args); args_length = PyTuple_GET_SIZE(args); - return_value = varpos_array_no_fastcall_impl(type, __clinic_args, args_length); + return_value = varpos_array_no_fastcall_impl((PyTypeObject *)type, __clinic_args, args_length); -exit: return return_value; } +PyDoc_STRVAR(posonly_varpos_array_no_fastcall__doc__, +"class_method($type, a, b, /, *args)\n" +"--\n" +"\n"); + +#define POSONLY_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"class_method", posonly_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_array_no_fastcall__doc__}, + static PyObject * posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length); static PyObject * -posonly_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_varpos_array_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b; PyObject * const *__clinic_args; Py_ssize_t args_length; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } - if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); b = PyTuple_GET_ITEM(args, 1); __clinic_args = _PyTuple_ITEMS(args) + 2; args_length = PyTuple_GET_SIZE(args) - 2; - return_value = posonly_varpos_array_no_fastcall_impl(type, a, b, __clinic_args, args_length); + return_value = posonly_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); exit: return return_value; } +PyDoc_STRVAR(posonly_req_opt_varpos_array_no_fastcall__doc__, +"class_method($type, a, b=False, /, *args)\n" +"--\n" +"\n"); + +#define POSONLY_REQ_OPT_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"class_method", posonly_req_opt_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_array_no_fastcall__doc__}, + static PyObject * posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, @@ -4226,20 +4255,15 @@ posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, Py_ssize_t args_length); static PyObject * -posonly_req_opt_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b = Py_False; PyObject * const *__clinic_args; Py_ssize_t args_length; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } - if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4250,12 +4274,20 @@ posonly_req_opt_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyO skip_optional: __clinic_args = PyTuple_GET_SIZE(args) > 2 ? _PyTuple_ITEMS(args) + 2 : _PyTuple_ITEMS(args); args_length = Py_MAX(0, PyTuple_GET_SIZE(args) - 2); - return_value = posonly_req_opt_varpos_array_no_fastcall_impl(type, a, b, __clinic_args, args_length); + return_value = posonly_req_opt_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); exit: return return_value; } +PyDoc_STRVAR(posonly_poskw_varpos_array_no_fastcall__doc__, +"class_method($type, a, /, b, *args)\n" +"--\n" +"\n"); + +#define POSONLY_POSKW_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"class_method", _PyCFunction_CAST(posonly_poskw_varpos_array_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_array_no_fastcall__doc__}, + static PyObject * posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, @@ -4263,7 +4295,7 @@ posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, Py_ssize_t args_length); static PyObject * -posonly_poskw_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) @@ -4287,7 +4319,7 @@ posonly_poskw_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObj static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, - .fname = "TestClass", + .fname = "class_method", .kwtuple = KWTUPLE, }; #undef KWTUPLE @@ -4308,9 +4340,9 @@ posonly_poskw_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObj b = fastargs[1]; __clinic_args = PyTuple_GET_SIZE(args) > 2 ? _PyTuple_ITEMS(args) + 2 : _PyTuple_ITEMS(args); args_length = Py_MAX(0, PyTuple_GET_SIZE(args) - 2); - return_value = posonly_poskw_varpos_array_no_fastcall_impl(type, a, b, __clinic_args, args_length); + return_value = posonly_poskw_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); exit: return return_value; } -/*[clinic end generated code: output=00085e5637450fe6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=181834e956ff0fea input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testclinic_limited.c.h b/Modules/clinic/_testclinic_limited.c.h index 94897f4c6dc427..5cf0a8e8868eca 100644 --- a/Modules/clinic/_testclinic_limited.c.h +++ b/Modules/clinic/_testclinic_limited.c.h @@ -8,7 +8,7 @@ PyDoc_STRVAR(test_empty_function__doc__, "\n"); #define TEST_EMPTY_FUNCTION_METHODDEF \ - {"test_empty_function", (PyCFunction)test_empty_function, METH_NOARGS, test_empty_function__doc__}, + {"test_empty_function", test_empty_function, METH_NOARGS, test_empty_function__doc__}, static PyObject * test_empty_function_impl(PyObject *module); @@ -25,7 +25,7 @@ PyDoc_STRVAR(my_int_func__doc__, "\n"); #define MY_INT_FUNC_METHODDEF \ - {"my_int_func", (PyCFunction)my_int_func, METH_O, my_int_func__doc__}, + {"my_int_func", my_int_func, METH_O, my_int_func__doc__}, static int my_int_func_impl(PyObject *module, int arg); @@ -181,7 +181,7 @@ PyDoc_STRVAR(get_file_descriptor__doc__, "Get a file descriptor."); #define GET_FILE_DESCRIPTOR_METHODDEF \ - {"get_file_descriptor", (PyCFunction)get_file_descriptor, METH_O, get_file_descriptor__doc__}, + {"get_file_descriptor", get_file_descriptor, METH_O, get_file_descriptor__doc__}, static int get_file_descriptor_impl(PyObject *module, int fd); @@ -206,4 +206,4 @@ get_file_descriptor(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=03fd7811c056dc74 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bc954e4e8b99154d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testinternalcapi.c.h b/Modules/clinic/_testinternalcapi.c.h index d98d69df22f982..474d7aa09ca293 100644 --- a/Modules/clinic/_testinternalcapi.c.h +++ b/Modules/clinic/_testinternalcapi.c.h @@ -75,7 +75,7 @@ PyDoc_STRVAR(_testinternalcapi_new_instruction_sequence__doc__, "Return a new, empty InstructionSequence."); #define _TESTINTERNALCAPI_NEW_INSTRUCTION_SEQUENCE_METHODDEF \ - {"new_instruction_sequence", (PyCFunction)_testinternalcapi_new_instruction_sequence, METH_NOARGS, _testinternalcapi_new_instruction_sequence__doc__}, + {"new_instruction_sequence", _testinternalcapi_new_instruction_sequence, METH_NOARGS, _testinternalcapi_new_instruction_sequence__doc__}, static PyObject * _testinternalcapi_new_instruction_sequence_impl(PyObject *module); @@ -294,7 +294,7 @@ PyDoc_STRVAR(_testinternalcapi_test_long_numbits__doc__, "\n"); #define _TESTINTERNALCAPI_TEST_LONG_NUMBITS_METHODDEF \ - {"test_long_numbits", (PyCFunction)_testinternalcapi_test_long_numbits, METH_NOARGS, _testinternalcapi_test_long_numbits__doc__}, + {"test_long_numbits", _testinternalcapi_test_long_numbits, METH_NOARGS, _testinternalcapi_test_long_numbits__doc__}, static PyObject * _testinternalcapi_test_long_numbits_impl(PyObject *module); @@ -365,4 +365,4 @@ gh_119213_getargs(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO exit: return return_value; } -/*[clinic end generated code: output=ec77971c6c2663da input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bc3d1afd54a902ef input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_threadmodule.c.h b/Modules/clinic/_threadmodule.c.h index 09b7afebd6d8d9..78370c4a372796 100644 --- a/Modules/clinic/_threadmodule.c.h +++ b/Modules/clinic/_threadmodule.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(_thread__get_name__doc__, "Get the name of the current thread."); #define _THREAD__GET_NAME_METHODDEF \ - {"_get_name", (PyCFunction)_thread__get_name, METH_NOARGS, _thread__get_name__doc__}, + {"_get_name", _thread__get_name, METH_NOARGS, _thread__get_name__doc__}, static PyObject * _thread__get_name_impl(PyObject *module); @@ -101,4 +101,4 @@ _thread_set_name(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #ifndef _THREAD_SET_NAME_METHODDEF #define _THREAD_SET_NAME_METHODDEF #endif /* !defined(_THREAD_SET_NAME_METHODDEF) */ -/*[clinic end generated code: output=6e88ef6b126cece8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bb347b8a0b815db6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index 352c2b9e3d410c..1c08e2036379f8 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -10,7 +10,7 @@ PyDoc_STRVAR(_tkinter_tkapp_eval__doc__, "\n"); #define _TKINTER_TKAPP_EVAL_METHODDEF \ - {"eval", (PyCFunction)_tkinter_tkapp_eval, METH_O, _tkinter_tkapp_eval__doc__}, + {"eval", _tkinter_tkapp_eval, METH_O, _tkinter_tkapp_eval__doc__}, static PyObject * _tkinter_tkapp_eval_impl(TkappObject *self, const char *script); @@ -46,7 +46,7 @@ PyDoc_STRVAR(_tkinter_tkapp_evalfile__doc__, "\n"); #define _TKINTER_TKAPP_EVALFILE_METHODDEF \ - {"evalfile", (PyCFunction)_tkinter_tkapp_evalfile, METH_O, _tkinter_tkapp_evalfile__doc__}, + {"evalfile", _tkinter_tkapp_evalfile, METH_O, _tkinter_tkapp_evalfile__doc__}, static PyObject * _tkinter_tkapp_evalfile_impl(TkappObject *self, const char *fileName); @@ -82,7 +82,7 @@ PyDoc_STRVAR(_tkinter_tkapp_record__doc__, "\n"); #define _TKINTER_TKAPP_RECORD_METHODDEF \ - {"record", (PyCFunction)_tkinter_tkapp_record, METH_O, _tkinter_tkapp_record__doc__}, + {"record", _tkinter_tkapp_record, METH_O, _tkinter_tkapp_record__doc__}, static PyObject * _tkinter_tkapp_record_impl(TkappObject *self, const char *script); @@ -118,7 +118,7 @@ PyDoc_STRVAR(_tkinter_tkapp_adderrorinfo__doc__, "\n"); #define _TKINTER_TKAPP_ADDERRORINFO_METHODDEF \ - {"adderrorinfo", (PyCFunction)_tkinter_tkapp_adderrorinfo, METH_O, _tkinter_tkapp_adderrorinfo__doc__}, + {"adderrorinfo", _tkinter_tkapp_adderrorinfo, METH_O, _tkinter_tkapp_adderrorinfo__doc__}, static PyObject * _tkinter_tkapp_adderrorinfo_impl(TkappObject *self, const char *msg); @@ -154,7 +154,7 @@ PyDoc_STRVAR(_tkinter_tkapp_getint__doc__, "\n"); #define _TKINTER_TKAPP_GETINT_METHODDEF \ - {"getint", (PyCFunction)_tkinter_tkapp_getint, METH_O, _tkinter_tkapp_getint__doc__}, + {"getint", _tkinter_tkapp_getint, METH_O, _tkinter_tkapp_getint__doc__}, static PyObject * _tkinter_tkapp_getint_impl(TkappObject *self, PyObject *arg); @@ -175,7 +175,7 @@ PyDoc_STRVAR(_tkinter_tkapp_getdouble__doc__, "\n"); #define _TKINTER_TKAPP_GETDOUBLE_METHODDEF \ - {"getdouble", (PyCFunction)_tkinter_tkapp_getdouble, METH_O, _tkinter_tkapp_getdouble__doc__}, + {"getdouble", _tkinter_tkapp_getdouble, METH_O, _tkinter_tkapp_getdouble__doc__}, static PyObject * _tkinter_tkapp_getdouble_impl(TkappObject *self, PyObject *arg); @@ -196,7 +196,7 @@ PyDoc_STRVAR(_tkinter_tkapp_getboolean__doc__, "\n"); #define _TKINTER_TKAPP_GETBOOLEAN_METHODDEF \ - {"getboolean", (PyCFunction)_tkinter_tkapp_getboolean, METH_O, _tkinter_tkapp_getboolean__doc__}, + {"getboolean", _tkinter_tkapp_getboolean, METH_O, _tkinter_tkapp_getboolean__doc__}, static PyObject * _tkinter_tkapp_getboolean_impl(TkappObject *self, PyObject *arg); @@ -217,7 +217,7 @@ PyDoc_STRVAR(_tkinter_tkapp_exprstring__doc__, "\n"); #define _TKINTER_TKAPP_EXPRSTRING_METHODDEF \ - {"exprstring", (PyCFunction)_tkinter_tkapp_exprstring, METH_O, _tkinter_tkapp_exprstring__doc__}, + {"exprstring", _tkinter_tkapp_exprstring, METH_O, _tkinter_tkapp_exprstring__doc__}, static PyObject * _tkinter_tkapp_exprstring_impl(TkappObject *self, const char *s); @@ -253,7 +253,7 @@ PyDoc_STRVAR(_tkinter_tkapp_exprlong__doc__, "\n"); #define _TKINTER_TKAPP_EXPRLONG_METHODDEF \ - {"exprlong", (PyCFunction)_tkinter_tkapp_exprlong, METH_O, _tkinter_tkapp_exprlong__doc__}, + {"exprlong", _tkinter_tkapp_exprlong, METH_O, _tkinter_tkapp_exprlong__doc__}, static PyObject * _tkinter_tkapp_exprlong_impl(TkappObject *self, const char *s); @@ -289,7 +289,7 @@ PyDoc_STRVAR(_tkinter_tkapp_exprdouble__doc__, "\n"); #define _TKINTER_TKAPP_EXPRDOUBLE_METHODDEF \ - {"exprdouble", (PyCFunction)_tkinter_tkapp_exprdouble, METH_O, _tkinter_tkapp_exprdouble__doc__}, + {"exprdouble", _tkinter_tkapp_exprdouble, METH_O, _tkinter_tkapp_exprdouble__doc__}, static PyObject * _tkinter_tkapp_exprdouble_impl(TkappObject *self, const char *s); @@ -325,7 +325,7 @@ PyDoc_STRVAR(_tkinter_tkapp_exprboolean__doc__, "\n"); #define _TKINTER_TKAPP_EXPRBOOLEAN_METHODDEF \ - {"exprboolean", (PyCFunction)_tkinter_tkapp_exprboolean, METH_O, _tkinter_tkapp_exprboolean__doc__}, + {"exprboolean", _tkinter_tkapp_exprboolean, METH_O, _tkinter_tkapp_exprboolean__doc__}, static PyObject * _tkinter_tkapp_exprboolean_impl(TkappObject *self, const char *s); @@ -361,7 +361,7 @@ PyDoc_STRVAR(_tkinter_tkapp_splitlist__doc__, "\n"); #define _TKINTER_TKAPP_SPLITLIST_METHODDEF \ - {"splitlist", (PyCFunction)_tkinter_tkapp_splitlist, METH_O, _tkinter_tkapp_splitlist__doc__}, + {"splitlist", _tkinter_tkapp_splitlist, METH_O, _tkinter_tkapp_splitlist__doc__}, static PyObject * _tkinter_tkapp_splitlist_impl(TkappObject *self, PyObject *arg); @@ -424,7 +424,7 @@ PyDoc_STRVAR(_tkinter_tkapp_deletecommand__doc__, "\n"); #define _TKINTER_TKAPP_DELETECOMMAND_METHODDEF \ - {"deletecommand", (PyCFunction)_tkinter_tkapp_deletecommand, METH_O, _tkinter_tkapp_deletecommand__doc__}, + {"deletecommand", _tkinter_tkapp_deletecommand, METH_O, _tkinter_tkapp_deletecommand__doc__}, static PyObject * _tkinter_tkapp_deletecommand_impl(TkappObject *self, const char *name); @@ -501,7 +501,7 @@ PyDoc_STRVAR(_tkinter_tkapp_deletefilehandler__doc__, "\n"); #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF \ - {"deletefilehandler", (PyCFunction)_tkinter_tkapp_deletefilehandler, METH_O, _tkinter_tkapp_deletefilehandler__doc__}, + {"deletefilehandler", _tkinter_tkapp_deletefilehandler, METH_O, _tkinter_tkapp_deletefilehandler__doc__}, static PyObject * _tkinter_tkapp_deletefilehandler_impl(TkappObject *self, PyObject *file); @@ -524,7 +524,7 @@ PyDoc_STRVAR(_tkinter_tktimertoken_deletetimerhandler__doc__, "\n"); #define _TKINTER_TKTIMERTOKEN_DELETETIMERHANDLER_METHODDEF \ - {"deletetimerhandler", (PyCFunction)_tkinter_tktimertoken_deletetimerhandler, METH_NOARGS, _tkinter_tktimertoken_deletetimerhandler__doc__}, + {"deletetimerhandler", _tkinter_tktimertoken_deletetimerhandler, METH_NOARGS, _tkinter_tktimertoken_deletetimerhandler__doc__}, static PyObject * _tkinter_tktimertoken_deletetimerhandler_impl(TkttObject *self); @@ -642,7 +642,7 @@ PyDoc_STRVAR(_tkinter_tkapp_quit__doc__, "\n"); #define _TKINTER_TKAPP_QUIT_METHODDEF \ - {"quit", (PyCFunction)_tkinter_tkapp_quit, METH_NOARGS, _tkinter_tkapp_quit__doc__}, + {"quit", _tkinter_tkapp_quit, METH_NOARGS, _tkinter_tkapp_quit__doc__}, static PyObject * _tkinter_tkapp_quit_impl(TkappObject *self); @@ -659,7 +659,7 @@ PyDoc_STRVAR(_tkinter_tkapp_interpaddr__doc__, "\n"); #define _TKINTER_TKAPP_INTERPADDR_METHODDEF \ - {"interpaddr", (PyCFunction)_tkinter_tkapp_interpaddr, METH_NOARGS, _tkinter_tkapp_interpaddr__doc__}, + {"interpaddr", _tkinter_tkapp_interpaddr, METH_NOARGS, _tkinter_tkapp_interpaddr__doc__}, static PyObject * _tkinter_tkapp_interpaddr_impl(TkappObject *self); @@ -676,7 +676,7 @@ PyDoc_STRVAR(_tkinter_tkapp_loadtk__doc__, "\n"); #define _TKINTER_TKAPP_LOADTK_METHODDEF \ - {"loadtk", (PyCFunction)_tkinter_tkapp_loadtk, METH_NOARGS, _tkinter_tkapp_loadtk__doc__}, + {"loadtk", _tkinter_tkapp_loadtk, METH_NOARGS, _tkinter_tkapp_loadtk__doc__}, static PyObject * _tkinter_tkapp_loadtk_impl(TkappObject *self); @@ -694,7 +694,7 @@ PyDoc_STRVAR(_tkinter_tkapp_settrace__doc__, "Set the tracing function."); #define _TKINTER_TKAPP_SETTRACE_METHODDEF \ - {"settrace", (PyCFunction)_tkinter_tkapp_settrace, METH_O, _tkinter_tkapp_settrace__doc__}, + {"settrace", _tkinter_tkapp_settrace, METH_O, _tkinter_tkapp_settrace__doc__}, static PyObject * _tkinter_tkapp_settrace_impl(TkappObject *self, PyObject *func); @@ -716,7 +716,7 @@ PyDoc_STRVAR(_tkinter_tkapp_gettrace__doc__, "Get the tracing function."); #define _TKINTER_TKAPP_GETTRACE_METHODDEF \ - {"gettrace", (PyCFunction)_tkinter_tkapp_gettrace, METH_NOARGS, _tkinter_tkapp_gettrace__doc__}, + {"gettrace", _tkinter_tkapp_gettrace, METH_NOARGS, _tkinter_tkapp_gettrace__doc__}, static PyObject * _tkinter_tkapp_gettrace_impl(TkappObject *self); @@ -733,7 +733,7 @@ PyDoc_STRVAR(_tkinter_tkapp_willdispatch__doc__, "\n"); #define _TKINTER_TKAPP_WILLDISPATCH_METHODDEF \ - {"willdispatch", (PyCFunction)_tkinter_tkapp_willdispatch, METH_NOARGS, _tkinter_tkapp_willdispatch__doc__}, + {"willdispatch", _tkinter_tkapp_willdispatch, METH_NOARGS, _tkinter_tkapp_willdispatch__doc__}, static PyObject * _tkinter_tkapp_willdispatch_impl(TkappObject *self); @@ -750,7 +750,7 @@ PyDoc_STRVAR(_tkinter__flatten__doc__, "\n"); #define _TKINTER__FLATTEN_METHODDEF \ - {"_flatten", (PyCFunction)_tkinter__flatten, METH_O, _tkinter__flatten__doc__}, + {"_flatten", _tkinter__flatten, METH_O, _tkinter__flatten__doc__}, PyDoc_STRVAR(_tkinter_create__doc__, "create($module, screenName=None, baseName=\'\', className=\'Tk\',\n" @@ -910,7 +910,7 @@ PyDoc_STRVAR(_tkinter_setbusywaitinterval__doc__, "It should be set to a divisor of the maximum time between frames in an animation."); #define _TKINTER_SETBUSYWAITINTERVAL_METHODDEF \ - {"setbusywaitinterval", (PyCFunction)_tkinter_setbusywaitinterval, METH_O, _tkinter_setbusywaitinterval__doc__}, + {"setbusywaitinterval", _tkinter_setbusywaitinterval, METH_O, _tkinter_setbusywaitinterval__doc__}, static PyObject * _tkinter_setbusywaitinterval_impl(PyObject *module, int new_val); @@ -938,7 +938,7 @@ PyDoc_STRVAR(_tkinter_getbusywaitinterval__doc__, "Return the current busy-wait interval between successive calls to Tcl_DoOneEvent in a threaded Python interpreter."); #define _TKINTER_GETBUSYWAITINTERVAL_METHODDEF \ - {"getbusywaitinterval", (PyCFunction)_tkinter_getbusywaitinterval, METH_NOARGS, _tkinter_getbusywaitinterval__doc__}, + {"getbusywaitinterval", _tkinter_getbusywaitinterval, METH_NOARGS, _tkinter_getbusywaitinterval__doc__}, static int _tkinter_getbusywaitinterval_impl(PyObject *module); @@ -966,4 +966,4 @@ _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=052c067aa69237be input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9643e57d76763b5a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tracemalloc.c.h b/Modules/clinic/_tracemalloc.c.h index 1d100247423991..8dc2fe46d73ed3 100644 --- a/Modules/clinic/_tracemalloc.c.h +++ b/Modules/clinic/_tracemalloc.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(_tracemalloc_is_tracing__doc__, "Return True if the tracemalloc module is tracing Python memory allocations."); #define _TRACEMALLOC_IS_TRACING_METHODDEF \ - {"is_tracing", (PyCFunction)_tracemalloc_is_tracing, METH_NOARGS, _tracemalloc_is_tracing__doc__}, + {"is_tracing", _tracemalloc_is_tracing, METH_NOARGS, _tracemalloc_is_tracing__doc__}, static PyObject * _tracemalloc_is_tracing_impl(PyObject *module); @@ -29,7 +29,7 @@ PyDoc_STRVAR(_tracemalloc_clear_traces__doc__, "Clear traces of memory blocks allocated by Python."); #define _TRACEMALLOC_CLEAR_TRACES_METHODDEF \ - {"clear_traces", (PyCFunction)_tracemalloc_clear_traces, METH_NOARGS, _tracemalloc_clear_traces__doc__}, + {"clear_traces", _tracemalloc_clear_traces, METH_NOARGS, _tracemalloc_clear_traces__doc__}, static PyObject * _tracemalloc_clear_traces_impl(PyObject *module); @@ -52,7 +52,7 @@ PyDoc_STRVAR(_tracemalloc__get_traces__doc__, "Return an empty list if the tracemalloc module is disabled."); #define _TRACEMALLOC__GET_TRACES_METHODDEF \ - {"_get_traces", (PyCFunction)_tracemalloc__get_traces, METH_NOARGS, _tracemalloc__get_traces__doc__}, + {"_get_traces", _tracemalloc__get_traces, METH_NOARGS, _tracemalloc__get_traces__doc__}, static PyObject * _tracemalloc__get_traces_impl(PyObject *module); @@ -74,7 +74,7 @@ PyDoc_STRVAR(_tracemalloc__get_object_traceback__doc__, "trace the allocation of the object."); #define _TRACEMALLOC__GET_OBJECT_TRACEBACK_METHODDEF \ - {"_get_object_traceback", (PyCFunction)_tracemalloc__get_object_traceback, METH_O, _tracemalloc__get_object_traceback__doc__}, + {"_get_object_traceback", _tracemalloc__get_object_traceback, METH_O, _tracemalloc__get_object_traceback__doc__}, PyDoc_STRVAR(_tracemalloc_start__doc__, "start($module, nframe=1, /)\n" @@ -123,7 +123,7 @@ PyDoc_STRVAR(_tracemalloc_stop__doc__, "Also clear traces of memory blocks allocated by Python."); #define _TRACEMALLOC_STOP_METHODDEF \ - {"stop", (PyCFunction)_tracemalloc_stop, METH_NOARGS, _tracemalloc_stop__doc__}, + {"stop", _tracemalloc_stop, METH_NOARGS, _tracemalloc_stop__doc__}, static PyObject * _tracemalloc_stop_impl(PyObject *module); @@ -144,7 +144,7 @@ PyDoc_STRVAR(_tracemalloc_get_traceback_limit__doc__, "the most recent frame: the limit is 1."); #define _TRACEMALLOC_GET_TRACEBACK_LIMIT_METHODDEF \ - {"get_traceback_limit", (PyCFunction)_tracemalloc_get_traceback_limit, METH_NOARGS, _tracemalloc_get_traceback_limit__doc__}, + {"get_traceback_limit", _tracemalloc_get_traceback_limit, METH_NOARGS, _tracemalloc_get_traceback_limit__doc__}, static PyObject * _tracemalloc_get_traceback_limit_impl(PyObject *module); @@ -164,7 +164,7 @@ PyDoc_STRVAR(_tracemalloc_get_tracemalloc_memory__doc__, "This memory is used internally to trace memory allocations."); #define _TRACEMALLOC_GET_TRACEMALLOC_MEMORY_METHODDEF \ - {"get_tracemalloc_memory", (PyCFunction)_tracemalloc_get_tracemalloc_memory, METH_NOARGS, _tracemalloc_get_tracemalloc_memory__doc__}, + {"get_tracemalloc_memory", _tracemalloc_get_tracemalloc_memory, METH_NOARGS, _tracemalloc_get_tracemalloc_memory__doc__}, static PyObject * _tracemalloc_get_tracemalloc_memory_impl(PyObject *module); @@ -184,7 +184,7 @@ PyDoc_STRVAR(_tracemalloc_get_traced_memory__doc__, "Returns a tuple: (current: int, peak: int)."); #define _TRACEMALLOC_GET_TRACED_MEMORY_METHODDEF \ - {"get_traced_memory", (PyCFunction)_tracemalloc_get_traced_memory, METH_NOARGS, _tracemalloc_get_traced_memory__doc__}, + {"get_traced_memory", _tracemalloc_get_traced_memory, METH_NOARGS, _tracemalloc_get_traced_memory__doc__}, static PyObject * _tracemalloc_get_traced_memory_impl(PyObject *module); @@ -204,7 +204,7 @@ PyDoc_STRVAR(_tracemalloc_reset_peak__doc__, "Do nothing if the tracemalloc module is not tracing memory allocations."); #define _TRACEMALLOC_RESET_PEAK_METHODDEF \ - {"reset_peak", (PyCFunction)_tracemalloc_reset_peak, METH_NOARGS, _tracemalloc_reset_peak__doc__}, + {"reset_peak", _tracemalloc_reset_peak, METH_NOARGS, _tracemalloc_reset_peak__doc__}, static PyObject * _tracemalloc_reset_peak_impl(PyObject *module); @@ -214,4 +214,4 @@ _tracemalloc_reset_peak(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _tracemalloc_reset_peak_impl(module); } -/*[clinic end generated code: output=9d4d884b156c2ddb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=abdeb5c5c5274c70 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_typingmodule.c.h b/Modules/clinic/_typingmodule.c.h index ea415e67153ed8..ddae332e43867a 100644 --- a/Modules/clinic/_typingmodule.c.h +++ b/Modules/clinic/_typingmodule.c.h @@ -8,5 +8,5 @@ PyDoc_STRVAR(_typing__idfunc__doc__, "\n"); #define _TYPING__IDFUNC_METHODDEF \ - {"_idfunc", (PyCFunction)_typing__idfunc, METH_O, _typing__idfunc__doc__}, -/*[clinic end generated code: output=e7ea2a3cb7ab301a input=a9049054013a1b77]*/ + {"_idfunc", _typing__idfunc, METH_O, _typing__idfunc__doc__}, +/*[clinic end generated code: output=c740c67df8c70130 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_weakref.c.h b/Modules/clinic/_weakref.c.h index 8d7bc5dc936610..83b34fb004c092 100644 --- a/Modules/clinic/_weakref.c.h +++ b/Modules/clinic/_weakref.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(_weakref_getweakrefcount__doc__, "Return the number of weak references to \'object\'."); #define _WEAKREF_GETWEAKREFCOUNT_METHODDEF \ - {"getweakrefcount", (PyCFunction)_weakref_getweakrefcount, METH_O, _weakref_getweakrefcount__doc__}, + {"getweakrefcount", _weakref_getweakrefcount, METH_O, _weakref_getweakrefcount__doc__}, static Py_ssize_t _weakref_getweakrefcount_impl(PyObject *module, PyObject *object); @@ -74,7 +74,7 @@ PyDoc_STRVAR(_weakref_getweakrefs__doc__, "Return a list of all weak reference objects pointing to \'object\'."); #define _WEAKREF_GETWEAKREFS_METHODDEF \ - {"getweakrefs", (PyCFunction)_weakref_getweakrefs, METH_O, _weakref_getweakrefs__doc__}, + {"getweakrefs", _weakref_getweakrefs, METH_O, _weakref_getweakrefs__doc__}, PyDoc_STRVAR(_weakref_proxy__doc__, "proxy($module, object, callback=None, /)\n" @@ -112,4 +112,4 @@ _weakref_proxy(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=60f59adc1dc9eab8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=eae8e52dc631b4fd input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h index 6a2f8d45cd4e0c..d51370b55317c3 100644 --- a/Modules/clinic/_winapi.c.h +++ b/Modules/clinic/_winapi.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(_winapi_Overlapped_GetOverlappedResult__doc__, "\n"); #define _WINAPI_OVERLAPPED_GETOVERLAPPEDRESULT_METHODDEF \ - {"GetOverlappedResult", (PyCFunction)_winapi_Overlapped_GetOverlappedResult, METH_O, _winapi_Overlapped_GetOverlappedResult__doc__}, + {"GetOverlappedResult", _winapi_Overlapped_GetOverlappedResult, METH_O, _winapi_Overlapped_GetOverlappedResult__doc__}, static PyObject * _winapi_Overlapped_GetOverlappedResult_impl(OverlappedObject *self, int wait); @@ -42,7 +42,7 @@ PyDoc_STRVAR(_winapi_Overlapped_getbuffer__doc__, "\n"); #define _WINAPI_OVERLAPPED_GETBUFFER_METHODDEF \ - {"getbuffer", (PyCFunction)_winapi_Overlapped_getbuffer, METH_NOARGS, _winapi_Overlapped_getbuffer__doc__}, + {"getbuffer", _winapi_Overlapped_getbuffer, METH_NOARGS, _winapi_Overlapped_getbuffer__doc__}, static PyObject * _winapi_Overlapped_getbuffer_impl(OverlappedObject *self); @@ -59,7 +59,7 @@ PyDoc_STRVAR(_winapi_Overlapped_cancel__doc__, "\n"); #define _WINAPI_OVERLAPPED_CANCEL_METHODDEF \ - {"cancel", (PyCFunction)_winapi_Overlapped_cancel, METH_NOARGS, _winapi_Overlapped_cancel__doc__}, + {"cancel", _winapi_Overlapped_cancel, METH_NOARGS, _winapi_Overlapped_cancel__doc__}, static PyObject * _winapi_Overlapped_cancel_impl(OverlappedObject *self); @@ -77,7 +77,7 @@ PyDoc_STRVAR(_winapi_CloseHandle__doc__, "Close handle."); #define _WINAPI_CLOSEHANDLE_METHODDEF \ - {"CloseHandle", (PyCFunction)_winapi_CloseHandle, METH_O, _winapi_CloseHandle__doc__}, + {"CloseHandle", _winapi_CloseHandle, METH_O, _winapi_CloseHandle__doc__}, static PyObject * _winapi_CloseHandle_impl(PyObject *module, HANDLE handle); @@ -634,7 +634,7 @@ PyDoc_STRVAR(_winapi_ExitProcess__doc__, "\n"); #define _WINAPI_EXITPROCESS_METHODDEF \ - {"ExitProcess", (PyCFunction)_winapi_ExitProcess, METH_O, _winapi_ExitProcess__doc__}, + {"ExitProcess", _winapi_ExitProcess, METH_O, _winapi_ExitProcess__doc__}, static PyObject * _winapi_ExitProcess_impl(PyObject *module, UINT ExitCode); @@ -661,7 +661,7 @@ PyDoc_STRVAR(_winapi_GetCurrentProcess__doc__, "Return a handle object for the current process."); #define _WINAPI_GETCURRENTPROCESS_METHODDEF \ - {"GetCurrentProcess", (PyCFunction)_winapi_GetCurrentProcess, METH_NOARGS, _winapi_GetCurrentProcess__doc__}, + {"GetCurrentProcess", _winapi_GetCurrentProcess, METH_NOARGS, _winapi_GetCurrentProcess__doc__}, static HANDLE _winapi_GetCurrentProcess_impl(PyObject *module); @@ -692,7 +692,7 @@ PyDoc_STRVAR(_winapi_GetExitCodeProcess__doc__, "Return the termination status of the specified process."); #define _WINAPI_GETEXITCODEPROCESS_METHODDEF \ - {"GetExitCodeProcess", (PyCFunction)_winapi_GetExitCodeProcess, METH_O, _winapi_GetExitCodeProcess__doc__}, + {"GetExitCodeProcess", _winapi_GetExitCodeProcess, METH_O, _winapi_GetExitCodeProcess__doc__}, static DWORD _winapi_GetExitCodeProcess_impl(PyObject *module, HANDLE process); @@ -723,7 +723,7 @@ PyDoc_STRVAR(_winapi_GetLastError__doc__, "\n"); #define _WINAPI_GETLASTERROR_METHODDEF \ - {"GetLastError", (PyCFunction)_winapi_GetLastError, METH_NOARGS, _winapi_GetLastError__doc__}, + {"GetLastError", _winapi_GetLastError, METH_NOARGS, _winapi_GetLastError__doc__}, static DWORD _winapi_GetLastError_impl(PyObject *module); @@ -829,7 +829,7 @@ PyDoc_STRVAR(_winapi_GetModuleFileName__doc__, "of the current process."); #define _WINAPI_GETMODULEFILENAME_METHODDEF \ - {"GetModuleFileName", (PyCFunction)_winapi_GetModuleFileName, METH_O, _winapi_GetModuleFileName__doc__}, + {"GetModuleFileName", _winapi_GetModuleFileName, METH_O, _winapi_GetModuleFileName__doc__}, static PyObject * _winapi_GetModuleFileName_impl(PyObject *module, HMODULE module_handle); @@ -932,7 +932,7 @@ PyDoc_STRVAR(_winapi_GetStdHandle__doc__, "The integer associated with the handle object is returned."); #define _WINAPI_GETSTDHANDLE_METHODDEF \ - {"GetStdHandle", (PyCFunction)_winapi_GetStdHandle, METH_O, _winapi_GetStdHandle__doc__}, + {"GetStdHandle", _winapi_GetStdHandle, METH_O, _winapi_GetStdHandle__doc__}, static HANDLE _winapi_GetStdHandle_impl(PyObject *module, DWORD std_handle); @@ -967,7 +967,7 @@ PyDoc_STRVAR(_winapi_GetVersion__doc__, "Return the version number of the current operating system."); #define _WINAPI_GETVERSION_METHODDEF \ - {"GetVersion", (PyCFunction)_winapi_GetVersion, METH_NOARGS, _winapi_GetVersion__doc__}, + {"GetVersion", _winapi_GetVersion, METH_NOARGS, _winapi_GetVersion__doc__}, static long _winapi_GetVersion_impl(PyObject *module); @@ -1033,7 +1033,7 @@ PyDoc_STRVAR(_winapi_UnmapViewOfFile__doc__, "\n"); #define _WINAPI_UNMAPVIEWOFFILE_METHODDEF \ - {"UnmapViewOfFile", (PyCFunction)_winapi_UnmapViewOfFile, METH_O, _winapi_UnmapViewOfFile__doc__}, + {"UnmapViewOfFile", _winapi_UnmapViewOfFile, METH_O, _winapi_UnmapViewOfFile__doc__}, static PyObject * _winapi_UnmapViewOfFile_impl(PyObject *module, LPCVOID address); @@ -1631,7 +1631,7 @@ PyDoc_STRVAR(_winapi_VirtualQuerySize__doc__, "\n"); #define _WINAPI_VIRTUALQUERYSIZE_METHODDEF \ - {"VirtualQuerySize", (PyCFunction)_winapi_VirtualQuerySize, METH_O, _winapi_VirtualQuerySize__doc__}, + {"VirtualQuerySize", _winapi_VirtualQuerySize, METH_O, _winapi_VirtualQuerySize__doc__}, static size_t _winapi_VirtualQuerySize_impl(PyObject *module, LPCVOID address); @@ -1890,7 +1890,7 @@ PyDoc_STRVAR(_winapi_GetACP__doc__, "Get the current Windows ANSI code page identifier."); #define _WINAPI_GETACP_METHODDEF \ - {"GetACP", (PyCFunction)_winapi_GetACP, METH_NOARGS, _winapi_GetACP__doc__}, + {"GetACP", _winapi_GetACP, METH_NOARGS, _winapi_GetACP__doc__}, static PyObject * _winapi_GetACP_impl(PyObject *module); @@ -2024,7 +2024,7 @@ PyDoc_STRVAR(_winapi_NeedCurrentDirectoryForExePath__doc__, "\n"); #define _WINAPI_NEEDCURRENTDIRECTORYFOREXEPATH_METHODDEF \ - {"NeedCurrentDirectoryForExePath", (PyCFunction)_winapi_NeedCurrentDirectoryForExePath, METH_O, _winapi_NeedCurrentDirectoryForExePath__doc__}, + {"NeedCurrentDirectoryForExePath", _winapi_NeedCurrentDirectoryForExePath, METH_O, _winapi_NeedCurrentDirectoryForExePath__doc__}, static int _winapi_NeedCurrentDirectoryForExePath_impl(PyObject *module, @@ -2127,4 +2127,4 @@ _winapi_CopyFile2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO return return_value; } -/*[clinic end generated code: output=06b56212b2186250 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=10664fcb729a1aa8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index 97e5ca771f3a90..0647c6365ac4ca 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(array_array_clear__doc__, "Remove all items from the array."); #define ARRAY_ARRAY_CLEAR_METHODDEF \ - {"clear", (PyCFunction)array_array_clear, METH_NOARGS, array_array_clear__doc__}, + {"clear", array_array_clear, METH_NOARGS, array_array_clear__doc__}, static PyObject * array_array_clear_impl(arrayobject *self); @@ -33,7 +33,7 @@ PyDoc_STRVAR(array_array___copy____doc__, "Return a copy of the array."); #define ARRAY_ARRAY___COPY___METHODDEF \ - {"__copy__", (PyCFunction)array_array___copy__, METH_NOARGS, array_array___copy____doc__}, + {"__copy__", array_array___copy__, METH_NOARGS, array_array___copy____doc__}, static PyObject * array_array___copy___impl(arrayobject *self); @@ -51,7 +51,7 @@ PyDoc_STRVAR(array_array___deepcopy____doc__, "Return a copy of the array."); #define ARRAY_ARRAY___DEEPCOPY___METHODDEF \ - {"__deepcopy__", (PyCFunction)array_array___deepcopy__, METH_O, array_array___deepcopy____doc__}, + {"__deepcopy__", array_array___deepcopy__, METH_O, array_array___deepcopy____doc__}, static PyObject * array_array___deepcopy___impl(arrayobject *self, PyObject *unused); @@ -73,7 +73,7 @@ PyDoc_STRVAR(array_array_count__doc__, "Return number of occurrences of v in the array."); #define ARRAY_ARRAY_COUNT_METHODDEF \ - {"count", (PyCFunction)array_array_count, METH_O, array_array_count__doc__}, + {"count", array_array_count, METH_O, array_array_count__doc__}, static PyObject * array_array_count_impl(arrayobject *self, PyObject *v); @@ -141,7 +141,7 @@ PyDoc_STRVAR(array_array_remove__doc__, "Remove the first occurrence of v in the array."); #define ARRAY_ARRAY_REMOVE_METHODDEF \ - {"remove", (PyCFunction)array_array_remove, METH_O, array_array_remove__doc__}, + {"remove", array_array_remove, METH_O, array_array_remove__doc__}, static PyObject * array_array_remove_impl(arrayobject *self, PyObject *v); @@ -296,7 +296,7 @@ PyDoc_STRVAR(array_array_buffer_info__doc__, "the buffer length in bytes."); #define ARRAY_ARRAY_BUFFER_INFO_METHODDEF \ - {"buffer_info", (PyCFunction)array_array_buffer_info, METH_NOARGS, array_array_buffer_info__doc__}, + {"buffer_info", array_array_buffer_info, METH_NOARGS, array_array_buffer_info__doc__}, static PyObject * array_array_buffer_info_impl(arrayobject *self); @@ -314,7 +314,7 @@ PyDoc_STRVAR(array_array_append__doc__, "Append new value v to the end of the array."); #define ARRAY_ARRAY_APPEND_METHODDEF \ - {"append", (PyCFunction)array_array_append, METH_O, array_array_append__doc__}, + {"append", array_array_append, METH_O, array_array_append__doc__}, static PyObject * array_array_append_impl(arrayobject *self, PyObject *v); @@ -339,7 +339,7 @@ PyDoc_STRVAR(array_array_byteswap__doc__, "raised."); #define ARRAY_ARRAY_BYTESWAP_METHODDEF \ - {"byteswap", (PyCFunction)array_array_byteswap, METH_NOARGS, array_array_byteswap__doc__}, + {"byteswap", array_array_byteswap, METH_NOARGS, array_array_byteswap__doc__}, static PyObject * array_array_byteswap_impl(arrayobject *self); @@ -357,7 +357,7 @@ PyDoc_STRVAR(array_array_reverse__doc__, "Reverse the order of the items in the array."); #define ARRAY_ARRAY_REVERSE_METHODDEF \ - {"reverse", (PyCFunction)array_array_reverse, METH_NOARGS, array_array_reverse__doc__}, + {"reverse", array_array_reverse, METH_NOARGS, array_array_reverse__doc__}, static PyObject * array_array_reverse_impl(arrayobject *self); @@ -477,7 +477,7 @@ PyDoc_STRVAR(array_array_fromlist__doc__, "Append items to array from list."); #define ARRAY_ARRAY_FROMLIST_METHODDEF \ - {"fromlist", (PyCFunction)array_array_fromlist, METH_O, array_array_fromlist__doc__}, + {"fromlist", array_array_fromlist, METH_O, array_array_fromlist__doc__}, static PyObject * array_array_fromlist_impl(arrayobject *self, PyObject *list); @@ -499,7 +499,7 @@ PyDoc_STRVAR(array_array_tolist__doc__, "Convert array to an ordinary list with the same items."); #define ARRAY_ARRAY_TOLIST_METHODDEF \ - {"tolist", (PyCFunction)array_array_tolist, METH_NOARGS, array_array_tolist__doc__}, + {"tolist", array_array_tolist, METH_NOARGS, array_array_tolist__doc__}, static PyObject * array_array_tolist_impl(arrayobject *self); @@ -517,7 +517,7 @@ PyDoc_STRVAR(array_array_frombytes__doc__, "Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method."); #define ARRAY_ARRAY_FROMBYTES_METHODDEF \ - {"frombytes", (PyCFunction)array_array_frombytes, METH_O, array_array_frombytes__doc__}, + {"frombytes", array_array_frombytes, METH_O, array_array_frombytes__doc__}, static PyObject * array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer); @@ -549,7 +549,7 @@ PyDoc_STRVAR(array_array_tobytes__doc__, "Convert the array to an array of machine values and return the bytes representation."); #define ARRAY_ARRAY_TOBYTES_METHODDEF \ - {"tobytes", (PyCFunction)array_array_tobytes, METH_NOARGS, array_array_tobytes__doc__}, + {"tobytes", array_array_tobytes, METH_NOARGS, array_array_tobytes__doc__}, static PyObject * array_array_tobytes_impl(arrayobject *self); @@ -571,7 +571,7 @@ PyDoc_STRVAR(array_array_fromunicode__doc__, "some other type."); #define ARRAY_ARRAY_FROMUNICODE_METHODDEF \ - {"fromunicode", (PyCFunction)array_array_fromunicode, METH_O, array_array_fromunicode__doc__}, + {"fromunicode", array_array_fromunicode, METH_O, array_array_fromunicode__doc__}, static PyObject * array_array_fromunicode_impl(arrayobject *self, PyObject *ustr); @@ -604,7 +604,7 @@ PyDoc_STRVAR(array_array_tounicode__doc__, "unicode string from an array of some other type."); #define ARRAY_ARRAY_TOUNICODE_METHODDEF \ - {"tounicode", (PyCFunction)array_array_tounicode, METH_NOARGS, array_array_tounicode__doc__}, + {"tounicode", array_array_tounicode, METH_NOARGS, array_array_tounicode__doc__}, static PyObject * array_array_tounicode_impl(arrayobject *self); @@ -622,7 +622,7 @@ PyDoc_STRVAR(array_array___sizeof____doc__, "Size of the array in memory, in bytes."); #define ARRAY_ARRAY___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)array_array___sizeof__, METH_NOARGS, array_array___sizeof____doc__}, + {"__sizeof__", array_array___sizeof__, METH_NOARGS, array_array___sizeof____doc__}, static PyObject * array_array___sizeof___impl(arrayobject *self); @@ -759,7 +759,7 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, "Set state information for unpickling."); #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ - {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, + {"__setstate__", array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, static PyObject * array_arrayiterator___setstate___impl(arrayiterobject *self, PyObject *state); @@ -773,4 +773,4 @@ array_arrayiterator___setstate__(PyObject *self, PyObject *state) return return_value; } -/*[clinic end generated code: output=dd49451ac1cc3f39 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=88448cc228e01197 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h index f81f12c388f373..b655f4d8d116bc 100644 --- a/Modules/clinic/binascii.c.h +++ b/Modules/clinic/binascii.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(binascii_a2b_uu__doc__, "Decode a line of uuencoded data."); #define BINASCII_A2B_UU_METHODDEF \ - {"a2b_uu", (PyCFunction)binascii_a2b_uu, METH_O, binascii_a2b_uu__doc__}, + {"a2b_uu", binascii_a2b_uu, METH_O, binascii_a2b_uu__doc__}, static PyObject * binascii_a2b_uu_impl(PyObject *module, Py_buffer *data); @@ -548,7 +548,7 @@ PyDoc_STRVAR(binascii_a2b_hex__doc__, "This function is also available as \"unhexlify()\"."); #define BINASCII_A2B_HEX_METHODDEF \ - {"a2b_hex", (PyCFunction)binascii_a2b_hex, METH_O, binascii_a2b_hex__doc__}, + {"a2b_hex", binascii_a2b_hex, METH_O, binascii_a2b_hex__doc__}, static PyObject * binascii_a2b_hex_impl(PyObject *module, Py_buffer *hexstr); @@ -581,7 +581,7 @@ PyDoc_STRVAR(binascii_unhexlify__doc__, "hexstr must contain an even number of hex digits (upper or lower case)."); #define BINASCII_UNHEXLIFY_METHODDEF \ - {"unhexlify", (PyCFunction)binascii_unhexlify, METH_O, binascii_unhexlify__doc__}, + {"unhexlify", binascii_unhexlify, METH_O, binascii_unhexlify__doc__}, static PyObject * binascii_unhexlify_impl(PyObject *module, Py_buffer *hexstr); @@ -774,4 +774,4 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj return return_value; } -/*[clinic end generated code: output=9ed7fbeec13c6606 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6c6cb05b69d40658 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/blake2module.c.h b/Modules/clinic/blake2module.c.h index 9450334bd676ef..8abb6eb071e234 100644 --- a/Modules/clinic/blake2module.c.h +++ b/Modules/clinic/blake2module.c.h @@ -406,7 +406,7 @@ PyDoc_STRVAR(_blake2_blake2b_copy__doc__, "Return a copy of the hash object."); #define _BLAKE2_BLAKE2B_COPY_METHODDEF \ - {"copy", (PyCFunction)_blake2_blake2b_copy, METH_NOARGS, _blake2_blake2b_copy__doc__}, + {"copy", _blake2_blake2b_copy, METH_NOARGS, _blake2_blake2b_copy__doc__}, static PyObject * _blake2_blake2b_copy_impl(Blake2Object *self); @@ -424,7 +424,7 @@ PyDoc_STRVAR(_blake2_blake2b_update__doc__, "Update this hash object\'s state with the provided bytes-like object."); #define _BLAKE2_BLAKE2B_UPDATE_METHODDEF \ - {"update", (PyCFunction)_blake2_blake2b_update, METH_O, _blake2_blake2b_update__doc__}, + {"update", _blake2_blake2b_update, METH_O, _blake2_blake2b_update__doc__}, static PyObject * _blake2_blake2b_update_impl(Blake2Object *self, PyObject *data); @@ -446,7 +446,7 @@ PyDoc_STRVAR(_blake2_blake2b_digest__doc__, "Return the digest value as a bytes object."); #define _BLAKE2_BLAKE2B_DIGEST_METHODDEF \ - {"digest", (PyCFunction)_blake2_blake2b_digest, METH_NOARGS, _blake2_blake2b_digest__doc__}, + {"digest", _blake2_blake2b_digest, METH_NOARGS, _blake2_blake2b_digest__doc__}, static PyObject * _blake2_blake2b_digest_impl(Blake2Object *self); @@ -464,7 +464,7 @@ PyDoc_STRVAR(_blake2_blake2b_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define _BLAKE2_BLAKE2B_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)_blake2_blake2b_hexdigest, METH_NOARGS, _blake2_blake2b_hexdigest__doc__}, + {"hexdigest", _blake2_blake2b_hexdigest, METH_NOARGS, _blake2_blake2b_hexdigest__doc__}, static PyObject * _blake2_blake2b_hexdigest_impl(Blake2Object *self); @@ -474,4 +474,4 @@ _blake2_blake2b_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2b_hexdigest_impl((Blake2Object *)self); } -/*[clinic end generated code: output=b286a0d1be8729b0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ee76e3b8d44532e4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/cmathmodule.c.h b/Modules/clinic/cmathmodule.c.h index 16eaba7aa7ee39..9ef8f42cdb45fc 100644 --- a/Modules/clinic/cmathmodule.c.h +++ b/Modules/clinic/cmathmodule.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(cmath_acos__doc__, "Return the arc cosine of z."); #define CMATH_ACOS_METHODDEF \ - {"acos", (PyCFunction)cmath_acos, METH_O, cmath_acos__doc__}, + {"acos", cmath_acos, METH_O, cmath_acos__doc__}, static Py_complex cmath_acos_impl(PyObject *module, Py_complex z); @@ -57,7 +57,7 @@ PyDoc_STRVAR(cmath_acosh__doc__, "Return the inverse hyperbolic cosine of z."); #define CMATH_ACOSH_METHODDEF \ - {"acosh", (PyCFunction)cmath_acosh, METH_O, cmath_acosh__doc__}, + {"acosh", cmath_acosh, METH_O, cmath_acosh__doc__}, static Py_complex cmath_acosh_impl(PyObject *module, Py_complex z); @@ -99,7 +99,7 @@ PyDoc_STRVAR(cmath_asin__doc__, "Return the arc sine of z."); #define CMATH_ASIN_METHODDEF \ - {"asin", (PyCFunction)cmath_asin, METH_O, cmath_asin__doc__}, + {"asin", cmath_asin, METH_O, cmath_asin__doc__}, static Py_complex cmath_asin_impl(PyObject *module, Py_complex z); @@ -141,7 +141,7 @@ PyDoc_STRVAR(cmath_asinh__doc__, "Return the inverse hyperbolic sine of z."); #define CMATH_ASINH_METHODDEF \ - {"asinh", (PyCFunction)cmath_asinh, METH_O, cmath_asinh__doc__}, + {"asinh", cmath_asinh, METH_O, cmath_asinh__doc__}, static Py_complex cmath_asinh_impl(PyObject *module, Py_complex z); @@ -183,7 +183,7 @@ PyDoc_STRVAR(cmath_atan__doc__, "Return the arc tangent of z."); #define CMATH_ATAN_METHODDEF \ - {"atan", (PyCFunction)cmath_atan, METH_O, cmath_atan__doc__}, + {"atan", cmath_atan, METH_O, cmath_atan__doc__}, static Py_complex cmath_atan_impl(PyObject *module, Py_complex z); @@ -225,7 +225,7 @@ PyDoc_STRVAR(cmath_atanh__doc__, "Return the inverse hyperbolic tangent of z."); #define CMATH_ATANH_METHODDEF \ - {"atanh", (PyCFunction)cmath_atanh, METH_O, cmath_atanh__doc__}, + {"atanh", cmath_atanh, METH_O, cmath_atanh__doc__}, static Py_complex cmath_atanh_impl(PyObject *module, Py_complex z); @@ -267,7 +267,7 @@ PyDoc_STRVAR(cmath_cos__doc__, "Return the cosine of z."); #define CMATH_COS_METHODDEF \ - {"cos", (PyCFunction)cmath_cos, METH_O, cmath_cos__doc__}, + {"cos", cmath_cos, METH_O, cmath_cos__doc__}, static Py_complex cmath_cos_impl(PyObject *module, Py_complex z); @@ -309,7 +309,7 @@ PyDoc_STRVAR(cmath_cosh__doc__, "Return the hyperbolic cosine of z."); #define CMATH_COSH_METHODDEF \ - {"cosh", (PyCFunction)cmath_cosh, METH_O, cmath_cosh__doc__}, + {"cosh", cmath_cosh, METH_O, cmath_cosh__doc__}, static Py_complex cmath_cosh_impl(PyObject *module, Py_complex z); @@ -351,7 +351,7 @@ PyDoc_STRVAR(cmath_exp__doc__, "Return the exponential value e**z."); #define CMATH_EXP_METHODDEF \ - {"exp", (PyCFunction)cmath_exp, METH_O, cmath_exp__doc__}, + {"exp", cmath_exp, METH_O, cmath_exp__doc__}, static Py_complex cmath_exp_impl(PyObject *module, Py_complex z); @@ -393,7 +393,7 @@ PyDoc_STRVAR(cmath_log10__doc__, "Return the base-10 logarithm of z."); #define CMATH_LOG10_METHODDEF \ - {"log10", (PyCFunction)cmath_log10, METH_O, cmath_log10__doc__}, + {"log10", cmath_log10, METH_O, cmath_log10__doc__}, static Py_complex cmath_log10_impl(PyObject *module, Py_complex z); @@ -435,7 +435,7 @@ PyDoc_STRVAR(cmath_sin__doc__, "Return the sine of z."); #define CMATH_SIN_METHODDEF \ - {"sin", (PyCFunction)cmath_sin, METH_O, cmath_sin__doc__}, + {"sin", cmath_sin, METH_O, cmath_sin__doc__}, static Py_complex cmath_sin_impl(PyObject *module, Py_complex z); @@ -477,7 +477,7 @@ PyDoc_STRVAR(cmath_sinh__doc__, "Return the hyperbolic sine of z."); #define CMATH_SINH_METHODDEF \ - {"sinh", (PyCFunction)cmath_sinh, METH_O, cmath_sinh__doc__}, + {"sinh", cmath_sinh, METH_O, cmath_sinh__doc__}, static Py_complex cmath_sinh_impl(PyObject *module, Py_complex z); @@ -519,7 +519,7 @@ PyDoc_STRVAR(cmath_sqrt__doc__, "Return the square root of z."); #define CMATH_SQRT_METHODDEF \ - {"sqrt", (PyCFunction)cmath_sqrt, METH_O, cmath_sqrt__doc__}, + {"sqrt", cmath_sqrt, METH_O, cmath_sqrt__doc__}, static Py_complex cmath_sqrt_impl(PyObject *module, Py_complex z); @@ -561,7 +561,7 @@ PyDoc_STRVAR(cmath_tan__doc__, "Return the tangent of z."); #define CMATH_TAN_METHODDEF \ - {"tan", (PyCFunction)cmath_tan, METH_O, cmath_tan__doc__}, + {"tan", cmath_tan, METH_O, cmath_tan__doc__}, static Py_complex cmath_tan_impl(PyObject *module, Py_complex z); @@ -603,7 +603,7 @@ PyDoc_STRVAR(cmath_tanh__doc__, "Return the hyperbolic tangent of z."); #define CMATH_TANH_METHODDEF \ - {"tanh", (PyCFunction)cmath_tanh, METH_O, cmath_tanh__doc__}, + {"tanh", cmath_tanh, METH_O, cmath_tanh__doc__}, static Py_complex cmath_tanh_impl(PyObject *module, Py_complex z); @@ -684,7 +684,7 @@ PyDoc_STRVAR(cmath_phase__doc__, "Return argument, also known as the phase angle, of a complex."); #define CMATH_PHASE_METHODDEF \ - {"phase", (PyCFunction)cmath_phase, METH_O, cmath_phase__doc__}, + {"phase", cmath_phase, METH_O, cmath_phase__doc__}, static PyObject * cmath_phase_impl(PyObject *module, Py_complex z); @@ -714,7 +714,7 @@ PyDoc_STRVAR(cmath_polar__doc__, "r is the distance from 0 and phi the phase angle."); #define CMATH_POLAR_METHODDEF \ - {"polar", (PyCFunction)cmath_polar, METH_O, cmath_polar__doc__}, + {"polar", cmath_polar, METH_O, cmath_polar__doc__}, static PyObject * cmath_polar_impl(PyObject *module, Py_complex z); @@ -790,7 +790,7 @@ PyDoc_STRVAR(cmath_isfinite__doc__, "Return True if both the real and imaginary parts of z are finite, else False."); #define CMATH_ISFINITE_METHODDEF \ - {"isfinite", (PyCFunction)cmath_isfinite, METH_O, cmath_isfinite__doc__}, + {"isfinite", cmath_isfinite, METH_O, cmath_isfinite__doc__}, static PyObject * cmath_isfinite_impl(PyObject *module, Py_complex z); @@ -818,7 +818,7 @@ PyDoc_STRVAR(cmath_isnan__doc__, "Checks if the real or imaginary part of z not a number (NaN)."); #define CMATH_ISNAN_METHODDEF \ - {"isnan", (PyCFunction)cmath_isnan, METH_O, cmath_isnan__doc__}, + {"isnan", cmath_isnan, METH_O, cmath_isnan__doc__}, static PyObject * cmath_isnan_impl(PyObject *module, Py_complex z); @@ -846,7 +846,7 @@ PyDoc_STRVAR(cmath_isinf__doc__, "Checks if the real or imaginary part of z is infinite."); #define CMATH_ISINF_METHODDEF \ - {"isinf", (PyCFunction)cmath_isinf, METH_O, cmath_isinf__doc__}, + {"isinf", cmath_isinf, METH_O, cmath_isinf__doc__}, static PyObject * cmath_isinf_impl(PyObject *module, Py_complex z); @@ -983,4 +983,4 @@ cmath_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=5fda69f15dc9dfc9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=90e4f6fb7954daa5 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/gcmodule.c.h b/Modules/clinic/gcmodule.c.h index 0147020bd483f9..6698a71c395635 100644 --- a/Modules/clinic/gcmodule.c.h +++ b/Modules/clinic/gcmodule.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(gc_enable__doc__, "Enable automatic garbage collection."); #define GC_ENABLE_METHODDEF \ - {"enable", (PyCFunction)gc_enable, METH_NOARGS, gc_enable__doc__}, + {"enable", gc_enable, METH_NOARGS, gc_enable__doc__}, static PyObject * gc_enable_impl(PyObject *module); @@ -35,7 +35,7 @@ PyDoc_STRVAR(gc_disable__doc__, "Disable automatic garbage collection."); #define GC_DISABLE_METHODDEF \ - {"disable", (PyCFunction)gc_disable, METH_NOARGS, gc_disable__doc__}, + {"disable", gc_disable, METH_NOARGS, gc_disable__doc__}, static PyObject * gc_disable_impl(PyObject *module); @@ -53,7 +53,7 @@ PyDoc_STRVAR(gc_isenabled__doc__, "Returns true if automatic garbage collection is enabled."); #define GC_ISENABLED_METHODDEF \ - {"isenabled", (PyCFunction)gc_isenabled, METH_NOARGS, gc_isenabled__doc__}, + {"isenabled", gc_isenabled, METH_NOARGS, gc_isenabled__doc__}, static int gc_isenabled_impl(PyObject *module); @@ -167,7 +167,7 @@ PyDoc_STRVAR(gc_set_debug__doc__, "Debugging information is written to sys.stderr."); #define GC_SET_DEBUG_METHODDEF \ - {"set_debug", (PyCFunction)gc_set_debug, METH_O, gc_set_debug__doc__}, + {"set_debug", gc_set_debug, METH_O, gc_set_debug__doc__}, static PyObject * gc_set_debug_impl(PyObject *module, int flags); @@ -195,7 +195,7 @@ PyDoc_STRVAR(gc_get_debug__doc__, "Get the garbage collection debugging flags."); #define GC_GET_DEBUG_METHODDEF \ - {"get_debug", (PyCFunction)gc_get_debug, METH_NOARGS, gc_get_debug__doc__}, + {"get_debug", gc_get_debug, METH_NOARGS, gc_get_debug__doc__}, static int gc_get_debug_impl(PyObject *module); @@ -223,7 +223,7 @@ PyDoc_STRVAR(gc_set_threshold__doc__, "Setting \'threshold0\' to zero disables collection."); #define GC_SET_THRESHOLD_METHODDEF \ - {"set_threshold", (PyCFunction)gc_set_threshold, METH_VARARGS, gc_set_threshold__doc__}, + {"set_threshold", gc_set_threshold, METH_VARARGS, gc_set_threshold__doc__}, static PyObject * gc_set_threshold_impl(PyObject *module, int threshold0, int group_right_1, @@ -275,7 +275,7 @@ PyDoc_STRVAR(gc_get_threshold__doc__, "Return the current collection thresholds."); #define GC_GET_THRESHOLD_METHODDEF \ - {"get_threshold", (PyCFunction)gc_get_threshold, METH_NOARGS, gc_get_threshold__doc__}, + {"get_threshold", gc_get_threshold, METH_NOARGS, gc_get_threshold__doc__}, static PyObject * gc_get_threshold_impl(PyObject *module); @@ -293,7 +293,7 @@ PyDoc_STRVAR(gc_get_count__doc__, "Return a three-tuple of the current collection counts."); #define GC_GET_COUNT_METHODDEF \ - {"get_count", (PyCFunction)gc_get_count, METH_NOARGS, gc_get_count__doc__}, + {"get_count", gc_get_count, METH_NOARGS, gc_get_count__doc__}, static PyObject * gc_get_count_impl(PyObject *module); @@ -442,7 +442,7 @@ PyDoc_STRVAR(gc_get_stats__doc__, "Return a list of dictionaries containing per-generation statistics."); #define GC_GET_STATS_METHODDEF \ - {"get_stats", (PyCFunction)gc_get_stats, METH_NOARGS, gc_get_stats__doc__}, + {"get_stats", gc_get_stats, METH_NOARGS, gc_get_stats__doc__}, static PyObject * gc_get_stats_impl(PyObject *module); @@ -462,7 +462,7 @@ PyDoc_STRVAR(gc_is_tracked__doc__, "Simple atomic objects will return false."); #define GC_IS_TRACKED_METHODDEF \ - {"is_tracked", (PyCFunction)gc_is_tracked, METH_O, gc_is_tracked__doc__}, + {"is_tracked", gc_is_tracked, METH_O, gc_is_tracked__doc__}, static int gc_is_tracked_impl(PyObject *module, PyObject *obj); @@ -490,7 +490,7 @@ PyDoc_STRVAR(gc_is_finalized__doc__, "Returns true if the object has been already finalized by the GC."); #define GC_IS_FINALIZED_METHODDEF \ - {"is_finalized", (PyCFunction)gc_is_finalized, METH_O, gc_is_finalized__doc__}, + {"is_finalized", gc_is_finalized, METH_O, gc_is_finalized__doc__}, static int gc_is_finalized_impl(PyObject *module, PyObject *obj); @@ -522,7 +522,7 @@ PyDoc_STRVAR(gc_freeze__doc__, "which can cause copy-on-write."); #define GC_FREEZE_METHODDEF \ - {"freeze", (PyCFunction)gc_freeze, METH_NOARGS, gc_freeze__doc__}, + {"freeze", gc_freeze, METH_NOARGS, gc_freeze__doc__}, static PyObject * gc_freeze_impl(PyObject *module); @@ -542,7 +542,7 @@ PyDoc_STRVAR(gc_unfreeze__doc__, "Put all objects in the permanent generation back into oldest generation."); #define GC_UNFREEZE_METHODDEF \ - {"unfreeze", (PyCFunction)gc_unfreeze, METH_NOARGS, gc_unfreeze__doc__}, + {"unfreeze", gc_unfreeze, METH_NOARGS, gc_unfreeze__doc__}, static PyObject * gc_unfreeze_impl(PyObject *module); @@ -560,7 +560,7 @@ PyDoc_STRVAR(gc_get_freeze_count__doc__, "Return the number of objects in the permanent generation."); #define GC_GET_FREEZE_COUNT_METHODDEF \ - {"get_freeze_count", (PyCFunction)gc_get_freeze_count, METH_NOARGS, gc_get_freeze_count__doc__}, + {"get_freeze_count", gc_get_freeze_count, METH_NOARGS, gc_get_freeze_count__doc__}, static Py_ssize_t gc_get_freeze_count_impl(PyObject *module); @@ -580,4 +580,4 @@ gc_get_freeze_count(PyObject *module, PyObject *Py_UNUSED(ignored)) exit: return return_value; } -/*[clinic end generated code: output=3e33248997e06c34 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=77b7d847ba2d4ed6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/grpmodule.c.h b/Modules/clinic/grpmodule.c.h index facfa3a43e490e..265d2de8fc422e 100644 --- a/Modules/clinic/grpmodule.c.h +++ b/Modules/clinic/grpmodule.c.h @@ -138,7 +138,7 @@ PyDoc_STRVAR(grp_getgrall__doc__, "to use YP/NIS and may not be accessible via getgrnam or getgrgid."); #define GRP_GETGRALL_METHODDEF \ - {"getgrall", (PyCFunction)grp_getgrall, METH_NOARGS, grp_getgrall__doc__}, + {"getgrall", grp_getgrall, METH_NOARGS, grp_getgrall__doc__}, static PyObject * grp_getgrall_impl(PyObject *module); @@ -148,4 +148,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored)) { return grp_getgrall_impl(module); } -/*[clinic end generated code: output=2154194308dab038 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=515460967fce87ed input=a9049054013a1b77]*/ diff --git a/Modules/clinic/itertoolsmodule.c.h b/Modules/clinic/itertoolsmodule.c.h index 401c87e846f501..a4df7bd2664651 100644 --- a/Modules/clinic/itertoolsmodule.c.h +++ b/Modules/clinic/itertoolsmodule.c.h @@ -484,7 +484,7 @@ PyDoc_STRVAR(itertools_chain_from_iterable__doc__, "Alternative chain() constructor taking a single iterable argument that evaluates lazily."); #define ITERTOOLS_CHAIN_FROM_ITERABLE_METHODDEF \ - {"from_iterable", (PyCFunction)itertools_chain_from_iterable, METH_O|METH_CLASS, itertools_chain_from_iterable__doc__}, + {"from_iterable", itertools_chain_from_iterable, METH_O|METH_CLASS, itertools_chain_from_iterable__doc__}, static PyObject * itertools_chain_from_iterable_impl(PyTypeObject *type, PyObject *arg); @@ -949,4 +949,4 @@ itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=688855b1dc77bf5a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=95dd74389890ba45 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h index a76dde1eb4350e..5328f8cd61c1d0 100644 --- a/Modules/clinic/mathmodule.c.h +++ b/Modules/clinic/mathmodule.c.h @@ -71,7 +71,7 @@ PyDoc_STRVAR(math_ceil__doc__, "This is the smallest integer >= x."); #define MATH_CEIL_METHODDEF \ - {"ceil", (PyCFunction)math_ceil, METH_O, math_ceil__doc__}, + {"ceil", math_ceil, METH_O, math_ceil__doc__}, PyDoc_STRVAR(math_floor__doc__, "floor($module, x, /)\n" @@ -82,7 +82,7 @@ PyDoc_STRVAR(math_floor__doc__, "This is the largest integer <= x."); #define MATH_FLOOR_METHODDEF \ - {"floor", (PyCFunction)math_floor, METH_O, math_floor__doc__}, + {"floor", math_floor, METH_O, math_floor__doc__}, PyDoc_STRVAR(math_fsum__doc__, "fsum($module, seq, /)\n" @@ -93,7 +93,7 @@ PyDoc_STRVAR(math_fsum__doc__, "Assumes IEEE-754 floating-point arithmetic."); #define MATH_FSUM_METHODDEF \ - {"fsum", (PyCFunction)math_fsum, METH_O, math_fsum__doc__}, + {"fsum", math_fsum, METH_O, math_fsum__doc__}, PyDoc_STRVAR(math_isqrt__doc__, "isqrt($module, n, /)\n" @@ -102,7 +102,7 @@ PyDoc_STRVAR(math_isqrt__doc__, "Return the integer part of the square root of the input."); #define MATH_ISQRT_METHODDEF \ - {"isqrt", (PyCFunction)math_isqrt, METH_O, math_isqrt__doc__}, + {"isqrt", math_isqrt, METH_O, math_isqrt__doc__}, PyDoc_STRVAR(math_factorial__doc__, "factorial($module, n, /)\n" @@ -113,7 +113,7 @@ PyDoc_STRVAR(math_factorial__doc__, "Raise a ValueError if x is negative or non-integral."); #define MATH_FACTORIAL_METHODDEF \ - {"factorial", (PyCFunction)math_factorial, METH_O, math_factorial__doc__}, + {"factorial", math_factorial, METH_O, math_factorial__doc__}, PyDoc_STRVAR(math_trunc__doc__, "trunc($module, x, /)\n" @@ -124,7 +124,7 @@ PyDoc_STRVAR(math_trunc__doc__, "Uses the __trunc__ magic method."); #define MATH_TRUNC_METHODDEF \ - {"trunc", (PyCFunction)math_trunc, METH_O, math_trunc__doc__}, + {"trunc", math_trunc, METH_O, math_trunc__doc__}, PyDoc_STRVAR(math_frexp__doc__, "frexp($module, x, /)\n" @@ -136,7 +136,7 @@ PyDoc_STRVAR(math_frexp__doc__, "If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0."); #define MATH_FREXP_METHODDEF \ - {"frexp", (PyCFunction)math_frexp, METH_O, math_frexp__doc__}, + {"frexp", math_frexp, METH_O, math_frexp__doc__}, static PyObject * math_frexp_impl(PyObject *module, double x); @@ -213,7 +213,7 @@ PyDoc_STRVAR(math_modf__doc__, "Both results carry the sign of x and are floats."); #define MATH_MODF_METHODDEF \ - {"modf", (PyCFunction)math_modf, METH_O, math_modf__doc__}, + {"modf", math_modf, METH_O, math_modf__doc__}, static PyObject * math_modf_impl(PyObject *module, double x); @@ -247,7 +247,7 @@ PyDoc_STRVAR(math_log2__doc__, "Return the base 2 logarithm of x."); #define MATH_LOG2_METHODDEF \ - {"log2", (PyCFunction)math_log2, METH_O, math_log2__doc__}, + {"log2", math_log2, METH_O, math_log2__doc__}, PyDoc_STRVAR(math_log10__doc__, "log10($module, x, /)\n" @@ -256,7 +256,7 @@ PyDoc_STRVAR(math_log10__doc__, "Return the base 10 logarithm of x."); #define MATH_LOG10_METHODDEF \ - {"log10", (PyCFunction)math_log10, METH_O, math_log10__doc__}, + {"log10", math_log10, METH_O, math_log10__doc__}, PyDoc_STRVAR(math_fma__doc__, "fma($module, x, y, z, /)\n" @@ -535,7 +535,7 @@ PyDoc_STRVAR(math_degrees__doc__, "Convert angle x from radians to degrees."); #define MATH_DEGREES_METHODDEF \ - {"degrees", (PyCFunction)math_degrees, METH_O, math_degrees__doc__}, + {"degrees", math_degrees, METH_O, math_degrees__doc__}, static PyObject * math_degrees_impl(PyObject *module, double x); @@ -569,7 +569,7 @@ PyDoc_STRVAR(math_radians__doc__, "Convert angle x from degrees to radians."); #define MATH_RADIANS_METHODDEF \ - {"radians", (PyCFunction)math_radians, METH_O, math_radians__doc__}, + {"radians", math_radians, METH_O, math_radians__doc__}, static PyObject * math_radians_impl(PyObject *module, double x); @@ -603,7 +603,7 @@ PyDoc_STRVAR(math_isfinite__doc__, "Return True if x is neither an infinity nor a NaN, and False otherwise."); #define MATH_ISFINITE_METHODDEF \ - {"isfinite", (PyCFunction)math_isfinite, METH_O, math_isfinite__doc__}, + {"isfinite", math_isfinite, METH_O, math_isfinite__doc__}, static PyObject * math_isfinite_impl(PyObject *module, double x); @@ -637,7 +637,7 @@ PyDoc_STRVAR(math_isnan__doc__, "Return True if x is a NaN (not a number), and False otherwise."); #define MATH_ISNAN_METHODDEF \ - {"isnan", (PyCFunction)math_isnan, METH_O, math_isnan__doc__}, + {"isnan", math_isnan, METH_O, math_isnan__doc__}, static PyObject * math_isnan_impl(PyObject *module, double x); @@ -671,7 +671,7 @@ PyDoc_STRVAR(math_isinf__doc__, "Return True if x is a positive or negative infinity, and False otherwise."); #define MATH_ISINF_METHODDEF \ - {"isinf", (PyCFunction)math_isinf, METH_O, math_isinf__doc__}, + {"isinf", math_isinf, METH_O, math_isinf__doc__}, static PyObject * math_isinf_impl(PyObject *module, double x); @@ -1075,7 +1075,7 @@ PyDoc_STRVAR(math_ulp__doc__, "Return the value of the least significant bit of the float x."); #define MATH_ULP_METHODDEF \ - {"ulp", (PyCFunction)math_ulp, METH_O, math_ulp__doc__}, + {"ulp", math_ulp, METH_O, math_ulp__doc__}, static double math_ulp_impl(PyObject *module, double x); @@ -1106,4 +1106,4 @@ math_ulp(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=1ccb4b9f570d6dad input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f4afeac249a582fe input=a9049054013a1b77]*/ diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index fc42bfb61f59e1..e1cacc6787f0e5 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -37,7 +37,7 @@ PyDoc_STRVAR(MD5Type_digest__doc__, "Return the digest value as a bytes object."); #define MD5TYPE_DIGEST_METHODDEF \ - {"digest", (PyCFunction)MD5Type_digest, METH_NOARGS, MD5Type_digest__doc__}, + {"digest", MD5Type_digest, METH_NOARGS, MD5Type_digest__doc__}, static PyObject * MD5Type_digest_impl(MD5object *self); @@ -55,7 +55,7 @@ PyDoc_STRVAR(MD5Type_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define MD5TYPE_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)MD5Type_hexdigest, METH_NOARGS, MD5Type_hexdigest__doc__}, + {"hexdigest", MD5Type_hexdigest, METH_NOARGS, MD5Type_hexdigest__doc__}, static PyObject * MD5Type_hexdigest_impl(MD5object *self); @@ -73,7 +73,7 @@ PyDoc_STRVAR(MD5Type_update__doc__, "Update this hash object\'s state with the provided string."); #define MD5TYPE_UPDATE_METHODDEF \ - {"update", (PyCFunction)MD5Type_update, METH_O, MD5Type_update__doc__}, + {"update", MD5Type_update, METH_O, MD5Type_update__doc__}, static PyObject * MD5Type_update_impl(MD5object *self, PyObject *obj); @@ -162,4 +162,4 @@ _md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw exit: return return_value; } -/*[clinic end generated code: output=10db0ff2ecf97159 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6b3d1a9abaf59b63 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/overlapped.c.h b/Modules/clinic/overlapped.c.h index 7e5715660022c1..605cef238f41ea 100644 --- a/Modules/clinic/overlapped.c.h +++ b/Modules/clinic/overlapped.c.h @@ -201,7 +201,7 @@ PyDoc_STRVAR(_overlapped_UnregisterWait__doc__, "Unregister wait handle."); #define _OVERLAPPED_UNREGISTERWAIT_METHODDEF \ - {"UnregisterWait", (PyCFunction)_overlapped_UnregisterWait, METH_O, _overlapped_UnregisterWait__doc__}, + {"UnregisterWait", _overlapped_UnregisterWait, METH_O, _overlapped_UnregisterWait__doc__}, static PyObject * _overlapped_UnregisterWait_impl(PyObject *module, HANDLE WaitHandle); @@ -326,7 +326,7 @@ PyDoc_STRVAR(_overlapped_SetEvent__doc__, "Set event."); #define _OVERLAPPED_SETEVENT_METHODDEF \ - {"SetEvent", (PyCFunction)_overlapped_SetEvent, METH_O, _overlapped_SetEvent__doc__}, + {"SetEvent", _overlapped_SetEvent, METH_O, _overlapped_SetEvent__doc__}, static PyObject * _overlapped_SetEvent_impl(PyObject *module, HANDLE Handle); @@ -354,7 +354,7 @@ PyDoc_STRVAR(_overlapped_ResetEvent__doc__, "Reset event."); #define _OVERLAPPED_RESETEVENT_METHODDEF \ - {"ResetEvent", (PyCFunction)_overlapped_ResetEvent, METH_O, _overlapped_ResetEvent__doc__}, + {"ResetEvent", _overlapped_ResetEvent, METH_O, _overlapped_ResetEvent__doc__}, static PyObject * _overlapped_ResetEvent_impl(PyObject *module, HANDLE Handle); @@ -420,7 +420,7 @@ PyDoc_STRVAR(_overlapped_FormatMessage__doc__, "Return error message for an error code."); #define _OVERLAPPED_FORMATMESSAGE_METHODDEF \ - {"FormatMessage", (PyCFunction)_overlapped_FormatMessage, METH_O, _overlapped_FormatMessage__doc__}, + {"FormatMessage", _overlapped_FormatMessage, METH_O, _overlapped_FormatMessage__doc__}, static PyObject * _overlapped_FormatMessage_impl(PyObject *module, DWORD code); @@ -510,7 +510,7 @@ PyDoc_STRVAR(_overlapped_Overlapped_cancel__doc__, "Cancel overlapped operation."); #define _OVERLAPPED_OVERLAPPED_CANCEL_METHODDEF \ - {"cancel", (PyCFunction)_overlapped_Overlapped_cancel, METH_NOARGS, _overlapped_Overlapped_cancel__doc__}, + {"cancel", _overlapped_Overlapped_cancel, METH_NOARGS, _overlapped_Overlapped_cancel__doc__}, static PyObject * _overlapped_Overlapped_cancel_impl(OverlappedObject *self); @@ -994,7 +994,7 @@ PyDoc_STRVAR(_overlapped_Overlapped_ConnectNamedPipe__doc__, "Start overlapped wait for a client to connect."); #define _OVERLAPPED_OVERLAPPED_CONNECTNAMEDPIPE_METHODDEF \ - {"ConnectNamedPipe", (PyCFunction)_overlapped_Overlapped_ConnectNamedPipe, METH_O, _overlapped_Overlapped_ConnectNamedPipe__doc__}, + {"ConnectNamedPipe", _overlapped_Overlapped_ConnectNamedPipe, METH_O, _overlapped_Overlapped_ConnectNamedPipe__doc__}, static PyObject * _overlapped_Overlapped_ConnectNamedPipe_impl(OverlappedObject *self, @@ -1023,7 +1023,7 @@ PyDoc_STRVAR(_overlapped_Overlapped_ConnectPipe__doc__, "Connect to the pipe for asynchronous I/O (overlapped)."); #define _OVERLAPPED_OVERLAPPED_CONNECTPIPE_METHODDEF \ - {"ConnectPipe", (PyCFunction)_overlapped_Overlapped_ConnectPipe, METH_O, _overlapped_Overlapped_ConnectPipe__doc__}, + {"ConnectPipe", _overlapped_Overlapped_ConnectPipe, METH_O, _overlapped_Overlapped_ConnectPipe__doc__}, static PyObject * _overlapped_Overlapped_ConnectPipe_impl(OverlappedObject *self, @@ -1240,4 +1240,4 @@ _overlapped_Overlapped_WSARecvFromInto(PyObject *self, PyObject *const *args, Py return return_value; } -/*[clinic end generated code: output=d009cc9e53d9732a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=049ff4e0635ea636 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index abeb9c3e3e12b1..61f9a7e9d64916 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -321,7 +321,7 @@ PyDoc_STRVAR(os_ttyname__doc__, " Integer file descriptor handle."); #define OS_TTYNAME_METHODDEF \ - {"ttyname", (PyCFunction)os_ttyname, METH_O, os_ttyname__doc__}, + {"ttyname", os_ttyname, METH_O, os_ttyname__doc__}, static PyObject * os_ttyname_impl(PyObject *module, int fd); @@ -353,7 +353,7 @@ PyDoc_STRVAR(os_ctermid__doc__, "Return the name of the controlling terminal for this process."); #define OS_CTERMID_METHODDEF \ - {"ctermid", (PyCFunction)os_ctermid, METH_NOARGS, os_ctermid__doc__}, + {"ctermid", os_ctermid, METH_NOARGS, os_ctermid__doc__}, static PyObject * os_ctermid_impl(PyObject *module); @@ -1057,7 +1057,7 @@ PyDoc_STRVAR(os_sync__doc__, "Force write of everything to disk."); #define OS_SYNC_METHODDEF \ - {"sync", (PyCFunction)os_sync, METH_NOARGS, os_sync__doc__}, + {"sync", os_sync, METH_NOARGS, os_sync__doc__}, static PyObject * os_sync_impl(PyObject *module); @@ -1406,7 +1406,7 @@ PyDoc_STRVAR(os_getcwd__doc__, "Return a unicode string representing the current working directory."); #define OS_GETCWD_METHODDEF \ - {"getcwd", (PyCFunction)os_getcwd, METH_NOARGS, os_getcwd__doc__}, + {"getcwd", os_getcwd, METH_NOARGS, os_getcwd__doc__}, static PyObject * os_getcwd_impl(PyObject *module); @@ -1424,7 +1424,7 @@ PyDoc_STRVAR(os_getcwdb__doc__, "Return a bytes string representing the current working directory."); #define OS_GETCWDB_METHODDEF \ - {"getcwdb", (PyCFunction)os_getcwdb, METH_NOARGS, os_getcwdb__doc__}, + {"getcwdb", os_getcwdb, METH_NOARGS, os_getcwdb__doc__}, static PyObject * os_getcwdb_impl(PyObject *module); @@ -1634,7 +1634,7 @@ PyDoc_STRVAR(os_listdrives__doc__, "A drive name typically looks like \'C:\\\\\'."); #define OS_LISTDRIVES_METHODDEF \ - {"listdrives", (PyCFunction)os_listdrives, METH_NOARGS, os_listdrives__doc__}, + {"listdrives", os_listdrives, METH_NOARGS, os_listdrives__doc__}, static PyObject * os_listdrives_impl(PyObject *module); @@ -1658,7 +1658,7 @@ PyDoc_STRVAR(os_listvolumes__doc__, "Volumes are typically represented as a GUID path."); #define OS_LISTVOLUMES_METHODDEF \ - {"listvolumes", (PyCFunction)os_listvolumes, METH_NOARGS, os_listvolumes__doc__}, + {"listvolumes", os_listvolumes, METH_NOARGS, os_listvolumes__doc__}, static PyObject * os_listvolumes_impl(PyObject *module); @@ -1811,7 +1811,7 @@ PyDoc_STRVAR(os__getfullpathname__doc__, "\n"); #define OS__GETFULLPATHNAME_METHODDEF \ - {"_getfullpathname", (PyCFunction)os__getfullpathname, METH_O, os__getfullpathname__doc__}, + {"_getfullpathname", os__getfullpathname, METH_O, os__getfullpathname__doc__}, static PyObject * os__getfullpathname_impl(PyObject *module, path_t *path); @@ -1845,7 +1845,7 @@ PyDoc_STRVAR(os__getfinalpathname__doc__, "A helper function for samepath on windows."); #define OS__GETFINALPATHNAME_METHODDEF \ - {"_getfinalpathname", (PyCFunction)os__getfinalpathname, METH_O, os__getfinalpathname__doc__}, + {"_getfinalpathname", os__getfinalpathname, METH_O, os__getfinalpathname__doc__}, static PyObject * os__getfinalpathname_impl(PyObject *module, path_t *path); @@ -1879,7 +1879,7 @@ PyDoc_STRVAR(os__findfirstfile__doc__, "A function to get the real file name without accessing the file in Windows."); #define OS__FINDFIRSTFILE_METHODDEF \ - {"_findfirstfile", (PyCFunction)os__findfirstfile, METH_O, os__findfirstfile__doc__}, + {"_findfirstfile", os__findfirstfile, METH_O, os__findfirstfile__doc__}, static PyObject * os__findfirstfile_impl(PyObject *module, path_t *path); @@ -2679,7 +2679,7 @@ PyDoc_STRVAR(os_nice__doc__, "Add increment to the priority of process and return the new priority."); #define OS_NICE_METHODDEF \ - {"nice", (PyCFunction)os_nice, METH_O, os_nice__doc__}, + {"nice", os_nice, METH_O, os_nice__doc__}, static PyObject * os_nice_impl(PyObject *module, int increment); @@ -3256,7 +3256,7 @@ PyDoc_STRVAR(os_umask__doc__, "Set the current numeric umask and return the previous umask."); #define OS_UMASK_METHODDEF \ - {"umask", (PyCFunction)os_umask, METH_O, os_umask__doc__}, + {"umask", os_umask, METH_O, os_umask__doc__}, static PyObject * os_umask_impl(PyObject *module, int mask); @@ -3441,7 +3441,7 @@ PyDoc_STRVAR(os_uname__doc__, " (sysname, nodename, release, version, machine)"); #define OS_UNAME_METHODDEF \ - {"uname", (PyCFunction)os_uname, METH_NOARGS, os_uname__doc__}, + {"uname", os_uname, METH_NOARGS, os_uname__doc__}, static PyObject * os_uname_impl(PyObject *module); @@ -4267,7 +4267,7 @@ PyDoc_STRVAR(os_fork1__doc__, "Return 0 to child process and PID of child to parent process."); #define OS_FORK1_METHODDEF \ - {"fork1", (PyCFunction)os_fork1, METH_NOARGS, os_fork1__doc__}, + {"fork1", os_fork1, METH_NOARGS, os_fork1__doc__}, static PyObject * os_fork1_impl(PyObject *module); @@ -4291,7 +4291,7 @@ PyDoc_STRVAR(os_fork__doc__, "Return 0 to child process and PID of child to parent process."); #define OS_FORK_METHODDEF \ - {"fork", (PyCFunction)os_fork, METH_NOARGS, os_fork__doc__}, + {"fork", os_fork, METH_NOARGS, os_fork__doc__}, static PyObject * os_fork_impl(PyObject *module); @@ -4441,7 +4441,7 @@ PyDoc_STRVAR(os_sched_getscheduler__doc__, "Passing 0 for pid returns the scheduling policy for the calling process."); #define OS_SCHED_GETSCHEDULER_METHODDEF \ - {"sched_getscheduler", (PyCFunction)os_sched_getscheduler, METH_O, os_sched_getscheduler__doc__}, + {"sched_getscheduler", os_sched_getscheduler, METH_O, os_sched_getscheduler__doc__}, static PyObject * os_sched_getscheduler_impl(PyObject *module, pid_t pid); @@ -4584,7 +4584,7 @@ PyDoc_STRVAR(os_sched_getparam__doc__, "Return value is an instance of sched_param."); #define OS_SCHED_GETPARAM_METHODDEF \ - {"sched_getparam", (PyCFunction)os_sched_getparam, METH_O, os_sched_getparam__doc__}, + {"sched_getparam", os_sched_getparam, METH_O, os_sched_getparam__doc__}, static PyObject * os_sched_getparam_impl(PyObject *module, pid_t pid); @@ -4658,7 +4658,7 @@ PyDoc_STRVAR(os_sched_rr_get_interval__doc__, "Value returned is a float."); #define OS_SCHED_RR_GET_INTERVAL_METHODDEF \ - {"sched_rr_get_interval", (PyCFunction)os_sched_rr_get_interval, METH_O, os_sched_rr_get_interval__doc__}, + {"sched_rr_get_interval", os_sched_rr_get_interval, METH_O, os_sched_rr_get_interval__doc__}, static double os_sched_rr_get_interval_impl(PyObject *module, pid_t pid); @@ -4695,7 +4695,7 @@ PyDoc_STRVAR(os_sched_yield__doc__, "Voluntarily relinquish the CPU."); #define OS_SCHED_YIELD_METHODDEF \ - {"sched_yield", (PyCFunction)os_sched_yield, METH_NOARGS, os_sched_yield__doc__}, + {"sched_yield", os_sched_yield, METH_NOARGS, os_sched_yield__doc__}, static PyObject * os_sched_yield_impl(PyObject *module); @@ -4758,7 +4758,7 @@ PyDoc_STRVAR(os_sched_getaffinity__doc__, "The affinity is returned as a set of CPU identifiers."); #define OS_SCHED_GETAFFINITY_METHODDEF \ - {"sched_getaffinity", (PyCFunction)os_sched_getaffinity, METH_O, os_sched_getaffinity__doc__}, + {"sched_getaffinity", os_sched_getaffinity, METH_O, os_sched_getaffinity__doc__}, static PyObject * os_sched_getaffinity_impl(PyObject *module, pid_t pid); @@ -4794,7 +4794,7 @@ PyDoc_STRVAR(os_posix_openpt__doc__, "of posix_openpt() of your system."); #define OS_POSIX_OPENPT_METHODDEF \ - {"posix_openpt", (PyCFunction)os_posix_openpt, METH_O, os_posix_openpt__doc__}, + {"posix_openpt", os_posix_openpt, METH_O, os_posix_openpt__doc__}, static int os_posix_openpt_impl(PyObject *module, int oflag); @@ -4836,7 +4836,7 @@ PyDoc_STRVAR(os_grantpt__doc__, "Performs a grantpt() C function call."); #define OS_GRANTPT_METHODDEF \ - {"grantpt", (PyCFunction)os_grantpt, METH_O, os_grantpt__doc__}, + {"grantpt", os_grantpt, METH_O, os_grantpt__doc__}, static PyObject * os_grantpt_impl(PyObject *module, int fd); @@ -4873,7 +4873,7 @@ PyDoc_STRVAR(os_unlockpt__doc__, "Performs an unlockpt() C function call."); #define OS_UNLOCKPT_METHODDEF \ - {"unlockpt", (PyCFunction)os_unlockpt, METH_O, os_unlockpt__doc__}, + {"unlockpt", os_unlockpt, METH_O, os_unlockpt__doc__}, static PyObject * os_unlockpt_impl(PyObject *module, int fd); @@ -4911,7 +4911,7 @@ PyDoc_STRVAR(os_ptsname__doc__, "otherwise, performs a ptsname() C function call."); #define OS_PTSNAME_METHODDEF \ - {"ptsname", (PyCFunction)os_ptsname, METH_O, os_ptsname__doc__}, + {"ptsname", os_ptsname, METH_O, os_ptsname__doc__}, static PyObject * os_ptsname_impl(PyObject *module, int fd); @@ -4946,7 +4946,7 @@ PyDoc_STRVAR(os_openpty__doc__, "for both the master and slave ends."); #define OS_OPENPTY_METHODDEF \ - {"openpty", (PyCFunction)os_openpty, METH_NOARGS, os_openpty__doc__}, + {"openpty", os_openpty, METH_NOARGS, os_openpty__doc__}, static PyObject * os_openpty_impl(PyObject *module); @@ -4972,7 +4972,7 @@ PyDoc_STRVAR(os_login_tty__doc__, "calling process; close fd."); #define OS_LOGIN_TTY_METHODDEF \ - {"login_tty", (PyCFunction)os_login_tty, METH_O, os_login_tty__doc__}, + {"login_tty", os_login_tty, METH_O, os_login_tty__doc__}, static PyObject * os_login_tty_impl(PyObject *module, int fd); @@ -5009,7 +5009,7 @@ PyDoc_STRVAR(os_forkpty__doc__, "To both, return fd of newly opened pseudo-terminal."); #define OS_FORKPTY_METHODDEF \ - {"forkpty", (PyCFunction)os_forkpty, METH_NOARGS, os_forkpty__doc__}, + {"forkpty", os_forkpty, METH_NOARGS, os_forkpty__doc__}, static PyObject * os_forkpty_impl(PyObject *module); @@ -5031,7 +5031,7 @@ PyDoc_STRVAR(os_getegid__doc__, "Return the current process\'s effective group id."); #define OS_GETEGID_METHODDEF \ - {"getegid", (PyCFunction)os_getegid, METH_NOARGS, os_getegid__doc__}, + {"getegid", os_getegid, METH_NOARGS, os_getegid__doc__}, static PyObject * os_getegid_impl(PyObject *module); @@ -5053,7 +5053,7 @@ PyDoc_STRVAR(os_geteuid__doc__, "Return the current process\'s effective user id."); #define OS_GETEUID_METHODDEF \ - {"geteuid", (PyCFunction)os_geteuid, METH_NOARGS, os_geteuid__doc__}, + {"geteuid", os_geteuid, METH_NOARGS, os_geteuid__doc__}, static PyObject * os_geteuid_impl(PyObject *module); @@ -5075,7 +5075,7 @@ PyDoc_STRVAR(os_getgid__doc__, "Return the current process\'s group id."); #define OS_GETGID_METHODDEF \ - {"getgid", (PyCFunction)os_getgid, METH_NOARGS, os_getgid__doc__}, + {"getgid", os_getgid, METH_NOARGS, os_getgid__doc__}, static PyObject * os_getgid_impl(PyObject *module); @@ -5097,7 +5097,7 @@ PyDoc_STRVAR(os_getpid__doc__, "Return the current process id."); #define OS_GETPID_METHODDEF \ - {"getpid", (PyCFunction)os_getpid, METH_NOARGS, os_getpid__doc__}, + {"getpid", os_getpid, METH_NOARGS, os_getpid__doc__}, static PyObject * os_getpid_impl(PyObject *module); @@ -5226,7 +5226,7 @@ PyDoc_STRVAR(os_getgroups__doc__, "Return list of supplemental group IDs for the process."); #define OS_GETGROUPS_METHODDEF \ - {"getgroups", (PyCFunction)os_getgroups, METH_NOARGS, os_getgroups__doc__}, + {"getgroups", os_getgroups, METH_NOARGS, os_getgroups__doc__}, static PyObject * os_getgroups_impl(PyObject *module); @@ -5402,7 +5402,7 @@ PyDoc_STRVAR(os_getpgrp__doc__, "Return the current process group id."); #define OS_GETPGRP_METHODDEF \ - {"getpgrp", (PyCFunction)os_getpgrp, METH_NOARGS, os_getpgrp__doc__}, + {"getpgrp", os_getpgrp, METH_NOARGS, os_getpgrp__doc__}, static PyObject * os_getpgrp_impl(PyObject *module); @@ -5424,7 +5424,7 @@ PyDoc_STRVAR(os_setpgrp__doc__, "Make the current process the leader of its process group."); #define OS_SETPGRP_METHODDEF \ - {"setpgrp", (PyCFunction)os_setpgrp, METH_NOARGS, os_setpgrp__doc__}, + {"setpgrp", os_setpgrp, METH_NOARGS, os_setpgrp__doc__}, static PyObject * os_setpgrp_impl(PyObject *module); @@ -5449,7 +5449,7 @@ PyDoc_STRVAR(os_getppid__doc__, "return its id; others systems will return the id of the \'init\' process (1)."); #define OS_GETPPID_METHODDEF \ - {"getppid", (PyCFunction)os_getppid, METH_NOARGS, os_getppid__doc__}, + {"getppid", os_getppid, METH_NOARGS, os_getppid__doc__}, static PyObject * os_getppid_impl(PyObject *module); @@ -5471,7 +5471,7 @@ PyDoc_STRVAR(os_getlogin__doc__, "Return the actual login name."); #define OS_GETLOGIN_METHODDEF \ - {"getlogin", (PyCFunction)os_getlogin, METH_NOARGS, os_getlogin__doc__}, + {"getlogin", os_getlogin, METH_NOARGS, os_getlogin__doc__}, static PyObject * os_getlogin_impl(PyObject *module); @@ -5493,7 +5493,7 @@ PyDoc_STRVAR(os_getuid__doc__, "Return the current process\'s user id."); #define OS_GETUID_METHODDEF \ - {"getuid", (PyCFunction)os_getuid, METH_NOARGS, os_getuid__doc__}, + {"getuid", os_getuid, METH_NOARGS, os_getuid__doc__}, static PyObject * os_getuid_impl(PyObject *module); @@ -5603,7 +5603,7 @@ PyDoc_STRVAR(os_plock__doc__, "Lock program segments into memory.\");"); #define OS_PLOCK_METHODDEF \ - {"plock", (PyCFunction)os_plock, METH_O, os_plock__doc__}, + {"plock", os_plock, METH_O, os_plock__doc__}, static PyObject * os_plock_impl(PyObject *module, int op); @@ -5635,7 +5635,7 @@ PyDoc_STRVAR(os_setuid__doc__, "Set the current process\'s user id."); #define OS_SETUID_METHODDEF \ - {"setuid", (PyCFunction)os_setuid, METH_O, os_setuid__doc__}, + {"setuid", os_setuid, METH_O, os_setuid__doc__}, static PyObject * os_setuid_impl(PyObject *module, uid_t uid); @@ -5666,7 +5666,7 @@ PyDoc_STRVAR(os_seteuid__doc__, "Set the current process\'s effective user id."); #define OS_SETEUID_METHODDEF \ - {"seteuid", (PyCFunction)os_seteuid, METH_O, os_seteuid__doc__}, + {"seteuid", os_seteuid, METH_O, os_seteuid__doc__}, static PyObject * os_seteuid_impl(PyObject *module, uid_t euid); @@ -5697,7 +5697,7 @@ PyDoc_STRVAR(os_setegid__doc__, "Set the current process\'s effective group id."); #define OS_SETEGID_METHODDEF \ - {"setegid", (PyCFunction)os_setegid, METH_O, os_setegid__doc__}, + {"setegid", os_setegid, METH_O, os_setegid__doc__}, static PyObject * os_setegid_impl(PyObject *module, gid_t egid); @@ -5804,7 +5804,7 @@ PyDoc_STRVAR(os_setgid__doc__, "Set the current process\'s group id."); #define OS_SETGID_METHODDEF \ - {"setgid", (PyCFunction)os_setgid, METH_O, os_setgid__doc__}, + {"setgid", os_setgid, METH_O, os_setgid__doc__}, static PyObject * os_setgid_impl(PyObject *module, gid_t gid); @@ -5835,7 +5835,7 @@ PyDoc_STRVAR(os_setgroups__doc__, "Set the groups of the current process to list."); #define OS_SETGROUPS_METHODDEF \ - {"setgroups", (PyCFunction)os_setgroups, METH_O, os_setgroups__doc__}, + {"setgroups", os_setgroups, METH_O, os_setgroups__doc__}, #endif /* defined(HAVE_SETGROUPS) */ @@ -6133,7 +6133,7 @@ PyDoc_STRVAR(os_wait__doc__, " (pid, status)"); #define OS_WAIT_METHODDEF \ - {"wait", (PyCFunction)os_wait, METH_NOARGS, os_wait__doc__}, + {"wait", os_wait, METH_NOARGS, os_wait__doc__}, static PyObject * os_wait_impl(PyObject *module); @@ -6561,7 +6561,7 @@ PyDoc_STRVAR(os_times__doc__, "All fields are floating-point numbers."); #define OS_TIMES_METHODDEF \ - {"times", (PyCFunction)os_times, METH_NOARGS, os_times__doc__}, + {"times", os_times, METH_NOARGS, os_times__doc__}, static PyObject * os_times_impl(PyObject *module); @@ -6891,7 +6891,7 @@ PyDoc_STRVAR(os_timerfd_gettime__doc__, " A timer file descriptor."); #define OS_TIMERFD_GETTIME_METHODDEF \ - {"timerfd_gettime", (PyCFunction)os_timerfd_gettime, METH_O, os_timerfd_gettime__doc__}, + {"timerfd_gettime", os_timerfd_gettime, METH_O, os_timerfd_gettime__doc__}, static PyObject * os_timerfd_gettime_impl(PyObject *module, int fd); @@ -6926,7 +6926,7 @@ PyDoc_STRVAR(os_timerfd_gettime_ns__doc__, " A timer file descriptor."); #define OS_TIMERFD_GETTIME_NS_METHODDEF \ - {"timerfd_gettime_ns", (PyCFunction)os_timerfd_gettime_ns, METH_O, os_timerfd_gettime_ns__doc__}, + {"timerfd_gettime_ns", os_timerfd_gettime_ns, METH_O, os_timerfd_gettime_ns__doc__}, static PyObject * os_timerfd_gettime_ns_impl(PyObject *module, int fd); @@ -6958,7 +6958,7 @@ PyDoc_STRVAR(os_getsid__doc__, "Call the system call getsid(pid) and return the result."); #define OS_GETSID_METHODDEF \ - {"getsid", (PyCFunction)os_getsid, METH_O, os_getsid__doc__}, + {"getsid", os_getsid, METH_O, os_getsid__doc__}, static PyObject * os_getsid_impl(PyObject *module, pid_t pid); @@ -6990,7 +6990,7 @@ PyDoc_STRVAR(os_setsid__doc__, "Call the system call setsid()."); #define OS_SETSID_METHODDEF \ - {"setsid", (PyCFunction)os_setsid, METH_NOARGS, os_setsid__doc__}, + {"setsid", os_setsid, METH_NOARGS, os_setsid__doc__}, static PyObject * os_setsid_impl(PyObject *module); @@ -7052,7 +7052,7 @@ PyDoc_STRVAR(os_tcgetpgrp__doc__, "Return the process group associated with the terminal specified by fd."); #define OS_TCGETPGRP_METHODDEF \ - {"tcgetpgrp", (PyCFunction)os_tcgetpgrp, METH_O, os_tcgetpgrp__doc__}, + {"tcgetpgrp", os_tcgetpgrp, METH_O, os_tcgetpgrp__doc__}, static PyObject * os_tcgetpgrp_impl(PyObject *module, int fd); @@ -7316,7 +7316,7 @@ PyDoc_STRVAR(os_dup__doc__, "Return a duplicate of a file descriptor."); #define OS_DUP_METHODDEF \ - {"dup", (PyCFunction)os_dup, METH_O, os_dup__doc__}, + {"dup", os_dup, METH_O, os_dup__doc__}, static int os_dup_impl(PyObject *module, int fd); @@ -8269,7 +8269,7 @@ PyDoc_STRVAR(os_isatty__doc__, "connected to the slave end of a terminal."); #define OS_ISATTY_METHODDEF \ - {"isatty", (PyCFunction)os_isatty, METH_O, os_isatty__doc__}, + {"isatty", os_isatty, METH_O, os_isatty__doc__}, static int os_isatty_impl(PyObject *module, int fd); @@ -8307,7 +8307,7 @@ PyDoc_STRVAR(os_pipe__doc__, " (read_fd, write_fd)"); #define OS_PIPE_METHODDEF \ - {"pipe", (PyCFunction)os_pipe, METH_NOARGS, os_pipe__doc__}, + {"pipe", os_pipe, METH_NOARGS, os_pipe__doc__}, static PyObject * os_pipe_impl(PyObject *module); @@ -8335,7 +8335,7 @@ PyDoc_STRVAR(os_pipe2__doc__, "O_NONBLOCK, O_CLOEXEC."); #define OS_PIPE2_METHODDEF \ - {"pipe2", (PyCFunction)os_pipe2, METH_O, os_pipe2__doc__}, + {"pipe2", os_pipe2, METH_O, os_pipe2__doc__}, static PyObject * os_pipe2_impl(PyObject *module, int flags); @@ -8978,7 +8978,7 @@ PyDoc_STRVAR(os_major__doc__, "Extracts a device major number from a raw device number."); #define OS_MAJOR_METHODDEF \ - {"major", (PyCFunction)os_major, METH_O, os_major__doc__}, + {"major", os_major, METH_O, os_major__doc__}, static PyObject * os_major_impl(PyObject *module, dev_t device); @@ -9009,7 +9009,7 @@ PyDoc_STRVAR(os_minor__doc__, "Extracts a device minor number from a raw device number."); #define OS_MINOR_METHODDEF \ - {"minor", (PyCFunction)os_minor, METH_O, os_minor__doc__}, + {"minor", os_minor, METH_O, os_minor__doc__}, static PyObject * os_minor_impl(PyObject *module, dev_t device); @@ -9383,7 +9383,7 @@ PyDoc_STRVAR(os_unsetenv__doc__, "Delete an environment variable."); #define OS_UNSETENV_METHODDEF \ - {"unsetenv", (PyCFunction)os_unsetenv, METH_O, os_unsetenv__doc__}, + {"unsetenv", os_unsetenv, METH_O, os_unsetenv__doc__}, static PyObject * os_unsetenv_impl(PyObject *module, PyObject *name); @@ -9416,7 +9416,7 @@ PyDoc_STRVAR(os_unsetenv__doc__, "Delete an environment variable."); #define OS_UNSETENV_METHODDEF \ - {"unsetenv", (PyCFunction)os_unsetenv, METH_O, os_unsetenv__doc__}, + {"unsetenv", os_unsetenv, METH_O, os_unsetenv__doc__}, static PyObject * os_unsetenv_impl(PyObject *module, PyObject *name); @@ -9448,7 +9448,7 @@ PyDoc_STRVAR(os_strerror__doc__, "Translate an error code to a message string."); #define OS_STRERROR_METHODDEF \ - {"strerror", (PyCFunction)os_strerror, METH_O, os_strerror__doc__}, + {"strerror", os_strerror, METH_O, os_strerror__doc__}, static PyObject * os_strerror_impl(PyObject *module, int code); @@ -9478,7 +9478,7 @@ PyDoc_STRVAR(os_WCOREDUMP__doc__, "Return True if the process returning status was dumped to a core file."); #define OS_WCOREDUMP_METHODDEF \ - {"WCOREDUMP", (PyCFunction)os_WCOREDUMP, METH_O, os_WCOREDUMP__doc__}, + {"WCOREDUMP", os_WCOREDUMP, METH_O, os_WCOREDUMP__doc__}, static int os_WCOREDUMP_impl(PyObject *module, int status); @@ -9996,7 +9996,7 @@ PyDoc_STRVAR(os_fstatvfs__doc__, "Equivalent to statvfs(fd)."); #define OS_FSTATVFS_METHODDEF \ - {"fstatvfs", (PyCFunction)os_fstatvfs, METH_O, os_fstatvfs__doc__}, + {"fstatvfs", os_fstatvfs, METH_O, os_fstatvfs__doc__}, static PyObject * os_fstatvfs_impl(PyObject *module, int fd); @@ -10286,7 +10286,7 @@ PyDoc_STRVAR(os_confstr__doc__, "Return a string-valued system configuration variable."); #define OS_CONFSTR_METHODDEF \ - {"confstr", (PyCFunction)os_confstr, METH_O, os_confstr__doc__}, + {"confstr", os_confstr, METH_O, os_confstr__doc__}, static PyObject * os_confstr_impl(PyObject *module, int name); @@ -10317,7 +10317,7 @@ PyDoc_STRVAR(os_sysconf__doc__, "Return an integer-valued system configuration variable."); #define OS_SYSCONF_METHODDEF \ - {"sysconf", (PyCFunction)os_sysconf, METH_O, os_sysconf__doc__}, + {"sysconf", os_sysconf, METH_O, os_sysconf__doc__}, static long os_sysconf_impl(PyObject *module, int name); @@ -10354,7 +10354,7 @@ PyDoc_STRVAR(os_abort__doc__, "on the hosting operating system. This function never returns."); #define OS_ABORT_METHODDEF \ - {"abort", (PyCFunction)os_abort, METH_NOARGS, os_abort__doc__}, + {"abort", os_abort, METH_NOARGS, os_abort__doc__}, static PyObject * os_abort_impl(PyObject *module); @@ -10524,7 +10524,7 @@ PyDoc_STRVAR(os_getloadavg__doc__, "Raises OSError if the load average was unobtainable."); #define OS_GETLOADAVG_METHODDEF \ - {"getloadavg", (PyCFunction)os_getloadavg, METH_NOARGS, os_getloadavg__doc__}, + {"getloadavg", os_getloadavg, METH_NOARGS, os_getloadavg__doc__}, static PyObject * os_getloadavg_impl(PyObject *module); @@ -10692,7 +10692,7 @@ PyDoc_STRVAR(os_getresuid__doc__, "Return a tuple of the current process\'s real, effective, and saved user ids."); #define OS_GETRESUID_METHODDEF \ - {"getresuid", (PyCFunction)os_getresuid, METH_NOARGS, os_getresuid__doc__}, + {"getresuid", os_getresuid, METH_NOARGS, os_getresuid__doc__}, static PyObject * os_getresuid_impl(PyObject *module); @@ -10714,7 +10714,7 @@ PyDoc_STRVAR(os_getresgid__doc__, "Return a tuple of the current process\'s real, effective, and saved group ids."); #define OS_GETRESGID_METHODDEF \ - {"getresgid", (PyCFunction)os_getresgid, METH_NOARGS, os_getresgid__doc__}, + {"getresgid", os_getresgid, METH_NOARGS, os_getresgid__doc__}, static PyObject * os_getresgid_impl(PyObject *module); @@ -11108,7 +11108,7 @@ PyDoc_STRVAR(os_urandom__doc__, "Return a bytes object containing random bytes suitable for cryptographic use."); #define OS_URANDOM_METHODDEF \ - {"urandom", (PyCFunction)os_urandom, METH_O, os_urandom__doc__}, + {"urandom", os_urandom, METH_O, os_urandom__doc__}, static PyObject * os_urandom_impl(PyObject *module, Py_ssize_t size); @@ -11473,7 +11473,7 @@ PyDoc_STRVAR(os_cpu_count__doc__, "Return None if indeterminable."); #define OS_CPU_COUNT_METHODDEF \ - {"cpu_count", (PyCFunction)os_cpu_count, METH_NOARGS, os_cpu_count__doc__}, + {"cpu_count", os_cpu_count, METH_NOARGS, os_cpu_count__doc__}, static PyObject * os_cpu_count_impl(PyObject *module); @@ -11491,7 +11491,7 @@ PyDoc_STRVAR(os_get_inheritable__doc__, "Get the close-on-exe flag of the specified file descriptor."); #define OS_GET_INHERITABLE_METHODDEF \ - {"get_inheritable", (PyCFunction)os_get_inheritable, METH_O, os_get_inheritable__doc__}, + {"get_inheritable", os_get_inheritable, METH_O, os_get_inheritable__doc__}, static int os_get_inheritable_impl(PyObject *module, int fd); @@ -11562,7 +11562,7 @@ PyDoc_STRVAR(os_get_handle_inheritable__doc__, "Get the close-on-exe flag of the specified file descriptor."); #define OS_GET_HANDLE_INHERITABLE_METHODDEF \ - {"get_handle_inheritable", (PyCFunction)os_get_handle_inheritable, METH_O, os_get_handle_inheritable__doc__}, + {"get_handle_inheritable", os_get_handle_inheritable, METH_O, os_get_handle_inheritable__doc__}, static int os_get_handle_inheritable_impl(PyObject *module, intptr_t handle); @@ -11640,7 +11640,7 @@ PyDoc_STRVAR(os_get_blocking__doc__, "Return False if the O_NONBLOCK flag is set, True if the flag is cleared."); #define OS_GET_BLOCKING_METHODDEF \ - {"get_blocking", (PyCFunction)os_get_blocking, METH_O, os_get_blocking__doc__}, + {"get_blocking", os_get_blocking, METH_O, os_get_blocking__doc__}, static int os_get_blocking_impl(PyObject *module, int fd); @@ -11744,7 +11744,7 @@ PyDoc_STRVAR(os_DirEntry_is_junction__doc__, "Return True if the entry is a junction; cached per entry."); #define OS_DIRENTRY_IS_JUNCTION_METHODDEF \ - {"is_junction", (PyCFunction)os_DirEntry_is_junction, METH_NOARGS, os_DirEntry_is_junction__doc__}, + {"is_junction", os_DirEntry_is_junction, METH_NOARGS, os_DirEntry_is_junction__doc__}, static int os_DirEntry_is_junction_impl(DirEntry *self); @@ -11977,7 +11977,7 @@ PyDoc_STRVAR(os_DirEntry_inode__doc__, "Return inode of the entry; cached per entry."); #define OS_DIRENTRY_INODE_METHODDEF \ - {"inode", (PyCFunction)os_DirEntry_inode, METH_NOARGS, os_DirEntry_inode__doc__}, + {"inode", os_DirEntry_inode, METH_NOARGS, os_DirEntry_inode__doc__}, static PyObject * os_DirEntry_inode_impl(DirEntry *self); @@ -11995,7 +11995,7 @@ PyDoc_STRVAR(os_DirEntry___fspath____doc__, "Returns the path for the entry."); #define OS_DIRENTRY___FSPATH___METHODDEF \ - {"__fspath__", (PyCFunction)os_DirEntry___fspath__, METH_NOARGS, os_DirEntry___fspath____doc__}, + {"__fspath__", os_DirEntry___fspath__, METH_NOARGS, os_DirEntry___fspath____doc__}, static PyObject * os_DirEntry___fspath___impl(DirEntry *self); @@ -12436,7 +12436,7 @@ PyDoc_STRVAR(os__supports_virtual_terminal__doc__, "Checks if virtual terminal is supported in windows"); #define OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF \ - {"_supports_virtual_terminal", (PyCFunction)os__supports_virtual_terminal, METH_NOARGS, os__supports_virtual_terminal__doc__}, + {"_supports_virtual_terminal", os__supports_virtual_terminal, METH_NOARGS, os__supports_virtual_terminal__doc__}, static PyObject * os__supports_virtual_terminal_impl(PyObject *module); @@ -12456,7 +12456,7 @@ PyDoc_STRVAR(os__inputhook__doc__, "Calls PyOS_CallInputHook droppong the GIL first"); #define OS__INPUTHOOK_METHODDEF \ - {"_inputhook", (PyCFunction)os__inputhook, METH_NOARGS, os__inputhook__doc__}, + {"_inputhook", os__inputhook, METH_NOARGS, os__inputhook__doc__}, static PyObject * os__inputhook_impl(PyObject *module); @@ -12474,7 +12474,7 @@ PyDoc_STRVAR(os__is_inputhook_installed__doc__, "Checks if PyOS_CallInputHook is set"); #define OS__IS_INPUTHOOK_INSTALLED_METHODDEF \ - {"_is_inputhook_installed", (PyCFunction)os__is_inputhook_installed, METH_NOARGS, os__is_inputhook_installed__doc__}, + {"_is_inputhook_installed", os__is_inputhook_installed, METH_NOARGS, os__is_inputhook_installed__doc__}, static PyObject * os__is_inputhook_installed_impl(PyObject *module); @@ -12492,7 +12492,7 @@ PyDoc_STRVAR(os__create_environ__doc__, "Create the environment dictionary."); #define OS__CREATE_ENVIRON_METHODDEF \ - {"_create_environ", (PyCFunction)os__create_environ, METH_NOARGS, os__create_environ__doc__}, + {"_create_environ", os__create_environ, METH_NOARGS, os__create_environ__doc__}, static PyObject * os__create_environ_impl(PyObject *module); @@ -12512,7 +12512,7 @@ PyDoc_STRVAR(os__emscripten_debugger__doc__, "Create a breakpoint for the JavaScript debugger. Emscripten only."); #define OS__EMSCRIPTEN_DEBUGGER_METHODDEF \ - {"_emscripten_debugger", (PyCFunction)os__emscripten_debugger, METH_NOARGS, os__emscripten_debugger__doc__}, + {"_emscripten_debugger", os__emscripten_debugger, METH_NOARGS, os__emscripten_debugger__doc__}, static PyObject * os__emscripten_debugger_impl(PyObject *module); @@ -13196,4 +13196,4 @@ os__emscripten_debugger(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef OS__EMSCRIPTEN_DEBUGGER_METHODDEF #define OS__EMSCRIPTEN_DEBUGGER_METHODDEF #endif /* !defined(OS__EMSCRIPTEN_DEBUGGER_METHODDEF) */ -/*[clinic end generated code: output=8318c26fc2cd236c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4932a904020ead66 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pwdmodule.c.h b/Modules/clinic/pwdmodule.c.h index 365d99aab1dd22..9df6e27a123112 100644 --- a/Modules/clinic/pwdmodule.c.h +++ b/Modules/clinic/pwdmodule.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(pwd_getpwuid__doc__, "See `help(pwd)` for more on password database entries."); #define PWD_GETPWUID_METHODDEF \ - {"getpwuid", (PyCFunction)pwd_getpwuid, METH_O, pwd_getpwuid__doc__}, + {"getpwuid", pwd_getpwuid, METH_O, pwd_getpwuid__doc__}, PyDoc_STRVAR(pwd_getpwnam__doc__, "getpwnam($module, name, /)\n" @@ -22,7 +22,7 @@ PyDoc_STRVAR(pwd_getpwnam__doc__, "See `help(pwd)` for more on password database entries."); #define PWD_GETPWNAM_METHODDEF \ - {"getpwnam", (PyCFunction)pwd_getpwnam, METH_O, pwd_getpwnam__doc__}, + {"getpwnam", pwd_getpwnam, METH_O, pwd_getpwnam__doc__}, static PyObject * pwd_getpwnam_impl(PyObject *module, PyObject *name); @@ -55,7 +55,7 @@ PyDoc_STRVAR(pwd_getpwall__doc__, "See help(pwd) for more on password database entries."); #define PWD_GETPWALL_METHODDEF \ - {"getpwall", (PyCFunction)pwd_getpwall, METH_NOARGS, pwd_getpwall__doc__}, + {"getpwall", pwd_getpwall, METH_NOARGS, pwd_getpwall__doc__}, static PyObject * pwd_getpwall_impl(PyObject *module); @@ -71,4 +71,4 @@ pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef PWD_GETPWALL_METHODDEF #define PWD_GETPWALL_METHODDEF #endif /* !defined(PWD_GETPWALL_METHODDEF) */ -/*[clinic end generated code: output=dac88d500f6d6f49 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5a1eea3e45743a34 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index 9eba59731c3fba..c68056ca548ec3 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_SetReparseDeferralEnabled__doc__, "Enable/Disable reparse deferral; enabled by default with Expat >=2.6.0."); #define PYEXPAT_XMLPARSER_SETREPARSEDEFERRALENABLED_METHODDEF \ - {"SetReparseDeferralEnabled", (PyCFunction)pyexpat_xmlparser_SetReparseDeferralEnabled, METH_O, pyexpat_xmlparser_SetReparseDeferralEnabled__doc__}, + {"SetReparseDeferralEnabled", pyexpat_xmlparser_SetReparseDeferralEnabled, METH_O, pyexpat_xmlparser_SetReparseDeferralEnabled__doc__}, static PyObject * pyexpat_xmlparser_SetReparseDeferralEnabled_impl(xmlparseobject *self, @@ -44,7 +44,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_GetReparseDeferralEnabled__doc__, "Retrieve reparse deferral enabled status; always returns false with Expat <2.6.0."); #define PYEXPAT_XMLPARSER_GETREPARSEDEFERRALENABLED_METHODDEF \ - {"GetReparseDeferralEnabled", (PyCFunction)pyexpat_xmlparser_GetReparseDeferralEnabled, METH_NOARGS, pyexpat_xmlparser_GetReparseDeferralEnabled__doc__}, + {"GetReparseDeferralEnabled", pyexpat_xmlparser_GetReparseDeferralEnabled, METH_NOARGS, pyexpat_xmlparser_GetReparseDeferralEnabled__doc__}, static PyObject * pyexpat_xmlparser_GetReparseDeferralEnabled_impl(xmlparseobject *self); @@ -163,7 +163,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_SetBase__doc__, "Set the base URL for the parser."); #define PYEXPAT_XMLPARSER_SETBASE_METHODDEF \ - {"SetBase", (PyCFunction)pyexpat_xmlparser_SetBase, METH_O, pyexpat_xmlparser_SetBase__doc__}, + {"SetBase", pyexpat_xmlparser_SetBase, METH_O, pyexpat_xmlparser_SetBase__doc__}, static PyObject * pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base); @@ -200,7 +200,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_GetBase__doc__, "Return base URL string for the parser."); #define PYEXPAT_XMLPARSER_GETBASE_METHODDEF \ - {"GetBase", (PyCFunction)pyexpat_xmlparser_GetBase, METH_NOARGS, pyexpat_xmlparser_GetBase__doc__}, + {"GetBase", pyexpat_xmlparser_GetBase, METH_NOARGS, pyexpat_xmlparser_GetBase__doc__}, static PyObject * pyexpat_xmlparser_GetBase_impl(xmlparseobject *self); @@ -221,7 +221,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_GetInputContext__doc__, "for an element with many attributes), not all of the text may be available."); #define PYEXPAT_XMLPARSER_GETINPUTCONTEXT_METHODDEF \ - {"GetInputContext", (PyCFunction)pyexpat_xmlparser_GetInputContext, METH_NOARGS, pyexpat_xmlparser_GetInputContext__doc__}, + {"GetInputContext", pyexpat_xmlparser_GetInputContext, METH_NOARGS, pyexpat_xmlparser_GetInputContext__doc__}, static PyObject * pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self); @@ -327,7 +327,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_SetParamEntityParsing__doc__, "was successful."); #define PYEXPAT_XMLPARSER_SETPARAMENTITYPARSING_METHODDEF \ - {"SetParamEntityParsing", (PyCFunction)pyexpat_xmlparser_SetParamEntityParsing, METH_O, pyexpat_xmlparser_SetParamEntityParsing__doc__}, + {"SetParamEntityParsing", pyexpat_xmlparser_SetParamEntityParsing, METH_O, pyexpat_xmlparser_SetParamEntityParsing__doc__}, static PyObject * pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag); @@ -526,7 +526,7 @@ PyDoc_STRVAR(pyexpat_ErrorString__doc__, "Returns string error for given number."); #define PYEXPAT_ERRORSTRING_METHODDEF \ - {"ErrorString", (PyCFunction)pyexpat_ErrorString, METH_O, pyexpat_ErrorString__doc__}, + {"ErrorString", pyexpat_ErrorString, METH_O, pyexpat_ErrorString__doc__}, static PyObject * pyexpat_ErrorString_impl(PyObject *module, long code); @@ -550,4 +550,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=7ee30ae5b666d0a8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=65190af4649c6524 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/readline.c.h b/Modules/clinic/readline.c.h index 696475f7d00f5b..e41d7b8213e692 100644 --- a/Modules/clinic/readline.c.h +++ b/Modules/clinic/readline.c.h @@ -12,7 +12,7 @@ PyDoc_STRVAR(readline_parse_and_bind__doc__, "Execute the init line provided in the string argument."); #define READLINE_PARSE_AND_BIND_METHODDEF \ - {"parse_and_bind", (PyCFunction)readline_parse_and_bind, METH_O, readline_parse_and_bind__doc__}, + {"parse_and_bind", readline_parse_and_bind, METH_O, readline_parse_and_bind__doc__}, static PyObject * readline_parse_and_bind_impl(PyObject *module, PyObject *string); @@ -192,7 +192,7 @@ PyDoc_STRVAR(readline_set_history_length__doc__, "A negative length is used to inhibit history truncation."); #define READLINE_SET_HISTORY_LENGTH_METHODDEF \ - {"set_history_length", (PyCFunction)readline_set_history_length, METH_O, readline_set_history_length__doc__}, + {"set_history_length", readline_set_history_length, METH_O, readline_set_history_length__doc__}, static PyObject * readline_set_history_length_impl(PyObject *module, int length); @@ -220,7 +220,7 @@ PyDoc_STRVAR(readline_get_history_length__doc__, "Return the maximum number of lines that will be written to the history file."); #define READLINE_GET_HISTORY_LENGTH_METHODDEF \ - {"get_history_length", (PyCFunction)readline_get_history_length, METH_NOARGS, readline_get_history_length__doc__}, + {"get_history_length", readline_get_history_length, METH_NOARGS, readline_get_history_length__doc__}, static PyObject * readline_get_history_length_impl(PyObject *module); @@ -356,7 +356,7 @@ PyDoc_STRVAR(readline_get_completion_type__doc__, "Get the type of completion being attempted."); #define READLINE_GET_COMPLETION_TYPE_METHODDEF \ - {"get_completion_type", (PyCFunction)readline_get_completion_type, METH_NOARGS, readline_get_completion_type__doc__}, + {"get_completion_type", readline_get_completion_type, METH_NOARGS, readline_get_completion_type__doc__}, static PyObject * readline_get_completion_type_impl(PyObject *module); @@ -374,7 +374,7 @@ PyDoc_STRVAR(readline_get_begidx__doc__, "Get the beginning index of the completion scope."); #define READLINE_GET_BEGIDX_METHODDEF \ - {"get_begidx", (PyCFunction)readline_get_begidx, METH_NOARGS, readline_get_begidx__doc__}, + {"get_begidx", readline_get_begidx, METH_NOARGS, readline_get_begidx__doc__}, static PyObject * readline_get_begidx_impl(PyObject *module); @@ -392,7 +392,7 @@ PyDoc_STRVAR(readline_get_endidx__doc__, "Get the ending index of the completion scope."); #define READLINE_GET_ENDIDX_METHODDEF \ - {"get_endidx", (PyCFunction)readline_get_endidx, METH_NOARGS, readline_get_endidx__doc__}, + {"get_endidx", readline_get_endidx, METH_NOARGS, readline_get_endidx__doc__}, static PyObject * readline_get_endidx_impl(PyObject *module); @@ -410,7 +410,7 @@ PyDoc_STRVAR(readline_set_completer_delims__doc__, "Set the word delimiters for completion."); #define READLINE_SET_COMPLETER_DELIMS_METHODDEF \ - {"set_completer_delims", (PyCFunction)readline_set_completer_delims, METH_O, readline_set_completer_delims__doc__}, + {"set_completer_delims", readline_set_completer_delims, METH_O, readline_set_completer_delims__doc__}, static PyObject * readline_set_completer_delims_impl(PyObject *module, PyObject *string); @@ -434,7 +434,7 @@ PyDoc_STRVAR(readline_remove_history_item__doc__, "Remove history item given by its zero-based position."); #define READLINE_REMOVE_HISTORY_ITEM_METHODDEF \ - {"remove_history_item", (PyCFunction)readline_remove_history_item, METH_O, readline_remove_history_item__doc__}, + {"remove_history_item", readline_remove_history_item, METH_O, readline_remove_history_item__doc__}, static PyObject * readline_remove_history_item_impl(PyObject *module, int entry_number); @@ -506,7 +506,7 @@ PyDoc_STRVAR(readline_add_history__doc__, "Add an item to the history buffer."); #define READLINE_ADD_HISTORY_METHODDEF \ - {"add_history", (PyCFunction)readline_add_history, METH_O, readline_add_history__doc__}, + {"add_history", readline_add_history, METH_O, readline_add_history__doc__}, static PyObject * readline_add_history_impl(PyObject *module, PyObject *string); @@ -530,7 +530,7 @@ PyDoc_STRVAR(readline_set_auto_history__doc__, "Enables or disables automatic history."); #define READLINE_SET_AUTO_HISTORY_METHODDEF \ - {"set_auto_history", (PyCFunction)readline_set_auto_history, METH_O, readline_set_auto_history__doc__}, + {"set_auto_history", readline_set_auto_history, METH_O, readline_set_auto_history__doc__}, static PyObject * readline_set_auto_history_impl(PyObject *module, @@ -559,7 +559,7 @@ PyDoc_STRVAR(readline_get_completer_delims__doc__, "Get the word delimiters for completion."); #define READLINE_GET_COMPLETER_DELIMS_METHODDEF \ - {"get_completer_delims", (PyCFunction)readline_get_completer_delims, METH_NOARGS, readline_get_completer_delims__doc__}, + {"get_completer_delims", readline_get_completer_delims, METH_NOARGS, readline_get_completer_delims__doc__}, static PyObject * readline_get_completer_delims_impl(PyObject *module); @@ -621,7 +621,7 @@ PyDoc_STRVAR(readline_get_completer__doc__, "Get the current completer function."); #define READLINE_GET_COMPLETER_METHODDEF \ - {"get_completer", (PyCFunction)readline_get_completer, METH_NOARGS, readline_get_completer__doc__}, + {"get_completer", readline_get_completer, METH_NOARGS, readline_get_completer__doc__}, static PyObject * readline_get_completer_impl(PyObject *module); @@ -639,7 +639,7 @@ PyDoc_STRVAR(readline_get_history_item__doc__, "Return the current contents of history item at one-based index."); #define READLINE_GET_HISTORY_ITEM_METHODDEF \ - {"get_history_item", (PyCFunction)readline_get_history_item, METH_O, readline_get_history_item__doc__}, + {"get_history_item", readline_get_history_item, METH_O, readline_get_history_item__doc__}, static PyObject * readline_get_history_item_impl(PyObject *module, int idx); @@ -669,7 +669,7 @@ PyDoc_STRVAR(readline_get_current_history_length__doc__, "Return the current (not the maximum) length of history."); #define READLINE_GET_CURRENT_HISTORY_LENGTH_METHODDEF \ - {"get_current_history_length", (PyCFunction)readline_get_current_history_length, METH_NOARGS, readline_get_current_history_length__doc__}, + {"get_current_history_length", readline_get_current_history_length, METH_NOARGS, readline_get_current_history_length__doc__}, static PyObject * readline_get_current_history_length_impl(PyObject *module); @@ -693,7 +693,7 @@ PyDoc_STRVAR(readline_get_line_buffer__doc__, "Return the current contents of the line buffer."); #define READLINE_GET_LINE_BUFFER_METHODDEF \ - {"get_line_buffer", (PyCFunction)readline_get_line_buffer, METH_NOARGS, readline_get_line_buffer__doc__}, + {"get_line_buffer", readline_get_line_buffer, METH_NOARGS, readline_get_line_buffer__doc__}, static PyObject * readline_get_line_buffer_impl(PyObject *module); @@ -719,7 +719,7 @@ PyDoc_STRVAR(readline_clear_history__doc__, "Clear the current readline history."); #define READLINE_CLEAR_HISTORY_METHODDEF \ - {"clear_history", (PyCFunction)readline_clear_history, METH_NOARGS, readline_clear_history__doc__}, + {"clear_history", readline_clear_history, METH_NOARGS, readline_clear_history__doc__}, static PyObject * readline_clear_history_impl(PyObject *module); @@ -745,7 +745,7 @@ PyDoc_STRVAR(readline_insert_text__doc__, "Insert text into the line buffer at the cursor position."); #define READLINE_INSERT_TEXT_METHODDEF \ - {"insert_text", (PyCFunction)readline_insert_text, METH_O, readline_insert_text__doc__}, + {"insert_text", readline_insert_text, METH_O, readline_insert_text__doc__}, static PyObject * readline_insert_text_impl(PyObject *module, PyObject *string); @@ -769,7 +769,7 @@ PyDoc_STRVAR(readline_redisplay__doc__, "Change what\'s displayed on the screen to reflect contents of the line buffer."); #define READLINE_REDISPLAY_METHODDEF \ - {"redisplay", (PyCFunction)readline_redisplay, METH_NOARGS, readline_redisplay__doc__}, + {"redisplay", readline_redisplay, METH_NOARGS, readline_redisplay__doc__}, static PyObject * readline_redisplay_impl(PyObject *module); @@ -797,4 +797,4 @@ readline_redisplay(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef READLINE_CLEAR_HISTORY_METHODDEF #define READLINE_CLEAR_HISTORY_METHODDEF #endif /* !defined(READLINE_CLEAR_HISTORY_METHODDEF) */ -/*[clinic end generated code: output=88d9812b6caa2102 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=286b83300ba086c2 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/resource.c.h b/Modules/clinic/resource.c.h index 9eda7de27532a1..3e96cb78381395 100644 --- a/Modules/clinic/resource.c.h +++ b/Modules/clinic/resource.c.h @@ -10,7 +10,7 @@ PyDoc_STRVAR(resource_getrusage__doc__, "\n"); #define RESOURCE_GETRUSAGE_METHODDEF \ - {"getrusage", (PyCFunction)resource_getrusage, METH_O, resource_getrusage__doc__}, + {"getrusage", resource_getrusage, METH_O, resource_getrusage__doc__}, static PyObject * resource_getrusage_impl(PyObject *module, int who); @@ -39,7 +39,7 @@ PyDoc_STRVAR(resource_getrlimit__doc__, "\n"); #define RESOURCE_GETRLIMIT_METHODDEF \ - {"getrlimit", (PyCFunction)resource_getrlimit, METH_O, resource_getrlimit__doc__}, + {"getrlimit", resource_getrlimit, METH_O, resource_getrlimit__doc__}, static PyObject * resource_getrlimit_impl(PyObject *module, int resource); @@ -150,7 +150,7 @@ PyDoc_STRVAR(resource_getpagesize__doc__, "\n"); #define RESOURCE_GETPAGESIZE_METHODDEF \ - {"getpagesize", (PyCFunction)resource_getpagesize, METH_NOARGS, resource_getpagesize__doc__}, + {"getpagesize", resource_getpagesize, METH_NOARGS, resource_getpagesize__doc__}, static int resource_getpagesize_impl(PyObject *module); @@ -178,4 +178,4 @@ resource_getpagesize(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef RESOURCE_PRLIMIT_METHODDEF #define RESOURCE_PRLIMIT_METHODDEF #endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */ -/*[clinic end generated code: output=e45883ace510414a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3d91aec3c1e3a374 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/selectmodule.c.h b/Modules/clinic/selectmodule.c.h index 8ee291dcca8b16..277a52d1bc92cb 100644 --- a/Modules/clinic/selectmodule.c.h +++ b/Modules/clinic/selectmodule.c.h @@ -177,7 +177,7 @@ PyDoc_STRVAR(select_poll_unregister__doc__, "Remove a file descriptor being tracked by the polling object."); #define SELECT_POLL_UNREGISTER_METHODDEF \ - {"unregister", (PyCFunction)select_poll_unregister, METH_O, select_poll_unregister__doc__}, + {"unregister", select_poll_unregister, METH_O, select_poll_unregister__doc__}, static PyObject * select_poll_unregister_impl(pollObject *self, int fd); @@ -362,7 +362,7 @@ PyDoc_STRVAR(select_devpoll_unregister__doc__, "Remove a file descriptor being tracked by the polling object."); #define SELECT_DEVPOLL_UNREGISTER_METHODDEF \ - {"unregister", (PyCFunction)select_devpoll_unregister, METH_O, select_devpoll_unregister__doc__}, + {"unregister", select_devpoll_unregister, METH_O, select_devpoll_unregister__doc__}, static PyObject * select_devpoll_unregister_impl(devpollObject *self, int fd); @@ -443,7 +443,7 @@ PyDoc_STRVAR(select_devpoll_close__doc__, "Further operations on the devpoll object will raise an exception."); #define SELECT_DEVPOLL_CLOSE_METHODDEF \ - {"close", (PyCFunction)select_devpoll_close, METH_NOARGS, select_devpoll_close__doc__}, + {"close", select_devpoll_close, METH_NOARGS, select_devpoll_close__doc__}, static PyObject * select_devpoll_close_impl(devpollObject *self); @@ -471,7 +471,7 @@ PyDoc_STRVAR(select_devpoll_fileno__doc__, "Return the file descriptor."); #define SELECT_DEVPOLL_FILENO_METHODDEF \ - {"fileno", (PyCFunction)select_devpoll_fileno, METH_NOARGS, select_devpoll_fileno__doc__}, + {"fileno", select_devpoll_fileno, METH_NOARGS, select_devpoll_fileno__doc__}, static PyObject * select_devpoll_fileno_impl(devpollObject *self); @@ -502,7 +502,7 @@ PyDoc_STRVAR(select_poll__doc__, "polling them for I/O events."); #define SELECT_POLL_METHODDEF \ - {"poll", (PyCFunction)select_poll, METH_NOARGS, select_poll__doc__}, + {"poll", select_poll, METH_NOARGS, select_poll__doc__}, static PyObject * select_poll_impl(PyObject *module); @@ -527,7 +527,7 @@ PyDoc_STRVAR(select_devpoll__doc__, "polling them for I/O events."); #define SELECT_DEVPOLL_METHODDEF \ - {"devpoll", (PyCFunction)select_devpoll, METH_NOARGS, select_devpoll__doc__}, + {"devpoll", select_devpoll, METH_NOARGS, select_devpoll__doc__}, static PyObject * select_devpoll_impl(PyObject *module); @@ -637,7 +637,7 @@ PyDoc_STRVAR(select_epoll_close__doc__, "Further operations on the epoll object will raise an exception."); #define SELECT_EPOLL_CLOSE_METHODDEF \ - {"close", (PyCFunction)select_epoll_close, METH_NOARGS, select_epoll_close__doc__}, + {"close", select_epoll_close, METH_NOARGS, select_epoll_close__doc__}, static PyObject * select_epoll_close_impl(pyEpoll_Object *self); @@ -665,7 +665,7 @@ PyDoc_STRVAR(select_epoll_fileno__doc__, "Return the epoll control file descriptor."); #define SELECT_EPOLL_FILENO_METHODDEF \ - {"fileno", (PyCFunction)select_epoll_fileno, METH_NOARGS, select_epoll_fileno__doc__}, + {"fileno", select_epoll_fileno, METH_NOARGS, select_epoll_fileno__doc__}, static PyObject * select_epoll_fileno_impl(pyEpoll_Object *self); @@ -687,7 +687,7 @@ PyDoc_STRVAR(select_epoll_fromfd__doc__, "Create an epoll object from a given control fd."); #define SELECT_EPOLL_FROMFD_METHODDEF \ - {"fromfd", (PyCFunction)select_epoll_fromfd, METH_O|METH_CLASS, select_epoll_fromfd__doc__}, + {"fromfd", select_epoll_fromfd, METH_O|METH_CLASS, select_epoll_fromfd__doc__}, static PyObject * select_epoll_fromfd_impl(PyTypeObject *type, int fd); @@ -1025,7 +1025,7 @@ PyDoc_STRVAR(select_epoll___enter____doc__, "\n"); #define SELECT_EPOLL___ENTER___METHODDEF \ - {"__enter__", (PyCFunction)select_epoll___enter__, METH_NOARGS, select_epoll___enter____doc__}, + {"__enter__", select_epoll___enter__, METH_NOARGS, select_epoll___enter____doc__}, static PyObject * select_epoll___enter___impl(pyEpoll_Object *self); @@ -1140,7 +1140,7 @@ PyDoc_STRVAR(select_kqueue_close__doc__, "Further operations on the kqueue object will raise an exception."); #define SELECT_KQUEUE_CLOSE_METHODDEF \ - {"close", (PyCFunction)select_kqueue_close, METH_NOARGS, select_kqueue_close__doc__}, + {"close", select_kqueue_close, METH_NOARGS, select_kqueue_close__doc__}, static PyObject * select_kqueue_close_impl(kqueue_queue_Object *self); @@ -1168,7 +1168,7 @@ PyDoc_STRVAR(select_kqueue_fileno__doc__, "Return the kqueue control file descriptor."); #define SELECT_KQUEUE_FILENO_METHODDEF \ - {"fileno", (PyCFunction)select_kqueue_fileno, METH_NOARGS, select_kqueue_fileno__doc__}, + {"fileno", select_kqueue_fileno, METH_NOARGS, select_kqueue_fileno__doc__}, static PyObject * select_kqueue_fileno_impl(kqueue_queue_Object *self); @@ -1190,7 +1190,7 @@ PyDoc_STRVAR(select_kqueue_fromfd__doc__, "Create a kqueue object from a given control fd."); #define SELECT_KQUEUE_FROMFD_METHODDEF \ - {"fromfd", (PyCFunction)select_kqueue_fromfd, METH_O|METH_CLASS, select_kqueue_fromfd__doc__}, + {"fromfd", select_kqueue_fromfd, METH_O|METH_CLASS, select_kqueue_fromfd__doc__}, static PyObject * select_kqueue_fromfd_impl(PyTypeObject *type, int fd); @@ -1365,4 +1365,4 @@ select_kqueue_control(PyObject *self, PyObject *const *args, Py_ssize_t nargs) #ifndef SELECT_KQUEUE_CONTROL_METHODDEF #define SELECT_KQUEUE_CONTROL_METHODDEF #endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */ -/*[clinic end generated code: output=60c3edb2745c9f33 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1a72074ea7c1b656 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index 792059d9b89bb2..1fd2a19974a00c 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -37,7 +37,7 @@ PyDoc_STRVAR(SHA1Type_digest__doc__, "Return the digest value as a bytes object."); #define SHA1TYPE_DIGEST_METHODDEF \ - {"digest", (PyCFunction)SHA1Type_digest, METH_NOARGS, SHA1Type_digest__doc__}, + {"digest", SHA1Type_digest, METH_NOARGS, SHA1Type_digest__doc__}, static PyObject * SHA1Type_digest_impl(SHA1object *self); @@ -55,7 +55,7 @@ PyDoc_STRVAR(SHA1Type_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define SHA1TYPE_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)SHA1Type_hexdigest, METH_NOARGS, SHA1Type_hexdigest__doc__}, + {"hexdigest", SHA1Type_hexdigest, METH_NOARGS, SHA1Type_hexdigest__doc__}, static PyObject * SHA1Type_hexdigest_impl(SHA1object *self); @@ -73,7 +73,7 @@ PyDoc_STRVAR(SHA1Type_update__doc__, "Update this hash object\'s state with the provided string."); #define SHA1TYPE_UPDATE_METHODDEF \ - {"update", (PyCFunction)SHA1Type_update, METH_O, SHA1Type_update__doc__}, + {"update", SHA1Type_update, METH_O, SHA1Type_update__doc__}, static PyObject * SHA1Type_update_impl(SHA1object *self, PyObject *obj); @@ -162,4 +162,4 @@ _sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * exit: return return_value; } -/*[clinic end generated code: output=3cfa7b6a9f99b5b2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a8844599cf058548 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha2module.c.h b/Modules/clinic/sha2module.c.h index 5e4b97b8ed3c1d..d776cbf0441af7 100644 --- a/Modules/clinic/sha2module.c.h +++ b/Modules/clinic/sha2module.c.h @@ -59,7 +59,7 @@ PyDoc_STRVAR(SHA256Type_digest__doc__, "Return the digest value as a bytes object."); #define SHA256TYPE_DIGEST_METHODDEF \ - {"digest", (PyCFunction)SHA256Type_digest, METH_NOARGS, SHA256Type_digest__doc__}, + {"digest", SHA256Type_digest, METH_NOARGS, SHA256Type_digest__doc__}, static PyObject * SHA256Type_digest_impl(SHA256object *self); @@ -77,7 +77,7 @@ PyDoc_STRVAR(SHA512Type_digest__doc__, "Return the digest value as a bytes object."); #define SHA512TYPE_DIGEST_METHODDEF \ - {"digest", (PyCFunction)SHA512Type_digest, METH_NOARGS, SHA512Type_digest__doc__}, + {"digest", SHA512Type_digest, METH_NOARGS, SHA512Type_digest__doc__}, static PyObject * SHA512Type_digest_impl(SHA512object *self); @@ -95,7 +95,7 @@ PyDoc_STRVAR(SHA256Type_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define SHA256TYPE_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)SHA256Type_hexdigest, METH_NOARGS, SHA256Type_hexdigest__doc__}, + {"hexdigest", SHA256Type_hexdigest, METH_NOARGS, SHA256Type_hexdigest__doc__}, static PyObject * SHA256Type_hexdigest_impl(SHA256object *self); @@ -113,7 +113,7 @@ PyDoc_STRVAR(SHA512Type_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define SHA512TYPE_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)SHA512Type_hexdigest, METH_NOARGS, SHA512Type_hexdigest__doc__}, + {"hexdigest", SHA512Type_hexdigest, METH_NOARGS, SHA512Type_hexdigest__doc__}, static PyObject * SHA512Type_hexdigest_impl(SHA512object *self); @@ -131,7 +131,7 @@ PyDoc_STRVAR(SHA256Type_update__doc__, "Update this hash object\'s state with the provided string."); #define SHA256TYPE_UPDATE_METHODDEF \ - {"update", (PyCFunction)SHA256Type_update, METH_O, SHA256Type_update__doc__}, + {"update", SHA256Type_update, METH_O, SHA256Type_update__doc__}, static PyObject * SHA256Type_update_impl(SHA256object *self, PyObject *obj); @@ -153,7 +153,7 @@ PyDoc_STRVAR(SHA512Type_update__doc__, "Update this hash object\'s state with the provided string."); #define SHA512TYPE_UPDATE_METHODDEF \ - {"update", (PyCFunction)SHA512Type_update, METH_O, SHA512Type_update__doc__}, + {"update", SHA512Type_update, METH_O, SHA512Type_update__doc__}, static PyObject * SHA512Type_update_impl(SHA512object *self, PyObject *obj); @@ -467,4 +467,4 @@ _sha2_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject exit: return return_value; } -/*[clinic end generated code: output=0c2eed5c77ec6987 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f056fc5485e0b4b4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha3module.c.h b/Modules/clinic/sha3module.c.h index 98d8f10a96ee48..2aa344eb8869c9 100644 --- a/Modules/clinic/sha3module.c.h +++ b/Modules/clinic/sha3module.c.h @@ -86,7 +86,7 @@ PyDoc_STRVAR(_sha3_sha3_224_copy__doc__, "Return a copy of the hash object."); #define _SHA3_SHA3_224_COPY_METHODDEF \ - {"copy", (PyCFunction)_sha3_sha3_224_copy, METH_NOARGS, _sha3_sha3_224_copy__doc__}, + {"copy", _sha3_sha3_224_copy, METH_NOARGS, _sha3_sha3_224_copy__doc__}, static PyObject * _sha3_sha3_224_copy_impl(SHA3object *self); @@ -104,7 +104,7 @@ PyDoc_STRVAR(_sha3_sha3_224_digest__doc__, "Return the digest value as a bytes object."); #define _SHA3_SHA3_224_DIGEST_METHODDEF \ - {"digest", (PyCFunction)_sha3_sha3_224_digest, METH_NOARGS, _sha3_sha3_224_digest__doc__}, + {"digest", _sha3_sha3_224_digest, METH_NOARGS, _sha3_sha3_224_digest__doc__}, static PyObject * _sha3_sha3_224_digest_impl(SHA3object *self); @@ -122,7 +122,7 @@ PyDoc_STRVAR(_sha3_sha3_224_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define _SHA3_SHA3_224_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)_sha3_sha3_224_hexdigest, METH_NOARGS, _sha3_sha3_224_hexdigest__doc__}, + {"hexdigest", _sha3_sha3_224_hexdigest, METH_NOARGS, _sha3_sha3_224_hexdigest__doc__}, static PyObject * _sha3_sha3_224_hexdigest_impl(SHA3object *self); @@ -140,7 +140,7 @@ PyDoc_STRVAR(_sha3_sha3_224_update__doc__, "Update this hash object\'s state with the provided bytes-like object."); #define _SHA3_SHA3_224_UPDATE_METHODDEF \ - {"update", (PyCFunction)_sha3_sha3_224_update, METH_O, _sha3_sha3_224_update__doc__}, + {"update", _sha3_sha3_224_update, METH_O, _sha3_sha3_224_update__doc__}, static PyObject * _sha3_sha3_224_update_impl(SHA3object *self, PyObject *data); @@ -162,7 +162,7 @@ PyDoc_STRVAR(_sha3_shake_128_digest__doc__, "Return the digest value as a bytes object."); #define _SHA3_SHAKE_128_DIGEST_METHODDEF \ - {"digest", (PyCFunction)_sha3_shake_128_digest, METH_O, _sha3_shake_128_digest__doc__}, + {"digest", _sha3_shake_128_digest, METH_O, _sha3_shake_128_digest__doc__}, static PyObject * _sha3_shake_128_digest_impl(SHA3object *self, unsigned long length); @@ -189,7 +189,7 @@ PyDoc_STRVAR(_sha3_shake_128_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define _SHA3_SHAKE_128_HEXDIGEST_METHODDEF \ - {"hexdigest", (PyCFunction)_sha3_shake_128_hexdigest, METH_O, _sha3_shake_128_hexdigest__doc__}, + {"hexdigest", _sha3_shake_128_hexdigest, METH_O, _sha3_shake_128_hexdigest__doc__}, static PyObject * _sha3_shake_128_hexdigest_impl(SHA3object *self, unsigned long length); @@ -208,4 +208,4 @@ _sha3_shake_128_hexdigest(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=437023d9eac08551 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dc7dfb8a3a529719 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index dd8da456ce08ce..9e3d72fc8755c6 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -53,7 +53,7 @@ PyDoc_STRVAR(signal_alarm__doc__, "Arrange for SIGALRM to arrive after the given number of seconds."); #define SIGNAL_ALARM_METHODDEF \ - {"alarm", (PyCFunction)signal_alarm, METH_O, signal_alarm__doc__}, + {"alarm", signal_alarm, METH_O, signal_alarm__doc__}, static long signal_alarm_impl(PyObject *module, int seconds); @@ -90,7 +90,7 @@ PyDoc_STRVAR(signal_pause__doc__, "Wait until a signal arrives."); #define SIGNAL_PAUSE_METHODDEF \ - {"pause", (PyCFunction)signal_pause, METH_NOARGS, signal_pause__doc__}, + {"pause", signal_pause, METH_NOARGS, signal_pause__doc__}, static PyObject * signal_pause_impl(PyObject *module); @@ -110,7 +110,7 @@ PyDoc_STRVAR(signal_raise_signal__doc__, "Send a signal to the executing process."); #define SIGNAL_RAISE_SIGNAL_METHODDEF \ - {"raise_signal", (PyCFunction)signal_raise_signal, METH_O, signal_raise_signal__doc__}, + {"raise_signal", signal_raise_signal, METH_O, signal_raise_signal__doc__}, static PyObject * signal_raise_signal_impl(PyObject *module, int signalnum); @@ -184,7 +184,7 @@ PyDoc_STRVAR(signal_getsignal__doc__, " anything else -- the callable Python object used as a handler"); #define SIGNAL_GETSIGNAL_METHODDEF \ - {"getsignal", (PyCFunction)signal_getsignal, METH_O, signal_getsignal__doc__}, + {"getsignal", signal_getsignal, METH_O, signal_getsignal__doc__}, static PyObject * signal_getsignal_impl(PyObject *module, int signalnum); @@ -216,7 +216,7 @@ PyDoc_STRVAR(signal_strsignal__doc__, "description. Raises :exc:`ValueError` if *signalnum* is invalid."); #define SIGNAL_STRSIGNAL_METHODDEF \ - {"strsignal", (PyCFunction)signal_strsignal, METH_O, signal_strsignal__doc__}, + {"strsignal", signal_strsignal, METH_O, signal_strsignal__doc__}, static PyObject * signal_strsignal_impl(PyObject *module, int signalnum); @@ -410,7 +410,7 @@ PyDoc_STRVAR(signal_getitimer__doc__, "Returns current value of given itimer."); #define SIGNAL_GETITIMER_METHODDEF \ - {"getitimer", (PyCFunction)signal_getitimer, METH_O, signal_getitimer__doc__}, + {"getitimer", signal_getitimer, METH_O, signal_getitimer__doc__}, static PyObject * signal_getitimer_impl(PyObject *module, int which); @@ -484,7 +484,7 @@ PyDoc_STRVAR(signal_sigpending__doc__, "the calling thread."); #define SIGNAL_SIGPENDING_METHODDEF \ - {"sigpending", (PyCFunction)signal_sigpending, METH_NOARGS, signal_sigpending__doc__}, + {"sigpending", signal_sigpending, METH_NOARGS, signal_sigpending__doc__}, static PyObject * signal_sigpending_impl(PyObject *module); @@ -510,7 +510,7 @@ PyDoc_STRVAR(signal_sigwait__doc__, "and returns the signal number."); #define SIGNAL_SIGWAIT_METHODDEF \ - {"sigwait", (PyCFunction)signal_sigwait, METH_O, signal_sigwait__doc__}, + {"sigwait", signal_sigwait, METH_O, signal_sigwait__doc__}, static PyObject * signal_sigwait_impl(PyObject *module, sigset_t sigset); @@ -544,7 +544,7 @@ PyDoc_STRVAR(signal_valid_signals__doc__, "functions like `pthread_sigmask`."); #define SIGNAL_VALID_SIGNALS_METHODDEF \ - {"valid_signals", (PyCFunction)signal_valid_signals, METH_NOARGS, signal_valid_signals__doc__}, + {"valid_signals", signal_valid_signals, METH_NOARGS, signal_valid_signals__doc__}, static PyObject * signal_valid_signals_impl(PyObject *module); @@ -568,7 +568,7 @@ PyDoc_STRVAR(signal_sigwaitinfo__doc__, "Returns a struct_siginfo containing information about the signal."); #define SIGNAL_SIGWAITINFO_METHODDEF \ - {"sigwaitinfo", (PyCFunction)signal_sigwaitinfo, METH_O, signal_sigwaitinfo__doc__}, + {"sigwaitinfo", signal_sigwaitinfo, METH_O, signal_sigwaitinfo__doc__}, static PyObject * signal_sigwaitinfo_impl(PyObject *module, sigset_t sigset); @@ -777,4 +777,4 @@ signal_pidfd_send_signal(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF #define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF #endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */ -/*[clinic end generated code: output=356e1acc44a4f377 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=86c4efb878e7f49d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/socketmodule.c.h b/Modules/clinic/socketmodule.c.h index dc62c4290d3e3b..a4921edd751b7a 100644 --- a/Modules/clinic/socketmodule.c.h +++ b/Modules/clinic/socketmodule.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(_socket_socket_close__doc__, "Close the socket. It cannot be used after this call."); #define _SOCKET_SOCKET_CLOSE_METHODDEF \ - {"close", (PyCFunction)_socket_socket_close, METH_NOARGS, _socket_socket_close__doc__}, + {"close", _socket_socket_close, METH_NOARGS, _socket_socket_close__doc__}, static PyObject * _socket_socket_close_impl(PySocketSockObject *s); @@ -120,7 +120,7 @@ PyDoc_STRVAR(_socket_socket_ntohs__doc__, "Convert a 16-bit unsigned integer from network to host byte order."); #define _SOCKET_SOCKET_NTOHS_METHODDEF \ - {"ntohs", (PyCFunction)_socket_socket_ntohs, METH_O, _socket_socket_ntohs__doc__}, + {"ntohs", _socket_socket_ntohs, METH_O, _socket_socket_ntohs__doc__}, static PyObject * _socket_socket_ntohs_impl(PySocketSockObject *self, int x); @@ -148,7 +148,7 @@ PyDoc_STRVAR(_socket_socket_htons__doc__, "Convert a 16-bit unsigned integer from host to network byte order."); #define _SOCKET_SOCKET_HTONS_METHODDEF \ - {"htons", (PyCFunction)_socket_socket_htons, METH_O, _socket_socket_htons__doc__}, + {"htons", _socket_socket_htons, METH_O, _socket_socket_htons__doc__}, static PyObject * _socket_socket_htons_impl(PySocketSockObject *self, int x); @@ -176,7 +176,7 @@ PyDoc_STRVAR(_socket_socket_inet_aton__doc__, "Convert an IP address in string format (123.45.67.89) to the 32-bit packed binary format used in low-level network functions."); #define _SOCKET_SOCKET_INET_ATON_METHODDEF \ - {"inet_aton", (PyCFunction)_socket_socket_inet_aton, METH_O, _socket_socket_inet_aton__doc__}, + {"inet_aton", _socket_socket_inet_aton, METH_O, _socket_socket_inet_aton__doc__}, static PyObject * _socket_socket_inet_aton_impl(PySocketSockObject *self, const char *ip_addr); @@ -215,7 +215,7 @@ PyDoc_STRVAR(_socket_socket_inet_ntoa__doc__, "Convert an IP address from 32-bit packed binary format to string format."); #define _SOCKET_SOCKET_INET_NTOA_METHODDEF \ - {"inet_ntoa", (PyCFunction)_socket_socket_inet_ntoa, METH_O, _socket_socket_inet_ntoa__doc__}, + {"inet_ntoa", _socket_socket_inet_ntoa, METH_O, _socket_socket_inet_ntoa__doc__}, static PyObject * _socket_socket_inet_ntoa_impl(PySocketSockObject *self, Py_buffer *packed_ip); @@ -251,7 +251,7 @@ PyDoc_STRVAR(_socket_socket_if_nametoindex__doc__, "Returns the interface index corresponding to the interface name if_name."); #define _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF \ - {"if_nametoindex", (PyCFunction)_socket_socket_if_nametoindex, METH_O, _socket_socket_if_nametoindex__doc__}, + {"if_nametoindex", _socket_socket_if_nametoindex, METH_O, _socket_socket_if_nametoindex__doc__}, static PyObject * _socket_socket_if_nametoindex_impl(PySocketSockObject *self, PyObject *oname); @@ -280,4 +280,4 @@ _socket_socket_if_nametoindex(PyObject *self, PyObject *arg) #ifndef _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF #define _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF #endif /* !defined(_SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF) */ -/*[clinic end generated code: output=d39efc30d811e74b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bd2b487f6158be18 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/syslogmodule.c.h b/Modules/clinic/syslogmodule.c.h index 7c3fcd64191500..a6779afc206e5a 100644 --- a/Modules/clinic/syslogmodule.c.h +++ b/Modules/clinic/syslogmodule.c.h @@ -103,7 +103,7 @@ PyDoc_STRVAR(syslog_syslog__doc__, "Send the string message to the system logger."); #define SYSLOG_SYSLOG_METHODDEF \ - {"syslog", (PyCFunction)syslog_syslog, METH_VARARGS, syslog_syslog__doc__}, + {"syslog", syslog_syslog, METH_VARARGS, syslog_syslog__doc__}, static PyObject * syslog_syslog_impl(PyObject *module, int group_left_1, int priority, @@ -148,7 +148,7 @@ PyDoc_STRVAR(syslog_closelog__doc__, "Reset the syslog module values and call the system library closelog()."); #define SYSLOG_CLOSELOG_METHODDEF \ - {"closelog", (PyCFunction)syslog_closelog, METH_NOARGS, syslog_closelog__doc__}, + {"closelog", syslog_closelog, METH_NOARGS, syslog_closelog__doc__}, static PyObject * syslog_closelog_impl(PyObject *module); @@ -172,7 +172,7 @@ PyDoc_STRVAR(syslog_setlogmask__doc__, "Set the priority mask to maskpri and return the previous mask value."); #define SYSLOG_SETLOGMASK_METHODDEF \ - {"setlogmask", (PyCFunction)syslog_setlogmask, METH_O, syslog_setlogmask__doc__}, + {"setlogmask", syslog_setlogmask, METH_O, syslog_setlogmask__doc__}, static long syslog_setlogmask_impl(PyObject *module, long maskpri); @@ -205,7 +205,7 @@ PyDoc_STRVAR(syslog_LOG_MASK__doc__, "Calculates the mask for the individual priority pri."); #define SYSLOG_LOG_MASK_METHODDEF \ - {"LOG_MASK", (PyCFunction)syslog_LOG_MASK, METH_O, syslog_LOG_MASK__doc__}, + {"LOG_MASK", syslog_LOG_MASK, METH_O, syslog_LOG_MASK__doc__}, static long syslog_LOG_MASK_impl(PyObject *module, long pri); @@ -238,7 +238,7 @@ PyDoc_STRVAR(syslog_LOG_UPTO__doc__, "Calculates the mask for all priorities up to and including pri."); #define SYSLOG_LOG_UPTO_METHODDEF \ - {"LOG_UPTO", (PyCFunction)syslog_LOG_UPTO, METH_O, syslog_LOG_UPTO__doc__}, + {"LOG_UPTO", syslog_LOG_UPTO, METH_O, syslog_LOG_UPTO__doc__}, static long syslog_LOG_UPTO_impl(PyObject *module, long pri); @@ -263,4 +263,4 @@ syslog_LOG_UPTO(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=f867a4f7a9267de1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f3101e6b4c13a76f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/termios.c.h b/Modules/clinic/termios.c.h index 83f5a4f6e9f882..c1e202465ab7bc 100644 --- a/Modules/clinic/termios.c.h +++ b/Modules/clinic/termios.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(termios_tcgetattr__doc__, "done using the symbolic constants defined in this module."); #define TERMIOS_TCGETATTR_METHODDEF \ - {"tcgetattr", (PyCFunction)termios_tcgetattr, METH_O, termios_tcgetattr__doc__}, + {"tcgetattr", termios_tcgetattr, METH_O, termios_tcgetattr__doc__}, static PyObject * termios_tcgetattr_impl(PyObject *module, int fd); @@ -130,7 +130,7 @@ PyDoc_STRVAR(termios_tcdrain__doc__, "Wait until all output written to file descriptor fd has been transmitted."); #define TERMIOS_TCDRAIN_METHODDEF \ - {"tcdrain", (PyCFunction)termios_tcdrain, METH_O, termios_tcdrain__doc__}, + {"tcdrain", termios_tcdrain, METH_O, termios_tcdrain__doc__}, static PyObject * termios_tcdrain_impl(PyObject *module, int fd); @@ -242,7 +242,7 @@ PyDoc_STRVAR(termios_tcgetwinsize__doc__, "Returns a tuple (ws_row, ws_col)."); #define TERMIOS_TCGETWINSIZE_METHODDEF \ - {"tcgetwinsize", (PyCFunction)termios_tcgetwinsize, METH_O, termios_tcgetwinsize__doc__}, + {"tcgetwinsize", termios_tcgetwinsize, METH_O, termios_tcgetwinsize__doc__}, static PyObject * termios_tcgetwinsize_impl(PyObject *module, int fd); @@ -299,4 +299,4 @@ termios_tcsetwinsize(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=c6c6192583b0da36 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2ee49d5de55b30c6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/timemodule.c.h b/Modules/clinic/timemodule.c.h index bbc0748f9a9c0d..09717c2176c3bd 100644 --- a/Modules/clinic/timemodule.c.h +++ b/Modules/clinic/timemodule.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(time_clock_gettime__doc__, "Return the time of the specified clock clk_id as a float."); #define TIME_CLOCK_GETTIME_METHODDEF \ - {"clock_gettime", (PyCFunction)time_clock_gettime, METH_O, time_clock_gettime__doc__}, + {"clock_gettime", time_clock_gettime, METH_O, time_clock_gettime__doc__}, static PyObject * time_clock_gettime_impl(PyObject *module, clockid_t clk_id); @@ -42,7 +42,7 @@ PyDoc_STRVAR(time_clock_gettime_ns__doc__, "Return the time of the specified clock clk_id as nanoseconds (int)."); #define TIME_CLOCK_GETTIME_NS_METHODDEF \ - {"clock_gettime_ns", (PyCFunction)time_clock_gettime_ns, METH_O, time_clock_gettime_ns__doc__}, + {"clock_gettime_ns", time_clock_gettime_ns, METH_O, time_clock_gettime_ns__doc__}, static PyObject * time_clock_gettime_ns_impl(PyObject *module, clockid_t clk_id); @@ -71,4 +71,4 @@ time_clock_gettime_ns(PyObject *module, PyObject *arg) #ifndef TIME_CLOCK_GETTIME_NS_METHODDEF #define TIME_CLOCK_GETTIME_NS_METHODDEF #endif /* !defined(TIME_CLOCK_GETTIME_NS_METHODDEF) */ -/*[clinic end generated code: output=b589a2132aa9df47 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0a5e10de8e92d3da input=a9049054013a1b77]*/ diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h index 345440eeee89a6..d77e577b781167 100644 --- a/Modules/clinic/unicodedata.c.h +++ b/Modules/clinic/unicodedata.c.h @@ -160,7 +160,7 @@ PyDoc_STRVAR(unicodedata_UCD_category__doc__, "Returns the general category assigned to the character chr as string."); #define UNICODEDATA_UCD_CATEGORY_METHODDEF \ - {"category", (PyCFunction)unicodedata_UCD_category, METH_O, unicodedata_UCD_category__doc__}, + {"category", unicodedata_UCD_category, METH_O, unicodedata_UCD_category__doc__}, static PyObject * unicodedata_UCD_category_impl(PyObject *self, int chr); @@ -198,7 +198,7 @@ PyDoc_STRVAR(unicodedata_UCD_bidirectional__doc__, "If no such value is defined, an empty string is returned."); #define UNICODEDATA_UCD_BIDIRECTIONAL_METHODDEF \ - {"bidirectional", (PyCFunction)unicodedata_UCD_bidirectional, METH_O, unicodedata_UCD_bidirectional__doc__}, + {"bidirectional", unicodedata_UCD_bidirectional, METH_O, unicodedata_UCD_bidirectional__doc__}, static PyObject * unicodedata_UCD_bidirectional_impl(PyObject *self, int chr); @@ -236,7 +236,7 @@ PyDoc_STRVAR(unicodedata_UCD_combining__doc__, "Returns 0 if no combining class is defined."); #define UNICODEDATA_UCD_COMBINING_METHODDEF \ - {"combining", (PyCFunction)unicodedata_UCD_combining, METH_O, unicodedata_UCD_combining__doc__}, + {"combining", unicodedata_UCD_combining, METH_O, unicodedata_UCD_combining__doc__}, static int unicodedata_UCD_combining_impl(PyObject *self, int chr); @@ -280,7 +280,7 @@ PyDoc_STRVAR(unicodedata_UCD_mirrored__doc__, "character in bidirectional text, 0 otherwise."); #define UNICODEDATA_UCD_MIRRORED_METHODDEF \ - {"mirrored", (PyCFunction)unicodedata_UCD_mirrored, METH_O, unicodedata_UCD_mirrored__doc__}, + {"mirrored", unicodedata_UCD_mirrored, METH_O, unicodedata_UCD_mirrored__doc__}, static int unicodedata_UCD_mirrored_impl(PyObject *self, int chr); @@ -321,7 +321,7 @@ PyDoc_STRVAR(unicodedata_UCD_east_asian_width__doc__, "Returns the east asian width assigned to the character chr as string."); #define UNICODEDATA_UCD_EAST_ASIAN_WIDTH_METHODDEF \ - {"east_asian_width", (PyCFunction)unicodedata_UCD_east_asian_width, METH_O, unicodedata_UCD_east_asian_width__doc__}, + {"east_asian_width", unicodedata_UCD_east_asian_width, METH_O, unicodedata_UCD_east_asian_width__doc__}, static PyObject * unicodedata_UCD_east_asian_width_impl(PyObject *self, int chr); @@ -359,7 +359,7 @@ PyDoc_STRVAR(unicodedata_UCD_decomposition__doc__, "An empty string is returned in case no such mapping is defined."); #define UNICODEDATA_UCD_DECOMPOSITION_METHODDEF \ - {"decomposition", (PyCFunction)unicodedata_UCD_decomposition, METH_O, unicodedata_UCD_decomposition__doc__}, + {"decomposition", unicodedata_UCD_decomposition, METH_O, unicodedata_UCD_decomposition__doc__}, static PyObject * unicodedata_UCD_decomposition_impl(PyObject *self, int chr); @@ -528,7 +528,7 @@ PyDoc_STRVAR(unicodedata_UCD_lookup__doc__, "corresponding character. If not found, KeyError is raised."); #define UNICODEDATA_UCD_LOOKUP_METHODDEF \ - {"lookup", (PyCFunction)unicodedata_UCD_lookup, METH_O, unicodedata_UCD_lookup__doc__}, + {"lookup", unicodedata_UCD_lookup, METH_O, unicodedata_UCD_lookup__doc__}, static PyObject * unicodedata_UCD_lookup_impl(PyObject *self, const char *name, @@ -549,4 +549,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=8a59d430cee41058 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=21e9a48655bd516f input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index 262438f830a9ad..9837ccb6086a28 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -214,7 +214,7 @@ PyDoc_STRVAR(bytearray_clear__doc__, "Remove all items from the bytearray."); #define BYTEARRAY_CLEAR_METHODDEF \ - {"clear", (PyCFunction)bytearray_clear, METH_NOARGS, bytearray_clear__doc__}, + {"clear", bytearray_clear, METH_NOARGS, bytearray_clear__doc__}, static PyObject * bytearray_clear_impl(PyByteArrayObject *self); @@ -232,7 +232,7 @@ PyDoc_STRVAR(bytearray_copy__doc__, "Return a copy of B."); #define BYTEARRAY_COPY_METHODDEF \ - {"copy", (PyCFunction)bytearray_copy, METH_NOARGS, bytearray_copy__doc__}, + {"copy", bytearray_copy, METH_NOARGS, bytearray_copy__doc__}, static PyObject * bytearray_copy_impl(PyByteArrayObject *self); @@ -525,7 +525,7 @@ PyDoc_STRVAR(bytearray_removeprefix__doc__, "bytearray."); #define BYTEARRAY_REMOVEPREFIX_METHODDEF \ - {"removeprefix", (PyCFunction)bytearray_removeprefix, METH_O, bytearray_removeprefix__doc__}, + {"removeprefix", bytearray_removeprefix, METH_O, bytearray_removeprefix__doc__}, static PyObject * bytearray_removeprefix_impl(PyByteArrayObject *self, Py_buffer *prefix); @@ -563,7 +563,7 @@ PyDoc_STRVAR(bytearray_removesuffix__doc__, "the original bytearray."); #define BYTEARRAY_REMOVESUFFIX_METHODDEF \ - {"removesuffix", (PyCFunction)bytearray_removesuffix, METH_O, bytearray_removesuffix__doc__}, + {"removesuffix", bytearray_removesuffix, METH_O, bytearray_removesuffix__doc__}, static PyObject * bytearray_removesuffix_impl(PyByteArrayObject *self, Py_buffer *suffix); @@ -600,7 +600,7 @@ PyDoc_STRVAR(bytearray_resize__doc__, " New size to resize to.."); #define BYTEARRAY_RESIZE_METHODDEF \ - {"resize", (PyCFunction)bytearray_resize, METH_O, bytearray_resize__doc__}, + {"resize", bytearray_resize, METH_O, bytearray_resize__doc__}, static PyObject * bytearray_resize_impl(PyByteArrayObject *self, Py_ssize_t size); @@ -923,7 +923,7 @@ PyDoc_STRVAR(bytearray_partition__doc__, "original bytearray object and two empty bytearray objects."); #define BYTEARRAY_PARTITION_METHODDEF \ - {"partition", (PyCFunction)bytearray_partition, METH_O, bytearray_partition__doc__}, + {"partition", bytearray_partition, METH_O, bytearray_partition__doc__}, static PyObject * bytearray_partition_impl(PyByteArrayObject *self, PyObject *sep); @@ -955,7 +955,7 @@ PyDoc_STRVAR(bytearray_rpartition__doc__, "objects and the copy of the original bytearray object."); #define BYTEARRAY_RPARTITION_METHODDEF \ - {"rpartition", (PyCFunction)bytearray_rpartition, METH_O, bytearray_rpartition__doc__}, + {"rpartition", bytearray_rpartition, METH_O, bytearray_rpartition__doc__}, static PyObject * bytearray_rpartition_impl(PyByteArrayObject *self, PyObject *sep); @@ -1071,7 +1071,7 @@ PyDoc_STRVAR(bytearray_reverse__doc__, "Reverse the order of the values in B in place."); #define BYTEARRAY_REVERSE_METHODDEF \ - {"reverse", (PyCFunction)bytearray_reverse, METH_NOARGS, bytearray_reverse__doc__}, + {"reverse", bytearray_reverse, METH_NOARGS, bytearray_reverse__doc__}, static PyObject * bytearray_reverse_impl(PyByteArrayObject *self); @@ -1148,7 +1148,7 @@ PyDoc_STRVAR(bytearray_append__doc__, " The item to be appended."); #define BYTEARRAY_APPEND_METHODDEF \ - {"append", (PyCFunction)bytearray_append, METH_O, bytearray_append__doc__}, + {"append", bytearray_append, METH_O, bytearray_append__doc__}, static PyObject * bytearray_append_impl(PyByteArrayObject *self, int item); @@ -1180,7 +1180,7 @@ PyDoc_STRVAR(bytearray_extend__doc__, " The iterable of items to append."); #define BYTEARRAY_EXTEND_METHODDEF \ - {"extend", (PyCFunction)bytearray_extend, METH_O, bytearray_extend__doc__}, + {"extend", bytearray_extend, METH_O, bytearray_extend__doc__}, static PyObject * bytearray_extend_impl(PyByteArrayObject *self, PyObject *iterable_of_ints); @@ -1258,7 +1258,7 @@ PyDoc_STRVAR(bytearray_remove__doc__, " The value to remove."); #define BYTEARRAY_REMOVE_METHODDEF \ - {"remove", (PyCFunction)bytearray_remove, METH_O, bytearray_remove__doc__}, + {"remove", bytearray_remove, METH_O, bytearray_remove__doc__}, static PyObject * bytearray_remove_impl(PyByteArrayObject *self, int value); @@ -1503,7 +1503,7 @@ PyDoc_STRVAR(bytearray_join__doc__, "The result is returned as a new bytearray object."); #define BYTEARRAY_JOIN_METHODDEF \ - {"join", (PyCFunction)bytearray_join, METH_O, bytearray_join__doc__}, + {"join", bytearray_join, METH_O, bytearray_join__doc__}, static PyObject * bytearray_join_impl(PyByteArrayObject *self, PyObject *iterable_of_bytes); @@ -1599,7 +1599,7 @@ PyDoc_STRVAR(bytearray_fromhex__doc__, "Example: bytearray.fromhex(\'B9 01EF\') -> bytearray(b\'\\\\xb9\\\\x01\\\\xef\')"); #define BYTEARRAY_FROMHEX_METHODDEF \ - {"fromhex", (PyCFunction)bytearray_fromhex, METH_O|METH_CLASS, bytearray_fromhex__doc__}, + {"fromhex", bytearray_fromhex, METH_O|METH_CLASS, bytearray_fromhex__doc__}, static PyObject * bytearray_fromhex_impl(PyTypeObject *type, PyObject *string); @@ -1711,7 +1711,7 @@ PyDoc_STRVAR(bytearray_reduce__doc__, "Return state information for pickling."); #define BYTEARRAY_REDUCE_METHODDEF \ - {"__reduce__", (PyCFunction)bytearray_reduce, METH_NOARGS, bytearray_reduce__doc__}, + {"__reduce__", bytearray_reduce, METH_NOARGS, bytearray_reduce__doc__}, static PyObject * bytearray_reduce_impl(PyByteArrayObject *self); @@ -1772,7 +1772,7 @@ PyDoc_STRVAR(bytearray_sizeof__doc__, "Returns the size of the bytearray object in memory, in bytes."); #define BYTEARRAY_SIZEOF_METHODDEF \ - {"__sizeof__", (PyCFunction)bytearray_sizeof, METH_NOARGS, bytearray_sizeof__doc__}, + {"__sizeof__", bytearray_sizeof, METH_NOARGS, bytearray_sizeof__doc__}, static PyObject * bytearray_sizeof_impl(PyByteArrayObject *self); @@ -1782,4 +1782,4 @@ bytearray_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl((PyByteArrayObject *)self); } -/*[clinic end generated code: output=0d1d1abc8b701ad9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8d5aaf1f23292613 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index f1f16de0c8af54..d55458dec7b839 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(bytes___bytes____doc__, "Convert this value to exact type bytes."); #define BYTES___BYTES___METHODDEF \ - {"__bytes__", (PyCFunction)bytes___bytes__, METH_NOARGS, bytes___bytes____doc__}, + {"__bytes__", bytes___bytes__, METH_NOARGS, bytes___bytes____doc__}, static PyObject * bytes___bytes___impl(PyBytesObject *self); @@ -128,7 +128,7 @@ PyDoc_STRVAR(bytes_partition__doc__, "object and two empty bytes objects."); #define BYTES_PARTITION_METHODDEF \ - {"partition", (PyCFunction)bytes_partition, METH_O, bytes_partition__doc__}, + {"partition", bytes_partition, METH_O, bytes_partition__doc__}, static PyObject * bytes_partition_impl(PyBytesObject *self, Py_buffer *sep); @@ -167,7 +167,7 @@ PyDoc_STRVAR(bytes_rpartition__doc__, "objects and the original bytes object."); #define BYTES_RPARTITION_METHODDEF \ - {"rpartition", (PyCFunction)bytes_rpartition, METH_O, bytes_rpartition__doc__}, + {"rpartition", bytes_rpartition, METH_O, bytes_rpartition__doc__}, static PyObject * bytes_rpartition_impl(PyBytesObject *self, Py_buffer *sep); @@ -294,7 +294,7 @@ PyDoc_STRVAR(bytes_join__doc__, "Example: b\'.\'.join([b\'ab\', b\'pq\', b\'rs\']) -> b\'ab.pq.rs\'."); #define BYTES_JOIN_METHODDEF \ - {"join", (PyCFunction)bytes_join, METH_O, bytes_join__doc__}, + {"join", bytes_join, METH_O, bytes_join__doc__}, static PyObject * bytes_join_impl(PyBytesObject *self, PyObject *iterable_of_bytes); @@ -860,7 +860,7 @@ PyDoc_STRVAR(bytes_removeprefix__doc__, "Otherwise, return a copy of the original bytes."); #define BYTES_REMOVEPREFIX_METHODDEF \ - {"removeprefix", (PyCFunction)bytes_removeprefix, METH_O, bytes_removeprefix__doc__}, + {"removeprefix", bytes_removeprefix, METH_O, bytes_removeprefix__doc__}, static PyObject * bytes_removeprefix_impl(PyBytesObject *self, Py_buffer *prefix); @@ -896,7 +896,7 @@ PyDoc_STRVAR(bytes_removesuffix__doc__, "bytes."); #define BYTES_REMOVESUFFIX_METHODDEF \ - {"removesuffix", (PyCFunction)bytes_removesuffix, METH_O, bytes_removesuffix__doc__}, + {"removesuffix", bytes_removesuffix, METH_O, bytes_removesuffix__doc__}, static PyObject * bytes_removesuffix_impl(PyBytesObject *self, Py_buffer *suffix); @@ -1202,7 +1202,7 @@ PyDoc_STRVAR(bytes_fromhex__doc__, "Example: bytes.fromhex(\'B9 01EF\') -> b\'\\\\xb9\\\\x01\\\\xef\'."); #define BYTES_FROMHEX_METHODDEF \ - {"fromhex", (PyCFunction)bytes_fromhex, METH_O|METH_CLASS, bytes_fromhex__doc__}, + {"fromhex", bytes_fromhex, METH_O|METH_CLASS, bytes_fromhex__doc__}, static PyObject * bytes_fromhex_impl(PyTypeObject *type, PyObject *string); @@ -1397,4 +1397,4 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=c607024162df3ea8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1ad32b60503522c2 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/classobject.c.h b/Objects/clinic/classobject.c.h index 5934f1c2a41669..f74fefc66fb8e3 100644 --- a/Objects/clinic/classobject.c.h +++ b/Objects/clinic/classobject.c.h @@ -10,7 +10,7 @@ PyDoc_STRVAR(method___reduce____doc__, "\n"); #define METHOD___REDUCE___METHODDEF \ - {"__reduce__", (PyCFunction)method___reduce__, METH_NOARGS, method___reduce____doc__}, + {"__reduce__", method___reduce__, METH_NOARGS, method___reduce____doc__}, static PyObject * method___reduce___impl(PyMethodObject *self); @@ -82,4 +82,4 @@ instancemethod_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=ab546abf90aac94e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bebe7e84ba161657 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/complexobject.c.h b/Objects/clinic/complexobject.c.h index 2988664317eede..c72c63a61eebca 100644 --- a/Objects/clinic/complexobject.c.h +++ b/Objects/clinic/complexobject.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(complex_conjugate__doc__, "Return the complex conjugate of its argument. (3-4j).conjugate() == 3+4j."); #define COMPLEX_CONJUGATE_METHODDEF \ - {"conjugate", (PyCFunction)complex_conjugate, METH_NOARGS, complex_conjugate__doc__}, + {"conjugate", complex_conjugate, METH_NOARGS, complex_conjugate__doc__}, static PyObject * complex_conjugate_impl(PyComplexObject *self); @@ -32,7 +32,7 @@ PyDoc_STRVAR(complex___getnewargs____doc__, "\n"); #define COMPLEX___GETNEWARGS___METHODDEF \ - {"__getnewargs__", (PyCFunction)complex___getnewargs__, METH_NOARGS, complex___getnewargs____doc__}, + {"__getnewargs__", complex___getnewargs__, METH_NOARGS, complex___getnewargs____doc__}, static PyObject * complex___getnewargs___impl(PyComplexObject *self); @@ -50,7 +50,7 @@ PyDoc_STRVAR(complex___format____doc__, "Convert to a string according to format_spec."); #define COMPLEX___FORMAT___METHODDEF \ - {"__format__", (PyCFunction)complex___format__, METH_O, complex___format____doc__}, + {"__format__", complex___format__, METH_O, complex___format____doc__}, static PyObject * complex___format___impl(PyComplexObject *self, PyObject *format_spec); @@ -79,7 +79,7 @@ PyDoc_STRVAR(complex___complex____doc__, "Convert this value to exact type complex."); #define COMPLEX___COMPLEX___METHODDEF \ - {"__complex__", (PyCFunction)complex___complex__, METH_NOARGS, complex___complex____doc__}, + {"__complex__", complex___complex__, METH_NOARGS, complex___complex____doc__}, static PyObject * complex___complex___impl(PyComplexObject *self); @@ -169,7 +169,7 @@ PyDoc_STRVAR(complex_from_number__doc__, "Convert number to a complex floating-point number."); #define COMPLEX_FROM_NUMBER_METHODDEF \ - {"from_number", (PyCFunction)complex_from_number, METH_O|METH_CLASS, complex_from_number__doc__}, + {"from_number", complex_from_number, METH_O|METH_CLASS, complex_from_number__doc__}, static PyObject * complex_from_number_impl(PyTypeObject *type, PyObject *number); @@ -183,4 +183,4 @@ complex_from_number(PyObject *type, PyObject *number) return return_value; } -/*[clinic end generated code: output=307531cd6d6e7544 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=46767f8412462a4e input=a9049054013a1b77]*/ diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h index abf6b38449fcb0..aa0e84af416e2e 100644 --- a/Objects/clinic/dictobject.c.h +++ b/Objects/clinic/dictobject.c.h @@ -46,7 +46,7 @@ PyDoc_STRVAR(dict_copy__doc__, "Return a shallow copy of the dict."); #define DICT_COPY_METHODDEF \ - {"copy", (PyCFunction)dict_copy, METH_NOARGS, dict_copy__doc__}, + {"copy", dict_copy, METH_NOARGS, dict_copy__doc__}, static PyObject * dict_copy_impl(PyDictObject *self); @@ -64,7 +64,7 @@ PyDoc_STRVAR(dict___contains____doc__, "True if the dictionary has the specified key, else False."); #define DICT___CONTAINS___METHODDEF \ - {"__contains__", (PyCFunction)dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__}, + {"__contains__", dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__}, static PyObject * dict___contains___impl(PyDictObject *self, PyObject *key); @@ -159,7 +159,7 @@ PyDoc_STRVAR(dict_clear__doc__, "Remove all items from the dict."); #define DICT_CLEAR_METHODDEF \ - {"clear", (PyCFunction)dict_clear, METH_NOARGS, dict_clear__doc__}, + {"clear", dict_clear, METH_NOARGS, dict_clear__doc__}, static PyObject * dict_clear_impl(PyDictObject *self); @@ -217,7 +217,7 @@ PyDoc_STRVAR(dict_popitem__doc__, "Raises KeyError if the dict is empty."); #define DICT_POPITEM_METHODDEF \ - {"popitem", (PyCFunction)dict_popitem, METH_NOARGS, dict_popitem__doc__}, + {"popitem", dict_popitem, METH_NOARGS, dict_popitem__doc__}, static PyObject * dict_popitem_impl(PyDictObject *self); @@ -241,7 +241,7 @@ PyDoc_STRVAR(dict___sizeof____doc__, "Return the size of the dict in memory, in bytes."); #define DICT___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)dict___sizeof__, METH_NOARGS, dict___sizeof____doc__}, + {"__sizeof__", dict___sizeof__, METH_NOARGS, dict___sizeof____doc__}, static PyObject * dict___sizeof___impl(PyDictObject *self); @@ -259,7 +259,7 @@ PyDoc_STRVAR(dict___reversed____doc__, "Return a reverse iterator over the dict keys."); #define DICT___REVERSED___METHODDEF \ - {"__reversed__", (PyCFunction)dict___reversed__, METH_NOARGS, dict___reversed____doc__}, + {"__reversed__", dict___reversed__, METH_NOARGS, dict___reversed____doc__}, static PyObject * dict___reversed___impl(PyDictObject *self); @@ -277,7 +277,7 @@ PyDoc_STRVAR(dict_keys__doc__, "Return a set-like object providing a view on the dict\'s keys."); #define DICT_KEYS_METHODDEF \ - {"keys", (PyCFunction)dict_keys, METH_NOARGS, dict_keys__doc__}, + {"keys", dict_keys, METH_NOARGS, dict_keys__doc__}, static PyObject * dict_keys_impl(PyDictObject *self); @@ -295,7 +295,7 @@ PyDoc_STRVAR(dict_items__doc__, "Return a set-like object providing a view on the dict\'s items."); #define DICT_ITEMS_METHODDEF \ - {"items", (PyCFunction)dict_items, METH_NOARGS, dict_items__doc__}, + {"items", dict_items, METH_NOARGS, dict_items__doc__}, static PyObject * dict_items_impl(PyDictObject *self); @@ -313,7 +313,7 @@ PyDoc_STRVAR(dict_values__doc__, "Return an object providing a view on the dict\'s values."); #define DICT_VALUES_METHODDEF \ - {"values", (PyCFunction)dict_values, METH_NOARGS, dict_values__doc__}, + {"values", dict_values, METH_NOARGS, dict_values__doc__}, static PyObject * dict_values_impl(PyDictObject *self); @@ -323,4 +323,4 @@ dict_values(PyObject *self, PyObject *Py_UNUSED(ignored)) { return dict_values_impl((PyDictObject *)self); } -/*[clinic end generated code: output=9007b74432217017 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0ab6938dd62a694b input=a9049054013a1b77]*/ diff --git a/Objects/clinic/exceptions.c.h b/Objects/clinic/exceptions.c.h index 9baac8b1cc660b..19674c276c9aff 100644 --- a/Objects/clinic/exceptions.c.h +++ b/Objects/clinic/exceptions.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(BaseException___reduce____doc__, "\n"); #define BASEEXCEPTION___REDUCE___METHODDEF \ - {"__reduce__", (PyCFunction)BaseException___reduce__, METH_NOARGS, BaseException___reduce____doc__}, + {"__reduce__", BaseException___reduce__, METH_NOARGS, BaseException___reduce____doc__}, static PyObject * BaseException___reduce___impl(PyBaseExceptionObject *self); @@ -34,7 +34,7 @@ PyDoc_STRVAR(BaseException___setstate____doc__, "\n"); #define BASEEXCEPTION___SETSTATE___METHODDEF \ - {"__setstate__", (PyCFunction)BaseException___setstate__, METH_O, BaseException___setstate____doc__}, + {"__setstate__", BaseException___setstate__, METH_O, BaseException___setstate____doc__}, static PyObject * BaseException___setstate___impl(PyBaseExceptionObject *self, PyObject *state); @@ -58,7 +58,7 @@ PyDoc_STRVAR(BaseException_with_traceback__doc__, "Set self.__traceback__ to tb and return self."); #define BASEEXCEPTION_WITH_TRACEBACK_METHODDEF \ - {"with_traceback", (PyCFunction)BaseException_with_traceback, METH_O, BaseException_with_traceback__doc__}, + {"with_traceback", BaseException_with_traceback, METH_O, BaseException_with_traceback__doc__}, static PyObject * BaseException_with_traceback_impl(PyBaseExceptionObject *self, PyObject *tb); @@ -82,7 +82,7 @@ PyDoc_STRVAR(BaseException_add_note__doc__, "Add a note to the exception"); #define BASEEXCEPTION_ADD_NOTE_METHODDEF \ - {"add_note", (PyCFunction)BaseException_add_note, METH_O, BaseException_add_note__doc__}, + {"add_note", BaseException_add_note, METH_O, BaseException_add_note__doc__}, static PyObject * BaseException_add_note_impl(PyBaseExceptionObject *self, PyObject *note); @@ -315,7 +315,7 @@ PyDoc_STRVAR(BaseExceptionGroup_derive__doc__, "\n"); #define BASEEXCEPTIONGROUP_DERIVE_METHODDEF \ - {"derive", (PyCFunction)BaseExceptionGroup_derive, METH_O, BaseExceptionGroup_derive__doc__}, + {"derive", BaseExceptionGroup_derive, METH_O, BaseExceptionGroup_derive__doc__}, static PyObject * BaseExceptionGroup_derive_impl(PyBaseExceptionGroupObject *self, @@ -339,7 +339,7 @@ PyDoc_STRVAR(BaseExceptionGroup_split__doc__, "\n"); #define BASEEXCEPTIONGROUP_SPLIT_METHODDEF \ - {"split", (PyCFunction)BaseExceptionGroup_split, METH_O, BaseExceptionGroup_split__doc__}, + {"split", BaseExceptionGroup_split, METH_O, BaseExceptionGroup_split__doc__}, static PyObject * BaseExceptionGroup_split_impl(PyBaseExceptionGroupObject *self, @@ -363,7 +363,7 @@ PyDoc_STRVAR(BaseExceptionGroup_subgroup__doc__, "\n"); #define BASEEXCEPTIONGROUP_SUBGROUP_METHODDEF \ - {"subgroup", (PyCFunction)BaseExceptionGroup_subgroup, METH_O, BaseExceptionGroup_subgroup__doc__}, + {"subgroup", BaseExceptionGroup_subgroup, METH_O, BaseExceptionGroup_subgroup__doc__}, static PyObject * BaseExceptionGroup_subgroup_impl(PyBaseExceptionGroupObject *self, @@ -380,4 +380,4 @@ BaseExceptionGroup_subgroup(PyObject *self, PyObject *matcher_value) return return_value; } -/*[clinic end generated code: output=fcf70b3b71f3d14a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a1c7821f60d77ad1 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h index 4051131f480ccb..798bc87fb320b0 100644 --- a/Objects/clinic/floatobject.c.h +++ b/Objects/clinic/floatobject.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(float_is_integer__doc__, "Return True if the float is an integer."); #define FLOAT_IS_INTEGER_METHODDEF \ - {"is_integer", (PyCFunction)float_is_integer, METH_NOARGS, float_is_integer__doc__}, + {"is_integer", float_is_integer, METH_NOARGS, float_is_integer__doc__}, static PyObject * float_is_integer_impl(PyObject *self); @@ -29,7 +29,7 @@ PyDoc_STRVAR(float___trunc____doc__, "Return the Integral closest to x between 0 and x."); #define FLOAT___TRUNC___METHODDEF \ - {"__trunc__", (PyCFunction)float___trunc__, METH_NOARGS, float___trunc____doc__}, + {"__trunc__", float___trunc__, METH_NOARGS, float___trunc____doc__}, static PyObject * float___trunc___impl(PyObject *self); @@ -47,7 +47,7 @@ PyDoc_STRVAR(float___floor____doc__, "Return the floor as an Integral."); #define FLOAT___FLOOR___METHODDEF \ - {"__floor__", (PyCFunction)float___floor__, METH_NOARGS, float___floor____doc__}, + {"__floor__", float___floor__, METH_NOARGS, float___floor____doc__}, static PyObject * float___floor___impl(PyObject *self); @@ -65,7 +65,7 @@ PyDoc_STRVAR(float___ceil____doc__, "Return the ceiling as an Integral."); #define FLOAT___CEIL___METHODDEF \ - {"__ceil__", (PyCFunction)float___ceil__, METH_NOARGS, float___ceil____doc__}, + {"__ceil__", float___ceil__, METH_NOARGS, float___ceil____doc__}, static PyObject * float___ceil___impl(PyObject *self); @@ -117,7 +117,7 @@ PyDoc_STRVAR(float_conjugate__doc__, "Return self, the complex conjugate of any float."); #define FLOAT_CONJUGATE_METHODDEF \ - {"conjugate", (PyCFunction)float_conjugate, METH_NOARGS, float_conjugate__doc__}, + {"conjugate", float_conjugate, METH_NOARGS, float_conjugate__doc__}, static PyObject * float_conjugate_impl(PyObject *self); @@ -140,7 +140,7 @@ PyDoc_STRVAR(float_hex__doc__, "\'0x1.921f9f01b866ep+1\'"); #define FLOAT_HEX_METHODDEF \ - {"hex", (PyCFunction)float_hex, METH_NOARGS, float_hex__doc__}, + {"hex", float_hex, METH_NOARGS, float_hex__doc__}, static PyObject * float_hex_impl(PyObject *self); @@ -163,7 +163,7 @@ PyDoc_STRVAR(float_fromhex__doc__, "-5e-324"); #define FLOAT_FROMHEX_METHODDEF \ - {"fromhex", (PyCFunction)float_fromhex, METH_O|METH_CLASS, float_fromhex__doc__}, + {"fromhex", float_fromhex, METH_O|METH_CLASS, float_fromhex__doc__}, static PyObject * float_fromhex_impl(PyTypeObject *type, PyObject *string); @@ -195,7 +195,7 @@ PyDoc_STRVAR(float_as_integer_ratio__doc__, "(-1, 4)"); #define FLOAT_AS_INTEGER_RATIO_METHODDEF \ - {"as_integer_ratio", (PyCFunction)float_as_integer_ratio, METH_NOARGS, float_as_integer_ratio__doc__}, + {"as_integer_ratio", float_as_integer_ratio, METH_NOARGS, float_as_integer_ratio__doc__}, static PyObject * float_as_integer_ratio_impl(PyObject *self); @@ -247,7 +247,7 @@ PyDoc_STRVAR(float_from_number__doc__, "Convert real number to a floating-point number."); #define FLOAT_FROM_NUMBER_METHODDEF \ - {"from_number", (PyCFunction)float_from_number, METH_O|METH_CLASS, float_from_number__doc__}, + {"from_number", float_from_number, METH_O|METH_CLASS, float_from_number__doc__}, static PyObject * float_from_number_impl(PyTypeObject *type, PyObject *number); @@ -268,7 +268,7 @@ PyDoc_STRVAR(float___getnewargs____doc__, "\n"); #define FLOAT___GETNEWARGS___METHODDEF \ - {"__getnewargs__", (PyCFunction)float___getnewargs__, METH_NOARGS, float___getnewargs____doc__}, + {"__getnewargs__", float___getnewargs__, METH_NOARGS, float___getnewargs____doc__}, static PyObject * float___getnewargs___impl(PyObject *self); @@ -295,7 +295,7 @@ PyDoc_STRVAR(float___getformat____doc__, "C type named by typestr."); #define FLOAT___GETFORMAT___METHODDEF \ - {"__getformat__", (PyCFunction)float___getformat__, METH_O|METH_CLASS, float___getformat____doc__}, + {"__getformat__", float___getformat__, METH_O|METH_CLASS, float___getformat____doc__}, static PyObject * float___getformat___impl(PyTypeObject *type, const char *typestr); @@ -332,7 +332,7 @@ PyDoc_STRVAR(float___format____doc__, "Formats the float according to format_spec."); #define FLOAT___FORMAT___METHODDEF \ - {"__format__", (PyCFunction)float___format__, METH_O, float___format____doc__}, + {"__format__", float___format__, METH_O, float___format____doc__}, static PyObject * float___format___impl(PyObject *self, PyObject *format_spec); @@ -353,4 +353,4 @@ float___format__(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=927035897ea3573f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=188bb8fc6137be75 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/listobject.c.h b/Objects/clinic/listobject.c.h index 3f4e7e72f85dc2..5f82b2099a2579 100644 --- a/Objects/clinic/listobject.c.h +++ b/Objects/clinic/listobject.c.h @@ -60,7 +60,7 @@ PyDoc_STRVAR(py_list_clear__doc__, "Remove all items from list."); #define PY_LIST_CLEAR_METHODDEF \ - {"clear", (PyCFunction)py_list_clear, METH_NOARGS, py_list_clear__doc__}, + {"clear", py_list_clear, METH_NOARGS, py_list_clear__doc__}, static PyObject * py_list_clear_impl(PyListObject *self); @@ -84,7 +84,7 @@ PyDoc_STRVAR(list_copy__doc__, "Return a shallow copy of the list."); #define LIST_COPY_METHODDEF \ - {"copy", (PyCFunction)list_copy, METH_NOARGS, list_copy__doc__}, + {"copy", list_copy, METH_NOARGS, list_copy__doc__}, static PyObject * list_copy_impl(PyListObject *self); @@ -108,7 +108,7 @@ PyDoc_STRVAR(list_append__doc__, "Append object to the end of the list."); #define LIST_APPEND_METHODDEF \ - {"append", (PyCFunction)list_append, METH_O, list_append__doc__}, + {"append", list_append, METH_O, list_append__doc__}, static PyObject * list_append_impl(PyListObject *self, PyObject *object); @@ -132,7 +132,7 @@ PyDoc_STRVAR(list_extend__doc__, "Extend list by appending elements from the iterable."); #define LIST_EXTEND_METHODDEF \ - {"extend", (PyCFunction)list_extend, METH_O, list_extend__doc__}, + {"extend", list_extend, METH_O, list_extend__doc__}, static PyObject * list_extend_impl(PyListObject *self, PyObject *iterable); @@ -282,7 +282,7 @@ PyDoc_STRVAR(list_reverse__doc__, "Reverse *IN PLACE*."); #define LIST_REVERSE_METHODDEF \ - {"reverse", (PyCFunction)list_reverse, METH_NOARGS, list_reverse__doc__}, + {"reverse", list_reverse, METH_NOARGS, list_reverse__doc__}, static PyObject * list_reverse_impl(PyListObject *self); @@ -352,7 +352,7 @@ PyDoc_STRVAR(list_count__doc__, "Return number of occurrences of value."); #define LIST_COUNT_METHODDEF \ - {"count", (PyCFunction)list_count, METH_O, list_count__doc__}, + {"count", list_count, METH_O, list_count__doc__}, static PyObject * list_count_impl(PyListObject *self, PyObject *value); @@ -376,7 +376,7 @@ PyDoc_STRVAR(list_remove__doc__, "Raises ValueError if the value is not present."); #define LIST_REMOVE_METHODDEF \ - {"remove", (PyCFunction)list_remove, METH_O, list_remove__doc__}, + {"remove", list_remove, METH_O, list_remove__doc__}, static PyObject * list_remove_impl(PyListObject *self, PyObject *value); @@ -438,7 +438,7 @@ PyDoc_STRVAR(list___sizeof____doc__, "Return the size of the list in memory, in bytes."); #define LIST___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)list___sizeof__, METH_NOARGS, list___sizeof____doc__}, + {"__sizeof__", list___sizeof__, METH_NOARGS, list___sizeof____doc__}, static PyObject * list___sizeof___impl(PyListObject *self); @@ -456,7 +456,7 @@ PyDoc_STRVAR(list___reversed____doc__, "Return a reverse iterator over the list."); #define LIST___REVERSED___METHODDEF \ - {"__reversed__", (PyCFunction)list___reversed__, METH_NOARGS, list___reversed____doc__}, + {"__reversed__", list___reversed__, METH_NOARGS, list___reversed____doc__}, static PyObject * list___reversed___impl(PyListObject *self); @@ -466,4 +466,4 @@ list___reversed__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return list___reversed___impl((PyListObject *)self); } -/*[clinic end generated code: output=bc45e43a621ac833 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=920ebb1a2c7fcf77 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h index 9043ab3d516ea0..1317c6f177bfa4 100644 --- a/Objects/clinic/longobject.c.h +++ b/Objects/clinic/longobject.c.h @@ -76,7 +76,7 @@ PyDoc_STRVAR(int___getnewargs____doc__, "\n"); #define INT___GETNEWARGS___METHODDEF \ - {"__getnewargs__", (PyCFunction)int___getnewargs__, METH_NOARGS, int___getnewargs____doc__}, + {"__getnewargs__", int___getnewargs__, METH_NOARGS, int___getnewargs____doc__}, static PyObject * int___getnewargs___impl(PyObject *self); @@ -94,7 +94,7 @@ PyDoc_STRVAR(int___format____doc__, "Convert to a string according to format_spec."); #define INT___FORMAT___METHODDEF \ - {"__format__", (PyCFunction)int___format__, METH_O, int___format____doc__}, + {"__format__", int___format__, METH_O, int___format____doc__}, static PyObject * int___format___impl(PyObject *self, PyObject *format_spec); @@ -157,7 +157,7 @@ PyDoc_STRVAR(int___sizeof____doc__, "Returns size in memory, in bytes."); #define INT___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)int___sizeof__, METH_NOARGS, int___sizeof____doc__}, + {"__sizeof__", int___sizeof__, METH_NOARGS, int___sizeof____doc__}, static Py_ssize_t int___sizeof___impl(PyObject *self); @@ -190,7 +190,7 @@ PyDoc_STRVAR(int_bit_length__doc__, "6"); #define INT_BIT_LENGTH_METHODDEF \ - {"bit_length", (PyCFunction)int_bit_length, METH_NOARGS, int_bit_length__doc__}, + {"bit_length", int_bit_length, METH_NOARGS, int_bit_length__doc__}, static PyObject * int_bit_length_impl(PyObject *self); @@ -215,7 +215,7 @@ PyDoc_STRVAR(int_bit_count__doc__, "3"); #define INT_BIT_COUNT_METHODDEF \ - {"bit_count", (PyCFunction)int_bit_count, METH_NOARGS, int_bit_count__doc__}, + {"bit_count", int_bit_count, METH_NOARGS, int_bit_count__doc__}, static PyObject * int_bit_count_impl(PyObject *self); @@ -242,7 +242,7 @@ PyDoc_STRVAR(int_as_integer_ratio__doc__, "(0, 1)"); #define INT_AS_INTEGER_RATIO_METHODDEF \ - {"as_integer_ratio", (PyCFunction)int_as_integer_ratio, METH_NOARGS, int_as_integer_ratio__doc__}, + {"as_integer_ratio", int_as_integer_ratio, METH_NOARGS, int_as_integer_ratio__doc__}, static PyObject * int_as_integer_ratio_impl(PyObject *self); @@ -469,7 +469,7 @@ PyDoc_STRVAR(int_is_integer__doc__, "Returns True. Exists for duck type compatibility with float.is_integer."); #define INT_IS_INTEGER_METHODDEF \ - {"is_integer", (PyCFunction)int_is_integer, METH_NOARGS, int_is_integer__doc__}, + {"is_integer", int_is_integer, METH_NOARGS, int_is_integer__doc__}, static PyObject * int_is_integer_impl(PyObject *self); @@ -479,4 +479,4 @@ int_is_integer(PyObject *self, PyObject *Py_UNUSED(ignored)) { return int_is_integer_impl(self); } -/*[clinic end generated code: output=591cffa2b80b5184 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a8319a611dd6fa31 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/memoryobject.c.h b/Objects/clinic/memoryobject.c.h index b3240c7e6c4363..bc1ff38392bd3c 100644 --- a/Objects/clinic/memoryobject.c.h +++ b/Objects/clinic/memoryobject.c.h @@ -131,7 +131,7 @@ PyDoc_STRVAR(memoryview_release__doc__, "Release the underlying buffer exposed by the memoryview object."); #define MEMORYVIEW_RELEASE_METHODDEF \ - {"release", (PyCFunction)memoryview_release, METH_NOARGS, memoryview_release__doc__}, + {"release", memoryview_release, METH_NOARGS, memoryview_release__doc__}, static PyObject * memoryview_release_impl(PyMemoryViewObject *self); @@ -217,7 +217,7 @@ PyDoc_STRVAR(memoryview_toreadonly__doc__, "Return a readonly version of the memoryview."); #define MEMORYVIEW_TOREADONLY_METHODDEF \ - {"toreadonly", (PyCFunction)memoryview_toreadonly, METH_NOARGS, memoryview_toreadonly__doc__}, + {"toreadonly", memoryview_toreadonly, METH_NOARGS, memoryview_toreadonly__doc__}, static PyObject * memoryview_toreadonly_impl(PyMemoryViewObject *self); @@ -235,7 +235,7 @@ PyDoc_STRVAR(memoryview_tolist__doc__, "Return the data in the buffer as a list of elements."); #define MEMORYVIEW_TOLIST_METHODDEF \ - {"tolist", (PyCFunction)memoryview_tolist, METH_NOARGS, memoryview_tolist__doc__}, + {"tolist", memoryview_tolist, METH_NOARGS, memoryview_tolist__doc__}, static PyObject * memoryview_tolist_impl(PyMemoryViewObject *self); @@ -426,7 +426,7 @@ PyDoc_STRVAR(memoryview_count__doc__, "Count the number of occurrences of a value."); #define MEMORYVIEW_COUNT_METHODDEF \ - {"count", (PyCFunction)memoryview_count, METH_O, memoryview_count__doc__}, + {"count", memoryview_count, METH_O, memoryview_count__doc__}, static PyObject * memoryview_count_impl(PyMemoryViewObject *self, PyObject *value); @@ -486,4 +486,4 @@ memoryview_index(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=ae3414e9311c02fb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c32614e84c83e729 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/setobject.c.h b/Objects/clinic/setobject.c.h index 96c70d0ae95a46..fdc7a8a6c50b73 100644 --- a/Objects/clinic/setobject.c.h +++ b/Objects/clinic/setobject.c.h @@ -13,7 +13,7 @@ PyDoc_STRVAR(set_pop__doc__, "Raises KeyError if the set is empty."); #define SET_POP_METHODDEF \ - {"pop", (PyCFunction)set_pop, METH_NOARGS, set_pop__doc__}, + {"pop", set_pop, METH_NOARGS, set_pop__doc__}, static PyObject * set_pop_impl(PySetObject *so); @@ -64,7 +64,7 @@ PyDoc_STRVAR(set_copy__doc__, "Return a shallow copy of a set."); #define SET_COPY_METHODDEF \ - {"copy", (PyCFunction)set_copy, METH_NOARGS, set_copy__doc__}, + {"copy", set_copy, METH_NOARGS, set_copy__doc__}, static PyObject * set_copy_impl(PySetObject *so); @@ -88,7 +88,7 @@ PyDoc_STRVAR(frozenset_copy__doc__, "Return a shallow copy of a set."); #define FROZENSET_COPY_METHODDEF \ - {"copy", (PyCFunction)frozenset_copy, METH_NOARGS, frozenset_copy__doc__}, + {"copy", frozenset_copy, METH_NOARGS, frozenset_copy__doc__}, static PyObject * frozenset_copy_impl(PySetObject *so); @@ -112,7 +112,7 @@ PyDoc_STRVAR(set_clear__doc__, "Remove all elements from this set."); #define SET_CLEAR_METHODDEF \ - {"clear", (PyCFunction)set_clear, METH_NOARGS, set_clear__doc__}, + {"clear", set_clear, METH_NOARGS, set_clear__doc__}, static PyObject * set_clear_impl(PySetObject *so); @@ -217,7 +217,7 @@ PyDoc_STRVAR(set_isdisjoint__doc__, "Return True if two sets have a null intersection."); #define SET_ISDISJOINT_METHODDEF \ - {"isdisjoint", (PyCFunction)set_isdisjoint, METH_O, set_isdisjoint__doc__}, + {"isdisjoint", set_isdisjoint, METH_O, set_isdisjoint__doc__}, static PyObject * set_isdisjoint_impl(PySetObject *so, PyObject *other); @@ -295,7 +295,7 @@ PyDoc_STRVAR(set_symmetric_difference_update__doc__, "Update the set, keeping only elements found in either set, but not in both."); #define SET_SYMMETRIC_DIFFERENCE_UPDATE_METHODDEF \ - {"symmetric_difference_update", (PyCFunction)set_symmetric_difference_update, METH_O, set_symmetric_difference_update__doc__}, + {"symmetric_difference_update", set_symmetric_difference_update, METH_O, set_symmetric_difference_update__doc__}, static PyObject * set_symmetric_difference_update_impl(PySetObject *so, PyObject *other); @@ -317,7 +317,7 @@ PyDoc_STRVAR(set_symmetric_difference__doc__, "Return a new set with elements in either the set or other but not both."); #define SET_SYMMETRIC_DIFFERENCE_METHODDEF \ - {"symmetric_difference", (PyCFunction)set_symmetric_difference, METH_O, set_symmetric_difference__doc__}, + {"symmetric_difference", set_symmetric_difference, METH_O, set_symmetric_difference__doc__}, static PyObject * set_symmetric_difference_impl(PySetObject *so, PyObject *other); @@ -341,7 +341,7 @@ PyDoc_STRVAR(set_issubset__doc__, "Report whether another set contains this set."); #define SET_ISSUBSET_METHODDEF \ - {"issubset", (PyCFunction)set_issubset, METH_O, set_issubset__doc__}, + {"issubset", set_issubset, METH_O, set_issubset__doc__}, static PyObject * set_issubset_impl(PySetObject *so, PyObject *other); @@ -365,7 +365,7 @@ PyDoc_STRVAR(set_issuperset__doc__, "Report whether this set contains another set."); #define SET_ISSUPERSET_METHODDEF \ - {"issuperset", (PyCFunction)set_issuperset, METH_O, set_issuperset__doc__}, + {"issuperset", set_issuperset, METH_O, set_issuperset__doc__}, static PyObject * set_issuperset_impl(PySetObject *so, PyObject *other); @@ -391,7 +391,7 @@ PyDoc_STRVAR(set_add__doc__, "This has no effect if the element is already present."); #define SET_ADD_METHODDEF \ - {"add", (PyCFunction)set_add, METH_O, set_add__doc__}, + {"add", set_add, METH_O, set_add__doc__}, static PyObject * set_add_impl(PySetObject *so, PyObject *key); @@ -415,7 +415,7 @@ PyDoc_STRVAR(set___contains____doc__, "x.__contains__(y) <==> y in x."); #define SET___CONTAINS___METHODDEF \ - {"__contains__", (PyCFunction)set___contains__, METH_O|METH_COEXIST, set___contains____doc__}, + {"__contains__", set___contains__, METH_O|METH_COEXIST, set___contains____doc__}, static PyObject * set___contains___impl(PySetObject *so, PyObject *key); @@ -441,7 +441,7 @@ PyDoc_STRVAR(set_remove__doc__, "If the element is not a member, raise a KeyError."); #define SET_REMOVE_METHODDEF \ - {"remove", (PyCFunction)set_remove, METH_O, set_remove__doc__}, + {"remove", set_remove, METH_O, set_remove__doc__}, static PyObject * set_remove_impl(PySetObject *so, PyObject *key); @@ -468,7 +468,7 @@ PyDoc_STRVAR(set_discard__doc__, "an exception when an element is missing from the set."); #define SET_DISCARD_METHODDEF \ - {"discard", (PyCFunction)set_discard, METH_O, set_discard__doc__}, + {"discard", set_discard, METH_O, set_discard__doc__}, static PyObject * set_discard_impl(PySetObject *so, PyObject *key); @@ -492,7 +492,7 @@ PyDoc_STRVAR(set___reduce____doc__, "Return state information for pickling."); #define SET___REDUCE___METHODDEF \ - {"__reduce__", (PyCFunction)set___reduce__, METH_NOARGS, set___reduce____doc__}, + {"__reduce__", set___reduce__, METH_NOARGS, set___reduce____doc__}, static PyObject * set___reduce___impl(PySetObject *so); @@ -516,7 +516,7 @@ PyDoc_STRVAR(set___sizeof____doc__, "S.__sizeof__() -> size of S in memory, in bytes."); #define SET___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)set___sizeof__, METH_NOARGS, set___sizeof____doc__}, + {"__sizeof__", set___sizeof__, METH_NOARGS, set___sizeof____doc__}, static PyObject * set___sizeof___impl(PySetObject *so); @@ -532,4 +532,4 @@ set___sizeof__(PyObject *so, PyObject *Py_UNUSED(ignored)) return return_value; } -/*[clinic end generated code: output=e2f1470de062d661 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=222f962570251614 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/tupleobject.c.h b/Objects/clinic/tupleobject.c.h index 1c12706c0bb43b..b71f3d3711673f 100644 --- a/Objects/clinic/tupleobject.c.h +++ b/Objects/clinic/tupleobject.c.h @@ -57,7 +57,7 @@ PyDoc_STRVAR(tuple_count__doc__, "Return number of occurrences of value."); #define TUPLE_COUNT_METHODDEF \ - {"count", (PyCFunction)tuple_count, METH_O, tuple_count__doc__}, + {"count", tuple_count, METH_O, tuple_count__doc__}, static PyObject * tuple_count_impl(PyTupleObject *self, PyObject *value); @@ -117,7 +117,7 @@ PyDoc_STRVAR(tuple___getnewargs____doc__, "\n"); #define TUPLE___GETNEWARGS___METHODDEF \ - {"__getnewargs__", (PyCFunction)tuple___getnewargs__, METH_NOARGS, tuple___getnewargs____doc__}, + {"__getnewargs__", tuple___getnewargs__, METH_NOARGS, tuple___getnewargs____doc__}, static PyObject * tuple___getnewargs___impl(PyTupleObject *self); @@ -127,4 +127,4 @@ tuple___getnewargs__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return tuple___getnewargs___impl((PyTupleObject *)self); } -/*[clinic end generated code: output=bd11662d62d973c2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8345867f523906f3 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typeobject.c.h b/Objects/clinic/typeobject.c.h index 24a25f27ea3cc3..0ed4fca818755f 100644 --- a/Objects/clinic/typeobject.c.h +++ b/Objects/clinic/typeobject.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(type___instancecheck____doc__, "Check if an object is an instance."); #define TYPE___INSTANCECHECK___METHODDEF \ - {"__instancecheck__", (PyCFunction)type___instancecheck__, METH_O, type___instancecheck____doc__}, + {"__instancecheck__", type___instancecheck__, METH_O, type___instancecheck____doc__}, static int type___instancecheck___impl(PyTypeObject *self, PyObject *instance); @@ -39,7 +39,7 @@ PyDoc_STRVAR(type___subclasscheck____doc__, "Check if a class is a subclass."); #define TYPE___SUBCLASSCHECK___METHODDEF \ - {"__subclasscheck__", (PyCFunction)type___subclasscheck__, METH_O, type___subclasscheck____doc__}, + {"__subclasscheck__", type___subclasscheck__, METH_O, type___subclasscheck____doc__}, static int type___subclasscheck___impl(PyTypeObject *self, PyObject *subclass); @@ -67,7 +67,7 @@ PyDoc_STRVAR(type_mro__doc__, "Return a type\'s method resolution order."); #define TYPE_MRO_METHODDEF \ - {"mro", (PyCFunction)type_mro, METH_NOARGS, type_mro__doc__}, + {"mro", type_mro, METH_NOARGS, type_mro__doc__}, static PyObject * type_mro_impl(PyTypeObject *self); @@ -85,7 +85,7 @@ PyDoc_STRVAR(type___subclasses____doc__, "Return a list of immediate subclasses."); #define TYPE___SUBCLASSES___METHODDEF \ - {"__subclasses__", (PyCFunction)type___subclasses__, METH_NOARGS, type___subclasses____doc__}, + {"__subclasses__", type___subclasses__, METH_NOARGS, type___subclasses____doc__}, static PyObject * type___subclasses___impl(PyTypeObject *self); @@ -103,7 +103,7 @@ PyDoc_STRVAR(type___dir____doc__, "Specialized __dir__ implementation for types."); #define TYPE___DIR___METHODDEF \ - {"__dir__", (PyCFunction)type___dir__, METH_NOARGS, type___dir____doc__}, + {"__dir__", type___dir__, METH_NOARGS, type___dir____doc__}, static PyObject * type___dir___impl(PyTypeObject *self); @@ -121,7 +121,7 @@ PyDoc_STRVAR(type___sizeof____doc__, "Return memory consumption of the type object."); #define TYPE___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)type___sizeof__, METH_NOARGS, type___sizeof____doc__}, + {"__sizeof__", type___sizeof__, METH_NOARGS, type___sizeof____doc__}, static PyObject * type___sizeof___impl(PyTypeObject *self); @@ -139,7 +139,7 @@ PyDoc_STRVAR(object___getstate____doc__, "Helper for pickle."); #define OBJECT___GETSTATE___METHODDEF \ - {"__getstate__", (PyCFunction)object___getstate__, METH_NOARGS, object___getstate____doc__}, + {"__getstate__", object___getstate__, METH_NOARGS, object___getstate____doc__}, static PyObject * object___getstate___impl(PyObject *self); @@ -157,7 +157,7 @@ PyDoc_STRVAR(object___reduce____doc__, "Helper for pickle."); #define OBJECT___REDUCE___METHODDEF \ - {"__reduce__", (PyCFunction)object___reduce__, METH_NOARGS, object___reduce____doc__}, + {"__reduce__", object___reduce__, METH_NOARGS, object___reduce____doc__}, static PyObject * object___reduce___impl(PyObject *self); @@ -175,7 +175,7 @@ PyDoc_STRVAR(object___reduce_ex____doc__, "Helper for pickle."); #define OBJECT___REDUCE_EX___METHODDEF \ - {"__reduce_ex__", (PyCFunction)object___reduce_ex__, METH_O, object___reduce_ex____doc__}, + {"__reduce_ex__", object___reduce_ex__, METH_O, object___reduce_ex____doc__}, static PyObject * object___reduce_ex___impl(PyObject *self, int protocol); @@ -205,7 +205,7 @@ PyDoc_STRVAR(object___format____doc__, "Return str(self) if format_spec is empty. Raise TypeError otherwise."); #define OBJECT___FORMAT___METHODDEF \ - {"__format__", (PyCFunction)object___format__, METH_O, object___format____doc__}, + {"__format__", object___format__, METH_O, object___format____doc__}, static PyObject * object___format___impl(PyObject *self, PyObject *format_spec); @@ -234,7 +234,7 @@ PyDoc_STRVAR(object___sizeof____doc__, "Size of object in memory, in bytes."); #define OBJECT___SIZEOF___METHODDEF \ - {"__sizeof__", (PyCFunction)object___sizeof__, METH_NOARGS, object___sizeof____doc__}, + {"__sizeof__", object___sizeof__, METH_NOARGS, object___sizeof____doc__}, static PyObject * object___sizeof___impl(PyObject *self); @@ -252,7 +252,7 @@ PyDoc_STRVAR(object___dir____doc__, "Default dir() implementation."); #define OBJECT___DIR___METHODDEF \ - {"__dir__", (PyCFunction)object___dir__, METH_NOARGS, object___dir____doc__}, + {"__dir__", object___dir__, METH_NOARGS, object___dir____doc__}, static PyObject * object___dir___impl(PyObject *self); @@ -262,4 +262,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return object___dir___impl(self); } -/*[clinic end generated code: output=b55c0d257e2518d2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=731c0d5d3f99d593 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typevarobject.c.h b/Objects/clinic/typevarobject.c.h index 87e0fd77203f75..870ef19e9ad23c 100644 --- a/Objects/clinic/typevarobject.c.h +++ b/Objects/clinic/typevarobject.c.h @@ -128,7 +128,7 @@ PyDoc_STRVAR(typevar_typing_subst__doc__, "\n"); #define TYPEVAR_TYPING_SUBST_METHODDEF \ - {"__typing_subst__", (PyCFunction)typevar_typing_subst, METH_O, typevar_typing_subst__doc__}, + {"__typing_subst__", typevar_typing_subst, METH_O, typevar_typing_subst__doc__}, static PyObject * typevar_typing_subst_impl(typevarobject *self, PyObject *arg); @@ -179,7 +179,7 @@ PyDoc_STRVAR(typevar_reduce__doc__, "\n"); #define TYPEVAR_REDUCE_METHODDEF \ - {"__reduce__", (PyCFunction)typevar_reduce, METH_NOARGS, typevar_reduce__doc__}, + {"__reduce__", typevar_reduce, METH_NOARGS, typevar_reduce__doc__}, static PyObject * typevar_reduce_impl(typevarobject *self); @@ -196,7 +196,7 @@ PyDoc_STRVAR(typevar_has_default__doc__, "\n"); #define TYPEVAR_HAS_DEFAULT_METHODDEF \ - {"has_default", (PyCFunction)typevar_has_default, METH_NOARGS, typevar_has_default__doc__}, + {"has_default", typevar_has_default, METH_NOARGS, typevar_has_default__doc__}, static PyObject * typevar_has_default_impl(typevarobject *self); @@ -429,7 +429,7 @@ PyDoc_STRVAR(paramspec_typing_subst__doc__, "\n"); #define PARAMSPEC_TYPING_SUBST_METHODDEF \ - {"__typing_subst__", (PyCFunction)paramspec_typing_subst, METH_O, paramspec_typing_subst__doc__}, + {"__typing_subst__", paramspec_typing_subst, METH_O, paramspec_typing_subst__doc__}, static PyObject * paramspec_typing_subst_impl(paramspecobject *self, PyObject *arg); @@ -480,7 +480,7 @@ PyDoc_STRVAR(paramspec_reduce__doc__, "\n"); #define PARAMSPEC_REDUCE_METHODDEF \ - {"__reduce__", (PyCFunction)paramspec_reduce, METH_NOARGS, paramspec_reduce__doc__}, + {"__reduce__", paramspec_reduce, METH_NOARGS, paramspec_reduce__doc__}, static PyObject * paramspec_reduce_impl(paramspecobject *self); @@ -497,7 +497,7 @@ PyDoc_STRVAR(paramspec_has_default__doc__, "\n"); #define PARAMSPEC_HAS_DEFAULT_METHODDEF \ - {"has_default", (PyCFunction)paramspec_has_default, METH_NOARGS, paramspec_has_default__doc__}, + {"has_default", paramspec_has_default, METH_NOARGS, paramspec_has_default__doc__}, static PyObject * paramspec_has_default_impl(paramspecobject *self); @@ -581,7 +581,7 @@ PyDoc_STRVAR(typevartuple_typing_subst__doc__, "\n"); #define TYPEVARTUPLE_TYPING_SUBST_METHODDEF \ - {"__typing_subst__", (PyCFunction)typevartuple_typing_subst, METH_O, typevartuple_typing_subst__doc__}, + {"__typing_subst__", typevartuple_typing_subst, METH_O, typevartuple_typing_subst__doc__}, static PyObject * typevartuple_typing_subst_impl(typevartupleobject *self, PyObject *arg); @@ -632,7 +632,7 @@ PyDoc_STRVAR(typevartuple_reduce__doc__, "\n"); #define TYPEVARTUPLE_REDUCE_METHODDEF \ - {"__reduce__", (PyCFunction)typevartuple_reduce, METH_NOARGS, typevartuple_reduce__doc__}, + {"__reduce__", typevartuple_reduce, METH_NOARGS, typevartuple_reduce__doc__}, static PyObject * typevartuple_reduce_impl(typevartupleobject *self); @@ -649,7 +649,7 @@ PyDoc_STRVAR(typevartuple_has_default__doc__, "\n"); #define TYPEVARTUPLE_HAS_DEFAULT_METHODDEF \ - {"has_default", (PyCFunction)typevartuple_has_default, METH_NOARGS, typevartuple_has_default__doc__}, + {"has_default", typevartuple_has_default, METH_NOARGS, typevartuple_has_default__doc__}, static PyObject * typevartuple_has_default_impl(typevartupleobject *self); @@ -666,7 +666,7 @@ PyDoc_STRVAR(typealias_reduce__doc__, "\n"); #define TYPEALIAS_REDUCE_METHODDEF \ - {"__reduce__", (PyCFunction)typealias_reduce, METH_NOARGS, typealias_reduce__doc__}, + {"__reduce__", typealias_reduce, METH_NOARGS, typealias_reduce__doc__}, static PyObject * typealias_reduce_impl(typealiasobject *self); @@ -745,4 +745,4 @@ typealias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=d0cdf708e2e315a4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b28d41c4b35c5b40 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index c299cf2cfc8bc1..965014313fad7f 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(EncodingMap_size__doc__, "Return the size (in bytes) of this object."); #define ENCODINGMAP_SIZE_METHODDEF \ - {"size", (PyCFunction)EncodingMap_size, METH_NOARGS, EncodingMap_size__doc__}, + {"size", EncodingMap_size, METH_NOARGS, EncodingMap_size__doc__}, static PyObject * EncodingMap_size_impl(struct encoding_map *self); @@ -37,7 +37,7 @@ PyDoc_STRVAR(unicode_title__doc__, "cased characters have lower case."); #define UNICODE_TITLE_METHODDEF \ - {"title", (PyCFunction)unicode_title, METH_NOARGS, unicode_title__doc__}, + {"title", unicode_title, METH_NOARGS, unicode_title__doc__}, static PyObject * unicode_title_impl(PyObject *self); @@ -58,7 +58,7 @@ PyDoc_STRVAR(unicode_capitalize__doc__, "case."); #define UNICODE_CAPITALIZE_METHODDEF \ - {"capitalize", (PyCFunction)unicode_capitalize, METH_NOARGS, unicode_capitalize__doc__}, + {"capitalize", unicode_capitalize, METH_NOARGS, unicode_capitalize__doc__}, static PyObject * unicode_capitalize_impl(PyObject *self); @@ -76,7 +76,7 @@ PyDoc_STRVAR(unicode_casefold__doc__, "Return a version of the string suitable for caseless comparisons."); #define UNICODE_CASEFOLD_METHODDEF \ - {"casefold", (PyCFunction)unicode_casefold, METH_NOARGS, unicode_casefold__doc__}, + {"casefold", unicode_casefold, METH_NOARGS, unicode_casefold__doc__}, static PyObject * unicode_casefold_impl(PyObject *self); @@ -480,7 +480,7 @@ PyDoc_STRVAR(unicode_isascii__doc__, "Empty string is ASCII too."); #define UNICODE_ISASCII_METHODDEF \ - {"isascii", (PyCFunction)unicode_isascii, METH_NOARGS, unicode_isascii__doc__}, + {"isascii", unicode_isascii, METH_NOARGS, unicode_isascii__doc__}, static PyObject * unicode_isascii_impl(PyObject *self); @@ -501,7 +501,7 @@ PyDoc_STRVAR(unicode_islower__doc__, "there is at least one cased character in the string."); #define UNICODE_ISLOWER_METHODDEF \ - {"islower", (PyCFunction)unicode_islower, METH_NOARGS, unicode_islower__doc__}, + {"islower", unicode_islower, METH_NOARGS, unicode_islower__doc__}, static PyObject * unicode_islower_impl(PyObject *self); @@ -522,7 +522,7 @@ PyDoc_STRVAR(unicode_isupper__doc__, "there is at least one cased character in the string."); #define UNICODE_ISUPPER_METHODDEF \ - {"isupper", (PyCFunction)unicode_isupper, METH_NOARGS, unicode_isupper__doc__}, + {"isupper", unicode_isupper, METH_NOARGS, unicode_isupper__doc__}, static PyObject * unicode_isupper_impl(PyObject *self); @@ -543,7 +543,7 @@ PyDoc_STRVAR(unicode_istitle__doc__, "follow uncased characters and lowercase characters only cased ones."); #define UNICODE_ISTITLE_METHODDEF \ - {"istitle", (PyCFunction)unicode_istitle, METH_NOARGS, unicode_istitle__doc__}, + {"istitle", unicode_istitle, METH_NOARGS, unicode_istitle__doc__}, static PyObject * unicode_istitle_impl(PyObject *self); @@ -564,7 +564,7 @@ PyDoc_STRVAR(unicode_isspace__doc__, "is at least one character in the string."); #define UNICODE_ISSPACE_METHODDEF \ - {"isspace", (PyCFunction)unicode_isspace, METH_NOARGS, unicode_isspace__doc__}, + {"isspace", unicode_isspace, METH_NOARGS, unicode_isspace__doc__}, static PyObject * unicode_isspace_impl(PyObject *self); @@ -585,7 +585,7 @@ PyDoc_STRVAR(unicode_isalpha__doc__, "is at least one character in the string."); #define UNICODE_ISALPHA_METHODDEF \ - {"isalpha", (PyCFunction)unicode_isalpha, METH_NOARGS, unicode_isalpha__doc__}, + {"isalpha", unicode_isalpha, METH_NOARGS, unicode_isalpha__doc__}, static PyObject * unicode_isalpha_impl(PyObject *self); @@ -606,7 +606,7 @@ PyDoc_STRVAR(unicode_isalnum__doc__, "there is at least one character in the string."); #define UNICODE_ISALNUM_METHODDEF \ - {"isalnum", (PyCFunction)unicode_isalnum, METH_NOARGS, unicode_isalnum__doc__}, + {"isalnum", unicode_isalnum, METH_NOARGS, unicode_isalnum__doc__}, static PyObject * unicode_isalnum_impl(PyObject *self); @@ -627,7 +627,7 @@ PyDoc_STRVAR(unicode_isdecimal__doc__, "there is at least one character in the string."); #define UNICODE_ISDECIMAL_METHODDEF \ - {"isdecimal", (PyCFunction)unicode_isdecimal, METH_NOARGS, unicode_isdecimal__doc__}, + {"isdecimal", unicode_isdecimal, METH_NOARGS, unicode_isdecimal__doc__}, static PyObject * unicode_isdecimal_impl(PyObject *self); @@ -648,7 +648,7 @@ PyDoc_STRVAR(unicode_isdigit__doc__, "is at least one character in the string."); #define UNICODE_ISDIGIT_METHODDEF \ - {"isdigit", (PyCFunction)unicode_isdigit, METH_NOARGS, unicode_isdigit__doc__}, + {"isdigit", unicode_isdigit, METH_NOARGS, unicode_isdigit__doc__}, static PyObject * unicode_isdigit_impl(PyObject *self); @@ -669,7 +669,7 @@ PyDoc_STRVAR(unicode_isnumeric__doc__, "least one character in the string."); #define UNICODE_ISNUMERIC_METHODDEF \ - {"isnumeric", (PyCFunction)unicode_isnumeric, METH_NOARGS, unicode_isnumeric__doc__}, + {"isnumeric", unicode_isnumeric, METH_NOARGS, unicode_isnumeric__doc__}, static PyObject * unicode_isnumeric_impl(PyObject *self); @@ -690,7 +690,7 @@ PyDoc_STRVAR(unicode_isidentifier__doc__, "such as \"def\" or \"class\"."); #define UNICODE_ISIDENTIFIER_METHODDEF \ - {"isidentifier", (PyCFunction)unicode_isidentifier, METH_NOARGS, unicode_isidentifier__doc__}, + {"isidentifier", unicode_isidentifier, METH_NOARGS, unicode_isidentifier__doc__}, static PyObject * unicode_isidentifier_impl(PyObject *self); @@ -710,7 +710,7 @@ PyDoc_STRVAR(unicode_isprintable__doc__, "A character is printable if repr() may use it in its output."); #define UNICODE_ISPRINTABLE_METHODDEF \ - {"isprintable", (PyCFunction)unicode_isprintable, METH_NOARGS, unicode_isprintable__doc__}, + {"isprintable", unicode_isprintable, METH_NOARGS, unicode_isprintable__doc__}, static PyObject * unicode_isprintable_impl(PyObject *self); @@ -733,7 +733,7 @@ PyDoc_STRVAR(unicode_join__doc__, "Example: \'.\'.join([\'ab\', \'pq\', \'rs\']) -> \'ab.pq.rs\'"); #define UNICODE_JOIN_METHODDEF \ - {"join", (PyCFunction)unicode_join, METH_O, unicode_join__doc__}, + {"join", unicode_join, METH_O, unicode_join__doc__}, PyDoc_STRVAR(unicode_ljust__doc__, "ljust($self, width, fillchar=\' \', /)\n" @@ -791,7 +791,7 @@ PyDoc_STRVAR(unicode_lower__doc__, "Return a copy of the string converted to lowercase."); #define UNICODE_LOWER_METHODDEF \ - {"lower", (PyCFunction)unicode_lower, METH_NOARGS, unicode_lower__doc__}, + {"lower", unicode_lower, METH_NOARGS, unicode_lower__doc__}, static PyObject * unicode_lower_impl(PyObject *self); @@ -1006,7 +1006,7 @@ PyDoc_STRVAR(unicode_removeprefix__doc__, "Otherwise, return a copy of the original string."); #define UNICODE_REMOVEPREFIX_METHODDEF \ - {"removeprefix", (PyCFunction)unicode_removeprefix, METH_O, unicode_removeprefix__doc__}, + {"removeprefix", unicode_removeprefix, METH_O, unicode_removeprefix__doc__}, static PyObject * unicode_removeprefix_impl(PyObject *self, PyObject *prefix); @@ -1039,7 +1039,7 @@ PyDoc_STRVAR(unicode_removesuffix__doc__, "string."); #define UNICODE_REMOVESUFFIX_METHODDEF \ - {"removesuffix", (PyCFunction)unicode_removesuffix, METH_O, unicode_removesuffix__doc__}, + {"removesuffix", unicode_removesuffix, METH_O, unicode_removesuffix__doc__}, static PyObject * unicode_removesuffix_impl(PyObject *self, PyObject *suffix); @@ -1331,7 +1331,7 @@ PyDoc_STRVAR(unicode_partition__doc__, "and two empty strings."); #define UNICODE_PARTITION_METHODDEF \ - {"partition", (PyCFunction)unicode_partition, METH_O, unicode_partition__doc__}, + {"partition", unicode_partition, METH_O, unicode_partition__doc__}, PyDoc_STRVAR(unicode_rpartition__doc__, "rpartition($self, sep, /)\n" @@ -1347,7 +1347,7 @@ PyDoc_STRVAR(unicode_rpartition__doc__, "and the original string."); #define UNICODE_RPARTITION_METHODDEF \ - {"rpartition", (PyCFunction)unicode_rpartition, METH_O, unicode_rpartition__doc__}, + {"rpartition", unicode_rpartition, METH_O, unicode_rpartition__doc__}, PyDoc_STRVAR(unicode_rsplit__doc__, "rsplit($self, /, sep=None, maxsplit=-1)\n" @@ -1514,7 +1514,7 @@ PyDoc_STRVAR(unicode_swapcase__doc__, "Convert uppercase characters to lowercase and lowercase characters to uppercase."); #define UNICODE_SWAPCASE_METHODDEF \ - {"swapcase", (PyCFunction)unicode_swapcase, METH_NOARGS, unicode_swapcase__doc__}, + {"swapcase", unicode_swapcase, METH_NOARGS, unicode_swapcase__doc__}, static PyObject * unicode_swapcase_impl(PyObject *self); @@ -1595,7 +1595,7 @@ PyDoc_STRVAR(unicode_translate__doc__, "left untouched. Characters mapped to None are deleted."); #define UNICODE_TRANSLATE_METHODDEF \ - {"translate", (PyCFunction)unicode_translate, METH_O, unicode_translate__doc__}, + {"translate", unicode_translate, METH_O, unicode_translate__doc__}, PyDoc_STRVAR(unicode_upper__doc__, "upper($self, /)\n" @@ -1604,7 +1604,7 @@ PyDoc_STRVAR(unicode_upper__doc__, "Return a copy of the string converted to uppercase."); #define UNICODE_UPPER_METHODDEF \ - {"upper", (PyCFunction)unicode_upper, METH_NOARGS, unicode_upper__doc__}, + {"upper", unicode_upper, METH_NOARGS, unicode_upper__doc__}, static PyObject * unicode_upper_impl(PyObject *self); @@ -1624,7 +1624,7 @@ PyDoc_STRVAR(unicode_zfill__doc__, "The string is never truncated."); #define UNICODE_ZFILL_METHODDEF \ - {"zfill", (PyCFunction)unicode_zfill, METH_O, unicode_zfill__doc__}, + {"zfill", unicode_zfill, METH_O, unicode_zfill__doc__}, static PyObject * unicode_zfill_impl(PyObject *self, Py_ssize_t width); @@ -1762,7 +1762,7 @@ PyDoc_STRVAR(unicode___format____doc__, "Return a formatted version of the string as described by format_spec."); #define UNICODE___FORMAT___METHODDEF \ - {"__format__", (PyCFunction)unicode___format__, METH_O, unicode___format____doc__}, + {"__format__", unicode___format__, METH_O, unicode___format____doc__}, static PyObject * unicode___format___impl(PyObject *self, PyObject *format_spec); @@ -1791,7 +1791,7 @@ PyDoc_STRVAR(unicode_sizeof__doc__, "Return the size of the string in memory, in bytes."); #define UNICODE_SIZEOF_METHODDEF \ - {"__sizeof__", (PyCFunction)unicode_sizeof, METH_NOARGS, unicode_sizeof__doc__}, + {"__sizeof__", unicode_sizeof, METH_NOARGS, unicode_sizeof__doc__}, static PyObject * unicode_sizeof_impl(PyObject *self); @@ -1894,4 +1894,4 @@ unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=81d703159f829f1f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=511da6f2cde6dab3 input=a9049054013a1b77]*/ diff --git a/Objects/stringlib/clinic/transmogrify.h.h b/Objects/stringlib/clinic/transmogrify.h.h index 5b82c2de737249..018c09c512ae04 100644 --- a/Objects/stringlib/clinic/transmogrify.h.h +++ b/Objects/stringlib/clinic/transmogrify.h.h @@ -294,7 +294,7 @@ PyDoc_STRVAR(stringlib_zfill__doc__, "The original string is never truncated."); #define STRINGLIB_ZFILL_METHODDEF \ - {"zfill", (PyCFunction)stringlib_zfill, METH_O, stringlib_zfill__doc__}, + {"zfill", stringlib_zfill, METH_O, stringlib_zfill__doc__}, static PyObject * stringlib_zfill_impl(PyObject *self, Py_ssize_t width); @@ -322,4 +322,4 @@ stringlib_zfill(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=0e24a10bac3ec053 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3847956f44e24623 input=a9049054013a1b77]*/ diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index a77d0855af293f..a13903a7331bd9 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -14,7 +14,7 @@ PyDoc_STRVAR(msvcrt_heapmin__doc__, "to the operating system. On failure, this raises OSError."); #define MSVCRT_HEAPMIN_METHODDEF \ - {"heapmin", (PyCFunction)msvcrt_heapmin, METH_NOARGS, msvcrt_heapmin__doc__}, + {"heapmin", msvcrt_heapmin, METH_NOARGS, msvcrt_heapmin__doc__}, static PyObject * msvcrt_heapmin_impl(PyObject *module); @@ -173,7 +173,7 @@ PyDoc_STRVAR(msvcrt_get_osfhandle__doc__, "Raises OSError if fd is not recognized."); #define MSVCRT_GET_OSFHANDLE_METHODDEF \ - {"get_osfhandle", (PyCFunction)msvcrt_get_osfhandle, METH_O, msvcrt_get_osfhandle__doc__}, + {"get_osfhandle", msvcrt_get_osfhandle, METH_O, msvcrt_get_osfhandle__doc__}, static void * msvcrt_get_osfhandle_impl(PyObject *module, int fd); @@ -206,7 +206,7 @@ PyDoc_STRVAR(msvcrt_kbhit__doc__, "Returns a nonzero value if a keypress is waiting to be read. Otherwise, return 0."); #define MSVCRT_KBHIT_METHODDEF \ - {"kbhit", (PyCFunction)msvcrt_kbhit, METH_NOARGS, msvcrt_kbhit__doc__}, + {"kbhit", msvcrt_kbhit, METH_NOARGS, msvcrt_kbhit__doc__}, static long msvcrt_kbhit_impl(PyObject *module); @@ -240,7 +240,7 @@ PyDoc_STRVAR(msvcrt_getch__doc__, "cannot be read with this function."); #define MSVCRT_GETCH_METHODDEF \ - {"getch", (PyCFunction)msvcrt_getch, METH_NOARGS, msvcrt_getch__doc__}, + {"getch", msvcrt_getch, METH_NOARGS, msvcrt_getch__doc__}, static int msvcrt_getch_impl(PyObject *module); @@ -266,7 +266,7 @@ PyDoc_STRVAR(msvcrt_getwch__doc__, "Wide char variant of getch(), returning a Unicode value."); #define MSVCRT_GETWCH_METHODDEF \ - {"getwch", (PyCFunction)msvcrt_getwch, METH_NOARGS, msvcrt_getwch__doc__}, + {"getwch", msvcrt_getwch, METH_NOARGS, msvcrt_getwch__doc__}, static wchar_t msvcrt_getwch_impl(PyObject *module); @@ -292,7 +292,7 @@ PyDoc_STRVAR(msvcrt_getche__doc__, "Similar to getch(), but the keypress will be echoed if possible."); #define MSVCRT_GETCHE_METHODDEF \ - {"getche", (PyCFunction)msvcrt_getche, METH_NOARGS, msvcrt_getche__doc__}, + {"getche", msvcrt_getche, METH_NOARGS, msvcrt_getche__doc__}, static int msvcrt_getche_impl(PyObject *module); @@ -318,7 +318,7 @@ PyDoc_STRVAR(msvcrt_getwche__doc__, "Wide char variant of getche(), returning a Unicode value."); #define MSVCRT_GETWCHE_METHODDEF \ - {"getwche", (PyCFunction)msvcrt_getwche, METH_NOARGS, msvcrt_getwche__doc__}, + {"getwche", msvcrt_getwche, METH_NOARGS, msvcrt_getwche__doc__}, static wchar_t msvcrt_getwche_impl(PyObject *module); @@ -344,7 +344,7 @@ PyDoc_STRVAR(msvcrt_putch__doc__, "Print the byte string char to the console without buffering."); #define MSVCRT_PUTCH_METHODDEF \ - {"putch", (PyCFunction)msvcrt_putch, METH_O, msvcrt_putch__doc__}, + {"putch", msvcrt_putch, METH_O, msvcrt_putch__doc__}, static PyObject * msvcrt_putch_impl(PyObject *module, char char_value); @@ -394,7 +394,7 @@ PyDoc_STRVAR(msvcrt_putwch__doc__, "Wide char variant of putch(), accepting a Unicode value."); #define MSVCRT_PUTWCH_METHODDEF \ - {"putwch", (PyCFunction)msvcrt_putwch, METH_O, msvcrt_putwch__doc__}, + {"putwch", msvcrt_putwch, METH_O, msvcrt_putwch__doc__}, static PyObject * msvcrt_putwch_impl(PyObject *module, int unicode_char); @@ -436,7 +436,7 @@ PyDoc_STRVAR(msvcrt_ungetch__doc__, "getch() or getche()."); #define MSVCRT_UNGETCH_METHODDEF \ - {"ungetch", (PyCFunction)msvcrt_ungetch, METH_O, msvcrt_ungetch__doc__}, + {"ungetch", msvcrt_ungetch, METH_O, msvcrt_ungetch__doc__}, static PyObject * msvcrt_ungetch_impl(PyObject *module, char char_value); @@ -486,7 +486,7 @@ PyDoc_STRVAR(msvcrt_ungetwch__doc__, "Wide char variant of ungetch(), accepting a Unicode value."); #define MSVCRT_UNGETWCH_METHODDEF \ - {"ungetwch", (PyCFunction)msvcrt_ungetwch, METH_O, msvcrt_ungetwch__doc__}, + {"ungetwch", msvcrt_ungetwch, METH_O, msvcrt_ungetwch__doc__}, static PyObject * msvcrt_ungetwch_impl(PyObject *module, int unicode_char); @@ -622,7 +622,7 @@ PyDoc_STRVAR(msvcrt_set_error_mode__doc__, "Only available on Debug builds."); #define MSVCRT_SET_ERROR_MODE_METHODDEF \ - {"set_error_mode", (PyCFunction)msvcrt_set_error_mode, METH_O, msvcrt_set_error_mode__doc__}, + {"set_error_mode", msvcrt_set_error_mode, METH_O, msvcrt_set_error_mode__doc__}, static long msvcrt_set_error_mode_impl(PyObject *module, int mode); @@ -659,7 +659,7 @@ PyDoc_STRVAR(msvcrt_GetErrorMode__doc__, "Wrapper around GetErrorMode."); #define MSVCRT_GETERRORMODE_METHODDEF \ - {"GetErrorMode", (PyCFunction)msvcrt_GetErrorMode, METH_NOARGS, msvcrt_GetErrorMode__doc__}, + {"GetErrorMode", msvcrt_GetErrorMode, METH_NOARGS, msvcrt_GetErrorMode__doc__}, static PyObject * msvcrt_GetErrorMode_impl(PyObject *module); @@ -679,7 +679,7 @@ PyDoc_STRVAR(msvcrt_SetErrorMode__doc__, "Wrapper around SetErrorMode."); #define MSVCRT_SETERRORMODE_METHODDEF \ - {"SetErrorMode", (PyCFunction)msvcrt_SetErrorMode, METH_O, msvcrt_SetErrorMode__doc__}, + {"SetErrorMode", msvcrt_SetErrorMode, METH_O, msvcrt_SetErrorMode__doc__}, static PyObject * msvcrt_SetErrorMode_impl(PyObject *module, unsigned int mode); @@ -731,4 +731,4 @@ msvcrt_SetErrorMode(PyObject *module, PyObject *arg) #ifndef MSVCRT_GETERRORMODE_METHODDEF #define MSVCRT_GETERRORMODE_METHODDEF #endif /* !defined(MSVCRT_GETERRORMODE_METHODDEF) */ -/*[clinic end generated code: output=692c6f52bb9193ce input=a9049054013a1b77]*/ +/*[clinic end generated code: output=849e852d970e7b24 input=a9049054013a1b77]*/ diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 00fa6a75ec113e..73299aa21e947c 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -20,7 +20,7 @@ PyDoc_STRVAR(winreg_HKEYType_Close__doc__, "If the handle is already closed, no error is raised."); #define WINREG_HKEYTYPE_CLOSE_METHODDEF \ - {"Close", (PyCFunction)winreg_HKEYType_Close, METH_NOARGS, winreg_HKEYType_Close__doc__}, + {"Close", winreg_HKEYType_Close, METH_NOARGS, winreg_HKEYType_Close__doc__}, static PyObject * winreg_HKEYType_Close_impl(PyHKEYObject *self); @@ -50,7 +50,7 @@ PyDoc_STRVAR(winreg_HKEYType_Detach__doc__, "handle object."); #define WINREG_HKEYTYPE_DETACH_METHODDEF \ - {"Detach", (PyCFunction)winreg_HKEYType_Detach, METH_NOARGS, winreg_HKEYType_Detach__doc__}, + {"Detach", winreg_HKEYType_Detach, METH_NOARGS, winreg_HKEYType_Detach__doc__}, static PyObject * winreg_HKEYType_Detach_impl(PyHKEYObject *self); @@ -71,7 +71,7 @@ PyDoc_STRVAR(winreg_HKEYType___enter____doc__, "\n"); #define WINREG_HKEYTYPE___ENTER___METHODDEF \ - {"__enter__", (PyCFunction)winreg_HKEYType___enter__, METH_NOARGS, winreg_HKEYType___enter____doc__}, + {"__enter__", winreg_HKEYType___enter__, METH_NOARGS, winreg_HKEYType___enter____doc__}, static PyHKEYObject * winreg_HKEYType___enter___impl(PyHKEYObject *self); @@ -141,7 +141,7 @@ PyDoc_STRVAR(winreg_CloseKey__doc__, "closed when the hkey object is destroyed by Python."); #define WINREG_CLOSEKEY_METHODDEF \ - {"CloseKey", (PyCFunction)winreg_CloseKey, METH_O, winreg_CloseKey__doc__}, + {"CloseKey", winreg_CloseKey, METH_O, winreg_CloseKey__doc__}, #endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES)) */ @@ -749,7 +749,7 @@ PyDoc_STRVAR(winreg_ExpandEnvironmentStrings__doc__, "Expand environment vars."); #define WINREG_EXPANDENVIRONMENTSTRINGS_METHODDEF \ - {"ExpandEnvironmentStrings", (PyCFunction)winreg_ExpandEnvironmentStrings, METH_O, winreg_ExpandEnvironmentStrings__doc__}, + {"ExpandEnvironmentStrings", winreg_ExpandEnvironmentStrings, METH_O, winreg_ExpandEnvironmentStrings__doc__}, static PyObject * winreg_ExpandEnvironmentStrings_impl(PyObject *module, const wchar_t *string); @@ -801,7 +801,7 @@ PyDoc_STRVAR(winreg_FlushKey__doc__, "a FlushKey() call is required, it probably isn\'t."); #define WINREG_FLUSHKEY_METHODDEF \ - {"FlushKey", (PyCFunction)winreg_FlushKey, METH_O, winreg_FlushKey__doc__}, + {"FlushKey", winreg_FlushKey, METH_O, winreg_FlushKey__doc__}, static PyObject * winreg_FlushKey_impl(PyObject *module, HKEY key); @@ -1157,7 +1157,7 @@ PyDoc_STRVAR(winreg_QueryInfoKey__doc__, "as 100\'s of nanoseconds since Jan 1, 1600."); #define WINREG_QUERYINFOKEY_METHODDEF \ - {"QueryInfoKey", (PyCFunction)winreg_QueryInfoKey, METH_O, winreg_QueryInfoKey__doc__}, + {"QueryInfoKey", winreg_QueryInfoKey, METH_O, winreg_QueryInfoKey__doc__}, static PyObject * winreg_QueryInfoKey_impl(PyObject *module, HKEY key); @@ -1563,7 +1563,7 @@ PyDoc_STRVAR(winreg_DisableReflectionKey__doc__, "of any subkeys."); #define WINREG_DISABLEREFLECTIONKEY_METHODDEF \ - {"DisableReflectionKey", (PyCFunction)winreg_DisableReflectionKey, METH_O, winreg_DisableReflectionKey__doc__}, + {"DisableReflectionKey", winreg_DisableReflectionKey, METH_O, winreg_DisableReflectionKey__doc__}, static PyObject * winreg_DisableReflectionKey_impl(PyObject *module, HKEY key); @@ -1601,7 +1601,7 @@ PyDoc_STRVAR(winreg_EnableReflectionKey__doc__, "subkeys."); #define WINREG_ENABLEREFLECTIONKEY_METHODDEF \ - {"EnableReflectionKey", (PyCFunction)winreg_EnableReflectionKey, METH_O, winreg_EnableReflectionKey__doc__}, + {"EnableReflectionKey", winreg_EnableReflectionKey, METH_O, winreg_EnableReflectionKey__doc__}, static PyObject * winreg_EnableReflectionKey_impl(PyObject *module, HKEY key); @@ -1637,7 +1637,7 @@ PyDoc_STRVAR(winreg_QueryReflectionKey__doc__, "Will generally raise NotImplementedError if executed on a 32bit OS."); #define WINREG_QUERYREFLECTIONKEY_METHODDEF \ - {"QueryReflectionKey", (PyCFunction)winreg_QueryReflectionKey, METH_O, winreg_QueryReflectionKey__doc__}, + {"QueryReflectionKey", winreg_QueryReflectionKey, METH_O, winreg_QueryReflectionKey__doc__}, static PyObject * winreg_QueryReflectionKey_impl(PyObject *module, HKEY key); @@ -1766,4 +1766,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) #ifndef WINREG_QUERYREFLECTIONKEY_METHODDEF #define WINREG_QUERYREFLECTIONKEY_METHODDEF #endif /* !defined(WINREG_QUERYREFLECTIONKEY_METHODDEF) */ -/*[clinic end generated code: output=fbe9b075cd2fa833 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e273adb99f26e8fb input=a9049054013a1b77]*/ diff --git a/Python/clinic/_warnings.c.h b/Python/clinic/_warnings.c.h index bcb4b344fa4370..6dfe94094725fb 100644 --- a/Python/clinic/_warnings.c.h +++ b/Python/clinic/_warnings.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(warnings_acquire_lock__doc__, "\n"); #define WARNINGS_ACQUIRE_LOCK_METHODDEF \ - {"_acquire_lock", (PyCFunction)warnings_acquire_lock, METH_NOARGS, warnings_acquire_lock__doc__}, + {"_acquire_lock", warnings_acquire_lock, METH_NOARGS, warnings_acquire_lock__doc__}, static PyObject * warnings_acquire_lock_impl(PyObject *module); @@ -32,7 +32,7 @@ PyDoc_STRVAR(warnings_release_lock__doc__, "\n"); #define WARNINGS_RELEASE_LOCK_METHODDEF \ - {"_release_lock", (PyCFunction)warnings_release_lock, METH_NOARGS, warnings_release_lock__doc__}, + {"_release_lock", warnings_release_lock, METH_NOARGS, warnings_release_lock__doc__}, static PyObject * warnings_release_lock_impl(PyObject *module); @@ -270,7 +270,7 @@ PyDoc_STRVAR(warnings_filters_mutated_lock_held__doc__, "\n"); #define WARNINGS_FILTERS_MUTATED_LOCK_HELD_METHODDEF \ - {"_filters_mutated_lock_held", (PyCFunction)warnings_filters_mutated_lock_held, METH_NOARGS, warnings_filters_mutated_lock_held__doc__}, + {"_filters_mutated_lock_held", warnings_filters_mutated_lock_held, METH_NOARGS, warnings_filters_mutated_lock_held__doc__}, static PyObject * warnings_filters_mutated_lock_held_impl(PyObject *module); @@ -280,4 +280,4 @@ warnings_filters_mutated_lock_held(PyObject *module, PyObject *Py_UNUSED(ignored { return warnings_filters_mutated_lock_held_impl(module); } -/*[clinic end generated code: output=d9d32a8b59a30683 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=71dbb864ea857762 input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index e5f634e34cb32f..b1bc8dc1fb22db 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -118,7 +118,7 @@ PyDoc_STRVAR(builtin_abs__doc__, "Return the absolute value of the argument."); #define BUILTIN_ABS_METHODDEF \ - {"abs", (PyCFunction)builtin_abs, METH_O, builtin_abs__doc__}, + {"abs", builtin_abs, METH_O, builtin_abs__doc__}, PyDoc_STRVAR(builtin_all__doc__, "all($module, iterable, /)\n" @@ -129,7 +129,7 @@ PyDoc_STRVAR(builtin_all__doc__, "If the iterable is empty, return True."); #define BUILTIN_ALL_METHODDEF \ - {"all", (PyCFunction)builtin_all, METH_O, builtin_all__doc__}, + {"all", builtin_all, METH_O, builtin_all__doc__}, PyDoc_STRVAR(builtin_any__doc__, "any($module, iterable, /)\n" @@ -140,7 +140,7 @@ PyDoc_STRVAR(builtin_any__doc__, "If the iterable is empty, return False."); #define BUILTIN_ANY_METHODDEF \ - {"any", (PyCFunction)builtin_any, METH_O, builtin_any__doc__}, + {"any", builtin_any, METH_O, builtin_any__doc__}, PyDoc_STRVAR(builtin_ascii__doc__, "ascii($module, obj, /)\n" @@ -154,7 +154,7 @@ PyDoc_STRVAR(builtin_ascii__doc__, "to that returned by repr() in Python 2."); #define BUILTIN_ASCII_METHODDEF \ - {"ascii", (PyCFunction)builtin_ascii, METH_O, builtin_ascii__doc__}, + {"ascii", builtin_ascii, METH_O, builtin_ascii__doc__}, PyDoc_STRVAR(builtin_bin__doc__, "bin($module, number, /)\n" @@ -166,7 +166,7 @@ PyDoc_STRVAR(builtin_bin__doc__, " \'0b1010101010101010101010\'"); #define BUILTIN_BIN_METHODDEF \ - {"bin", (PyCFunction)builtin_bin, METH_O, builtin_bin__doc__}, + {"bin", builtin_bin, METH_O, builtin_bin__doc__}, PyDoc_STRVAR(builtin_callable__doc__, "callable($module, obj, /)\n" @@ -178,7 +178,7 @@ PyDoc_STRVAR(builtin_callable__doc__, "__call__() method."); #define BUILTIN_CALLABLE_METHODDEF \ - {"callable", (PyCFunction)builtin_callable, METH_O, builtin_callable__doc__}, + {"callable", builtin_callable, METH_O, builtin_callable__doc__}, PyDoc_STRVAR(builtin_format__doc__, "format($module, value, format_spec=\'\', /)\n" @@ -232,7 +232,7 @@ PyDoc_STRVAR(builtin_chr__doc__, "Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."); #define BUILTIN_CHR_METHODDEF \ - {"chr", (PyCFunction)builtin_chr, METH_O, builtin_chr__doc__}, + {"chr", builtin_chr, METH_O, builtin_chr__doc__}, PyDoc_STRVAR(builtin_compile__doc__, "compile($module, /, source, filename, mode, flags=0,\n" @@ -573,7 +573,7 @@ PyDoc_STRVAR(builtin_globals__doc__, "global scope and vice-versa."); #define BUILTIN_GLOBALS_METHODDEF \ - {"globals", (PyCFunction)builtin_globals, METH_NOARGS, builtin_globals__doc__}, + {"globals", builtin_globals, METH_NOARGS, builtin_globals__doc__}, static PyObject * builtin_globals_impl(PyObject *module); @@ -626,7 +626,7 @@ PyDoc_STRVAR(builtin_id__doc__, "(CPython uses the object\'s memory address.)"); #define BUILTIN_ID_METHODDEF \ - {"id", (PyCFunction)builtin_id, METH_O, builtin_id__doc__}, + {"id", builtin_id, METH_O, builtin_id__doc__}, static PyObject * builtin_id_impl(PyModuleDef *self, PyObject *v); @@ -718,7 +718,7 @@ PyDoc_STRVAR(builtin_hash__doc__, "reverse is not necessarily true."); #define BUILTIN_HASH_METHODDEF \ - {"hash", (PyCFunction)builtin_hash, METH_O, builtin_hash__doc__}, + {"hash", builtin_hash, METH_O, builtin_hash__doc__}, PyDoc_STRVAR(builtin_hex__doc__, "hex($module, number, /)\n" @@ -730,7 +730,7 @@ PyDoc_STRVAR(builtin_hex__doc__, " \'0xc0ffee\'"); #define BUILTIN_HEX_METHODDEF \ - {"hex", (PyCFunction)builtin_hex, METH_O, builtin_hex__doc__}, + {"hex", builtin_hex, METH_O, builtin_hex__doc__}, PyDoc_STRVAR(builtin_aiter__doc__, "aiter($module, async_iterable, /)\n" @@ -739,7 +739,7 @@ PyDoc_STRVAR(builtin_aiter__doc__, "Return an AsyncIterator for an AsyncIterable object."); #define BUILTIN_AITER_METHODDEF \ - {"aiter", (PyCFunction)builtin_aiter, METH_O, builtin_aiter__doc__}, + {"aiter", builtin_aiter, METH_O, builtin_aiter__doc__}, PyDoc_STRVAR(builtin_anext__doc__, "anext($module, aiterator, default=, /)\n" @@ -786,7 +786,7 @@ PyDoc_STRVAR(builtin_len__doc__, "Return the number of items in a container."); #define BUILTIN_LEN_METHODDEF \ - {"len", (PyCFunction)builtin_len, METH_O, builtin_len__doc__}, + {"len", builtin_len, METH_O, builtin_len__doc__}, PyDoc_STRVAR(builtin_locals__doc__, "locals($module, /)\n" @@ -799,7 +799,7 @@ PyDoc_STRVAR(builtin_locals__doc__, "covered by any backwards compatibility guarantees."); #define BUILTIN_LOCALS_METHODDEF \ - {"locals", (PyCFunction)builtin_locals, METH_NOARGS, builtin_locals__doc__}, + {"locals", builtin_locals, METH_NOARGS, builtin_locals__doc__}, static PyObject * builtin_locals_impl(PyObject *module); @@ -820,7 +820,7 @@ PyDoc_STRVAR(builtin_oct__doc__, " \'0o1234567\'"); #define BUILTIN_OCT_METHODDEF \ - {"oct", (PyCFunction)builtin_oct, METH_O, builtin_oct__doc__}, + {"oct", builtin_oct, METH_O, builtin_oct__doc__}, PyDoc_STRVAR(builtin_ord__doc__, "ord($module, c, /)\n" @@ -829,7 +829,7 @@ PyDoc_STRVAR(builtin_ord__doc__, "Return the Unicode code point for a one-character string."); #define BUILTIN_ORD_METHODDEF \ - {"ord", (PyCFunction)builtin_ord, METH_O, builtin_ord__doc__}, + {"ord", builtin_ord, METH_O, builtin_ord__doc__}, PyDoc_STRVAR(builtin_pow__doc__, "pow($module, /, base, exp, mod=None)\n" @@ -1048,7 +1048,7 @@ PyDoc_STRVAR(builtin_repr__doc__, "For many object types, including most builtins, eval(repr(obj)) == obj."); #define BUILTIN_REPR_METHODDEF \ - {"repr", (PyCFunction)builtin_repr, METH_O, builtin_repr__doc__}, + {"repr", builtin_repr, METH_O, builtin_repr__doc__}, PyDoc_STRVAR(builtin_round__doc__, "round($module, /, number, ndigits=None)\n" @@ -1252,4 +1252,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=c08e0e086a791ff0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=95665fce5b257fe3 input=a9049054013a1b77]*/ diff --git a/Python/clinic/context.c.h b/Python/clinic/context.c.h index 5ed74e6e6ddb6b..77f1762e4a3dd8 100644 --- a/Python/clinic/context.c.h +++ b/Python/clinic/context.c.h @@ -51,7 +51,7 @@ PyDoc_STRVAR(_contextvars_Context_items__doc__, "The result is returned as a list of 2-tuples (variable, value)."); #define _CONTEXTVARS_CONTEXT_ITEMS_METHODDEF \ - {"items", (PyCFunction)_contextvars_Context_items, METH_NOARGS, _contextvars_Context_items__doc__}, + {"items", _contextvars_Context_items, METH_NOARGS, _contextvars_Context_items__doc__}, static PyObject * _contextvars_Context_items_impl(PyContext *self); @@ -69,7 +69,7 @@ PyDoc_STRVAR(_contextvars_Context_keys__doc__, "Return a list of all variables in the context object."); #define _CONTEXTVARS_CONTEXT_KEYS_METHODDEF \ - {"keys", (PyCFunction)_contextvars_Context_keys, METH_NOARGS, _contextvars_Context_keys__doc__}, + {"keys", _contextvars_Context_keys, METH_NOARGS, _contextvars_Context_keys__doc__}, static PyObject * _contextvars_Context_keys_impl(PyContext *self); @@ -87,7 +87,7 @@ PyDoc_STRVAR(_contextvars_Context_values__doc__, "Return a list of all variables\' values in the context object."); #define _CONTEXTVARS_CONTEXT_VALUES_METHODDEF \ - {"values", (PyCFunction)_contextvars_Context_values, METH_NOARGS, _contextvars_Context_values__doc__}, + {"values", _contextvars_Context_values, METH_NOARGS, _contextvars_Context_values__doc__}, static PyObject * _contextvars_Context_values_impl(PyContext *self); @@ -105,7 +105,7 @@ PyDoc_STRVAR(_contextvars_Context_copy__doc__, "Return a shallow copy of the context object."); #define _CONTEXTVARS_CONTEXT_COPY_METHODDEF \ - {"copy", (PyCFunction)_contextvars_Context_copy, METH_NOARGS, _contextvars_Context_copy__doc__}, + {"copy", _contextvars_Context_copy, METH_NOARGS, _contextvars_Context_copy__doc__}, static PyObject * _contextvars_Context_copy_impl(PyContext *self); @@ -166,7 +166,7 @@ PyDoc_STRVAR(_contextvars_ContextVar_set__doc__, "value via the `ContextVar.reset()` method."); #define _CONTEXTVARS_CONTEXTVAR_SET_METHODDEF \ - {"set", (PyCFunction)_contextvars_ContextVar_set, METH_O, _contextvars_ContextVar_set__doc__}, + {"set", _contextvars_ContextVar_set, METH_O, _contextvars_ContextVar_set__doc__}, static PyObject * _contextvars_ContextVar_set_impl(PyContextVar *self, PyObject *value); @@ -191,7 +191,7 @@ PyDoc_STRVAR(_contextvars_ContextVar_reset__doc__, "created the token was used."); #define _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF \ - {"reset", (PyCFunction)_contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__}, + {"reset", _contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__}, static PyObject * _contextvars_ContextVar_reset_impl(PyContextVar *self, PyObject *token); @@ -213,7 +213,7 @@ PyDoc_STRVAR(token_enter__doc__, "Enter into Token context manager."); #define TOKEN_ENTER_METHODDEF \ - {"__enter__", (PyCFunction)token_enter, METH_NOARGS, token_enter__doc__}, + {"__enter__", token_enter, METH_NOARGS, token_enter__doc__}, static PyObject * token_enter_impl(PyContextToken *self); @@ -256,4 +256,4 @@ token_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=3a04b2fddf24c3e9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7c953506c4fc86ec input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 0e6a560d57c8ba..467bf3d26ee259 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(_imp_lock_held__doc__, "On platforms without threads, return False."); #define _IMP_LOCK_HELD_METHODDEF \ - {"lock_held", (PyCFunction)_imp_lock_held, METH_NOARGS, _imp_lock_held__doc__}, + {"lock_held", _imp_lock_held, METH_NOARGS, _imp_lock_held__doc__}, static PyObject * _imp_lock_held_impl(PyObject *module); @@ -38,7 +38,7 @@ PyDoc_STRVAR(_imp_acquire_lock__doc__, "modules. On platforms without threads, this function does nothing."); #define _IMP_ACQUIRE_LOCK_METHODDEF \ - {"acquire_lock", (PyCFunction)_imp_acquire_lock, METH_NOARGS, _imp_acquire_lock__doc__}, + {"acquire_lock", _imp_acquire_lock, METH_NOARGS, _imp_acquire_lock__doc__}, static PyObject * _imp_acquire_lock_impl(PyObject *module); @@ -58,7 +58,7 @@ PyDoc_STRVAR(_imp_release_lock__doc__, "On platforms without threads, this function does nothing."); #define _IMP_RELEASE_LOCK_METHODDEF \ - {"release_lock", (PyCFunction)_imp_release_lock, METH_NOARGS, _imp_release_lock__doc__}, + {"release_lock", _imp_release_lock, METH_NOARGS, _imp_release_lock__doc__}, static PyObject * _imp_release_lock_impl(PyObject *module); @@ -120,7 +120,7 @@ PyDoc_STRVAR(_imp_create_builtin__doc__, "Create an extension module."); #define _IMP_CREATE_BUILTIN_METHODDEF \ - {"create_builtin", (PyCFunction)_imp_create_builtin, METH_O, _imp_create_builtin__doc__}, + {"create_builtin", _imp_create_builtin, METH_O, _imp_create_builtin__doc__}, PyDoc_STRVAR(_imp_extension_suffixes__doc__, "extension_suffixes($module, /)\n" @@ -129,7 +129,7 @@ PyDoc_STRVAR(_imp_extension_suffixes__doc__, "Returns the list of file suffixes used to identify extension modules."); #define _IMP_EXTENSION_SUFFIXES_METHODDEF \ - {"extension_suffixes", (PyCFunction)_imp_extension_suffixes, METH_NOARGS, _imp_extension_suffixes__doc__}, + {"extension_suffixes", _imp_extension_suffixes, METH_NOARGS, _imp_extension_suffixes__doc__}, static PyObject * _imp_extension_suffixes_impl(PyObject *module); @@ -147,7 +147,7 @@ PyDoc_STRVAR(_imp_init_frozen__doc__, "Initializes a frozen module."); #define _IMP_INIT_FROZEN_METHODDEF \ - {"init_frozen", (PyCFunction)_imp_init_frozen, METH_O, _imp_init_frozen__doc__}, + {"init_frozen", _imp_init_frozen, METH_O, _imp_init_frozen__doc__}, static PyObject * _imp_init_frozen_impl(PyObject *module, PyObject *name); @@ -293,7 +293,7 @@ PyDoc_STRVAR(_imp_is_frozen_package__doc__, "Returns True if the module name is of a frozen package."); #define _IMP_IS_FROZEN_PACKAGE_METHODDEF \ - {"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_O, _imp_is_frozen_package__doc__}, + {"is_frozen_package", _imp_is_frozen_package, METH_O, _imp_is_frozen_package__doc__}, static PyObject * _imp_is_frozen_package_impl(PyObject *module, PyObject *name); @@ -322,7 +322,7 @@ PyDoc_STRVAR(_imp_is_builtin__doc__, "Returns True if the module name corresponds to a built-in module."); #define _IMP_IS_BUILTIN_METHODDEF \ - {"is_builtin", (PyCFunction)_imp_is_builtin, METH_O, _imp_is_builtin__doc__}, + {"is_builtin", _imp_is_builtin, METH_O, _imp_is_builtin__doc__}, static PyObject * _imp_is_builtin_impl(PyObject *module, PyObject *name); @@ -351,7 +351,7 @@ PyDoc_STRVAR(_imp_is_frozen__doc__, "Returns True if the module name corresponds to a frozen module."); #define _IMP_IS_FROZEN_METHODDEF \ - {"is_frozen", (PyCFunction)_imp_is_frozen, METH_O, _imp_is_frozen__doc__}, + {"is_frozen", _imp_is_frozen, METH_O, _imp_is_frozen__doc__}, static PyObject * _imp_is_frozen_impl(PyObject *module, PyObject *name); @@ -380,7 +380,7 @@ PyDoc_STRVAR(_imp__frozen_module_names__doc__, "Returns the list of available frozen modules."); #define _IMP__FROZEN_MODULE_NAMES_METHODDEF \ - {"_frozen_module_names", (PyCFunction)_imp__frozen_module_names, METH_NOARGS, _imp__frozen_module_names__doc__}, + {"_frozen_module_names", _imp__frozen_module_names, METH_NOARGS, _imp__frozen_module_names__doc__}, static PyObject * _imp__frozen_module_names_impl(PyObject *module); @@ -401,7 +401,7 @@ PyDoc_STRVAR(_imp__override_frozen_modules_for_tests__doc__, "See frozen_modules() in Lib/test/support/import_helper.py."); #define _IMP__OVERRIDE_FROZEN_MODULES_FOR_TESTS_METHODDEF \ - {"_override_frozen_modules_for_tests", (PyCFunction)_imp__override_frozen_modules_for_tests, METH_O, _imp__override_frozen_modules_for_tests__doc__}, + {"_override_frozen_modules_for_tests", _imp__override_frozen_modules_for_tests, METH_O, _imp__override_frozen_modules_for_tests__doc__}, static PyObject * _imp__override_frozen_modules_for_tests_impl(PyObject *module, int override); @@ -431,7 +431,7 @@ PyDoc_STRVAR(_imp__override_multi_interp_extensions_check__doc__, "(-1: \"never\", 1: \"always\", 0: no override)"); #define _IMP__OVERRIDE_MULTI_INTERP_EXTENSIONS_CHECK_METHODDEF \ - {"_override_multi_interp_extensions_check", (PyCFunction)_imp__override_multi_interp_extensions_check, METH_O, _imp__override_multi_interp_extensions_check__doc__}, + {"_override_multi_interp_extensions_check", _imp__override_multi_interp_extensions_check, METH_O, _imp__override_multi_interp_extensions_check__doc__}, static PyObject * _imp__override_multi_interp_extensions_check_impl(PyObject *module, @@ -500,7 +500,7 @@ PyDoc_STRVAR(_imp_exec_dynamic__doc__, "Initialize an extension module."); #define _IMP_EXEC_DYNAMIC_METHODDEF \ - {"exec_dynamic", (PyCFunction)_imp_exec_dynamic, METH_O, _imp_exec_dynamic__doc__}, + {"exec_dynamic", _imp_exec_dynamic, METH_O, _imp_exec_dynamic__doc__}, static int _imp_exec_dynamic_impl(PyObject *module, PyObject *mod); @@ -530,7 +530,7 @@ PyDoc_STRVAR(_imp_exec_builtin__doc__, "Initialize a built-in module."); #define _IMP_EXEC_BUILTIN_METHODDEF \ - {"exec_builtin", (PyCFunction)_imp_exec_builtin, METH_O, _imp_exec_builtin__doc__}, + {"exec_builtin", _imp_exec_builtin, METH_O, _imp_exec_builtin__doc__}, static int _imp_exec_builtin_impl(PyObject *module, PyObject *mod); @@ -625,4 +625,4 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=d0e278351d6adbb1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0b5e92e1f66778a4 input=a9049054013a1b77]*/ diff --git a/Python/clinic/instruction_sequence.c.h b/Python/clinic/instruction_sequence.c.h index 41ab2de44e426e..6920bbb3efa279 100644 --- a/Python/clinic/instruction_sequence.c.h +++ b/Python/clinic/instruction_sequence.c.h @@ -191,7 +191,7 @@ PyDoc_STRVAR(InstructionSequenceType_new_label__doc__, "Return a new label."); #define INSTRUCTIONSEQUENCETYPE_NEW_LABEL_METHODDEF \ - {"new_label", (PyCFunction)InstructionSequenceType_new_label, METH_NOARGS, InstructionSequenceType_new_label__doc__}, + {"new_label", InstructionSequenceType_new_label, METH_NOARGS, InstructionSequenceType_new_label__doc__}, static int InstructionSequenceType_new_label_impl(_PyInstructionSequence *self); @@ -276,7 +276,7 @@ PyDoc_STRVAR(InstructionSequenceType_get_nested__doc__, "Add a nested sequence."); #define INSTRUCTIONSEQUENCETYPE_GET_NESTED_METHODDEF \ - {"get_nested", (PyCFunction)InstructionSequenceType_get_nested, METH_NOARGS, InstructionSequenceType_get_nested__doc__}, + {"get_nested", InstructionSequenceType_get_nested, METH_NOARGS, InstructionSequenceType_get_nested__doc__}, static PyObject * InstructionSequenceType_get_nested_impl(_PyInstructionSequence *self); @@ -294,7 +294,7 @@ PyDoc_STRVAR(InstructionSequenceType_get_instructions__doc__, "Return the instructions as a list of tuples or labels."); #define INSTRUCTIONSEQUENCETYPE_GET_INSTRUCTIONS_METHODDEF \ - {"get_instructions", (PyCFunction)InstructionSequenceType_get_instructions, METH_NOARGS, InstructionSequenceType_get_instructions__doc__}, + {"get_instructions", InstructionSequenceType_get_instructions, METH_NOARGS, InstructionSequenceType_get_instructions__doc__}, static PyObject * InstructionSequenceType_get_instructions_impl(_PyInstructionSequence *self); @@ -304,4 +304,4 @@ InstructionSequenceType_get_instructions(PyObject *self, PyObject *Py_UNUSED(ign { return InstructionSequenceType_get_instructions_impl((_PyInstructionSequence *)self); } -/*[clinic end generated code: output=e6b5d05bde008cc2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=608608dbfba9a80c input=a9049054013a1b77]*/ diff --git a/Python/clinic/instrumentation.c.h b/Python/clinic/instrumentation.c.h index 9b3373bc1a67a5..7fee9c3b3628cf 100644 --- a/Python/clinic/instrumentation.c.h +++ b/Python/clinic/instrumentation.c.h @@ -42,7 +42,7 @@ PyDoc_STRVAR(monitoring_clear_tool_id__doc__, "\n"); #define MONITORING_CLEAR_TOOL_ID_METHODDEF \ - {"clear_tool_id", (PyCFunction)monitoring_clear_tool_id, METH_O, monitoring_clear_tool_id__doc__}, + {"clear_tool_id", monitoring_clear_tool_id, METH_O, monitoring_clear_tool_id__doc__}, static PyObject * monitoring_clear_tool_id_impl(PyObject *module, int tool_id); @@ -69,7 +69,7 @@ PyDoc_STRVAR(monitoring_free_tool_id__doc__, "\n"); #define MONITORING_FREE_TOOL_ID_METHODDEF \ - {"free_tool_id", (PyCFunction)monitoring_free_tool_id, METH_O, monitoring_free_tool_id__doc__}, + {"free_tool_id", monitoring_free_tool_id, METH_O, monitoring_free_tool_id__doc__}, static PyObject * monitoring_free_tool_id_impl(PyObject *module, int tool_id); @@ -96,7 +96,7 @@ PyDoc_STRVAR(monitoring_get_tool__doc__, "\n"); #define MONITORING_GET_TOOL_METHODDEF \ - {"get_tool", (PyCFunction)monitoring_get_tool, METH_O, monitoring_get_tool__doc__}, + {"get_tool", monitoring_get_tool, METH_O, monitoring_get_tool__doc__}, static PyObject * monitoring_get_tool_impl(PyObject *module, int tool_id); @@ -161,7 +161,7 @@ PyDoc_STRVAR(monitoring_get_events__doc__, "\n"); #define MONITORING_GET_EVENTS_METHODDEF \ - {"get_events", (PyCFunction)monitoring_get_events, METH_O, monitoring_get_events__doc__}, + {"get_events", monitoring_get_events, METH_O, monitoring_get_events__doc__}, static int monitoring_get_events_impl(PyObject *module, int tool_id); @@ -304,7 +304,7 @@ PyDoc_STRVAR(monitoring_restart_events__doc__, "\n"); #define MONITORING_RESTART_EVENTS_METHODDEF \ - {"restart_events", (PyCFunction)monitoring_restart_events, METH_NOARGS, monitoring_restart_events__doc__}, + {"restart_events", monitoring_restart_events, METH_NOARGS, monitoring_restart_events__doc__}, static PyObject * monitoring_restart_events_impl(PyObject *module); @@ -321,7 +321,7 @@ PyDoc_STRVAR(monitoring__all_events__doc__, "\n"); #define MONITORING__ALL_EVENTS_METHODDEF \ - {"_all_events", (PyCFunction)monitoring__all_events, METH_NOARGS, monitoring__all_events__doc__}, + {"_all_events", monitoring__all_events, METH_NOARGS, monitoring__all_events__doc__}, static PyObject * monitoring__all_events_impl(PyObject *module); @@ -331,4 +331,4 @@ monitoring__all_events(PyObject *module, PyObject *Py_UNUSED(ignored)) { return monitoring__all_events_impl(module); } -/*[clinic end generated code: output=8f81876c6aba9be8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c67603c41007f5ba input=a9049054013a1b77]*/ diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index 1e53624d4d45d7..8392497177b2f0 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -120,7 +120,7 @@ PyDoc_STRVAR(sys_displayhook__doc__, "Print an object to sys.stdout and also save it in builtins._"); #define SYS_DISPLAYHOOK_METHODDEF \ - {"displayhook", (PyCFunction)sys_displayhook, METH_O, sys_displayhook__doc__}, + {"displayhook", sys_displayhook, METH_O, sys_displayhook__doc__}, PyDoc_STRVAR(sys_excepthook__doc__, "excepthook($module, exctype, value, traceback, /)\n" @@ -166,7 +166,7 @@ PyDoc_STRVAR(sys_exception__doc__, "if no such exception exists."); #define SYS_EXCEPTION_METHODDEF \ - {"exception", (PyCFunction)sys_exception, METH_NOARGS, sys_exception__doc__}, + {"exception", sys_exception, METH_NOARGS, sys_exception__doc__}, static PyObject * sys_exception_impl(PyObject *module); @@ -187,7 +187,7 @@ PyDoc_STRVAR(sys_exc_info__doc__, "clause in the current stack frame or in an older stack frame."); #define SYS_EXC_INFO_METHODDEF \ - {"exc_info", (PyCFunction)sys_exc_info, METH_NOARGS, sys_exc_info__doc__}, + {"exc_info", sys_exc_info, METH_NOARGS, sys_exc_info__doc__}, static PyObject * sys_exc_info_impl(PyObject *module); @@ -213,7 +213,7 @@ PyDoc_STRVAR(sys_unraisablehook__doc__, "* object: Object causing the exception, can be None."); #define SYS_UNRAISABLEHOOK_METHODDEF \ - {"unraisablehook", (PyCFunction)sys_unraisablehook, METH_O, sys_unraisablehook__doc__}, + {"unraisablehook", sys_unraisablehook, METH_O, sys_unraisablehook__doc__}, PyDoc_STRVAR(sys_exit__doc__, "exit($module, status=None, /)\n" @@ -259,7 +259,7 @@ PyDoc_STRVAR(sys_getdefaultencoding__doc__, "Return the current default encoding used by the Unicode implementation."); #define SYS_GETDEFAULTENCODING_METHODDEF \ - {"getdefaultencoding", (PyCFunction)sys_getdefaultencoding, METH_NOARGS, sys_getdefaultencoding__doc__}, + {"getdefaultencoding", sys_getdefaultencoding, METH_NOARGS, sys_getdefaultencoding__doc__}, static PyObject * sys_getdefaultencoding_impl(PyObject *module); @@ -277,7 +277,7 @@ PyDoc_STRVAR(sys_getfilesystemencoding__doc__, "Return the encoding used to convert Unicode filenames to OS filenames."); #define SYS_GETFILESYSTEMENCODING_METHODDEF \ - {"getfilesystemencoding", (PyCFunction)sys_getfilesystemencoding, METH_NOARGS, sys_getfilesystemencoding__doc__}, + {"getfilesystemencoding", sys_getfilesystemencoding, METH_NOARGS, sys_getfilesystemencoding__doc__}, static PyObject * sys_getfilesystemencoding_impl(PyObject *module); @@ -295,7 +295,7 @@ PyDoc_STRVAR(sys_getfilesystemencodeerrors__doc__, "Return the error mode used Unicode to OS filename conversion."); #define SYS_GETFILESYSTEMENCODEERRORS_METHODDEF \ - {"getfilesystemencodeerrors", (PyCFunction)sys_getfilesystemencodeerrors, METH_NOARGS, sys_getfilesystemencodeerrors__doc__}, + {"getfilesystemencodeerrors", sys_getfilesystemencodeerrors, METH_NOARGS, sys_getfilesystemencodeerrors__doc__}, static PyObject * sys_getfilesystemencodeerrors_impl(PyObject *module); @@ -317,7 +317,7 @@ PyDoc_STRVAR(sys_intern__doc__, "the previously interned string object with the same value."); #define SYS_INTERN_METHODDEF \ - {"intern", (PyCFunction)sys_intern, METH_O, sys_intern__doc__}, + {"intern", sys_intern, METH_O, sys_intern__doc__}, static PyObject * sys_intern_impl(PyObject *module, PyObject *s); @@ -346,7 +346,7 @@ PyDoc_STRVAR(sys__is_interned__doc__, "Return True if the given string is \"interned\"."); #define SYS__IS_INTERNED_METHODDEF \ - {"_is_interned", (PyCFunction)sys__is_interned, METH_O, sys__is_interned__doc__}, + {"_is_interned", sys__is_interned, METH_O, sys__is_interned__doc__}, static int sys__is_interned_impl(PyObject *module, PyObject *string); @@ -382,7 +382,7 @@ PyDoc_STRVAR(sys__is_immortal__doc__, "This function should be used for specialized purposes only."); #define SYS__IS_IMMORTAL_METHODDEF \ - {"_is_immortal", (PyCFunction)sys__is_immortal, METH_O, sys__is_immortal__doc__}, + {"_is_immortal", sys__is_immortal, METH_O, sys__is_immortal__doc__}, static int sys__is_immortal_impl(PyObject *module, PyObject *op); @@ -413,7 +413,7 @@ PyDoc_STRVAR(sys_settrace__doc__, "in the library manual."); #define SYS_SETTRACE_METHODDEF \ - {"settrace", (PyCFunction)sys_settrace, METH_O, sys_settrace__doc__}, + {"settrace", sys_settrace, METH_O, sys_settrace__doc__}, PyDoc_STRVAR(sys__settraceallthreads__doc__, "_settraceallthreads($module, function, /)\n" @@ -425,7 +425,7 @@ PyDoc_STRVAR(sys__settraceallthreads__doc__, "in the library manual."); #define SYS__SETTRACEALLTHREADS_METHODDEF \ - {"_settraceallthreads", (PyCFunction)sys__settraceallthreads, METH_O, sys__settraceallthreads__doc__}, + {"_settraceallthreads", sys__settraceallthreads, METH_O, sys__settraceallthreads__doc__}, PyDoc_STRVAR(sys_gettrace__doc__, "gettrace($module, /)\n" @@ -436,7 +436,7 @@ PyDoc_STRVAR(sys_gettrace__doc__, "See the debugger chapter in the library manual."); #define SYS_GETTRACE_METHODDEF \ - {"gettrace", (PyCFunction)sys_gettrace, METH_NOARGS, sys_gettrace__doc__}, + {"gettrace", sys_gettrace, METH_NOARGS, sys_gettrace__doc__}, static PyObject * sys_gettrace_impl(PyObject *module); @@ -457,7 +457,7 @@ PyDoc_STRVAR(sys_setprofile__doc__, "chapter in the library manual."); #define SYS_SETPROFILE_METHODDEF \ - {"setprofile", (PyCFunction)sys_setprofile, METH_O, sys_setprofile__doc__}, + {"setprofile", sys_setprofile, METH_O, sys_setprofile__doc__}, PyDoc_STRVAR(sys__setprofileallthreads__doc__, "_setprofileallthreads($module, function, /)\n" @@ -469,7 +469,7 @@ PyDoc_STRVAR(sys__setprofileallthreads__doc__, "chapter in the library manual."); #define SYS__SETPROFILEALLTHREADS_METHODDEF \ - {"_setprofileallthreads", (PyCFunction)sys__setprofileallthreads, METH_O, sys__setprofileallthreads__doc__}, + {"_setprofileallthreads", sys__setprofileallthreads, METH_O, sys__setprofileallthreads__doc__}, PyDoc_STRVAR(sys_getprofile__doc__, "getprofile($module, /)\n" @@ -480,7 +480,7 @@ PyDoc_STRVAR(sys_getprofile__doc__, "See the profiler chapter in the library manual."); #define SYS_GETPROFILE_METHODDEF \ - {"getprofile", (PyCFunction)sys_getprofile, METH_NOARGS, sys_getprofile__doc__}, + {"getprofile", sys_getprofile, METH_NOARGS, sys_getprofile__doc__}, static PyObject * sys_getprofile_impl(PyObject *module); @@ -505,7 +505,7 @@ PyDoc_STRVAR(sys_setswitchinterval__doc__, "A typical value is 0.005 (5 milliseconds)."); #define SYS_SETSWITCHINTERVAL_METHODDEF \ - {"setswitchinterval", (PyCFunction)sys_setswitchinterval, METH_O, sys_setswitchinterval__doc__}, + {"setswitchinterval", sys_setswitchinterval, METH_O, sys_setswitchinterval__doc__}, static PyObject * sys_setswitchinterval_impl(PyObject *module, double interval); @@ -539,7 +539,7 @@ PyDoc_STRVAR(sys_getswitchinterval__doc__, "Return the current thread switch interval; see sys.setswitchinterval()."); #define SYS_GETSWITCHINTERVAL_METHODDEF \ - {"getswitchinterval", (PyCFunction)sys_getswitchinterval, METH_NOARGS, sys_getswitchinterval__doc__}, + {"getswitchinterval", sys_getswitchinterval, METH_NOARGS, sys_getswitchinterval__doc__}, static double sys_getswitchinterval_impl(PyObject *module); @@ -571,7 +571,7 @@ PyDoc_STRVAR(sys_setrecursionlimit__doc__, "dependent."); #define SYS_SETRECURSIONLIMIT_METHODDEF \ - {"setrecursionlimit", (PyCFunction)sys_setrecursionlimit, METH_O, sys_setrecursionlimit__doc__}, + {"setrecursionlimit", sys_setrecursionlimit, METH_O, sys_setrecursionlimit__doc__}, static PyObject * sys_setrecursionlimit_impl(PyObject *module, int new_limit); @@ -663,7 +663,7 @@ PyDoc_STRVAR(sys_get_coroutine_origin_tracking_depth__doc__, "Check status of origin tracking for coroutine objects in this thread."); #define SYS_GET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF \ - {"get_coroutine_origin_tracking_depth", (PyCFunction)sys_get_coroutine_origin_tracking_depth, METH_NOARGS, sys_get_coroutine_origin_tracking_depth__doc__}, + {"get_coroutine_origin_tracking_depth", sys_get_coroutine_origin_tracking_depth, METH_NOARGS, sys_get_coroutine_origin_tracking_depth__doc__}, static int sys_get_coroutine_origin_tracking_depth_impl(PyObject *module); @@ -693,7 +693,7 @@ PyDoc_STRVAR(sys_get_asyncgen_hooks__doc__, "This returns a namedtuple of the form (firstiter, finalizer)."); #define SYS_GET_ASYNCGEN_HOOKS_METHODDEF \ - {"get_asyncgen_hooks", (PyCFunction)sys_get_asyncgen_hooks, METH_NOARGS, sys_get_asyncgen_hooks__doc__}, + {"get_asyncgen_hooks", sys_get_asyncgen_hooks, METH_NOARGS, sys_get_asyncgen_hooks__doc__}, static PyObject * sys_get_asyncgen_hooks_impl(PyObject *module); @@ -715,7 +715,7 @@ PyDoc_STRVAR(sys_getrecursionlimit__doc__, "of the C stack and crashing Python."); #define SYS_GETRECURSIONLIMIT_METHODDEF \ - {"getrecursionlimit", (PyCFunction)sys_getrecursionlimit, METH_NOARGS, sys_getrecursionlimit__doc__}, + {"getrecursionlimit", sys_getrecursionlimit, METH_NOARGS, sys_getrecursionlimit__doc__}, static PyObject * sys_getrecursionlimit_impl(PyObject *module); @@ -745,7 +745,7 @@ PyDoc_STRVAR(sys_getwindowsversion__doc__, "intended for identifying the OS rather than feature detection."); #define SYS_GETWINDOWSVERSION_METHODDEF \ - {"getwindowsversion", (PyCFunction)sys_getwindowsversion, METH_NOARGS, sys_getwindowsversion__doc__}, + {"getwindowsversion", sys_getwindowsversion, METH_NOARGS, sys_getwindowsversion__doc__}, static PyObject * sys_getwindowsversion_impl(PyObject *module); @@ -773,7 +773,7 @@ PyDoc_STRVAR(sys__enablelegacywindowsfsencoding__doc__, "environment variable before launching Python."); #define SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF \ - {"_enablelegacywindowsfsencoding", (PyCFunction)sys__enablelegacywindowsfsencoding, METH_NOARGS, sys__enablelegacywindowsfsencoding__doc__}, + {"_enablelegacywindowsfsencoding", sys__enablelegacywindowsfsencoding, METH_NOARGS, sys__enablelegacywindowsfsencoding__doc__}, static PyObject * sys__enablelegacywindowsfsencoding_impl(PyObject *module); @@ -803,7 +803,7 @@ PyDoc_STRVAR(sys_setdlopenflags__doc__, "os.RTLD_LAZY)."); #define SYS_SETDLOPENFLAGS_METHODDEF \ - {"setdlopenflags", (PyCFunction)sys_setdlopenflags, METH_O, sys_setdlopenflags__doc__}, + {"setdlopenflags", sys_setdlopenflags, METH_O, sys_setdlopenflags__doc__}, static PyObject * sys_setdlopenflags_impl(PyObject *module, int new_val); @@ -837,7 +837,7 @@ PyDoc_STRVAR(sys_getdlopenflags__doc__, "The flag constants are defined in the os module."); #define SYS_GETDLOPENFLAGS_METHODDEF \ - {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_NOARGS, sys_getdlopenflags__doc__}, + {"getdlopenflags", sys_getdlopenflags, METH_NOARGS, sys_getdlopenflags__doc__}, static PyObject * sys_getdlopenflags_impl(PyObject *module); @@ -858,7 +858,7 @@ PyDoc_STRVAR(sys_mdebug__doc__, "\n"); #define SYS_MDEBUG_METHODDEF \ - {"mdebug", (PyCFunction)sys_mdebug, METH_O, sys_mdebug__doc__}, + {"mdebug", sys_mdebug, METH_O, sys_mdebug__doc__}, static PyObject * sys_mdebug_impl(PyObject *module, int flag); @@ -888,7 +888,7 @@ PyDoc_STRVAR(sys_get_int_max_str_digits__doc__, "Return the maximum string digits limit for non-binary int<->str conversions."); #define SYS_GET_INT_MAX_STR_DIGITS_METHODDEF \ - {"get_int_max_str_digits", (PyCFunction)sys_get_int_max_str_digits, METH_NOARGS, sys_get_int_max_str_digits__doc__}, + {"get_int_max_str_digits", sys_get_int_max_str_digits, METH_NOARGS, sys_get_int_max_str_digits__doc__}, static PyObject * sys_get_int_max_str_digits_impl(PyObject *module); @@ -969,7 +969,7 @@ PyDoc_STRVAR(sys_getrefcount__doc__, "getrefcount()."); #define SYS_GETREFCOUNT_METHODDEF \ - {"getrefcount", (PyCFunction)sys_getrefcount, METH_O, sys_getrefcount__doc__}, + {"getrefcount", sys_getrefcount, METH_O, sys_getrefcount__doc__}, static Py_ssize_t sys_getrefcount_impl(PyObject *module, PyObject *object); @@ -998,7 +998,7 @@ PyDoc_STRVAR(sys_gettotalrefcount__doc__, "\n"); #define SYS_GETTOTALREFCOUNT_METHODDEF \ - {"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS, sys_gettotalrefcount__doc__}, + {"gettotalrefcount", sys_gettotalrefcount, METH_NOARGS, sys_gettotalrefcount__doc__}, static Py_ssize_t sys_gettotalrefcount_impl(PyObject *module); @@ -1028,7 +1028,7 @@ PyDoc_STRVAR(sys_getallocatedblocks__doc__, "Return the number of memory blocks currently allocated."); #define SYS_GETALLOCATEDBLOCKS_METHODDEF \ - {"getallocatedblocks", (PyCFunction)sys_getallocatedblocks, METH_NOARGS, sys_getallocatedblocks__doc__}, + {"getallocatedblocks", sys_getallocatedblocks, METH_NOARGS, sys_getallocatedblocks__doc__}, static Py_ssize_t sys_getallocatedblocks_impl(PyObject *module); @@ -1170,7 +1170,7 @@ PyDoc_STRVAR(sys__current_frames__doc__, "This function should be used for specialized purposes only."); #define SYS__CURRENT_FRAMES_METHODDEF \ - {"_current_frames", (PyCFunction)sys__current_frames, METH_NOARGS, sys__current_frames__doc__}, + {"_current_frames", sys__current_frames, METH_NOARGS, sys__current_frames__doc__}, static PyObject * sys__current_frames_impl(PyObject *module); @@ -1190,7 +1190,7 @@ PyDoc_STRVAR(sys__current_exceptions__doc__, "This function should be used for specialized purposes only."); #define SYS__CURRENT_EXCEPTIONS_METHODDEF \ - {"_current_exceptions", (PyCFunction)sys__current_exceptions, METH_NOARGS, sys__current_exceptions__doc__}, + {"_current_exceptions", sys__current_exceptions, METH_NOARGS, sys__current_exceptions__doc__}, static PyObject * sys__current_exceptions_impl(PyObject *module); @@ -1249,7 +1249,7 @@ PyDoc_STRVAR(sys__debugmallocstats__doc__, "checks."); #define SYS__DEBUGMALLOCSTATS_METHODDEF \ - {"_debugmallocstats", (PyCFunction)sys__debugmallocstats, METH_NOARGS, sys__debugmallocstats__doc__}, + {"_debugmallocstats", sys__debugmallocstats, METH_NOARGS, sys__debugmallocstats__doc__}, static PyObject * sys__debugmallocstats_impl(PyObject *module); @@ -1267,7 +1267,7 @@ PyDoc_STRVAR(sys__clear_type_cache__doc__, "Clear the internal type lookup cache."); #define SYS__CLEAR_TYPE_CACHE_METHODDEF \ - {"_clear_type_cache", (PyCFunction)sys__clear_type_cache, METH_NOARGS, sys__clear_type_cache__doc__}, + {"_clear_type_cache", sys__clear_type_cache, METH_NOARGS, sys__clear_type_cache__doc__}, static PyObject * sys__clear_type_cache_impl(PyObject *module); @@ -1285,7 +1285,7 @@ PyDoc_STRVAR(sys__clear_internal_caches__doc__, "Clear all internal performance-related caches."); #define SYS__CLEAR_INTERNAL_CACHES_METHODDEF \ - {"_clear_internal_caches", (PyCFunction)sys__clear_internal_caches, METH_NOARGS, sys__clear_internal_caches__doc__}, + {"_clear_internal_caches", sys__clear_internal_caches, METH_NOARGS, sys__clear_internal_caches__doc__}, static PyObject * sys__clear_internal_caches_impl(PyObject *module); @@ -1303,7 +1303,7 @@ PyDoc_STRVAR(sys_is_finalizing__doc__, "Return True if Python is exiting."); #define SYS_IS_FINALIZING_METHODDEF \ - {"is_finalizing", (PyCFunction)sys_is_finalizing, METH_NOARGS, sys_is_finalizing__doc__}, + {"is_finalizing", sys_is_finalizing, METH_NOARGS, sys_is_finalizing__doc__}, static PyObject * sys_is_finalizing_impl(PyObject *module); @@ -1323,7 +1323,7 @@ PyDoc_STRVAR(sys__stats_on__doc__, "Turns on stats gathering (stats gathering is off by default)."); #define SYS__STATS_ON_METHODDEF \ - {"_stats_on", (PyCFunction)sys__stats_on, METH_NOARGS, sys__stats_on__doc__}, + {"_stats_on", sys__stats_on, METH_NOARGS, sys__stats_on__doc__}, static PyObject * sys__stats_on_impl(PyObject *module); @@ -1345,7 +1345,7 @@ PyDoc_STRVAR(sys__stats_off__doc__, "Turns off stats gathering (stats gathering is off by default)."); #define SYS__STATS_OFF_METHODDEF \ - {"_stats_off", (PyCFunction)sys__stats_off, METH_NOARGS, sys__stats_off__doc__}, + {"_stats_off", sys__stats_off, METH_NOARGS, sys__stats_off__doc__}, static PyObject * sys__stats_off_impl(PyObject *module); @@ -1367,7 +1367,7 @@ PyDoc_STRVAR(sys__stats_clear__doc__, "Clears the stats."); #define SYS__STATS_CLEAR_METHODDEF \ - {"_stats_clear", (PyCFunction)sys__stats_clear, METH_NOARGS, sys__stats_clear__doc__}, + {"_stats_clear", sys__stats_clear, METH_NOARGS, sys__stats_clear__doc__}, static PyObject * sys__stats_clear_impl(PyObject *module); @@ -1391,7 +1391,7 @@ PyDoc_STRVAR(sys__stats_dump__doc__, "Return False if no statistics were not dumped because stats gathering was off."); #define SYS__STATS_DUMP_METHODDEF \ - {"_stats_dump", (PyCFunction)sys__stats_dump, METH_NOARGS, sys__stats_dump__doc__}, + {"_stats_dump", sys__stats_dump, METH_NOARGS, sys__stats_dump__doc__}, static int sys__stats_dump_impl(PyObject *module); @@ -1423,7 +1423,7 @@ PyDoc_STRVAR(sys_getandroidapilevel__doc__, "Return the build time API version of Android as an integer."); #define SYS_GETANDROIDAPILEVEL_METHODDEF \ - {"getandroidapilevel", (PyCFunction)sys_getandroidapilevel, METH_NOARGS, sys_getandroidapilevel__doc__}, + {"getandroidapilevel", sys_getandroidapilevel, METH_NOARGS, sys_getandroidapilevel__doc__}, static PyObject * sys_getandroidapilevel_impl(PyObject *module); @@ -1443,7 +1443,7 @@ PyDoc_STRVAR(sys_activate_stack_trampoline__doc__, "Activate stack profiler trampoline *backend*."); #define SYS_ACTIVATE_STACK_TRAMPOLINE_METHODDEF \ - {"activate_stack_trampoline", (PyCFunction)sys_activate_stack_trampoline, METH_O, sys_activate_stack_trampoline__doc__}, + {"activate_stack_trampoline", sys_activate_stack_trampoline, METH_O, sys_activate_stack_trampoline__doc__}, static PyObject * sys_activate_stack_trampoline_impl(PyObject *module, const char *backend); @@ -1482,7 +1482,7 @@ PyDoc_STRVAR(sys_deactivate_stack_trampoline__doc__, "If no stack profiler is activated, this function has no effect."); #define SYS_DEACTIVATE_STACK_TRAMPOLINE_METHODDEF \ - {"deactivate_stack_trampoline", (PyCFunction)sys_deactivate_stack_trampoline, METH_NOARGS, sys_deactivate_stack_trampoline__doc__}, + {"deactivate_stack_trampoline", sys_deactivate_stack_trampoline, METH_NOARGS, sys_deactivate_stack_trampoline__doc__}, static PyObject * sys_deactivate_stack_trampoline_impl(PyObject *module); @@ -1500,7 +1500,7 @@ PyDoc_STRVAR(sys_is_stack_trampoline_active__doc__, "Return *True* if a stack profiler trampoline is active."); #define SYS_IS_STACK_TRAMPOLINE_ACTIVE_METHODDEF \ - {"is_stack_trampoline_active", (PyCFunction)sys_is_stack_trampoline_active, METH_NOARGS, sys_is_stack_trampoline_active__doc__}, + {"is_stack_trampoline_active", sys_is_stack_trampoline_active, METH_NOARGS, sys_is_stack_trampoline_active__doc__}, static PyObject * sys_is_stack_trampoline_active_impl(PyObject *module); @@ -1644,7 +1644,7 @@ PyDoc_STRVAR(sys__get_cpu_count_config__doc__, "Private function for getting PyConfig.cpu_count"); #define SYS__GET_CPU_COUNT_CONFIG_METHODDEF \ - {"_get_cpu_count_config", (PyCFunction)sys__get_cpu_count_config, METH_NOARGS, sys__get_cpu_count_config__doc__}, + {"_get_cpu_count_config", sys__get_cpu_count_config, METH_NOARGS, sys__get_cpu_count_config__doc__}, static int sys__get_cpu_count_config_impl(PyObject *module); @@ -1672,7 +1672,7 @@ PyDoc_STRVAR(sys__baserepl__doc__, "Private function for getting the base REPL"); #define SYS__BASEREPL_METHODDEF \ - {"_baserepl", (PyCFunction)sys__baserepl, METH_NOARGS, sys__baserepl__doc__}, + {"_baserepl", sys__baserepl, METH_NOARGS, sys__baserepl__doc__}, static PyObject * sys__baserepl_impl(PyObject *module); @@ -1690,7 +1690,7 @@ PyDoc_STRVAR(sys__is_gil_enabled__doc__, "Return True if the GIL is currently enabled and False otherwise."); #define SYS__IS_GIL_ENABLED_METHODDEF \ - {"_is_gil_enabled", (PyCFunction)sys__is_gil_enabled, METH_NOARGS, sys__is_gil_enabled__doc__}, + {"_is_gil_enabled", sys__is_gil_enabled, METH_NOARGS, sys__is_gil_enabled__doc__}, static int sys__is_gil_enabled_impl(PyObject *module); @@ -1754,4 +1754,4 @@ sys__is_gil_enabled(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=1e5f608092c12636 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f600d96ec198ada5 input=a9049054013a1b77]*/ diff --git a/Tools/clinic/libclinic/dsl_parser.py b/Tools/clinic/libclinic/dsl_parser.py index 4b4a8b9969d142..b5d04edf247c0d 100644 --- a/Tools/clinic/libclinic/dsl_parser.py +++ b/Tools/clinic/libclinic/dsl_parser.py @@ -260,6 +260,7 @@ class DSLParser: preserve_output: bool critical_section: bool target_critical_section: list[str] + disable_fastcall: bool from_version_re = re.compile(r'([*/]) +\[from +(.+)\]') def __init__(self, clinic: Clinic) -> None: @@ -296,6 +297,7 @@ def reset(self) -> None: self.preserve_output = False self.critical_section = False self.target_critical_section = [] + self.disable_fastcall = False def directive_module(self, name: str) -> None: fields = name.split('.')[:-1] @@ -423,6 +425,13 @@ def at_critical_section(self, *args: str) -> None: self.target_critical_section.extend(args) self.critical_section = True + def at_disable(self, *args: str) -> None: + if self.kind is not CALLABLE: + fail("Can't set @disable, function is not a normal callable") + if not args: + fail("@disable expects at least one argument") + self.disable_fastcall = 'fastcall' in args + def at_getter(self) -> None: match self.kind: case FunctionKind.GETTER: @@ -691,6 +700,7 @@ def state_modulename_name(self, line: str) -> None: kind=self.kind, coexist=self.coexist, critical_section=self.critical_section, + disable_fastcall=self.disable_fastcall, target_critical_section=self.target_critical_section, forced_text_signature=self.forced_text_signature ) diff --git a/Tools/clinic/libclinic/function.py b/Tools/clinic/libclinic/function.py index 93901263e44c04..e80e2f5f13f648 100644 --- a/Tools/clinic/libclinic/function.py +++ b/Tools/clinic/libclinic/function.py @@ -109,6 +109,7 @@ class Function: docstring_only: bool = False forced_text_signature: str | None = None critical_section: bool = False + disable_fastcall: bool = False target_critical_section: list[str] = dc.field(default_factory=list) def __post_init__(self) -> None: diff --git a/Tools/clinic/libclinic/parse_args.py b/Tools/clinic/libclinic/parse_args.py index 3a08f37afab796..a28167441a2b39 100644 --- a/Tools/clinic/libclinic/parse_args.py +++ b/Tools/clinic/libclinic/parse_args.py @@ -258,7 +258,10 @@ def __init__(self, func: Function, codegen: CodeGen) -> None: if self.func.critical_section: self.codegen.add_include('pycore_critical_section.h', 'Py_BEGIN_CRITICAL_SECTION()') - self.fastcall = not self.is_new_or_init() + if self.func.disable_fastcall: + self.fastcall = False + else: + self.fastcall = not self.is_new_or_init() self.pos_only = 0 self.min_pos = 0 @@ -831,9 +834,9 @@ def handle_new_or_init(self) -> None: def process_methoddef(self, clang: CLanguage) -> None: methoddef_cast_end = "" if self.flags in ('METH_NOARGS', 'METH_O', 'METH_VARARGS'): - methoddef_cast = "(PyCFunction)" + methoddef_cast = "" # no need to cast to PyCFunction elif self.func.kind is GETTER: - methoddef_cast = "" # This should end up unused + methoddef_cast = "" # This should end up unused elif self.limited_capi: methoddef_cast = "(PyCFunction)(void(*)(void))" else: From 4001c734022088eba7a403dc01fe6645dd3276fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Thu, 20 Mar 2025 19:46:06 +0100 Subject: [PATCH 02/12] fixup --- Modules/_testclinic.c | 71 ++++++-------- Modules/clinic/_testclinic.c.h | 142 +++++++++++---------------- Tools/clinic/libclinic/dsl_parser.py | 10 -- Tools/clinic/libclinic/parse_args.py | 5 +- 4 files changed, 88 insertions(+), 140 deletions(-) diff --git a/Modules/_testclinic.c b/Modules/_testclinic.c index 7b937191490237..b20f247bb2fca6 100644 --- a/Modules/_testclinic.c +++ b/Modules/_testclinic.c @@ -1444,9 +1444,8 @@ _testclinic_TestClass_defclass_posonly_varpos_impl(PyObject *self, /*[clinic input] -@disable fastcall @classmethod -_testclinic.TestClass.class_method as varpos_no_fastcall +_testclinic.TestClass.__new__ as varpos_no_fastcall *args: tuple @@ -1454,16 +1453,15 @@ _testclinic.TestClass.class_method as varpos_no_fastcall static PyObject * varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) -/*[clinic end generated code: output=04e94f2898bb2dde input=10c2251e9ac6baf3]*/ +/*[clinic end generated code: output=04e94f2898bb2dde input=c5d3d30a6589f97f]*/ { return Py_NewRef(args); } /*[clinic input] -@disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_varpos_no_fastcall +_testclinic.TestClass.__new__ as posonly_varpos_no_fastcall a: object b: object @@ -1475,16 +1473,15 @@ _testclinic.TestClass.class_method as posonly_varpos_no_fastcall static PyObject * posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=b0a0425719f69f5a input=f7c75501a787c7af]*/ +/*[clinic end generated code: output=b0a0425719f69f5a input=10f29f2c2c6bfdc4]*/ { return pack_arguments_newref(3, a, b, args); } /*[clinic input] -@disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_req_opt_varpos_no_fastcall +_testclinic.TestClass.__new__ as posonly_req_opt_varpos_no_fastcall a: object b: object = False @@ -1496,16 +1493,15 @@ _testclinic.TestClass.class_method as posonly_req_opt_varpos_no_fastcall static PyObject * posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=3c44915b1a554e2d input=701bf93e7572e6b3]*/ +/*[clinic end generated code: output=3c44915b1a554e2d input=d319302a8748147c]*/ { return pack_arguments_newref(3, a, b, args); } /*[clinic input] -@disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_poskw_varpos_no_fastcall +_testclinic.TestClass.__new__ as posonly_poskw_varpos_no_fastcall a: object / @@ -1517,16 +1513,15 @@ _testclinic.TestClass.class_method as posonly_poskw_varpos_no_fastcall static PyObject * posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=6ad74bed4bdc7f96 input=2bbbc74dc92ba7ba]*/ +/*[clinic end generated code: output=6ad74bed4bdc7f96 input=1f8c113e749414a3]*/ { return pack_arguments_newref(3, a, b, args); } /*[clinic input] -@disable fastcall @classmethod -_testclinic.TestClass.class_method as varpos_array_no_fastcall +_testclinic.TestClass.__new__ as varpos_array_no_fastcall *args: array @@ -1535,16 +1530,15 @@ _testclinic.TestClass.class_method as varpos_array_no_fastcall static PyObject * varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=f99d984346c60d42 input=de625878254ecac0]*/ +/*[clinic end generated code: output=f99d984346c60d42 input=368d8eea6de48c12]*/ { return _PyTuple_FromArray(args, args_length); } /*[clinic input] -@disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_varpos_array_no_fastcall +_testclinic.TestClass.__new__ as posonly_varpos_array_no_fastcall a: object b: object @@ -1557,16 +1551,15 @@ static PyObject * posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=1eec4da1fb5b5978 input=15adeb514423f485]*/ +/*[clinic end generated code: output=1eec4da1fb5b5978 input=7330c8d819a23548]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } /*[clinic input] -@disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_req_opt_varpos_array_no_fastcall +_testclinic.TestClass.__new__ as posonly_req_opt_varpos_array_no_fastcall a: object b: object = False @@ -1580,16 +1573,15 @@ posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=88041c2176135218 input=445ff173a49709d5]*/ +/*[clinic end generated code: output=88041c2176135218 input=7f5fd34ee5f9e0bf]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } /*[clinic input] -@disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_poskw_varpos_array_no_fastcall +_testclinic.TestClass.__new__ as posonly_poskw_varpos_array_no_fastcall a: object / @@ -1603,7 +1595,7 @@ posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=70eda18c3667681e input=c0ac0f6b990f553c]*/ +/*[clinic end generated code: output=70eda18c3667681e input=2b0fcd7bd9bb865c]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } @@ -1614,27 +1606,28 @@ static struct PyMethodDef test_class_methods[] = { _TESTCLINIC_TESTCLASS_DEFCLASS_VARPOS_METHODDEF _TESTCLINIC_TESTCLASS_DEFCLASS_POSONLY_VARPOS_METHODDEF - {"varpos_no_fastcall", _PyCFunction_CAST(varpos_no_fastcall), - METH_VARARGS|METH_CLASS, ""}, - {"posonly_varpos_no_fastcall", _PyCFunction_CAST(posonly_varpos_no_fastcall), - METH_VARARGS|METH_CLASS, ""}, - {"posonly_req_opt_varpos_no_fastcall", _PyCFunction_CAST(posonly_req_opt_varpos_no_fastcall), - METH_VARARGS|METH_CLASS, ""}, - {"posonly_poskw_varpos_no_fastcall", _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + {"varpos_no_fastcall", varpos_no_fastcall, + METH_VARARGS|METH_CLASS, PyDoc_STR("")}, + {"posonly_varpos_no_fastcall", posonly_varpos_no_fastcall, + METH_VARARGS|METH_CLASS, PyDoc_STR("")}, + {"posonly_req_opt_varpos_no_fastcall", posonly_req_opt_varpos_no_fastcall, + METH_VARARGS|METH_CLASS, PyDoc_STR("")}, + {"posonly_poskw_varpos_no_fastcall", + _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), + METH_VARARGS|METH_KEYWORDS|METH_CLASS, PyDoc_STR("")}, {"varpos_array_no_fastcall", - _PyCFunction_CAST(varpos_array_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + varpos_array_no_fastcall, + METH_VARARGS|METH_CLASS, PyDoc_STR("")}, {"posonly_varpos_array_no_fastcall", - _PyCFunction_CAST(posonly_varpos_array_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + posonly_varpos_array_no_fastcall, + METH_VARARGS|METH_CLASS, PyDoc_STR("")}, {"posonly_req_opt_varpos_array_no_fastcall", - _PyCFunction_CAST(posonly_req_opt_varpos_array_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + posonly_req_opt_varpos_array_no_fastcall, + METH_VARARGS|METH_CLASS, PyDoc_STR("")}, {"posonly_poskw_varpos_array_no_fastcall", _PyCFunction_CAST(posonly_poskw_varpos_array_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + METH_VARARGS|METH_KEYWORDS|METH_CLASS, PyDoc_STR("")}, {NULL, NULL} }; diff --git a/Modules/clinic/_testclinic.c.h b/Modules/clinic/_testclinic.c.h index 96c3541cc0c248..2a3a0528496b73 100644 --- a/Modules/clinic/_testclinic.c.h +++ b/Modules/clinic/_testclinic.c.h @@ -4005,53 +4005,48 @@ _testclinic_TestClass_defclass_posonly_varpos(PyObject *self, PyTypeObject *cls, return return_value; } -PyDoc_STRVAR(varpos_no_fastcall__doc__, -"class_method($type, /, *args)\n" -"--\n" -"\n"); - -#define VARPOS_NO_FASTCALL_METHODDEF \ - {"class_method", varpos_no_fastcall, METH_VARARGS|METH_CLASS, varpos_no_fastcall__doc__}, - static PyObject * varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args); static PyObject * -varpos_no_fastcall(PyObject *type, PyObject *args) +varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; + PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *__clinic_args = NULL; + if ((type == base_tp || type->tp_init == base_tp->tp_init) && + !_PyArg_NoKeywords("TestClass", kwargs)) { + goto exit; + } __clinic_args = Py_NewRef(args); - return_value = varpos_no_fastcall_impl((PyTypeObject *)type, __clinic_args); + return_value = varpos_no_fastcall_impl(type, __clinic_args); +exit: /* Cleanup for args */ Py_XDECREF(__clinic_args); return return_value; } -PyDoc_STRVAR(posonly_varpos_no_fastcall__doc__, -"class_method($type, a, b, /, *args)\n" -"--\n" -"\n"); - -#define POSONLY_VARPOS_NO_FASTCALL_METHODDEF \ - {"class_method", posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_no_fastcall__doc__}, - static PyObject * posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args); static PyObject * -posonly_varpos_no_fastcall(PyObject *type, PyObject *args) +posonly_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; + PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b; PyObject *__clinic_args = NULL; - if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { + if ((type == base_tp || type->tp_init == base_tp->tp_init) && + !_PyArg_NoKeywords("TestClass", kwargs)) { + goto exit; + } + if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4060,7 +4055,7 @@ posonly_varpos_no_fastcall(PyObject *type, PyObject *args) if (!__clinic_args) { goto exit; } - return_value = posonly_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); + return_value = posonly_varpos_no_fastcall_impl(type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4069,27 +4064,24 @@ posonly_varpos_no_fastcall(PyObject *type, PyObject *args) return return_value; } -PyDoc_STRVAR(posonly_req_opt_varpos_no_fastcall__doc__, -"class_method($type, a, b=False, /, *args)\n" -"--\n" -"\n"); - -#define POSONLY_REQ_OPT_VARPOS_NO_FASTCALL_METHODDEF \ - {"class_method", posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_no_fastcall__doc__}, - static PyObject * posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args); static PyObject * -posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) +posonly_req_opt_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; + PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b = Py_False; PyObject *__clinic_args = NULL; - if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { + if ((type == base_tp || type->tp_init == base_tp->tp_init) && + !_PyArg_NoKeywords("TestClass", kwargs)) { + goto exit; + } + if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4102,7 +4094,7 @@ posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) if (!__clinic_args) { goto exit; } - return_value = posonly_req_opt_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); + return_value = posonly_req_opt_varpos_no_fastcall_impl(type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4111,20 +4103,12 @@ posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) return return_value; } -PyDoc_STRVAR(posonly_poskw_varpos_no_fastcall__doc__, -"class_method($type, a, /, b, *args)\n" -"--\n" -"\n"); - -#define POSONLY_POSKW_VARPOS_NO_FASTCALL_METHODDEF \ - {"class_method", _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_no_fastcall__doc__}, - static PyObject * posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args); static PyObject * -posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs) +posonly_poskw_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) @@ -4148,7 +4132,7 @@ posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwarg static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, - .fname = "class_method", + .fname = "TestClass", .kwtuple = KWTUPLE, }; #undef KWTUPLE @@ -4170,7 +4154,7 @@ posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwarg if (!__clinic_args) { goto exit; } - return_value = posonly_poskw_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); + return_value = posonly_poskw_varpos_no_fastcall_impl(type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4179,75 +4163,62 @@ posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwarg return return_value; } -PyDoc_STRVAR(varpos_array_no_fastcall__doc__, -"class_method($type, /, *args)\n" -"--\n" -"\n"); - -#define VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"class_method", varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, varpos_array_no_fastcall__doc__}, - static PyObject * varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, Py_ssize_t args_length); static PyObject * -varpos_array_no_fastcall(PyObject *type, PyObject *args) +varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; + PyTypeObject *base_tp = &PyBaseObject_Type; PyObject * const *__clinic_args; Py_ssize_t args_length; + if ((type == base_tp || type->tp_init == base_tp->tp_init) && + !_PyArg_NoKeywords("TestClass", kwargs)) { + goto exit; + } __clinic_args = _PyTuple_ITEMS(args); args_length = PyTuple_GET_SIZE(args); - return_value = varpos_array_no_fastcall_impl((PyTypeObject *)type, __clinic_args, args_length); + return_value = varpos_array_no_fastcall_impl(type, __clinic_args, args_length); +exit: return return_value; } -PyDoc_STRVAR(posonly_varpos_array_no_fastcall__doc__, -"class_method($type, a, b, /, *args)\n" -"--\n" -"\n"); - -#define POSONLY_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"class_method", posonly_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_array_no_fastcall__doc__}, - static PyObject * posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length); static PyObject * -posonly_varpos_array_no_fastcall(PyObject *type, PyObject *args) +posonly_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; + PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b; PyObject * const *__clinic_args; Py_ssize_t args_length; - if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { + if ((type == base_tp || type->tp_init == base_tp->tp_init) && + !_PyArg_NoKeywords("TestClass", kwargs)) { + goto exit; + } + if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); b = PyTuple_GET_ITEM(args, 1); __clinic_args = _PyTuple_ITEMS(args) + 2; args_length = PyTuple_GET_SIZE(args) - 2; - return_value = posonly_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); + return_value = posonly_varpos_array_no_fastcall_impl(type, a, b, __clinic_args, args_length); exit: return return_value; } -PyDoc_STRVAR(posonly_req_opt_varpos_array_no_fastcall__doc__, -"class_method($type, a, b=False, /, *args)\n" -"--\n" -"\n"); - -#define POSONLY_REQ_OPT_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"class_method", posonly_req_opt_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_array_no_fastcall__doc__}, - static PyObject * posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, @@ -4255,15 +4226,20 @@ posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, Py_ssize_t args_length); static PyObject * -posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args) +posonly_req_opt_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; + PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b = Py_False; PyObject * const *__clinic_args; Py_ssize_t args_length; - if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { + if ((type == base_tp || type->tp_init == base_tp->tp_init) && + !_PyArg_NoKeywords("TestClass", kwargs)) { + goto exit; + } + if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4274,20 +4250,12 @@ posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args) skip_optional: __clinic_args = PyTuple_GET_SIZE(args) > 2 ? _PyTuple_ITEMS(args) + 2 : _PyTuple_ITEMS(args); args_length = Py_MAX(0, PyTuple_GET_SIZE(args) - 2); - return_value = posonly_req_opt_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); + return_value = posonly_req_opt_varpos_array_no_fastcall_impl(type, a, b, __clinic_args, args_length); exit: return return_value; } -PyDoc_STRVAR(posonly_poskw_varpos_array_no_fastcall__doc__, -"class_method($type, a, /, b, *args)\n" -"--\n" -"\n"); - -#define POSONLY_POSKW_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"class_method", _PyCFunction_CAST(posonly_poskw_varpos_array_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_array_no_fastcall__doc__}, - static PyObject * posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, @@ -4295,7 +4263,7 @@ posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, Py_ssize_t args_length); static PyObject * -posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs) +posonly_poskw_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) @@ -4319,7 +4287,7 @@ posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, - .fname = "class_method", + .fname = "TestClass", .kwtuple = KWTUPLE, }; #undef KWTUPLE @@ -4340,9 +4308,9 @@ posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject b = fastargs[1]; __clinic_args = PyTuple_GET_SIZE(args) > 2 ? _PyTuple_ITEMS(args) + 2 : _PyTuple_ITEMS(args); args_length = Py_MAX(0, PyTuple_GET_SIZE(args) - 2); - return_value = posonly_poskw_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); + return_value = posonly_poskw_varpos_array_no_fastcall_impl(type, a, b, __clinic_args, args_length); exit: return return_value; } -/*[clinic end generated code: output=181834e956ff0fea input=a9049054013a1b77]*/ +/*[clinic end generated code: output=07b1350399ae051b input=a9049054013a1b77]*/ diff --git a/Tools/clinic/libclinic/dsl_parser.py b/Tools/clinic/libclinic/dsl_parser.py index b5d04edf247c0d..4b4a8b9969d142 100644 --- a/Tools/clinic/libclinic/dsl_parser.py +++ b/Tools/clinic/libclinic/dsl_parser.py @@ -260,7 +260,6 @@ class DSLParser: preserve_output: bool critical_section: bool target_critical_section: list[str] - disable_fastcall: bool from_version_re = re.compile(r'([*/]) +\[from +(.+)\]') def __init__(self, clinic: Clinic) -> None: @@ -297,7 +296,6 @@ def reset(self) -> None: self.preserve_output = False self.critical_section = False self.target_critical_section = [] - self.disable_fastcall = False def directive_module(self, name: str) -> None: fields = name.split('.')[:-1] @@ -425,13 +423,6 @@ def at_critical_section(self, *args: str) -> None: self.target_critical_section.extend(args) self.critical_section = True - def at_disable(self, *args: str) -> None: - if self.kind is not CALLABLE: - fail("Can't set @disable, function is not a normal callable") - if not args: - fail("@disable expects at least one argument") - self.disable_fastcall = 'fastcall' in args - def at_getter(self) -> None: match self.kind: case FunctionKind.GETTER: @@ -700,7 +691,6 @@ def state_modulename_name(self, line: str) -> None: kind=self.kind, coexist=self.coexist, critical_section=self.critical_section, - disable_fastcall=self.disable_fastcall, target_critical_section=self.target_critical_section, forced_text_signature=self.forced_text_signature ) diff --git a/Tools/clinic/libclinic/parse_args.py b/Tools/clinic/libclinic/parse_args.py index a28167441a2b39..a1d8478fea53f5 100644 --- a/Tools/clinic/libclinic/parse_args.py +++ b/Tools/clinic/libclinic/parse_args.py @@ -258,10 +258,7 @@ def __init__(self, func: Function, codegen: CodeGen) -> None: if self.func.critical_section: self.codegen.add_include('pycore_critical_section.h', 'Py_BEGIN_CRITICAL_SECTION()') - if self.func.disable_fastcall: - self.fastcall = False - else: - self.fastcall = not self.is_new_or_init() + self.fastcall = not self.is_new_or_init() self.pos_only = 0 self.min_pos = 0 From 14801661302f88749f6fa529c4fd65cf9a500ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Thu, 20 Mar 2025 19:52:00 +0100 Subject: [PATCH 03/12] Revert "fixup" This reverts commit 4001c734022088eba7a403dc01fe6645dd3276fe. --- Modules/_testclinic.c | 71 ++++++++------ Modules/clinic/_testclinic.c.h | 142 ++++++++++++++++----------- Tools/clinic/libclinic/dsl_parser.py | 10 ++ Tools/clinic/libclinic/parse_args.py | 5 +- 4 files changed, 140 insertions(+), 88 deletions(-) diff --git a/Modules/_testclinic.c b/Modules/_testclinic.c index b20f247bb2fca6..7b937191490237 100644 --- a/Modules/_testclinic.c +++ b/Modules/_testclinic.c @@ -1444,8 +1444,9 @@ _testclinic_TestClass_defclass_posonly_varpos_impl(PyObject *self, /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as varpos_no_fastcall +_testclinic.TestClass.class_method as varpos_no_fastcall *args: tuple @@ -1453,15 +1454,16 @@ _testclinic.TestClass.__new__ as varpos_no_fastcall static PyObject * varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) -/*[clinic end generated code: output=04e94f2898bb2dde input=c5d3d30a6589f97f]*/ +/*[clinic end generated code: output=04e94f2898bb2dde input=10c2251e9ac6baf3]*/ { return Py_NewRef(args); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_varpos_no_fastcall +_testclinic.TestClass.class_method as posonly_varpos_no_fastcall a: object b: object @@ -1473,15 +1475,16 @@ _testclinic.TestClass.__new__ as posonly_varpos_no_fastcall static PyObject * posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=b0a0425719f69f5a input=10f29f2c2c6bfdc4]*/ +/*[clinic end generated code: output=b0a0425719f69f5a input=f7c75501a787c7af]*/ { return pack_arguments_newref(3, a, b, args); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_req_opt_varpos_no_fastcall +_testclinic.TestClass.class_method as posonly_req_opt_varpos_no_fastcall a: object b: object = False @@ -1493,15 +1496,16 @@ _testclinic.TestClass.__new__ as posonly_req_opt_varpos_no_fastcall static PyObject * posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=3c44915b1a554e2d input=d319302a8748147c]*/ +/*[clinic end generated code: output=3c44915b1a554e2d input=701bf93e7572e6b3]*/ { return pack_arguments_newref(3, a, b, args); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_poskw_varpos_no_fastcall +_testclinic.TestClass.class_method as posonly_poskw_varpos_no_fastcall a: object / @@ -1513,15 +1517,16 @@ _testclinic.TestClass.__new__ as posonly_poskw_varpos_no_fastcall static PyObject * posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=6ad74bed4bdc7f96 input=1f8c113e749414a3]*/ +/*[clinic end generated code: output=6ad74bed4bdc7f96 input=2bbbc74dc92ba7ba]*/ { return pack_arguments_newref(3, a, b, args); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as varpos_array_no_fastcall +_testclinic.TestClass.class_method as varpos_array_no_fastcall *args: array @@ -1530,15 +1535,16 @@ _testclinic.TestClass.__new__ as varpos_array_no_fastcall static PyObject * varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=f99d984346c60d42 input=368d8eea6de48c12]*/ +/*[clinic end generated code: output=f99d984346c60d42 input=de625878254ecac0]*/ { return _PyTuple_FromArray(args, args_length); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_varpos_array_no_fastcall +_testclinic.TestClass.class_method as posonly_varpos_array_no_fastcall a: object b: object @@ -1551,15 +1557,16 @@ static PyObject * posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=1eec4da1fb5b5978 input=7330c8d819a23548]*/ +/*[clinic end generated code: output=1eec4da1fb5b5978 input=15adeb514423f485]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_req_opt_varpos_array_no_fastcall +_testclinic.TestClass.class_method as posonly_req_opt_varpos_array_no_fastcall a: object b: object = False @@ -1573,15 +1580,16 @@ posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=88041c2176135218 input=7f5fd34ee5f9e0bf]*/ +/*[clinic end generated code: output=88041c2176135218 input=445ff173a49709d5]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } /*[clinic input] +@disable fastcall @classmethod -_testclinic.TestClass.__new__ as posonly_poskw_varpos_array_no_fastcall +_testclinic.TestClass.class_method as posonly_poskw_varpos_array_no_fastcall a: object / @@ -1595,7 +1603,7 @@ posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=70eda18c3667681e input=2b0fcd7bd9bb865c]*/ +/*[clinic end generated code: output=70eda18c3667681e input=c0ac0f6b990f553c]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } @@ -1606,28 +1614,27 @@ static struct PyMethodDef test_class_methods[] = { _TESTCLINIC_TESTCLASS_DEFCLASS_VARPOS_METHODDEF _TESTCLINIC_TESTCLASS_DEFCLASS_POSONLY_VARPOS_METHODDEF - {"varpos_no_fastcall", varpos_no_fastcall, - METH_VARARGS|METH_CLASS, PyDoc_STR("")}, - {"posonly_varpos_no_fastcall", posonly_varpos_no_fastcall, - METH_VARARGS|METH_CLASS, PyDoc_STR("")}, - {"posonly_req_opt_varpos_no_fastcall", posonly_req_opt_varpos_no_fastcall, - METH_VARARGS|METH_CLASS, PyDoc_STR("")}, - {"posonly_poskw_varpos_no_fastcall", - _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, PyDoc_STR("")}, + {"varpos_no_fastcall", _PyCFunction_CAST(varpos_no_fastcall), + METH_VARARGS|METH_CLASS, ""}, + {"posonly_varpos_no_fastcall", _PyCFunction_CAST(posonly_varpos_no_fastcall), + METH_VARARGS|METH_CLASS, ""}, + {"posonly_req_opt_varpos_no_fastcall", _PyCFunction_CAST(posonly_req_opt_varpos_no_fastcall), + METH_VARARGS|METH_CLASS, ""}, + {"posonly_poskw_varpos_no_fastcall", _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), + METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, {"varpos_array_no_fastcall", - varpos_array_no_fastcall, - METH_VARARGS|METH_CLASS, PyDoc_STR("")}, + _PyCFunction_CAST(varpos_array_no_fastcall), + METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, {"posonly_varpos_array_no_fastcall", - posonly_varpos_array_no_fastcall, - METH_VARARGS|METH_CLASS, PyDoc_STR("")}, + _PyCFunction_CAST(posonly_varpos_array_no_fastcall), + METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, {"posonly_req_opt_varpos_array_no_fastcall", - posonly_req_opt_varpos_array_no_fastcall, - METH_VARARGS|METH_CLASS, PyDoc_STR("")}, + _PyCFunction_CAST(posonly_req_opt_varpos_array_no_fastcall), + METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, {"posonly_poskw_varpos_array_no_fastcall", _PyCFunction_CAST(posonly_poskw_varpos_array_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, PyDoc_STR("")}, + METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, {NULL, NULL} }; diff --git a/Modules/clinic/_testclinic.c.h b/Modules/clinic/_testclinic.c.h index 2a3a0528496b73..96c3541cc0c248 100644 --- a/Modules/clinic/_testclinic.c.h +++ b/Modules/clinic/_testclinic.c.h @@ -4005,48 +4005,53 @@ _testclinic_TestClass_defclass_posonly_varpos(PyObject *self, PyTypeObject *cls, return return_value; } +PyDoc_STRVAR(varpos_no_fastcall__doc__, +"class_method($type, /, *args)\n" +"--\n" +"\n"); + +#define VARPOS_NO_FASTCALL_METHODDEF \ + {"class_method", varpos_no_fastcall, METH_VARARGS|METH_CLASS, varpos_no_fastcall__doc__}, + static PyObject * varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args); static PyObject * -varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +varpos_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *__clinic_args = NULL; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } __clinic_args = Py_NewRef(args); - return_value = varpos_no_fastcall_impl(type, __clinic_args); + return_value = varpos_no_fastcall_impl((PyTypeObject *)type, __clinic_args); -exit: /* Cleanup for args */ Py_XDECREF(__clinic_args); return return_value; } +PyDoc_STRVAR(posonly_varpos_no_fastcall__doc__, +"class_method($type, a, b, /, *args)\n" +"--\n" +"\n"); + +#define POSONLY_VARPOS_NO_FASTCALL_METHODDEF \ + {"class_method", posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_no_fastcall__doc__}, + static PyObject * posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args); static PyObject * -posonly_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_varpos_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b; PyObject *__clinic_args = NULL; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } - if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4055,7 +4060,7 @@ posonly_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) if (!__clinic_args) { goto exit; } - return_value = posonly_varpos_no_fastcall_impl(type, a, b, __clinic_args); + return_value = posonly_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4064,24 +4069,27 @@ posonly_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) return return_value; } +PyDoc_STRVAR(posonly_req_opt_varpos_no_fastcall__doc__, +"class_method($type, a, b=False, /, *args)\n" +"--\n" +"\n"); + +#define POSONLY_REQ_OPT_VARPOS_NO_FASTCALL_METHODDEF \ + {"class_method", posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_no_fastcall__doc__}, + static PyObject * posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args); static PyObject * -posonly_req_opt_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b = Py_False; PyObject *__clinic_args = NULL; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } - if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4094,7 +4102,7 @@ posonly_req_opt_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject if (!__clinic_args) { goto exit; } - return_value = posonly_req_opt_varpos_no_fastcall_impl(type, a, b, __clinic_args); + return_value = posonly_req_opt_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4103,12 +4111,20 @@ posonly_req_opt_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject return return_value; } +PyDoc_STRVAR(posonly_poskw_varpos_no_fastcall__doc__, +"class_method($type, a, /, b, *args)\n" +"--\n" +"\n"); + +#define POSONLY_POSKW_VARPOS_NO_FASTCALL_METHODDEF \ + {"class_method", _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_no_fastcall__doc__}, + static PyObject * posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args); static PyObject * -posonly_poskw_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) @@ -4132,7 +4148,7 @@ posonly_poskw_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *k static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, - .fname = "TestClass", + .fname = "class_method", .kwtuple = KWTUPLE, }; #undef KWTUPLE @@ -4154,7 +4170,7 @@ posonly_poskw_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *k if (!__clinic_args) { goto exit; } - return_value = posonly_poskw_varpos_no_fastcall_impl(type, a, b, __clinic_args); + return_value = posonly_poskw_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4163,62 +4179,75 @@ posonly_poskw_varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *k return return_value; } +PyDoc_STRVAR(varpos_array_no_fastcall__doc__, +"class_method($type, /, *args)\n" +"--\n" +"\n"); + +#define VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"class_method", varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, varpos_array_no_fastcall__doc__}, + static PyObject * varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, Py_ssize_t args_length); static PyObject * -varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +varpos_array_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject * const *__clinic_args; Py_ssize_t args_length; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } __clinic_args = _PyTuple_ITEMS(args); args_length = PyTuple_GET_SIZE(args); - return_value = varpos_array_no_fastcall_impl(type, __clinic_args, args_length); + return_value = varpos_array_no_fastcall_impl((PyTypeObject *)type, __clinic_args, args_length); -exit: return return_value; } +PyDoc_STRVAR(posonly_varpos_array_no_fastcall__doc__, +"class_method($type, a, b, /, *args)\n" +"--\n" +"\n"); + +#define POSONLY_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"class_method", posonly_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_array_no_fastcall__doc__}, + static PyObject * posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length); static PyObject * -posonly_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_varpos_array_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b; PyObject * const *__clinic_args; Py_ssize_t args_length; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } - if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); b = PyTuple_GET_ITEM(args, 1); __clinic_args = _PyTuple_ITEMS(args) + 2; args_length = PyTuple_GET_SIZE(args) - 2; - return_value = posonly_varpos_array_no_fastcall_impl(type, a, b, __clinic_args, args_length); + return_value = posonly_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); exit: return return_value; } +PyDoc_STRVAR(posonly_req_opt_varpos_array_no_fastcall__doc__, +"class_method($type, a, b=False, /, *args)\n" +"--\n" +"\n"); + +#define POSONLY_REQ_OPT_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"class_method", posonly_req_opt_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_array_no_fastcall__doc__}, + static PyObject * posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, @@ -4226,20 +4255,15 @@ posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, Py_ssize_t args_length); static PyObject * -posonly_req_opt_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *a; PyObject *b = Py_False; PyObject * const *__clinic_args; Py_ssize_t args_length; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } - if (!_PyArg_CheckPositional("TestClass", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4250,12 +4274,20 @@ posonly_req_opt_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyO skip_optional: __clinic_args = PyTuple_GET_SIZE(args) > 2 ? _PyTuple_ITEMS(args) + 2 : _PyTuple_ITEMS(args); args_length = Py_MAX(0, PyTuple_GET_SIZE(args) - 2); - return_value = posonly_req_opt_varpos_array_no_fastcall_impl(type, a, b, __clinic_args, args_length); + return_value = posonly_req_opt_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); exit: return return_value; } +PyDoc_STRVAR(posonly_poskw_varpos_array_no_fastcall__doc__, +"class_method($type, a, /, b, *args)\n" +"--\n" +"\n"); + +#define POSONLY_POSKW_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"class_method", _PyCFunction_CAST(posonly_poskw_varpos_array_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_array_no_fastcall__doc__}, + static PyObject * posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, @@ -4263,7 +4295,7 @@ posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, Py_ssize_t args_length); static PyObject * -posonly_poskw_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) @@ -4287,7 +4319,7 @@ posonly_poskw_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObj static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, - .fname = "TestClass", + .fname = "class_method", .kwtuple = KWTUPLE, }; #undef KWTUPLE @@ -4308,9 +4340,9 @@ posonly_poskw_varpos_array_no_fastcall(PyTypeObject *type, PyObject *args, PyObj b = fastargs[1]; __clinic_args = PyTuple_GET_SIZE(args) > 2 ? _PyTuple_ITEMS(args) + 2 : _PyTuple_ITEMS(args); args_length = Py_MAX(0, PyTuple_GET_SIZE(args) - 2); - return_value = posonly_poskw_varpos_array_no_fastcall_impl(type, a, b, __clinic_args, args_length); + return_value = posonly_poskw_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); exit: return return_value; } -/*[clinic end generated code: output=07b1350399ae051b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=181834e956ff0fea input=a9049054013a1b77]*/ diff --git a/Tools/clinic/libclinic/dsl_parser.py b/Tools/clinic/libclinic/dsl_parser.py index 4b4a8b9969d142..b5d04edf247c0d 100644 --- a/Tools/clinic/libclinic/dsl_parser.py +++ b/Tools/clinic/libclinic/dsl_parser.py @@ -260,6 +260,7 @@ class DSLParser: preserve_output: bool critical_section: bool target_critical_section: list[str] + disable_fastcall: bool from_version_re = re.compile(r'([*/]) +\[from +(.+)\]') def __init__(self, clinic: Clinic) -> None: @@ -296,6 +297,7 @@ def reset(self) -> None: self.preserve_output = False self.critical_section = False self.target_critical_section = [] + self.disable_fastcall = False def directive_module(self, name: str) -> None: fields = name.split('.')[:-1] @@ -423,6 +425,13 @@ def at_critical_section(self, *args: str) -> None: self.target_critical_section.extend(args) self.critical_section = True + def at_disable(self, *args: str) -> None: + if self.kind is not CALLABLE: + fail("Can't set @disable, function is not a normal callable") + if not args: + fail("@disable expects at least one argument") + self.disable_fastcall = 'fastcall' in args + def at_getter(self) -> None: match self.kind: case FunctionKind.GETTER: @@ -691,6 +700,7 @@ def state_modulename_name(self, line: str) -> None: kind=self.kind, coexist=self.coexist, critical_section=self.critical_section, + disable_fastcall=self.disable_fastcall, target_critical_section=self.target_critical_section, forced_text_signature=self.forced_text_signature ) diff --git a/Tools/clinic/libclinic/parse_args.py b/Tools/clinic/libclinic/parse_args.py index a1d8478fea53f5..a28167441a2b39 100644 --- a/Tools/clinic/libclinic/parse_args.py +++ b/Tools/clinic/libclinic/parse_args.py @@ -258,7 +258,10 @@ def __init__(self, func: Function, codegen: CodeGen) -> None: if self.func.critical_section: self.codegen.add_include('pycore_critical_section.h', 'Py_BEGIN_CRITICAL_SECTION()') - self.fastcall = not self.is_new_or_init() + if self.func.disable_fastcall: + self.fastcall = False + else: + self.fastcall = not self.is_new_or_init() self.pos_only = 0 self.min_pos = 0 From a737ca5ee0ad48de1c9ebb25408c4a483647ab82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Thu, 20 Mar 2025 20:03:20 +0100 Subject: [PATCH 04/12] fixup --- Modules/_testclinic.c | 77 ++++++++++++++++++++++------------ Modules/clinic/_testclinic.c.h | 60 +++++++++++++------------- 2 files changed, 80 insertions(+), 57 deletions(-) diff --git a/Modules/_testclinic.c b/Modules/_testclinic.c index 7b937191490237..d99ac991cc8ca3 100644 --- a/Modules/_testclinic.c +++ b/Modules/_testclinic.c @@ -1446,15 +1446,39 @@ _testclinic_TestClass_defclass_posonly_varpos_impl(PyObject *self, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.class_method as varpos_no_fastcall +_testclinic.TestClass.__new__ as varpos_no_fastcall *args: tuple +# Do NOT use __new__ to generate this method. Compare: +# +# With __new__ +# +# varpos_no_fastcall_1(PyTypeObject *type, PyObject *args, PyObject *kwargs) +# varpos_no_fastcall_impl_1(PyTypeObject *type, PyObject *args) +# +# Without __new__ and an explicit "@disable fastcall" +# +# varpos_no_fastcall_2(PyObject *type, PyObject *args) +# varpos_no_fastcall_impl_2(PyTypeObject *type, PyObject *args) +# +# We want to test a non-fastcall class method (i.e. something like __new__) +# but without triggering an undefined behaviour at runtime in cfunction_call(). +# +# At runtime, a METH_VARARGS method called in cfunction_call() must be: +# +# (PyObject *, PyObject *) -> PyObject * +# (PyObject *, PyObject *, PyObject *) -> PyObject * +# +# depending on whether METH_KEYWORDS is present or not. Changin AC to make +# varpos_no_fastcall_1() compatible with cfunction_call() would also affect +# how the regular __new__ methods are generated (they ALWAYS support 'kwargs'). +# Thus, for testing non-fastcall class methods, "@disable fastcall" is needed. [clinic start generated code]*/ static PyObject * varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) -/*[clinic end generated code: output=04e94f2898bb2dde input=10c2251e9ac6baf3]*/ +/*[clinic end generated code: output=04e94f2898bb2dde input=df0b72d3e7784a18]*/ { return Py_NewRef(args); } @@ -1463,7 +1487,7 @@ varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_varpos_no_fastcall +_testclinic.TestClass.cm as posonly_varpos_no_fastcall a: object b: object @@ -1475,7 +1499,7 @@ _testclinic.TestClass.class_method as posonly_varpos_no_fastcall static PyObject * posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=b0a0425719f69f5a input=f7c75501a787c7af]*/ +/*[clinic end generated code: output=b0a0425719f69f5a input=c8870f84456e68be]*/ { return pack_arguments_newref(3, a, b, args); } @@ -1484,7 +1508,7 @@ posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_req_opt_varpos_no_fastcall +_testclinic.TestClass.cm as posonly_req_opt_varpos_no_fastcall a: object b: object = False @@ -1496,7 +1520,7 @@ _testclinic.TestClass.class_method as posonly_req_opt_varpos_no_fastcall static PyObject * posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=3c44915b1a554e2d input=701bf93e7572e6b3]*/ +/*[clinic end generated code: output=3c44915b1a554e2d input=9e29ef335e399e8e]*/ { return pack_arguments_newref(3, a, b, args); } @@ -1505,7 +1529,7 @@ posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_poskw_varpos_no_fastcall +_testclinic.TestClass.cm as posonly_poskw_varpos_no_fastcall a: object / @@ -1517,7 +1541,7 @@ _testclinic.TestClass.class_method as posonly_poskw_varpos_no_fastcall static PyObject * posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject *args) -/*[clinic end generated code: output=6ad74bed4bdc7f96 input=2bbbc74dc92ba7ba]*/ +/*[clinic end generated code: output=6ad74bed4bdc7f96 input=66226ea6c3d38c36]*/ { return pack_arguments_newref(3, a, b, args); } @@ -1526,7 +1550,7 @@ posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.class_method as varpos_array_no_fastcall +_testclinic.TestClass.cm as varpos_array_no_fastcall *args: array @@ -1535,7 +1559,7 @@ _testclinic.TestClass.class_method as varpos_array_no_fastcall static PyObject * varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=f99d984346c60d42 input=de625878254ecac0]*/ +/*[clinic end generated code: output=f99d984346c60d42 input=52b2e8011dbee112]*/ { return _PyTuple_FromArray(args, args_length); } @@ -1544,7 +1568,7 @@ varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_varpos_array_no_fastcall +_testclinic.TestClass.cm as posonly_varpos_array_no_fastcall a: object b: object @@ -1557,7 +1581,7 @@ static PyObject * posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=1eec4da1fb5b5978 input=15adeb514423f485]*/ +/*[clinic end generated code: output=1eec4da1fb5b5978 input=78fd1e9358b8987f]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } @@ -1566,7 +1590,7 @@ posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_req_opt_varpos_array_no_fastcall +_testclinic.TestClass.cm as posonly_req_opt_varpos_array_no_fastcall a: object b: object = False @@ -1580,7 +1604,7 @@ posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=88041c2176135218 input=445ff173a49709d5]*/ +/*[clinic end generated code: output=88041c2176135218 input=f730318da80b94c1]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } @@ -1589,7 +1613,7 @@ posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.class_method as posonly_poskw_varpos_array_no_fastcall +_testclinic.TestClass.cm as posonly_poskw_varpos_array_no_fastcall a: object / @@ -1603,7 +1627,7 @@ posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, PyObject * const *args, Py_ssize_t args_length) -/*[clinic end generated code: output=70eda18c3667681e input=c0ac0f6b990f553c]*/ +/*[clinic end generated code: output=70eda18c3667681e input=a98374a618ec8d36]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } @@ -1614,24 +1638,25 @@ static struct PyMethodDef test_class_methods[] = { _TESTCLINIC_TESTCLASS_DEFCLASS_VARPOS_METHODDEF _TESTCLINIC_TESTCLASS_DEFCLASS_POSONLY_VARPOS_METHODDEF - {"varpos_no_fastcall", _PyCFunction_CAST(varpos_no_fastcall), + {"varpos_no_fastcall", varpos_no_fastcall, METH_VARARGS|METH_CLASS, ""}, - {"posonly_varpos_no_fastcall", _PyCFunction_CAST(posonly_varpos_no_fastcall), + {"posonly_varpos_no_fastcall", posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, ""}, - {"posonly_req_opt_varpos_no_fastcall", _PyCFunction_CAST(posonly_req_opt_varpos_no_fastcall), + {"posonly_req_opt_varpos_no_fastcall", posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, ""}, - {"posonly_poskw_varpos_no_fastcall", _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), + {"posonly_poskw_varpos_no_fastcall", + _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, {"varpos_array_no_fastcall", - _PyCFunction_CAST(varpos_array_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + varpos_array_no_fastcall, + METH_VARARGS|METH_CLASS, ""}, {"posonly_varpos_array_no_fastcall", - _PyCFunction_CAST(posonly_varpos_array_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + posonly_varpos_array_no_fastcall, + METH_VARARGS|METH_CLASS, ""}, {"posonly_req_opt_varpos_array_no_fastcall", - _PyCFunction_CAST(posonly_req_opt_varpos_array_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + posonly_req_opt_varpos_array_no_fastcall, + METH_VARARGS|METH_CLASS, ""}, {"posonly_poskw_varpos_array_no_fastcall", _PyCFunction_CAST(posonly_poskw_varpos_array_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, diff --git a/Modules/clinic/_testclinic.c.h b/Modules/clinic/_testclinic.c.h index 96c3541cc0c248..5eb7a695dbcc2c 100644 --- a/Modules/clinic/_testclinic.c.h +++ b/Modules/clinic/_testclinic.c.h @@ -4005,26 +4005,24 @@ _testclinic_TestClass_defclass_posonly_varpos(PyObject *self, PyTypeObject *cls, return return_value; } -PyDoc_STRVAR(varpos_no_fastcall__doc__, -"class_method($type, /, *args)\n" -"--\n" -"\n"); - -#define VARPOS_NO_FASTCALL_METHODDEF \ - {"class_method", varpos_no_fastcall, METH_VARARGS|METH_CLASS, varpos_no_fastcall__doc__}, - static PyObject * varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args); static PyObject * -varpos_no_fastcall(PyObject *type, PyObject *args) +varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; + PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *__clinic_args = NULL; + if ((type == base_tp || type->tp_init == base_tp->tp_init) && + !_PyArg_NoKeywords("TestClass", kwargs)) { + goto exit; + } __clinic_args = Py_NewRef(args); - return_value = varpos_no_fastcall_impl((PyTypeObject *)type, __clinic_args); + return_value = varpos_no_fastcall_impl(type, __clinic_args); +exit: /* Cleanup for args */ Py_XDECREF(__clinic_args); @@ -4032,12 +4030,12 @@ varpos_no_fastcall(PyObject *type, PyObject *args) } PyDoc_STRVAR(posonly_varpos_no_fastcall__doc__, -"class_method($type, a, b, /, *args)\n" +"cm($type, a, b, /, *args)\n" "--\n" "\n"); #define POSONLY_VARPOS_NO_FASTCALL_METHODDEF \ - {"class_method", posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_no_fastcall__doc__}, + {"cm", posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_no_fastcall__doc__}, static PyObject * posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, @@ -4051,7 +4049,7 @@ posonly_varpos_no_fastcall(PyObject *type, PyObject *args) PyObject *b; PyObject *__clinic_args = NULL; - if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("cm", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4070,12 +4068,12 @@ posonly_varpos_no_fastcall(PyObject *type, PyObject *args) } PyDoc_STRVAR(posonly_req_opt_varpos_no_fastcall__doc__, -"class_method($type, a, b=False, /, *args)\n" +"cm($type, a, b=False, /, *args)\n" "--\n" "\n"); #define POSONLY_REQ_OPT_VARPOS_NO_FASTCALL_METHODDEF \ - {"class_method", posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_no_fastcall__doc__}, + {"cm", posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_no_fastcall__doc__}, static PyObject * posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, @@ -4089,7 +4087,7 @@ posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) PyObject *b = Py_False; PyObject *__clinic_args = NULL; - if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("cm", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4112,12 +4110,12 @@ posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) } PyDoc_STRVAR(posonly_poskw_varpos_no_fastcall__doc__, -"class_method($type, a, /, b, *args)\n" +"cm($type, a, /, b, *args)\n" "--\n" "\n"); #define POSONLY_POSKW_VARPOS_NO_FASTCALL_METHODDEF \ - {"class_method", _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_no_fastcall__doc__}, + {"cm", _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_no_fastcall__doc__}, static PyObject * posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, @@ -4148,7 +4146,7 @@ posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwarg static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, - .fname = "class_method", + .fname = "cm", .kwtuple = KWTUPLE, }; #undef KWTUPLE @@ -4180,12 +4178,12 @@ posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwarg } PyDoc_STRVAR(varpos_array_no_fastcall__doc__, -"class_method($type, /, *args)\n" +"cm($type, /, *args)\n" "--\n" "\n"); #define VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"class_method", varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, varpos_array_no_fastcall__doc__}, + {"cm", varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, varpos_array_no_fastcall__doc__}, static PyObject * varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, @@ -4206,12 +4204,12 @@ varpos_array_no_fastcall(PyObject *type, PyObject *args) } PyDoc_STRVAR(posonly_varpos_array_no_fastcall__doc__, -"class_method($type, a, b, /, *args)\n" +"cm($type, a, b, /, *args)\n" "--\n" "\n"); #define POSONLY_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"class_method", posonly_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_array_no_fastcall__doc__}, + {"cm", posonly_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_array_no_fastcall__doc__}, static PyObject * posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, @@ -4227,7 +4225,7 @@ posonly_varpos_array_no_fastcall(PyObject *type, PyObject *args) PyObject * const *__clinic_args; Py_ssize_t args_length; - if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("cm", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4241,12 +4239,12 @@ posonly_varpos_array_no_fastcall(PyObject *type, PyObject *args) } PyDoc_STRVAR(posonly_req_opt_varpos_array_no_fastcall__doc__, -"class_method($type, a, b=False, /, *args)\n" +"cm($type, a, b=False, /, *args)\n" "--\n" "\n"); #define POSONLY_REQ_OPT_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"class_method", posonly_req_opt_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_array_no_fastcall__doc__}, + {"cm", posonly_req_opt_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_array_no_fastcall__doc__}, static PyObject * posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, @@ -4263,7 +4261,7 @@ posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args) PyObject * const *__clinic_args; Py_ssize_t args_length; - if (!_PyArg_CheckPositional("class_method", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("cm", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4281,12 +4279,12 @@ posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args) } PyDoc_STRVAR(posonly_poskw_varpos_array_no_fastcall__doc__, -"class_method($type, a, /, b, *args)\n" +"cm($type, a, /, b, *args)\n" "--\n" "\n"); #define POSONLY_POSKW_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"class_method", _PyCFunction_CAST(posonly_poskw_varpos_array_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_array_no_fastcall__doc__}, + {"cm", _PyCFunction_CAST(posonly_poskw_varpos_array_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_array_no_fastcall__doc__}, static PyObject * posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, @@ -4319,7 +4317,7 @@ posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, - .fname = "class_method", + .fname = "cm", .kwtuple = KWTUPLE, }; #undef KWTUPLE @@ -4345,4 +4343,4 @@ posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject exit: return return_value; } -/*[clinic end generated code: output=181834e956ff0fea input=a9049054013a1b77]*/ +/*[clinic end generated code: output=97b90a15296eb10b input=a9049054013a1b77]*/ From 6f20fc938d6f6ffc027bbb4c850c2f4683ca64bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Thu, 20 Mar 2025 20:31:57 +0100 Subject: [PATCH 05/12] fixup --- Modules/_testclinic.c | 153 ++++++++++++++++-------------- Modules/clinic/_testclinic.c.h | 168 ++++++++++++++++++--------------- 2 files changed, 174 insertions(+), 147 deletions(-) diff --git a/Modules/_testclinic.c b/Modules/_testclinic.c index d99ac991cc8ca3..d130019fd52777 100644 --- a/Modules/_testclinic.c +++ b/Modules/_testclinic.c @@ -1446,39 +1446,54 @@ _testclinic_TestClass_defclass_posonly_varpos_impl(PyObject *self, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.__new__ as varpos_no_fastcall +_testclinic.TestClass.varpos_no_fastcall *args: tuple # Do NOT use __new__ to generate this method. Compare: # -# With __new__ +# [1] With __new__ (METH_KEYWORDS must be added even if we don't want to) # -# varpos_no_fastcall_1(PyTypeObject *type, PyObject *args, PyObject *kwargs) -# varpos_no_fastcall_impl_1(PyTypeObject *type, PyObject *args) +# varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +# varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) +# no auto-generated METHODDEF macro # -# Without __new__ and an explicit "@disable fastcall" +# [2] Without __new__ (automatically METH_FASTCALL, not good for this test) # -# varpos_no_fastcall_2(PyObject *type, PyObject *args) -# varpos_no_fastcall_impl_2(PyTypeObject *type, PyObject *args) +# varpos_no_fastcall_impl(PyObject *type, PyObject *args) +# varpos_no_fastcall(PyObject *type, PyObject *const *args, Py_ssize_t nargs) +# flags = METH_FASTCALL|METH_CLASS # -# We want to test a non-fastcall class method (i.e. something like __new__) -# but without triggering an undefined behaviour at runtime in cfunction_call(). +# [3] Without __new__ + "@disable fastcall" (what we want) +# +# varpos_no_fastcall(PyObject *type, PyObject *args) +# varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) +# flags = METH_VARARGS|METH_CLASS +# +# We want to test a non-fastcall class method but without triggering an +# undefined behaviour at runtime in cfunction_call(). # # At runtime, a METH_VARARGS method called in cfunction_call() must be: # # (PyObject *, PyObject *) -> PyObject * # (PyObject *, PyObject *, PyObject *) -> PyObject * # -# depending on whether METH_KEYWORDS is present or not. Changin AC to make -# varpos_no_fastcall_1() compatible with cfunction_call() would also affect -# how the regular __new__ methods are generated (they ALWAYS support 'kwargs'). -# Thus, for testing non-fastcall class methods, "@disable fastcall" is needed. +# depending on whether METH_KEYWORDS is present or not. +# +# AC determines whether a method is a __new__-like method solely bsaed +# on the method name, and not on its usage or its c_basename, and those +# methods must always be used with METH_VARARGS|METH_KEYWORDS|METH_CLASS. +# +# In particular, using [1] forces us to add METH_KEYWORDS even though +# the test shouldn't be expecting keyword arguments. Using [2] is also +# not possible since we want to test non-fastcalls. This is the reason +# why we need to be able to disable the METH_FASTCALL flag. [clinic start generated code]*/ static PyObject * -varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) -/*[clinic end generated code: output=04e94f2898bb2dde input=df0b72d3e7784a18]*/ +_testclinic_TestClass_varpos_no_fastcall_impl(PyTypeObject *type, + PyObject *args) +/*[clinic end generated code: output=edfacec733aeb9c5 input=e385fc8a3af7ae44]*/ { return Py_NewRef(args); } @@ -1487,7 +1502,7 @@ varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.cm as posonly_varpos_no_fastcall +_testclinic.TestClass.posonly_varpos_no_fastcall a: object b: object @@ -1497,9 +1512,11 @@ _testclinic.TestClass.cm as posonly_varpos_no_fastcall [clinic start generated code]*/ static PyObject * -posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, - PyObject *args) -/*[clinic end generated code: output=b0a0425719f69f5a input=c8870f84456e68be]*/ +_testclinic_TestClass_posonly_varpos_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject *args) +/*[clinic end generated code: output=2c5184aebe020085 input=3621dd172c5193d8]*/ { return pack_arguments_newref(3, a, b, args); } @@ -1508,7 +1525,7 @@ posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.cm as posonly_req_opt_varpos_no_fastcall +_testclinic.TestClass.posonly_req_opt_varpos_no_fastcall a: object b: object = False @@ -1518,9 +1535,11 @@ _testclinic.TestClass.cm as posonly_req_opt_varpos_no_fastcall [clinic start generated code]*/ static PyObject * -posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, - PyObject *b, PyObject *args) -/*[clinic end generated code: output=3c44915b1a554e2d input=9e29ef335e399e8e]*/ +_testclinic_TestClass_posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject *args) +/*[clinic end generated code: output=08e533d59bceadf6 input=922fa7851b32e2dd]*/ { return pack_arguments_newref(3, a, b, args); } @@ -1529,7 +1548,7 @@ posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.cm as posonly_poskw_varpos_no_fastcall +_testclinic.TestClass.posonly_poskw_varpos_no_fastcall a: object / @@ -1539,9 +1558,11 @@ _testclinic.TestClass.cm as posonly_poskw_varpos_no_fastcall [clinic start generated code]*/ static PyObject * -posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, - PyObject *b, PyObject *args) -/*[clinic end generated code: output=6ad74bed4bdc7f96 input=66226ea6c3d38c36]*/ +_testclinic_TestClass_posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject *args) +/*[clinic end generated code: output=8ecfda20850e689f input=60443fe0bb8fe3e0]*/ { return pack_arguments_newref(3, a, b, args); } @@ -1550,16 +1571,17 @@ posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.cm as varpos_array_no_fastcall +_testclinic.TestClass.varpos_array_no_fastcall *args: array [clinic start generated code]*/ static PyObject * -varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, - Py_ssize_t args_length) -/*[clinic end generated code: output=f99d984346c60d42 input=52b2e8011dbee112]*/ +_testclinic_TestClass_varpos_array_no_fastcall_impl(PyTypeObject *type, + PyObject * const *args, + Py_ssize_t args_length) +/*[clinic end generated code: output=27c9da663e942617 input=9ba5ae1f1eb58777]*/ { return _PyTuple_FromArray(args, args_length); } @@ -1568,7 +1590,7 @@ varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.cm as posonly_varpos_array_no_fastcall +_testclinic.TestClass.posonly_varpos_array_no_fastcall a: object b: object @@ -1578,10 +1600,12 @@ _testclinic.TestClass.cm as posonly_varpos_array_no_fastcall [clinic start generated code]*/ static PyObject * -posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, - PyObject *b, PyObject * const *args, - Py_ssize_t args_length) -/*[clinic end generated code: output=1eec4da1fb5b5978 input=78fd1e9358b8987f]*/ +_testclinic_TestClass_posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject * const *args, + Py_ssize_t args_length) +/*[clinic end generated code: output=71e676f1870b5a7e input=18eadf4c6eaab613]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } @@ -1590,7 +1614,7 @@ posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.cm as posonly_req_opt_varpos_array_no_fastcall +_testclinic.TestClass.posonly_req_opt_varpos_array_no_fastcall a: object b: object = False @@ -1600,11 +1624,12 @@ _testclinic.TestClass.cm as posonly_req_opt_varpos_array_no_fastcall [clinic start generated code]*/ static PyObject * -posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, - PyObject *a, PyObject *b, - PyObject * const *args, - Py_ssize_t args_length) -/*[clinic end generated code: output=88041c2176135218 input=f730318da80b94c1]*/ +_testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject * const *args, + Py_ssize_t args_length) +/*[clinic end generated code: output=abb395cae91d48ac input=5bf791fdad70b480]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } @@ -1613,7 +1638,7 @@ posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, /*[clinic input] @disable fastcall @classmethod -_testclinic.TestClass.cm as posonly_poskw_varpos_array_no_fastcall +_testclinic.TestClass.posonly_poskw_varpos_array_no_fastcall a: object / @@ -1623,11 +1648,12 @@ _testclinic.TestClass.cm as posonly_poskw_varpos_array_no_fastcall [clinic start generated code]*/ static PyObject * -posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, - PyObject *b, - PyObject * const *args, - Py_ssize_t args_length) -/*[clinic end generated code: output=70eda18c3667681e input=a98374a618ec8d36]*/ +_testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject * const *args, + Py_ssize_t args_length) +/*[clinic end generated code: output=aaddd9530048b229 input=9ed3842f4d472d45]*/ { return pack_arguments_2pos_varpos(a, b, args, args_length); } @@ -1638,28 +1664,15 @@ static struct PyMethodDef test_class_methods[] = { _TESTCLINIC_TESTCLASS_DEFCLASS_VARPOS_METHODDEF _TESTCLINIC_TESTCLASS_DEFCLASS_POSONLY_VARPOS_METHODDEF - {"varpos_no_fastcall", varpos_no_fastcall, - METH_VARARGS|METH_CLASS, ""}, - {"posonly_varpos_no_fastcall", posonly_varpos_no_fastcall, - METH_VARARGS|METH_CLASS, ""}, - {"posonly_req_opt_varpos_no_fastcall", posonly_req_opt_varpos_no_fastcall, - METH_VARARGS|METH_CLASS, ""}, - {"posonly_poskw_varpos_no_fastcall", - _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, - - {"varpos_array_no_fastcall", - varpos_array_no_fastcall, - METH_VARARGS|METH_CLASS, ""}, - {"posonly_varpos_array_no_fastcall", - posonly_varpos_array_no_fastcall, - METH_VARARGS|METH_CLASS, ""}, - {"posonly_req_opt_varpos_array_no_fastcall", - posonly_req_opt_varpos_array_no_fastcall, - METH_VARARGS|METH_CLASS, ""}, - {"posonly_poskw_varpos_array_no_fastcall", - _PyCFunction_CAST(posonly_poskw_varpos_array_no_fastcall), - METH_VARARGS|METH_KEYWORDS|METH_CLASS, ""}, + _TESTCLINIC_TESTCLASS_VARPOS_NO_FASTCALL_METHODDEF + _TESTCLINIC_TESTCLASS_POSONLY_VARPOS_NO_FASTCALL_METHODDEF + _TESTCLINIC_TESTCLASS_POSONLY_REQ_OPT_VARPOS_NO_FASTCALL_METHODDEF + _TESTCLINIC_TESTCLASS_POSONLY_POSKW_VARPOS_NO_FASTCALL_METHODDEF + + _TESTCLINIC_TESTCLASS_VARPOS_ARRAY_NO_FASTCALL_METHODDEF + _TESTCLINIC_TESTCLASS_POSONLY_VARPOS_ARRAY_NO_FASTCALL_METHODDEF + _TESTCLINIC_TESTCLASS_POSONLY_REQ_OPT_VARPOS_ARRAY_NO_FASTCALL_METHODDEF + _TESTCLINIC_TESTCLASS_POSONLY_POSKW_VARPOS_ARRAY_NO_FASTCALL_METHODDEF {NULL, NULL} }; diff --git a/Modules/clinic/_testclinic.c.h b/Modules/clinic/_testclinic.c.h index 5eb7a695dbcc2c..96dc3ef35fc084 100644 --- a/Modules/clinic/_testclinic.c.h +++ b/Modules/clinic/_testclinic.c.h @@ -4005,51 +4005,56 @@ _testclinic_TestClass_defclass_posonly_varpos(PyObject *self, PyTypeObject *cls, return return_value; } +PyDoc_STRVAR(_testclinic_TestClass_varpos_no_fastcall__doc__, +"varpos_no_fastcall($type, /, *args)\n" +"--\n" +"\n"); + +#define _TESTCLINIC_TESTCLASS_VARPOS_NO_FASTCALL_METHODDEF \ + {"varpos_no_fastcall", _testclinic_TestClass_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_varpos_no_fastcall__doc__}, + static PyObject * -varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args); +_testclinic_TestClass_varpos_no_fastcall_impl(PyTypeObject *type, + PyObject *args); static PyObject * -varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) +_testclinic_TestClass_varpos_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; - PyTypeObject *base_tp = &PyBaseObject_Type; PyObject *__clinic_args = NULL; - if ((type == base_tp || type->tp_init == base_tp->tp_init) && - !_PyArg_NoKeywords("TestClass", kwargs)) { - goto exit; - } __clinic_args = Py_NewRef(args); - return_value = varpos_no_fastcall_impl(type, __clinic_args); + return_value = _testclinic_TestClass_varpos_no_fastcall_impl((PyTypeObject *)type, __clinic_args); -exit: /* Cleanup for args */ Py_XDECREF(__clinic_args); return return_value; } -PyDoc_STRVAR(posonly_varpos_no_fastcall__doc__, -"cm($type, a, b, /, *args)\n" +PyDoc_STRVAR(_testclinic_TestClass_posonly_varpos_no_fastcall__doc__, +"posonly_varpos_no_fastcall($type, a, b, /, *args)\n" "--\n" "\n"); -#define POSONLY_VARPOS_NO_FASTCALL_METHODDEF \ - {"cm", posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_no_fastcall__doc__}, +#define _TESTCLINIC_TESTCLASS_POSONLY_VARPOS_NO_FASTCALL_METHODDEF \ + {"posonly_varpos_no_fastcall", _testclinic_TestClass_posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_varpos_no_fastcall__doc__}, static PyObject * -posonly_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, PyObject *b, - PyObject *args); +_testclinic_TestClass_posonly_varpos_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject *args); static PyObject * -posonly_varpos_no_fastcall(PyObject *type, PyObject *args) +_testclinic_TestClass_posonly_varpos_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; PyObject *a; PyObject *b; PyObject *__clinic_args = NULL; - if (!_PyArg_CheckPositional("cm", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("posonly_varpos_no_fastcall", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4058,7 +4063,7 @@ posonly_varpos_no_fastcall(PyObject *type, PyObject *args) if (!__clinic_args) { goto exit; } - return_value = posonly_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); + return_value = _testclinic_TestClass_posonly_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4067,27 +4072,29 @@ posonly_varpos_no_fastcall(PyObject *type, PyObject *args) return return_value; } -PyDoc_STRVAR(posonly_req_opt_varpos_no_fastcall__doc__, -"cm($type, a, b=False, /, *args)\n" +PyDoc_STRVAR(_testclinic_TestClass_posonly_req_opt_varpos_no_fastcall__doc__, +"posonly_req_opt_varpos_no_fastcall($type, a, b=False, /, *args)\n" "--\n" "\n"); -#define POSONLY_REQ_OPT_VARPOS_NO_FASTCALL_METHODDEF \ - {"cm", posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_no_fastcall__doc__}, +#define _TESTCLINIC_TESTCLASS_POSONLY_REQ_OPT_VARPOS_NO_FASTCALL_METHODDEF \ + {"posonly_req_opt_varpos_no_fastcall", _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall__doc__}, static PyObject * -posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, - PyObject *b, PyObject *args); +_testclinic_TestClass_posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject *args); static PyObject * -posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) +_testclinic_TestClass_posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; PyObject *a; PyObject *b = Py_False; PyObject *__clinic_args = NULL; - if (!_PyArg_CheckPositional("cm", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("posonly_req_opt_varpos_no_fastcall", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4100,7 +4107,7 @@ posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) if (!__clinic_args) { goto exit; } - return_value = posonly_req_opt_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); + return_value = _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4109,20 +4116,22 @@ posonly_req_opt_varpos_no_fastcall(PyObject *type, PyObject *args) return return_value; } -PyDoc_STRVAR(posonly_poskw_varpos_no_fastcall__doc__, -"cm($type, a, /, b, *args)\n" +PyDoc_STRVAR(_testclinic_TestClass_posonly_poskw_varpos_no_fastcall__doc__, +"posonly_poskw_varpos_no_fastcall($type, a, /, b, *args)\n" "--\n" "\n"); -#define POSONLY_POSKW_VARPOS_NO_FASTCALL_METHODDEF \ - {"cm", _PyCFunction_CAST(posonly_poskw_varpos_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_no_fastcall__doc__}, +#define _TESTCLINIC_TESTCLASS_POSONLY_POSKW_VARPOS_NO_FASTCALL_METHODDEF \ + {"posonly_poskw_varpos_no_fastcall", _PyCFunction_CAST(_testclinic_TestClass_posonly_poskw_varpos_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, _testclinic_TestClass_posonly_poskw_varpos_no_fastcall__doc__}, static PyObject * -posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *a, - PyObject *b, PyObject *args); +_testclinic_TestClass_posonly_poskw_varpos_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject *args); static PyObject * -posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs) +_testclinic_TestClass_posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) @@ -4146,7 +4155,7 @@ posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwarg static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, - .fname = "cm", + .fname = "posonly_poskw_varpos_no_fastcall", .kwtuple = KWTUPLE, }; #undef KWTUPLE @@ -4168,7 +4177,7 @@ posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwarg if (!__clinic_args) { goto exit; } - return_value = posonly_poskw_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); + return_value = _testclinic_TestClass_posonly_poskw_varpos_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args); exit: /* Cleanup for args */ @@ -4177,20 +4186,21 @@ posonly_poskw_varpos_no_fastcall(PyObject *type, PyObject *args, PyObject *kwarg return return_value; } -PyDoc_STRVAR(varpos_array_no_fastcall__doc__, -"cm($type, /, *args)\n" +PyDoc_STRVAR(_testclinic_TestClass_varpos_array_no_fastcall__doc__, +"varpos_array_no_fastcall($type, /, *args)\n" "--\n" "\n"); -#define VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"cm", varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, varpos_array_no_fastcall__doc__}, +#define _TESTCLINIC_TESTCLASS_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"varpos_array_no_fastcall", _testclinic_TestClass_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_varpos_array_no_fastcall__doc__}, static PyObject * -varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject * const *args, - Py_ssize_t args_length); +_testclinic_TestClass_varpos_array_no_fastcall_impl(PyTypeObject *type, + PyObject * const *args, + Py_ssize_t args_length); static PyObject * -varpos_array_no_fastcall(PyObject *type, PyObject *args) +_testclinic_TestClass_varpos_array_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; PyObject * const *__clinic_args; @@ -4198,26 +4208,28 @@ varpos_array_no_fastcall(PyObject *type, PyObject *args) __clinic_args = _PyTuple_ITEMS(args); args_length = PyTuple_GET_SIZE(args); - return_value = varpos_array_no_fastcall_impl((PyTypeObject *)type, __clinic_args, args_length); + return_value = _testclinic_TestClass_varpos_array_no_fastcall_impl((PyTypeObject *)type, __clinic_args, args_length); return return_value; } -PyDoc_STRVAR(posonly_varpos_array_no_fastcall__doc__, -"cm($type, a, b, /, *args)\n" +PyDoc_STRVAR(_testclinic_TestClass_posonly_varpos_array_no_fastcall__doc__, +"posonly_varpos_array_no_fastcall($type, a, b, /, *args)\n" "--\n" "\n"); -#define POSONLY_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"cm", posonly_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_varpos_array_no_fastcall__doc__}, +#define _TESTCLINIC_TESTCLASS_POSONLY_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"posonly_varpos_array_no_fastcall", _testclinic_TestClass_posonly_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_varpos_array_no_fastcall__doc__}, static PyObject * -posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, - PyObject *b, PyObject * const *args, - Py_ssize_t args_length); +_testclinic_TestClass_posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject * const *args, + Py_ssize_t args_length); static PyObject * -posonly_varpos_array_no_fastcall(PyObject *type, PyObject *args) +_testclinic_TestClass_posonly_varpos_array_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; PyObject *a; @@ -4225,35 +4237,36 @@ posonly_varpos_array_no_fastcall(PyObject *type, PyObject *args) PyObject * const *__clinic_args; Py_ssize_t args_length; - if (!_PyArg_CheckPositional("cm", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("posonly_varpos_array_no_fastcall", PyTuple_GET_SIZE(args), 2, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); b = PyTuple_GET_ITEM(args, 1); __clinic_args = _PyTuple_ITEMS(args) + 2; args_length = PyTuple_GET_SIZE(args) - 2; - return_value = posonly_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); + return_value = _testclinic_TestClass_posonly_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); exit: return return_value; } -PyDoc_STRVAR(posonly_req_opt_varpos_array_no_fastcall__doc__, -"cm($type, a, b=False, /, *args)\n" +PyDoc_STRVAR(_testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall__doc__, +"posonly_req_opt_varpos_array_no_fastcall($type, a, b=False, /, *args)\n" "--\n" "\n"); -#define POSONLY_REQ_OPT_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"cm", posonly_req_opt_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, posonly_req_opt_varpos_array_no_fastcall__doc__}, +#define _TESTCLINIC_TESTCLASS_POSONLY_REQ_OPT_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"posonly_req_opt_varpos_array_no_fastcall", _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall__doc__}, static PyObject * -posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, - PyObject *a, PyObject *b, - PyObject * const *args, - Py_ssize_t args_length); +_testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject * const *args, + Py_ssize_t args_length); static PyObject * -posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args) +_testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args) { PyObject *return_value = NULL; PyObject *a; @@ -4261,7 +4274,7 @@ posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args) PyObject * const *__clinic_args; Py_ssize_t args_length; - if (!_PyArg_CheckPositional("cm", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { + if (!_PyArg_CheckPositional("posonly_req_opt_varpos_array_no_fastcall", PyTuple_GET_SIZE(args), 1, PY_SSIZE_T_MAX)) { goto exit; } a = PyTuple_GET_ITEM(args, 0); @@ -4272,28 +4285,29 @@ posonly_req_opt_varpos_array_no_fastcall(PyObject *type, PyObject *args) skip_optional: __clinic_args = PyTuple_GET_SIZE(args) > 2 ? _PyTuple_ITEMS(args) + 2 : _PyTuple_ITEMS(args); args_length = Py_MAX(0, PyTuple_GET_SIZE(args) - 2); - return_value = posonly_req_opt_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); + return_value = _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); exit: return return_value; } -PyDoc_STRVAR(posonly_poskw_varpos_array_no_fastcall__doc__, -"cm($type, a, /, b, *args)\n" +PyDoc_STRVAR(_testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall__doc__, +"posonly_poskw_varpos_array_no_fastcall($type, a, /, b, *args)\n" "--\n" "\n"); -#define POSONLY_POSKW_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"cm", _PyCFunction_CAST(posonly_poskw_varpos_array_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, posonly_poskw_varpos_array_no_fastcall__doc__}, +#define _TESTCLINIC_TESTCLASS_POSONLY_POSKW_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ + {"posonly_poskw_varpos_array_no_fastcall", _PyCFunction_CAST(_testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall), METH_VARARGS|METH_KEYWORDS|METH_CLASS, _testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall__doc__}, static PyObject * -posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, PyObject *a, - PyObject *b, - PyObject * const *args, - Py_ssize_t args_length); +_testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall_impl(PyTypeObject *type, + PyObject *a, + PyObject *b, + PyObject * const *args, + Py_ssize_t args_length); static PyObject * -posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs) +_testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) @@ -4317,7 +4331,7 @@ posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject static const char * const _keywords[] = {"", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, - .fname = "cm", + .fname = "posonly_poskw_varpos_array_no_fastcall", .kwtuple = KWTUPLE, }; #undef KWTUPLE @@ -4338,9 +4352,9 @@ posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyObject *args, PyObject b = fastargs[1]; __clinic_args = PyTuple_GET_SIZE(args) > 2 ? _PyTuple_ITEMS(args) + 2 : _PyTuple_ITEMS(args); args_length = Py_MAX(0, PyTuple_GET_SIZE(args) - 2); - return_value = posonly_poskw_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); + return_value = _testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall_impl((PyTypeObject *)type, a, b, __clinic_args, args_length); exit: return return_value; } -/*[clinic end generated code: output=97b90a15296eb10b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dbf17d873e9e8626 input=a9049054013a1b77]*/ From 1331a3e6b6a14f981d5d1727333d0a77d2bf2291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sun, 23 Mar 2025 10:46:26 +0100 Subject: [PATCH 06/12] move comments --- Modules/_testclinic.c | 79 ++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/Modules/_testclinic.c b/Modules/_testclinic.c index d130019fd52777..ce51119fb46dae 100644 --- a/Modules/_testclinic.c +++ b/Modules/_testclinic.c @@ -1443,6 +1443,47 @@ _testclinic_TestClass_defclass_posonly_varpos_impl(PyObject *self, } +/* + * # Do NOT use __new__ to generate this method. Compare: + * + * [1] With __new__ (METH_KEYWORDS must be added even if we don't want to) + * + * varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) + * varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) + * no auto-generated METHODDEF macro + * + * [2] Without __new__ (automatically METH_FASTCALL, not good for this test) + * + * varpos_no_fastcall_impl(PyObject *type, PyObject *args) + * varpos_no_fastcall(PyObject *type, PyObject *const *args, Py_ssize_t nargs) + * flags = METH_FASTCALL|METH_CLASS + * + * [3] Without __new__ + "@disable fastcall" (what we want) + * + * varpos_no_fastcall(PyObject *type, PyObject *args) + * varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) + * flags = METH_VARARGS|METH_CLASS + * + * We want to test a non-fastcall class method but without triggering an + * undefined behaviour at runtime in cfunction_call(). + * + * At runtime, a METH_VARARGS method called in cfunction_call() must be: + * + * (PyObject *, PyObject *) -> PyObject * + * (PyObject *, PyObject *, PyObject *) -> PyObject * + * + * depending on whether METH_KEYWORDS is present or not. + * + * AC determines whether a method is a __new__-like method solely bsaed + * on the method name, and not on its usage or its c_basename, and those + * methods must always be used with METH_VARARGS|METH_KEYWORDS|METH_CLASS. + * + * In particular, using [1] forces us to add METH_KEYWORDS even though + * the test shouldn't be expecting keyword arguments. Using [2] is also + * not possible since we want to test non-fastcalls. This is the reason + * why we need to be able to disable the METH_FASTCALL flag. + */ + /*[clinic input] @disable fastcall @classmethod @@ -1450,44 +1491,6 @@ _testclinic.TestClass.varpos_no_fastcall *args: tuple -# Do NOT use __new__ to generate this method. Compare: -# -# [1] With __new__ (METH_KEYWORDS must be added even if we don't want to) -# -# varpos_no_fastcall(PyTypeObject *type, PyObject *args, PyObject *kwargs) -# varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) -# no auto-generated METHODDEF macro -# -# [2] Without __new__ (automatically METH_FASTCALL, not good for this test) -# -# varpos_no_fastcall_impl(PyObject *type, PyObject *args) -# varpos_no_fastcall(PyObject *type, PyObject *const *args, Py_ssize_t nargs) -# flags = METH_FASTCALL|METH_CLASS -# -# [3] Without __new__ + "@disable fastcall" (what we want) -# -# varpos_no_fastcall(PyObject *type, PyObject *args) -# varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) -# flags = METH_VARARGS|METH_CLASS -# -# We want to test a non-fastcall class method but without triggering an -# undefined behaviour at runtime in cfunction_call(). -# -# At runtime, a METH_VARARGS method called in cfunction_call() must be: -# -# (PyObject *, PyObject *) -> PyObject * -# (PyObject *, PyObject *, PyObject *) -> PyObject * -# -# depending on whether METH_KEYWORDS is present or not. -# -# AC determines whether a method is a __new__-like method solely bsaed -# on the method name, and not on its usage or its c_basename, and those -# methods must always be used with METH_VARARGS|METH_KEYWORDS|METH_CLASS. -# -# In particular, using [1] forces us to add METH_KEYWORDS even though -# the test shouldn't be expecting keyword arguments. Using [2] is also -# not possible since we want to test non-fastcalls. This is the reason -# why we need to be able to disable the METH_FASTCALL flag. [clinic start generated code]*/ static PyObject * From df2d4667befb2234627ebc9a70c93635db7e4c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sun, 23 Mar 2025 10:46:38 +0100 Subject: [PATCH 07/12] move comments --- Modules/_testclinic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_testclinic.c b/Modules/_testclinic.c index ce51119fb46dae..0a1f13db6ca204 100644 --- a/Modules/_testclinic.c +++ b/Modules/_testclinic.c @@ -1496,7 +1496,7 @@ _testclinic.TestClass.varpos_no_fastcall static PyObject * _testclinic_TestClass_varpos_no_fastcall_impl(PyTypeObject *type, PyObject *args) -/*[clinic end generated code: output=edfacec733aeb9c5 input=e385fc8a3af7ae44]*/ +/*[clinic end generated code: output=edfacec733aeb9c5 input=3f298d143aa98048]*/ { return Py_NewRef(args); } From d032ba0b3201b2ccfc34bbef0d85464f60018924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Mon, 24 Mar 2025 10:36:10 +0100 Subject: [PATCH 08/12] revert cast removal --- Lib/test/test_clinic.py | 8 +- Modules/_ctypes/clinic/callproc.c.h | 6 +- Modules/_io/clinic/bufferedio.c.h | 36 ++-- Modules/_io/clinic/bytesio.c.h | 24 +-- Modules/_io/clinic/fileio.c.h | 16 +- Modules/_io/clinic/iobase.c.h | 20 +- Modules/_io/clinic/stringio.c.h | 20 +- Modules/_io/clinic/textio.c.h | 28 +-- Modules/_io/clinic/winconsoleio.c.h | 12 +- .../clinic/multiprocessing.c.h | 6 +- .../_multiprocessing/clinic/posixshmem.c.h | 4 +- Modules/_multiprocessing/clinic/semaphore.c.h | 18 +- Modules/_sqlite/clinic/blob.c.h | 10 +- Modules/_sqlite/clinic/connection.c.h | 20 +- Modules/_sqlite/clinic/cursor.c.h | 12 +- Modules/_sqlite/clinic/module.c.h | 4 +- Modules/_sqlite/clinic/row.c.h | 4 +- Modules/_sre/clinic/sre.c.h | 20 +- Modules/_ssl/clinic/cert.c.h | 4 +- Modules/_testcapi/clinic/exceptions.c.h | 8 +- Modules/_testcapi/clinic/file.c.h | 4 +- Modules/_testcapi/clinic/long.c.h | 4 +- Modules/_testcapi/clinic/vectorcall.c.h | 6 +- Modules/_testlimitedcapi/clinic/file.c.h | 4 +- Modules/_testlimitedcapi/clinic/long.c.h | 18 +- .../clinic/vectorcall_limited.c.h | 6 +- Modules/cjkcodecs/clinic/multibytecodec.c.h | 18 +- Modules/clinic/_abc.c.h | 12 +- Modules/clinic/_asynciomodule.c.h | 36 ++-- Modules/clinic/_bz2module.c.h | 6 +- Modules/clinic/_codecsmodule.c.h | 14 +- Modules/clinic/_collectionsmodule.c.h | 32 +-- Modules/clinic/_contextvarsmodule.c.h | 4 +- Modules/clinic/_csv.c.h | 4 +- Modules/clinic/_curses_panel.c.h | 18 +- Modules/clinic/_cursesmodule.c.h | 188 +++++++++--------- Modules/clinic/_datetimemodule.c.h | 4 +- Modules/clinic/_dbmmodule.c.h | 4 +- Modules/clinic/_elementtree.c.h | 32 +-- Modules/clinic/_functoolsmodule.c.h | 6 +- Modules/clinic/_gdbmmodule.c.h | 4 +- Modules/clinic/_hashopenssl.c.h | 18 +- Modules/clinic/_heapqmodule.c.h | 10 +- Modules/clinic/_localemodule.c.h | 16 +- Modules/clinic/_lsprof.c.h | 6 +- Modules/clinic/_lzmamodule.c.h | 8 +- Modules/clinic/_opcode.c.h | 12 +- Modules/clinic/_operator.c.h | 22 +- Modules/clinic/_pickle.c.h | 20 +- Modules/clinic/_queuemodule.c.h | 6 +- Modules/clinic/_randommodule.c.h | 10 +- Modules/clinic/_ssl.c.h | 58 +++--- Modules/clinic/_struct.c.h | 10 +- Modules/clinic/_sysconfig.c.h | 4 +- Modules/clinic/_testclinic.c.h | 24 +-- Modules/clinic/_testclinic_limited.c.h | 8 +- Modules/clinic/_testinternalcapi.c.h | 6 +- Modules/clinic/_threadmodule.c.h | 4 +- Modules/clinic/_tkinter.c.h | 50 ++--- Modules/clinic/_tracemalloc.c.h | 20 +- Modules/clinic/_typingmodule.c.h | 4 +- Modules/clinic/_weakref.c.h | 6 +- Modules/clinic/_winapi.c.h | 32 +-- Modules/clinic/arraymodule.c.h | 36 ++-- Modules/clinic/binascii.c.h | 8 +- Modules/clinic/blake2module.c.h | 10 +- Modules/clinic/cmathmodule.c.h | 42 ++-- Modules/clinic/gcmodule.c.h | 30 +-- Modules/clinic/grpmodule.c.h | 4 +- Modules/clinic/itertoolsmodule.c.h | 4 +- Modules/clinic/mathmodule.c.h | 34 ++-- Modules/clinic/md5module.c.h | 8 +- Modules/clinic/overlapped.c.h | 16 +- Modules/clinic/posixmodule.c.h | 162 +++++++-------- Modules/clinic/pwdmodule.c.h | 8 +- Modules/clinic/pyexpat.c.h | 16 +- Modules/clinic/readline.c.h | 38 ++-- Modules/clinic/resource.c.h | 8 +- Modules/clinic/selectmodule.c.h | 28 +-- Modules/clinic/sha1module.c.h | 8 +- Modules/clinic/sha2module.c.h | 14 +- Modules/clinic/sha3module.c.h | 14 +- Modules/clinic/signalmodule.c.h | 22 +- Modules/clinic/socketmodule.c.h | 14 +- Modules/clinic/syslogmodule.c.h | 12 +- Modules/clinic/termios.c.h | 8 +- Modules/clinic/timemodule.c.h | 6 +- Modules/clinic/unicodedata.c.h | 16 +- Objects/clinic/bytearrayobject.c.h | 32 +-- Objects/clinic/bytesobject.c.h | 16 +- Objects/clinic/classobject.c.h | 4 +- Objects/clinic/complexobject.c.h | 12 +- Objects/clinic/dictobject.c.h | 20 +- Objects/clinic/exceptions.c.h | 16 +- Objects/clinic/floatobject.c.h | 26 +-- Objects/clinic/frameobject.c.h | 6 +- Objects/clinic/listobject.c.h | 20 +- Objects/clinic/longobject.c.h | 16 +- Objects/clinic/memoryobject.c.h | 10 +- Objects/clinic/setobject.c.h | 32 +-- Objects/clinic/tupleobject.c.h | 6 +- Objects/clinic/typeobject.c.h | 26 +-- Objects/clinic/typevarobject.c.h | 22 +- Objects/clinic/unicodeobject.c.h | 58 +++--- Objects/stringlib/clinic/transmogrify.h.h | 4 +- PC/clinic/msvcrtmodule.c.h | 30 +-- PC/clinic/winreg.c.h | 22 +- Python/clinic/_warnings.c.h | 8 +- Python/clinic/bltinmodule.c.h | 36 ++-- Python/clinic/context.c.h | 16 +- Python/clinic/import.c.h | 30 +-- Python/clinic/instruction_sequence.c.h | 8 +- Python/clinic/instrumentation.c.h | 14 +- Python/clinic/sysmodule.c.h | 98 ++++----- Tools/clinic/libclinic/parse_args.py | 4 +- 115 files changed, 1108 insertions(+), 1108 deletions(-) diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py index 82d7e99add13ee..b45b9ee89ee3de 100644 --- a/Lib/test/test_clinic.py +++ b/Lib/test/test_clinic.py @@ -432,11 +432,11 @@ def test_dest_buffer_not_empty_at_eof(self): "\\n"); #define FN_METHODDEF \\ - {"fn", fn, METH_O, fn__doc__}, + {"fn", (PyCFunction)fn, METH_O, fn__doc__}, static PyObject * fn(PyObject *module, PyObject *a) - /*[clinic end generated code: output=9ca52938037af908 input=524ce2e021e4eba6]*/ + /*[clinic end generated code: output=be6798b148ab4e53 input=524ce2e021e4eba6]*/ """) block = dedent(""" /*[clinic input] @@ -2930,11 +2930,11 @@ def test_file_dest(self): "\\n"); #define FUNC_METHODDEF \\ - {"func", func, METH_O, func__doc__}, + {"func", (PyCFunction)func, METH_O, func__doc__}, static PyObject * func(PyObject *module, PyObject *a) - /*[clinic end generated code: output=c710c5cbbd6f0a2f input=a9049054013a1b77]*/ + /*[clinic end generated code: output=3dde2d13002165b9 input=a9049054013a1b77]*/ """) with os_helper.temp_dir() as tmp_dir: in_fn = os.path.join(tmp_dir, "test.c") diff --git a/Modules/_ctypes/clinic/callproc.c.h b/Modules/_ctypes/clinic/callproc.c.h index e42ffe15b21097..a787693ae67cd8 100644 --- a/Modules/_ctypes/clinic/callproc.c.h +++ b/Modules/_ctypes/clinic/callproc.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(create_pointer_type__doc__, "so calling this function repeatedly is cheap."); #define CREATE_POINTER_TYPE_METHODDEF \ - {"POINTER", create_pointer_type, METH_O, create_pointer_type__doc__}, + {"POINTER", (PyCFunction)create_pointer_type, METH_O, create_pointer_type__doc__}, PyDoc_STRVAR(create_pointer_inst__doc__, "pointer($module, obj, /)\n" @@ -28,5 +28,5 @@ PyDoc_STRVAR(create_pointer_inst__doc__, "should use byref(obj) which is much faster."); #define CREATE_POINTER_INST_METHODDEF \ - {"pointer", create_pointer_inst, METH_O, create_pointer_inst__doc__}, -/*[clinic end generated code: output=a3affa6de5689703 input=a9049054013a1b77]*/ + {"pointer", (PyCFunction)create_pointer_inst, METH_O, create_pointer_inst__doc__}, +/*[clinic end generated code: output=51b311ea369e5adf input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index 76073ee9f25564..3345ae4c7f805f 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(_io__BufferedIOBase_readinto__doc__, "\n"); #define _IO__BUFFEREDIOBASE_READINTO_METHODDEF \ - {"readinto", _io__BufferedIOBase_readinto, METH_O, _io__BufferedIOBase_readinto__doc__}, + {"readinto", (PyCFunction)_io__BufferedIOBase_readinto, METH_O, _io__BufferedIOBase_readinto__doc__}, static PyObject * _io__BufferedIOBase_readinto_impl(PyObject *self, Py_buffer *buffer); @@ -50,7 +50,7 @@ PyDoc_STRVAR(_io__BufferedIOBase_readinto1__doc__, "\n"); #define _IO__BUFFEREDIOBASE_READINTO1_METHODDEF \ - {"readinto1", _io__BufferedIOBase_readinto1, METH_O, _io__BufferedIOBase_readinto1__doc__}, + {"readinto1", (PyCFunction)_io__BufferedIOBase_readinto1, METH_O, _io__BufferedIOBase_readinto1__doc__}, static PyObject * _io__BufferedIOBase_readinto1_impl(PyObject *self, Py_buffer *buffer); @@ -282,7 +282,7 @@ PyDoc_STRVAR(_io__Buffered___sizeof____doc__, "\n"); #define _IO__BUFFERED___SIZEOF___METHODDEF \ - {"__sizeof__", _io__Buffered___sizeof__, METH_NOARGS, _io__Buffered___sizeof____doc__}, + {"__sizeof__", (PyCFunction)_io__Buffered___sizeof__, METH_NOARGS, _io__Buffered___sizeof____doc__}, static PyObject * _io__Buffered___sizeof___impl(buffered *self); @@ -305,7 +305,7 @@ PyDoc_STRVAR(_io__Buffered__dealloc_warn__doc__, "\n"); #define _IO__BUFFERED__DEALLOC_WARN_METHODDEF \ - {"_dealloc_warn", _io__Buffered__dealloc_warn, METH_O, _io__Buffered__dealloc_warn__doc__}, + {"_dealloc_warn", (PyCFunction)_io__Buffered__dealloc_warn, METH_O, _io__Buffered__dealloc_warn__doc__}, static PyObject * _io__Buffered__dealloc_warn_impl(buffered *self, PyObject *source); @@ -326,7 +326,7 @@ PyDoc_STRVAR(_io__Buffered_simple_flush__doc__, "\n"); #define _IO__BUFFERED_SIMPLE_FLUSH_METHODDEF \ - {"flush", _io__Buffered_simple_flush, METH_NOARGS, _io__Buffered_simple_flush__doc__}, + {"flush", (PyCFunction)_io__Buffered_simple_flush, METH_NOARGS, _io__Buffered_simple_flush__doc__}, static PyObject * _io__Buffered_simple_flush_impl(buffered *self); @@ -374,7 +374,7 @@ PyDoc_STRVAR(_io__Buffered_close__doc__, "\n"); #define _IO__BUFFERED_CLOSE_METHODDEF \ - {"close", _io__Buffered_close, METH_NOARGS, _io__Buffered_close__doc__}, + {"close", (PyCFunction)_io__Buffered_close, METH_NOARGS, _io__Buffered_close__doc__}, static PyObject * _io__Buffered_close_impl(buffered *self); @@ -397,7 +397,7 @@ PyDoc_STRVAR(_io__Buffered_detach__doc__, "\n"); #define _IO__BUFFERED_DETACH_METHODDEF \ - {"detach", _io__Buffered_detach, METH_NOARGS, _io__Buffered_detach__doc__}, + {"detach", (PyCFunction)_io__Buffered_detach, METH_NOARGS, _io__Buffered_detach__doc__}, static PyObject * _io__Buffered_detach_impl(buffered *self); @@ -420,7 +420,7 @@ PyDoc_STRVAR(_io__Buffered_seekable__doc__, "\n"); #define _IO__BUFFERED_SEEKABLE_METHODDEF \ - {"seekable", _io__Buffered_seekable, METH_NOARGS, _io__Buffered_seekable__doc__}, + {"seekable", (PyCFunction)_io__Buffered_seekable, METH_NOARGS, _io__Buffered_seekable__doc__}, static PyObject * _io__Buffered_seekable_impl(buffered *self); @@ -443,7 +443,7 @@ PyDoc_STRVAR(_io__Buffered_readable__doc__, "\n"); #define _IO__BUFFERED_READABLE_METHODDEF \ - {"readable", _io__Buffered_readable, METH_NOARGS, _io__Buffered_readable__doc__}, + {"readable", (PyCFunction)_io__Buffered_readable, METH_NOARGS, _io__Buffered_readable__doc__}, static PyObject * _io__Buffered_readable_impl(buffered *self); @@ -466,7 +466,7 @@ PyDoc_STRVAR(_io__Buffered_writable__doc__, "\n"); #define _IO__BUFFERED_WRITABLE_METHODDEF \ - {"writable", _io__Buffered_writable, METH_NOARGS, _io__Buffered_writable__doc__}, + {"writable", (PyCFunction)_io__Buffered_writable, METH_NOARGS, _io__Buffered_writable__doc__}, static PyObject * _io__Buffered_writable_impl(buffered *self); @@ -539,7 +539,7 @@ PyDoc_STRVAR(_io__Buffered_fileno__doc__, "\n"); #define _IO__BUFFERED_FILENO_METHODDEF \ - {"fileno", _io__Buffered_fileno, METH_NOARGS, _io__Buffered_fileno__doc__}, + {"fileno", (PyCFunction)_io__Buffered_fileno, METH_NOARGS, _io__Buffered_fileno__doc__}, static PyObject * _io__Buffered_fileno_impl(buffered *self); @@ -562,7 +562,7 @@ PyDoc_STRVAR(_io__Buffered_isatty__doc__, "\n"); #define _IO__BUFFERED_ISATTY_METHODDEF \ - {"isatty", _io__Buffered_isatty, METH_NOARGS, _io__Buffered_isatty__doc__}, + {"isatty", (PyCFunction)_io__Buffered_isatty, METH_NOARGS, _io__Buffered_isatty__doc__}, static PyObject * _io__Buffered_isatty_impl(buffered *self); @@ -585,7 +585,7 @@ PyDoc_STRVAR(_io__Buffered_flush__doc__, "\n"); #define _IO__BUFFERED_FLUSH_METHODDEF \ - {"flush", _io__Buffered_flush, METH_NOARGS, _io__Buffered_flush__doc__}, + {"flush", (PyCFunction)_io__Buffered_flush, METH_NOARGS, _io__Buffered_flush__doc__}, static PyObject * _io__Buffered_flush_impl(buffered *self); @@ -731,7 +731,7 @@ PyDoc_STRVAR(_io__Buffered_readinto__doc__, "\n"); #define _IO__BUFFERED_READINTO_METHODDEF \ - {"readinto", _io__Buffered_readinto, METH_O, _io__Buffered_readinto__doc__}, + {"readinto", (PyCFunction)_io__Buffered_readinto, METH_O, _io__Buffered_readinto__doc__}, static PyObject * _io__Buffered_readinto_impl(buffered *self, Py_buffer *buffer); @@ -765,7 +765,7 @@ PyDoc_STRVAR(_io__Buffered_readinto1__doc__, "\n"); #define _IO__BUFFERED_READINTO1_METHODDEF \ - {"readinto1", _io__Buffered_readinto1, METH_O, _io__Buffered_readinto1__doc__}, + {"readinto1", (PyCFunction)_io__Buffered_readinto1, METH_O, _io__Buffered_readinto1__doc__}, static PyObject * _io__Buffered_readinto1_impl(buffered *self, Py_buffer *buffer); @@ -834,7 +834,7 @@ PyDoc_STRVAR(_io__Buffered_tell__doc__, "\n"); #define _IO__BUFFERED_TELL_METHODDEF \ - {"tell", _io__Buffered_tell, METH_NOARGS, _io__Buffered_tell__doc__}, + {"tell", (PyCFunction)_io__Buffered_tell, METH_NOARGS, _io__Buffered_tell__doc__}, static PyObject * _io__Buffered_tell_impl(buffered *self); @@ -1096,7 +1096,7 @@ PyDoc_STRVAR(_io_BufferedWriter_write__doc__, "\n"); #define _IO_BUFFEREDWRITER_WRITE_METHODDEF \ - {"write", _io_BufferedWriter_write, METH_O, _io_BufferedWriter_write__doc__}, + {"write", (PyCFunction)_io_BufferedWriter_write, METH_O, _io_BufferedWriter_write__doc__}, static PyObject * _io_BufferedWriter_write_impl(buffered *self, Py_buffer *buffer); @@ -1259,4 +1259,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=c9f9d2206eaf7514 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1a0562c66776fd53 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index 434f78bd1489fd..dc481603d1e8a2 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(_io_BytesIO_readable__doc__, "Returns True if the IO object can be read."); #define _IO_BYTESIO_READABLE_METHODDEF \ - {"readable", _io_BytesIO_readable, METH_NOARGS, _io_BytesIO_readable__doc__}, + {"readable", (PyCFunction)_io_BytesIO_readable, METH_NOARGS, _io_BytesIO_readable__doc__}, static PyObject * _io_BytesIO_readable_impl(bytesio *self); @@ -34,7 +34,7 @@ PyDoc_STRVAR(_io_BytesIO_writable__doc__, "Returns True if the IO object can be written."); #define _IO_BYTESIO_WRITABLE_METHODDEF \ - {"writable", _io_BytesIO_writable, METH_NOARGS, _io_BytesIO_writable__doc__}, + {"writable", (PyCFunction)_io_BytesIO_writable, METH_NOARGS, _io_BytesIO_writable__doc__}, static PyObject * _io_BytesIO_writable_impl(bytesio *self); @@ -52,7 +52,7 @@ PyDoc_STRVAR(_io_BytesIO_seekable__doc__, "Returns True if the IO object can be seeked."); #define _IO_BYTESIO_SEEKABLE_METHODDEF \ - {"seekable", _io_BytesIO_seekable, METH_NOARGS, _io_BytesIO_seekable__doc__}, + {"seekable", (PyCFunction)_io_BytesIO_seekable, METH_NOARGS, _io_BytesIO_seekable__doc__}, static PyObject * _io_BytesIO_seekable_impl(bytesio *self); @@ -70,7 +70,7 @@ PyDoc_STRVAR(_io_BytesIO_flush__doc__, "Does nothing."); #define _IO_BYTESIO_FLUSH_METHODDEF \ - {"flush", _io_BytesIO_flush, METH_NOARGS, _io_BytesIO_flush__doc__}, + {"flush", (PyCFunction)_io_BytesIO_flush, METH_NOARGS, _io_BytesIO_flush__doc__}, static PyObject * _io_BytesIO_flush_impl(bytesio *self); @@ -110,7 +110,7 @@ PyDoc_STRVAR(_io_BytesIO_getvalue__doc__, "Retrieve the entire contents of the BytesIO object."); #define _IO_BYTESIO_GETVALUE_METHODDEF \ - {"getvalue", _io_BytesIO_getvalue, METH_NOARGS, _io_BytesIO_getvalue__doc__}, + {"getvalue", (PyCFunction)_io_BytesIO_getvalue, METH_NOARGS, _io_BytesIO_getvalue__doc__}, static PyObject * _io_BytesIO_getvalue_impl(bytesio *self); @@ -130,7 +130,7 @@ PyDoc_STRVAR(_io_BytesIO_isatty__doc__, "BytesIO objects are not connected to a TTY-like device."); #define _IO_BYTESIO_ISATTY_METHODDEF \ - {"isatty", _io_BytesIO_isatty, METH_NOARGS, _io_BytesIO_isatty__doc__}, + {"isatty", (PyCFunction)_io_BytesIO_isatty, METH_NOARGS, _io_BytesIO_isatty__doc__}, static PyObject * _io_BytesIO_isatty_impl(bytesio *self); @@ -148,7 +148,7 @@ PyDoc_STRVAR(_io_BytesIO_tell__doc__, "Current file position, an integer."); #define _IO_BYTESIO_TELL_METHODDEF \ - {"tell", _io_BytesIO_tell, METH_NOARGS, _io_BytesIO_tell__doc__}, + {"tell", (PyCFunction)_io_BytesIO_tell, METH_NOARGS, _io_BytesIO_tell__doc__}, static PyObject * _io_BytesIO_tell_impl(bytesio *self); @@ -317,7 +317,7 @@ PyDoc_STRVAR(_io_BytesIO_readinto__doc__, "is set not to block and has no data to read."); #define _IO_BYTESIO_READINTO_METHODDEF \ - {"readinto", _io_BytesIO_readinto, METH_O, _io_BytesIO_readinto__doc__}, + {"readinto", (PyCFunction)_io_BytesIO_readinto, METH_O, _io_BytesIO_readinto__doc__}, static PyObject * _io_BytesIO_readinto_impl(bytesio *self, Py_buffer *buffer); @@ -443,7 +443,7 @@ PyDoc_STRVAR(_io_BytesIO_write__doc__, "Return the number of bytes written."); #define _IO_BYTESIO_WRITE_METHODDEF \ - {"write", _io_BytesIO_write, METH_O, _io_BytesIO_write__doc__}, + {"write", (PyCFunction)_io_BytesIO_write, METH_O, _io_BytesIO_write__doc__}, static PyObject * _io_BytesIO_write_impl(bytesio *self, PyObject *b); @@ -469,7 +469,7 @@ PyDoc_STRVAR(_io_BytesIO_writelines__doc__, "each element."); #define _IO_BYTESIO_WRITELINES_METHODDEF \ - {"writelines", _io_BytesIO_writelines, METH_O, _io_BytesIO_writelines__doc__}, + {"writelines", (PyCFunction)_io_BytesIO_writelines, METH_O, _io_BytesIO_writelines__doc__}, static PyObject * _io_BytesIO_writelines_impl(bytesio *self, PyObject *lines); @@ -491,7 +491,7 @@ PyDoc_STRVAR(_io_BytesIO_close__doc__, "Disable all I/O operations."); #define _IO_BYTESIO_CLOSE_METHODDEF \ - {"close", _io_BytesIO_close, METH_NOARGS, _io_BytesIO_close__doc__}, + {"close", (PyCFunction)_io_BytesIO_close, METH_NOARGS, _io_BytesIO_close__doc__}, static PyObject * _io_BytesIO_close_impl(bytesio *self); @@ -561,4 +561,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=094ee2072ceab962 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=477217b2bc464110 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index 5038561391581c..bc816ea030fc80 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -145,7 +145,7 @@ PyDoc_STRVAR(_io_FileIO_fileno__doc__, "Return the underlying file descriptor (an integer)."); #define _IO_FILEIO_FILENO_METHODDEF \ - {"fileno", _io_FileIO_fileno, METH_NOARGS, _io_FileIO_fileno__doc__}, + {"fileno", (PyCFunction)_io_FileIO_fileno, METH_NOARGS, _io_FileIO_fileno__doc__}, static PyObject * _io_FileIO_fileno_impl(fileio *self); @@ -163,7 +163,7 @@ PyDoc_STRVAR(_io_FileIO_readable__doc__, "True if file was opened in a read mode."); #define _IO_FILEIO_READABLE_METHODDEF \ - {"readable", _io_FileIO_readable, METH_NOARGS, _io_FileIO_readable__doc__}, + {"readable", (PyCFunction)_io_FileIO_readable, METH_NOARGS, _io_FileIO_readable__doc__}, static PyObject * _io_FileIO_readable_impl(fileio *self); @@ -181,7 +181,7 @@ PyDoc_STRVAR(_io_FileIO_writable__doc__, "True if file was opened in a write mode."); #define _IO_FILEIO_WRITABLE_METHODDEF \ - {"writable", _io_FileIO_writable, METH_NOARGS, _io_FileIO_writable__doc__}, + {"writable", (PyCFunction)_io_FileIO_writable, METH_NOARGS, _io_FileIO_writable__doc__}, static PyObject * _io_FileIO_writable_impl(fileio *self); @@ -199,7 +199,7 @@ PyDoc_STRVAR(_io_FileIO_seekable__doc__, "True if file supports random-access."); #define _IO_FILEIO_SEEKABLE_METHODDEF \ - {"seekable", _io_FileIO_seekable, METH_NOARGS, _io_FileIO_seekable__doc__}, + {"seekable", (PyCFunction)_io_FileIO_seekable, METH_NOARGS, _io_FileIO_seekable__doc__}, static PyObject * _io_FileIO_seekable_impl(fileio *self); @@ -275,7 +275,7 @@ PyDoc_STRVAR(_io_FileIO_readall__doc__, "data is available (EAGAIN is returned before bytes are read) returns None."); #define _IO_FILEIO_READALL_METHODDEF \ - {"readall", _io_FileIO_readall, METH_NOARGS, _io_FileIO_readall__doc__}, + {"readall", (PyCFunction)_io_FileIO_readall, METH_NOARGS, _io_FileIO_readall__doc__}, static PyObject * _io_FileIO_readall_impl(fileio *self); @@ -454,7 +454,7 @@ PyDoc_STRVAR(_io_FileIO_tell__doc__, "Can raise OSError for non seekable files."); #define _IO_FILEIO_TELL_METHODDEF \ - {"tell", _io_FileIO_tell, METH_NOARGS, _io_FileIO_tell__doc__}, + {"tell", (PyCFunction)_io_FileIO_tell, METH_NOARGS, _io_FileIO_tell__doc__}, static PyObject * _io_FileIO_tell_impl(fileio *self); @@ -527,7 +527,7 @@ PyDoc_STRVAR(_io_FileIO_isatty__doc__, "True if the file is connected to a TTY device."); #define _IO_FILEIO_ISATTY_METHODDEF \ - {"isatty", _io_FileIO_isatty, METH_NOARGS, _io_FileIO_isatty__doc__}, + {"isatty", (PyCFunction)_io_FileIO_isatty, METH_NOARGS, _io_FileIO_isatty__doc__}, static PyObject * _io_FileIO_isatty_impl(fileio *self); @@ -541,4 +541,4 @@ _io_FileIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=472dfa3229b4e10f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f4e1f74c03d4ecdf input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/iobase.c.h b/Modules/_io/clinic/iobase.c.h index 2b310d6b651bbe..402448545dfc51 100644 --- a/Modules/_io/clinic/iobase.c.h +++ b/Modules/_io/clinic/iobase.c.h @@ -86,7 +86,7 @@ PyDoc_STRVAR(_io__IOBase_tell__doc__, "Return current stream position."); #define _IO__IOBASE_TELL_METHODDEF \ - {"tell", _io__IOBase_tell, METH_NOARGS, _io__IOBase_tell__doc__}, + {"tell", (PyCFunction)_io__IOBase_tell, METH_NOARGS, _io__IOBase_tell__doc__}, static PyObject * _io__IOBase_tell_impl(PyObject *self); @@ -158,7 +158,7 @@ PyDoc_STRVAR(_io__IOBase_flush__doc__, "This is not implemented for read-only and non-blocking streams."); #define _IO__IOBASE_FLUSH_METHODDEF \ - {"flush", _io__IOBase_flush, METH_NOARGS, _io__IOBase_flush__doc__}, + {"flush", (PyCFunction)_io__IOBase_flush, METH_NOARGS, _io__IOBase_flush__doc__}, static PyObject * _io__IOBase_flush_impl(PyObject *self); @@ -178,7 +178,7 @@ PyDoc_STRVAR(_io__IOBase_close__doc__, "This method has no effect if the file is already closed."); #define _IO__IOBASE_CLOSE_METHODDEF \ - {"close", _io__IOBase_close, METH_NOARGS, _io__IOBase_close__doc__}, + {"close", (PyCFunction)_io__IOBase_close, METH_NOARGS, _io__IOBase_close__doc__}, static PyObject * _io__IOBase_close_impl(PyObject *self); @@ -199,7 +199,7 @@ PyDoc_STRVAR(_io__IOBase_seekable__doc__, "This method may need to do a test seek()."); #define _IO__IOBASE_SEEKABLE_METHODDEF \ - {"seekable", _io__IOBase_seekable, METH_NOARGS, _io__IOBase_seekable__doc__}, + {"seekable", (PyCFunction)_io__IOBase_seekable, METH_NOARGS, _io__IOBase_seekable__doc__}, static PyObject * _io__IOBase_seekable_impl(PyObject *self); @@ -219,7 +219,7 @@ PyDoc_STRVAR(_io__IOBase_readable__doc__, "If False, read() will raise OSError."); #define _IO__IOBASE_READABLE_METHODDEF \ - {"readable", _io__IOBase_readable, METH_NOARGS, _io__IOBase_readable__doc__}, + {"readable", (PyCFunction)_io__IOBase_readable, METH_NOARGS, _io__IOBase_readable__doc__}, static PyObject * _io__IOBase_readable_impl(PyObject *self); @@ -239,7 +239,7 @@ PyDoc_STRVAR(_io__IOBase_writable__doc__, "If False, write() will raise OSError."); #define _IO__IOBASE_WRITABLE_METHODDEF \ - {"writable", _io__IOBase_writable, METH_NOARGS, _io__IOBase_writable__doc__}, + {"writable", (PyCFunction)_io__IOBase_writable, METH_NOARGS, _io__IOBase_writable__doc__}, static PyObject * _io__IOBase_writable_impl(PyObject *self); @@ -283,7 +283,7 @@ PyDoc_STRVAR(_io__IOBase_isatty__doc__, "Return False if it can\'t be determined."); #define _IO__IOBASE_ISATTY_METHODDEF \ - {"isatty", _io__IOBase_isatty, METH_NOARGS, _io__IOBase_isatty__doc__}, + {"isatty", (PyCFunction)_io__IOBase_isatty, METH_NOARGS, _io__IOBase_isatty__doc__}, static PyObject * _io__IOBase_isatty_impl(PyObject *self); @@ -382,7 +382,7 @@ PyDoc_STRVAR(_io__IOBase_writelines__doc__, "lines provided to have a line separator at the end."); #define _IO__IOBASE_WRITELINES_METHODDEF \ - {"writelines", _io__IOBase_writelines, METH_O, _io__IOBase_writelines__doc__}, + {"writelines", (PyCFunction)_io__IOBase_writelines, METH_O, _io__IOBase_writelines__doc__}, PyDoc_STRVAR(_io__RawIOBase_read__doc__, "read($self, size=-1, /)\n" @@ -433,7 +433,7 @@ PyDoc_STRVAR(_io__RawIOBase_readall__doc__, "Read until EOF, using multiple read() call."); #define _IO__RAWIOBASE_READALL_METHODDEF \ - {"readall", _io__RawIOBase_readall, METH_NOARGS, _io__RawIOBase_readall__doc__}, + {"readall", (PyCFunction)_io__RawIOBase_readall, METH_NOARGS, _io__RawIOBase_readall__doc__}, static PyObject * _io__RawIOBase_readall_impl(PyObject *self); @@ -443,4 +443,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _io__RawIOBase_readall_impl(self); } -/*[clinic end generated code: output=6081b57d56063953 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9359e74d95534bef input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h index dde54cbaaf8994..2c5757f668e93d 100644 --- a/Modules/_io/clinic/stringio.c.h +++ b/Modules/_io/clinic/stringio.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(_io_StringIO_getvalue__doc__, "Retrieve the entire contents of the object."); #define _IO_STRINGIO_GETVALUE_METHODDEF \ - {"getvalue", _io_StringIO_getvalue, METH_NOARGS, _io_StringIO_getvalue__doc__}, + {"getvalue", (PyCFunction)_io_StringIO_getvalue, METH_NOARGS, _io_StringIO_getvalue__doc__}, static PyObject * _io_StringIO_getvalue_impl(stringio *self); @@ -41,7 +41,7 @@ PyDoc_STRVAR(_io_StringIO_tell__doc__, "Tell the current file position."); #define _IO_STRINGIO_TELL_METHODDEF \ - {"tell", _io_StringIO_tell, METH_NOARGS, _io_StringIO_tell__doc__}, + {"tell", (PyCFunction)_io_StringIO_tell, METH_NOARGS, _io_StringIO_tell__doc__}, static PyObject * _io_StringIO_tell_impl(stringio *self); @@ -241,7 +241,7 @@ PyDoc_STRVAR(_io_StringIO_write__doc__, "the length of the string."); #define _IO_STRINGIO_WRITE_METHODDEF \ - {"write", _io_StringIO_write, METH_O, _io_StringIO_write__doc__}, + {"write", (PyCFunction)_io_StringIO_write, METH_O, _io_StringIO_write__doc__}, static PyObject * _io_StringIO_write_impl(stringio *self, PyObject *obj); @@ -270,7 +270,7 @@ PyDoc_STRVAR(_io_StringIO_close__doc__, "This method has no effect if the file is already closed."); #define _IO_STRINGIO_CLOSE_METHODDEF \ - {"close", _io_StringIO_close, METH_NOARGS, _io_StringIO_close__doc__}, + {"close", (PyCFunction)_io_StringIO_close, METH_NOARGS, _io_StringIO_close__doc__}, static PyObject * _io_StringIO_close_impl(stringio *self); @@ -365,7 +365,7 @@ PyDoc_STRVAR(_io_StringIO_readable__doc__, "Returns True if the IO object can be read."); #define _IO_STRINGIO_READABLE_METHODDEF \ - {"readable", _io_StringIO_readable, METH_NOARGS, _io_StringIO_readable__doc__}, + {"readable", (PyCFunction)_io_StringIO_readable, METH_NOARGS, _io_StringIO_readable__doc__}, static PyObject * _io_StringIO_readable_impl(stringio *self); @@ -389,7 +389,7 @@ PyDoc_STRVAR(_io_StringIO_writable__doc__, "Returns True if the IO object can be written."); #define _IO_STRINGIO_WRITABLE_METHODDEF \ - {"writable", _io_StringIO_writable, METH_NOARGS, _io_StringIO_writable__doc__}, + {"writable", (PyCFunction)_io_StringIO_writable, METH_NOARGS, _io_StringIO_writable__doc__}, static PyObject * _io_StringIO_writable_impl(stringio *self); @@ -413,7 +413,7 @@ PyDoc_STRVAR(_io_StringIO_seekable__doc__, "Returns True if the IO object can be seeked."); #define _IO_STRINGIO_SEEKABLE_METHODDEF \ - {"seekable", _io_StringIO_seekable, METH_NOARGS, _io_StringIO_seekable__doc__}, + {"seekable", (PyCFunction)_io_StringIO_seekable, METH_NOARGS, _io_StringIO_seekable__doc__}, static PyObject * _io_StringIO_seekable_impl(stringio *self); @@ -436,7 +436,7 @@ PyDoc_STRVAR(_io_StringIO___getstate____doc__, "\n"); #define _IO_STRINGIO___GETSTATE___METHODDEF \ - {"__getstate__", _io_StringIO___getstate__, METH_NOARGS, _io_StringIO___getstate____doc__}, + {"__getstate__", (PyCFunction)_io_StringIO___getstate__, METH_NOARGS, _io_StringIO___getstate____doc__}, static PyObject * _io_StringIO___getstate___impl(stringio *self); @@ -459,7 +459,7 @@ PyDoc_STRVAR(_io_StringIO___setstate____doc__, "\n"); #define _IO_STRINGIO___SETSTATE___METHODDEF \ - {"__setstate__", _io_StringIO___setstate__, METH_O, _io_StringIO___setstate____doc__}, + {"__setstate__", (PyCFunction)_io_StringIO___setstate__, METH_O, _io_StringIO___setstate____doc__}, static PyObject * _io_StringIO___setstate___impl(stringio *self, PyObject *state); @@ -550,4 +550,4 @@ _io_StringIO_newlines_get(PyObject *self, void *Py_UNUSED(context)) return return_value; } -/*[clinic end generated code: output=6914ca11bef4bc35 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=69c9b100a359cbd5 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index c70620088e3d00..fd84198b1036de 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -438,7 +438,7 @@ PyDoc_STRVAR(_io_IncrementalNewlineDecoder_getstate__doc__, "\n"); #define _IO_INCREMENTALNEWLINEDECODER_GETSTATE_METHODDEF \ - {"getstate", _io_IncrementalNewlineDecoder_getstate, METH_NOARGS, _io_IncrementalNewlineDecoder_getstate__doc__}, + {"getstate", (PyCFunction)_io_IncrementalNewlineDecoder_getstate, METH_NOARGS, _io_IncrementalNewlineDecoder_getstate__doc__}, static PyObject * _io_IncrementalNewlineDecoder_getstate_impl(nldecoder_object *self); @@ -455,7 +455,7 @@ PyDoc_STRVAR(_io_IncrementalNewlineDecoder_setstate__doc__, "\n"); #define _IO_INCREMENTALNEWLINEDECODER_SETSTATE_METHODDEF \ - {"setstate", _io_IncrementalNewlineDecoder_setstate, METH_O, _io_IncrementalNewlineDecoder_setstate__doc__}, + {"setstate", (PyCFunction)_io_IncrementalNewlineDecoder_setstate, METH_O, _io_IncrementalNewlineDecoder_setstate__doc__}, static PyObject * _io_IncrementalNewlineDecoder_setstate_impl(nldecoder_object *self, @@ -477,7 +477,7 @@ PyDoc_STRVAR(_io_IncrementalNewlineDecoder_reset__doc__, "\n"); #define _IO_INCREMENTALNEWLINEDECODER_RESET_METHODDEF \ - {"reset", _io_IncrementalNewlineDecoder_reset, METH_NOARGS, _io_IncrementalNewlineDecoder_reset__doc__}, + {"reset", (PyCFunction)_io_IncrementalNewlineDecoder_reset, METH_NOARGS, _io_IncrementalNewlineDecoder_reset__doc__}, static PyObject * _io_IncrementalNewlineDecoder_reset_impl(nldecoder_object *self); @@ -752,7 +752,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_detach__doc__, "\n"); #define _IO_TEXTIOWRAPPER_DETACH_METHODDEF \ - {"detach", _io_TextIOWrapper_detach, METH_NOARGS, _io_TextIOWrapper_detach__doc__}, + {"detach", (PyCFunction)_io_TextIOWrapper_detach, METH_NOARGS, _io_TextIOWrapper_detach__doc__}, static PyObject * _io_TextIOWrapper_detach_impl(textio *self); @@ -775,7 +775,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_write__doc__, "\n"); #define _IO_TEXTIOWRAPPER_WRITE_METHODDEF \ - {"write", _io_TextIOWrapper_write, METH_O, _io_TextIOWrapper_write__doc__}, + {"write", (PyCFunction)_io_TextIOWrapper_write, METH_O, _io_TextIOWrapper_write__doc__}, static PyObject * _io_TextIOWrapper_write_impl(textio *self, PyObject *text); @@ -944,7 +944,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_tell__doc__, "previous stream position."); #define _IO_TEXTIOWRAPPER_TELL_METHODDEF \ - {"tell", _io_TextIOWrapper_tell, METH_NOARGS, _io_TextIOWrapper_tell__doc__}, + {"tell", (PyCFunction)_io_TextIOWrapper_tell, METH_NOARGS, _io_TextIOWrapper_tell__doc__}, static PyObject * _io_TextIOWrapper_tell_impl(textio *self); @@ -1000,7 +1000,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_fileno__doc__, "\n"); #define _IO_TEXTIOWRAPPER_FILENO_METHODDEF \ - {"fileno", _io_TextIOWrapper_fileno, METH_NOARGS, _io_TextIOWrapper_fileno__doc__}, + {"fileno", (PyCFunction)_io_TextIOWrapper_fileno, METH_NOARGS, _io_TextIOWrapper_fileno__doc__}, static PyObject * _io_TextIOWrapper_fileno_impl(textio *self); @@ -1023,7 +1023,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_seekable__doc__, "\n"); #define _IO_TEXTIOWRAPPER_SEEKABLE_METHODDEF \ - {"seekable", _io_TextIOWrapper_seekable, METH_NOARGS, _io_TextIOWrapper_seekable__doc__}, + {"seekable", (PyCFunction)_io_TextIOWrapper_seekable, METH_NOARGS, _io_TextIOWrapper_seekable__doc__}, static PyObject * _io_TextIOWrapper_seekable_impl(textio *self); @@ -1046,7 +1046,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_readable__doc__, "\n"); #define _IO_TEXTIOWRAPPER_READABLE_METHODDEF \ - {"readable", _io_TextIOWrapper_readable, METH_NOARGS, _io_TextIOWrapper_readable__doc__}, + {"readable", (PyCFunction)_io_TextIOWrapper_readable, METH_NOARGS, _io_TextIOWrapper_readable__doc__}, static PyObject * _io_TextIOWrapper_readable_impl(textio *self); @@ -1069,7 +1069,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_writable__doc__, "\n"); #define _IO_TEXTIOWRAPPER_WRITABLE_METHODDEF \ - {"writable", _io_TextIOWrapper_writable, METH_NOARGS, _io_TextIOWrapper_writable__doc__}, + {"writable", (PyCFunction)_io_TextIOWrapper_writable, METH_NOARGS, _io_TextIOWrapper_writable__doc__}, static PyObject * _io_TextIOWrapper_writable_impl(textio *self); @@ -1092,7 +1092,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_isatty__doc__, "\n"); #define _IO_TEXTIOWRAPPER_ISATTY_METHODDEF \ - {"isatty", _io_TextIOWrapper_isatty, METH_NOARGS, _io_TextIOWrapper_isatty__doc__}, + {"isatty", (PyCFunction)_io_TextIOWrapper_isatty, METH_NOARGS, _io_TextIOWrapper_isatty__doc__}, static PyObject * _io_TextIOWrapper_isatty_impl(textio *self); @@ -1115,7 +1115,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_flush__doc__, "\n"); #define _IO_TEXTIOWRAPPER_FLUSH_METHODDEF \ - {"flush", _io_TextIOWrapper_flush, METH_NOARGS, _io_TextIOWrapper_flush__doc__}, + {"flush", (PyCFunction)_io_TextIOWrapper_flush, METH_NOARGS, _io_TextIOWrapper_flush__doc__}, static PyObject * _io_TextIOWrapper_flush_impl(textio *self); @@ -1138,7 +1138,7 @@ PyDoc_STRVAR(_io_TextIOWrapper_close__doc__, "\n"); #define _IO_TEXTIOWRAPPER_CLOSE_METHODDEF \ - {"close", _io_TextIOWrapper_close, METH_NOARGS, _io_TextIOWrapper_close__doc__}, + {"close", (PyCFunction)_io_TextIOWrapper_close, METH_NOARGS, _io_TextIOWrapper_close__doc__}, static PyObject * _io_TextIOWrapper_close_impl(textio *self); @@ -1304,4 +1304,4 @@ _io_TextIOWrapper__CHUNK_SIZE_set(PyObject *self, PyObject *value, void *Py_UNUS return return_value; } -/*[clinic end generated code: output=fa7f387a4f8689a4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dad68d8c33d676e6 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index 33df4370af7955..ba6dcde6e01064 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -148,7 +148,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_fileno__doc__, "Return the underlying file descriptor (an integer)."); #define _IO__WINDOWSCONSOLEIO_FILENO_METHODDEF \ - {"fileno", _io__WindowsConsoleIO_fileno, METH_NOARGS, _io__WindowsConsoleIO_fileno__doc__}, + {"fileno", (PyCFunction)_io__WindowsConsoleIO_fileno, METH_NOARGS, _io__WindowsConsoleIO_fileno__doc__}, static PyObject * _io__WindowsConsoleIO_fileno_impl(winconsoleio *self); @@ -170,7 +170,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_readable__doc__, "True if console is an input buffer."); #define _IO__WINDOWSCONSOLEIO_READABLE_METHODDEF \ - {"readable", _io__WindowsConsoleIO_readable, METH_NOARGS, _io__WindowsConsoleIO_readable__doc__}, + {"readable", (PyCFunction)_io__WindowsConsoleIO_readable, METH_NOARGS, _io__WindowsConsoleIO_readable__doc__}, static PyObject * _io__WindowsConsoleIO_readable_impl(winconsoleio *self); @@ -192,7 +192,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_writable__doc__, "True if console is an output buffer."); #define _IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF \ - {"writable", _io__WindowsConsoleIO_writable, METH_NOARGS, _io__WindowsConsoleIO_writable__doc__}, + {"writable", (PyCFunction)_io__WindowsConsoleIO_writable, METH_NOARGS, _io__WindowsConsoleIO_writable__doc__}, static PyObject * _io__WindowsConsoleIO_writable_impl(winconsoleio *self); @@ -273,7 +273,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_readall__doc__, "Return an empty bytes object at EOF."); #define _IO__WINDOWSCONSOLEIO_READALL_METHODDEF \ - {"readall", _io__WindowsConsoleIO_readall, METH_NOARGS, _io__WindowsConsoleIO_readall__doc__}, + {"readall", (PyCFunction)_io__WindowsConsoleIO_readall, METH_NOARGS, _io__WindowsConsoleIO_readall__doc__}, static PyObject * _io__WindowsConsoleIO_readall_impl(winconsoleio *self); @@ -413,7 +413,7 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_isatty__doc__, "Always True."); #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF \ - {"isatty", _io__WindowsConsoleIO_isatty, METH_NOARGS, _io__WindowsConsoleIO_isatty__doc__}, + {"isatty", (PyCFunction)_io__WindowsConsoleIO_isatty, METH_NOARGS, _io__WindowsConsoleIO_isatty__doc__}, static PyObject * _io__WindowsConsoleIO_isatty_impl(winconsoleio *self); @@ -461,4 +461,4 @@ _io__WindowsConsoleIO_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=10c53819f68d4b50 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=edc47f5c49589045 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/multiprocessing.c.h b/Modules/_multiprocessing/clinic/multiprocessing.c.h index 192a86f8819144..6d4f5c2afcfd39 100644 --- a/Modules/_multiprocessing/clinic/multiprocessing.c.h +++ b/Modules/_multiprocessing/clinic/multiprocessing.c.h @@ -12,7 +12,7 @@ PyDoc_STRVAR(_multiprocessing_closesocket__doc__, "\n"); #define _MULTIPROCESSING_CLOSESOCKET_METHODDEF \ - {"closesocket", _multiprocessing_closesocket, METH_O, _multiprocessing_closesocket__doc__}, + {"closesocket", (PyCFunction)_multiprocessing_closesocket, METH_O, _multiprocessing_closesocket__doc__}, static PyObject * _multiprocessing_closesocket_impl(PyObject *module, HANDLE handle); @@ -123,7 +123,7 @@ PyDoc_STRVAR(_multiprocessing_sem_unlink__doc__, "\n"); #define _MULTIPROCESSING_SEM_UNLINK_METHODDEF \ - {"sem_unlink", _multiprocessing_sem_unlink, METH_O, _multiprocessing_sem_unlink__doc__}, + {"sem_unlink", (PyCFunction)_multiprocessing_sem_unlink, METH_O, _multiprocessing_sem_unlink__doc__}, static PyObject * _multiprocessing_sem_unlink_impl(PyObject *module, const char *name); @@ -164,4 +164,4 @@ _multiprocessing_sem_unlink(PyObject *module, PyObject *arg) #ifndef _MULTIPROCESSING_SEND_METHODDEF #define _MULTIPROCESSING_SEND_METHODDEF #endif /* !defined(_MULTIPROCESSING_SEND_METHODDEF) */ -/*[clinic end generated code: output=978917b569b6ffb0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=73b4cb8428d816da input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/posixshmem.c.h b/Modules/_multiprocessing/clinic/posixshmem.c.h index 2d0d4f17e55274..a545ff4d80f067 100644 --- a/Modules/_multiprocessing/clinic/posixshmem.c.h +++ b/Modules/_multiprocessing/clinic/posixshmem.c.h @@ -55,7 +55,7 @@ PyDoc_STRVAR(_posixshmem_shm_unlink__doc__, "region."); #define _POSIXSHMEM_SHM_UNLINK_METHODDEF \ - {"shm_unlink", _posixshmem_shm_unlink, METH_O, _posixshmem_shm_unlink__doc__}, + {"shm_unlink", (PyCFunction)_posixshmem_shm_unlink, METH_O, _posixshmem_shm_unlink__doc__}, static PyObject * _posixshmem_shm_unlink_impl(PyObject *module, PyObject *path); @@ -86,4 +86,4 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *arg) #ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF #define _POSIXSHMEM_SHM_UNLINK_METHODDEF #endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */ -/*[clinic end generated code: output=69688922c0d9548a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=74588a5abba6e36c input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/semaphore.c.h b/Modules/_multiprocessing/clinic/semaphore.c.h index ee96ab2c731ed8..74a9daa3c67ad2 100644 --- a/Modules/_multiprocessing/clinic/semaphore.c.h +++ b/Modules/_multiprocessing/clinic/semaphore.c.h @@ -96,7 +96,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock_release__doc__, "Release the semaphore/lock."); #define _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF \ - {"release", _multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__}, + {"release", (PyCFunction)_multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__}, static PyObject * _multiprocessing_SemLock_release_impl(SemLockObject *self); @@ -202,7 +202,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock_release__doc__, "Release the semaphore/lock."); #define _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF \ - {"release", _multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__}, + {"release", (PyCFunction)_multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__}, static PyObject * _multiprocessing_SemLock_release_impl(SemLockObject *self); @@ -352,7 +352,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock__count__doc__, "Num of `acquire()`s minus num of `release()`s for this process."); #define _MULTIPROCESSING_SEMLOCK__COUNT_METHODDEF \ - {"_count", _multiprocessing_SemLock__count, METH_NOARGS, _multiprocessing_SemLock__count__doc__}, + {"_count", (PyCFunction)_multiprocessing_SemLock__count, METH_NOARGS, _multiprocessing_SemLock__count__doc__}, static PyObject * _multiprocessing_SemLock__count_impl(SemLockObject *self); @@ -380,7 +380,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock__is_mine__doc__, "Whether the lock is owned by this thread."); #define _MULTIPROCESSING_SEMLOCK__IS_MINE_METHODDEF \ - {"_is_mine", _multiprocessing_SemLock__is_mine, METH_NOARGS, _multiprocessing_SemLock__is_mine__doc__}, + {"_is_mine", (PyCFunction)_multiprocessing_SemLock__is_mine, METH_NOARGS, _multiprocessing_SemLock__is_mine__doc__}, static PyObject * _multiprocessing_SemLock__is_mine_impl(SemLockObject *self); @@ -402,7 +402,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock__get_value__doc__, "Get the value of the semaphore."); #define _MULTIPROCESSING_SEMLOCK__GET_VALUE_METHODDEF \ - {"_get_value", _multiprocessing_SemLock__get_value, METH_NOARGS, _multiprocessing_SemLock__get_value__doc__}, + {"_get_value", (PyCFunction)_multiprocessing_SemLock__get_value, METH_NOARGS, _multiprocessing_SemLock__get_value__doc__}, static PyObject * _multiprocessing_SemLock__get_value_impl(SemLockObject *self); @@ -424,7 +424,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock__is_zero__doc__, "Return whether semaphore has value zero."); #define _MULTIPROCESSING_SEMLOCK__IS_ZERO_METHODDEF \ - {"_is_zero", _multiprocessing_SemLock__is_zero, METH_NOARGS, _multiprocessing_SemLock__is_zero__doc__}, + {"_is_zero", (PyCFunction)_multiprocessing_SemLock__is_zero, METH_NOARGS, _multiprocessing_SemLock__is_zero__doc__}, static PyObject * _multiprocessing_SemLock__is_zero_impl(SemLockObject *self); @@ -446,7 +446,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock__after_fork__doc__, "Rezero the net acquisition count after fork()."); #define _MULTIPROCESSING_SEMLOCK__AFTER_FORK_METHODDEF \ - {"_after_fork", _multiprocessing_SemLock__after_fork, METH_NOARGS, _multiprocessing_SemLock__after_fork__doc__}, + {"_after_fork", (PyCFunction)_multiprocessing_SemLock__after_fork, METH_NOARGS, _multiprocessing_SemLock__after_fork__doc__}, static PyObject * _multiprocessing_SemLock__after_fork_impl(SemLockObject *self); @@ -468,7 +468,7 @@ PyDoc_STRVAR(_multiprocessing_SemLock___enter____doc__, "Enter the semaphore/lock."); #define _MULTIPROCESSING_SEMLOCK___ENTER___METHODDEF \ - {"__enter__", _multiprocessing_SemLock___enter__, METH_NOARGS, _multiprocessing_SemLock___enter____doc__}, + {"__enter__", (PyCFunction)_multiprocessing_SemLock___enter__, METH_NOARGS, _multiprocessing_SemLock___enter____doc__}, static PyObject * _multiprocessing_SemLock___enter___impl(SemLockObject *self); @@ -576,4 +576,4 @@ _multiprocessing_SemLock___exit__(PyObject *self, PyObject *const *args, Py_ssiz #ifndef _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF #define _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF #endif /* !defined(_MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF) */ -/*[clinic end generated code: output=5fb620cdc3ae67af input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dddd8e989525f565 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/blob.c.h b/Modules/_sqlite/clinic/blob.c.h index 3e3e655ed2706f..921e7cbd7ffcab 100644 --- a/Modules/_sqlite/clinic/blob.c.h +++ b/Modules/_sqlite/clinic/blob.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(blob_close__doc__, "Close the blob."); #define BLOB_CLOSE_METHODDEF \ - {"close", blob_close, METH_NOARGS, blob_close__doc__}, + {"close", (PyCFunction)blob_close, METH_NOARGS, blob_close__doc__}, static PyObject * blob_close_impl(pysqlite_Blob *self); @@ -74,7 +74,7 @@ PyDoc_STRVAR(blob_write__doc__, "blob will result in an exception being raised."); #define BLOB_WRITE_METHODDEF \ - {"write", blob_write, METH_O, blob_write__doc__}, + {"write", (PyCFunction)blob_write, METH_O, blob_write__doc__}, static PyObject * blob_write_impl(pysqlite_Blob *self, Py_buffer *data); @@ -150,7 +150,7 @@ PyDoc_STRVAR(blob_tell__doc__, "Return the current access position for the blob."); #define BLOB_TELL_METHODDEF \ - {"tell", blob_tell, METH_NOARGS, blob_tell__doc__}, + {"tell", (PyCFunction)blob_tell, METH_NOARGS, blob_tell__doc__}, static PyObject * blob_tell_impl(pysqlite_Blob *self); @@ -168,7 +168,7 @@ PyDoc_STRVAR(blob_enter__doc__, "Blob context manager enter."); #define BLOB_ENTER_METHODDEF \ - {"__enter__", blob_enter, METH_NOARGS, blob_enter__doc__}, + {"__enter__", (PyCFunction)blob_enter, METH_NOARGS, blob_enter__doc__}, static PyObject * blob_enter_impl(pysqlite_Blob *self); @@ -211,4 +211,4 @@ blob_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=bbd981c41a4b42e3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f03f4ba622b67ae0 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/connection.c.h b/Modules/_sqlite/clinic/connection.c.h index dd525158a3f940..bbdefe24a01370 100644 --- a/Modules/_sqlite/clinic/connection.c.h +++ b/Modules/_sqlite/clinic/connection.c.h @@ -366,7 +366,7 @@ PyDoc_STRVAR(pysqlite_connection_close__doc__, "Any pending transaction is not committed implicitly."); #define PYSQLITE_CONNECTION_CLOSE_METHODDEF \ - {"close", pysqlite_connection_close, METH_NOARGS, pysqlite_connection_close__doc__}, + {"close", (PyCFunction)pysqlite_connection_close, METH_NOARGS, pysqlite_connection_close__doc__}, static PyObject * pysqlite_connection_close_impl(pysqlite_Connection *self); @@ -386,7 +386,7 @@ PyDoc_STRVAR(pysqlite_connection_commit__doc__, "If there is no open transaction, this method is a no-op."); #define PYSQLITE_CONNECTION_COMMIT_METHODDEF \ - {"commit", pysqlite_connection_commit, METH_NOARGS, pysqlite_connection_commit__doc__}, + {"commit", (PyCFunction)pysqlite_connection_commit, METH_NOARGS, pysqlite_connection_commit__doc__}, static PyObject * pysqlite_connection_commit_impl(pysqlite_Connection *self); @@ -406,7 +406,7 @@ PyDoc_STRVAR(pysqlite_connection_rollback__doc__, "If there is no open transaction, this method is a no-op."); #define PYSQLITE_CONNECTION_ROLLBACK_METHODDEF \ - {"rollback", pysqlite_connection_rollback, METH_NOARGS, pysqlite_connection_rollback__doc__}, + {"rollback", (PyCFunction)pysqlite_connection_rollback, METH_NOARGS, pysqlite_connection_rollback__doc__}, static PyObject * pysqlite_connection_rollback_impl(pysqlite_Connection *self); @@ -990,7 +990,7 @@ PyDoc_STRVAR(pysqlite_connection_enable_load_extension__doc__, "Enable dynamic loading of SQLite extension modules."); #define PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF \ - {"enable_load_extension", pysqlite_connection_enable_load_extension, METH_O, pysqlite_connection_enable_load_extension__doc__}, + {"enable_load_extension", (PyCFunction)pysqlite_connection_enable_load_extension, METH_O, pysqlite_connection_enable_load_extension__doc__}, static PyObject * pysqlite_connection_enable_load_extension_impl(pysqlite_Connection *self, @@ -1193,7 +1193,7 @@ PyDoc_STRVAR(pysqlite_connection_executescript__doc__, "Executes multiple SQL statements at once."); #define PYSQLITE_CONNECTION_EXECUTESCRIPT_METHODDEF \ - {"executescript", pysqlite_connection_executescript, METH_O, pysqlite_connection_executescript__doc__}, + {"executescript", (PyCFunction)pysqlite_connection_executescript, METH_O, pysqlite_connection_executescript__doc__}, static PyObject * pysqlite_connection_executescript_impl(pysqlite_Connection *self, @@ -1216,7 +1216,7 @@ PyDoc_STRVAR(pysqlite_connection_interrupt__doc__, "Abort any pending database operation."); #define PYSQLITE_CONNECTION_INTERRUPT_METHODDEF \ - {"interrupt", pysqlite_connection_interrupt, METH_NOARGS, pysqlite_connection_interrupt__doc__}, + {"interrupt", (PyCFunction)pysqlite_connection_interrupt, METH_NOARGS, pysqlite_connection_interrupt__doc__}, static PyObject * pysqlite_connection_interrupt_impl(pysqlite_Connection *self); @@ -1674,7 +1674,7 @@ PyDoc_STRVAR(pysqlite_connection_enter__doc__, "Returns itself as a convenience to the caller."); #define PYSQLITE_CONNECTION_ENTER_METHODDEF \ - {"__enter__", pysqlite_connection_enter, METH_NOARGS, pysqlite_connection_enter__doc__}, + {"__enter__", (PyCFunction)pysqlite_connection_enter, METH_NOARGS, pysqlite_connection_enter__doc__}, static PyObject * pysqlite_connection_enter_impl(pysqlite_Connection *self); @@ -1776,7 +1776,7 @@ PyDoc_STRVAR(getlimit__doc__, " The limit category to be queried."); #define GETLIMIT_METHODDEF \ - {"getlimit", getlimit, METH_O, getlimit__doc__}, + {"getlimit", (PyCFunction)getlimit, METH_O, getlimit__doc__}, static PyObject * getlimit_impl(pysqlite_Connection *self, int category); @@ -1850,7 +1850,7 @@ PyDoc_STRVAR(getconfig__doc__, " The configuration verb; one of the sqlite3.SQLITE_DBCONFIG codes."); #define GETCONFIG_METHODDEF \ - {"getconfig", getconfig, METH_O, getconfig__doc__}, + {"getconfig", (PyCFunction)getconfig, METH_O, getconfig__doc__}, static int getconfig_impl(pysqlite_Connection *self, int op); @@ -1895,4 +1895,4 @@ getconfig(PyObject *self, PyObject *arg) #ifndef DESERIALIZE_METHODDEF #define DESERIALIZE_METHODDEF #endif /* !defined(DESERIALIZE_METHODDEF) */ -/*[clinic end generated code: output=bd39929e8cd492bd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fc4857f09ad563b1 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/cursor.c.h b/Modules/_sqlite/clinic/cursor.c.h index 276d2ad74f0e90..832ba2e43f02bb 100644 --- a/Modules/_sqlite/clinic/cursor.c.h +++ b/Modules/_sqlite/clinic/cursor.c.h @@ -119,7 +119,7 @@ PyDoc_STRVAR(pysqlite_cursor_executescript__doc__, "Executes multiple SQL statements at once."); #define PYSQLITE_CURSOR_EXECUTESCRIPT_METHODDEF \ - {"executescript", pysqlite_cursor_executescript, METH_O, pysqlite_cursor_executescript__doc__}, + {"executescript", (PyCFunction)pysqlite_cursor_executescript, METH_O, pysqlite_cursor_executescript__doc__}, static PyObject * pysqlite_cursor_executescript_impl(pysqlite_Cursor *self, @@ -157,7 +157,7 @@ PyDoc_STRVAR(pysqlite_cursor_fetchone__doc__, "Fetches one row from the resultset."); #define PYSQLITE_CURSOR_FETCHONE_METHODDEF \ - {"fetchone", pysqlite_cursor_fetchone, METH_NOARGS, pysqlite_cursor_fetchone__doc__}, + {"fetchone", (PyCFunction)pysqlite_cursor_fetchone, METH_NOARGS, pysqlite_cursor_fetchone__doc__}, static PyObject * pysqlite_cursor_fetchone_impl(pysqlite_Cursor *self); @@ -242,7 +242,7 @@ PyDoc_STRVAR(pysqlite_cursor_fetchall__doc__, "Fetches all rows from the resultset."); #define PYSQLITE_CURSOR_FETCHALL_METHODDEF \ - {"fetchall", pysqlite_cursor_fetchall, METH_NOARGS, pysqlite_cursor_fetchall__doc__}, + {"fetchall", (PyCFunction)pysqlite_cursor_fetchall, METH_NOARGS, pysqlite_cursor_fetchall__doc__}, static PyObject * pysqlite_cursor_fetchall_impl(pysqlite_Cursor *self); @@ -260,7 +260,7 @@ PyDoc_STRVAR(pysqlite_cursor_setinputsizes__doc__, "Required by DB-API. Does nothing in sqlite3."); #define PYSQLITE_CURSOR_SETINPUTSIZES_METHODDEF \ - {"setinputsizes", pysqlite_cursor_setinputsizes, METH_O, pysqlite_cursor_setinputsizes__doc__}, + {"setinputsizes", (PyCFunction)pysqlite_cursor_setinputsizes, METH_O, pysqlite_cursor_setinputsizes__doc__}, static PyObject * pysqlite_cursor_setinputsizes_impl(pysqlite_Cursor *self, PyObject *sizes); @@ -317,7 +317,7 @@ PyDoc_STRVAR(pysqlite_cursor_close__doc__, "Closes the cursor."); #define PYSQLITE_CURSOR_CLOSE_METHODDEF \ - {"close", pysqlite_cursor_close, METH_NOARGS, pysqlite_cursor_close__doc__}, + {"close", (PyCFunction)pysqlite_cursor_close, METH_NOARGS, pysqlite_cursor_close__doc__}, static PyObject * pysqlite_cursor_close_impl(pysqlite_Cursor *self); @@ -327,4 +327,4 @@ pysqlite_cursor_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { return pysqlite_cursor_close_impl((pysqlite_Cursor *)self); } -/*[clinic end generated code: output=e611823c9419a283 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=02831aed7377f5f6 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/module.c.h b/Modules/_sqlite/clinic/module.c.h index e7117ba2f88dd1..5569c45451647f 100644 --- a/Modules/_sqlite/clinic/module.c.h +++ b/Modules/_sqlite/clinic/module.c.h @@ -149,7 +149,7 @@ PyDoc_STRVAR(pysqlite_enable_callback_trace__doc__, "Enable or disable callback functions throwing errors to stderr."); #define PYSQLITE_ENABLE_CALLBACK_TRACE_METHODDEF \ - {"enable_callback_tracebacks", pysqlite_enable_callback_trace, METH_O, pysqlite_enable_callback_trace__doc__}, + {"enable_callback_tracebacks", (PyCFunction)pysqlite_enable_callback_trace, METH_O, pysqlite_enable_callback_trace__doc__}, static PyObject * pysqlite_enable_callback_trace_impl(PyObject *module, int enable); @@ -209,4 +209,4 @@ pysqlite_adapt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=e435309143741fb9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=db9bf7ecad197343 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/row.c.h b/Modules/_sqlite/clinic/row.c.h index cf89d4f20448fa..068906744e445f 100644 --- a/Modules/_sqlite/clinic/row.c.h +++ b/Modules/_sqlite/clinic/row.c.h @@ -46,7 +46,7 @@ PyDoc_STRVAR(pysqlite_row_keys__doc__, "Returns the keys of the row."); #define PYSQLITE_ROW_KEYS_METHODDEF \ - {"keys", pysqlite_row_keys, METH_NOARGS, pysqlite_row_keys__doc__}, + {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS, pysqlite_row_keys__doc__}, static PyObject * pysqlite_row_keys_impl(pysqlite_Row *self); @@ -56,4 +56,4 @@ pysqlite_row_keys(PyObject *self, PyObject *Py_UNUSED(ignored)) { return pysqlite_row_keys_impl((pysqlite_Row *)self); } -/*[clinic end generated code: output=06ac9c8ba2f45699 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6c1acbb48f386468 input=a9049054013a1b77]*/ diff --git a/Modules/_sre/clinic/sre.c.h b/Modules/_sre/clinic/sre.c.h index a443b93b9b26f5..1f7e037351d1c6 100644 --- a/Modules/_sre/clinic/sre.c.h +++ b/Modules/_sre/clinic/sre.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(_sre_getcodesize__doc__, "\n"); #define _SRE_GETCODESIZE_METHODDEF \ - {"getcodesize", _sre_getcodesize, METH_NOARGS, _sre_getcodesize__doc__}, + {"getcodesize", (PyCFunction)_sre_getcodesize, METH_NOARGS, _sre_getcodesize__doc__}, static int _sre_getcodesize_impl(PyObject *module); @@ -42,7 +42,7 @@ PyDoc_STRVAR(_sre_ascii_iscased__doc__, "\n"); #define _SRE_ASCII_ISCASED_METHODDEF \ - {"ascii_iscased", _sre_ascii_iscased, METH_O, _sre_ascii_iscased__doc__}, + {"ascii_iscased", (PyCFunction)_sre_ascii_iscased, METH_O, _sre_ascii_iscased__doc__}, static int _sre_ascii_iscased_impl(PyObject *module, int character); @@ -74,7 +74,7 @@ PyDoc_STRVAR(_sre_unicode_iscased__doc__, "\n"); #define _SRE_UNICODE_ISCASED_METHODDEF \ - {"unicode_iscased", _sre_unicode_iscased, METH_O, _sre_unicode_iscased__doc__}, + {"unicode_iscased", (PyCFunction)_sre_unicode_iscased, METH_O, _sre_unicode_iscased__doc__}, static int _sre_unicode_iscased_impl(PyObject *module, int character); @@ -106,7 +106,7 @@ PyDoc_STRVAR(_sre_ascii_tolower__doc__, "\n"); #define _SRE_ASCII_TOLOWER_METHODDEF \ - {"ascii_tolower", _sre_ascii_tolower, METH_O, _sre_ascii_tolower__doc__}, + {"ascii_tolower", (PyCFunction)_sre_ascii_tolower, METH_O, _sre_ascii_tolower__doc__}, static int _sre_ascii_tolower_impl(PyObject *module, int character); @@ -138,7 +138,7 @@ PyDoc_STRVAR(_sre_unicode_tolower__doc__, "\n"); #define _SRE_UNICODE_TOLOWER_METHODDEF \ - {"unicode_tolower", _sre_unicode_tolower, METH_O, _sre_unicode_tolower__doc__}, + {"unicode_tolower", (PyCFunction)_sre_unicode_tolower, METH_O, _sre_unicode_tolower__doc__}, static int _sre_unicode_tolower_impl(PyObject *module, int character); @@ -966,7 +966,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern___copy____doc__, "\n"); #define _SRE_SRE_PATTERN___COPY___METHODDEF \ - {"__copy__", _sre_SRE_Pattern___copy__, METH_NOARGS, _sre_SRE_Pattern___copy____doc__}, + {"__copy__", (PyCFunction)_sre_SRE_Pattern___copy__, METH_NOARGS, _sre_SRE_Pattern___copy____doc__}, static PyObject * _sre_SRE_Pattern___copy___impl(PatternObject *self); @@ -983,7 +983,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern___deepcopy____doc__, "\n"); #define _SRE_SRE_PATTERN___DEEPCOPY___METHODDEF \ - {"__deepcopy__", _sre_SRE_Pattern___deepcopy__, METH_O, _sre_SRE_Pattern___deepcopy____doc__}, + {"__deepcopy__", (PyCFunction)_sre_SRE_Pattern___deepcopy__, METH_O, _sre_SRE_Pattern___deepcopy____doc__}, static PyObject * _sre_SRE_Pattern___deepcopy___impl(PatternObject *self, PyObject *memo); @@ -1465,7 +1465,7 @@ PyDoc_STRVAR(_sre_SRE_Match___copy____doc__, "\n"); #define _SRE_SRE_MATCH___COPY___METHODDEF \ - {"__copy__", _sre_SRE_Match___copy__, METH_NOARGS, _sre_SRE_Match___copy____doc__}, + {"__copy__", (PyCFunction)_sre_SRE_Match___copy__, METH_NOARGS, _sre_SRE_Match___copy____doc__}, static PyObject * _sre_SRE_Match___copy___impl(MatchObject *self); @@ -1482,7 +1482,7 @@ PyDoc_STRVAR(_sre_SRE_Match___deepcopy____doc__, "\n"); #define _SRE_SRE_MATCH___DEEPCOPY___METHODDEF \ - {"__deepcopy__", _sre_SRE_Match___deepcopy__, METH_O, _sre_SRE_Match___deepcopy____doc__}, + {"__deepcopy__", (PyCFunction)_sre_SRE_Match___deepcopy__, METH_O, _sre_SRE_Match___deepcopy____doc__}, static PyObject * _sre_SRE_Match___deepcopy___impl(MatchObject *self, PyObject *memo); @@ -1542,4 +1542,4 @@ _sre_SRE_Scanner_search(PyObject *self, PyTypeObject *cls, PyObject *const *args #ifndef _SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF #define _SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF #endif /* !defined(_SRE_SRE_PATTERN__FAIL_AFTER_METHODDEF) */ -/*[clinic end generated code: output=66dba0de5f21cfef input=a9049054013a1b77]*/ +/*[clinic end generated code: output=45baae8bdfafdc51 input=a9049054013a1b77]*/ diff --git a/Modules/_ssl/clinic/cert.c.h b/Modules/_ssl/clinic/cert.c.h index 86a5fbb19b075b..3e0c5b405092db 100644 --- a/Modules/_ssl/clinic/cert.c.h +++ b/Modules/_ssl/clinic/cert.c.h @@ -77,7 +77,7 @@ PyDoc_STRVAR(_ssl_Certificate_get_info__doc__, "\n"); #define _SSL_CERTIFICATE_GET_INFO_METHODDEF \ - {"get_info", _ssl_Certificate_get_info, METH_NOARGS, _ssl_Certificate_get_info__doc__}, + {"get_info", (PyCFunction)_ssl_Certificate_get_info, METH_NOARGS, _ssl_Certificate_get_info__doc__}, static PyObject * _ssl_Certificate_get_info_impl(PySSLCertificate *self); @@ -87,4 +87,4 @@ _ssl_Certificate_get_info(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _ssl_Certificate_get_info_impl((PySSLCertificate *)self); } -/*[clinic end generated code: output=4a086ea89162137f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=51365b498b975ee0 input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/exceptions.c.h b/Modules/_testcapi/clinic/exceptions.c.h index bf6c432551426f..7c18bac0f686e2 100644 --- a/Modules/_testcapi/clinic/exceptions.c.h +++ b/Modules/_testcapi/clinic/exceptions.c.h @@ -14,7 +14,7 @@ PyDoc_STRVAR(_testcapi_err_set_raised__doc__, "\n"); #define _TESTCAPI_ERR_SET_RAISED_METHODDEF \ - {"err_set_raised", _testcapi_err_set_raised, METH_O, _testcapi_err_set_raised__doc__}, + {"err_set_raised", (PyCFunction)_testcapi_err_set_raised, METH_O, _testcapi_err_set_raised__doc__}, PyDoc_STRVAR(_testcapi_exception_print__doc__, "exception_print($module, exception, legacy=False, /)\n" @@ -316,7 +316,7 @@ PyDoc_STRVAR(_testcapi_raise_memoryerror__doc__, "\n"); #define _TESTCAPI_RAISE_MEMORYERROR_METHODDEF \ - {"raise_memoryerror", _testcapi_raise_memoryerror, METH_NOARGS, _testcapi_raise_memoryerror__doc__}, + {"raise_memoryerror", (PyCFunction)_testcapi_raise_memoryerror, METH_NOARGS, _testcapi_raise_memoryerror__doc__}, static PyObject * _testcapi_raise_memoryerror_impl(PyObject *module); @@ -394,7 +394,7 @@ PyDoc_STRVAR(_testcapi_set_exception__doc__, "\n"); #define _TESTCAPI_SET_EXCEPTION_METHODDEF \ - {"set_exception", _testcapi_set_exception, METH_O, _testcapi_set_exception__doc__}, + {"set_exception", (PyCFunction)_testcapi_set_exception, METH_O, _testcapi_set_exception__doc__}, PyDoc_STRVAR(_testcapi_traceback_print__doc__, "traceback_print($module, traceback, file, /)\n" @@ -457,4 +457,4 @@ _testcapi_unstable_exc_prep_reraise_star(PyObject *module, PyObject *const *args exit: return return_value; } -/*[clinic end generated code: output=c47d4b239c0cb5fc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d917e9ec082e69ee input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/file.c.h b/Modules/_testcapi/clinic/file.c.h index 01b0618e941e5d..6efb6b47353443 100644 --- a/Modules/_testcapi/clinic/file.c.h +++ b/Modules/_testcapi/clinic/file.c.h @@ -10,7 +10,7 @@ PyDoc_STRVAR(_testcapi_pyfile_newstdprinter__doc__, "\n"); #define _TESTCAPI_PYFILE_NEWSTDPRINTER_METHODDEF \ - {"pyfile_newstdprinter", _testcapi_pyfile_newstdprinter, METH_O, _testcapi_pyfile_newstdprinter__doc__}, + {"pyfile_newstdprinter", (PyCFunction)_testcapi_pyfile_newstdprinter, METH_O, _testcapi_pyfile_newstdprinter__doc__}, static PyObject * _testcapi_pyfile_newstdprinter_impl(PyObject *module, int fd); @@ -61,4 +61,4 @@ _testcapi_py_fopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=9a88e7c10f6c58d5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e943bbd7f181d079 input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/long.c.h b/Modules/_testcapi/clinic/long.c.h index 3e43c9959e8c2e..767c671abb8eae 100644 --- a/Modules/_testcapi/clinic/long.c.h +++ b/Modules/_testcapi/clinic/long.c.h @@ -8,5 +8,5 @@ PyDoc_STRVAR(_testcapi_call_long_compact_api__doc__, "\n"); #define _TESTCAPI_CALL_LONG_COMPACT_API_METHODDEF \ - {"call_long_compact_api", _testcapi_call_long_compact_api, METH_O, _testcapi_call_long_compact_api__doc__}, -/*[clinic end generated code: output=45f2a3cf1aa74fbb input=a9049054013a1b77]*/ + {"call_long_compact_api", (PyCFunction)_testcapi_call_long_compact_api, METH_O, _testcapi_call_long_compact_api__doc__}, +/*[clinic end generated code: output=0ddcbc6ea06e5e21 input=a9049054013a1b77]*/ diff --git a/Modules/_testcapi/clinic/vectorcall.c.h b/Modules/_testcapi/clinic/vectorcall.c.h index a110e24c0497cb..c6049a438dc8fc 100644 --- a/Modules/_testcapi/clinic/vectorcall.c.h +++ b/Modules/_testcapi/clinic/vectorcall.c.h @@ -111,7 +111,7 @@ PyDoc_STRVAR(_testcapi_VectorCallClass_set_vectorcall__doc__, "Set self\'s vectorcall function for `type` to one that returns \"vectorcall\""); #define _TESTCAPI_VECTORCALLCLASS_SET_VECTORCALL_METHODDEF \ - {"set_vectorcall", _testcapi_VectorCallClass_set_vectorcall, METH_O, _testcapi_VectorCallClass_set_vectorcall__doc__}, + {"set_vectorcall", (PyCFunction)_testcapi_VectorCallClass_set_vectorcall, METH_O, _testcapi_VectorCallClass_set_vectorcall__doc__}, static PyObject * _testcapi_VectorCallClass_set_vectorcall_impl(PyObject *self, @@ -180,7 +180,7 @@ PyDoc_STRVAR(_testcapi_has_vectorcall_flag__doc__, "Return true iff Py_TPFLAGS_HAVE_VECTORCALL is set on the class."); #define _TESTCAPI_HAS_VECTORCALL_FLAG_METHODDEF \ - {"has_vectorcall_flag", _testcapi_has_vectorcall_flag, METH_O, _testcapi_has_vectorcall_flag__doc__}, + {"has_vectorcall_flag", (PyCFunction)_testcapi_has_vectorcall_flag, METH_O, _testcapi_has_vectorcall_flag__doc__}, static int _testcapi_has_vectorcall_flag_impl(PyObject *module, PyTypeObject *type); @@ -206,4 +206,4 @@ _testcapi_has_vectorcall_flag(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=02ce0c764988bb3e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=210ae67caab177ba input=a9049054013a1b77]*/ diff --git a/Modules/_testlimitedcapi/clinic/file.c.h b/Modules/_testlimitedcapi/clinic/file.c.h index a8dd9db9d876c6..663619eead2a3a 100644 --- a/Modules/_testlimitedcapi/clinic/file.c.h +++ b/Modules/_testlimitedcapi/clinic/file.c.h @@ -77,5 +77,5 @@ PyDoc_STRVAR(_testcapi_pyobject_asfiledescriptor__doc__, "\n"); #define _TESTCAPI_PYOBJECT_ASFILEDESCRIPTOR_METHODDEF \ - {"pyobject_asfiledescriptor", _testcapi_pyobject_asfiledescriptor, METH_O, _testcapi_pyobject_asfiledescriptor__doc__}, -/*[clinic end generated code: output=fb0d76fd0f7d8035 input=a9049054013a1b77]*/ + {"pyobject_asfiledescriptor", (PyCFunction)_testcapi_pyobject_asfiledescriptor, METH_O, _testcapi_pyobject_asfiledescriptor__doc__}, +/*[clinic end generated code: output=ea572aaaa01aec7b input=a9049054013a1b77]*/ diff --git a/Modules/_testlimitedcapi/clinic/long.c.h b/Modules/_testlimitedcapi/clinic/long.c.h index c98e3b1151cef1..ebaeb53921a82f 100644 --- a/Modules/_testlimitedcapi/clinic/long.c.h +++ b/Modules/_testlimitedcapi/clinic/long.c.h @@ -8,7 +8,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_api__doc__, "\n"); #define _TESTLIMITEDCAPI_TEST_LONG_API_METHODDEF \ - {"test_long_api", _testlimitedcapi_test_long_api, METH_NOARGS, _testlimitedcapi_test_long_api__doc__}, + {"test_long_api", (PyCFunction)_testlimitedcapi_test_long_api, METH_NOARGS, _testlimitedcapi_test_long_api__doc__}, static PyObject * _testlimitedcapi_test_long_api_impl(PyObject *module); @@ -25,7 +25,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_longlong_api__doc__, "\n"); #define _TESTLIMITEDCAPI_TEST_LONGLONG_API_METHODDEF \ - {"test_longlong_api", _testlimitedcapi_test_longlong_api, METH_NOARGS, _testlimitedcapi_test_longlong_api__doc__}, + {"test_longlong_api", (PyCFunction)_testlimitedcapi_test_longlong_api, METH_NOARGS, _testlimitedcapi_test_longlong_api__doc__}, static PyObject * _testlimitedcapi_test_longlong_api_impl(PyObject *module); @@ -46,7 +46,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_and_overflow__doc__, "This test will concentrate on proper handling of overflow."); #define _TESTLIMITEDCAPI_TEST_LONG_AND_OVERFLOW_METHODDEF \ - {"test_long_and_overflow", _testlimitedcapi_test_long_and_overflow, METH_NOARGS, _testlimitedcapi_test_long_and_overflow__doc__}, + {"test_long_and_overflow", (PyCFunction)_testlimitedcapi_test_long_and_overflow, METH_NOARGS, _testlimitedcapi_test_long_and_overflow__doc__}, static PyObject * _testlimitedcapi_test_long_and_overflow_impl(PyObject *module); @@ -67,7 +67,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_long_and_overflow__doc__, "This test will concentrate on proper handling of overflow."); #define _TESTLIMITEDCAPI_TEST_LONG_LONG_AND_OVERFLOW_METHODDEF \ - {"test_long_long_and_overflow", _testlimitedcapi_test_long_long_and_overflow, METH_NOARGS, _testlimitedcapi_test_long_long_and_overflow__doc__}, + {"test_long_long_and_overflow", (PyCFunction)_testlimitedcapi_test_long_long_and_overflow, METH_NOARGS, _testlimitedcapi_test_long_long_and_overflow__doc__}, static PyObject * _testlimitedcapi_test_long_long_and_overflow_impl(PyObject *module); @@ -88,7 +88,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_as_size_t__doc__, "It should be extended to test overflow handling."); #define _TESTLIMITEDCAPI_TEST_LONG_AS_SIZE_T_METHODDEF \ - {"test_long_as_size_t", _testlimitedcapi_test_long_as_size_t, METH_NOARGS, _testlimitedcapi_test_long_as_size_t__doc__}, + {"test_long_as_size_t", (PyCFunction)_testlimitedcapi_test_long_as_size_t, METH_NOARGS, _testlimitedcapi_test_long_as_size_t__doc__}, static PyObject * _testlimitedcapi_test_long_as_size_t_impl(PyObject *module); @@ -105,7 +105,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_as_unsigned_long_long_mask__doc__, "\n"); #define _TESTLIMITEDCAPI_TEST_LONG_AS_UNSIGNED_LONG_LONG_MASK_METHODDEF \ - {"test_long_as_unsigned_long_long_mask", _testlimitedcapi_test_long_as_unsigned_long_long_mask, METH_NOARGS, _testlimitedcapi_test_long_as_unsigned_long_long_mask__doc__}, + {"test_long_as_unsigned_long_long_mask", (PyCFunction)_testlimitedcapi_test_long_as_unsigned_long_long_mask, METH_NOARGS, _testlimitedcapi_test_long_as_unsigned_long_long_mask__doc__}, static PyObject * _testlimitedcapi_test_long_as_unsigned_long_long_mask_impl(PyObject *module); @@ -122,7 +122,7 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_as_double__doc__, "\n"); #define _TESTLIMITEDCAPI_TEST_LONG_AS_DOUBLE_METHODDEF \ - {"test_long_as_double", _testlimitedcapi_test_long_as_double, METH_NOARGS, _testlimitedcapi_test_long_as_double__doc__}, + {"test_long_as_double", (PyCFunction)_testlimitedcapi_test_long_as_double, METH_NOARGS, _testlimitedcapi_test_long_as_double__doc__}, static PyObject * _testlimitedcapi_test_long_as_double_impl(PyObject *module); @@ -139,5 +139,5 @@ PyDoc_STRVAR(_testlimitedcapi_PyLong_AsInt__doc__, "\n"); #define _TESTLIMITEDCAPI_PYLONG_ASINT_METHODDEF \ - {"PyLong_AsInt", _testlimitedcapi_PyLong_AsInt, METH_O, _testlimitedcapi_PyLong_AsInt__doc__}, -/*[clinic end generated code: output=b2d9fb30e9c058f5 input=a9049054013a1b77]*/ + {"PyLong_AsInt", (PyCFunction)_testlimitedcapi_PyLong_AsInt, METH_O, _testlimitedcapi_PyLong_AsInt__doc__}, +/*[clinic end generated code: output=bc52b73c599f96c2 input=a9049054013a1b77]*/ diff --git a/Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h b/Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h index 4babbdd592b970..6631a9c42deab0 100644 --- a/Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h +++ b/Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h @@ -8,7 +8,7 @@ PyDoc_STRVAR(_testlimitedcapi_call_vectorcall__doc__, "\n"); #define _TESTLIMITEDCAPI_CALL_VECTORCALL_METHODDEF \ - {"call_vectorcall", _testlimitedcapi_call_vectorcall, METH_O, _testlimitedcapi_call_vectorcall__doc__}, + {"call_vectorcall", (PyCFunction)_testlimitedcapi_call_vectorcall, METH_O, _testlimitedcapi_call_vectorcall__doc__}, PyDoc_STRVAR(_testlimitedcapi_call_vectorcall_method__doc__, "call_vectorcall_method($module, callable, /)\n" @@ -16,5 +16,5 @@ PyDoc_STRVAR(_testlimitedcapi_call_vectorcall_method__doc__, "\n"); #define _TESTLIMITEDCAPI_CALL_VECTORCALL_METHOD_METHODDEF \ - {"call_vectorcall_method", _testlimitedcapi_call_vectorcall_method, METH_O, _testlimitedcapi_call_vectorcall_method__doc__}, -/*[clinic end generated code: output=7d87830093608031 input=a9049054013a1b77]*/ + {"call_vectorcall_method", (PyCFunction)_testlimitedcapi_call_vectorcall_method, METH_O, _testlimitedcapi_call_vectorcall_method__doc__}, +/*[clinic end generated code: output=5976b9b360e1ff30 input=a9049054013a1b77]*/ diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index fe26a110bbdde7..d77bbd48066354 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -262,7 +262,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_getstate__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_GETSTATE_METHODDEF \ - {"getstate", _multibytecodec_MultibyteIncrementalEncoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_getstate__doc__}, + {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_getstate__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEncoderObject *self); @@ -279,7 +279,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_setstate__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_SETSTATE_METHODDEF \ - {"setstate", _multibytecodec_MultibyteIncrementalEncoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalEncoder_setstate__doc__}, + {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalEncoder_setstate__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalEncoder_setstate_impl(MultibyteIncrementalEncoderObject *self, @@ -308,7 +308,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_reset__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF \ - {"reset", _multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__}, + {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self); @@ -399,7 +399,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_getstate__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_GETSTATE_METHODDEF \ - {"getstate", _multibytecodec_MultibyteIncrementalDecoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_getstate__doc__}, + {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_getstate__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDecoderObject *self); @@ -416,7 +416,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_setstate__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_SETSTATE_METHODDEF \ - {"setstate", _multibytecodec_MultibyteIncrementalDecoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalDecoder_setstate__doc__}, + {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalDecoder_setstate__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDecoderObject *self, @@ -445,7 +445,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_reset__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF \ - {"reset", _multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__}, + {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__}, static PyObject * _multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self); @@ -558,7 +558,7 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_reset__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_RESET_METHODDEF \ - {"reset", _multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__}, + {"reset", (PyCFunction)_multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__}, static PyObject * _multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self); @@ -687,5 +687,5 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, "\n"); #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ - {"__create_codec", _multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=9c591aee2ee1a3bf input=a9049054013a1b77]*/ + {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, +/*[clinic end generated code: output=6571941b8e45b013 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_abc.c.h b/Modules/clinic/_abc.c.h index 3f8a3ca34cb690..04681fa2206a2a 100644 --- a/Modules/clinic/_abc.c.h +++ b/Modules/clinic/_abc.c.h @@ -13,7 +13,7 @@ PyDoc_STRVAR(_abc__reset_registry__doc__, "Should be only used by refleak.py"); #define _ABC__RESET_REGISTRY_METHODDEF \ - {"_reset_registry", _abc__reset_registry, METH_O, _abc__reset_registry__doc__}, + {"_reset_registry", (PyCFunction)_abc__reset_registry, METH_O, _abc__reset_registry__doc__}, PyDoc_STRVAR(_abc__reset_caches__doc__, "_reset_caches($module, self, /)\n" @@ -24,7 +24,7 @@ PyDoc_STRVAR(_abc__reset_caches__doc__, "Should be only used by refleak.py"); #define _ABC__RESET_CACHES_METHODDEF \ - {"_reset_caches", _abc__reset_caches, METH_O, _abc__reset_caches__doc__}, + {"_reset_caches", (PyCFunction)_abc__reset_caches, METH_O, _abc__reset_caches__doc__}, PyDoc_STRVAR(_abc__get_dump__doc__, "_get_dump($module, self, /)\n" @@ -37,7 +37,7 @@ PyDoc_STRVAR(_abc__get_dump__doc__, "instead use ABC._dump_registry() for a nice repr."); #define _ABC__GET_DUMP_METHODDEF \ - {"_get_dump", _abc__get_dump, METH_O, _abc__get_dump__doc__}, + {"_get_dump", (PyCFunction)_abc__get_dump, METH_O, _abc__get_dump__doc__}, PyDoc_STRVAR(_abc__abc_init__doc__, "_abc_init($module, self, /)\n" @@ -46,7 +46,7 @@ PyDoc_STRVAR(_abc__abc_init__doc__, "Internal ABC helper for class set-up. Should be never used outside abc module."); #define _ABC__ABC_INIT_METHODDEF \ - {"_abc_init", _abc__abc_init, METH_O, _abc__abc_init__doc__}, + {"_abc_init", (PyCFunction)_abc__abc_init, METH_O, _abc__abc_init__doc__}, PyDoc_STRVAR(_abc__abc_register__doc__, "_abc_register($module, self, subclass, /)\n" @@ -151,7 +151,7 @@ PyDoc_STRVAR(_abc_get_cache_token__doc__, "with every call to register() on any ABC."); #define _ABC_GET_CACHE_TOKEN_METHODDEF \ - {"get_cache_token", _abc_get_cache_token, METH_NOARGS, _abc_get_cache_token__doc__}, + {"get_cache_token", (PyCFunction)_abc_get_cache_token, METH_NOARGS, _abc_get_cache_token__doc__}, static PyObject * _abc_get_cache_token_impl(PyObject *module); @@ -161,4 +161,4 @@ _abc_get_cache_token(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _abc_get_cache_token_impl(module); } -/*[clinic end generated code: output=a180fd3274c1a4f7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1989b6716c950e17 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_asynciomodule.c.h b/Modules/clinic/_asynciomodule.c.h index 0480e06234fbc1..d529b09bd1529f 100644 --- a/Modules/clinic/_asynciomodule.c.h +++ b/Modules/clinic/_asynciomodule.c.h @@ -91,7 +91,7 @@ PyDoc_STRVAR(_asyncio_Future_result__doc__, "the future is done and has an exception set, this exception is raised."); #define _ASYNCIO_FUTURE_RESULT_METHODDEF \ - {"result", _asyncio_Future_result, METH_NOARGS, _asyncio_Future_result__doc__}, + {"result", (PyCFunction)_asyncio_Future_result, METH_NOARGS, _asyncio_Future_result__doc__}, static PyObject * _asyncio_Future_result_impl(FutureObj *self); @@ -436,7 +436,7 @@ PyDoc_STRVAR(_asyncio_Future_cancelled__doc__, "Return True if the future was cancelled."); #define _ASYNCIO_FUTURE_CANCELLED_METHODDEF \ - {"cancelled", _asyncio_Future_cancelled, METH_NOARGS, _asyncio_Future_cancelled__doc__}, + {"cancelled", (PyCFunction)_asyncio_Future_cancelled, METH_NOARGS, _asyncio_Future_cancelled__doc__}, static PyObject * _asyncio_Future_cancelled_impl(FutureObj *self); @@ -463,7 +463,7 @@ PyDoc_STRVAR(_asyncio_Future_done__doc__, "future was cancelled."); #define _ASYNCIO_FUTURE_DONE_METHODDEF \ - {"done", _asyncio_Future_done, METH_NOARGS, _asyncio_Future_done__doc__}, + {"done", (PyCFunction)_asyncio_Future_done, METH_NOARGS, _asyncio_Future_done__doc__}, static PyObject * _asyncio_Future_done_impl(FutureObj *self); @@ -845,7 +845,7 @@ PyDoc_STRVAR(_asyncio_Future__make_cancelled_error__doc__, "it erases the context exception value."); #define _ASYNCIO_FUTURE__MAKE_CANCELLED_ERROR_METHODDEF \ - {"_make_cancelled_error", _asyncio_Future__make_cancelled_error, METH_NOARGS, _asyncio_Future__make_cancelled_error__doc__}, + {"_make_cancelled_error", (PyCFunction)_asyncio_Future__make_cancelled_error, METH_NOARGS, _asyncio_Future__make_cancelled_error__doc__}, static PyObject * _asyncio_Future__make_cancelled_error_impl(FutureObj *self); @@ -1085,7 +1085,7 @@ PyDoc_STRVAR(_asyncio_Task__make_cancelled_error__doc__, "it erases the context exception value."); #define _ASYNCIO_TASK__MAKE_CANCELLED_ERROR_METHODDEF \ - {"_make_cancelled_error", _asyncio_Task__make_cancelled_error, METH_NOARGS, _asyncio_Task__make_cancelled_error__doc__}, + {"_make_cancelled_error", (PyCFunction)_asyncio_Task__make_cancelled_error, METH_NOARGS, _asyncio_Task__make_cancelled_error__doc__}, static PyObject * _asyncio_Task__make_cancelled_error_impl(TaskObj *self); @@ -1194,7 +1194,7 @@ PyDoc_STRVAR(_asyncio_Task_cancelling__doc__, "and may be decremented using .uncancel()."); #define _ASYNCIO_TASK_CANCELLING_METHODDEF \ - {"cancelling", _asyncio_Task_cancelling, METH_NOARGS, _asyncio_Task_cancelling__doc__}, + {"cancelling", (PyCFunction)_asyncio_Task_cancelling, METH_NOARGS, _asyncio_Task_cancelling__doc__}, static PyObject * _asyncio_Task_cancelling_impl(TaskObj *self); @@ -1223,7 +1223,7 @@ PyDoc_STRVAR(_asyncio_Task_uncancel__doc__, "Returns the remaining number of cancellation requests."); #define _ASYNCIO_TASK_UNCANCEL_METHODDEF \ - {"uncancel", _asyncio_Task_uncancel, METH_NOARGS, _asyncio_Task_uncancel__doc__}, + {"uncancel", (PyCFunction)_asyncio_Task_uncancel, METH_NOARGS, _asyncio_Task_uncancel__doc__}, static PyObject * _asyncio_Task_uncancel_impl(TaskObj *self); @@ -1401,7 +1401,7 @@ PyDoc_STRVAR(_asyncio_Task_set_result__doc__, "\n"); #define _ASYNCIO_TASK_SET_RESULT_METHODDEF \ - {"set_result", _asyncio_Task_set_result, METH_O, _asyncio_Task_set_result__doc__}, + {"set_result", (PyCFunction)_asyncio_Task_set_result, METH_O, _asyncio_Task_set_result__doc__}, static PyObject * _asyncio_Task_set_result_impl(TaskObj *self, PyObject *result); @@ -1422,7 +1422,7 @@ PyDoc_STRVAR(_asyncio_Task_set_exception__doc__, "\n"); #define _ASYNCIO_TASK_SET_EXCEPTION_METHODDEF \ - {"set_exception", _asyncio_Task_set_exception, METH_O, _asyncio_Task_set_exception__doc__}, + {"set_exception", (PyCFunction)_asyncio_Task_set_exception, METH_O, _asyncio_Task_set_exception__doc__}, static PyObject * _asyncio_Task_set_exception_impl(TaskObj *self, PyObject *exception); @@ -1443,7 +1443,7 @@ PyDoc_STRVAR(_asyncio_Task_get_coro__doc__, "\n"); #define _ASYNCIO_TASK_GET_CORO_METHODDEF \ - {"get_coro", _asyncio_Task_get_coro, METH_NOARGS, _asyncio_Task_get_coro__doc__}, + {"get_coro", (PyCFunction)_asyncio_Task_get_coro, METH_NOARGS, _asyncio_Task_get_coro__doc__}, static PyObject * _asyncio_Task_get_coro_impl(TaskObj *self); @@ -1466,7 +1466,7 @@ PyDoc_STRVAR(_asyncio_Task_get_context__doc__, "\n"); #define _ASYNCIO_TASK_GET_CONTEXT_METHODDEF \ - {"get_context", _asyncio_Task_get_context, METH_NOARGS, _asyncio_Task_get_context__doc__}, + {"get_context", (PyCFunction)_asyncio_Task_get_context, METH_NOARGS, _asyncio_Task_get_context__doc__}, static PyObject * _asyncio_Task_get_context_impl(TaskObj *self); @@ -1483,7 +1483,7 @@ PyDoc_STRVAR(_asyncio_Task_get_name__doc__, "\n"); #define _ASYNCIO_TASK_GET_NAME_METHODDEF \ - {"get_name", _asyncio_Task_get_name, METH_NOARGS, _asyncio_Task_get_name__doc__}, + {"get_name", (PyCFunction)_asyncio_Task_get_name, METH_NOARGS, _asyncio_Task_get_name__doc__}, static PyObject * _asyncio_Task_get_name_impl(TaskObj *self); @@ -1506,7 +1506,7 @@ PyDoc_STRVAR(_asyncio_Task_set_name__doc__, "\n"); #define _ASYNCIO_TASK_SET_NAME_METHODDEF \ - {"set_name", _asyncio_Task_set_name, METH_O, _asyncio_Task_set_name__doc__}, + {"set_name", (PyCFunction)_asyncio_Task_set_name, METH_O, _asyncio_Task_set_name__doc__}, static PyObject * _asyncio_Task_set_name_impl(TaskObj *self, PyObject *value); @@ -1533,7 +1533,7 @@ PyDoc_STRVAR(_asyncio__get_running_loop__doc__, "This function is thread-specific."); #define _ASYNCIO__GET_RUNNING_LOOP_METHODDEF \ - {"_get_running_loop", _asyncio__get_running_loop, METH_NOARGS, _asyncio__get_running_loop__doc__}, + {"_get_running_loop", (PyCFunction)_asyncio__get_running_loop, METH_NOARGS, _asyncio__get_running_loop__doc__}, static PyObject * _asyncio__get_running_loop_impl(PyObject *module); @@ -1554,7 +1554,7 @@ PyDoc_STRVAR(_asyncio__set_running_loop__doc__, "This function is thread-specific."); #define _ASYNCIO__SET_RUNNING_LOOP_METHODDEF \ - {"_set_running_loop", _asyncio__set_running_loop, METH_O, _asyncio__set_running_loop__doc__}, + {"_set_running_loop", (PyCFunction)_asyncio__set_running_loop, METH_O, _asyncio__set_running_loop__doc__}, PyDoc_STRVAR(_asyncio_get_event_loop__doc__, "get_event_loop($module, /)\n" @@ -1570,7 +1570,7 @@ PyDoc_STRVAR(_asyncio_get_event_loop__doc__, "the result of `get_event_loop_policy().get_event_loop()` call."); #define _ASYNCIO_GET_EVENT_LOOP_METHODDEF \ - {"get_event_loop", _asyncio_get_event_loop, METH_NOARGS, _asyncio_get_event_loop__doc__}, + {"get_event_loop", (PyCFunction)_asyncio_get_event_loop, METH_NOARGS, _asyncio_get_event_loop__doc__}, static PyObject * _asyncio_get_event_loop_impl(PyObject *module); @@ -1590,7 +1590,7 @@ PyDoc_STRVAR(_asyncio_get_running_loop__doc__, "This function is thread-specific."); #define _ASYNCIO_GET_RUNNING_LOOP_METHODDEF \ - {"get_running_loop", _asyncio_get_running_loop, METH_NOARGS, _asyncio_get_running_loop__doc__}, + {"get_running_loop", (PyCFunction)_asyncio_get_running_loop, METH_NOARGS, _asyncio_get_running_loop__doc__}, static PyObject * _asyncio_get_running_loop_impl(PyObject *module); @@ -2200,4 +2200,4 @@ _asyncio_future_discard_from_awaited_by(PyObject *module, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=02be76f30a66fa14 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b1060b180d9dd54c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index 01f1030997aefb..a599bd1a8be96a 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -21,7 +21,7 @@ PyDoc_STRVAR(_bz2_BZ2Compressor_compress__doc__, "flush() method to finish the compression process."); #define _BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF \ - {"compress", _bz2_BZ2Compressor_compress, METH_O, _bz2_BZ2Compressor_compress__doc__}, + {"compress", (PyCFunction)_bz2_BZ2Compressor_compress, METH_O, _bz2_BZ2Compressor_compress__doc__}, static PyObject * _bz2_BZ2Compressor_compress_impl(BZ2Compressor *self, Py_buffer *data); @@ -57,7 +57,7 @@ PyDoc_STRVAR(_bz2_BZ2Compressor_flush__doc__, "The compressor object may not be used after this method is called."); #define _BZ2_BZ2COMPRESSOR_FLUSH_METHODDEF \ - {"flush", _bz2_BZ2Compressor_flush, METH_NOARGS, _bz2_BZ2Compressor_flush__doc__}, + {"flush", (PyCFunction)_bz2_BZ2Compressor_flush, METH_NOARGS, _bz2_BZ2Compressor_flush__doc__}, static PyObject * _bz2_BZ2Compressor_flush_impl(BZ2Compressor *self); @@ -235,4 +235,4 @@ _bz2_BZ2Decompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=95641908220cc58a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0fc5a6292c5fd2c5 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_codecsmodule.c.h b/Modules/clinic/_codecsmodule.c.h index 95f5d7873f829b..46476a948b66d9 100644 --- a/Modules/clinic/_codecsmodule.c.h +++ b/Modules/clinic/_codecsmodule.c.h @@ -19,7 +19,7 @@ PyDoc_STRVAR(_codecs_register__doc__, "(encoder, decoder, stream_reader, stream_writer) (or a CodecInfo object)."); #define _CODECS_REGISTER_METHODDEF \ - {"register", _codecs_register, METH_O, _codecs_register__doc__}, + {"register", (PyCFunction)_codecs_register, METH_O, _codecs_register__doc__}, PyDoc_STRVAR(_codecs_unregister__doc__, "unregister($module, search_function, /)\n" @@ -30,7 +30,7 @@ PyDoc_STRVAR(_codecs_unregister__doc__, "If the search function is not registered, do nothing."); #define _CODECS_UNREGISTER_METHODDEF \ - {"unregister", _codecs_unregister, METH_O, _codecs_unregister__doc__}, + {"unregister", (PyCFunction)_codecs_unregister, METH_O, _codecs_unregister__doc__}, PyDoc_STRVAR(_codecs_lookup__doc__, "lookup($module, encoding, /)\n" @@ -39,7 +39,7 @@ PyDoc_STRVAR(_codecs_lookup__doc__, "Looks up a codec tuple in the Python codec registry and returns a CodecInfo object."); #define _CODECS_LOOKUP_METHODDEF \ - {"lookup", _codecs_lookup, METH_O, _codecs_lookup__doc__}, + {"lookup", (PyCFunction)_codecs_lookup, METH_O, _codecs_lookup__doc__}, static PyObject * _codecs_lookup_impl(PyObject *module, const char *encoding); @@ -2436,7 +2436,7 @@ PyDoc_STRVAR(_codecs_charmap_build__doc__, "\n"); #define _CODECS_CHARMAP_BUILD_METHODDEF \ - {"charmap_build", _codecs_charmap_build, METH_O, _codecs_charmap_build__doc__}, + {"charmap_build", (PyCFunction)_codecs_charmap_build, METH_O, _codecs_charmap_build__doc__}, static PyObject * _codecs_charmap_build_impl(PyObject *module, PyObject *map); @@ -2700,7 +2700,7 @@ PyDoc_STRVAR(_codecs__unregister_error__doc__, "handling exists."); #define _CODECS__UNREGISTER_ERROR_METHODDEF \ - {"_unregister_error", _codecs__unregister_error, METH_O, _codecs__unregister_error__doc__}, + {"_unregister_error", (PyCFunction)_codecs__unregister_error, METH_O, _codecs__unregister_error__doc__}, static int _codecs__unregister_error_impl(PyObject *module, const char *errors); @@ -2745,7 +2745,7 @@ PyDoc_STRVAR(_codecs_lookup_error__doc__, "LookupError, if no handler exists under this name."); #define _CODECS_LOOKUP_ERROR_METHODDEF \ - {"lookup_error", _codecs_lookup_error, METH_O, _codecs_lookup_error__doc__}, + {"lookup_error", (PyCFunction)_codecs_lookup_error, METH_O, _codecs_lookup_error__doc__}, static PyObject * _codecs_lookup_error_impl(PyObject *module, const char *name); @@ -2798,4 +2798,4 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF #define _CODECS_CODE_PAGE_ENCODE_METHODDEF #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ -/*[clinic end generated code: output=6bae21e542af78dc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f8a7fdd0b7edc0c4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_collectionsmodule.c.h b/Modules/clinic/_collectionsmodule.c.h index 5411ca31f5e73e..c7dc639ce87ad8 100644 --- a/Modules/clinic/_collectionsmodule.c.h +++ b/Modules/clinic/_collectionsmodule.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(deque_pop__doc__, "Remove and return the rightmost element."); #define DEQUE_POP_METHODDEF \ - {"pop", deque_pop, METH_NOARGS, deque_pop__doc__}, + {"pop", (PyCFunction)deque_pop, METH_NOARGS, deque_pop__doc__}, static PyObject * deque_pop_impl(dequeobject *deque); @@ -41,7 +41,7 @@ PyDoc_STRVAR(deque_popleft__doc__, "Remove and return the leftmost element."); #define DEQUE_POPLEFT_METHODDEF \ - {"popleft", deque_popleft, METH_NOARGS, deque_popleft__doc__}, + {"popleft", (PyCFunction)deque_popleft, METH_NOARGS, deque_popleft__doc__}, static PyObject * deque_popleft_impl(dequeobject *deque); @@ -65,7 +65,7 @@ PyDoc_STRVAR(deque_append__doc__, "Add an element to the right side of the deque."); #define DEQUE_APPEND_METHODDEF \ - {"append", deque_append, METH_O, deque_append__doc__}, + {"append", (PyCFunction)deque_append, METH_O, deque_append__doc__}, static PyObject * deque_append_impl(dequeobject *deque, PyObject *item); @@ -89,7 +89,7 @@ PyDoc_STRVAR(deque_appendleft__doc__, "Add an element to the left side of the deque."); #define DEQUE_APPENDLEFT_METHODDEF \ - {"appendleft", deque_appendleft, METH_O, deque_appendleft__doc__}, + {"appendleft", (PyCFunction)deque_appendleft, METH_O, deque_appendleft__doc__}, static PyObject * deque_appendleft_impl(dequeobject *deque, PyObject *item); @@ -113,7 +113,7 @@ PyDoc_STRVAR(deque_extend__doc__, "Extend the right side of the deque with elements from the iterable."); #define DEQUE_EXTEND_METHODDEF \ - {"extend", deque_extend, METH_O, deque_extend__doc__}, + {"extend", (PyCFunction)deque_extend, METH_O, deque_extend__doc__}, static PyObject * deque_extend_impl(dequeobject *deque, PyObject *iterable); @@ -137,7 +137,7 @@ PyDoc_STRVAR(deque_extendleft__doc__, "Extend the left side of the deque with elements from the iterable."); #define DEQUE_EXTENDLEFT_METHODDEF \ - {"extendleft", deque_extendleft, METH_O, deque_extendleft__doc__}, + {"extendleft", (PyCFunction)deque_extendleft, METH_O, deque_extendleft__doc__}, static PyObject * deque_extendleft_impl(dequeobject *deque, PyObject *iterable); @@ -161,7 +161,7 @@ PyDoc_STRVAR(deque_copy__doc__, "Return a shallow copy of a deque."); #define DEQUE_COPY_METHODDEF \ - {"copy", deque_copy, METH_NOARGS, deque_copy__doc__}, + {"copy", (PyCFunction)deque_copy, METH_NOARGS, deque_copy__doc__}, static PyObject * deque_copy_impl(dequeobject *deque); @@ -185,7 +185,7 @@ PyDoc_STRVAR(deque___copy____doc__, "Return a shallow copy of a deque."); #define DEQUE___COPY___METHODDEF \ - {"__copy__", deque___copy__, METH_NOARGS, deque___copy____doc__}, + {"__copy__", (PyCFunction)deque___copy__, METH_NOARGS, deque___copy____doc__}, static PyObject * deque___copy___impl(dequeobject *deque); @@ -209,7 +209,7 @@ PyDoc_STRVAR(deque_clearmethod__doc__, "Remove all elements from the deque."); #define DEQUE_CLEARMETHOD_METHODDEF \ - {"clear", deque_clearmethod, METH_NOARGS, deque_clearmethod__doc__}, + {"clear", (PyCFunction)deque_clearmethod, METH_NOARGS, deque_clearmethod__doc__}, static PyObject * deque_clearmethod_impl(dequeobject *deque); @@ -278,7 +278,7 @@ PyDoc_STRVAR(deque_reverse__doc__, "Reverse *IN PLACE*."); #define DEQUE_REVERSE_METHODDEF \ - {"reverse", deque_reverse, METH_NOARGS, deque_reverse__doc__}, + {"reverse", (PyCFunction)deque_reverse, METH_NOARGS, deque_reverse__doc__}, static PyObject * deque_reverse_impl(dequeobject *deque); @@ -302,7 +302,7 @@ PyDoc_STRVAR(deque_count__doc__, "Return number of occurrences of value."); #define DEQUE_COUNT_METHODDEF \ - {"count", deque_count, METH_O, deque_count__doc__}, + {"count", (PyCFunction)deque_count, METH_O, deque_count__doc__}, static PyObject * deque_count_impl(dequeobject *deque, PyObject *v); @@ -417,7 +417,7 @@ PyDoc_STRVAR(deque_remove__doc__, "Remove first occurrence of value."); #define DEQUE_REMOVE_METHODDEF \ - {"remove", deque_remove, METH_O, deque_remove__doc__}, + {"remove", (PyCFunction)deque_remove, METH_O, deque_remove__doc__}, static PyObject * deque_remove_impl(dequeobject *deque, PyObject *value); @@ -441,7 +441,7 @@ PyDoc_STRVAR(deque___reduce____doc__, "Return state information for pickling."); #define DEQUE___REDUCE___METHODDEF \ - {"__reduce__", deque___reduce__, METH_NOARGS, deque___reduce____doc__}, + {"__reduce__", (PyCFunction)deque___reduce__, METH_NOARGS, deque___reduce____doc__}, static PyObject * deque___reduce___impl(dequeobject *deque); @@ -528,7 +528,7 @@ PyDoc_STRVAR(deque___sizeof____doc__, "Return the size of the deque in memory, in bytes."); #define DEQUE___SIZEOF___METHODDEF \ - {"__sizeof__", deque___sizeof__, METH_NOARGS, deque___sizeof____doc__}, + {"__sizeof__", (PyCFunction)deque___sizeof__, METH_NOARGS, deque___sizeof____doc__}, static PyObject * deque___sizeof___impl(dequeobject *deque); @@ -552,7 +552,7 @@ PyDoc_STRVAR(deque___reversed____doc__, "Return a reverse iterator over the deque."); #define DEQUE___REVERSED___METHODDEF \ - {"__reversed__", deque___reversed__, METH_NOARGS, deque___reversed____doc__}, + {"__reversed__", (PyCFunction)deque___reversed__, METH_NOARGS, deque___reversed____doc__}, static PyObject * deque___reversed___impl(dequeobject *deque); @@ -630,4 +630,4 @@ tuplegetter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=850f240cebed2699 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1eb3634d5ef8b407 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_contextvarsmodule.c.h b/Modules/clinic/_contextvarsmodule.c.h index 74fbc90b87bcce..b1885e41c355d2 100644 --- a/Modules/clinic/_contextvarsmodule.c.h +++ b/Modules/clinic/_contextvarsmodule.c.h @@ -8,7 +8,7 @@ PyDoc_STRVAR(_contextvars_copy_context__doc__, "\n"); #define _CONTEXTVARS_COPY_CONTEXT_METHODDEF \ - {"copy_context", _contextvars_copy_context, METH_NOARGS, _contextvars_copy_context__doc__}, + {"copy_context", (PyCFunction)_contextvars_copy_context, METH_NOARGS, _contextvars_copy_context__doc__}, static PyObject * _contextvars_copy_context_impl(PyObject *module); @@ -18,4 +18,4 @@ _contextvars_copy_context(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _contextvars_copy_context_impl(module); } -/*[clinic end generated code: output=3ae2d989e71f46d0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=26e07024451baf52 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_csv.c.h b/Modules/clinic/_csv.c.h index cc6347ebfb0435..b5608c850b6a97 100644 --- a/Modules/clinic/_csv.c.h +++ b/Modules/clinic/_csv.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(_csv_list_dialects__doc__, " names = csv.list_dialects()"); #define _CSV_LIST_DIALECTS_METHODDEF \ - {"list_dialects", _csv_list_dialects, METH_NOARGS, _csv_list_dialects__doc__}, + {"list_dialects", (PyCFunction)_csv_list_dialects, METH_NOARGS, _csv_list_dialects__doc__}, static PyObject * _csv_list_dialects_impl(PyObject *module); @@ -209,4 +209,4 @@ _csv_field_size_limit(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=d90bf490ee38eb9f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9c7314c2434156b3 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_curses_panel.c.h b/Modules/clinic/_curses_panel.c.h index 44f0dff2469378..6f4966825ec4bf 100644 --- a/Modules/clinic/_curses_panel.c.h +++ b/Modules/clinic/_curses_panel.c.h @@ -104,7 +104,7 @@ PyDoc_STRVAR(_curses_panel_panel_above__doc__, "Return the panel above the current panel."); #define _CURSES_PANEL_PANEL_ABOVE_METHODDEF \ - {"above", _curses_panel_panel_above, METH_NOARGS, _curses_panel_panel_above__doc__}, + {"above", (PyCFunction)_curses_panel_panel_above, METH_NOARGS, _curses_panel_panel_above__doc__}, static PyObject * _curses_panel_panel_above_impl(PyCursesPanelObject *self); @@ -122,7 +122,7 @@ PyDoc_STRVAR(_curses_panel_panel_below__doc__, "Return the panel below the current panel."); #define _CURSES_PANEL_PANEL_BELOW_METHODDEF \ - {"below", _curses_panel_panel_below, METH_NOARGS, _curses_panel_panel_below__doc__}, + {"below", (PyCFunction)_curses_panel_panel_below, METH_NOARGS, _curses_panel_panel_below__doc__}, static PyObject * _curses_panel_panel_below_impl(PyCursesPanelObject *self); @@ -140,7 +140,7 @@ PyDoc_STRVAR(_curses_panel_panel_hidden__doc__, "Return True if the panel is hidden (not visible), False otherwise."); #define _CURSES_PANEL_PANEL_HIDDEN_METHODDEF \ - {"hidden", _curses_panel_panel_hidden, METH_NOARGS, _curses_panel_panel_hidden__doc__}, + {"hidden", (PyCFunction)_curses_panel_panel_hidden, METH_NOARGS, _curses_panel_panel_hidden__doc__}, static PyObject * _curses_panel_panel_hidden_impl(PyCursesPanelObject *self); @@ -211,7 +211,7 @@ PyDoc_STRVAR(_curses_panel_panel_window__doc__, "Return the window object associated with the panel."); #define _CURSES_PANEL_PANEL_WINDOW_METHODDEF \ - {"window", _curses_panel_panel_window, METH_NOARGS, _curses_panel_panel_window__doc__}, + {"window", (PyCFunction)_curses_panel_panel_window, METH_NOARGS, _curses_panel_panel_window__doc__}, static PyObject * _curses_panel_panel_window_impl(PyCursesPanelObject *self); @@ -347,7 +347,7 @@ PyDoc_STRVAR(_curses_panel_bottom_panel__doc__, "Return the bottom panel in the panel stack."); #define _CURSES_PANEL_BOTTOM_PANEL_METHODDEF \ - {"bottom_panel", _curses_panel_bottom_panel, METH_NOARGS, _curses_panel_bottom_panel__doc__}, + {"bottom_panel", (PyCFunction)_curses_panel_bottom_panel, METH_NOARGS, _curses_panel_bottom_panel__doc__}, static PyObject * _curses_panel_bottom_panel_impl(PyObject *module); @@ -365,7 +365,7 @@ PyDoc_STRVAR(_curses_panel_new_panel__doc__, "Return a panel object, associating it with the given window win."); #define _CURSES_PANEL_NEW_PANEL_METHODDEF \ - {"new_panel", _curses_panel_new_panel, METH_O, _curses_panel_new_panel__doc__}, + {"new_panel", (PyCFunction)_curses_panel_new_panel, METH_O, _curses_panel_new_panel__doc__}, static PyObject * _curses_panel_new_panel_impl(PyObject *module, PyCursesWindowObject *win); @@ -394,7 +394,7 @@ PyDoc_STRVAR(_curses_panel_top_panel__doc__, "Return the top panel in the panel stack."); #define _CURSES_PANEL_TOP_PANEL_METHODDEF \ - {"top_panel", _curses_panel_top_panel, METH_NOARGS, _curses_panel_top_panel__doc__}, + {"top_panel", (PyCFunction)_curses_panel_top_panel, METH_NOARGS, _curses_panel_top_panel__doc__}, static PyObject * _curses_panel_top_panel_impl(PyObject *module); @@ -414,7 +414,7 @@ PyDoc_STRVAR(_curses_panel_update_panels__doc__, "This does not call curses.doupdate(), so you\'ll have to do this yourself."); #define _CURSES_PANEL_UPDATE_PANELS_METHODDEF \ - {"update_panels", _curses_panel_update_panels, METH_NOARGS, _curses_panel_update_panels__doc__}, + {"update_panels", (PyCFunction)_curses_panel_update_panels, METH_NOARGS, _curses_panel_update_panels__doc__}, static PyObject * _curses_panel_update_panels_impl(PyObject *module); @@ -424,4 +424,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _curses_panel_update_panels_impl(module); } -/*[clinic end generated code: output=7d7290f8008d8d11 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=36853ecb4a979814 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index 37d2528180da84..769d75c09010bd 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -27,7 +27,7 @@ PyDoc_STRVAR(_curses_window_addch__doc__, "current settings for the window object."); #define _CURSES_WINDOW_ADDCH_METHODDEF \ - {"addch", _curses_window_addch, METH_VARARGS, _curses_window_addch__doc__}, + {"addch", (PyCFunction)_curses_window_addch, METH_VARARGS, _curses_window_addch__doc__}, static PyObject * _curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, @@ -99,7 +99,7 @@ PyDoc_STRVAR(_curses_window_addstr__doc__, "current settings for the window object."); #define _CURSES_WINDOW_ADDSTR_METHODDEF \ - {"addstr", _curses_window_addstr, METH_VARARGS, _curses_window_addstr__doc__}, + {"addstr", (PyCFunction)_curses_window_addstr, METH_VARARGS, _curses_window_addstr__doc__}, static PyObject * _curses_window_addstr_impl(PyCursesWindowObject *self, int group_left_1, @@ -173,7 +173,7 @@ PyDoc_STRVAR(_curses_window_addnstr__doc__, "current settings for the window object."); #define _CURSES_WINDOW_ADDNSTR_METHODDEF \ - {"addnstr", _curses_window_addnstr, METH_VARARGS, _curses_window_addnstr__doc__}, + {"addnstr", (PyCFunction)_curses_window_addnstr, METH_VARARGS, _curses_window_addnstr__doc__}, static PyObject * _curses_window_addnstr_impl(PyCursesWindowObject *self, int group_left_1, @@ -276,7 +276,7 @@ PyDoc_STRVAR(_curses_window_attroff__doc__, "Remove attribute attr from the \"background\" set."); #define _CURSES_WINDOW_ATTROFF_METHODDEF \ - {"attroff", _curses_window_attroff, METH_O, _curses_window_attroff__doc__}, + {"attroff", (PyCFunction)_curses_window_attroff, METH_O, _curses_window_attroff__doc__}, static PyObject * _curses_window_attroff_impl(PyCursesWindowObject *self, long attr); @@ -304,7 +304,7 @@ PyDoc_STRVAR(_curses_window_attron__doc__, "Add attribute attr from the \"background\" set."); #define _CURSES_WINDOW_ATTRON_METHODDEF \ - {"attron", _curses_window_attron, METH_O, _curses_window_attron__doc__}, + {"attron", (PyCFunction)_curses_window_attron, METH_O, _curses_window_attron__doc__}, static PyObject * _curses_window_attron_impl(PyCursesWindowObject *self, long attr); @@ -332,7 +332,7 @@ PyDoc_STRVAR(_curses_window_attrset__doc__, "Set the \"background\" set of attributes."); #define _CURSES_WINDOW_ATTRSET_METHODDEF \ - {"attrset", _curses_window_attrset, METH_O, _curses_window_attrset__doc__}, + {"attrset", (PyCFunction)_curses_window_attrset, METH_O, _curses_window_attrset__doc__}, static PyObject * _curses_window_attrset_impl(PyCursesWindowObject *self, long attr); @@ -504,7 +504,7 @@ PyDoc_STRVAR(_curses_window_box__doc__, "horch. The default corner characters are always used by this function."); #define _CURSES_WINDOW_BOX_METHODDEF \ - {"box", _curses_window_box, METH_VARARGS, _curses_window_box__doc__}, + {"box", (PyCFunction)_curses_window_box, METH_VARARGS, _curses_window_box__doc__}, static PyObject * _curses_window_box_impl(PyCursesWindowObject *self, int group_right_1, @@ -547,7 +547,7 @@ PyDoc_STRVAR(_curses_window_delch__doc__, " X-coordinate."); #define _CURSES_WINDOW_DELCH_METHODDEF \ - {"delch", _curses_window_delch, METH_VARARGS, _curses_window_delch__doc__}, + {"delch", (PyCFunction)_curses_window_delch, METH_VARARGS, _curses_window_delch__doc__}, static PyObject * _curses_window_delch_impl(PyCursesWindowObject *self, int group_right_1, @@ -598,7 +598,7 @@ PyDoc_STRVAR(_curses_window_derwin__doc__, "screen."); #define _CURSES_WINDOW_DERWIN_METHODDEF \ - {"derwin", _curses_window_derwin, METH_VARARGS, _curses_window_derwin__doc__}, + {"derwin", (PyCFunction)_curses_window_derwin, METH_VARARGS, _curses_window_derwin__doc__}, static PyObject * _curses_window_derwin_impl(PyCursesWindowObject *self, int group_left_1, @@ -731,7 +731,7 @@ PyDoc_STRVAR(_curses_window_getbkgd__doc__, "Return the window\'s current background character/attribute pair."); #define _CURSES_WINDOW_GETBKGD_METHODDEF \ - {"getbkgd", _curses_window_getbkgd, METH_NOARGS, _curses_window_getbkgd__doc__}, + {"getbkgd", (PyCFunction)_curses_window_getbkgd, METH_NOARGS, _curses_window_getbkgd__doc__}, static long _curses_window_getbkgd_impl(PyCursesWindowObject *self); @@ -766,7 +766,7 @@ PyDoc_STRVAR(_curses_window_getch__doc__, "is returned if there is no input, else getch() waits until a key is pressed."); #define _CURSES_WINDOW_GETCH_METHODDEF \ - {"getch", _curses_window_getch, METH_VARARGS, _curses_window_getch__doc__}, + {"getch", (PyCFunction)_curses_window_getch, METH_VARARGS, _curses_window_getch__doc__}, static int _curses_window_getch_impl(PyCursesWindowObject *self, int group_right_1, @@ -818,7 +818,7 @@ PyDoc_STRVAR(_curses_window_getkey__doc__, "key name. In no-delay mode, an exception is raised if there is no input."); #define _CURSES_WINDOW_GETKEY_METHODDEF \ - {"getkey", _curses_window_getkey, METH_VARARGS, _curses_window_getkey__doc__}, + {"getkey", (PyCFunction)_curses_window_getkey, METH_VARARGS, _curses_window_getkey__doc__}, static PyObject * _curses_window_getkey_impl(PyCursesWindowObject *self, int group_right_1, @@ -866,7 +866,7 @@ PyDoc_STRVAR(_curses_window_get_wch__doc__, "keypad keys, and other special keys."); #define _CURSES_WINDOW_GET_WCH_METHODDEF \ - {"get_wch", _curses_window_get_wch, METH_VARARGS, _curses_window_get_wch__doc__}, + {"get_wch", (PyCFunction)_curses_window_get_wch, METH_VARARGS, _curses_window_get_wch__doc__}, static PyObject * _curses_window_get_wch_impl(PyCursesWindowObject *self, int group_right_1, @@ -917,7 +917,7 @@ PyDoc_STRVAR(_curses_window_hline__doc__, " Attributes for the characters."); #define _CURSES_WINDOW_HLINE_METHODDEF \ - {"hline", _curses_window_hline, METH_VARARGS, _curses_window_hline__doc__}, + {"hline", (PyCFunction)_curses_window_hline, METH_VARARGS, _curses_window_hline__doc__}, static PyObject * _curses_window_hline_impl(PyCursesWindowObject *self, int group_left_1, @@ -988,7 +988,7 @@ PyDoc_STRVAR(_curses_window_insch__doc__, "the rightmost characters on the line being lost."); #define _CURSES_WINDOW_INSCH_METHODDEF \ - {"insch", _curses_window_insch, METH_VARARGS, _curses_window_insch__doc__}, + {"insch", (PyCFunction)_curses_window_insch, METH_VARARGS, _curses_window_insch__doc__}, static PyObject * _curses_window_insch_impl(PyCursesWindowObject *self, int group_left_1, @@ -1053,7 +1053,7 @@ PyDoc_STRVAR(_curses_window_inch__doc__, "The bottom 8 bits are the character proper, and upper bits are the attributes."); #define _CURSES_WINDOW_INCH_METHODDEF \ - {"inch", _curses_window_inch, METH_VARARGS, _curses_window_inch__doc__}, + {"inch", (PyCFunction)_curses_window_inch, METH_VARARGS, _curses_window_inch__doc__}, static unsigned long _curses_window_inch_impl(PyCursesWindowObject *self, int group_right_1, @@ -1111,7 +1111,7 @@ PyDoc_STRVAR(_curses_window_insstr__doc__, "if specified)."); #define _CURSES_WINDOW_INSSTR_METHODDEF \ - {"insstr", _curses_window_insstr, METH_VARARGS, _curses_window_insstr__doc__}, + {"insstr", (PyCFunction)_curses_window_insstr, METH_VARARGS, _curses_window_insstr__doc__}, static PyObject * _curses_window_insstr_impl(PyCursesWindowObject *self, int group_left_1, @@ -1187,7 +1187,7 @@ PyDoc_STRVAR(_curses_window_insnstr__doc__, "specified)."); #define _CURSES_WINDOW_INSNSTR_METHODDEF \ - {"insnstr", _curses_window_insnstr, METH_VARARGS, _curses_window_insnstr__doc__}, + {"insnstr", (PyCFunction)_curses_window_insnstr, METH_VARARGS, _curses_window_insnstr__doc__}, static PyObject * _curses_window_insnstr_impl(PyCursesWindowObject *self, int group_left_1, @@ -1253,7 +1253,7 @@ PyDoc_STRVAR(_curses_window_is_linetouched__doc__, "Raise a curses.error exception if line is not valid for the given window."); #define _CURSES_WINDOW_IS_LINETOUCHED_METHODDEF \ - {"is_linetouched", _curses_window_is_linetouched, METH_O, _curses_window_is_linetouched__doc__}, + {"is_linetouched", (PyCFunction)_curses_window_is_linetouched, METH_O, _curses_window_is_linetouched__doc__}, static PyObject * _curses_window_is_linetouched_impl(PyCursesWindowObject *self, int line); @@ -1285,7 +1285,7 @@ PyDoc_STRVAR(_curses_window_noutrefresh__doc__, "that, call doupdate()."); #define _CURSES_WINDOW_NOUTREFRESH_METHODDEF \ - {"noutrefresh", _curses_window_noutrefresh, METH_VARARGS, _curses_window_noutrefresh__doc__}, + {"noutrefresh", (PyCFunction)_curses_window_noutrefresh, METH_VARARGS, _curses_window_noutrefresh__doc__}, static PyObject * _curses_window_noutrefresh_impl(PyCursesWindowObject *self, @@ -1339,7 +1339,7 @@ PyDoc_STRVAR(_curses_window_noutrefresh__doc__, "that, call doupdate()."); #define _CURSES_WINDOW_NOUTREFRESH_METHODDEF \ - {"noutrefresh", _curses_window_noutrefresh, METH_NOARGS, _curses_window_noutrefresh__doc__}, + {"noutrefresh", (PyCFunction)_curses_window_noutrefresh, METH_NOARGS, _curses_window_noutrefresh__doc__}, static PyObject * _curses_window_noutrefresh_impl(PyCursesWindowObject *self); @@ -1366,7 +1366,7 @@ PyDoc_STRVAR(_curses_window_overlay__doc__, "destination window."); #define _CURSES_WINDOW_OVERLAY_METHODDEF \ - {"overlay", _curses_window_overlay, METH_VARARGS, _curses_window_overlay__doc__}, + {"overlay", (PyCFunction)_curses_window_overlay, METH_VARARGS, _curses_window_overlay__doc__}, static PyObject * _curses_window_overlay_impl(PyCursesWindowObject *self, @@ -1424,7 +1424,7 @@ PyDoc_STRVAR(_curses_window_overwrite__doc__, "window."); #define _CURSES_WINDOW_OVERWRITE_METHODDEF \ - {"overwrite", _curses_window_overwrite, METH_VARARGS, _curses_window_overwrite__doc__}, + {"overwrite", (PyCFunction)_curses_window_overwrite, METH_VARARGS, _curses_window_overwrite__doc__}, static PyObject * _curses_window_overwrite_impl(PyCursesWindowObject *self, @@ -1477,7 +1477,7 @@ PyDoc_STRVAR(_curses_window_putwin__doc__, "This information can be later retrieved using the getwin() function."); #define _CURSES_WINDOW_PUTWIN_METHODDEF \ - {"putwin", _curses_window_putwin, METH_O, _curses_window_putwin__doc__}, + {"putwin", (PyCFunction)_curses_window_putwin, METH_O, _curses_window_putwin__doc__}, static PyObject * _curses_window_putwin_impl(PyCursesWindowObject *self, PyObject *file); @@ -1552,7 +1552,7 @@ PyDoc_STRVAR(_curses_window_refresh__doc__, "sminrow, or smincol are treated as if they were zero."); #define _CURSES_WINDOW_REFRESH_METHODDEF \ - {"refresh", _curses_window_refresh, METH_VARARGS, _curses_window_refresh__doc__}, + {"refresh", (PyCFunction)_curses_window_refresh, METH_VARARGS, _curses_window_refresh__doc__}, static PyObject * _curses_window_refresh_impl(PyCursesWindowObject *self, int group_right_1, @@ -1651,7 +1651,7 @@ PyDoc_STRVAR(_curses_window_subwin__doc__, "lower right corner of the window."); #define _CURSES_WINDOW_SUBWIN_METHODDEF \ - {"subwin", _curses_window_subwin, METH_VARARGS, _curses_window_subwin__doc__}, + {"subwin", (PyCFunction)_curses_window_subwin, METH_VARARGS, _curses_window_subwin__doc__}, static PyObject * _curses_window_subwin_impl(PyCursesWindowObject *self, int group_left_1, @@ -1699,7 +1699,7 @@ PyDoc_STRVAR(_curses_window_scroll__doc__, "Scroll upward if the argument is positive and downward if it is negative."); #define _CURSES_WINDOW_SCROLL_METHODDEF \ - {"scroll", _curses_window_scroll, METH_VARARGS, _curses_window_scroll__doc__}, + {"scroll", (PyCFunction)_curses_window_scroll, METH_VARARGS, _curses_window_scroll__doc__}, static PyObject * _curses_window_scroll_impl(PyCursesWindowObject *self, int group_right_1, @@ -1739,7 +1739,7 @@ PyDoc_STRVAR(_curses_window_touchline__doc__, "as having been changed (changed=True) or unchanged (changed=False)."); #define _CURSES_WINDOW_TOUCHLINE_METHODDEF \ - {"touchline", _curses_window_touchline, METH_VARARGS, _curses_window_touchline__doc__}, + {"touchline", (PyCFunction)_curses_window_touchline, METH_VARARGS, _curses_window_touchline__doc__}, static PyObject * _curses_window_touchline_impl(PyCursesWindowObject *self, int start, @@ -1792,7 +1792,7 @@ PyDoc_STRVAR(_curses_window_vline__doc__, " Attributes for the character."); #define _CURSES_WINDOW_VLINE_METHODDEF \ - {"vline", _curses_window_vline, METH_VARARGS, _curses_window_vline__doc__}, + {"vline", (PyCFunction)_curses_window_vline, METH_VARARGS, _curses_window_vline__doc__}, static PyObject * _curses_window_vline_impl(PyCursesWindowObject *self, int group_left_1, @@ -1854,7 +1854,7 @@ PyDoc_STRVAR(_curses_filter__doc__, "\n"); #define _CURSES_FILTER_METHODDEF \ - {"filter", _curses_filter, METH_NOARGS, _curses_filter__doc__}, + {"filter", (PyCFunction)_curses_filter, METH_NOARGS, _curses_filter__doc__}, static PyObject * _curses_filter_impl(PyObject *module); @@ -1874,7 +1874,7 @@ PyDoc_STRVAR(_curses_baudrate__doc__, "Return the output speed of the terminal in bits per second."); #define _CURSES_BAUDRATE_METHODDEF \ - {"baudrate", _curses_baudrate, METH_NOARGS, _curses_baudrate__doc__}, + {"baudrate", (PyCFunction)_curses_baudrate, METH_NOARGS, _curses_baudrate__doc__}, static PyObject * _curses_baudrate_impl(PyObject *module); @@ -1892,7 +1892,7 @@ PyDoc_STRVAR(_curses_beep__doc__, "Emit a short attention sound."); #define _CURSES_BEEP_METHODDEF \ - {"beep", _curses_beep, METH_NOARGS, _curses_beep__doc__}, + {"beep", (PyCFunction)_curses_beep, METH_NOARGS, _curses_beep__doc__}, static PyObject * _curses_beep_impl(PyObject *module); @@ -1910,7 +1910,7 @@ PyDoc_STRVAR(_curses_can_change_color__doc__, "Return True if the programmer can change the colors displayed by the terminal."); #define _CURSES_CAN_CHANGE_COLOR_METHODDEF \ - {"can_change_color", _curses_can_change_color, METH_NOARGS, _curses_can_change_color__doc__}, + {"can_change_color", (PyCFunction)_curses_can_change_color, METH_NOARGS, _curses_can_change_color__doc__}, static PyObject * _curses_can_change_color_impl(PyObject *module); @@ -1978,7 +1978,7 @@ PyDoc_STRVAR(_curses_color_content__doc__, "which will be between 0 (no component) and 1000 (maximum amount of component)."); #define _CURSES_COLOR_CONTENT_METHODDEF \ - {"color_content", _curses_color_content, METH_O, _curses_color_content__doc__}, + {"color_content", (PyCFunction)_curses_color_content, METH_O, _curses_color_content__doc__}, static PyObject * _curses_color_content_impl(PyObject *module, int color_number); @@ -2011,7 +2011,7 @@ PyDoc_STRVAR(_curses_color_pair__doc__, "other A_* attributes. pair_number() is the counterpart to this function."); #define _CURSES_COLOR_PAIR_METHODDEF \ - {"color_pair", _curses_color_pair, METH_O, _curses_color_pair__doc__}, + {"color_pair", (PyCFunction)_curses_color_pair, METH_O, _curses_color_pair__doc__}, static PyObject * _curses_color_pair_impl(PyObject *module, int pair_number); @@ -2047,7 +2047,7 @@ PyDoc_STRVAR(_curses_curs_set__doc__, "a block cursor."); #define _CURSES_CURS_SET_METHODDEF \ - {"curs_set", _curses_curs_set, METH_O, _curses_curs_set__doc__}, + {"curs_set", (PyCFunction)_curses_curs_set, METH_O, _curses_curs_set__doc__}, static PyObject * _curses_curs_set_impl(PyObject *module, int visibility); @@ -2079,7 +2079,7 @@ PyDoc_STRVAR(_curses_def_prog_mode__doc__, "Subsequent calls to reset_prog_mode() will restore this mode."); #define _CURSES_DEF_PROG_MODE_METHODDEF \ - {"def_prog_mode", _curses_def_prog_mode, METH_NOARGS, _curses_def_prog_mode__doc__}, + {"def_prog_mode", (PyCFunction)_curses_def_prog_mode, METH_NOARGS, _curses_def_prog_mode__doc__}, static PyObject * _curses_def_prog_mode_impl(PyObject *module); @@ -2101,7 +2101,7 @@ PyDoc_STRVAR(_curses_def_shell_mode__doc__, "Subsequent calls to reset_shell_mode() will restore this mode."); #define _CURSES_DEF_SHELL_MODE_METHODDEF \ - {"def_shell_mode", _curses_def_shell_mode, METH_NOARGS, _curses_def_shell_mode__doc__}, + {"def_shell_mode", (PyCFunction)_curses_def_shell_mode, METH_NOARGS, _curses_def_shell_mode__doc__}, static PyObject * _curses_def_shell_mode_impl(PyObject *module); @@ -2122,7 +2122,7 @@ PyDoc_STRVAR(_curses_delay_output__doc__, " Duration in milliseconds."); #define _CURSES_DELAY_OUTPUT_METHODDEF \ - {"delay_output", _curses_delay_output, METH_O, _curses_delay_output__doc__}, + {"delay_output", (PyCFunction)_curses_delay_output, METH_O, _curses_delay_output__doc__}, static PyObject * _curses_delay_output_impl(PyObject *module, int ms); @@ -2150,7 +2150,7 @@ PyDoc_STRVAR(_curses_doupdate__doc__, "Update the physical screen to match the virtual screen."); #define _CURSES_DOUPDATE_METHODDEF \ - {"doupdate", _curses_doupdate, METH_NOARGS, _curses_doupdate__doc__}, + {"doupdate", (PyCFunction)_curses_doupdate, METH_NOARGS, _curses_doupdate__doc__}, static PyObject * _curses_doupdate_impl(PyObject *module); @@ -2208,7 +2208,7 @@ PyDoc_STRVAR(_curses_endwin__doc__, "De-initialize the library, and return terminal to normal status."); #define _CURSES_ENDWIN_METHODDEF \ - {"endwin", _curses_endwin, METH_NOARGS, _curses_endwin__doc__}, + {"endwin", (PyCFunction)_curses_endwin, METH_NOARGS, _curses_endwin__doc__}, static PyObject * _curses_endwin_impl(PyObject *module); @@ -2226,7 +2226,7 @@ PyDoc_STRVAR(_curses_erasechar__doc__, "Return the user\'s current erase character."); #define _CURSES_ERASECHAR_METHODDEF \ - {"erasechar", _curses_erasechar, METH_NOARGS, _curses_erasechar__doc__}, + {"erasechar", (PyCFunction)_curses_erasechar, METH_NOARGS, _curses_erasechar__doc__}, static PyObject * _curses_erasechar_impl(PyObject *module); @@ -2246,7 +2246,7 @@ PyDoc_STRVAR(_curses_flash__doc__, "That is, change it to reverse-video and then change it back in a short interval."); #define _CURSES_FLASH_METHODDEF \ - {"flash", _curses_flash, METH_NOARGS, _curses_flash__doc__}, + {"flash", (PyCFunction)_curses_flash, METH_NOARGS, _curses_flash__doc__}, static PyObject * _curses_flash_impl(PyObject *module); @@ -2267,7 +2267,7 @@ PyDoc_STRVAR(_curses_flushinp__doc__, "yet been processed by the program."); #define _CURSES_FLUSHINP_METHODDEF \ - {"flushinp", _curses_flushinp, METH_NOARGS, _curses_flushinp__doc__}, + {"flushinp", (PyCFunction)_curses_flushinp, METH_NOARGS, _curses_flushinp__doc__}, static PyObject * _curses_flushinp_impl(PyObject *module); @@ -2289,7 +2289,7 @@ PyDoc_STRVAR(_curses_getsyx__doc__, "Return a (y, x) tuple. If leaveok is currently true, return (-1, -1)."); #define _CURSES_GETSYX_METHODDEF \ - {"getsyx", _curses_getsyx, METH_NOARGS, _curses_getsyx__doc__}, + {"getsyx", (PyCFunction)_curses_getsyx, METH_NOARGS, _curses_getsyx__doc__}, static PyObject * _curses_getsyx_impl(PyObject *module); @@ -2314,7 +2314,7 @@ PyDoc_STRVAR(_curses_getmouse__doc__, "returns a 5-tuple (id, x, y, z, bstate)."); #define _CURSES_GETMOUSE_METHODDEF \ - {"getmouse", _curses_getmouse, METH_NOARGS, _curses_getmouse__doc__}, + {"getmouse", (PyCFunction)_curses_getmouse, METH_NOARGS, _curses_getmouse__doc__}, static PyObject * _curses_getmouse_impl(PyObject *module); @@ -2411,7 +2411,7 @@ PyDoc_STRVAR(_curses_getwin__doc__, "returning the new window object."); #define _CURSES_GETWIN_METHODDEF \ - {"getwin", _curses_getwin, METH_O, _curses_getwin__doc__}, + {"getwin", (PyCFunction)_curses_getwin, METH_O, _curses_getwin__doc__}, PyDoc_STRVAR(_curses_halfdelay__doc__, "halfdelay($module, tenths, /)\n" @@ -2425,7 +2425,7 @@ PyDoc_STRVAR(_curses_halfdelay__doc__, "Use nocbreak() to leave half-delay mode."); #define _CURSES_HALFDELAY_METHODDEF \ - {"halfdelay", _curses_halfdelay, METH_O, _curses_halfdelay__doc__}, + {"halfdelay", (PyCFunction)_curses_halfdelay, METH_O, _curses_halfdelay__doc__}, static PyObject * _curses_halfdelay_impl(PyObject *module, unsigned char tenths); @@ -2468,7 +2468,7 @@ PyDoc_STRVAR(_curses_has_colors__doc__, "Return True if the terminal can display colors; otherwise, return False."); #define _CURSES_HAS_COLORS_METHODDEF \ - {"has_colors", _curses_has_colors, METH_NOARGS, _curses_has_colors__doc__}, + {"has_colors", (PyCFunction)_curses_has_colors, METH_NOARGS, _curses_has_colors__doc__}, static PyObject * _curses_has_colors_impl(PyObject *module); @@ -2486,7 +2486,7 @@ PyDoc_STRVAR(_curses_has_ic__doc__, "Return True if the terminal has insert- and delete-character capabilities."); #define _CURSES_HAS_IC_METHODDEF \ - {"has_ic", _curses_has_ic, METH_NOARGS, _curses_has_ic__doc__}, + {"has_ic", (PyCFunction)_curses_has_ic, METH_NOARGS, _curses_has_ic__doc__}, static PyObject * _curses_has_ic_impl(PyObject *module); @@ -2504,7 +2504,7 @@ PyDoc_STRVAR(_curses_has_il__doc__, "Return True if the terminal has insert- and delete-line capabilities."); #define _CURSES_HAS_IL_METHODDEF \ - {"has_il", _curses_has_il, METH_NOARGS, _curses_has_il__doc__}, + {"has_il", (PyCFunction)_curses_has_il, METH_NOARGS, _curses_has_il__doc__}, static PyObject * _curses_has_il_impl(PyObject *module); @@ -2527,7 +2527,7 @@ PyDoc_STRVAR(_curses_has_key__doc__, " Key number."); #define _CURSES_HAS_KEY_METHODDEF \ - {"has_key", _curses_has_key, METH_O, _curses_has_key__doc__}, + {"has_key", (PyCFunction)_curses_has_key, METH_O, _curses_has_key__doc__}, static PyObject * _curses_has_key_impl(PyObject *module, int key); @@ -2663,7 +2663,7 @@ PyDoc_STRVAR(_curses_initscr__doc__, "Return a WindowObject which represents the whole screen."); #define _CURSES_INITSCR_METHODDEF \ - {"initscr", _curses_initscr, METH_NOARGS, _curses_initscr__doc__}, + {"initscr", (PyCFunction)_curses_initscr, METH_NOARGS, _curses_initscr__doc__}, static PyObject * _curses_initscr_impl(PyObject *module); @@ -2782,7 +2782,7 @@ PyDoc_STRVAR(_curses_get_escdelay__doc__, "keyboard from escape sequences sent by cursor and function keys."); #define _CURSES_GET_ESCDELAY_METHODDEF \ - {"get_escdelay", _curses_get_escdelay, METH_NOARGS, _curses_get_escdelay__doc__}, + {"get_escdelay", (PyCFunction)_curses_get_escdelay, METH_NOARGS, _curses_get_escdelay__doc__}, static PyObject * _curses_get_escdelay_impl(PyObject *module); @@ -2811,7 +2811,7 @@ PyDoc_STRVAR(_curses_set_escdelay__doc__, "keyboard from escape sequences sent by cursor and function keys."); #define _CURSES_SET_ESCDELAY_METHODDEF \ - {"set_escdelay", _curses_set_escdelay, METH_O, _curses_set_escdelay__doc__}, + {"set_escdelay", (PyCFunction)_curses_set_escdelay, METH_O, _curses_set_escdelay__doc__}, static PyObject * _curses_set_escdelay_impl(PyObject *module, int ms); @@ -2846,7 +2846,7 @@ PyDoc_STRVAR(_curses_get_tabsize__doc__, "character to spaces as it adds the tab to a window."); #define _CURSES_GET_TABSIZE_METHODDEF \ - {"get_tabsize", _curses_get_tabsize, METH_NOARGS, _curses_get_tabsize__doc__}, + {"get_tabsize", (PyCFunction)_curses_get_tabsize, METH_NOARGS, _curses_get_tabsize__doc__}, static PyObject * _curses_get_tabsize_impl(PyObject *module); @@ -2874,7 +2874,7 @@ PyDoc_STRVAR(_curses_set_tabsize__doc__, "character to spaces as it adds the tab to a window."); #define _CURSES_SET_TABSIZE_METHODDEF \ - {"set_tabsize", _curses_set_tabsize, METH_O, _curses_set_tabsize__doc__}, + {"set_tabsize", (PyCFunction)_curses_set_tabsize, METH_O, _curses_set_tabsize__doc__}, static PyObject * _curses_set_tabsize_impl(PyObject *module, int size); @@ -2903,7 +2903,7 @@ PyDoc_STRVAR(_curses_intrflush__doc__, "\n"); #define _CURSES_INTRFLUSH_METHODDEF \ - {"intrflush", _curses_intrflush, METH_O, _curses_intrflush__doc__}, + {"intrflush", (PyCFunction)_curses_intrflush, METH_O, _curses_intrflush__doc__}, static PyObject * _curses_intrflush_impl(PyObject *module, int flag); @@ -2931,7 +2931,7 @@ PyDoc_STRVAR(_curses_isendwin__doc__, "Return True if endwin() has been called."); #define _CURSES_ISENDWIN_METHODDEF \ - {"isendwin", _curses_isendwin, METH_NOARGS, _curses_isendwin__doc__}, + {"isendwin", (PyCFunction)_curses_isendwin, METH_NOARGS, _curses_isendwin__doc__}, static PyObject * _curses_isendwin_impl(PyObject *module); @@ -2997,7 +2997,7 @@ PyDoc_STRVAR(_curses_keyname__doc__, " Key number."); #define _CURSES_KEYNAME_METHODDEF \ - {"keyname", _curses_keyname, METH_O, _curses_keyname__doc__}, + {"keyname", (PyCFunction)_curses_keyname, METH_O, _curses_keyname__doc__}, static PyObject * _curses_keyname_impl(PyObject *module, int key); @@ -3025,7 +3025,7 @@ PyDoc_STRVAR(_curses_killchar__doc__, "Return the user\'s current line kill character."); #define _CURSES_KILLCHAR_METHODDEF \ - {"killchar", _curses_killchar, METH_NOARGS, _curses_killchar__doc__}, + {"killchar", (PyCFunction)_curses_killchar, METH_NOARGS, _curses_killchar__doc__}, static PyObject * _curses_killchar_impl(PyObject *module); @@ -3046,7 +3046,7 @@ PyDoc_STRVAR(_curses_longname__doc__, "only after the call to initscr()."); #define _CURSES_LONGNAME_METHODDEF \ - {"longname", _curses_longname, METH_NOARGS, _curses_longname__doc__}, + {"longname", (PyCFunction)_curses_longname, METH_NOARGS, _curses_longname__doc__}, static PyObject * _curses_longname_impl(PyObject *module); @@ -3067,7 +3067,7 @@ PyDoc_STRVAR(_curses_meta__doc__, "allow only 7-bit characters."); #define _CURSES_META_METHODDEF \ - {"meta", _curses_meta, METH_O, _curses_meta__doc__}, + {"meta", (PyCFunction)_curses_meta, METH_O, _curses_meta__doc__}, static PyObject * _curses_meta_impl(PyObject *module, int yes); @@ -3104,7 +3104,7 @@ PyDoc_STRVAR(_curses_mouseinterval__doc__, "value."); #define _CURSES_MOUSEINTERVAL_METHODDEF \ - {"mouseinterval", _curses_mouseinterval, METH_O, _curses_mouseinterval__doc__}, + {"mouseinterval", (PyCFunction)_curses_mouseinterval, METH_O, _curses_mouseinterval__doc__}, static PyObject * _curses_mouseinterval_impl(PyObject *module, int interval); @@ -3141,7 +3141,7 @@ PyDoc_STRVAR(_curses_mousemask__doc__, "If this function is never called, no mouse events are ever reported."); #define _CURSES_MOUSEMASK_METHODDEF \ - {"mousemask", _curses_mousemask, METH_O, _curses_mousemask__doc__}, + {"mousemask", (PyCFunction)_curses_mousemask, METH_O, _curses_mousemask__doc__}, static PyObject * _curses_mousemask_impl(PyObject *module, unsigned long newmask); @@ -3175,7 +3175,7 @@ PyDoc_STRVAR(_curses_napms__doc__, " Duration in milliseconds."); #define _CURSES_NAPMS_METHODDEF \ - {"napms", _curses_napms, METH_O, _curses_napms__doc__}, + {"napms", (PyCFunction)_curses_napms, METH_O, _curses_napms__doc__}, static int _curses_napms_impl(PyObject *module, int ms); @@ -3259,7 +3259,7 @@ PyDoc_STRVAR(_curses_newwin__doc__, "right corner of the screen."); #define _CURSES_NEWWIN_METHODDEF \ - {"newwin", _curses_newwin, METH_VARARGS, _curses_newwin__doc__}, + {"newwin", (PyCFunction)_curses_newwin, METH_VARARGS, _curses_newwin__doc__}, static PyObject * _curses_newwin_impl(PyObject *module, int nlines, int ncols, @@ -3347,7 +3347,7 @@ PyDoc_STRVAR(_curses_nocbreak__doc__, "Return to normal \"cooked\" mode with line buffering."); #define _CURSES_NOCBREAK_METHODDEF \ - {"nocbreak", _curses_nocbreak, METH_NOARGS, _curses_nocbreak__doc__}, + {"nocbreak", (PyCFunction)_curses_nocbreak, METH_NOARGS, _curses_nocbreak__doc__}, static PyObject * _curses_nocbreak_impl(PyObject *module); @@ -3367,7 +3367,7 @@ PyDoc_STRVAR(_curses_noecho__doc__, "Echoing of input characters is turned off."); #define _CURSES_NOECHO_METHODDEF \ - {"noecho", _curses_noecho, METH_NOARGS, _curses_noecho__doc__}, + {"noecho", (PyCFunction)_curses_noecho, METH_NOARGS, _curses_noecho__doc__}, static PyObject * _curses_noecho_impl(PyObject *module); @@ -3388,7 +3388,7 @@ PyDoc_STRVAR(_curses_nonl__doc__, "translation of newline into newline/return on output."); #define _CURSES_NONL_METHODDEF \ - {"nonl", _curses_nonl, METH_NOARGS, _curses_nonl__doc__}, + {"nonl", (PyCFunction)_curses_nonl, METH_NOARGS, _curses_nonl__doc__}, static PyObject * _curses_nonl_impl(PyObject *module); @@ -3409,7 +3409,7 @@ PyDoc_STRVAR(_curses_noqiflush__doc__, "associated with the INTR, QUIT and SUSP characters will not be done."); #define _CURSES_NOQIFLUSH_METHODDEF \ - {"noqiflush", _curses_noqiflush, METH_NOARGS, _curses_noqiflush__doc__}, + {"noqiflush", (PyCFunction)_curses_noqiflush, METH_NOARGS, _curses_noqiflush__doc__}, static PyObject * _curses_noqiflush_impl(PyObject *module); @@ -3429,7 +3429,7 @@ PyDoc_STRVAR(_curses_noraw__doc__, "Return to normal \"cooked\" mode with line buffering."); #define _CURSES_NORAW_METHODDEF \ - {"noraw", _curses_noraw, METH_NOARGS, _curses_noraw__doc__}, + {"noraw", (PyCFunction)_curses_noraw, METH_NOARGS, _curses_noraw__doc__}, static PyObject * _curses_noraw_impl(PyObject *module); @@ -3450,7 +3450,7 @@ PyDoc_STRVAR(_curses_pair_content__doc__, " The number of the color pair (0 - (COLOR_PAIRS-1))."); #define _CURSES_PAIR_CONTENT_METHODDEF \ - {"pair_content", _curses_pair_content, METH_O, _curses_pair_content__doc__}, + {"pair_content", (PyCFunction)_curses_pair_content, METH_O, _curses_pair_content__doc__}, static PyObject * _curses_pair_content_impl(PyObject *module, int pair_number); @@ -3479,7 +3479,7 @@ PyDoc_STRVAR(_curses_pair_number__doc__, "color_pair() is the counterpart to this function."); #define _CURSES_PAIR_NUMBER_METHODDEF \ - {"pair_number", _curses_pair_number, METH_O, _curses_pair_number__doc__}, + {"pair_number", (PyCFunction)_curses_pair_number, METH_O, _curses_pair_number__doc__}, static PyObject * _curses_pair_number_impl(PyObject *module, int attr); @@ -3509,7 +3509,7 @@ PyDoc_STRVAR(_curses_putp__doc__, "Note that the output of putp() always goes to standard output."); #define _CURSES_PUTP_METHODDEF \ - {"putp", _curses_putp, METH_O, _curses_putp__doc__}, + {"putp", (PyCFunction)_curses_putp, METH_O, _curses_putp__doc__}, static PyObject * _curses_putp_impl(PyObject *module, const char *string); @@ -3578,7 +3578,7 @@ PyDoc_STRVAR(_curses_update_lines_cols__doc__, "\n"); #define _CURSES_UPDATE_LINES_COLS_METHODDEF \ - {"update_lines_cols", _curses_update_lines_cols, METH_NOARGS, _curses_update_lines_cols__doc__}, + {"update_lines_cols", (PyCFunction)_curses_update_lines_cols, METH_NOARGS, _curses_update_lines_cols__doc__}, static PyObject * _curses_update_lines_cols_impl(PyObject *module); @@ -3640,7 +3640,7 @@ PyDoc_STRVAR(_curses_reset_prog_mode__doc__, "Restore the terminal to \"program\" mode, as previously saved by def_prog_mode()."); #define _CURSES_RESET_PROG_MODE_METHODDEF \ - {"reset_prog_mode", _curses_reset_prog_mode, METH_NOARGS, _curses_reset_prog_mode__doc__}, + {"reset_prog_mode", (PyCFunction)_curses_reset_prog_mode, METH_NOARGS, _curses_reset_prog_mode__doc__}, static PyObject * _curses_reset_prog_mode_impl(PyObject *module); @@ -3658,7 +3658,7 @@ PyDoc_STRVAR(_curses_reset_shell_mode__doc__, "Restore the terminal to \"shell\" mode, as previously saved by def_shell_mode()."); #define _CURSES_RESET_SHELL_MODE_METHODDEF \ - {"reset_shell_mode", _curses_reset_shell_mode, METH_NOARGS, _curses_reset_shell_mode__doc__}, + {"reset_shell_mode", (PyCFunction)_curses_reset_shell_mode, METH_NOARGS, _curses_reset_shell_mode__doc__}, static PyObject * _curses_reset_shell_mode_impl(PyObject *module); @@ -3676,7 +3676,7 @@ PyDoc_STRVAR(_curses_resetty__doc__, "Restore terminal mode."); #define _CURSES_RESETTY_METHODDEF \ - {"resetty", _curses_resetty, METH_NOARGS, _curses_resetty__doc__}, + {"resetty", (PyCFunction)_curses_resetty, METH_NOARGS, _curses_resetty__doc__}, static PyObject * _curses_resetty_impl(PyObject *module); @@ -3853,7 +3853,7 @@ PyDoc_STRVAR(_curses_savetty__doc__, "Save terminal mode."); #define _CURSES_SAVETTY_METHODDEF \ - {"savetty", _curses_savetty, METH_NOARGS, _curses_savetty__doc__}, + {"savetty", (PyCFunction)_curses_savetty, METH_NOARGS, _curses_savetty__doc__}, static PyObject * _curses_savetty_impl(PyObject *module); @@ -3925,7 +3925,7 @@ PyDoc_STRVAR(_curses_start_color__doc__, "terminal was just turned on."); #define _CURSES_START_COLOR_METHODDEF \ - {"start_color", _curses_start_color, METH_NOARGS, _curses_start_color__doc__}, + {"start_color", (PyCFunction)_curses_start_color, METH_NOARGS, _curses_start_color__doc__}, static PyObject * _curses_start_color_impl(PyObject *module); @@ -3943,7 +3943,7 @@ PyDoc_STRVAR(_curses_termattrs__doc__, "Return a logical OR of all video attributes supported by the terminal."); #define _CURSES_TERMATTRS_METHODDEF \ - {"termattrs", _curses_termattrs, METH_NOARGS, _curses_termattrs__doc__}, + {"termattrs", (PyCFunction)_curses_termattrs, METH_NOARGS, _curses_termattrs__doc__}, static PyObject * _curses_termattrs_impl(PyObject *module); @@ -3961,7 +3961,7 @@ PyDoc_STRVAR(_curses_termname__doc__, "Return the value of the environment variable TERM, truncated to 14 characters."); #define _CURSES_TERMNAME_METHODDEF \ - {"termname", _curses_termname, METH_NOARGS, _curses_termname__doc__}, + {"termname", (PyCFunction)_curses_termname, METH_NOARGS, _curses_termname__doc__}, static PyObject * _curses_termname_impl(PyObject *module); @@ -3985,7 +3985,7 @@ PyDoc_STRVAR(_curses_tigetflag__doc__, "it is canceled or absent from the terminal description."); #define _CURSES_TIGETFLAG_METHODDEF \ - {"tigetflag", _curses_tigetflag, METH_O, _curses_tigetflag__doc__}, + {"tigetflag", (PyCFunction)_curses_tigetflag, METH_O, _curses_tigetflag__doc__}, static PyObject * _curses_tigetflag_impl(PyObject *module, const char *capname); @@ -4028,7 +4028,7 @@ PyDoc_STRVAR(_curses_tigetnum__doc__, "it is canceled or absent from the terminal description."); #define _CURSES_TIGETNUM_METHODDEF \ - {"tigetnum", _curses_tigetnum, METH_O, _curses_tigetnum__doc__}, + {"tigetnum", (PyCFunction)_curses_tigetnum, METH_O, _curses_tigetnum__doc__}, static PyObject * _curses_tigetnum_impl(PyObject *module, const char *capname); @@ -4071,7 +4071,7 @@ PyDoc_STRVAR(_curses_tigetstr__doc__, "absent from the terminal description."); #define _CURSES_TIGETSTR_METHODDEF \ - {"tigetstr", _curses_tigetstr, METH_O, _curses_tigetstr__doc__}, + {"tigetstr", (PyCFunction)_curses_tigetstr, METH_O, _curses_tigetstr__doc__}, static PyObject * _curses_tigetstr_impl(PyObject *module, const char *capname); @@ -4157,7 +4157,7 @@ PyDoc_STRVAR(_curses_typeahead__doc__, "If fd is -1, then no typeahead checking is done."); #define _CURSES_TYPEAHEAD_METHODDEF \ - {"typeahead", _curses_typeahead, METH_O, _curses_typeahead__doc__}, + {"typeahead", (PyCFunction)_curses_typeahead, METH_O, _curses_typeahead__doc__}, static PyObject * _curses_typeahead_impl(PyObject *module, int fd); @@ -4190,7 +4190,7 @@ PyDoc_STRVAR(_curses_unctrl__doc__, "for example as ^C. Printing characters are left as they are."); #define _CURSES_UNCTRL_METHODDEF \ - {"unctrl", _curses_unctrl, METH_O, _curses_unctrl__doc__}, + {"unctrl", (PyCFunction)_curses_unctrl, METH_O, _curses_unctrl__doc__}, PyDoc_STRVAR(_curses_ungetch__doc__, "ungetch($module, ch, /)\n" @@ -4199,7 +4199,7 @@ PyDoc_STRVAR(_curses_ungetch__doc__, "Push ch so the next getch() will return it."); #define _CURSES_UNGETCH_METHODDEF \ - {"ungetch", _curses_ungetch, METH_O, _curses_ungetch__doc__}, + {"ungetch", (PyCFunction)_curses_ungetch, METH_O, _curses_ungetch__doc__}, #if defined(HAVE_NCURSESW) @@ -4210,7 +4210,7 @@ PyDoc_STRVAR(_curses_unget_wch__doc__, "Push ch so the next get_wch() will return it."); #define _CURSES_UNGET_WCH_METHODDEF \ - {"unget_wch", _curses_unget_wch, METH_O, _curses_unget_wch__doc__}, + {"unget_wch", (PyCFunction)_curses_unget_wch, METH_O, _curses_unget_wch__doc__}, #endif /* defined(HAVE_NCURSESW) */ @@ -4232,7 +4232,7 @@ PyDoc_STRVAR(_curses_use_env__doc__, "not set)."); #define _CURSES_USE_ENV_METHODDEF \ - {"use_env", _curses_use_env, METH_O, _curses_use_env__doc__}, + {"use_env", (PyCFunction)_curses_use_env, METH_O, _curses_use_env__doc__}, static PyObject * _curses_use_env_impl(PyObject *module, int flag); @@ -4267,7 +4267,7 @@ PyDoc_STRVAR(_curses_use_default_colors__doc__, "is assigned to the color number -1."); #define _CURSES_USE_DEFAULT_COLORS_METHODDEF \ - {"use_default_colors", _curses_use_default_colors, METH_NOARGS, _curses_use_default_colors__doc__}, + {"use_default_colors", (PyCFunction)_curses_use_default_colors, METH_NOARGS, _curses_use_default_colors__doc__}, static PyObject * _curses_use_default_colors_impl(PyObject *module); @@ -4290,7 +4290,7 @@ PyDoc_STRVAR(_curses_has_extended_color_support__doc__, "that support more than 16 colors (e.g. xterm-256color)."); #define _CURSES_HAS_EXTENDED_COLOR_SUPPORT_METHODDEF \ - {"has_extended_color_support", _curses_has_extended_color_support, METH_NOARGS, _curses_has_extended_color_support__doc__}, + {"has_extended_color_support", (PyCFunction)_curses_has_extended_color_support, METH_NOARGS, _curses_has_extended_color_support__doc__}, static PyObject * _curses_has_extended_color_support_impl(PyObject *module); @@ -4392,4 +4392,4 @@ _curses_has_extended_color_support(PyObject *module, PyObject *Py_UNUSED(ignored #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF #define _CURSES_USE_DEFAULT_COLORS_METHODDEF #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */ -/*[clinic end generated code: output=c03ac7b812675584 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ce2d19df9e20bfa3 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_datetimemodule.c.h b/Modules/clinic/_datetimemodule.c.h index a9d720ff53d62d..d200c9cfd1888b 100644 --- a/Modules/clinic/_datetimemodule.c.h +++ b/Modules/clinic/_datetimemodule.c.h @@ -18,7 +18,7 @@ PyDoc_STRVAR(datetime_date_fromtimestamp__doc__, "as local time."); #define DATETIME_DATE_FROMTIMESTAMP_METHODDEF \ - {"fromtimestamp", datetime_date_fromtimestamp, METH_O|METH_CLASS, datetime_date_fromtimestamp__doc__}, + {"fromtimestamp", (PyCFunction)datetime_date_fromtimestamp, METH_O|METH_CLASS, datetime_date_fromtimestamp__doc__}, static PyObject * datetime_date_fromtimestamp_impl(PyTypeObject *type, PyObject *timestamp); @@ -514,4 +514,4 @@ datetime_datetime_replace(PyObject *self, PyObject *const *args, Py_ssize_t narg exit: return return_value; } -/*[clinic end generated code: output=84badd5e306602b6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7b55f2d9a4596b58 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h index 4b13df326b2b9c..5e503194408776 100644 --- a/Modules/clinic/_dbmmodule.c.h +++ b/Modules/clinic/_dbmmodule.c.h @@ -14,7 +14,7 @@ PyDoc_STRVAR(_dbm_dbm_close__doc__, "Close the database."); #define _DBM_DBM_CLOSE_METHODDEF \ - {"close", _dbm_dbm_close, METH_NOARGS, _dbm_dbm_close__doc__}, + {"close", (PyCFunction)_dbm_dbm_close, METH_NOARGS, _dbm_dbm_close__doc__}, static PyObject * _dbm_dbm_close_impl(dbmobject *self); @@ -221,4 +221,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=eafa31670cd71bae input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3b456118f231b160 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 6b8a35aadc24e2..e79f20d86204bb 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -63,7 +63,7 @@ PyDoc_STRVAR(_elementtree_Element_clear__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_CLEAR_METHODDEF \ - {"clear", _elementtree_Element_clear, METH_NOARGS, _elementtree_Element_clear__doc__}, + {"clear", (PyCFunction)_elementtree_Element_clear, METH_NOARGS, _elementtree_Element_clear__doc__}, static PyObject * _elementtree_Element_clear_impl(ElementObject *self); @@ -101,7 +101,7 @@ PyDoc_STRVAR(_elementtree_Element___deepcopy____doc__, "\n"); #define _ELEMENTTREE_ELEMENT___DEEPCOPY___METHODDEF \ - {"__deepcopy__", _elementtree_Element___deepcopy__, METH_O, _elementtree_Element___deepcopy____doc__}, + {"__deepcopy__", (PyCFunction)_elementtree_Element___deepcopy__, METH_O, _elementtree_Element___deepcopy____doc__}, static PyObject * _elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo); @@ -129,7 +129,7 @@ PyDoc_STRVAR(_elementtree_Element___sizeof____doc__, "\n"); #define _ELEMENTTREE_ELEMENT___SIZEOF___METHODDEF \ - {"__sizeof__", _elementtree_Element___sizeof__, METH_NOARGS, _elementtree_Element___sizeof____doc__}, + {"__sizeof__", (PyCFunction)_elementtree_Element___sizeof__, METH_NOARGS, _elementtree_Element___sizeof____doc__}, static size_t _elementtree_Element___sizeof___impl(ElementObject *self); @@ -156,7 +156,7 @@ PyDoc_STRVAR(_elementtree_Element___getstate____doc__, "\n"); #define _ELEMENTTREE_ELEMENT___GETSTATE___METHODDEF \ - {"__getstate__", _elementtree_Element___getstate__, METH_NOARGS, _elementtree_Element___getstate____doc__}, + {"__getstate__", (PyCFunction)_elementtree_Element___getstate__, METH_NOARGS, _elementtree_Element___getstate____doc__}, static PyObject * _elementtree_Element___getstate___impl(ElementObject *self); @@ -711,7 +711,7 @@ PyDoc_STRVAR(_elementtree_Element_items__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_ITEMS_METHODDEF \ - {"items", _elementtree_Element_items, METH_NOARGS, _elementtree_Element_items__doc__}, + {"items", (PyCFunction)_elementtree_Element_items, METH_NOARGS, _elementtree_Element_items__doc__}, static PyObject * _elementtree_Element_items_impl(ElementObject *self); @@ -728,7 +728,7 @@ PyDoc_STRVAR(_elementtree_Element_keys__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_KEYS_METHODDEF \ - {"keys", _elementtree_Element_keys, METH_NOARGS, _elementtree_Element_keys__doc__}, + {"keys", (PyCFunction)_elementtree_Element_keys, METH_NOARGS, _elementtree_Element_keys__doc__}, static PyObject * _elementtree_Element_keys_impl(ElementObject *self); @@ -795,7 +795,7 @@ PyDoc_STRVAR(_elementtree_Element_remove__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_REMOVE_METHODDEF \ - {"remove", _elementtree_Element_remove, METH_O, _elementtree_Element_remove__doc__}, + {"remove", (PyCFunction)_elementtree_Element_remove, METH_O, _elementtree_Element_remove__doc__}, static PyObject * _elementtree_Element_remove_impl(ElementObject *self, PyObject *subelement); @@ -982,7 +982,7 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_data__doc__, "\n"); #define _ELEMENTTREE_TREEBUILDER_DATA_METHODDEF \ - {"data", _elementtree_TreeBuilder_data, METH_O, _elementtree_TreeBuilder_data__doc__}, + {"data", (PyCFunction)_elementtree_TreeBuilder_data, METH_O, _elementtree_TreeBuilder_data__doc__}, static PyObject * _elementtree_TreeBuilder_data_impl(TreeBuilderObject *self, PyObject *data); @@ -1003,7 +1003,7 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_end__doc__, "\n"); #define _ELEMENTTREE_TREEBUILDER_END_METHODDEF \ - {"end", _elementtree_TreeBuilder_end, METH_O, _elementtree_TreeBuilder_end__doc__}, + {"end", (PyCFunction)_elementtree_TreeBuilder_end, METH_O, _elementtree_TreeBuilder_end__doc__}, static PyObject * _elementtree_TreeBuilder_end_impl(TreeBuilderObject *self, PyObject *tag); @@ -1024,7 +1024,7 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_comment__doc__, "\n"); #define _ELEMENTTREE_TREEBUILDER_COMMENT_METHODDEF \ - {"comment", _elementtree_TreeBuilder_comment, METH_O, _elementtree_TreeBuilder_comment__doc__}, + {"comment", (PyCFunction)_elementtree_TreeBuilder_comment, METH_O, _elementtree_TreeBuilder_comment__doc__}, static PyObject * _elementtree_TreeBuilder_comment_impl(TreeBuilderObject *self, @@ -1080,7 +1080,7 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_close__doc__, "\n"); #define _ELEMENTTREE_TREEBUILDER_CLOSE_METHODDEF \ - {"close", _elementtree_TreeBuilder_close, METH_NOARGS, _elementtree_TreeBuilder_close__doc__}, + {"close", (PyCFunction)_elementtree_TreeBuilder_close, METH_NOARGS, _elementtree_TreeBuilder_close__doc__}, static PyObject * _elementtree_TreeBuilder_close_impl(TreeBuilderObject *self); @@ -1210,7 +1210,7 @@ PyDoc_STRVAR(_elementtree_XMLParser_close__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER_CLOSE_METHODDEF \ - {"close", _elementtree_XMLParser_close, METH_NOARGS, _elementtree_XMLParser_close__doc__}, + {"close", (PyCFunction)_elementtree_XMLParser_close, METH_NOARGS, _elementtree_XMLParser_close__doc__}, static PyObject * _elementtree_XMLParser_close_impl(XMLParserObject *self); @@ -1227,7 +1227,7 @@ PyDoc_STRVAR(_elementtree_XMLParser_flush__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER_FLUSH_METHODDEF \ - {"flush", _elementtree_XMLParser_flush, METH_NOARGS, _elementtree_XMLParser_flush__doc__}, + {"flush", (PyCFunction)_elementtree_XMLParser_flush, METH_NOARGS, _elementtree_XMLParser_flush__doc__}, static PyObject * _elementtree_XMLParser_flush_impl(XMLParserObject *self); @@ -1244,7 +1244,7 @@ PyDoc_STRVAR(_elementtree_XMLParser_feed__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER_FEED_METHODDEF \ - {"feed", _elementtree_XMLParser_feed, METH_O, _elementtree_XMLParser_feed__doc__}, + {"feed", (PyCFunction)_elementtree_XMLParser_feed, METH_O, _elementtree_XMLParser_feed__doc__}, static PyObject * _elementtree_XMLParser_feed_impl(XMLParserObject *self, PyObject *data); @@ -1265,7 +1265,7 @@ PyDoc_STRVAR(_elementtree_XMLParser__parse_whole__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER__PARSE_WHOLE_METHODDEF \ - {"_parse_whole", _elementtree_XMLParser__parse_whole, METH_O, _elementtree_XMLParser__parse_whole__doc__}, + {"_parse_whole", (PyCFunction)_elementtree_XMLParser__parse_whole, METH_O, _elementtree_XMLParser__parse_whole__doc__}, static PyObject * _elementtree_XMLParser__parse_whole_impl(XMLParserObject *self, @@ -1315,4 +1315,4 @@ _elementtree_XMLParser__setevents(PyObject *self, PyObject *const *args, Py_ssiz exit: return return_value; } -/*[clinic end generated code: output=b3b1fa09802c069f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0eed58350c3c1832 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_functoolsmodule.c.h b/Modules/clinic/_functoolsmodule.c.h index 6046686a03fe2d..afd5eb4eb12b78 100644 --- a/Modules/clinic/_functoolsmodule.c.h +++ b/Modules/clinic/_functoolsmodule.c.h @@ -148,7 +148,7 @@ PyDoc_STRVAR(_functools__lru_cache_wrapper_cache_info__doc__, "Report cache statistics"); #define _FUNCTOOLS__LRU_CACHE_WRAPPER_CACHE_INFO_METHODDEF \ - {"cache_info", _functools__lru_cache_wrapper_cache_info, METH_NOARGS, _functools__lru_cache_wrapper_cache_info__doc__}, + {"cache_info", (PyCFunction)_functools__lru_cache_wrapper_cache_info, METH_NOARGS, _functools__lru_cache_wrapper_cache_info__doc__}, static PyObject * _functools__lru_cache_wrapper_cache_info_impl(PyObject *self); @@ -172,7 +172,7 @@ PyDoc_STRVAR(_functools__lru_cache_wrapper_cache_clear__doc__, "Clear the cache and cache statistics"); #define _FUNCTOOLS__LRU_CACHE_WRAPPER_CACHE_CLEAR_METHODDEF \ - {"cache_clear", _functools__lru_cache_wrapper_cache_clear, METH_NOARGS, _functools__lru_cache_wrapper_cache_clear__doc__}, + {"cache_clear", (PyCFunction)_functools__lru_cache_wrapper_cache_clear, METH_NOARGS, _functools__lru_cache_wrapper_cache_clear__doc__}, static PyObject * _functools__lru_cache_wrapper_cache_clear_impl(PyObject *self); @@ -188,4 +188,4 @@ _functools__lru_cache_wrapper_cache_clear(PyObject *self, PyObject *Py_UNUSED(ig return return_value; } -/*[clinic end generated code: output=cd7afa547ff66d08 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e6edcc01f0720daf input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index f2d604ab02e327..00950f18e53541 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -83,7 +83,7 @@ PyDoc_STRVAR(_gdbm_gdbm_close__doc__, "Close the database."); #define _GDBM_GDBM_CLOSE_METHODDEF \ - {"close", _gdbm_gdbm_close, METH_NOARGS, _gdbm_gdbm_close__doc__}, + {"close", (PyCFunction)_gdbm_gdbm_close, METH_NOARGS, _gdbm_gdbm_close__doc__}, static PyObject * _gdbm_gdbm_close_impl(gdbmobject *self); @@ -343,4 +343,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=54dc05a2b1a17c4b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d974cb39e4ee5d67 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index 1b32294dd5926e..7bf6af1eeeba24 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(EVP_copy__doc__, "Return a copy of the hash object."); #define EVP_COPY_METHODDEF \ - {"copy", EVP_copy, METH_NOARGS, EVP_copy__doc__}, + {"copy", (PyCFunction)EVP_copy, METH_NOARGS, EVP_copy__doc__}, static PyObject * EVP_copy_impl(EVPobject *self); @@ -34,7 +34,7 @@ PyDoc_STRVAR(EVP_digest__doc__, "Return the digest value as a bytes object."); #define EVP_DIGEST_METHODDEF \ - {"digest", EVP_digest, METH_NOARGS, EVP_digest__doc__}, + {"digest", (PyCFunction)EVP_digest, METH_NOARGS, EVP_digest__doc__}, static PyObject * EVP_digest_impl(EVPobject *self); @@ -52,7 +52,7 @@ PyDoc_STRVAR(EVP_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define EVP_HEXDIGEST_METHODDEF \ - {"hexdigest", EVP_hexdigest, METH_NOARGS, EVP_hexdigest__doc__}, + {"hexdigest", (PyCFunction)EVP_hexdigest, METH_NOARGS, EVP_hexdigest__doc__}, static PyObject * EVP_hexdigest_impl(EVPobject *self); @@ -70,7 +70,7 @@ PyDoc_STRVAR(EVP_update__doc__, "Update this hash object\'s state with the provided string."); #define EVP_UPDATE_METHODDEF \ - {"update", EVP_update, METH_O, EVP_update__doc__}, + {"update", (PyCFunction)EVP_update, METH_O, EVP_update__doc__}, static PyObject * EVP_update_impl(EVPobject *self, PyObject *obj); @@ -1641,7 +1641,7 @@ PyDoc_STRVAR(_hashlib_HMAC_copy__doc__, "Return a copy (\"clone\") of the HMAC object."); #define _HASHLIB_HMAC_COPY_METHODDEF \ - {"copy", _hashlib_HMAC_copy, METH_NOARGS, _hashlib_HMAC_copy__doc__}, + {"copy", (PyCFunction)_hashlib_HMAC_copy, METH_NOARGS, _hashlib_HMAC_copy__doc__}, static PyObject * _hashlib_HMAC_copy_impl(HMACobject *self); @@ -1715,7 +1715,7 @@ PyDoc_STRVAR(_hashlib_HMAC_digest__doc__, "Return the digest of the bytes passed to the update() method so far."); #define _HASHLIB_HMAC_DIGEST_METHODDEF \ - {"digest", _hashlib_HMAC_digest, METH_NOARGS, _hashlib_HMAC_digest__doc__}, + {"digest", (PyCFunction)_hashlib_HMAC_digest, METH_NOARGS, _hashlib_HMAC_digest__doc__}, static PyObject * _hashlib_HMAC_digest_impl(HMACobject *self); @@ -1736,7 +1736,7 @@ PyDoc_STRVAR(_hashlib_HMAC_hexdigest__doc__, "environments."); #define _HASHLIB_HMAC_HEXDIGEST_METHODDEF \ - {"hexdigest", _hashlib_HMAC_hexdigest, METH_NOARGS, _hashlib_HMAC_hexdigest__doc__}, + {"hexdigest", (PyCFunction)_hashlib_HMAC_hexdigest, METH_NOARGS, _hashlib_HMAC_hexdigest__doc__}, static PyObject * _hashlib_HMAC_hexdigest_impl(HMACobject *self); @@ -1761,7 +1761,7 @@ PyDoc_STRVAR(_hashlib_get_fips_mode__doc__, "values other than 1 may have additional significance."); #define _HASHLIB_GET_FIPS_MODE_METHODDEF \ - {"get_fips_mode", _hashlib_get_fips_mode, METH_NOARGS, _hashlib_get_fips_mode__doc__}, + {"get_fips_mode", (PyCFunction)_hashlib_get_fips_mode, METH_NOARGS, _hashlib_get_fips_mode__doc__}, static int _hashlib_get_fips_mode_impl(PyObject *module); @@ -1857,4 +1857,4 @@ _hashlib_compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t narg #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=26fd290225cb8d0a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e9624853a73bb65a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_heapqmodule.c.h b/Modules/clinic/_heapqmodule.c.h index eec5c6c918322b..9046307990773b 100644 --- a/Modules/clinic/_heapqmodule.c.h +++ b/Modules/clinic/_heapqmodule.c.h @@ -45,7 +45,7 @@ PyDoc_STRVAR(_heapq_heappop__doc__, "Pop the smallest item off the heap, maintaining the heap invariant."); #define _HEAPQ_HEAPPOP_METHODDEF \ - {"heappop", _heapq_heappop, METH_O, _heapq_heappop__doc__}, + {"heappop", (PyCFunction)_heapq_heappop, METH_O, _heapq_heappop__doc__}, static PyObject * _heapq_heappop_impl(PyObject *module, PyObject *heap); @@ -153,7 +153,7 @@ PyDoc_STRVAR(_heapq_heapify__doc__, "Transform list into a heap, in-place, in O(len(heap)) time."); #define _HEAPQ_HEAPIFY_METHODDEF \ - {"heapify", _heapq_heapify, METH_O, _heapq_heapify__doc__}, + {"heapify", (PyCFunction)_heapq_heapify, METH_O, _heapq_heapify__doc__}, static PyObject * _heapq_heapify_impl(PyObject *module, PyObject *heap); @@ -182,7 +182,7 @@ PyDoc_STRVAR(_heapq__heappop_max__doc__, "Maxheap variant of heappop."); #define _HEAPQ__HEAPPOP_MAX_METHODDEF \ - {"_heappop_max", _heapq__heappop_max, METH_O, _heapq__heappop_max__doc__}, + {"_heappop_max", (PyCFunction)_heapq__heappop_max, METH_O, _heapq__heappop_max__doc__}, static PyObject * _heapq__heappop_max_impl(PyObject *module, PyObject *heap); @@ -246,7 +246,7 @@ PyDoc_STRVAR(_heapq__heapify_max__doc__, "Maxheap variant of heapify."); #define _HEAPQ__HEAPIFY_MAX_METHODDEF \ - {"_heapify_max", _heapq__heapify_max, METH_O, _heapq__heapify_max__doc__}, + {"_heapify_max", (PyCFunction)_heapq__heapify_max, METH_O, _heapq__heapify_max__doc__}, static PyObject * _heapq__heapify_max_impl(PyObject *module, PyObject *heap); @@ -267,4 +267,4 @@ _heapq__heapify_max(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=06ad2cf6ef705d99 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=05f2afdf3bc54c9d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_localemodule.c.h b/Modules/clinic/_localemodule.c.h index 73ac47aaf0b45c..5e0880b0d0bb4c 100644 --- a/Modules/clinic/_localemodule.c.h +++ b/Modules/clinic/_localemodule.c.h @@ -65,7 +65,7 @@ PyDoc_STRVAR(_locale_localeconv__doc__, "Returns numeric and monetary locale-specific parameters."); #define _LOCALE_LOCALECONV_METHODDEF \ - {"localeconv", _locale_localeconv, METH_NOARGS, _locale_localeconv__doc__}, + {"localeconv", (PyCFunction)_locale_localeconv, METH_NOARGS, _locale_localeconv__doc__}, static PyObject * _locale_localeconv_impl(PyObject *module); @@ -127,7 +127,7 @@ PyDoc_STRVAR(_locale_strxfrm__doc__, "Return a string that can be used as a key for locale-aware comparisons."); #define _LOCALE_STRXFRM_METHODDEF \ - {"strxfrm", _locale_strxfrm, METH_O, _locale_strxfrm__doc__}, + {"strxfrm", (PyCFunction)_locale_strxfrm, METH_O, _locale_strxfrm__doc__}, static PyObject * _locale_strxfrm_impl(PyObject *module, PyObject *str); @@ -159,7 +159,7 @@ PyDoc_STRVAR(_locale__getdefaultlocale__doc__, "\n"); #define _LOCALE__GETDEFAULTLOCALE_METHODDEF \ - {"_getdefaultlocale", _locale__getdefaultlocale, METH_NOARGS, _locale__getdefaultlocale__doc__}, + {"_getdefaultlocale", (PyCFunction)_locale__getdefaultlocale, METH_NOARGS, _locale__getdefaultlocale__doc__}, static PyObject * _locale__getdefaultlocale_impl(PyObject *module); @@ -181,7 +181,7 @@ PyDoc_STRVAR(_locale_nl_langinfo__doc__, "Return the value for the locale information associated with key."); #define _LOCALE_NL_LANGINFO_METHODDEF \ - {"nl_langinfo", _locale_nl_langinfo, METH_O, _locale_nl_langinfo__doc__}, + {"nl_langinfo", (PyCFunction)_locale_nl_langinfo, METH_O, _locale_nl_langinfo__doc__}, static PyObject * _locale_nl_langinfo_impl(PyObject *module, int item); @@ -215,7 +215,7 @@ PyDoc_STRVAR(_locale_gettext__doc__, "Return translation of msg."); #define _LOCALE_GETTEXT_METHODDEF \ - {"gettext", _locale_gettext, METH_O, _locale_gettext__doc__}, + {"gettext", (PyCFunction)_locale_gettext, METH_O, _locale_gettext__doc__}, static PyObject * _locale_gettext_impl(PyObject *module, const char *in); @@ -390,7 +390,7 @@ PyDoc_STRVAR(_locale_textdomain__doc__, "Set the C library\'s textdmain to domain, returning the new domain."); #define _LOCALE_TEXTDOMAIN_METHODDEF \ - {"textdomain", _locale_textdomain, METH_O, _locale_textdomain__doc__}, + {"textdomain", (PyCFunction)_locale_textdomain, METH_O, _locale_textdomain__doc__}, static PyObject * _locale_textdomain_impl(PyObject *module, const char *domain); @@ -545,7 +545,7 @@ PyDoc_STRVAR(_locale_getencoding__doc__, "Get the current locale encoding."); #define _LOCALE_GETENCODING_METHODDEF \ - {"getencoding", _locale_getencoding, METH_NOARGS, _locale_getencoding__doc__}, + {"getencoding", (PyCFunction)_locale_getencoding, METH_NOARGS, _locale_getencoding__doc__}, static PyObject * _locale_getencoding_impl(PyObject *module); @@ -595,4 +595,4 @@ _locale_getencoding(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF #define _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF #endif /* !defined(_LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF) */ -/*[clinic end generated code: output=ec091fccbb896f06 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=034a3c219466d207 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lsprof.c.h b/Modules/clinic/_lsprof.c.h index d817b68c0b8d46..6a75a8f9833d1e 100644 --- a/Modules/clinic/_lsprof.c.h +++ b/Modules/clinic/_lsprof.c.h @@ -277,7 +277,7 @@ PyDoc_STRVAR(_lsprof_Profiler_disable__doc__, "Stop collecting profiling information."); #define _LSPROF_PROFILER_DISABLE_METHODDEF \ - {"disable", _lsprof_Profiler_disable, METH_NOARGS, _lsprof_Profiler_disable__doc__}, + {"disable", (PyCFunction)_lsprof_Profiler_disable, METH_NOARGS, _lsprof_Profiler_disable__doc__}, static PyObject * _lsprof_Profiler_disable_impl(ProfilerObject *self); @@ -295,7 +295,7 @@ PyDoc_STRVAR(_lsprof_Profiler_clear__doc__, "Clear all profiling information collected so far."); #define _LSPROF_PROFILER_CLEAR_METHODDEF \ - {"clear", _lsprof_Profiler_clear, METH_NOARGS, _lsprof_Profiler_clear__doc__}, + {"clear", (PyCFunction)_lsprof_Profiler_clear, METH_NOARGS, _lsprof_Profiler_clear__doc__}, static PyObject * _lsprof_Profiler_clear_impl(ProfilerObject *self); @@ -407,4 +407,4 @@ profiler_init(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=72fb758bc5e5e6f9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d983dbf23fd8ac3b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index 1e779e9b129cd5..c7c81d8d1f1b9d 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -21,7 +21,7 @@ PyDoc_STRVAR(_lzma_LZMACompressor_compress__doc__, "flush() method to finish the compression process."); #define _LZMA_LZMACOMPRESSOR_COMPRESS_METHODDEF \ - {"compress", _lzma_LZMACompressor_compress, METH_O, _lzma_LZMACompressor_compress__doc__}, + {"compress", (PyCFunction)_lzma_LZMACompressor_compress, METH_O, _lzma_LZMACompressor_compress__doc__}, static PyObject * _lzma_LZMACompressor_compress_impl(Compressor *self, Py_buffer *data); @@ -57,7 +57,7 @@ PyDoc_STRVAR(_lzma_LZMACompressor_flush__doc__, "The compressor object may not be used after this method is called."); #define _LZMA_LZMACOMPRESSOR_FLUSH_METHODDEF \ - {"flush", _lzma_LZMACompressor_flush, METH_NOARGS, _lzma_LZMACompressor_flush__doc__}, + {"flush", (PyCFunction)_lzma_LZMACompressor_flush, METH_NOARGS, _lzma_LZMACompressor_flush__doc__}, static PyObject * _lzma_LZMACompressor_flush_impl(Compressor *self); @@ -267,7 +267,7 @@ PyDoc_STRVAR(_lzma_is_check_supported__doc__, "Always returns True for CHECK_NONE and CHECK_CRC32."); #define _LZMA_IS_CHECK_SUPPORTED_METHODDEF \ - {"is_check_supported", _lzma_is_check_supported, METH_O, _lzma_is_check_supported__doc__}, + {"is_check_supported", (PyCFunction)_lzma_is_check_supported, METH_O, _lzma_is_check_supported__doc__}, static PyObject * _lzma_is_check_supported_impl(PyObject *module, int check_id); @@ -329,4 +329,4 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz return return_value; } -/*[clinic end generated code: output=88187d95393f0c22 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=19ed9b1182f5ddf9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_opcode.c.h b/Modules/clinic/_opcode.c.h index f0bc801833e837..e61762e124ad72 100644 --- a/Modules/clinic/_opcode.c.h +++ b/Modules/clinic/_opcode.c.h @@ -611,7 +611,7 @@ PyDoc_STRVAR(_opcode_get_specialization_stats__doc__, "Return the specialization stats"); #define _OPCODE_GET_SPECIALIZATION_STATS_METHODDEF \ - {"get_specialization_stats", _opcode_get_specialization_stats, METH_NOARGS, _opcode_get_specialization_stats__doc__}, + {"get_specialization_stats", (PyCFunction)_opcode_get_specialization_stats, METH_NOARGS, _opcode_get_specialization_stats__doc__}, static PyObject * _opcode_get_specialization_stats_impl(PyObject *module); @@ -631,7 +631,7 @@ PyDoc_STRVAR(_opcode_get_nb_ops__doc__, "Indexed by the BINARY_OP oparg value."); #define _OPCODE_GET_NB_OPS_METHODDEF \ - {"get_nb_ops", _opcode_get_nb_ops, METH_NOARGS, _opcode_get_nb_ops__doc__}, + {"get_nb_ops", (PyCFunction)_opcode_get_nb_ops, METH_NOARGS, _opcode_get_nb_ops__doc__}, static PyObject * _opcode_get_nb_ops_impl(PyObject *module); @@ -649,7 +649,7 @@ PyDoc_STRVAR(_opcode_get_intrinsic1_descs__doc__, "Return a list of names of the unary intrinsics."); #define _OPCODE_GET_INTRINSIC1_DESCS_METHODDEF \ - {"get_intrinsic1_descs", _opcode_get_intrinsic1_descs, METH_NOARGS, _opcode_get_intrinsic1_descs__doc__}, + {"get_intrinsic1_descs", (PyCFunction)_opcode_get_intrinsic1_descs, METH_NOARGS, _opcode_get_intrinsic1_descs__doc__}, static PyObject * _opcode_get_intrinsic1_descs_impl(PyObject *module); @@ -667,7 +667,7 @@ PyDoc_STRVAR(_opcode_get_intrinsic2_descs__doc__, "Return a list of names of the binary intrinsics."); #define _OPCODE_GET_INTRINSIC2_DESCS_METHODDEF \ - {"get_intrinsic2_descs", _opcode_get_intrinsic2_descs, METH_NOARGS, _opcode_get_intrinsic2_descs__doc__}, + {"get_intrinsic2_descs", (PyCFunction)_opcode_get_intrinsic2_descs, METH_NOARGS, _opcode_get_intrinsic2_descs__doc__}, static PyObject * _opcode_get_intrinsic2_descs_impl(PyObject *module); @@ -685,7 +685,7 @@ PyDoc_STRVAR(_opcode_get_special_method_names__doc__, "Return a list of special method names."); #define _OPCODE_GET_SPECIAL_METHOD_NAMES_METHODDEF \ - {"get_special_method_names", _opcode_get_special_method_names, METH_NOARGS, _opcode_get_special_method_names__doc__}, + {"get_special_method_names", (PyCFunction)_opcode_get_special_method_names, METH_NOARGS, _opcode_get_special_method_names__doc__}, static PyObject * _opcode_get_special_method_names_impl(PyObject *module); @@ -756,4 +756,4 @@ _opcode_get_executor(PyObject *module, PyObject *const *args, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=a02840cf31912b4d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2e0c39286d0253e7 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_operator.c.h b/Modules/clinic/_operator.c.h index 9b5f4b03737a9f..48a8ea8c3379ab 100644 --- a/Modules/clinic/_operator.c.h +++ b/Modules/clinic/_operator.c.h @@ -12,7 +12,7 @@ PyDoc_STRVAR(_operator_truth__doc__, "Return True if a is true, False otherwise."); #define _OPERATOR_TRUTH_METHODDEF \ - {"truth", _operator_truth, METH_O, _operator_truth__doc__}, + {"truth", (PyCFunction)_operator_truth, METH_O, _operator_truth__doc__}, static int _operator_truth_impl(PyObject *module, PyObject *a); @@ -250,7 +250,7 @@ PyDoc_STRVAR(_operator_neg__doc__, "Same as -a."); #define _OPERATOR_NEG_METHODDEF \ - {"neg", _operator_neg, METH_O, _operator_neg__doc__}, + {"neg", (PyCFunction)_operator_neg, METH_O, _operator_neg__doc__}, PyDoc_STRVAR(_operator_pos__doc__, "pos($module, a, /)\n" @@ -259,7 +259,7 @@ PyDoc_STRVAR(_operator_pos__doc__, "Same as +a."); #define _OPERATOR_POS_METHODDEF \ - {"pos", _operator_pos, METH_O, _operator_pos__doc__}, + {"pos", (PyCFunction)_operator_pos, METH_O, _operator_pos__doc__}, PyDoc_STRVAR(_operator_abs__doc__, "abs($module, a, /)\n" @@ -268,7 +268,7 @@ PyDoc_STRVAR(_operator_abs__doc__, "Same as abs(a)."); #define _OPERATOR_ABS_METHODDEF \ - {"abs", _operator_abs, METH_O, _operator_abs__doc__}, + {"abs", (PyCFunction)_operator_abs, METH_O, _operator_abs__doc__}, PyDoc_STRVAR(_operator_inv__doc__, "inv($module, a, /)\n" @@ -277,7 +277,7 @@ PyDoc_STRVAR(_operator_inv__doc__, "Same as ~a."); #define _OPERATOR_INV_METHODDEF \ - {"inv", _operator_inv, METH_O, _operator_inv__doc__}, + {"inv", (PyCFunction)_operator_inv, METH_O, _operator_inv__doc__}, PyDoc_STRVAR(_operator_invert__doc__, "invert($module, a, /)\n" @@ -286,7 +286,7 @@ PyDoc_STRVAR(_operator_invert__doc__, "Same as ~a."); #define _OPERATOR_INVERT_METHODDEF \ - {"invert", _operator_invert, METH_O, _operator_invert__doc__}, + {"invert", (PyCFunction)_operator_invert, METH_O, _operator_invert__doc__}, PyDoc_STRVAR(_operator_lshift__doc__, "lshift($module, a, b, /)\n" @@ -355,7 +355,7 @@ PyDoc_STRVAR(_operator_not___doc__, "Same as not a."); #define _OPERATOR_NOT__METHODDEF \ - {"not_", _operator_not_, METH_O, _operator_not___doc__}, + {"not_", (PyCFunction)_operator_not_, METH_O, _operator_not___doc__}, static int _operator_not__impl(PyObject *module, PyObject *a); @@ -1331,7 +1331,7 @@ PyDoc_STRVAR(_operator_index__doc__, "Same as a.__index__()"); #define _OPERATOR_INDEX_METHODDEF \ - {"index", _operator_index, METH_O, _operator_index__doc__}, + {"index", (PyCFunction)_operator_index, METH_O, _operator_index__doc__}, PyDoc_STRVAR(_operator_is___doc__, "is_($module, a, b, /)\n" @@ -1400,7 +1400,7 @@ PyDoc_STRVAR(_operator_is_none__doc__, "Same as a is None."); #define _OPERATOR_IS_NONE_METHODDEF \ - {"is_none", _operator_is_none, METH_O, _operator_is_none__doc__}, + {"is_none", (PyCFunction)_operator_is_none, METH_O, _operator_is_none__doc__}, PyDoc_STRVAR(_operator_is_not_none__doc__, "is_not_none($module, a, /)\n" @@ -1409,7 +1409,7 @@ PyDoc_STRVAR(_operator_is_not_none__doc__, "Same as a is not None."); #define _OPERATOR_IS_NOT_NONE_METHODDEF \ - {"is_not_none", _operator_is_not_none, METH_O, _operator_is_not_none__doc__}, + {"is_not_none", (PyCFunction)_operator_is_not_none, METH_O, _operator_is_not_none__doc__}, PyDoc_STRVAR(_operator_length_hint__doc__, "length_hint($module, obj, default=0, /)\n" @@ -1507,4 +1507,4 @@ _operator__compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t na exit: return return_value; } -/*[clinic end generated code: output=5b58ed7c1fee66b5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=972e2543c4fcf1ba input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index 479dcbd03ac6f6..91d355c5afb353 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -20,7 +20,7 @@ PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__, "re-using picklers."); #define _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF \ - {"clear_memo", _pickle_Pickler_clear_memo, METH_NOARGS, _pickle_Pickler_clear_memo__doc__}, + {"clear_memo", (PyCFunction)_pickle_Pickler_clear_memo, METH_NOARGS, _pickle_Pickler_clear_memo__doc__}, static PyObject * _pickle_Pickler_clear_memo_impl(PicklerObject *self); @@ -83,7 +83,7 @@ PyDoc_STRVAR(_pickle_Pickler___sizeof____doc__, "Returns size in memory, in bytes."); #define _PICKLE_PICKLER___SIZEOF___METHODDEF \ - {"__sizeof__", _pickle_Pickler___sizeof__, METH_NOARGS, _pickle_Pickler___sizeof____doc__}, + {"__sizeof__", (PyCFunction)_pickle_Pickler___sizeof__, METH_NOARGS, _pickle_Pickler___sizeof____doc__}, static size_t _pickle_Pickler___sizeof___impl(PicklerObject *self); @@ -221,7 +221,7 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy_clear__doc__, "Remove all items from memo."); #define _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF \ - {"clear", _pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__}, + {"clear", (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__}, static PyObject * _pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self); @@ -239,7 +239,7 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__, "Copy the memo to a new object."); #define _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF \ - {"copy", _pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__}, + {"copy", (PyCFunction)_pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__}, static PyObject * _pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self); @@ -257,7 +257,7 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__, "Implement pickle support."); #define _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF \ - {"__reduce__", _pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__}, + {"__reduce__", (PyCFunction)_pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__}, static PyObject * _pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self); @@ -400,7 +400,7 @@ PyDoc_STRVAR(_pickle_Unpickler___sizeof____doc__, "Returns size in memory, in bytes."); #define _PICKLE_UNPICKLER___SIZEOF___METHODDEF \ - {"__sizeof__", _pickle_Unpickler___sizeof__, METH_NOARGS, _pickle_Unpickler___sizeof____doc__}, + {"__sizeof__", (PyCFunction)_pickle_Unpickler___sizeof__, METH_NOARGS, _pickle_Unpickler___sizeof____doc__}, static size_t _pickle_Unpickler___sizeof___impl(UnpicklerObject *self); @@ -560,7 +560,7 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_clear__doc__, "Remove all items from memo."); #define _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF \ - {"clear", _pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__}, + {"clear", (PyCFunction)_pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__}, static PyObject * _pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self); @@ -578,7 +578,7 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__, "Copy the memo to a new object."); #define _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF \ - {"copy", _pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__}, + {"copy", (PyCFunction)_pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__}, static PyObject * _pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self); @@ -596,7 +596,7 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__, "Implement pickling support."); #define _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF \ - {"__reduce__", _pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__}, + {"__reduce__", (PyCFunction)_pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__}, static PyObject * _pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self); @@ -1086,4 +1086,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=602519519b7ae911 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d71dc73af298ebe8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_queuemodule.c.h b/Modules/clinic/_queuemodule.c.h index 4b9f498212b96a..2dfc3e6be1984e 100644 --- a/Modules/clinic/_queuemodule.c.h +++ b/Modules/clinic/_queuemodule.c.h @@ -300,7 +300,7 @@ PyDoc_STRVAR(_queue_SimpleQueue_empty__doc__, "Return True if the queue is empty, False otherwise (not reliable!)."); #define _QUEUE_SIMPLEQUEUE_EMPTY_METHODDEF \ - {"empty", _queue_SimpleQueue_empty, METH_NOARGS, _queue_SimpleQueue_empty__doc__}, + {"empty", (PyCFunction)_queue_SimpleQueue_empty, METH_NOARGS, _queue_SimpleQueue_empty__doc__}, static int _queue_SimpleQueue_empty_impl(simplequeueobject *self); @@ -330,7 +330,7 @@ PyDoc_STRVAR(_queue_SimpleQueue_qsize__doc__, "Return the approximate size of the queue (not reliable!)."); #define _QUEUE_SIMPLEQUEUE_QSIZE_METHODDEF \ - {"qsize", _queue_SimpleQueue_qsize, METH_NOARGS, _queue_SimpleQueue_qsize__doc__}, + {"qsize", (PyCFunction)_queue_SimpleQueue_qsize, METH_NOARGS, _queue_SimpleQueue_qsize__doc__}, static Py_ssize_t _queue_SimpleQueue_qsize_impl(simplequeueobject *self); @@ -352,4 +352,4 @@ _queue_SimpleQueue_qsize(PyObject *self, PyObject *Py_UNUSED(ignored)) exit: return return_value; } -/*[clinic end generated code: output=8fff3ab8db9c6127 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e04e15a1b959c700 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_randommodule.c.h b/Modules/clinic/_randommodule.c.h index 67b927d4546540..1e989e970c9de5 100644 --- a/Modules/clinic/_randommodule.c.h +++ b/Modules/clinic/_randommodule.c.h @@ -12,7 +12,7 @@ PyDoc_STRVAR(_random_Random_random__doc__, "random() -> x in the interval [0, 1)."); #define _RANDOM_RANDOM_RANDOM_METHODDEF \ - {"random", _random_Random_random, METH_NOARGS, _random_Random_random__doc__}, + {"random", (PyCFunction)_random_Random_random, METH_NOARGS, _random_Random_random__doc__}, static PyObject * _random_Random_random_impl(RandomObject *self); @@ -73,7 +73,7 @@ PyDoc_STRVAR(_random_Random_getstate__doc__, "getstate() -> tuple containing the current state."); #define _RANDOM_RANDOM_GETSTATE_METHODDEF \ - {"getstate", _random_Random_getstate, METH_NOARGS, _random_Random_getstate__doc__}, + {"getstate", (PyCFunction)_random_Random_getstate, METH_NOARGS, _random_Random_getstate__doc__}, static PyObject * _random_Random_getstate_impl(RandomObject *self); @@ -97,7 +97,7 @@ PyDoc_STRVAR(_random_Random_setstate__doc__, "setstate(state) -> None. Restores generator state."); #define _RANDOM_RANDOM_SETSTATE_METHODDEF \ - {"setstate", _random_Random_setstate, METH_O, _random_Random_setstate__doc__}, + {"setstate", (PyCFunction)_random_Random_setstate, METH_O, _random_Random_setstate__doc__}, static PyObject * _random_Random_setstate_impl(RandomObject *self, PyObject *state); @@ -121,7 +121,7 @@ PyDoc_STRVAR(_random_Random_getrandbits__doc__, "getrandbits(k) -> x. Generates an int with k random bits."); #define _RANDOM_RANDOM_GETRANDBITS_METHODDEF \ - {"getrandbits", _random_Random_getrandbits, METH_O, _random_Random_getrandbits__doc__}, + {"getrandbits", (PyCFunction)_random_Random_getrandbits, METH_O, _random_Random_getrandbits__doc__}, static PyObject * _random_Random_getrandbits_impl(RandomObject *self, int k); @@ -143,4 +143,4 @@ _random_Random_getrandbits(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=46631c9da5aacd1d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4458b5a69201ebea input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index f28329126c5048..9656f09c471931 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_do_handshake__doc__, "\n"); #define _SSL__SSLSOCKET_DO_HANDSHAKE_METHODDEF \ - {"do_handshake", _ssl__SSLSocket_do_handshake, METH_NOARGS, _ssl__SSLSocket_do_handshake__doc__}, + {"do_handshake", (PyCFunction)_ssl__SSLSocket_do_handshake, METH_NOARGS, _ssl__SSLSocket_do_handshake__doc__}, static PyObject * _ssl__SSLSocket_do_handshake_impl(PySSLSocket *self); @@ -38,7 +38,7 @@ PyDoc_STRVAR(_ssl__test_decode_cert__doc__, "\n"); #define _SSL__TEST_DECODE_CERT_METHODDEF \ - {"_test_decode_cert", _ssl__test_decode_cert, METH_O, _ssl__test_decode_cert__doc__}, + {"_test_decode_cert", (PyCFunction)_ssl__test_decode_cert, METH_O, _ssl__test_decode_cert__doc__}, static PyObject * _ssl__test_decode_cert_impl(PyObject *module, PyObject *path); @@ -109,7 +109,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_get_verified_chain__doc__, "\n"); #define _SSL__SSLSOCKET_GET_VERIFIED_CHAIN_METHODDEF \ - {"get_verified_chain", _ssl__SSLSocket_get_verified_chain, METH_NOARGS, _ssl__SSLSocket_get_verified_chain__doc__}, + {"get_verified_chain", (PyCFunction)_ssl__SSLSocket_get_verified_chain, METH_NOARGS, _ssl__SSLSocket_get_verified_chain__doc__}, static PyObject * _ssl__SSLSocket_get_verified_chain_impl(PySSLSocket *self); @@ -132,7 +132,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_get_unverified_chain__doc__, "\n"); #define _SSL__SSLSOCKET_GET_UNVERIFIED_CHAIN_METHODDEF \ - {"get_unverified_chain", _ssl__SSLSocket_get_unverified_chain, METH_NOARGS, _ssl__SSLSocket_get_unverified_chain__doc__}, + {"get_unverified_chain", (PyCFunction)_ssl__SSLSocket_get_unverified_chain, METH_NOARGS, _ssl__SSLSocket_get_unverified_chain__doc__}, static PyObject * _ssl__SSLSocket_get_unverified_chain_impl(PySSLSocket *self); @@ -155,7 +155,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_shared_ciphers__doc__, "\n"); #define _SSL__SSLSOCKET_SHARED_CIPHERS_METHODDEF \ - {"shared_ciphers", _ssl__SSLSocket_shared_ciphers, METH_NOARGS, _ssl__SSLSocket_shared_ciphers__doc__}, + {"shared_ciphers", (PyCFunction)_ssl__SSLSocket_shared_ciphers, METH_NOARGS, _ssl__SSLSocket_shared_ciphers__doc__}, static PyObject * _ssl__SSLSocket_shared_ciphers_impl(PySSLSocket *self); @@ -178,7 +178,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_cipher__doc__, "\n"); #define _SSL__SSLSOCKET_CIPHER_METHODDEF \ - {"cipher", _ssl__SSLSocket_cipher, METH_NOARGS, _ssl__SSLSocket_cipher__doc__}, + {"cipher", (PyCFunction)_ssl__SSLSocket_cipher, METH_NOARGS, _ssl__SSLSocket_cipher__doc__}, static PyObject * _ssl__SSLSocket_cipher_impl(PySSLSocket *self); @@ -201,7 +201,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_version__doc__, "\n"); #define _SSL__SSLSOCKET_VERSION_METHODDEF \ - {"version", _ssl__SSLSocket_version, METH_NOARGS, _ssl__SSLSocket_version__doc__}, + {"version", (PyCFunction)_ssl__SSLSocket_version, METH_NOARGS, _ssl__SSLSocket_version__doc__}, static PyObject * _ssl__SSLSocket_version_impl(PySSLSocket *self); @@ -224,7 +224,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_selected_alpn_protocol__doc__, "\n"); #define _SSL__SSLSOCKET_SELECTED_ALPN_PROTOCOL_METHODDEF \ - {"selected_alpn_protocol", _ssl__SSLSocket_selected_alpn_protocol, METH_NOARGS, _ssl__SSLSocket_selected_alpn_protocol__doc__}, + {"selected_alpn_protocol", (PyCFunction)_ssl__SSLSocket_selected_alpn_protocol, METH_NOARGS, _ssl__SSLSocket_selected_alpn_protocol__doc__}, static PyObject * _ssl__SSLSocket_selected_alpn_protocol_impl(PySSLSocket *self); @@ -247,7 +247,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_compression__doc__, "\n"); #define _SSL__SSLSOCKET_COMPRESSION_METHODDEF \ - {"compression", _ssl__SSLSocket_compression, METH_NOARGS, _ssl__SSLSocket_compression__doc__}, + {"compression", (PyCFunction)_ssl__SSLSocket_compression, METH_NOARGS, _ssl__SSLSocket_compression__doc__}, static PyObject * _ssl__SSLSocket_compression_impl(PySSLSocket *self); @@ -451,7 +451,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_write__doc__, "Returns the number of bytes written."); #define _SSL__SSLSOCKET_WRITE_METHODDEF \ - {"write", _ssl__SSLSocket_write, METH_O, _ssl__SSLSocket_write__doc__}, + {"write", (PyCFunction)_ssl__SSLSocket_write, METH_O, _ssl__SSLSocket_write__doc__}, static PyObject * _ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b); @@ -485,7 +485,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_pending__doc__, "Returns the number of already decrypted bytes available for read, pending on the connection."); #define _SSL__SSLSOCKET_PENDING_METHODDEF \ - {"pending", _ssl__SSLSocket_pending, METH_NOARGS, _ssl__SSLSocket_pending__doc__}, + {"pending", (PyCFunction)_ssl__SSLSocket_pending, METH_NOARGS, _ssl__SSLSocket_pending__doc__}, static PyObject * _ssl__SSLSocket_pending_impl(PySSLSocket *self); @@ -507,7 +507,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_read__doc__, "Read up to size bytes from the SSL socket."); #define _SSL__SSLSOCKET_READ_METHODDEF \ - {"read", _ssl__SSLSocket_read, METH_VARARGS, _ssl__SSLSocket_read__doc__}, + {"read", (PyCFunction)_ssl__SSLSocket_read, METH_VARARGS, _ssl__SSLSocket_read__doc__}, static PyObject * _ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len, @@ -557,7 +557,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_shutdown__doc__, "Does the SSL shutdown handshake with the remote end."); #define _SSL__SSLSOCKET_SHUTDOWN_METHODDEF \ - {"shutdown", _ssl__SSLSocket_shutdown, METH_NOARGS, _ssl__SSLSocket_shutdown__doc__}, + {"shutdown", (PyCFunction)_ssl__SSLSocket_shutdown, METH_NOARGS, _ssl__SSLSocket_shutdown__doc__}, static PyObject * _ssl__SSLSocket_shutdown_impl(PySSLSocket *self); @@ -661,7 +661,7 @@ PyDoc_STRVAR(_ssl__SSLSocket_verify_client_post_handshake__doc__, "Initiate TLS 1.3 post-handshake authentication"); #define _SSL__SSLSOCKET_VERIFY_CLIENT_POST_HANDSHAKE_METHODDEF \ - {"verify_client_post_handshake", _ssl__SSLSocket_verify_client_post_handshake, METH_NOARGS, _ssl__SSLSocket_verify_client_post_handshake__doc__}, + {"verify_client_post_handshake", (PyCFunction)_ssl__SSLSocket_verify_client_post_handshake, METH_NOARGS, _ssl__SSLSocket_verify_client_post_handshake__doc__}, static PyObject * _ssl__SSLSocket_verify_client_post_handshake_impl(PySSLSocket *self); @@ -802,7 +802,7 @@ PyDoc_STRVAR(_ssl__SSLContext_set_ciphers__doc__, "\n"); #define _SSL__SSLCONTEXT_SET_CIPHERS_METHODDEF \ - {"set_ciphers", _ssl__SSLContext_set_ciphers, METH_O, _ssl__SSLContext_set_ciphers__doc__}, + {"set_ciphers", (PyCFunction)_ssl__SSLContext_set_ciphers, METH_O, _ssl__SSLContext_set_ciphers__doc__}, static PyObject * _ssl__SSLContext_set_ciphers_impl(PySSLContext *self, const char *cipherlist); @@ -840,7 +840,7 @@ PyDoc_STRVAR(_ssl__SSLContext_get_ciphers__doc__, "\n"); #define _SSL__SSLCONTEXT_GET_CIPHERS_METHODDEF \ - {"get_ciphers", _ssl__SSLContext_get_ciphers, METH_NOARGS, _ssl__SSLContext_get_ciphers__doc__}, + {"get_ciphers", (PyCFunction)_ssl__SSLContext_get_ciphers, METH_NOARGS, _ssl__SSLContext_get_ciphers__doc__}, static PyObject * _ssl__SSLContext_get_ciphers_impl(PySSLContext *self); @@ -863,7 +863,7 @@ PyDoc_STRVAR(_ssl__SSLContext__set_alpn_protocols__doc__, "\n"); #define _SSL__SSLCONTEXT__SET_ALPN_PROTOCOLS_METHODDEF \ - {"_set_alpn_protocols", _ssl__SSLContext__set_alpn_protocols, METH_O, _ssl__SSLContext__set_alpn_protocols__doc__}, + {"_set_alpn_protocols", (PyCFunction)_ssl__SSLContext__set_alpn_protocols, METH_O, _ssl__SSLContext__set_alpn_protocols__doc__}, static PyObject * _ssl__SSLContext__set_alpn_protocols_impl(PySSLContext *self, @@ -1514,7 +1514,7 @@ PyDoc_STRVAR(_ssl__SSLContext_load_dh_params__doc__, "\n"); #define _SSL__SSLCONTEXT_LOAD_DH_PARAMS_METHODDEF \ - {"load_dh_params", _ssl__SSLContext_load_dh_params, METH_O, _ssl__SSLContext_load_dh_params__doc__}, + {"load_dh_params", (PyCFunction)_ssl__SSLContext_load_dh_params, METH_O, _ssl__SSLContext_load_dh_params__doc__}, static PyObject * _ssl__SSLContext_load_dh_params_impl(PySSLContext *self, PyObject *filepath); @@ -1732,7 +1732,7 @@ PyDoc_STRVAR(_ssl__SSLContext_session_stats__doc__, "\n"); #define _SSL__SSLCONTEXT_SESSION_STATS_METHODDEF \ - {"session_stats", _ssl__SSLContext_session_stats, METH_NOARGS, _ssl__SSLContext_session_stats__doc__}, + {"session_stats", (PyCFunction)_ssl__SSLContext_session_stats, METH_NOARGS, _ssl__SSLContext_session_stats__doc__}, static PyObject * _ssl__SSLContext_session_stats_impl(PySSLContext *self); @@ -1755,7 +1755,7 @@ PyDoc_STRVAR(_ssl__SSLContext_set_default_verify_paths__doc__, "\n"); #define _SSL__SSLCONTEXT_SET_DEFAULT_VERIFY_PATHS_METHODDEF \ - {"set_default_verify_paths", _ssl__SSLContext_set_default_verify_paths, METH_NOARGS, _ssl__SSLContext_set_default_verify_paths__doc__}, + {"set_default_verify_paths", (PyCFunction)_ssl__SSLContext_set_default_verify_paths, METH_NOARGS, _ssl__SSLContext_set_default_verify_paths__doc__}, static PyObject * _ssl__SSLContext_set_default_verify_paths_impl(PySSLContext *self); @@ -1778,7 +1778,7 @@ PyDoc_STRVAR(_ssl__SSLContext_set_ecdh_curve__doc__, "\n"); #define _SSL__SSLCONTEXT_SET_ECDH_CURVE_METHODDEF \ - {"set_ecdh_curve", _ssl__SSLContext_set_ecdh_curve, METH_O, _ssl__SSLContext_set_ecdh_curve__doc__}, + {"set_ecdh_curve", (PyCFunction)_ssl__SSLContext_set_ecdh_curve, METH_O, _ssl__SSLContext_set_ecdh_curve__doc__}, static PyObject * _ssl__SSLContext_set_ecdh_curve_impl(PySSLContext *self, PyObject *name); @@ -1870,7 +1870,7 @@ PyDoc_STRVAR(_ssl__SSLContext_cert_store_stats__doc__, "been used at least once."); #define _SSL__SSLCONTEXT_CERT_STORE_STATS_METHODDEF \ - {"cert_store_stats", _ssl__SSLContext_cert_store_stats, METH_NOARGS, _ssl__SSLContext_cert_store_stats__doc__}, + {"cert_store_stats", (PyCFunction)_ssl__SSLContext_cert_store_stats, METH_NOARGS, _ssl__SSLContext_cert_store_stats__doc__}, static PyObject * _ssl__SSLContext_cert_store_stats_impl(PySSLContext *self); @@ -2240,7 +2240,7 @@ PyDoc_STRVAR(_ssl_MemoryBIO_write__doc__, "Returns the number of bytes written."); #define _SSL_MEMORYBIO_WRITE_METHODDEF \ - {"write", _ssl_MemoryBIO_write, METH_O, _ssl_MemoryBIO_write__doc__}, + {"write", (PyCFunction)_ssl_MemoryBIO_write, METH_O, _ssl_MemoryBIO_write__doc__}, static PyObject * _ssl_MemoryBIO_write_impl(PySSLMemoryBIO *self, Py_buffer *b); @@ -2276,7 +2276,7 @@ PyDoc_STRVAR(_ssl_MemoryBIO_write_eof__doc__, "When all data has been read, the \"eof\" property will be True."); #define _SSL_MEMORYBIO_WRITE_EOF_METHODDEF \ - {"write_eof", _ssl_MemoryBIO_write_eof, METH_NOARGS, _ssl_MemoryBIO_write_eof__doc__}, + {"write_eof", (PyCFunction)_ssl_MemoryBIO_write_eof, METH_NOARGS, _ssl_MemoryBIO_write_eof__doc__}, static PyObject * _ssl_MemoryBIO_write_eof_impl(PySSLMemoryBIO *self); @@ -2523,7 +2523,7 @@ PyDoc_STRVAR(_ssl_RAND_bytes__doc__, "Generate n cryptographically strong pseudo-random bytes."); #define _SSL_RAND_BYTES_METHODDEF \ - {"RAND_bytes", _ssl_RAND_bytes, METH_O, _ssl_RAND_bytes__doc__}, + {"RAND_bytes", (PyCFunction)_ssl_RAND_bytes, METH_O, _ssl_RAND_bytes__doc__}, static PyObject * _ssl_RAND_bytes_impl(PyObject *module, int n); @@ -2556,7 +2556,7 @@ PyDoc_STRVAR(_ssl_RAND_status__doc__, "using the ssl() function."); #define _SSL_RAND_STATUS_METHODDEF \ - {"RAND_status", _ssl_RAND_status, METH_NOARGS, _ssl_RAND_status__doc__}, + {"RAND_status", (PyCFunction)_ssl_RAND_status, METH_NOARGS, _ssl_RAND_status__doc__}, static PyObject * _ssl_RAND_status_impl(PyObject *module); @@ -2582,7 +2582,7 @@ PyDoc_STRVAR(_ssl_get_default_verify_paths__doc__, "The values are \'cert_file_env\', \'cert_file\', \'cert_dir_env\', \'cert_dir\'."); #define _SSL_GET_DEFAULT_VERIFY_PATHS_METHODDEF \ - {"get_default_verify_paths", _ssl_get_default_verify_paths, METH_NOARGS, _ssl_get_default_verify_paths__doc__}, + {"get_default_verify_paths", (PyCFunction)_ssl_get_default_verify_paths, METH_NOARGS, _ssl_get_default_verify_paths__doc__}, static PyObject * _ssl_get_default_verify_paths_impl(PyObject *module); @@ -2689,7 +2689,7 @@ PyDoc_STRVAR(_ssl_nid2obj__doc__, "Lookup NID, short name, long name and OID of an ASN1_OBJECT by NID."); #define _SSL_NID2OBJ_METHODDEF \ - {"nid2obj", _ssl_nid2obj, METH_O, _ssl_nid2obj__doc__}, + {"nid2obj", (PyCFunction)_ssl_nid2obj, METH_O, _ssl_nid2obj__doc__}, static PyObject * _ssl_nid2obj_impl(PyObject *module, int nid); @@ -2878,4 +2878,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=d0981b8b5ea94ae1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c402c53dc30a14fa input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h index 2e35b5575d1784..0e50395f70d827 100644 --- a/Modules/clinic/_struct.c.h +++ b/Modules/clinic/_struct.c.h @@ -81,7 +81,7 @@ PyDoc_STRVAR(Struct_unpack__doc__, "See help(struct) for more on format strings."); #define STRUCT_UNPACK_METHODDEF \ - {"unpack", Struct_unpack, METH_O, Struct_unpack__doc__}, + {"unpack", (PyCFunction)Struct_unpack, METH_O, Struct_unpack__doc__}, static PyObject * Struct_unpack_impl(PyStructObject *self, Py_buffer *buffer); @@ -207,7 +207,7 @@ PyDoc_STRVAR(Struct_iter_unpack__doc__, "Requires that the bytes length be a multiple of the struct size."); #define STRUCT_ITER_UNPACK_METHODDEF \ - {"iter_unpack", Struct_iter_unpack, METH_O, Struct_iter_unpack__doc__}, + {"iter_unpack", (PyCFunction)Struct_iter_unpack, METH_O, Struct_iter_unpack__doc__}, static PyObject * Struct_iter_unpack_impl(PyStructObject *self, PyObject *buffer); @@ -229,7 +229,7 @@ PyDoc_STRVAR(_clearcache__doc__, "Clear the internal cache."); #define _CLEARCACHE_METHODDEF \ - {"_clearcache", _clearcache, METH_NOARGS, _clearcache__doc__}, + {"_clearcache", (PyCFunction)_clearcache, METH_NOARGS, _clearcache__doc__}, static PyObject * _clearcache_impl(PyObject *module); @@ -247,7 +247,7 @@ PyDoc_STRVAR(calcsize__doc__, "Return size in bytes of the struct described by the format string."); #define CALCSIZE_METHODDEF \ - {"calcsize", calcsize, METH_O, calcsize__doc__}, + {"calcsize", (PyCFunction)calcsize, METH_O, calcsize__doc__}, static Py_ssize_t calcsize_impl(PyObject *module, PyStructObject *s_object); @@ -452,4 +452,4 @@ iter_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=e1d169d3c17deaae input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c7c051850b7ad427 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_sysconfig.c.h b/Modules/clinic/_sysconfig.c.h index 5ceddd925ae30a..eb3d396298bb21 100644 --- a/Modules/clinic/_sysconfig.c.h +++ b/Modules/clinic/_sysconfig.c.h @@ -9,7 +9,7 @@ PyDoc_STRVAR(_sysconfig_config_vars__doc__, "Returns a dictionary containing build variables intended to be exposed by sysconfig."); #define _SYSCONFIG_CONFIG_VARS_METHODDEF \ - {"config_vars", _sysconfig_config_vars, METH_NOARGS, _sysconfig_config_vars__doc__}, + {"config_vars", (PyCFunction)_sysconfig_config_vars, METH_NOARGS, _sysconfig_config_vars__doc__}, static PyObject * _sysconfig_config_vars_impl(PyObject *module); @@ -19,4 +19,4 @@ _sysconfig_config_vars(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _sysconfig_config_vars_impl(module); } -/*[clinic end generated code: output=63b2681222d333d9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=25d395cf02eced1f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testclinic.c.h b/Modules/clinic/_testclinic.c.h index 96dc3ef35fc084..3bc2e34ac51aca 100644 --- a/Modules/clinic/_testclinic.c.h +++ b/Modules/clinic/_testclinic.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(test_empty_function__doc__, "\n"); #define TEST_EMPTY_FUNCTION_METHODDEF \ - {"test_empty_function", test_empty_function, METH_NOARGS, test_empty_function__doc__}, + {"test_empty_function", (PyCFunction)test_empty_function, METH_NOARGS, test_empty_function__doc__}, static PyObject * test_empty_function_impl(PyObject *module); @@ -67,7 +67,7 @@ PyDoc_STRVAR(bytes_object_converter__doc__, "\n"); #define BYTES_OBJECT_CONVERTER_METHODDEF \ - {"bytes_object_converter", bytes_object_converter, METH_O, bytes_object_converter__doc__}, + {"bytes_object_converter", (PyCFunction)bytes_object_converter, METH_O, bytes_object_converter__doc__}, static PyObject * bytes_object_converter_impl(PyObject *module, PyBytesObject *a); @@ -95,7 +95,7 @@ PyDoc_STRVAR(byte_array_object_converter__doc__, "\n"); #define BYTE_ARRAY_OBJECT_CONVERTER_METHODDEF \ - {"byte_array_object_converter", byte_array_object_converter, METH_O, byte_array_object_converter__doc__}, + {"byte_array_object_converter", (PyCFunction)byte_array_object_converter, METH_O, byte_array_object_converter__doc__}, static PyObject * byte_array_object_converter_impl(PyObject *module, PyByteArrayObject *a); @@ -123,7 +123,7 @@ PyDoc_STRVAR(unicode_converter__doc__, "\n"); #define UNICODE_CONVERTER_METHODDEF \ - {"unicode_converter", unicode_converter, METH_O, unicode_converter__doc__}, + {"unicode_converter", (PyCFunction)unicode_converter, METH_O, unicode_converter__doc__}, static PyObject * unicode_converter_impl(PyObject *module, PyObject *a); @@ -1309,7 +1309,7 @@ PyDoc_STRVAR(py_complex_converter__doc__, "\n"); #define PY_COMPLEX_CONVERTER_METHODDEF \ - {"py_complex_converter", py_complex_converter, METH_O, py_complex_converter__doc__}, + {"py_complex_converter", (PyCFunction)py_complex_converter, METH_O, py_complex_converter__doc__}, static PyObject * py_complex_converter_impl(PyObject *module, Py_complex a); @@ -4011,7 +4011,7 @@ PyDoc_STRVAR(_testclinic_TestClass_varpos_no_fastcall__doc__, "\n"); #define _TESTCLINIC_TESTCLASS_VARPOS_NO_FASTCALL_METHODDEF \ - {"varpos_no_fastcall", _testclinic_TestClass_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_varpos_no_fastcall__doc__}, + {"varpos_no_fastcall", (PyCFunction)_testclinic_TestClass_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_varpos_no_fastcall__doc__}, static PyObject * _testclinic_TestClass_varpos_no_fastcall_impl(PyTypeObject *type, @@ -4038,7 +4038,7 @@ PyDoc_STRVAR(_testclinic_TestClass_posonly_varpos_no_fastcall__doc__, "\n"); #define _TESTCLINIC_TESTCLASS_POSONLY_VARPOS_NO_FASTCALL_METHODDEF \ - {"posonly_varpos_no_fastcall", _testclinic_TestClass_posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_varpos_no_fastcall__doc__}, + {"posonly_varpos_no_fastcall", (PyCFunction)_testclinic_TestClass_posonly_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_varpos_no_fastcall__doc__}, static PyObject * _testclinic_TestClass_posonly_varpos_no_fastcall_impl(PyTypeObject *type, @@ -4078,7 +4078,7 @@ PyDoc_STRVAR(_testclinic_TestClass_posonly_req_opt_varpos_no_fastcall__doc__, "\n"); #define _TESTCLINIC_TESTCLASS_POSONLY_REQ_OPT_VARPOS_NO_FASTCALL_METHODDEF \ - {"posonly_req_opt_varpos_no_fastcall", _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall__doc__}, + {"posonly_req_opt_varpos_no_fastcall", (PyCFunction)_testclinic_TestClass_posonly_req_opt_varpos_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall__doc__}, static PyObject * _testclinic_TestClass_posonly_req_opt_varpos_no_fastcall_impl(PyTypeObject *type, @@ -4192,7 +4192,7 @@ PyDoc_STRVAR(_testclinic_TestClass_varpos_array_no_fastcall__doc__, "\n"); #define _TESTCLINIC_TESTCLASS_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"varpos_array_no_fastcall", _testclinic_TestClass_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_varpos_array_no_fastcall__doc__}, + {"varpos_array_no_fastcall", (PyCFunction)_testclinic_TestClass_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_varpos_array_no_fastcall__doc__}, static PyObject * _testclinic_TestClass_varpos_array_no_fastcall_impl(PyTypeObject *type, @@ -4219,7 +4219,7 @@ PyDoc_STRVAR(_testclinic_TestClass_posonly_varpos_array_no_fastcall__doc__, "\n"); #define _TESTCLINIC_TESTCLASS_POSONLY_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"posonly_varpos_array_no_fastcall", _testclinic_TestClass_posonly_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_varpos_array_no_fastcall__doc__}, + {"posonly_varpos_array_no_fastcall", (PyCFunction)_testclinic_TestClass_posonly_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_varpos_array_no_fastcall__doc__}, static PyObject * _testclinic_TestClass_posonly_varpos_array_no_fastcall_impl(PyTypeObject *type, @@ -4256,7 +4256,7 @@ PyDoc_STRVAR(_testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall__doc "\n"); #define _TESTCLINIC_TESTCLASS_POSONLY_REQ_OPT_VARPOS_ARRAY_NO_FASTCALL_METHODDEF \ - {"posonly_req_opt_varpos_array_no_fastcall", _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall__doc__}, + {"posonly_req_opt_varpos_array_no_fastcall", (PyCFunction)_testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall, METH_VARARGS|METH_CLASS, _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall__doc__}, static PyObject * _testclinic_TestClass_posonly_req_opt_varpos_array_no_fastcall_impl(PyTypeObject *type, @@ -4357,4 +4357,4 @@ _testclinic_TestClass_posonly_poskw_varpos_array_no_fastcall(PyObject *type, PyO exit: return return_value; } -/*[clinic end generated code: output=dbf17d873e9e8626 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3743b66729741d41 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testclinic_limited.c.h b/Modules/clinic/_testclinic_limited.c.h index 5cf0a8e8868eca..94897f4c6dc427 100644 --- a/Modules/clinic/_testclinic_limited.c.h +++ b/Modules/clinic/_testclinic_limited.c.h @@ -8,7 +8,7 @@ PyDoc_STRVAR(test_empty_function__doc__, "\n"); #define TEST_EMPTY_FUNCTION_METHODDEF \ - {"test_empty_function", test_empty_function, METH_NOARGS, test_empty_function__doc__}, + {"test_empty_function", (PyCFunction)test_empty_function, METH_NOARGS, test_empty_function__doc__}, static PyObject * test_empty_function_impl(PyObject *module); @@ -25,7 +25,7 @@ PyDoc_STRVAR(my_int_func__doc__, "\n"); #define MY_INT_FUNC_METHODDEF \ - {"my_int_func", my_int_func, METH_O, my_int_func__doc__}, + {"my_int_func", (PyCFunction)my_int_func, METH_O, my_int_func__doc__}, static int my_int_func_impl(PyObject *module, int arg); @@ -181,7 +181,7 @@ PyDoc_STRVAR(get_file_descriptor__doc__, "Get a file descriptor."); #define GET_FILE_DESCRIPTOR_METHODDEF \ - {"get_file_descriptor", get_file_descriptor, METH_O, get_file_descriptor__doc__}, + {"get_file_descriptor", (PyCFunction)get_file_descriptor, METH_O, get_file_descriptor__doc__}, static int get_file_descriptor_impl(PyObject *module, int fd); @@ -206,4 +206,4 @@ get_file_descriptor(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=bc954e4e8b99154d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=03fd7811c056dc74 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_testinternalcapi.c.h b/Modules/clinic/_testinternalcapi.c.h index 474d7aa09ca293..d98d69df22f982 100644 --- a/Modules/clinic/_testinternalcapi.c.h +++ b/Modules/clinic/_testinternalcapi.c.h @@ -75,7 +75,7 @@ PyDoc_STRVAR(_testinternalcapi_new_instruction_sequence__doc__, "Return a new, empty InstructionSequence."); #define _TESTINTERNALCAPI_NEW_INSTRUCTION_SEQUENCE_METHODDEF \ - {"new_instruction_sequence", _testinternalcapi_new_instruction_sequence, METH_NOARGS, _testinternalcapi_new_instruction_sequence__doc__}, + {"new_instruction_sequence", (PyCFunction)_testinternalcapi_new_instruction_sequence, METH_NOARGS, _testinternalcapi_new_instruction_sequence__doc__}, static PyObject * _testinternalcapi_new_instruction_sequence_impl(PyObject *module); @@ -294,7 +294,7 @@ PyDoc_STRVAR(_testinternalcapi_test_long_numbits__doc__, "\n"); #define _TESTINTERNALCAPI_TEST_LONG_NUMBITS_METHODDEF \ - {"test_long_numbits", _testinternalcapi_test_long_numbits, METH_NOARGS, _testinternalcapi_test_long_numbits__doc__}, + {"test_long_numbits", (PyCFunction)_testinternalcapi_test_long_numbits, METH_NOARGS, _testinternalcapi_test_long_numbits__doc__}, static PyObject * _testinternalcapi_test_long_numbits_impl(PyObject *module); @@ -365,4 +365,4 @@ gh_119213_getargs(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO exit: return return_value; } -/*[clinic end generated code: output=bc3d1afd54a902ef input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ec77971c6c2663da input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_threadmodule.c.h b/Modules/clinic/_threadmodule.c.h index 81bfbdd65c191e..367831c25a96c6 100644 --- a/Modules/clinic/_threadmodule.c.h +++ b/Modules/clinic/_threadmodule.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(_thread__get_name__doc__, "Get the name of the current thread."); #define _THREAD__GET_NAME_METHODDEF \ - {"_get_name", _thread__get_name, METH_NOARGS, _thread__get_name__doc__}, + {"_get_name", (PyCFunction)_thread__get_name, METH_NOARGS, _thread__get_name__doc__}, static PyObject * _thread__get_name_impl(PyObject *module); @@ -101,4 +101,4 @@ _thread_set_name(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #ifndef _THREAD_SET_NAME_METHODDEF #define _THREAD_SET_NAME_METHODDEF #endif /* !defined(_THREAD_SET_NAME_METHODDEF) */ -/*[clinic end generated code: output=05074845049408ff input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c7922811558d314f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index 1c08e2036379f8..352c2b9e3d410c 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -10,7 +10,7 @@ PyDoc_STRVAR(_tkinter_tkapp_eval__doc__, "\n"); #define _TKINTER_TKAPP_EVAL_METHODDEF \ - {"eval", _tkinter_tkapp_eval, METH_O, _tkinter_tkapp_eval__doc__}, + {"eval", (PyCFunction)_tkinter_tkapp_eval, METH_O, _tkinter_tkapp_eval__doc__}, static PyObject * _tkinter_tkapp_eval_impl(TkappObject *self, const char *script); @@ -46,7 +46,7 @@ PyDoc_STRVAR(_tkinter_tkapp_evalfile__doc__, "\n"); #define _TKINTER_TKAPP_EVALFILE_METHODDEF \ - {"evalfile", _tkinter_tkapp_evalfile, METH_O, _tkinter_tkapp_evalfile__doc__}, + {"evalfile", (PyCFunction)_tkinter_tkapp_evalfile, METH_O, _tkinter_tkapp_evalfile__doc__}, static PyObject * _tkinter_tkapp_evalfile_impl(TkappObject *self, const char *fileName); @@ -82,7 +82,7 @@ PyDoc_STRVAR(_tkinter_tkapp_record__doc__, "\n"); #define _TKINTER_TKAPP_RECORD_METHODDEF \ - {"record", _tkinter_tkapp_record, METH_O, _tkinter_tkapp_record__doc__}, + {"record", (PyCFunction)_tkinter_tkapp_record, METH_O, _tkinter_tkapp_record__doc__}, static PyObject * _tkinter_tkapp_record_impl(TkappObject *self, const char *script); @@ -118,7 +118,7 @@ PyDoc_STRVAR(_tkinter_tkapp_adderrorinfo__doc__, "\n"); #define _TKINTER_TKAPP_ADDERRORINFO_METHODDEF \ - {"adderrorinfo", _tkinter_tkapp_adderrorinfo, METH_O, _tkinter_tkapp_adderrorinfo__doc__}, + {"adderrorinfo", (PyCFunction)_tkinter_tkapp_adderrorinfo, METH_O, _tkinter_tkapp_adderrorinfo__doc__}, static PyObject * _tkinter_tkapp_adderrorinfo_impl(TkappObject *self, const char *msg); @@ -154,7 +154,7 @@ PyDoc_STRVAR(_tkinter_tkapp_getint__doc__, "\n"); #define _TKINTER_TKAPP_GETINT_METHODDEF \ - {"getint", _tkinter_tkapp_getint, METH_O, _tkinter_tkapp_getint__doc__}, + {"getint", (PyCFunction)_tkinter_tkapp_getint, METH_O, _tkinter_tkapp_getint__doc__}, static PyObject * _tkinter_tkapp_getint_impl(TkappObject *self, PyObject *arg); @@ -175,7 +175,7 @@ PyDoc_STRVAR(_tkinter_tkapp_getdouble__doc__, "\n"); #define _TKINTER_TKAPP_GETDOUBLE_METHODDEF \ - {"getdouble", _tkinter_tkapp_getdouble, METH_O, _tkinter_tkapp_getdouble__doc__}, + {"getdouble", (PyCFunction)_tkinter_tkapp_getdouble, METH_O, _tkinter_tkapp_getdouble__doc__}, static PyObject * _tkinter_tkapp_getdouble_impl(TkappObject *self, PyObject *arg); @@ -196,7 +196,7 @@ PyDoc_STRVAR(_tkinter_tkapp_getboolean__doc__, "\n"); #define _TKINTER_TKAPP_GETBOOLEAN_METHODDEF \ - {"getboolean", _tkinter_tkapp_getboolean, METH_O, _tkinter_tkapp_getboolean__doc__}, + {"getboolean", (PyCFunction)_tkinter_tkapp_getboolean, METH_O, _tkinter_tkapp_getboolean__doc__}, static PyObject * _tkinter_tkapp_getboolean_impl(TkappObject *self, PyObject *arg); @@ -217,7 +217,7 @@ PyDoc_STRVAR(_tkinter_tkapp_exprstring__doc__, "\n"); #define _TKINTER_TKAPP_EXPRSTRING_METHODDEF \ - {"exprstring", _tkinter_tkapp_exprstring, METH_O, _tkinter_tkapp_exprstring__doc__}, + {"exprstring", (PyCFunction)_tkinter_tkapp_exprstring, METH_O, _tkinter_tkapp_exprstring__doc__}, static PyObject * _tkinter_tkapp_exprstring_impl(TkappObject *self, const char *s); @@ -253,7 +253,7 @@ PyDoc_STRVAR(_tkinter_tkapp_exprlong__doc__, "\n"); #define _TKINTER_TKAPP_EXPRLONG_METHODDEF \ - {"exprlong", _tkinter_tkapp_exprlong, METH_O, _tkinter_tkapp_exprlong__doc__}, + {"exprlong", (PyCFunction)_tkinter_tkapp_exprlong, METH_O, _tkinter_tkapp_exprlong__doc__}, static PyObject * _tkinter_tkapp_exprlong_impl(TkappObject *self, const char *s); @@ -289,7 +289,7 @@ PyDoc_STRVAR(_tkinter_tkapp_exprdouble__doc__, "\n"); #define _TKINTER_TKAPP_EXPRDOUBLE_METHODDEF \ - {"exprdouble", _tkinter_tkapp_exprdouble, METH_O, _tkinter_tkapp_exprdouble__doc__}, + {"exprdouble", (PyCFunction)_tkinter_tkapp_exprdouble, METH_O, _tkinter_tkapp_exprdouble__doc__}, static PyObject * _tkinter_tkapp_exprdouble_impl(TkappObject *self, const char *s); @@ -325,7 +325,7 @@ PyDoc_STRVAR(_tkinter_tkapp_exprboolean__doc__, "\n"); #define _TKINTER_TKAPP_EXPRBOOLEAN_METHODDEF \ - {"exprboolean", _tkinter_tkapp_exprboolean, METH_O, _tkinter_tkapp_exprboolean__doc__}, + {"exprboolean", (PyCFunction)_tkinter_tkapp_exprboolean, METH_O, _tkinter_tkapp_exprboolean__doc__}, static PyObject * _tkinter_tkapp_exprboolean_impl(TkappObject *self, const char *s); @@ -361,7 +361,7 @@ PyDoc_STRVAR(_tkinter_tkapp_splitlist__doc__, "\n"); #define _TKINTER_TKAPP_SPLITLIST_METHODDEF \ - {"splitlist", _tkinter_tkapp_splitlist, METH_O, _tkinter_tkapp_splitlist__doc__}, + {"splitlist", (PyCFunction)_tkinter_tkapp_splitlist, METH_O, _tkinter_tkapp_splitlist__doc__}, static PyObject * _tkinter_tkapp_splitlist_impl(TkappObject *self, PyObject *arg); @@ -424,7 +424,7 @@ PyDoc_STRVAR(_tkinter_tkapp_deletecommand__doc__, "\n"); #define _TKINTER_TKAPP_DELETECOMMAND_METHODDEF \ - {"deletecommand", _tkinter_tkapp_deletecommand, METH_O, _tkinter_tkapp_deletecommand__doc__}, + {"deletecommand", (PyCFunction)_tkinter_tkapp_deletecommand, METH_O, _tkinter_tkapp_deletecommand__doc__}, static PyObject * _tkinter_tkapp_deletecommand_impl(TkappObject *self, const char *name); @@ -501,7 +501,7 @@ PyDoc_STRVAR(_tkinter_tkapp_deletefilehandler__doc__, "\n"); #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF \ - {"deletefilehandler", _tkinter_tkapp_deletefilehandler, METH_O, _tkinter_tkapp_deletefilehandler__doc__}, + {"deletefilehandler", (PyCFunction)_tkinter_tkapp_deletefilehandler, METH_O, _tkinter_tkapp_deletefilehandler__doc__}, static PyObject * _tkinter_tkapp_deletefilehandler_impl(TkappObject *self, PyObject *file); @@ -524,7 +524,7 @@ PyDoc_STRVAR(_tkinter_tktimertoken_deletetimerhandler__doc__, "\n"); #define _TKINTER_TKTIMERTOKEN_DELETETIMERHANDLER_METHODDEF \ - {"deletetimerhandler", _tkinter_tktimertoken_deletetimerhandler, METH_NOARGS, _tkinter_tktimertoken_deletetimerhandler__doc__}, + {"deletetimerhandler", (PyCFunction)_tkinter_tktimertoken_deletetimerhandler, METH_NOARGS, _tkinter_tktimertoken_deletetimerhandler__doc__}, static PyObject * _tkinter_tktimertoken_deletetimerhandler_impl(TkttObject *self); @@ -642,7 +642,7 @@ PyDoc_STRVAR(_tkinter_tkapp_quit__doc__, "\n"); #define _TKINTER_TKAPP_QUIT_METHODDEF \ - {"quit", _tkinter_tkapp_quit, METH_NOARGS, _tkinter_tkapp_quit__doc__}, + {"quit", (PyCFunction)_tkinter_tkapp_quit, METH_NOARGS, _tkinter_tkapp_quit__doc__}, static PyObject * _tkinter_tkapp_quit_impl(TkappObject *self); @@ -659,7 +659,7 @@ PyDoc_STRVAR(_tkinter_tkapp_interpaddr__doc__, "\n"); #define _TKINTER_TKAPP_INTERPADDR_METHODDEF \ - {"interpaddr", _tkinter_tkapp_interpaddr, METH_NOARGS, _tkinter_tkapp_interpaddr__doc__}, + {"interpaddr", (PyCFunction)_tkinter_tkapp_interpaddr, METH_NOARGS, _tkinter_tkapp_interpaddr__doc__}, static PyObject * _tkinter_tkapp_interpaddr_impl(TkappObject *self); @@ -676,7 +676,7 @@ PyDoc_STRVAR(_tkinter_tkapp_loadtk__doc__, "\n"); #define _TKINTER_TKAPP_LOADTK_METHODDEF \ - {"loadtk", _tkinter_tkapp_loadtk, METH_NOARGS, _tkinter_tkapp_loadtk__doc__}, + {"loadtk", (PyCFunction)_tkinter_tkapp_loadtk, METH_NOARGS, _tkinter_tkapp_loadtk__doc__}, static PyObject * _tkinter_tkapp_loadtk_impl(TkappObject *self); @@ -694,7 +694,7 @@ PyDoc_STRVAR(_tkinter_tkapp_settrace__doc__, "Set the tracing function."); #define _TKINTER_TKAPP_SETTRACE_METHODDEF \ - {"settrace", _tkinter_tkapp_settrace, METH_O, _tkinter_tkapp_settrace__doc__}, + {"settrace", (PyCFunction)_tkinter_tkapp_settrace, METH_O, _tkinter_tkapp_settrace__doc__}, static PyObject * _tkinter_tkapp_settrace_impl(TkappObject *self, PyObject *func); @@ -716,7 +716,7 @@ PyDoc_STRVAR(_tkinter_tkapp_gettrace__doc__, "Get the tracing function."); #define _TKINTER_TKAPP_GETTRACE_METHODDEF \ - {"gettrace", _tkinter_tkapp_gettrace, METH_NOARGS, _tkinter_tkapp_gettrace__doc__}, + {"gettrace", (PyCFunction)_tkinter_tkapp_gettrace, METH_NOARGS, _tkinter_tkapp_gettrace__doc__}, static PyObject * _tkinter_tkapp_gettrace_impl(TkappObject *self); @@ -733,7 +733,7 @@ PyDoc_STRVAR(_tkinter_tkapp_willdispatch__doc__, "\n"); #define _TKINTER_TKAPP_WILLDISPATCH_METHODDEF \ - {"willdispatch", _tkinter_tkapp_willdispatch, METH_NOARGS, _tkinter_tkapp_willdispatch__doc__}, + {"willdispatch", (PyCFunction)_tkinter_tkapp_willdispatch, METH_NOARGS, _tkinter_tkapp_willdispatch__doc__}, static PyObject * _tkinter_tkapp_willdispatch_impl(TkappObject *self); @@ -750,7 +750,7 @@ PyDoc_STRVAR(_tkinter__flatten__doc__, "\n"); #define _TKINTER__FLATTEN_METHODDEF \ - {"_flatten", _tkinter__flatten, METH_O, _tkinter__flatten__doc__}, + {"_flatten", (PyCFunction)_tkinter__flatten, METH_O, _tkinter__flatten__doc__}, PyDoc_STRVAR(_tkinter_create__doc__, "create($module, screenName=None, baseName=\'\', className=\'Tk\',\n" @@ -910,7 +910,7 @@ PyDoc_STRVAR(_tkinter_setbusywaitinterval__doc__, "It should be set to a divisor of the maximum time between frames in an animation."); #define _TKINTER_SETBUSYWAITINTERVAL_METHODDEF \ - {"setbusywaitinterval", _tkinter_setbusywaitinterval, METH_O, _tkinter_setbusywaitinterval__doc__}, + {"setbusywaitinterval", (PyCFunction)_tkinter_setbusywaitinterval, METH_O, _tkinter_setbusywaitinterval__doc__}, static PyObject * _tkinter_setbusywaitinterval_impl(PyObject *module, int new_val); @@ -938,7 +938,7 @@ PyDoc_STRVAR(_tkinter_getbusywaitinterval__doc__, "Return the current busy-wait interval between successive calls to Tcl_DoOneEvent in a threaded Python interpreter."); #define _TKINTER_GETBUSYWAITINTERVAL_METHODDEF \ - {"getbusywaitinterval", _tkinter_getbusywaitinterval, METH_NOARGS, _tkinter_getbusywaitinterval__doc__}, + {"getbusywaitinterval", (PyCFunction)_tkinter_getbusywaitinterval, METH_NOARGS, _tkinter_getbusywaitinterval__doc__}, static int _tkinter_getbusywaitinterval_impl(PyObject *module); @@ -966,4 +966,4 @@ _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=9643e57d76763b5a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=052c067aa69237be input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tracemalloc.c.h b/Modules/clinic/_tracemalloc.c.h index 8dc2fe46d73ed3..1d100247423991 100644 --- a/Modules/clinic/_tracemalloc.c.h +++ b/Modules/clinic/_tracemalloc.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(_tracemalloc_is_tracing__doc__, "Return True if the tracemalloc module is tracing Python memory allocations."); #define _TRACEMALLOC_IS_TRACING_METHODDEF \ - {"is_tracing", _tracemalloc_is_tracing, METH_NOARGS, _tracemalloc_is_tracing__doc__}, + {"is_tracing", (PyCFunction)_tracemalloc_is_tracing, METH_NOARGS, _tracemalloc_is_tracing__doc__}, static PyObject * _tracemalloc_is_tracing_impl(PyObject *module); @@ -29,7 +29,7 @@ PyDoc_STRVAR(_tracemalloc_clear_traces__doc__, "Clear traces of memory blocks allocated by Python."); #define _TRACEMALLOC_CLEAR_TRACES_METHODDEF \ - {"clear_traces", _tracemalloc_clear_traces, METH_NOARGS, _tracemalloc_clear_traces__doc__}, + {"clear_traces", (PyCFunction)_tracemalloc_clear_traces, METH_NOARGS, _tracemalloc_clear_traces__doc__}, static PyObject * _tracemalloc_clear_traces_impl(PyObject *module); @@ -52,7 +52,7 @@ PyDoc_STRVAR(_tracemalloc__get_traces__doc__, "Return an empty list if the tracemalloc module is disabled."); #define _TRACEMALLOC__GET_TRACES_METHODDEF \ - {"_get_traces", _tracemalloc__get_traces, METH_NOARGS, _tracemalloc__get_traces__doc__}, + {"_get_traces", (PyCFunction)_tracemalloc__get_traces, METH_NOARGS, _tracemalloc__get_traces__doc__}, static PyObject * _tracemalloc__get_traces_impl(PyObject *module); @@ -74,7 +74,7 @@ PyDoc_STRVAR(_tracemalloc__get_object_traceback__doc__, "trace the allocation of the object."); #define _TRACEMALLOC__GET_OBJECT_TRACEBACK_METHODDEF \ - {"_get_object_traceback", _tracemalloc__get_object_traceback, METH_O, _tracemalloc__get_object_traceback__doc__}, + {"_get_object_traceback", (PyCFunction)_tracemalloc__get_object_traceback, METH_O, _tracemalloc__get_object_traceback__doc__}, PyDoc_STRVAR(_tracemalloc_start__doc__, "start($module, nframe=1, /)\n" @@ -123,7 +123,7 @@ PyDoc_STRVAR(_tracemalloc_stop__doc__, "Also clear traces of memory blocks allocated by Python."); #define _TRACEMALLOC_STOP_METHODDEF \ - {"stop", _tracemalloc_stop, METH_NOARGS, _tracemalloc_stop__doc__}, + {"stop", (PyCFunction)_tracemalloc_stop, METH_NOARGS, _tracemalloc_stop__doc__}, static PyObject * _tracemalloc_stop_impl(PyObject *module); @@ -144,7 +144,7 @@ PyDoc_STRVAR(_tracemalloc_get_traceback_limit__doc__, "the most recent frame: the limit is 1."); #define _TRACEMALLOC_GET_TRACEBACK_LIMIT_METHODDEF \ - {"get_traceback_limit", _tracemalloc_get_traceback_limit, METH_NOARGS, _tracemalloc_get_traceback_limit__doc__}, + {"get_traceback_limit", (PyCFunction)_tracemalloc_get_traceback_limit, METH_NOARGS, _tracemalloc_get_traceback_limit__doc__}, static PyObject * _tracemalloc_get_traceback_limit_impl(PyObject *module); @@ -164,7 +164,7 @@ PyDoc_STRVAR(_tracemalloc_get_tracemalloc_memory__doc__, "This memory is used internally to trace memory allocations."); #define _TRACEMALLOC_GET_TRACEMALLOC_MEMORY_METHODDEF \ - {"get_tracemalloc_memory", _tracemalloc_get_tracemalloc_memory, METH_NOARGS, _tracemalloc_get_tracemalloc_memory__doc__}, + {"get_tracemalloc_memory", (PyCFunction)_tracemalloc_get_tracemalloc_memory, METH_NOARGS, _tracemalloc_get_tracemalloc_memory__doc__}, static PyObject * _tracemalloc_get_tracemalloc_memory_impl(PyObject *module); @@ -184,7 +184,7 @@ PyDoc_STRVAR(_tracemalloc_get_traced_memory__doc__, "Returns a tuple: (current: int, peak: int)."); #define _TRACEMALLOC_GET_TRACED_MEMORY_METHODDEF \ - {"get_traced_memory", _tracemalloc_get_traced_memory, METH_NOARGS, _tracemalloc_get_traced_memory__doc__}, + {"get_traced_memory", (PyCFunction)_tracemalloc_get_traced_memory, METH_NOARGS, _tracemalloc_get_traced_memory__doc__}, static PyObject * _tracemalloc_get_traced_memory_impl(PyObject *module); @@ -204,7 +204,7 @@ PyDoc_STRVAR(_tracemalloc_reset_peak__doc__, "Do nothing if the tracemalloc module is not tracing memory allocations."); #define _TRACEMALLOC_RESET_PEAK_METHODDEF \ - {"reset_peak", _tracemalloc_reset_peak, METH_NOARGS, _tracemalloc_reset_peak__doc__}, + {"reset_peak", (PyCFunction)_tracemalloc_reset_peak, METH_NOARGS, _tracemalloc_reset_peak__doc__}, static PyObject * _tracemalloc_reset_peak_impl(PyObject *module); @@ -214,4 +214,4 @@ _tracemalloc_reset_peak(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _tracemalloc_reset_peak_impl(module); } -/*[clinic end generated code: output=abdeb5c5c5274c70 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9d4d884b156c2ddb input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_typingmodule.c.h b/Modules/clinic/_typingmodule.c.h index ddae332e43867a..ea415e67153ed8 100644 --- a/Modules/clinic/_typingmodule.c.h +++ b/Modules/clinic/_typingmodule.c.h @@ -8,5 +8,5 @@ PyDoc_STRVAR(_typing__idfunc__doc__, "\n"); #define _TYPING__IDFUNC_METHODDEF \ - {"_idfunc", _typing__idfunc, METH_O, _typing__idfunc__doc__}, -/*[clinic end generated code: output=c740c67df8c70130 input=a9049054013a1b77]*/ + {"_idfunc", (PyCFunction)_typing__idfunc, METH_O, _typing__idfunc__doc__}, +/*[clinic end generated code: output=e7ea2a3cb7ab301a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_weakref.c.h b/Modules/clinic/_weakref.c.h index 83b34fb004c092..8d7bc5dc936610 100644 --- a/Modules/clinic/_weakref.c.h +++ b/Modules/clinic/_weakref.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(_weakref_getweakrefcount__doc__, "Return the number of weak references to \'object\'."); #define _WEAKREF_GETWEAKREFCOUNT_METHODDEF \ - {"getweakrefcount", _weakref_getweakrefcount, METH_O, _weakref_getweakrefcount__doc__}, + {"getweakrefcount", (PyCFunction)_weakref_getweakrefcount, METH_O, _weakref_getweakrefcount__doc__}, static Py_ssize_t _weakref_getweakrefcount_impl(PyObject *module, PyObject *object); @@ -74,7 +74,7 @@ PyDoc_STRVAR(_weakref_getweakrefs__doc__, "Return a list of all weak reference objects pointing to \'object\'."); #define _WEAKREF_GETWEAKREFS_METHODDEF \ - {"getweakrefs", _weakref_getweakrefs, METH_O, _weakref_getweakrefs__doc__}, + {"getweakrefs", (PyCFunction)_weakref_getweakrefs, METH_O, _weakref_getweakrefs__doc__}, PyDoc_STRVAR(_weakref_proxy__doc__, "proxy($module, object, callback=None, /)\n" @@ -112,4 +112,4 @@ _weakref_proxy(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=eae8e52dc631b4fd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=60f59adc1dc9eab8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h index d51370b55317c3..6a2f8d45cd4e0c 100644 --- a/Modules/clinic/_winapi.c.h +++ b/Modules/clinic/_winapi.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(_winapi_Overlapped_GetOverlappedResult__doc__, "\n"); #define _WINAPI_OVERLAPPED_GETOVERLAPPEDRESULT_METHODDEF \ - {"GetOverlappedResult", _winapi_Overlapped_GetOverlappedResult, METH_O, _winapi_Overlapped_GetOverlappedResult__doc__}, + {"GetOverlappedResult", (PyCFunction)_winapi_Overlapped_GetOverlappedResult, METH_O, _winapi_Overlapped_GetOverlappedResult__doc__}, static PyObject * _winapi_Overlapped_GetOverlappedResult_impl(OverlappedObject *self, int wait); @@ -42,7 +42,7 @@ PyDoc_STRVAR(_winapi_Overlapped_getbuffer__doc__, "\n"); #define _WINAPI_OVERLAPPED_GETBUFFER_METHODDEF \ - {"getbuffer", _winapi_Overlapped_getbuffer, METH_NOARGS, _winapi_Overlapped_getbuffer__doc__}, + {"getbuffer", (PyCFunction)_winapi_Overlapped_getbuffer, METH_NOARGS, _winapi_Overlapped_getbuffer__doc__}, static PyObject * _winapi_Overlapped_getbuffer_impl(OverlappedObject *self); @@ -59,7 +59,7 @@ PyDoc_STRVAR(_winapi_Overlapped_cancel__doc__, "\n"); #define _WINAPI_OVERLAPPED_CANCEL_METHODDEF \ - {"cancel", _winapi_Overlapped_cancel, METH_NOARGS, _winapi_Overlapped_cancel__doc__}, + {"cancel", (PyCFunction)_winapi_Overlapped_cancel, METH_NOARGS, _winapi_Overlapped_cancel__doc__}, static PyObject * _winapi_Overlapped_cancel_impl(OverlappedObject *self); @@ -77,7 +77,7 @@ PyDoc_STRVAR(_winapi_CloseHandle__doc__, "Close handle."); #define _WINAPI_CLOSEHANDLE_METHODDEF \ - {"CloseHandle", _winapi_CloseHandle, METH_O, _winapi_CloseHandle__doc__}, + {"CloseHandle", (PyCFunction)_winapi_CloseHandle, METH_O, _winapi_CloseHandle__doc__}, static PyObject * _winapi_CloseHandle_impl(PyObject *module, HANDLE handle); @@ -634,7 +634,7 @@ PyDoc_STRVAR(_winapi_ExitProcess__doc__, "\n"); #define _WINAPI_EXITPROCESS_METHODDEF \ - {"ExitProcess", _winapi_ExitProcess, METH_O, _winapi_ExitProcess__doc__}, + {"ExitProcess", (PyCFunction)_winapi_ExitProcess, METH_O, _winapi_ExitProcess__doc__}, static PyObject * _winapi_ExitProcess_impl(PyObject *module, UINT ExitCode); @@ -661,7 +661,7 @@ PyDoc_STRVAR(_winapi_GetCurrentProcess__doc__, "Return a handle object for the current process."); #define _WINAPI_GETCURRENTPROCESS_METHODDEF \ - {"GetCurrentProcess", _winapi_GetCurrentProcess, METH_NOARGS, _winapi_GetCurrentProcess__doc__}, + {"GetCurrentProcess", (PyCFunction)_winapi_GetCurrentProcess, METH_NOARGS, _winapi_GetCurrentProcess__doc__}, static HANDLE _winapi_GetCurrentProcess_impl(PyObject *module); @@ -692,7 +692,7 @@ PyDoc_STRVAR(_winapi_GetExitCodeProcess__doc__, "Return the termination status of the specified process."); #define _WINAPI_GETEXITCODEPROCESS_METHODDEF \ - {"GetExitCodeProcess", _winapi_GetExitCodeProcess, METH_O, _winapi_GetExitCodeProcess__doc__}, + {"GetExitCodeProcess", (PyCFunction)_winapi_GetExitCodeProcess, METH_O, _winapi_GetExitCodeProcess__doc__}, static DWORD _winapi_GetExitCodeProcess_impl(PyObject *module, HANDLE process); @@ -723,7 +723,7 @@ PyDoc_STRVAR(_winapi_GetLastError__doc__, "\n"); #define _WINAPI_GETLASTERROR_METHODDEF \ - {"GetLastError", _winapi_GetLastError, METH_NOARGS, _winapi_GetLastError__doc__}, + {"GetLastError", (PyCFunction)_winapi_GetLastError, METH_NOARGS, _winapi_GetLastError__doc__}, static DWORD _winapi_GetLastError_impl(PyObject *module); @@ -829,7 +829,7 @@ PyDoc_STRVAR(_winapi_GetModuleFileName__doc__, "of the current process."); #define _WINAPI_GETMODULEFILENAME_METHODDEF \ - {"GetModuleFileName", _winapi_GetModuleFileName, METH_O, _winapi_GetModuleFileName__doc__}, + {"GetModuleFileName", (PyCFunction)_winapi_GetModuleFileName, METH_O, _winapi_GetModuleFileName__doc__}, static PyObject * _winapi_GetModuleFileName_impl(PyObject *module, HMODULE module_handle); @@ -932,7 +932,7 @@ PyDoc_STRVAR(_winapi_GetStdHandle__doc__, "The integer associated with the handle object is returned."); #define _WINAPI_GETSTDHANDLE_METHODDEF \ - {"GetStdHandle", _winapi_GetStdHandle, METH_O, _winapi_GetStdHandle__doc__}, + {"GetStdHandle", (PyCFunction)_winapi_GetStdHandle, METH_O, _winapi_GetStdHandle__doc__}, static HANDLE _winapi_GetStdHandle_impl(PyObject *module, DWORD std_handle); @@ -967,7 +967,7 @@ PyDoc_STRVAR(_winapi_GetVersion__doc__, "Return the version number of the current operating system."); #define _WINAPI_GETVERSION_METHODDEF \ - {"GetVersion", _winapi_GetVersion, METH_NOARGS, _winapi_GetVersion__doc__}, + {"GetVersion", (PyCFunction)_winapi_GetVersion, METH_NOARGS, _winapi_GetVersion__doc__}, static long _winapi_GetVersion_impl(PyObject *module); @@ -1033,7 +1033,7 @@ PyDoc_STRVAR(_winapi_UnmapViewOfFile__doc__, "\n"); #define _WINAPI_UNMAPVIEWOFFILE_METHODDEF \ - {"UnmapViewOfFile", _winapi_UnmapViewOfFile, METH_O, _winapi_UnmapViewOfFile__doc__}, + {"UnmapViewOfFile", (PyCFunction)_winapi_UnmapViewOfFile, METH_O, _winapi_UnmapViewOfFile__doc__}, static PyObject * _winapi_UnmapViewOfFile_impl(PyObject *module, LPCVOID address); @@ -1631,7 +1631,7 @@ PyDoc_STRVAR(_winapi_VirtualQuerySize__doc__, "\n"); #define _WINAPI_VIRTUALQUERYSIZE_METHODDEF \ - {"VirtualQuerySize", _winapi_VirtualQuerySize, METH_O, _winapi_VirtualQuerySize__doc__}, + {"VirtualQuerySize", (PyCFunction)_winapi_VirtualQuerySize, METH_O, _winapi_VirtualQuerySize__doc__}, static size_t _winapi_VirtualQuerySize_impl(PyObject *module, LPCVOID address); @@ -1890,7 +1890,7 @@ PyDoc_STRVAR(_winapi_GetACP__doc__, "Get the current Windows ANSI code page identifier."); #define _WINAPI_GETACP_METHODDEF \ - {"GetACP", _winapi_GetACP, METH_NOARGS, _winapi_GetACP__doc__}, + {"GetACP", (PyCFunction)_winapi_GetACP, METH_NOARGS, _winapi_GetACP__doc__}, static PyObject * _winapi_GetACP_impl(PyObject *module); @@ -2024,7 +2024,7 @@ PyDoc_STRVAR(_winapi_NeedCurrentDirectoryForExePath__doc__, "\n"); #define _WINAPI_NEEDCURRENTDIRECTORYFOREXEPATH_METHODDEF \ - {"NeedCurrentDirectoryForExePath", _winapi_NeedCurrentDirectoryForExePath, METH_O, _winapi_NeedCurrentDirectoryForExePath__doc__}, + {"NeedCurrentDirectoryForExePath", (PyCFunction)_winapi_NeedCurrentDirectoryForExePath, METH_O, _winapi_NeedCurrentDirectoryForExePath__doc__}, static int _winapi_NeedCurrentDirectoryForExePath_impl(PyObject *module, @@ -2127,4 +2127,4 @@ _winapi_CopyFile2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO return return_value; } -/*[clinic end generated code: output=10664fcb729a1aa8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=06b56212b2186250 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index 0647c6365ac4ca..97e5ca771f3a90 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(array_array_clear__doc__, "Remove all items from the array."); #define ARRAY_ARRAY_CLEAR_METHODDEF \ - {"clear", array_array_clear, METH_NOARGS, array_array_clear__doc__}, + {"clear", (PyCFunction)array_array_clear, METH_NOARGS, array_array_clear__doc__}, static PyObject * array_array_clear_impl(arrayobject *self); @@ -33,7 +33,7 @@ PyDoc_STRVAR(array_array___copy____doc__, "Return a copy of the array."); #define ARRAY_ARRAY___COPY___METHODDEF \ - {"__copy__", array_array___copy__, METH_NOARGS, array_array___copy____doc__}, + {"__copy__", (PyCFunction)array_array___copy__, METH_NOARGS, array_array___copy____doc__}, static PyObject * array_array___copy___impl(arrayobject *self); @@ -51,7 +51,7 @@ PyDoc_STRVAR(array_array___deepcopy____doc__, "Return a copy of the array."); #define ARRAY_ARRAY___DEEPCOPY___METHODDEF \ - {"__deepcopy__", array_array___deepcopy__, METH_O, array_array___deepcopy____doc__}, + {"__deepcopy__", (PyCFunction)array_array___deepcopy__, METH_O, array_array___deepcopy____doc__}, static PyObject * array_array___deepcopy___impl(arrayobject *self, PyObject *unused); @@ -73,7 +73,7 @@ PyDoc_STRVAR(array_array_count__doc__, "Return number of occurrences of v in the array."); #define ARRAY_ARRAY_COUNT_METHODDEF \ - {"count", array_array_count, METH_O, array_array_count__doc__}, + {"count", (PyCFunction)array_array_count, METH_O, array_array_count__doc__}, static PyObject * array_array_count_impl(arrayobject *self, PyObject *v); @@ -141,7 +141,7 @@ PyDoc_STRVAR(array_array_remove__doc__, "Remove the first occurrence of v in the array."); #define ARRAY_ARRAY_REMOVE_METHODDEF \ - {"remove", array_array_remove, METH_O, array_array_remove__doc__}, + {"remove", (PyCFunction)array_array_remove, METH_O, array_array_remove__doc__}, static PyObject * array_array_remove_impl(arrayobject *self, PyObject *v); @@ -296,7 +296,7 @@ PyDoc_STRVAR(array_array_buffer_info__doc__, "the buffer length in bytes."); #define ARRAY_ARRAY_BUFFER_INFO_METHODDEF \ - {"buffer_info", array_array_buffer_info, METH_NOARGS, array_array_buffer_info__doc__}, + {"buffer_info", (PyCFunction)array_array_buffer_info, METH_NOARGS, array_array_buffer_info__doc__}, static PyObject * array_array_buffer_info_impl(arrayobject *self); @@ -314,7 +314,7 @@ PyDoc_STRVAR(array_array_append__doc__, "Append new value v to the end of the array."); #define ARRAY_ARRAY_APPEND_METHODDEF \ - {"append", array_array_append, METH_O, array_array_append__doc__}, + {"append", (PyCFunction)array_array_append, METH_O, array_array_append__doc__}, static PyObject * array_array_append_impl(arrayobject *self, PyObject *v); @@ -339,7 +339,7 @@ PyDoc_STRVAR(array_array_byteswap__doc__, "raised."); #define ARRAY_ARRAY_BYTESWAP_METHODDEF \ - {"byteswap", array_array_byteswap, METH_NOARGS, array_array_byteswap__doc__}, + {"byteswap", (PyCFunction)array_array_byteswap, METH_NOARGS, array_array_byteswap__doc__}, static PyObject * array_array_byteswap_impl(arrayobject *self); @@ -357,7 +357,7 @@ PyDoc_STRVAR(array_array_reverse__doc__, "Reverse the order of the items in the array."); #define ARRAY_ARRAY_REVERSE_METHODDEF \ - {"reverse", array_array_reverse, METH_NOARGS, array_array_reverse__doc__}, + {"reverse", (PyCFunction)array_array_reverse, METH_NOARGS, array_array_reverse__doc__}, static PyObject * array_array_reverse_impl(arrayobject *self); @@ -477,7 +477,7 @@ PyDoc_STRVAR(array_array_fromlist__doc__, "Append items to array from list."); #define ARRAY_ARRAY_FROMLIST_METHODDEF \ - {"fromlist", array_array_fromlist, METH_O, array_array_fromlist__doc__}, + {"fromlist", (PyCFunction)array_array_fromlist, METH_O, array_array_fromlist__doc__}, static PyObject * array_array_fromlist_impl(arrayobject *self, PyObject *list); @@ -499,7 +499,7 @@ PyDoc_STRVAR(array_array_tolist__doc__, "Convert array to an ordinary list with the same items."); #define ARRAY_ARRAY_TOLIST_METHODDEF \ - {"tolist", array_array_tolist, METH_NOARGS, array_array_tolist__doc__}, + {"tolist", (PyCFunction)array_array_tolist, METH_NOARGS, array_array_tolist__doc__}, static PyObject * array_array_tolist_impl(arrayobject *self); @@ -517,7 +517,7 @@ PyDoc_STRVAR(array_array_frombytes__doc__, "Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method."); #define ARRAY_ARRAY_FROMBYTES_METHODDEF \ - {"frombytes", array_array_frombytes, METH_O, array_array_frombytes__doc__}, + {"frombytes", (PyCFunction)array_array_frombytes, METH_O, array_array_frombytes__doc__}, static PyObject * array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer); @@ -549,7 +549,7 @@ PyDoc_STRVAR(array_array_tobytes__doc__, "Convert the array to an array of machine values and return the bytes representation."); #define ARRAY_ARRAY_TOBYTES_METHODDEF \ - {"tobytes", array_array_tobytes, METH_NOARGS, array_array_tobytes__doc__}, + {"tobytes", (PyCFunction)array_array_tobytes, METH_NOARGS, array_array_tobytes__doc__}, static PyObject * array_array_tobytes_impl(arrayobject *self); @@ -571,7 +571,7 @@ PyDoc_STRVAR(array_array_fromunicode__doc__, "some other type."); #define ARRAY_ARRAY_FROMUNICODE_METHODDEF \ - {"fromunicode", array_array_fromunicode, METH_O, array_array_fromunicode__doc__}, + {"fromunicode", (PyCFunction)array_array_fromunicode, METH_O, array_array_fromunicode__doc__}, static PyObject * array_array_fromunicode_impl(arrayobject *self, PyObject *ustr); @@ -604,7 +604,7 @@ PyDoc_STRVAR(array_array_tounicode__doc__, "unicode string from an array of some other type."); #define ARRAY_ARRAY_TOUNICODE_METHODDEF \ - {"tounicode", array_array_tounicode, METH_NOARGS, array_array_tounicode__doc__}, + {"tounicode", (PyCFunction)array_array_tounicode, METH_NOARGS, array_array_tounicode__doc__}, static PyObject * array_array_tounicode_impl(arrayobject *self); @@ -622,7 +622,7 @@ PyDoc_STRVAR(array_array___sizeof____doc__, "Size of the array in memory, in bytes."); #define ARRAY_ARRAY___SIZEOF___METHODDEF \ - {"__sizeof__", array_array___sizeof__, METH_NOARGS, array_array___sizeof____doc__}, + {"__sizeof__", (PyCFunction)array_array___sizeof__, METH_NOARGS, array_array___sizeof____doc__}, static PyObject * array_array___sizeof___impl(arrayobject *self); @@ -759,7 +759,7 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, "Set state information for unpickling."); #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ - {"__setstate__", array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, + {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, static PyObject * array_arrayiterator___setstate___impl(arrayiterobject *self, PyObject *state); @@ -773,4 +773,4 @@ array_arrayiterator___setstate__(PyObject *self, PyObject *state) return return_value; } -/*[clinic end generated code: output=88448cc228e01197 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dd49451ac1cc3f39 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h index b655f4d8d116bc..f81f12c388f373 100644 --- a/Modules/clinic/binascii.c.h +++ b/Modules/clinic/binascii.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(binascii_a2b_uu__doc__, "Decode a line of uuencoded data."); #define BINASCII_A2B_UU_METHODDEF \ - {"a2b_uu", binascii_a2b_uu, METH_O, binascii_a2b_uu__doc__}, + {"a2b_uu", (PyCFunction)binascii_a2b_uu, METH_O, binascii_a2b_uu__doc__}, static PyObject * binascii_a2b_uu_impl(PyObject *module, Py_buffer *data); @@ -548,7 +548,7 @@ PyDoc_STRVAR(binascii_a2b_hex__doc__, "This function is also available as \"unhexlify()\"."); #define BINASCII_A2B_HEX_METHODDEF \ - {"a2b_hex", binascii_a2b_hex, METH_O, binascii_a2b_hex__doc__}, + {"a2b_hex", (PyCFunction)binascii_a2b_hex, METH_O, binascii_a2b_hex__doc__}, static PyObject * binascii_a2b_hex_impl(PyObject *module, Py_buffer *hexstr); @@ -581,7 +581,7 @@ PyDoc_STRVAR(binascii_unhexlify__doc__, "hexstr must contain an even number of hex digits (upper or lower case)."); #define BINASCII_UNHEXLIFY_METHODDEF \ - {"unhexlify", binascii_unhexlify, METH_O, binascii_unhexlify__doc__}, + {"unhexlify", (PyCFunction)binascii_unhexlify, METH_O, binascii_unhexlify__doc__}, static PyObject * binascii_unhexlify_impl(PyObject *module, Py_buffer *hexstr); @@ -774,4 +774,4 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj return return_value; } -/*[clinic end generated code: output=6c6cb05b69d40658 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9ed7fbeec13c6606 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/blake2module.c.h b/Modules/clinic/blake2module.c.h index 8abb6eb071e234..9450334bd676ef 100644 --- a/Modules/clinic/blake2module.c.h +++ b/Modules/clinic/blake2module.c.h @@ -406,7 +406,7 @@ PyDoc_STRVAR(_blake2_blake2b_copy__doc__, "Return a copy of the hash object."); #define _BLAKE2_BLAKE2B_COPY_METHODDEF \ - {"copy", _blake2_blake2b_copy, METH_NOARGS, _blake2_blake2b_copy__doc__}, + {"copy", (PyCFunction)_blake2_blake2b_copy, METH_NOARGS, _blake2_blake2b_copy__doc__}, static PyObject * _blake2_blake2b_copy_impl(Blake2Object *self); @@ -424,7 +424,7 @@ PyDoc_STRVAR(_blake2_blake2b_update__doc__, "Update this hash object\'s state with the provided bytes-like object."); #define _BLAKE2_BLAKE2B_UPDATE_METHODDEF \ - {"update", _blake2_blake2b_update, METH_O, _blake2_blake2b_update__doc__}, + {"update", (PyCFunction)_blake2_blake2b_update, METH_O, _blake2_blake2b_update__doc__}, static PyObject * _blake2_blake2b_update_impl(Blake2Object *self, PyObject *data); @@ -446,7 +446,7 @@ PyDoc_STRVAR(_blake2_blake2b_digest__doc__, "Return the digest value as a bytes object."); #define _BLAKE2_BLAKE2B_DIGEST_METHODDEF \ - {"digest", _blake2_blake2b_digest, METH_NOARGS, _blake2_blake2b_digest__doc__}, + {"digest", (PyCFunction)_blake2_blake2b_digest, METH_NOARGS, _blake2_blake2b_digest__doc__}, static PyObject * _blake2_blake2b_digest_impl(Blake2Object *self); @@ -464,7 +464,7 @@ PyDoc_STRVAR(_blake2_blake2b_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define _BLAKE2_BLAKE2B_HEXDIGEST_METHODDEF \ - {"hexdigest", _blake2_blake2b_hexdigest, METH_NOARGS, _blake2_blake2b_hexdigest__doc__}, + {"hexdigest", (PyCFunction)_blake2_blake2b_hexdigest, METH_NOARGS, _blake2_blake2b_hexdigest__doc__}, static PyObject * _blake2_blake2b_hexdigest_impl(Blake2Object *self); @@ -474,4 +474,4 @@ _blake2_blake2b_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2b_hexdigest_impl((Blake2Object *)self); } -/*[clinic end generated code: output=ee76e3b8d44532e4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b286a0d1be8729b0 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/cmathmodule.c.h b/Modules/clinic/cmathmodule.c.h index 9ef8f42cdb45fc..16eaba7aa7ee39 100644 --- a/Modules/clinic/cmathmodule.c.h +++ b/Modules/clinic/cmathmodule.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(cmath_acos__doc__, "Return the arc cosine of z."); #define CMATH_ACOS_METHODDEF \ - {"acos", cmath_acos, METH_O, cmath_acos__doc__}, + {"acos", (PyCFunction)cmath_acos, METH_O, cmath_acos__doc__}, static Py_complex cmath_acos_impl(PyObject *module, Py_complex z); @@ -57,7 +57,7 @@ PyDoc_STRVAR(cmath_acosh__doc__, "Return the inverse hyperbolic cosine of z."); #define CMATH_ACOSH_METHODDEF \ - {"acosh", cmath_acosh, METH_O, cmath_acosh__doc__}, + {"acosh", (PyCFunction)cmath_acosh, METH_O, cmath_acosh__doc__}, static Py_complex cmath_acosh_impl(PyObject *module, Py_complex z); @@ -99,7 +99,7 @@ PyDoc_STRVAR(cmath_asin__doc__, "Return the arc sine of z."); #define CMATH_ASIN_METHODDEF \ - {"asin", cmath_asin, METH_O, cmath_asin__doc__}, + {"asin", (PyCFunction)cmath_asin, METH_O, cmath_asin__doc__}, static Py_complex cmath_asin_impl(PyObject *module, Py_complex z); @@ -141,7 +141,7 @@ PyDoc_STRVAR(cmath_asinh__doc__, "Return the inverse hyperbolic sine of z."); #define CMATH_ASINH_METHODDEF \ - {"asinh", cmath_asinh, METH_O, cmath_asinh__doc__}, + {"asinh", (PyCFunction)cmath_asinh, METH_O, cmath_asinh__doc__}, static Py_complex cmath_asinh_impl(PyObject *module, Py_complex z); @@ -183,7 +183,7 @@ PyDoc_STRVAR(cmath_atan__doc__, "Return the arc tangent of z."); #define CMATH_ATAN_METHODDEF \ - {"atan", cmath_atan, METH_O, cmath_atan__doc__}, + {"atan", (PyCFunction)cmath_atan, METH_O, cmath_atan__doc__}, static Py_complex cmath_atan_impl(PyObject *module, Py_complex z); @@ -225,7 +225,7 @@ PyDoc_STRVAR(cmath_atanh__doc__, "Return the inverse hyperbolic tangent of z."); #define CMATH_ATANH_METHODDEF \ - {"atanh", cmath_atanh, METH_O, cmath_atanh__doc__}, + {"atanh", (PyCFunction)cmath_atanh, METH_O, cmath_atanh__doc__}, static Py_complex cmath_atanh_impl(PyObject *module, Py_complex z); @@ -267,7 +267,7 @@ PyDoc_STRVAR(cmath_cos__doc__, "Return the cosine of z."); #define CMATH_COS_METHODDEF \ - {"cos", cmath_cos, METH_O, cmath_cos__doc__}, + {"cos", (PyCFunction)cmath_cos, METH_O, cmath_cos__doc__}, static Py_complex cmath_cos_impl(PyObject *module, Py_complex z); @@ -309,7 +309,7 @@ PyDoc_STRVAR(cmath_cosh__doc__, "Return the hyperbolic cosine of z."); #define CMATH_COSH_METHODDEF \ - {"cosh", cmath_cosh, METH_O, cmath_cosh__doc__}, + {"cosh", (PyCFunction)cmath_cosh, METH_O, cmath_cosh__doc__}, static Py_complex cmath_cosh_impl(PyObject *module, Py_complex z); @@ -351,7 +351,7 @@ PyDoc_STRVAR(cmath_exp__doc__, "Return the exponential value e**z."); #define CMATH_EXP_METHODDEF \ - {"exp", cmath_exp, METH_O, cmath_exp__doc__}, + {"exp", (PyCFunction)cmath_exp, METH_O, cmath_exp__doc__}, static Py_complex cmath_exp_impl(PyObject *module, Py_complex z); @@ -393,7 +393,7 @@ PyDoc_STRVAR(cmath_log10__doc__, "Return the base-10 logarithm of z."); #define CMATH_LOG10_METHODDEF \ - {"log10", cmath_log10, METH_O, cmath_log10__doc__}, + {"log10", (PyCFunction)cmath_log10, METH_O, cmath_log10__doc__}, static Py_complex cmath_log10_impl(PyObject *module, Py_complex z); @@ -435,7 +435,7 @@ PyDoc_STRVAR(cmath_sin__doc__, "Return the sine of z."); #define CMATH_SIN_METHODDEF \ - {"sin", cmath_sin, METH_O, cmath_sin__doc__}, + {"sin", (PyCFunction)cmath_sin, METH_O, cmath_sin__doc__}, static Py_complex cmath_sin_impl(PyObject *module, Py_complex z); @@ -477,7 +477,7 @@ PyDoc_STRVAR(cmath_sinh__doc__, "Return the hyperbolic sine of z."); #define CMATH_SINH_METHODDEF \ - {"sinh", cmath_sinh, METH_O, cmath_sinh__doc__}, + {"sinh", (PyCFunction)cmath_sinh, METH_O, cmath_sinh__doc__}, static Py_complex cmath_sinh_impl(PyObject *module, Py_complex z); @@ -519,7 +519,7 @@ PyDoc_STRVAR(cmath_sqrt__doc__, "Return the square root of z."); #define CMATH_SQRT_METHODDEF \ - {"sqrt", cmath_sqrt, METH_O, cmath_sqrt__doc__}, + {"sqrt", (PyCFunction)cmath_sqrt, METH_O, cmath_sqrt__doc__}, static Py_complex cmath_sqrt_impl(PyObject *module, Py_complex z); @@ -561,7 +561,7 @@ PyDoc_STRVAR(cmath_tan__doc__, "Return the tangent of z."); #define CMATH_TAN_METHODDEF \ - {"tan", cmath_tan, METH_O, cmath_tan__doc__}, + {"tan", (PyCFunction)cmath_tan, METH_O, cmath_tan__doc__}, static Py_complex cmath_tan_impl(PyObject *module, Py_complex z); @@ -603,7 +603,7 @@ PyDoc_STRVAR(cmath_tanh__doc__, "Return the hyperbolic tangent of z."); #define CMATH_TANH_METHODDEF \ - {"tanh", cmath_tanh, METH_O, cmath_tanh__doc__}, + {"tanh", (PyCFunction)cmath_tanh, METH_O, cmath_tanh__doc__}, static Py_complex cmath_tanh_impl(PyObject *module, Py_complex z); @@ -684,7 +684,7 @@ PyDoc_STRVAR(cmath_phase__doc__, "Return argument, also known as the phase angle, of a complex."); #define CMATH_PHASE_METHODDEF \ - {"phase", cmath_phase, METH_O, cmath_phase__doc__}, + {"phase", (PyCFunction)cmath_phase, METH_O, cmath_phase__doc__}, static PyObject * cmath_phase_impl(PyObject *module, Py_complex z); @@ -714,7 +714,7 @@ PyDoc_STRVAR(cmath_polar__doc__, "r is the distance from 0 and phi the phase angle."); #define CMATH_POLAR_METHODDEF \ - {"polar", cmath_polar, METH_O, cmath_polar__doc__}, + {"polar", (PyCFunction)cmath_polar, METH_O, cmath_polar__doc__}, static PyObject * cmath_polar_impl(PyObject *module, Py_complex z); @@ -790,7 +790,7 @@ PyDoc_STRVAR(cmath_isfinite__doc__, "Return True if both the real and imaginary parts of z are finite, else False."); #define CMATH_ISFINITE_METHODDEF \ - {"isfinite", cmath_isfinite, METH_O, cmath_isfinite__doc__}, + {"isfinite", (PyCFunction)cmath_isfinite, METH_O, cmath_isfinite__doc__}, static PyObject * cmath_isfinite_impl(PyObject *module, Py_complex z); @@ -818,7 +818,7 @@ PyDoc_STRVAR(cmath_isnan__doc__, "Checks if the real or imaginary part of z not a number (NaN)."); #define CMATH_ISNAN_METHODDEF \ - {"isnan", cmath_isnan, METH_O, cmath_isnan__doc__}, + {"isnan", (PyCFunction)cmath_isnan, METH_O, cmath_isnan__doc__}, static PyObject * cmath_isnan_impl(PyObject *module, Py_complex z); @@ -846,7 +846,7 @@ PyDoc_STRVAR(cmath_isinf__doc__, "Checks if the real or imaginary part of z is infinite."); #define CMATH_ISINF_METHODDEF \ - {"isinf", cmath_isinf, METH_O, cmath_isinf__doc__}, + {"isinf", (PyCFunction)cmath_isinf, METH_O, cmath_isinf__doc__}, static PyObject * cmath_isinf_impl(PyObject *module, Py_complex z); @@ -983,4 +983,4 @@ cmath_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=90e4f6fb7954daa5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5fda69f15dc9dfc9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/gcmodule.c.h b/Modules/clinic/gcmodule.c.h index 6698a71c395635..0147020bd483f9 100644 --- a/Modules/clinic/gcmodule.c.h +++ b/Modules/clinic/gcmodule.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(gc_enable__doc__, "Enable automatic garbage collection."); #define GC_ENABLE_METHODDEF \ - {"enable", gc_enable, METH_NOARGS, gc_enable__doc__}, + {"enable", (PyCFunction)gc_enable, METH_NOARGS, gc_enable__doc__}, static PyObject * gc_enable_impl(PyObject *module); @@ -35,7 +35,7 @@ PyDoc_STRVAR(gc_disable__doc__, "Disable automatic garbage collection."); #define GC_DISABLE_METHODDEF \ - {"disable", gc_disable, METH_NOARGS, gc_disable__doc__}, + {"disable", (PyCFunction)gc_disable, METH_NOARGS, gc_disable__doc__}, static PyObject * gc_disable_impl(PyObject *module); @@ -53,7 +53,7 @@ PyDoc_STRVAR(gc_isenabled__doc__, "Returns true if automatic garbage collection is enabled."); #define GC_ISENABLED_METHODDEF \ - {"isenabled", gc_isenabled, METH_NOARGS, gc_isenabled__doc__}, + {"isenabled", (PyCFunction)gc_isenabled, METH_NOARGS, gc_isenabled__doc__}, static int gc_isenabled_impl(PyObject *module); @@ -167,7 +167,7 @@ PyDoc_STRVAR(gc_set_debug__doc__, "Debugging information is written to sys.stderr."); #define GC_SET_DEBUG_METHODDEF \ - {"set_debug", gc_set_debug, METH_O, gc_set_debug__doc__}, + {"set_debug", (PyCFunction)gc_set_debug, METH_O, gc_set_debug__doc__}, static PyObject * gc_set_debug_impl(PyObject *module, int flags); @@ -195,7 +195,7 @@ PyDoc_STRVAR(gc_get_debug__doc__, "Get the garbage collection debugging flags."); #define GC_GET_DEBUG_METHODDEF \ - {"get_debug", gc_get_debug, METH_NOARGS, gc_get_debug__doc__}, + {"get_debug", (PyCFunction)gc_get_debug, METH_NOARGS, gc_get_debug__doc__}, static int gc_get_debug_impl(PyObject *module); @@ -223,7 +223,7 @@ PyDoc_STRVAR(gc_set_threshold__doc__, "Setting \'threshold0\' to zero disables collection."); #define GC_SET_THRESHOLD_METHODDEF \ - {"set_threshold", gc_set_threshold, METH_VARARGS, gc_set_threshold__doc__}, + {"set_threshold", (PyCFunction)gc_set_threshold, METH_VARARGS, gc_set_threshold__doc__}, static PyObject * gc_set_threshold_impl(PyObject *module, int threshold0, int group_right_1, @@ -275,7 +275,7 @@ PyDoc_STRVAR(gc_get_threshold__doc__, "Return the current collection thresholds."); #define GC_GET_THRESHOLD_METHODDEF \ - {"get_threshold", gc_get_threshold, METH_NOARGS, gc_get_threshold__doc__}, + {"get_threshold", (PyCFunction)gc_get_threshold, METH_NOARGS, gc_get_threshold__doc__}, static PyObject * gc_get_threshold_impl(PyObject *module); @@ -293,7 +293,7 @@ PyDoc_STRVAR(gc_get_count__doc__, "Return a three-tuple of the current collection counts."); #define GC_GET_COUNT_METHODDEF \ - {"get_count", gc_get_count, METH_NOARGS, gc_get_count__doc__}, + {"get_count", (PyCFunction)gc_get_count, METH_NOARGS, gc_get_count__doc__}, static PyObject * gc_get_count_impl(PyObject *module); @@ -442,7 +442,7 @@ PyDoc_STRVAR(gc_get_stats__doc__, "Return a list of dictionaries containing per-generation statistics."); #define GC_GET_STATS_METHODDEF \ - {"get_stats", gc_get_stats, METH_NOARGS, gc_get_stats__doc__}, + {"get_stats", (PyCFunction)gc_get_stats, METH_NOARGS, gc_get_stats__doc__}, static PyObject * gc_get_stats_impl(PyObject *module); @@ -462,7 +462,7 @@ PyDoc_STRVAR(gc_is_tracked__doc__, "Simple atomic objects will return false."); #define GC_IS_TRACKED_METHODDEF \ - {"is_tracked", gc_is_tracked, METH_O, gc_is_tracked__doc__}, + {"is_tracked", (PyCFunction)gc_is_tracked, METH_O, gc_is_tracked__doc__}, static int gc_is_tracked_impl(PyObject *module, PyObject *obj); @@ -490,7 +490,7 @@ PyDoc_STRVAR(gc_is_finalized__doc__, "Returns true if the object has been already finalized by the GC."); #define GC_IS_FINALIZED_METHODDEF \ - {"is_finalized", gc_is_finalized, METH_O, gc_is_finalized__doc__}, + {"is_finalized", (PyCFunction)gc_is_finalized, METH_O, gc_is_finalized__doc__}, static int gc_is_finalized_impl(PyObject *module, PyObject *obj); @@ -522,7 +522,7 @@ PyDoc_STRVAR(gc_freeze__doc__, "which can cause copy-on-write."); #define GC_FREEZE_METHODDEF \ - {"freeze", gc_freeze, METH_NOARGS, gc_freeze__doc__}, + {"freeze", (PyCFunction)gc_freeze, METH_NOARGS, gc_freeze__doc__}, static PyObject * gc_freeze_impl(PyObject *module); @@ -542,7 +542,7 @@ PyDoc_STRVAR(gc_unfreeze__doc__, "Put all objects in the permanent generation back into oldest generation."); #define GC_UNFREEZE_METHODDEF \ - {"unfreeze", gc_unfreeze, METH_NOARGS, gc_unfreeze__doc__}, + {"unfreeze", (PyCFunction)gc_unfreeze, METH_NOARGS, gc_unfreeze__doc__}, static PyObject * gc_unfreeze_impl(PyObject *module); @@ -560,7 +560,7 @@ PyDoc_STRVAR(gc_get_freeze_count__doc__, "Return the number of objects in the permanent generation."); #define GC_GET_FREEZE_COUNT_METHODDEF \ - {"get_freeze_count", gc_get_freeze_count, METH_NOARGS, gc_get_freeze_count__doc__}, + {"get_freeze_count", (PyCFunction)gc_get_freeze_count, METH_NOARGS, gc_get_freeze_count__doc__}, static Py_ssize_t gc_get_freeze_count_impl(PyObject *module); @@ -580,4 +580,4 @@ gc_get_freeze_count(PyObject *module, PyObject *Py_UNUSED(ignored)) exit: return return_value; } -/*[clinic end generated code: output=77b7d847ba2d4ed6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3e33248997e06c34 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/grpmodule.c.h b/Modules/clinic/grpmodule.c.h index 265d2de8fc422e..facfa3a43e490e 100644 --- a/Modules/clinic/grpmodule.c.h +++ b/Modules/clinic/grpmodule.c.h @@ -138,7 +138,7 @@ PyDoc_STRVAR(grp_getgrall__doc__, "to use YP/NIS and may not be accessible via getgrnam or getgrgid."); #define GRP_GETGRALL_METHODDEF \ - {"getgrall", grp_getgrall, METH_NOARGS, grp_getgrall__doc__}, + {"getgrall", (PyCFunction)grp_getgrall, METH_NOARGS, grp_getgrall__doc__}, static PyObject * grp_getgrall_impl(PyObject *module); @@ -148,4 +148,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored)) { return grp_getgrall_impl(module); } -/*[clinic end generated code: output=515460967fce87ed input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2154194308dab038 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/itertoolsmodule.c.h b/Modules/clinic/itertoolsmodule.c.h index a4df7bd2664651..401c87e846f501 100644 --- a/Modules/clinic/itertoolsmodule.c.h +++ b/Modules/clinic/itertoolsmodule.c.h @@ -484,7 +484,7 @@ PyDoc_STRVAR(itertools_chain_from_iterable__doc__, "Alternative chain() constructor taking a single iterable argument that evaluates lazily."); #define ITERTOOLS_CHAIN_FROM_ITERABLE_METHODDEF \ - {"from_iterable", itertools_chain_from_iterable, METH_O|METH_CLASS, itertools_chain_from_iterable__doc__}, + {"from_iterable", (PyCFunction)itertools_chain_from_iterable, METH_O|METH_CLASS, itertools_chain_from_iterable__doc__}, static PyObject * itertools_chain_from_iterable_impl(PyTypeObject *type, PyObject *arg); @@ -949,4 +949,4 @@ itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=95dd74389890ba45 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=688855b1dc77bf5a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h index 5328f8cd61c1d0..a76dde1eb4350e 100644 --- a/Modules/clinic/mathmodule.c.h +++ b/Modules/clinic/mathmodule.c.h @@ -71,7 +71,7 @@ PyDoc_STRVAR(math_ceil__doc__, "This is the smallest integer >= x."); #define MATH_CEIL_METHODDEF \ - {"ceil", math_ceil, METH_O, math_ceil__doc__}, + {"ceil", (PyCFunction)math_ceil, METH_O, math_ceil__doc__}, PyDoc_STRVAR(math_floor__doc__, "floor($module, x, /)\n" @@ -82,7 +82,7 @@ PyDoc_STRVAR(math_floor__doc__, "This is the largest integer <= x."); #define MATH_FLOOR_METHODDEF \ - {"floor", math_floor, METH_O, math_floor__doc__}, + {"floor", (PyCFunction)math_floor, METH_O, math_floor__doc__}, PyDoc_STRVAR(math_fsum__doc__, "fsum($module, seq, /)\n" @@ -93,7 +93,7 @@ PyDoc_STRVAR(math_fsum__doc__, "Assumes IEEE-754 floating-point arithmetic."); #define MATH_FSUM_METHODDEF \ - {"fsum", math_fsum, METH_O, math_fsum__doc__}, + {"fsum", (PyCFunction)math_fsum, METH_O, math_fsum__doc__}, PyDoc_STRVAR(math_isqrt__doc__, "isqrt($module, n, /)\n" @@ -102,7 +102,7 @@ PyDoc_STRVAR(math_isqrt__doc__, "Return the integer part of the square root of the input."); #define MATH_ISQRT_METHODDEF \ - {"isqrt", math_isqrt, METH_O, math_isqrt__doc__}, + {"isqrt", (PyCFunction)math_isqrt, METH_O, math_isqrt__doc__}, PyDoc_STRVAR(math_factorial__doc__, "factorial($module, n, /)\n" @@ -113,7 +113,7 @@ PyDoc_STRVAR(math_factorial__doc__, "Raise a ValueError if x is negative or non-integral."); #define MATH_FACTORIAL_METHODDEF \ - {"factorial", math_factorial, METH_O, math_factorial__doc__}, + {"factorial", (PyCFunction)math_factorial, METH_O, math_factorial__doc__}, PyDoc_STRVAR(math_trunc__doc__, "trunc($module, x, /)\n" @@ -124,7 +124,7 @@ PyDoc_STRVAR(math_trunc__doc__, "Uses the __trunc__ magic method."); #define MATH_TRUNC_METHODDEF \ - {"trunc", math_trunc, METH_O, math_trunc__doc__}, + {"trunc", (PyCFunction)math_trunc, METH_O, math_trunc__doc__}, PyDoc_STRVAR(math_frexp__doc__, "frexp($module, x, /)\n" @@ -136,7 +136,7 @@ PyDoc_STRVAR(math_frexp__doc__, "If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0."); #define MATH_FREXP_METHODDEF \ - {"frexp", math_frexp, METH_O, math_frexp__doc__}, + {"frexp", (PyCFunction)math_frexp, METH_O, math_frexp__doc__}, static PyObject * math_frexp_impl(PyObject *module, double x); @@ -213,7 +213,7 @@ PyDoc_STRVAR(math_modf__doc__, "Both results carry the sign of x and are floats."); #define MATH_MODF_METHODDEF \ - {"modf", math_modf, METH_O, math_modf__doc__}, + {"modf", (PyCFunction)math_modf, METH_O, math_modf__doc__}, static PyObject * math_modf_impl(PyObject *module, double x); @@ -247,7 +247,7 @@ PyDoc_STRVAR(math_log2__doc__, "Return the base 2 logarithm of x."); #define MATH_LOG2_METHODDEF \ - {"log2", math_log2, METH_O, math_log2__doc__}, + {"log2", (PyCFunction)math_log2, METH_O, math_log2__doc__}, PyDoc_STRVAR(math_log10__doc__, "log10($module, x, /)\n" @@ -256,7 +256,7 @@ PyDoc_STRVAR(math_log10__doc__, "Return the base 10 logarithm of x."); #define MATH_LOG10_METHODDEF \ - {"log10", math_log10, METH_O, math_log10__doc__}, + {"log10", (PyCFunction)math_log10, METH_O, math_log10__doc__}, PyDoc_STRVAR(math_fma__doc__, "fma($module, x, y, z, /)\n" @@ -535,7 +535,7 @@ PyDoc_STRVAR(math_degrees__doc__, "Convert angle x from radians to degrees."); #define MATH_DEGREES_METHODDEF \ - {"degrees", math_degrees, METH_O, math_degrees__doc__}, + {"degrees", (PyCFunction)math_degrees, METH_O, math_degrees__doc__}, static PyObject * math_degrees_impl(PyObject *module, double x); @@ -569,7 +569,7 @@ PyDoc_STRVAR(math_radians__doc__, "Convert angle x from degrees to radians."); #define MATH_RADIANS_METHODDEF \ - {"radians", math_radians, METH_O, math_radians__doc__}, + {"radians", (PyCFunction)math_radians, METH_O, math_radians__doc__}, static PyObject * math_radians_impl(PyObject *module, double x); @@ -603,7 +603,7 @@ PyDoc_STRVAR(math_isfinite__doc__, "Return True if x is neither an infinity nor a NaN, and False otherwise."); #define MATH_ISFINITE_METHODDEF \ - {"isfinite", math_isfinite, METH_O, math_isfinite__doc__}, + {"isfinite", (PyCFunction)math_isfinite, METH_O, math_isfinite__doc__}, static PyObject * math_isfinite_impl(PyObject *module, double x); @@ -637,7 +637,7 @@ PyDoc_STRVAR(math_isnan__doc__, "Return True if x is a NaN (not a number), and False otherwise."); #define MATH_ISNAN_METHODDEF \ - {"isnan", math_isnan, METH_O, math_isnan__doc__}, + {"isnan", (PyCFunction)math_isnan, METH_O, math_isnan__doc__}, static PyObject * math_isnan_impl(PyObject *module, double x); @@ -671,7 +671,7 @@ PyDoc_STRVAR(math_isinf__doc__, "Return True if x is a positive or negative infinity, and False otherwise."); #define MATH_ISINF_METHODDEF \ - {"isinf", math_isinf, METH_O, math_isinf__doc__}, + {"isinf", (PyCFunction)math_isinf, METH_O, math_isinf__doc__}, static PyObject * math_isinf_impl(PyObject *module, double x); @@ -1075,7 +1075,7 @@ PyDoc_STRVAR(math_ulp__doc__, "Return the value of the least significant bit of the float x."); #define MATH_ULP_METHODDEF \ - {"ulp", math_ulp, METH_O, math_ulp__doc__}, + {"ulp", (PyCFunction)math_ulp, METH_O, math_ulp__doc__}, static double math_ulp_impl(PyObject *module, double x); @@ -1106,4 +1106,4 @@ math_ulp(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=f4afeac249a582fe input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1ccb4b9f570d6dad input=a9049054013a1b77]*/ diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index e1cacc6787f0e5..fc42bfb61f59e1 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -37,7 +37,7 @@ PyDoc_STRVAR(MD5Type_digest__doc__, "Return the digest value as a bytes object."); #define MD5TYPE_DIGEST_METHODDEF \ - {"digest", MD5Type_digest, METH_NOARGS, MD5Type_digest__doc__}, + {"digest", (PyCFunction)MD5Type_digest, METH_NOARGS, MD5Type_digest__doc__}, static PyObject * MD5Type_digest_impl(MD5object *self); @@ -55,7 +55,7 @@ PyDoc_STRVAR(MD5Type_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define MD5TYPE_HEXDIGEST_METHODDEF \ - {"hexdigest", MD5Type_hexdigest, METH_NOARGS, MD5Type_hexdigest__doc__}, + {"hexdigest", (PyCFunction)MD5Type_hexdigest, METH_NOARGS, MD5Type_hexdigest__doc__}, static PyObject * MD5Type_hexdigest_impl(MD5object *self); @@ -73,7 +73,7 @@ PyDoc_STRVAR(MD5Type_update__doc__, "Update this hash object\'s state with the provided string."); #define MD5TYPE_UPDATE_METHODDEF \ - {"update", MD5Type_update, METH_O, MD5Type_update__doc__}, + {"update", (PyCFunction)MD5Type_update, METH_O, MD5Type_update__doc__}, static PyObject * MD5Type_update_impl(MD5object *self, PyObject *obj); @@ -162,4 +162,4 @@ _md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw exit: return return_value; } -/*[clinic end generated code: output=6b3d1a9abaf59b63 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=10db0ff2ecf97159 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/overlapped.c.h b/Modules/clinic/overlapped.c.h index 605cef238f41ea..7e5715660022c1 100644 --- a/Modules/clinic/overlapped.c.h +++ b/Modules/clinic/overlapped.c.h @@ -201,7 +201,7 @@ PyDoc_STRVAR(_overlapped_UnregisterWait__doc__, "Unregister wait handle."); #define _OVERLAPPED_UNREGISTERWAIT_METHODDEF \ - {"UnregisterWait", _overlapped_UnregisterWait, METH_O, _overlapped_UnregisterWait__doc__}, + {"UnregisterWait", (PyCFunction)_overlapped_UnregisterWait, METH_O, _overlapped_UnregisterWait__doc__}, static PyObject * _overlapped_UnregisterWait_impl(PyObject *module, HANDLE WaitHandle); @@ -326,7 +326,7 @@ PyDoc_STRVAR(_overlapped_SetEvent__doc__, "Set event."); #define _OVERLAPPED_SETEVENT_METHODDEF \ - {"SetEvent", _overlapped_SetEvent, METH_O, _overlapped_SetEvent__doc__}, + {"SetEvent", (PyCFunction)_overlapped_SetEvent, METH_O, _overlapped_SetEvent__doc__}, static PyObject * _overlapped_SetEvent_impl(PyObject *module, HANDLE Handle); @@ -354,7 +354,7 @@ PyDoc_STRVAR(_overlapped_ResetEvent__doc__, "Reset event."); #define _OVERLAPPED_RESETEVENT_METHODDEF \ - {"ResetEvent", _overlapped_ResetEvent, METH_O, _overlapped_ResetEvent__doc__}, + {"ResetEvent", (PyCFunction)_overlapped_ResetEvent, METH_O, _overlapped_ResetEvent__doc__}, static PyObject * _overlapped_ResetEvent_impl(PyObject *module, HANDLE Handle); @@ -420,7 +420,7 @@ PyDoc_STRVAR(_overlapped_FormatMessage__doc__, "Return error message for an error code."); #define _OVERLAPPED_FORMATMESSAGE_METHODDEF \ - {"FormatMessage", _overlapped_FormatMessage, METH_O, _overlapped_FormatMessage__doc__}, + {"FormatMessage", (PyCFunction)_overlapped_FormatMessage, METH_O, _overlapped_FormatMessage__doc__}, static PyObject * _overlapped_FormatMessage_impl(PyObject *module, DWORD code); @@ -510,7 +510,7 @@ PyDoc_STRVAR(_overlapped_Overlapped_cancel__doc__, "Cancel overlapped operation."); #define _OVERLAPPED_OVERLAPPED_CANCEL_METHODDEF \ - {"cancel", _overlapped_Overlapped_cancel, METH_NOARGS, _overlapped_Overlapped_cancel__doc__}, + {"cancel", (PyCFunction)_overlapped_Overlapped_cancel, METH_NOARGS, _overlapped_Overlapped_cancel__doc__}, static PyObject * _overlapped_Overlapped_cancel_impl(OverlappedObject *self); @@ -994,7 +994,7 @@ PyDoc_STRVAR(_overlapped_Overlapped_ConnectNamedPipe__doc__, "Start overlapped wait for a client to connect."); #define _OVERLAPPED_OVERLAPPED_CONNECTNAMEDPIPE_METHODDEF \ - {"ConnectNamedPipe", _overlapped_Overlapped_ConnectNamedPipe, METH_O, _overlapped_Overlapped_ConnectNamedPipe__doc__}, + {"ConnectNamedPipe", (PyCFunction)_overlapped_Overlapped_ConnectNamedPipe, METH_O, _overlapped_Overlapped_ConnectNamedPipe__doc__}, static PyObject * _overlapped_Overlapped_ConnectNamedPipe_impl(OverlappedObject *self, @@ -1023,7 +1023,7 @@ PyDoc_STRVAR(_overlapped_Overlapped_ConnectPipe__doc__, "Connect to the pipe for asynchronous I/O (overlapped)."); #define _OVERLAPPED_OVERLAPPED_CONNECTPIPE_METHODDEF \ - {"ConnectPipe", _overlapped_Overlapped_ConnectPipe, METH_O, _overlapped_Overlapped_ConnectPipe__doc__}, + {"ConnectPipe", (PyCFunction)_overlapped_Overlapped_ConnectPipe, METH_O, _overlapped_Overlapped_ConnectPipe__doc__}, static PyObject * _overlapped_Overlapped_ConnectPipe_impl(OverlappedObject *self, @@ -1240,4 +1240,4 @@ _overlapped_Overlapped_WSARecvFromInto(PyObject *self, PyObject *const *args, Py return return_value; } -/*[clinic end generated code: output=049ff4e0635ea636 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d009cc9e53d9732a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 61f9a7e9d64916..abeb9c3e3e12b1 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -321,7 +321,7 @@ PyDoc_STRVAR(os_ttyname__doc__, " Integer file descriptor handle."); #define OS_TTYNAME_METHODDEF \ - {"ttyname", os_ttyname, METH_O, os_ttyname__doc__}, + {"ttyname", (PyCFunction)os_ttyname, METH_O, os_ttyname__doc__}, static PyObject * os_ttyname_impl(PyObject *module, int fd); @@ -353,7 +353,7 @@ PyDoc_STRVAR(os_ctermid__doc__, "Return the name of the controlling terminal for this process."); #define OS_CTERMID_METHODDEF \ - {"ctermid", os_ctermid, METH_NOARGS, os_ctermid__doc__}, + {"ctermid", (PyCFunction)os_ctermid, METH_NOARGS, os_ctermid__doc__}, static PyObject * os_ctermid_impl(PyObject *module); @@ -1057,7 +1057,7 @@ PyDoc_STRVAR(os_sync__doc__, "Force write of everything to disk."); #define OS_SYNC_METHODDEF \ - {"sync", os_sync, METH_NOARGS, os_sync__doc__}, + {"sync", (PyCFunction)os_sync, METH_NOARGS, os_sync__doc__}, static PyObject * os_sync_impl(PyObject *module); @@ -1406,7 +1406,7 @@ PyDoc_STRVAR(os_getcwd__doc__, "Return a unicode string representing the current working directory."); #define OS_GETCWD_METHODDEF \ - {"getcwd", os_getcwd, METH_NOARGS, os_getcwd__doc__}, + {"getcwd", (PyCFunction)os_getcwd, METH_NOARGS, os_getcwd__doc__}, static PyObject * os_getcwd_impl(PyObject *module); @@ -1424,7 +1424,7 @@ PyDoc_STRVAR(os_getcwdb__doc__, "Return a bytes string representing the current working directory."); #define OS_GETCWDB_METHODDEF \ - {"getcwdb", os_getcwdb, METH_NOARGS, os_getcwdb__doc__}, + {"getcwdb", (PyCFunction)os_getcwdb, METH_NOARGS, os_getcwdb__doc__}, static PyObject * os_getcwdb_impl(PyObject *module); @@ -1634,7 +1634,7 @@ PyDoc_STRVAR(os_listdrives__doc__, "A drive name typically looks like \'C:\\\\\'."); #define OS_LISTDRIVES_METHODDEF \ - {"listdrives", os_listdrives, METH_NOARGS, os_listdrives__doc__}, + {"listdrives", (PyCFunction)os_listdrives, METH_NOARGS, os_listdrives__doc__}, static PyObject * os_listdrives_impl(PyObject *module); @@ -1658,7 +1658,7 @@ PyDoc_STRVAR(os_listvolumes__doc__, "Volumes are typically represented as a GUID path."); #define OS_LISTVOLUMES_METHODDEF \ - {"listvolumes", os_listvolumes, METH_NOARGS, os_listvolumes__doc__}, + {"listvolumes", (PyCFunction)os_listvolumes, METH_NOARGS, os_listvolumes__doc__}, static PyObject * os_listvolumes_impl(PyObject *module); @@ -1811,7 +1811,7 @@ PyDoc_STRVAR(os__getfullpathname__doc__, "\n"); #define OS__GETFULLPATHNAME_METHODDEF \ - {"_getfullpathname", os__getfullpathname, METH_O, os__getfullpathname__doc__}, + {"_getfullpathname", (PyCFunction)os__getfullpathname, METH_O, os__getfullpathname__doc__}, static PyObject * os__getfullpathname_impl(PyObject *module, path_t *path); @@ -1845,7 +1845,7 @@ PyDoc_STRVAR(os__getfinalpathname__doc__, "A helper function for samepath on windows."); #define OS__GETFINALPATHNAME_METHODDEF \ - {"_getfinalpathname", os__getfinalpathname, METH_O, os__getfinalpathname__doc__}, + {"_getfinalpathname", (PyCFunction)os__getfinalpathname, METH_O, os__getfinalpathname__doc__}, static PyObject * os__getfinalpathname_impl(PyObject *module, path_t *path); @@ -1879,7 +1879,7 @@ PyDoc_STRVAR(os__findfirstfile__doc__, "A function to get the real file name without accessing the file in Windows."); #define OS__FINDFIRSTFILE_METHODDEF \ - {"_findfirstfile", os__findfirstfile, METH_O, os__findfirstfile__doc__}, + {"_findfirstfile", (PyCFunction)os__findfirstfile, METH_O, os__findfirstfile__doc__}, static PyObject * os__findfirstfile_impl(PyObject *module, path_t *path); @@ -2679,7 +2679,7 @@ PyDoc_STRVAR(os_nice__doc__, "Add increment to the priority of process and return the new priority."); #define OS_NICE_METHODDEF \ - {"nice", os_nice, METH_O, os_nice__doc__}, + {"nice", (PyCFunction)os_nice, METH_O, os_nice__doc__}, static PyObject * os_nice_impl(PyObject *module, int increment); @@ -3256,7 +3256,7 @@ PyDoc_STRVAR(os_umask__doc__, "Set the current numeric umask and return the previous umask."); #define OS_UMASK_METHODDEF \ - {"umask", os_umask, METH_O, os_umask__doc__}, + {"umask", (PyCFunction)os_umask, METH_O, os_umask__doc__}, static PyObject * os_umask_impl(PyObject *module, int mask); @@ -3441,7 +3441,7 @@ PyDoc_STRVAR(os_uname__doc__, " (sysname, nodename, release, version, machine)"); #define OS_UNAME_METHODDEF \ - {"uname", os_uname, METH_NOARGS, os_uname__doc__}, + {"uname", (PyCFunction)os_uname, METH_NOARGS, os_uname__doc__}, static PyObject * os_uname_impl(PyObject *module); @@ -4267,7 +4267,7 @@ PyDoc_STRVAR(os_fork1__doc__, "Return 0 to child process and PID of child to parent process."); #define OS_FORK1_METHODDEF \ - {"fork1", os_fork1, METH_NOARGS, os_fork1__doc__}, + {"fork1", (PyCFunction)os_fork1, METH_NOARGS, os_fork1__doc__}, static PyObject * os_fork1_impl(PyObject *module); @@ -4291,7 +4291,7 @@ PyDoc_STRVAR(os_fork__doc__, "Return 0 to child process and PID of child to parent process."); #define OS_FORK_METHODDEF \ - {"fork", os_fork, METH_NOARGS, os_fork__doc__}, + {"fork", (PyCFunction)os_fork, METH_NOARGS, os_fork__doc__}, static PyObject * os_fork_impl(PyObject *module); @@ -4441,7 +4441,7 @@ PyDoc_STRVAR(os_sched_getscheduler__doc__, "Passing 0 for pid returns the scheduling policy for the calling process."); #define OS_SCHED_GETSCHEDULER_METHODDEF \ - {"sched_getscheduler", os_sched_getscheduler, METH_O, os_sched_getscheduler__doc__}, + {"sched_getscheduler", (PyCFunction)os_sched_getscheduler, METH_O, os_sched_getscheduler__doc__}, static PyObject * os_sched_getscheduler_impl(PyObject *module, pid_t pid); @@ -4584,7 +4584,7 @@ PyDoc_STRVAR(os_sched_getparam__doc__, "Return value is an instance of sched_param."); #define OS_SCHED_GETPARAM_METHODDEF \ - {"sched_getparam", os_sched_getparam, METH_O, os_sched_getparam__doc__}, + {"sched_getparam", (PyCFunction)os_sched_getparam, METH_O, os_sched_getparam__doc__}, static PyObject * os_sched_getparam_impl(PyObject *module, pid_t pid); @@ -4658,7 +4658,7 @@ PyDoc_STRVAR(os_sched_rr_get_interval__doc__, "Value returned is a float."); #define OS_SCHED_RR_GET_INTERVAL_METHODDEF \ - {"sched_rr_get_interval", os_sched_rr_get_interval, METH_O, os_sched_rr_get_interval__doc__}, + {"sched_rr_get_interval", (PyCFunction)os_sched_rr_get_interval, METH_O, os_sched_rr_get_interval__doc__}, static double os_sched_rr_get_interval_impl(PyObject *module, pid_t pid); @@ -4695,7 +4695,7 @@ PyDoc_STRVAR(os_sched_yield__doc__, "Voluntarily relinquish the CPU."); #define OS_SCHED_YIELD_METHODDEF \ - {"sched_yield", os_sched_yield, METH_NOARGS, os_sched_yield__doc__}, + {"sched_yield", (PyCFunction)os_sched_yield, METH_NOARGS, os_sched_yield__doc__}, static PyObject * os_sched_yield_impl(PyObject *module); @@ -4758,7 +4758,7 @@ PyDoc_STRVAR(os_sched_getaffinity__doc__, "The affinity is returned as a set of CPU identifiers."); #define OS_SCHED_GETAFFINITY_METHODDEF \ - {"sched_getaffinity", os_sched_getaffinity, METH_O, os_sched_getaffinity__doc__}, + {"sched_getaffinity", (PyCFunction)os_sched_getaffinity, METH_O, os_sched_getaffinity__doc__}, static PyObject * os_sched_getaffinity_impl(PyObject *module, pid_t pid); @@ -4794,7 +4794,7 @@ PyDoc_STRVAR(os_posix_openpt__doc__, "of posix_openpt() of your system."); #define OS_POSIX_OPENPT_METHODDEF \ - {"posix_openpt", os_posix_openpt, METH_O, os_posix_openpt__doc__}, + {"posix_openpt", (PyCFunction)os_posix_openpt, METH_O, os_posix_openpt__doc__}, static int os_posix_openpt_impl(PyObject *module, int oflag); @@ -4836,7 +4836,7 @@ PyDoc_STRVAR(os_grantpt__doc__, "Performs a grantpt() C function call."); #define OS_GRANTPT_METHODDEF \ - {"grantpt", os_grantpt, METH_O, os_grantpt__doc__}, + {"grantpt", (PyCFunction)os_grantpt, METH_O, os_grantpt__doc__}, static PyObject * os_grantpt_impl(PyObject *module, int fd); @@ -4873,7 +4873,7 @@ PyDoc_STRVAR(os_unlockpt__doc__, "Performs an unlockpt() C function call."); #define OS_UNLOCKPT_METHODDEF \ - {"unlockpt", os_unlockpt, METH_O, os_unlockpt__doc__}, + {"unlockpt", (PyCFunction)os_unlockpt, METH_O, os_unlockpt__doc__}, static PyObject * os_unlockpt_impl(PyObject *module, int fd); @@ -4911,7 +4911,7 @@ PyDoc_STRVAR(os_ptsname__doc__, "otherwise, performs a ptsname() C function call."); #define OS_PTSNAME_METHODDEF \ - {"ptsname", os_ptsname, METH_O, os_ptsname__doc__}, + {"ptsname", (PyCFunction)os_ptsname, METH_O, os_ptsname__doc__}, static PyObject * os_ptsname_impl(PyObject *module, int fd); @@ -4946,7 +4946,7 @@ PyDoc_STRVAR(os_openpty__doc__, "for both the master and slave ends."); #define OS_OPENPTY_METHODDEF \ - {"openpty", os_openpty, METH_NOARGS, os_openpty__doc__}, + {"openpty", (PyCFunction)os_openpty, METH_NOARGS, os_openpty__doc__}, static PyObject * os_openpty_impl(PyObject *module); @@ -4972,7 +4972,7 @@ PyDoc_STRVAR(os_login_tty__doc__, "calling process; close fd."); #define OS_LOGIN_TTY_METHODDEF \ - {"login_tty", os_login_tty, METH_O, os_login_tty__doc__}, + {"login_tty", (PyCFunction)os_login_tty, METH_O, os_login_tty__doc__}, static PyObject * os_login_tty_impl(PyObject *module, int fd); @@ -5009,7 +5009,7 @@ PyDoc_STRVAR(os_forkpty__doc__, "To both, return fd of newly opened pseudo-terminal."); #define OS_FORKPTY_METHODDEF \ - {"forkpty", os_forkpty, METH_NOARGS, os_forkpty__doc__}, + {"forkpty", (PyCFunction)os_forkpty, METH_NOARGS, os_forkpty__doc__}, static PyObject * os_forkpty_impl(PyObject *module); @@ -5031,7 +5031,7 @@ PyDoc_STRVAR(os_getegid__doc__, "Return the current process\'s effective group id."); #define OS_GETEGID_METHODDEF \ - {"getegid", os_getegid, METH_NOARGS, os_getegid__doc__}, + {"getegid", (PyCFunction)os_getegid, METH_NOARGS, os_getegid__doc__}, static PyObject * os_getegid_impl(PyObject *module); @@ -5053,7 +5053,7 @@ PyDoc_STRVAR(os_geteuid__doc__, "Return the current process\'s effective user id."); #define OS_GETEUID_METHODDEF \ - {"geteuid", os_geteuid, METH_NOARGS, os_geteuid__doc__}, + {"geteuid", (PyCFunction)os_geteuid, METH_NOARGS, os_geteuid__doc__}, static PyObject * os_geteuid_impl(PyObject *module); @@ -5075,7 +5075,7 @@ PyDoc_STRVAR(os_getgid__doc__, "Return the current process\'s group id."); #define OS_GETGID_METHODDEF \ - {"getgid", os_getgid, METH_NOARGS, os_getgid__doc__}, + {"getgid", (PyCFunction)os_getgid, METH_NOARGS, os_getgid__doc__}, static PyObject * os_getgid_impl(PyObject *module); @@ -5097,7 +5097,7 @@ PyDoc_STRVAR(os_getpid__doc__, "Return the current process id."); #define OS_GETPID_METHODDEF \ - {"getpid", os_getpid, METH_NOARGS, os_getpid__doc__}, + {"getpid", (PyCFunction)os_getpid, METH_NOARGS, os_getpid__doc__}, static PyObject * os_getpid_impl(PyObject *module); @@ -5226,7 +5226,7 @@ PyDoc_STRVAR(os_getgroups__doc__, "Return list of supplemental group IDs for the process."); #define OS_GETGROUPS_METHODDEF \ - {"getgroups", os_getgroups, METH_NOARGS, os_getgroups__doc__}, + {"getgroups", (PyCFunction)os_getgroups, METH_NOARGS, os_getgroups__doc__}, static PyObject * os_getgroups_impl(PyObject *module); @@ -5402,7 +5402,7 @@ PyDoc_STRVAR(os_getpgrp__doc__, "Return the current process group id."); #define OS_GETPGRP_METHODDEF \ - {"getpgrp", os_getpgrp, METH_NOARGS, os_getpgrp__doc__}, + {"getpgrp", (PyCFunction)os_getpgrp, METH_NOARGS, os_getpgrp__doc__}, static PyObject * os_getpgrp_impl(PyObject *module); @@ -5424,7 +5424,7 @@ PyDoc_STRVAR(os_setpgrp__doc__, "Make the current process the leader of its process group."); #define OS_SETPGRP_METHODDEF \ - {"setpgrp", os_setpgrp, METH_NOARGS, os_setpgrp__doc__}, + {"setpgrp", (PyCFunction)os_setpgrp, METH_NOARGS, os_setpgrp__doc__}, static PyObject * os_setpgrp_impl(PyObject *module); @@ -5449,7 +5449,7 @@ PyDoc_STRVAR(os_getppid__doc__, "return its id; others systems will return the id of the \'init\' process (1)."); #define OS_GETPPID_METHODDEF \ - {"getppid", os_getppid, METH_NOARGS, os_getppid__doc__}, + {"getppid", (PyCFunction)os_getppid, METH_NOARGS, os_getppid__doc__}, static PyObject * os_getppid_impl(PyObject *module); @@ -5471,7 +5471,7 @@ PyDoc_STRVAR(os_getlogin__doc__, "Return the actual login name."); #define OS_GETLOGIN_METHODDEF \ - {"getlogin", os_getlogin, METH_NOARGS, os_getlogin__doc__}, + {"getlogin", (PyCFunction)os_getlogin, METH_NOARGS, os_getlogin__doc__}, static PyObject * os_getlogin_impl(PyObject *module); @@ -5493,7 +5493,7 @@ PyDoc_STRVAR(os_getuid__doc__, "Return the current process\'s user id."); #define OS_GETUID_METHODDEF \ - {"getuid", os_getuid, METH_NOARGS, os_getuid__doc__}, + {"getuid", (PyCFunction)os_getuid, METH_NOARGS, os_getuid__doc__}, static PyObject * os_getuid_impl(PyObject *module); @@ -5603,7 +5603,7 @@ PyDoc_STRVAR(os_plock__doc__, "Lock program segments into memory.\");"); #define OS_PLOCK_METHODDEF \ - {"plock", os_plock, METH_O, os_plock__doc__}, + {"plock", (PyCFunction)os_plock, METH_O, os_plock__doc__}, static PyObject * os_plock_impl(PyObject *module, int op); @@ -5635,7 +5635,7 @@ PyDoc_STRVAR(os_setuid__doc__, "Set the current process\'s user id."); #define OS_SETUID_METHODDEF \ - {"setuid", os_setuid, METH_O, os_setuid__doc__}, + {"setuid", (PyCFunction)os_setuid, METH_O, os_setuid__doc__}, static PyObject * os_setuid_impl(PyObject *module, uid_t uid); @@ -5666,7 +5666,7 @@ PyDoc_STRVAR(os_seteuid__doc__, "Set the current process\'s effective user id."); #define OS_SETEUID_METHODDEF \ - {"seteuid", os_seteuid, METH_O, os_seteuid__doc__}, + {"seteuid", (PyCFunction)os_seteuid, METH_O, os_seteuid__doc__}, static PyObject * os_seteuid_impl(PyObject *module, uid_t euid); @@ -5697,7 +5697,7 @@ PyDoc_STRVAR(os_setegid__doc__, "Set the current process\'s effective group id."); #define OS_SETEGID_METHODDEF \ - {"setegid", os_setegid, METH_O, os_setegid__doc__}, + {"setegid", (PyCFunction)os_setegid, METH_O, os_setegid__doc__}, static PyObject * os_setegid_impl(PyObject *module, gid_t egid); @@ -5804,7 +5804,7 @@ PyDoc_STRVAR(os_setgid__doc__, "Set the current process\'s group id."); #define OS_SETGID_METHODDEF \ - {"setgid", os_setgid, METH_O, os_setgid__doc__}, + {"setgid", (PyCFunction)os_setgid, METH_O, os_setgid__doc__}, static PyObject * os_setgid_impl(PyObject *module, gid_t gid); @@ -5835,7 +5835,7 @@ PyDoc_STRVAR(os_setgroups__doc__, "Set the groups of the current process to list."); #define OS_SETGROUPS_METHODDEF \ - {"setgroups", os_setgroups, METH_O, os_setgroups__doc__}, + {"setgroups", (PyCFunction)os_setgroups, METH_O, os_setgroups__doc__}, #endif /* defined(HAVE_SETGROUPS) */ @@ -6133,7 +6133,7 @@ PyDoc_STRVAR(os_wait__doc__, " (pid, status)"); #define OS_WAIT_METHODDEF \ - {"wait", os_wait, METH_NOARGS, os_wait__doc__}, + {"wait", (PyCFunction)os_wait, METH_NOARGS, os_wait__doc__}, static PyObject * os_wait_impl(PyObject *module); @@ -6561,7 +6561,7 @@ PyDoc_STRVAR(os_times__doc__, "All fields are floating-point numbers."); #define OS_TIMES_METHODDEF \ - {"times", os_times, METH_NOARGS, os_times__doc__}, + {"times", (PyCFunction)os_times, METH_NOARGS, os_times__doc__}, static PyObject * os_times_impl(PyObject *module); @@ -6891,7 +6891,7 @@ PyDoc_STRVAR(os_timerfd_gettime__doc__, " A timer file descriptor."); #define OS_TIMERFD_GETTIME_METHODDEF \ - {"timerfd_gettime", os_timerfd_gettime, METH_O, os_timerfd_gettime__doc__}, + {"timerfd_gettime", (PyCFunction)os_timerfd_gettime, METH_O, os_timerfd_gettime__doc__}, static PyObject * os_timerfd_gettime_impl(PyObject *module, int fd); @@ -6926,7 +6926,7 @@ PyDoc_STRVAR(os_timerfd_gettime_ns__doc__, " A timer file descriptor."); #define OS_TIMERFD_GETTIME_NS_METHODDEF \ - {"timerfd_gettime_ns", os_timerfd_gettime_ns, METH_O, os_timerfd_gettime_ns__doc__}, + {"timerfd_gettime_ns", (PyCFunction)os_timerfd_gettime_ns, METH_O, os_timerfd_gettime_ns__doc__}, static PyObject * os_timerfd_gettime_ns_impl(PyObject *module, int fd); @@ -6958,7 +6958,7 @@ PyDoc_STRVAR(os_getsid__doc__, "Call the system call getsid(pid) and return the result."); #define OS_GETSID_METHODDEF \ - {"getsid", os_getsid, METH_O, os_getsid__doc__}, + {"getsid", (PyCFunction)os_getsid, METH_O, os_getsid__doc__}, static PyObject * os_getsid_impl(PyObject *module, pid_t pid); @@ -6990,7 +6990,7 @@ PyDoc_STRVAR(os_setsid__doc__, "Call the system call setsid()."); #define OS_SETSID_METHODDEF \ - {"setsid", os_setsid, METH_NOARGS, os_setsid__doc__}, + {"setsid", (PyCFunction)os_setsid, METH_NOARGS, os_setsid__doc__}, static PyObject * os_setsid_impl(PyObject *module); @@ -7052,7 +7052,7 @@ PyDoc_STRVAR(os_tcgetpgrp__doc__, "Return the process group associated with the terminal specified by fd."); #define OS_TCGETPGRP_METHODDEF \ - {"tcgetpgrp", os_tcgetpgrp, METH_O, os_tcgetpgrp__doc__}, + {"tcgetpgrp", (PyCFunction)os_tcgetpgrp, METH_O, os_tcgetpgrp__doc__}, static PyObject * os_tcgetpgrp_impl(PyObject *module, int fd); @@ -7316,7 +7316,7 @@ PyDoc_STRVAR(os_dup__doc__, "Return a duplicate of a file descriptor."); #define OS_DUP_METHODDEF \ - {"dup", os_dup, METH_O, os_dup__doc__}, + {"dup", (PyCFunction)os_dup, METH_O, os_dup__doc__}, static int os_dup_impl(PyObject *module, int fd); @@ -8269,7 +8269,7 @@ PyDoc_STRVAR(os_isatty__doc__, "connected to the slave end of a terminal."); #define OS_ISATTY_METHODDEF \ - {"isatty", os_isatty, METH_O, os_isatty__doc__}, + {"isatty", (PyCFunction)os_isatty, METH_O, os_isatty__doc__}, static int os_isatty_impl(PyObject *module, int fd); @@ -8307,7 +8307,7 @@ PyDoc_STRVAR(os_pipe__doc__, " (read_fd, write_fd)"); #define OS_PIPE_METHODDEF \ - {"pipe", os_pipe, METH_NOARGS, os_pipe__doc__}, + {"pipe", (PyCFunction)os_pipe, METH_NOARGS, os_pipe__doc__}, static PyObject * os_pipe_impl(PyObject *module); @@ -8335,7 +8335,7 @@ PyDoc_STRVAR(os_pipe2__doc__, "O_NONBLOCK, O_CLOEXEC."); #define OS_PIPE2_METHODDEF \ - {"pipe2", os_pipe2, METH_O, os_pipe2__doc__}, + {"pipe2", (PyCFunction)os_pipe2, METH_O, os_pipe2__doc__}, static PyObject * os_pipe2_impl(PyObject *module, int flags); @@ -8978,7 +8978,7 @@ PyDoc_STRVAR(os_major__doc__, "Extracts a device major number from a raw device number."); #define OS_MAJOR_METHODDEF \ - {"major", os_major, METH_O, os_major__doc__}, + {"major", (PyCFunction)os_major, METH_O, os_major__doc__}, static PyObject * os_major_impl(PyObject *module, dev_t device); @@ -9009,7 +9009,7 @@ PyDoc_STRVAR(os_minor__doc__, "Extracts a device minor number from a raw device number."); #define OS_MINOR_METHODDEF \ - {"minor", os_minor, METH_O, os_minor__doc__}, + {"minor", (PyCFunction)os_minor, METH_O, os_minor__doc__}, static PyObject * os_minor_impl(PyObject *module, dev_t device); @@ -9383,7 +9383,7 @@ PyDoc_STRVAR(os_unsetenv__doc__, "Delete an environment variable."); #define OS_UNSETENV_METHODDEF \ - {"unsetenv", os_unsetenv, METH_O, os_unsetenv__doc__}, + {"unsetenv", (PyCFunction)os_unsetenv, METH_O, os_unsetenv__doc__}, static PyObject * os_unsetenv_impl(PyObject *module, PyObject *name); @@ -9416,7 +9416,7 @@ PyDoc_STRVAR(os_unsetenv__doc__, "Delete an environment variable."); #define OS_UNSETENV_METHODDEF \ - {"unsetenv", os_unsetenv, METH_O, os_unsetenv__doc__}, + {"unsetenv", (PyCFunction)os_unsetenv, METH_O, os_unsetenv__doc__}, static PyObject * os_unsetenv_impl(PyObject *module, PyObject *name); @@ -9448,7 +9448,7 @@ PyDoc_STRVAR(os_strerror__doc__, "Translate an error code to a message string."); #define OS_STRERROR_METHODDEF \ - {"strerror", os_strerror, METH_O, os_strerror__doc__}, + {"strerror", (PyCFunction)os_strerror, METH_O, os_strerror__doc__}, static PyObject * os_strerror_impl(PyObject *module, int code); @@ -9478,7 +9478,7 @@ PyDoc_STRVAR(os_WCOREDUMP__doc__, "Return True if the process returning status was dumped to a core file."); #define OS_WCOREDUMP_METHODDEF \ - {"WCOREDUMP", os_WCOREDUMP, METH_O, os_WCOREDUMP__doc__}, + {"WCOREDUMP", (PyCFunction)os_WCOREDUMP, METH_O, os_WCOREDUMP__doc__}, static int os_WCOREDUMP_impl(PyObject *module, int status); @@ -9996,7 +9996,7 @@ PyDoc_STRVAR(os_fstatvfs__doc__, "Equivalent to statvfs(fd)."); #define OS_FSTATVFS_METHODDEF \ - {"fstatvfs", os_fstatvfs, METH_O, os_fstatvfs__doc__}, + {"fstatvfs", (PyCFunction)os_fstatvfs, METH_O, os_fstatvfs__doc__}, static PyObject * os_fstatvfs_impl(PyObject *module, int fd); @@ -10286,7 +10286,7 @@ PyDoc_STRVAR(os_confstr__doc__, "Return a string-valued system configuration variable."); #define OS_CONFSTR_METHODDEF \ - {"confstr", os_confstr, METH_O, os_confstr__doc__}, + {"confstr", (PyCFunction)os_confstr, METH_O, os_confstr__doc__}, static PyObject * os_confstr_impl(PyObject *module, int name); @@ -10317,7 +10317,7 @@ PyDoc_STRVAR(os_sysconf__doc__, "Return an integer-valued system configuration variable."); #define OS_SYSCONF_METHODDEF \ - {"sysconf", os_sysconf, METH_O, os_sysconf__doc__}, + {"sysconf", (PyCFunction)os_sysconf, METH_O, os_sysconf__doc__}, static long os_sysconf_impl(PyObject *module, int name); @@ -10354,7 +10354,7 @@ PyDoc_STRVAR(os_abort__doc__, "on the hosting operating system. This function never returns."); #define OS_ABORT_METHODDEF \ - {"abort", os_abort, METH_NOARGS, os_abort__doc__}, + {"abort", (PyCFunction)os_abort, METH_NOARGS, os_abort__doc__}, static PyObject * os_abort_impl(PyObject *module); @@ -10524,7 +10524,7 @@ PyDoc_STRVAR(os_getloadavg__doc__, "Raises OSError if the load average was unobtainable."); #define OS_GETLOADAVG_METHODDEF \ - {"getloadavg", os_getloadavg, METH_NOARGS, os_getloadavg__doc__}, + {"getloadavg", (PyCFunction)os_getloadavg, METH_NOARGS, os_getloadavg__doc__}, static PyObject * os_getloadavg_impl(PyObject *module); @@ -10692,7 +10692,7 @@ PyDoc_STRVAR(os_getresuid__doc__, "Return a tuple of the current process\'s real, effective, and saved user ids."); #define OS_GETRESUID_METHODDEF \ - {"getresuid", os_getresuid, METH_NOARGS, os_getresuid__doc__}, + {"getresuid", (PyCFunction)os_getresuid, METH_NOARGS, os_getresuid__doc__}, static PyObject * os_getresuid_impl(PyObject *module); @@ -10714,7 +10714,7 @@ PyDoc_STRVAR(os_getresgid__doc__, "Return a tuple of the current process\'s real, effective, and saved group ids."); #define OS_GETRESGID_METHODDEF \ - {"getresgid", os_getresgid, METH_NOARGS, os_getresgid__doc__}, + {"getresgid", (PyCFunction)os_getresgid, METH_NOARGS, os_getresgid__doc__}, static PyObject * os_getresgid_impl(PyObject *module); @@ -11108,7 +11108,7 @@ PyDoc_STRVAR(os_urandom__doc__, "Return a bytes object containing random bytes suitable for cryptographic use."); #define OS_URANDOM_METHODDEF \ - {"urandom", os_urandom, METH_O, os_urandom__doc__}, + {"urandom", (PyCFunction)os_urandom, METH_O, os_urandom__doc__}, static PyObject * os_urandom_impl(PyObject *module, Py_ssize_t size); @@ -11473,7 +11473,7 @@ PyDoc_STRVAR(os_cpu_count__doc__, "Return None if indeterminable."); #define OS_CPU_COUNT_METHODDEF \ - {"cpu_count", os_cpu_count, METH_NOARGS, os_cpu_count__doc__}, + {"cpu_count", (PyCFunction)os_cpu_count, METH_NOARGS, os_cpu_count__doc__}, static PyObject * os_cpu_count_impl(PyObject *module); @@ -11491,7 +11491,7 @@ PyDoc_STRVAR(os_get_inheritable__doc__, "Get the close-on-exe flag of the specified file descriptor."); #define OS_GET_INHERITABLE_METHODDEF \ - {"get_inheritable", os_get_inheritable, METH_O, os_get_inheritable__doc__}, + {"get_inheritable", (PyCFunction)os_get_inheritable, METH_O, os_get_inheritable__doc__}, static int os_get_inheritable_impl(PyObject *module, int fd); @@ -11562,7 +11562,7 @@ PyDoc_STRVAR(os_get_handle_inheritable__doc__, "Get the close-on-exe flag of the specified file descriptor."); #define OS_GET_HANDLE_INHERITABLE_METHODDEF \ - {"get_handle_inheritable", os_get_handle_inheritable, METH_O, os_get_handle_inheritable__doc__}, + {"get_handle_inheritable", (PyCFunction)os_get_handle_inheritable, METH_O, os_get_handle_inheritable__doc__}, static int os_get_handle_inheritable_impl(PyObject *module, intptr_t handle); @@ -11640,7 +11640,7 @@ PyDoc_STRVAR(os_get_blocking__doc__, "Return False if the O_NONBLOCK flag is set, True if the flag is cleared."); #define OS_GET_BLOCKING_METHODDEF \ - {"get_blocking", os_get_blocking, METH_O, os_get_blocking__doc__}, + {"get_blocking", (PyCFunction)os_get_blocking, METH_O, os_get_blocking__doc__}, static int os_get_blocking_impl(PyObject *module, int fd); @@ -11744,7 +11744,7 @@ PyDoc_STRVAR(os_DirEntry_is_junction__doc__, "Return True if the entry is a junction; cached per entry."); #define OS_DIRENTRY_IS_JUNCTION_METHODDEF \ - {"is_junction", os_DirEntry_is_junction, METH_NOARGS, os_DirEntry_is_junction__doc__}, + {"is_junction", (PyCFunction)os_DirEntry_is_junction, METH_NOARGS, os_DirEntry_is_junction__doc__}, static int os_DirEntry_is_junction_impl(DirEntry *self); @@ -11977,7 +11977,7 @@ PyDoc_STRVAR(os_DirEntry_inode__doc__, "Return inode of the entry; cached per entry."); #define OS_DIRENTRY_INODE_METHODDEF \ - {"inode", os_DirEntry_inode, METH_NOARGS, os_DirEntry_inode__doc__}, + {"inode", (PyCFunction)os_DirEntry_inode, METH_NOARGS, os_DirEntry_inode__doc__}, static PyObject * os_DirEntry_inode_impl(DirEntry *self); @@ -11995,7 +11995,7 @@ PyDoc_STRVAR(os_DirEntry___fspath____doc__, "Returns the path for the entry."); #define OS_DIRENTRY___FSPATH___METHODDEF \ - {"__fspath__", os_DirEntry___fspath__, METH_NOARGS, os_DirEntry___fspath____doc__}, + {"__fspath__", (PyCFunction)os_DirEntry___fspath__, METH_NOARGS, os_DirEntry___fspath____doc__}, static PyObject * os_DirEntry___fspath___impl(DirEntry *self); @@ -12436,7 +12436,7 @@ PyDoc_STRVAR(os__supports_virtual_terminal__doc__, "Checks if virtual terminal is supported in windows"); #define OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF \ - {"_supports_virtual_terminal", os__supports_virtual_terminal, METH_NOARGS, os__supports_virtual_terminal__doc__}, + {"_supports_virtual_terminal", (PyCFunction)os__supports_virtual_terminal, METH_NOARGS, os__supports_virtual_terminal__doc__}, static PyObject * os__supports_virtual_terminal_impl(PyObject *module); @@ -12456,7 +12456,7 @@ PyDoc_STRVAR(os__inputhook__doc__, "Calls PyOS_CallInputHook droppong the GIL first"); #define OS__INPUTHOOK_METHODDEF \ - {"_inputhook", os__inputhook, METH_NOARGS, os__inputhook__doc__}, + {"_inputhook", (PyCFunction)os__inputhook, METH_NOARGS, os__inputhook__doc__}, static PyObject * os__inputhook_impl(PyObject *module); @@ -12474,7 +12474,7 @@ PyDoc_STRVAR(os__is_inputhook_installed__doc__, "Checks if PyOS_CallInputHook is set"); #define OS__IS_INPUTHOOK_INSTALLED_METHODDEF \ - {"_is_inputhook_installed", os__is_inputhook_installed, METH_NOARGS, os__is_inputhook_installed__doc__}, + {"_is_inputhook_installed", (PyCFunction)os__is_inputhook_installed, METH_NOARGS, os__is_inputhook_installed__doc__}, static PyObject * os__is_inputhook_installed_impl(PyObject *module); @@ -12492,7 +12492,7 @@ PyDoc_STRVAR(os__create_environ__doc__, "Create the environment dictionary."); #define OS__CREATE_ENVIRON_METHODDEF \ - {"_create_environ", os__create_environ, METH_NOARGS, os__create_environ__doc__}, + {"_create_environ", (PyCFunction)os__create_environ, METH_NOARGS, os__create_environ__doc__}, static PyObject * os__create_environ_impl(PyObject *module); @@ -12512,7 +12512,7 @@ PyDoc_STRVAR(os__emscripten_debugger__doc__, "Create a breakpoint for the JavaScript debugger. Emscripten only."); #define OS__EMSCRIPTEN_DEBUGGER_METHODDEF \ - {"_emscripten_debugger", os__emscripten_debugger, METH_NOARGS, os__emscripten_debugger__doc__}, + {"_emscripten_debugger", (PyCFunction)os__emscripten_debugger, METH_NOARGS, os__emscripten_debugger__doc__}, static PyObject * os__emscripten_debugger_impl(PyObject *module); @@ -13196,4 +13196,4 @@ os__emscripten_debugger(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef OS__EMSCRIPTEN_DEBUGGER_METHODDEF #define OS__EMSCRIPTEN_DEBUGGER_METHODDEF #endif /* !defined(OS__EMSCRIPTEN_DEBUGGER_METHODDEF) */ -/*[clinic end generated code: output=4932a904020ead66 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8318c26fc2cd236c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pwdmodule.c.h b/Modules/clinic/pwdmodule.c.h index 9df6e27a123112..365d99aab1dd22 100644 --- a/Modules/clinic/pwdmodule.c.h +++ b/Modules/clinic/pwdmodule.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(pwd_getpwuid__doc__, "See `help(pwd)` for more on password database entries."); #define PWD_GETPWUID_METHODDEF \ - {"getpwuid", pwd_getpwuid, METH_O, pwd_getpwuid__doc__}, + {"getpwuid", (PyCFunction)pwd_getpwuid, METH_O, pwd_getpwuid__doc__}, PyDoc_STRVAR(pwd_getpwnam__doc__, "getpwnam($module, name, /)\n" @@ -22,7 +22,7 @@ PyDoc_STRVAR(pwd_getpwnam__doc__, "See `help(pwd)` for more on password database entries."); #define PWD_GETPWNAM_METHODDEF \ - {"getpwnam", pwd_getpwnam, METH_O, pwd_getpwnam__doc__}, + {"getpwnam", (PyCFunction)pwd_getpwnam, METH_O, pwd_getpwnam__doc__}, static PyObject * pwd_getpwnam_impl(PyObject *module, PyObject *name); @@ -55,7 +55,7 @@ PyDoc_STRVAR(pwd_getpwall__doc__, "See help(pwd) for more on password database entries."); #define PWD_GETPWALL_METHODDEF \ - {"getpwall", pwd_getpwall, METH_NOARGS, pwd_getpwall__doc__}, + {"getpwall", (PyCFunction)pwd_getpwall, METH_NOARGS, pwd_getpwall__doc__}, static PyObject * pwd_getpwall_impl(PyObject *module); @@ -71,4 +71,4 @@ pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef PWD_GETPWALL_METHODDEF #define PWD_GETPWALL_METHODDEF #endif /* !defined(PWD_GETPWALL_METHODDEF) */ -/*[clinic end generated code: output=5a1eea3e45743a34 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dac88d500f6d6f49 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index c68056ca548ec3..9eba59731c3fba 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_SetReparseDeferralEnabled__doc__, "Enable/Disable reparse deferral; enabled by default with Expat >=2.6.0."); #define PYEXPAT_XMLPARSER_SETREPARSEDEFERRALENABLED_METHODDEF \ - {"SetReparseDeferralEnabled", pyexpat_xmlparser_SetReparseDeferralEnabled, METH_O, pyexpat_xmlparser_SetReparseDeferralEnabled__doc__}, + {"SetReparseDeferralEnabled", (PyCFunction)pyexpat_xmlparser_SetReparseDeferralEnabled, METH_O, pyexpat_xmlparser_SetReparseDeferralEnabled__doc__}, static PyObject * pyexpat_xmlparser_SetReparseDeferralEnabled_impl(xmlparseobject *self, @@ -44,7 +44,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_GetReparseDeferralEnabled__doc__, "Retrieve reparse deferral enabled status; always returns false with Expat <2.6.0."); #define PYEXPAT_XMLPARSER_GETREPARSEDEFERRALENABLED_METHODDEF \ - {"GetReparseDeferralEnabled", pyexpat_xmlparser_GetReparseDeferralEnabled, METH_NOARGS, pyexpat_xmlparser_GetReparseDeferralEnabled__doc__}, + {"GetReparseDeferralEnabled", (PyCFunction)pyexpat_xmlparser_GetReparseDeferralEnabled, METH_NOARGS, pyexpat_xmlparser_GetReparseDeferralEnabled__doc__}, static PyObject * pyexpat_xmlparser_GetReparseDeferralEnabled_impl(xmlparseobject *self); @@ -163,7 +163,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_SetBase__doc__, "Set the base URL for the parser."); #define PYEXPAT_XMLPARSER_SETBASE_METHODDEF \ - {"SetBase", pyexpat_xmlparser_SetBase, METH_O, pyexpat_xmlparser_SetBase__doc__}, + {"SetBase", (PyCFunction)pyexpat_xmlparser_SetBase, METH_O, pyexpat_xmlparser_SetBase__doc__}, static PyObject * pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base); @@ -200,7 +200,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_GetBase__doc__, "Return base URL string for the parser."); #define PYEXPAT_XMLPARSER_GETBASE_METHODDEF \ - {"GetBase", pyexpat_xmlparser_GetBase, METH_NOARGS, pyexpat_xmlparser_GetBase__doc__}, + {"GetBase", (PyCFunction)pyexpat_xmlparser_GetBase, METH_NOARGS, pyexpat_xmlparser_GetBase__doc__}, static PyObject * pyexpat_xmlparser_GetBase_impl(xmlparseobject *self); @@ -221,7 +221,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_GetInputContext__doc__, "for an element with many attributes), not all of the text may be available."); #define PYEXPAT_XMLPARSER_GETINPUTCONTEXT_METHODDEF \ - {"GetInputContext", pyexpat_xmlparser_GetInputContext, METH_NOARGS, pyexpat_xmlparser_GetInputContext__doc__}, + {"GetInputContext", (PyCFunction)pyexpat_xmlparser_GetInputContext, METH_NOARGS, pyexpat_xmlparser_GetInputContext__doc__}, static PyObject * pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self); @@ -327,7 +327,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_SetParamEntityParsing__doc__, "was successful."); #define PYEXPAT_XMLPARSER_SETPARAMENTITYPARSING_METHODDEF \ - {"SetParamEntityParsing", pyexpat_xmlparser_SetParamEntityParsing, METH_O, pyexpat_xmlparser_SetParamEntityParsing__doc__}, + {"SetParamEntityParsing", (PyCFunction)pyexpat_xmlparser_SetParamEntityParsing, METH_O, pyexpat_xmlparser_SetParamEntityParsing__doc__}, static PyObject * pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag); @@ -526,7 +526,7 @@ PyDoc_STRVAR(pyexpat_ErrorString__doc__, "Returns string error for given number."); #define PYEXPAT_ERRORSTRING_METHODDEF \ - {"ErrorString", pyexpat_ErrorString, METH_O, pyexpat_ErrorString__doc__}, + {"ErrorString", (PyCFunction)pyexpat_ErrorString, METH_O, pyexpat_ErrorString__doc__}, static PyObject * pyexpat_ErrorString_impl(PyObject *module, long code); @@ -550,4 +550,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=65190af4649c6524 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7ee30ae5b666d0a8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/readline.c.h b/Modules/clinic/readline.c.h index e41d7b8213e692..696475f7d00f5b 100644 --- a/Modules/clinic/readline.c.h +++ b/Modules/clinic/readline.c.h @@ -12,7 +12,7 @@ PyDoc_STRVAR(readline_parse_and_bind__doc__, "Execute the init line provided in the string argument."); #define READLINE_PARSE_AND_BIND_METHODDEF \ - {"parse_and_bind", readline_parse_and_bind, METH_O, readline_parse_and_bind__doc__}, + {"parse_and_bind", (PyCFunction)readline_parse_and_bind, METH_O, readline_parse_and_bind__doc__}, static PyObject * readline_parse_and_bind_impl(PyObject *module, PyObject *string); @@ -192,7 +192,7 @@ PyDoc_STRVAR(readline_set_history_length__doc__, "A negative length is used to inhibit history truncation."); #define READLINE_SET_HISTORY_LENGTH_METHODDEF \ - {"set_history_length", readline_set_history_length, METH_O, readline_set_history_length__doc__}, + {"set_history_length", (PyCFunction)readline_set_history_length, METH_O, readline_set_history_length__doc__}, static PyObject * readline_set_history_length_impl(PyObject *module, int length); @@ -220,7 +220,7 @@ PyDoc_STRVAR(readline_get_history_length__doc__, "Return the maximum number of lines that will be written to the history file."); #define READLINE_GET_HISTORY_LENGTH_METHODDEF \ - {"get_history_length", readline_get_history_length, METH_NOARGS, readline_get_history_length__doc__}, + {"get_history_length", (PyCFunction)readline_get_history_length, METH_NOARGS, readline_get_history_length__doc__}, static PyObject * readline_get_history_length_impl(PyObject *module); @@ -356,7 +356,7 @@ PyDoc_STRVAR(readline_get_completion_type__doc__, "Get the type of completion being attempted."); #define READLINE_GET_COMPLETION_TYPE_METHODDEF \ - {"get_completion_type", readline_get_completion_type, METH_NOARGS, readline_get_completion_type__doc__}, + {"get_completion_type", (PyCFunction)readline_get_completion_type, METH_NOARGS, readline_get_completion_type__doc__}, static PyObject * readline_get_completion_type_impl(PyObject *module); @@ -374,7 +374,7 @@ PyDoc_STRVAR(readline_get_begidx__doc__, "Get the beginning index of the completion scope."); #define READLINE_GET_BEGIDX_METHODDEF \ - {"get_begidx", readline_get_begidx, METH_NOARGS, readline_get_begidx__doc__}, + {"get_begidx", (PyCFunction)readline_get_begidx, METH_NOARGS, readline_get_begidx__doc__}, static PyObject * readline_get_begidx_impl(PyObject *module); @@ -392,7 +392,7 @@ PyDoc_STRVAR(readline_get_endidx__doc__, "Get the ending index of the completion scope."); #define READLINE_GET_ENDIDX_METHODDEF \ - {"get_endidx", readline_get_endidx, METH_NOARGS, readline_get_endidx__doc__}, + {"get_endidx", (PyCFunction)readline_get_endidx, METH_NOARGS, readline_get_endidx__doc__}, static PyObject * readline_get_endidx_impl(PyObject *module); @@ -410,7 +410,7 @@ PyDoc_STRVAR(readline_set_completer_delims__doc__, "Set the word delimiters for completion."); #define READLINE_SET_COMPLETER_DELIMS_METHODDEF \ - {"set_completer_delims", readline_set_completer_delims, METH_O, readline_set_completer_delims__doc__}, + {"set_completer_delims", (PyCFunction)readline_set_completer_delims, METH_O, readline_set_completer_delims__doc__}, static PyObject * readline_set_completer_delims_impl(PyObject *module, PyObject *string); @@ -434,7 +434,7 @@ PyDoc_STRVAR(readline_remove_history_item__doc__, "Remove history item given by its zero-based position."); #define READLINE_REMOVE_HISTORY_ITEM_METHODDEF \ - {"remove_history_item", readline_remove_history_item, METH_O, readline_remove_history_item__doc__}, + {"remove_history_item", (PyCFunction)readline_remove_history_item, METH_O, readline_remove_history_item__doc__}, static PyObject * readline_remove_history_item_impl(PyObject *module, int entry_number); @@ -506,7 +506,7 @@ PyDoc_STRVAR(readline_add_history__doc__, "Add an item to the history buffer."); #define READLINE_ADD_HISTORY_METHODDEF \ - {"add_history", readline_add_history, METH_O, readline_add_history__doc__}, + {"add_history", (PyCFunction)readline_add_history, METH_O, readline_add_history__doc__}, static PyObject * readline_add_history_impl(PyObject *module, PyObject *string); @@ -530,7 +530,7 @@ PyDoc_STRVAR(readline_set_auto_history__doc__, "Enables or disables automatic history."); #define READLINE_SET_AUTO_HISTORY_METHODDEF \ - {"set_auto_history", readline_set_auto_history, METH_O, readline_set_auto_history__doc__}, + {"set_auto_history", (PyCFunction)readline_set_auto_history, METH_O, readline_set_auto_history__doc__}, static PyObject * readline_set_auto_history_impl(PyObject *module, @@ -559,7 +559,7 @@ PyDoc_STRVAR(readline_get_completer_delims__doc__, "Get the word delimiters for completion."); #define READLINE_GET_COMPLETER_DELIMS_METHODDEF \ - {"get_completer_delims", readline_get_completer_delims, METH_NOARGS, readline_get_completer_delims__doc__}, + {"get_completer_delims", (PyCFunction)readline_get_completer_delims, METH_NOARGS, readline_get_completer_delims__doc__}, static PyObject * readline_get_completer_delims_impl(PyObject *module); @@ -621,7 +621,7 @@ PyDoc_STRVAR(readline_get_completer__doc__, "Get the current completer function."); #define READLINE_GET_COMPLETER_METHODDEF \ - {"get_completer", readline_get_completer, METH_NOARGS, readline_get_completer__doc__}, + {"get_completer", (PyCFunction)readline_get_completer, METH_NOARGS, readline_get_completer__doc__}, static PyObject * readline_get_completer_impl(PyObject *module); @@ -639,7 +639,7 @@ PyDoc_STRVAR(readline_get_history_item__doc__, "Return the current contents of history item at one-based index."); #define READLINE_GET_HISTORY_ITEM_METHODDEF \ - {"get_history_item", readline_get_history_item, METH_O, readline_get_history_item__doc__}, + {"get_history_item", (PyCFunction)readline_get_history_item, METH_O, readline_get_history_item__doc__}, static PyObject * readline_get_history_item_impl(PyObject *module, int idx); @@ -669,7 +669,7 @@ PyDoc_STRVAR(readline_get_current_history_length__doc__, "Return the current (not the maximum) length of history."); #define READLINE_GET_CURRENT_HISTORY_LENGTH_METHODDEF \ - {"get_current_history_length", readline_get_current_history_length, METH_NOARGS, readline_get_current_history_length__doc__}, + {"get_current_history_length", (PyCFunction)readline_get_current_history_length, METH_NOARGS, readline_get_current_history_length__doc__}, static PyObject * readline_get_current_history_length_impl(PyObject *module); @@ -693,7 +693,7 @@ PyDoc_STRVAR(readline_get_line_buffer__doc__, "Return the current contents of the line buffer."); #define READLINE_GET_LINE_BUFFER_METHODDEF \ - {"get_line_buffer", readline_get_line_buffer, METH_NOARGS, readline_get_line_buffer__doc__}, + {"get_line_buffer", (PyCFunction)readline_get_line_buffer, METH_NOARGS, readline_get_line_buffer__doc__}, static PyObject * readline_get_line_buffer_impl(PyObject *module); @@ -719,7 +719,7 @@ PyDoc_STRVAR(readline_clear_history__doc__, "Clear the current readline history."); #define READLINE_CLEAR_HISTORY_METHODDEF \ - {"clear_history", readline_clear_history, METH_NOARGS, readline_clear_history__doc__}, + {"clear_history", (PyCFunction)readline_clear_history, METH_NOARGS, readline_clear_history__doc__}, static PyObject * readline_clear_history_impl(PyObject *module); @@ -745,7 +745,7 @@ PyDoc_STRVAR(readline_insert_text__doc__, "Insert text into the line buffer at the cursor position."); #define READLINE_INSERT_TEXT_METHODDEF \ - {"insert_text", readline_insert_text, METH_O, readline_insert_text__doc__}, + {"insert_text", (PyCFunction)readline_insert_text, METH_O, readline_insert_text__doc__}, static PyObject * readline_insert_text_impl(PyObject *module, PyObject *string); @@ -769,7 +769,7 @@ PyDoc_STRVAR(readline_redisplay__doc__, "Change what\'s displayed on the screen to reflect contents of the line buffer."); #define READLINE_REDISPLAY_METHODDEF \ - {"redisplay", readline_redisplay, METH_NOARGS, readline_redisplay__doc__}, + {"redisplay", (PyCFunction)readline_redisplay, METH_NOARGS, readline_redisplay__doc__}, static PyObject * readline_redisplay_impl(PyObject *module); @@ -797,4 +797,4 @@ readline_redisplay(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef READLINE_CLEAR_HISTORY_METHODDEF #define READLINE_CLEAR_HISTORY_METHODDEF #endif /* !defined(READLINE_CLEAR_HISTORY_METHODDEF) */ -/*[clinic end generated code: output=286b83300ba086c2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=88d9812b6caa2102 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/resource.c.h b/Modules/clinic/resource.c.h index 3e96cb78381395..9eda7de27532a1 100644 --- a/Modules/clinic/resource.c.h +++ b/Modules/clinic/resource.c.h @@ -10,7 +10,7 @@ PyDoc_STRVAR(resource_getrusage__doc__, "\n"); #define RESOURCE_GETRUSAGE_METHODDEF \ - {"getrusage", resource_getrusage, METH_O, resource_getrusage__doc__}, + {"getrusage", (PyCFunction)resource_getrusage, METH_O, resource_getrusage__doc__}, static PyObject * resource_getrusage_impl(PyObject *module, int who); @@ -39,7 +39,7 @@ PyDoc_STRVAR(resource_getrlimit__doc__, "\n"); #define RESOURCE_GETRLIMIT_METHODDEF \ - {"getrlimit", resource_getrlimit, METH_O, resource_getrlimit__doc__}, + {"getrlimit", (PyCFunction)resource_getrlimit, METH_O, resource_getrlimit__doc__}, static PyObject * resource_getrlimit_impl(PyObject *module, int resource); @@ -150,7 +150,7 @@ PyDoc_STRVAR(resource_getpagesize__doc__, "\n"); #define RESOURCE_GETPAGESIZE_METHODDEF \ - {"getpagesize", resource_getpagesize, METH_NOARGS, resource_getpagesize__doc__}, + {"getpagesize", (PyCFunction)resource_getpagesize, METH_NOARGS, resource_getpagesize__doc__}, static int resource_getpagesize_impl(PyObject *module); @@ -178,4 +178,4 @@ resource_getpagesize(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef RESOURCE_PRLIMIT_METHODDEF #define RESOURCE_PRLIMIT_METHODDEF #endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */ -/*[clinic end generated code: output=3d91aec3c1e3a374 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e45883ace510414a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/selectmodule.c.h b/Modules/clinic/selectmodule.c.h index 277a52d1bc92cb..8ee291dcca8b16 100644 --- a/Modules/clinic/selectmodule.c.h +++ b/Modules/clinic/selectmodule.c.h @@ -177,7 +177,7 @@ PyDoc_STRVAR(select_poll_unregister__doc__, "Remove a file descriptor being tracked by the polling object."); #define SELECT_POLL_UNREGISTER_METHODDEF \ - {"unregister", select_poll_unregister, METH_O, select_poll_unregister__doc__}, + {"unregister", (PyCFunction)select_poll_unregister, METH_O, select_poll_unregister__doc__}, static PyObject * select_poll_unregister_impl(pollObject *self, int fd); @@ -362,7 +362,7 @@ PyDoc_STRVAR(select_devpoll_unregister__doc__, "Remove a file descriptor being tracked by the polling object."); #define SELECT_DEVPOLL_UNREGISTER_METHODDEF \ - {"unregister", select_devpoll_unregister, METH_O, select_devpoll_unregister__doc__}, + {"unregister", (PyCFunction)select_devpoll_unregister, METH_O, select_devpoll_unregister__doc__}, static PyObject * select_devpoll_unregister_impl(devpollObject *self, int fd); @@ -443,7 +443,7 @@ PyDoc_STRVAR(select_devpoll_close__doc__, "Further operations on the devpoll object will raise an exception."); #define SELECT_DEVPOLL_CLOSE_METHODDEF \ - {"close", select_devpoll_close, METH_NOARGS, select_devpoll_close__doc__}, + {"close", (PyCFunction)select_devpoll_close, METH_NOARGS, select_devpoll_close__doc__}, static PyObject * select_devpoll_close_impl(devpollObject *self); @@ -471,7 +471,7 @@ PyDoc_STRVAR(select_devpoll_fileno__doc__, "Return the file descriptor."); #define SELECT_DEVPOLL_FILENO_METHODDEF \ - {"fileno", select_devpoll_fileno, METH_NOARGS, select_devpoll_fileno__doc__}, + {"fileno", (PyCFunction)select_devpoll_fileno, METH_NOARGS, select_devpoll_fileno__doc__}, static PyObject * select_devpoll_fileno_impl(devpollObject *self); @@ -502,7 +502,7 @@ PyDoc_STRVAR(select_poll__doc__, "polling them for I/O events."); #define SELECT_POLL_METHODDEF \ - {"poll", select_poll, METH_NOARGS, select_poll__doc__}, + {"poll", (PyCFunction)select_poll, METH_NOARGS, select_poll__doc__}, static PyObject * select_poll_impl(PyObject *module); @@ -527,7 +527,7 @@ PyDoc_STRVAR(select_devpoll__doc__, "polling them for I/O events."); #define SELECT_DEVPOLL_METHODDEF \ - {"devpoll", select_devpoll, METH_NOARGS, select_devpoll__doc__}, + {"devpoll", (PyCFunction)select_devpoll, METH_NOARGS, select_devpoll__doc__}, static PyObject * select_devpoll_impl(PyObject *module); @@ -637,7 +637,7 @@ PyDoc_STRVAR(select_epoll_close__doc__, "Further operations on the epoll object will raise an exception."); #define SELECT_EPOLL_CLOSE_METHODDEF \ - {"close", select_epoll_close, METH_NOARGS, select_epoll_close__doc__}, + {"close", (PyCFunction)select_epoll_close, METH_NOARGS, select_epoll_close__doc__}, static PyObject * select_epoll_close_impl(pyEpoll_Object *self); @@ -665,7 +665,7 @@ PyDoc_STRVAR(select_epoll_fileno__doc__, "Return the epoll control file descriptor."); #define SELECT_EPOLL_FILENO_METHODDEF \ - {"fileno", select_epoll_fileno, METH_NOARGS, select_epoll_fileno__doc__}, + {"fileno", (PyCFunction)select_epoll_fileno, METH_NOARGS, select_epoll_fileno__doc__}, static PyObject * select_epoll_fileno_impl(pyEpoll_Object *self); @@ -687,7 +687,7 @@ PyDoc_STRVAR(select_epoll_fromfd__doc__, "Create an epoll object from a given control fd."); #define SELECT_EPOLL_FROMFD_METHODDEF \ - {"fromfd", select_epoll_fromfd, METH_O|METH_CLASS, select_epoll_fromfd__doc__}, + {"fromfd", (PyCFunction)select_epoll_fromfd, METH_O|METH_CLASS, select_epoll_fromfd__doc__}, static PyObject * select_epoll_fromfd_impl(PyTypeObject *type, int fd); @@ -1025,7 +1025,7 @@ PyDoc_STRVAR(select_epoll___enter____doc__, "\n"); #define SELECT_EPOLL___ENTER___METHODDEF \ - {"__enter__", select_epoll___enter__, METH_NOARGS, select_epoll___enter____doc__}, + {"__enter__", (PyCFunction)select_epoll___enter__, METH_NOARGS, select_epoll___enter____doc__}, static PyObject * select_epoll___enter___impl(pyEpoll_Object *self); @@ -1140,7 +1140,7 @@ PyDoc_STRVAR(select_kqueue_close__doc__, "Further operations on the kqueue object will raise an exception."); #define SELECT_KQUEUE_CLOSE_METHODDEF \ - {"close", select_kqueue_close, METH_NOARGS, select_kqueue_close__doc__}, + {"close", (PyCFunction)select_kqueue_close, METH_NOARGS, select_kqueue_close__doc__}, static PyObject * select_kqueue_close_impl(kqueue_queue_Object *self); @@ -1168,7 +1168,7 @@ PyDoc_STRVAR(select_kqueue_fileno__doc__, "Return the kqueue control file descriptor."); #define SELECT_KQUEUE_FILENO_METHODDEF \ - {"fileno", select_kqueue_fileno, METH_NOARGS, select_kqueue_fileno__doc__}, + {"fileno", (PyCFunction)select_kqueue_fileno, METH_NOARGS, select_kqueue_fileno__doc__}, static PyObject * select_kqueue_fileno_impl(kqueue_queue_Object *self); @@ -1190,7 +1190,7 @@ PyDoc_STRVAR(select_kqueue_fromfd__doc__, "Create a kqueue object from a given control fd."); #define SELECT_KQUEUE_FROMFD_METHODDEF \ - {"fromfd", select_kqueue_fromfd, METH_O|METH_CLASS, select_kqueue_fromfd__doc__}, + {"fromfd", (PyCFunction)select_kqueue_fromfd, METH_O|METH_CLASS, select_kqueue_fromfd__doc__}, static PyObject * select_kqueue_fromfd_impl(PyTypeObject *type, int fd); @@ -1365,4 +1365,4 @@ select_kqueue_control(PyObject *self, PyObject *const *args, Py_ssize_t nargs) #ifndef SELECT_KQUEUE_CONTROL_METHODDEF #define SELECT_KQUEUE_CONTROL_METHODDEF #endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */ -/*[clinic end generated code: output=1a72074ea7c1b656 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=60c3edb2745c9f33 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index 1fd2a19974a00c..792059d9b89bb2 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -37,7 +37,7 @@ PyDoc_STRVAR(SHA1Type_digest__doc__, "Return the digest value as a bytes object."); #define SHA1TYPE_DIGEST_METHODDEF \ - {"digest", SHA1Type_digest, METH_NOARGS, SHA1Type_digest__doc__}, + {"digest", (PyCFunction)SHA1Type_digest, METH_NOARGS, SHA1Type_digest__doc__}, static PyObject * SHA1Type_digest_impl(SHA1object *self); @@ -55,7 +55,7 @@ PyDoc_STRVAR(SHA1Type_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define SHA1TYPE_HEXDIGEST_METHODDEF \ - {"hexdigest", SHA1Type_hexdigest, METH_NOARGS, SHA1Type_hexdigest__doc__}, + {"hexdigest", (PyCFunction)SHA1Type_hexdigest, METH_NOARGS, SHA1Type_hexdigest__doc__}, static PyObject * SHA1Type_hexdigest_impl(SHA1object *self); @@ -73,7 +73,7 @@ PyDoc_STRVAR(SHA1Type_update__doc__, "Update this hash object\'s state with the provided string."); #define SHA1TYPE_UPDATE_METHODDEF \ - {"update", SHA1Type_update, METH_O, SHA1Type_update__doc__}, + {"update", (PyCFunction)SHA1Type_update, METH_O, SHA1Type_update__doc__}, static PyObject * SHA1Type_update_impl(SHA1object *self, PyObject *obj); @@ -162,4 +162,4 @@ _sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * exit: return return_value; } -/*[clinic end generated code: output=a8844599cf058548 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3cfa7b6a9f99b5b2 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha2module.c.h b/Modules/clinic/sha2module.c.h index d776cbf0441af7..5e4b97b8ed3c1d 100644 --- a/Modules/clinic/sha2module.c.h +++ b/Modules/clinic/sha2module.c.h @@ -59,7 +59,7 @@ PyDoc_STRVAR(SHA256Type_digest__doc__, "Return the digest value as a bytes object."); #define SHA256TYPE_DIGEST_METHODDEF \ - {"digest", SHA256Type_digest, METH_NOARGS, SHA256Type_digest__doc__}, + {"digest", (PyCFunction)SHA256Type_digest, METH_NOARGS, SHA256Type_digest__doc__}, static PyObject * SHA256Type_digest_impl(SHA256object *self); @@ -77,7 +77,7 @@ PyDoc_STRVAR(SHA512Type_digest__doc__, "Return the digest value as a bytes object."); #define SHA512TYPE_DIGEST_METHODDEF \ - {"digest", SHA512Type_digest, METH_NOARGS, SHA512Type_digest__doc__}, + {"digest", (PyCFunction)SHA512Type_digest, METH_NOARGS, SHA512Type_digest__doc__}, static PyObject * SHA512Type_digest_impl(SHA512object *self); @@ -95,7 +95,7 @@ PyDoc_STRVAR(SHA256Type_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define SHA256TYPE_HEXDIGEST_METHODDEF \ - {"hexdigest", SHA256Type_hexdigest, METH_NOARGS, SHA256Type_hexdigest__doc__}, + {"hexdigest", (PyCFunction)SHA256Type_hexdigest, METH_NOARGS, SHA256Type_hexdigest__doc__}, static PyObject * SHA256Type_hexdigest_impl(SHA256object *self); @@ -113,7 +113,7 @@ PyDoc_STRVAR(SHA512Type_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define SHA512TYPE_HEXDIGEST_METHODDEF \ - {"hexdigest", SHA512Type_hexdigest, METH_NOARGS, SHA512Type_hexdigest__doc__}, + {"hexdigest", (PyCFunction)SHA512Type_hexdigest, METH_NOARGS, SHA512Type_hexdigest__doc__}, static PyObject * SHA512Type_hexdigest_impl(SHA512object *self); @@ -131,7 +131,7 @@ PyDoc_STRVAR(SHA256Type_update__doc__, "Update this hash object\'s state with the provided string."); #define SHA256TYPE_UPDATE_METHODDEF \ - {"update", SHA256Type_update, METH_O, SHA256Type_update__doc__}, + {"update", (PyCFunction)SHA256Type_update, METH_O, SHA256Type_update__doc__}, static PyObject * SHA256Type_update_impl(SHA256object *self, PyObject *obj); @@ -153,7 +153,7 @@ PyDoc_STRVAR(SHA512Type_update__doc__, "Update this hash object\'s state with the provided string."); #define SHA512TYPE_UPDATE_METHODDEF \ - {"update", SHA512Type_update, METH_O, SHA512Type_update__doc__}, + {"update", (PyCFunction)SHA512Type_update, METH_O, SHA512Type_update__doc__}, static PyObject * SHA512Type_update_impl(SHA512object *self, PyObject *obj); @@ -467,4 +467,4 @@ _sha2_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject exit: return return_value; } -/*[clinic end generated code: output=f056fc5485e0b4b4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0c2eed5c77ec6987 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha3module.c.h b/Modules/clinic/sha3module.c.h index 2aa344eb8869c9..98d8f10a96ee48 100644 --- a/Modules/clinic/sha3module.c.h +++ b/Modules/clinic/sha3module.c.h @@ -86,7 +86,7 @@ PyDoc_STRVAR(_sha3_sha3_224_copy__doc__, "Return a copy of the hash object."); #define _SHA3_SHA3_224_COPY_METHODDEF \ - {"copy", _sha3_sha3_224_copy, METH_NOARGS, _sha3_sha3_224_copy__doc__}, + {"copy", (PyCFunction)_sha3_sha3_224_copy, METH_NOARGS, _sha3_sha3_224_copy__doc__}, static PyObject * _sha3_sha3_224_copy_impl(SHA3object *self); @@ -104,7 +104,7 @@ PyDoc_STRVAR(_sha3_sha3_224_digest__doc__, "Return the digest value as a bytes object."); #define _SHA3_SHA3_224_DIGEST_METHODDEF \ - {"digest", _sha3_sha3_224_digest, METH_NOARGS, _sha3_sha3_224_digest__doc__}, + {"digest", (PyCFunction)_sha3_sha3_224_digest, METH_NOARGS, _sha3_sha3_224_digest__doc__}, static PyObject * _sha3_sha3_224_digest_impl(SHA3object *self); @@ -122,7 +122,7 @@ PyDoc_STRVAR(_sha3_sha3_224_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define _SHA3_SHA3_224_HEXDIGEST_METHODDEF \ - {"hexdigest", _sha3_sha3_224_hexdigest, METH_NOARGS, _sha3_sha3_224_hexdigest__doc__}, + {"hexdigest", (PyCFunction)_sha3_sha3_224_hexdigest, METH_NOARGS, _sha3_sha3_224_hexdigest__doc__}, static PyObject * _sha3_sha3_224_hexdigest_impl(SHA3object *self); @@ -140,7 +140,7 @@ PyDoc_STRVAR(_sha3_sha3_224_update__doc__, "Update this hash object\'s state with the provided bytes-like object."); #define _SHA3_SHA3_224_UPDATE_METHODDEF \ - {"update", _sha3_sha3_224_update, METH_O, _sha3_sha3_224_update__doc__}, + {"update", (PyCFunction)_sha3_sha3_224_update, METH_O, _sha3_sha3_224_update__doc__}, static PyObject * _sha3_sha3_224_update_impl(SHA3object *self, PyObject *data); @@ -162,7 +162,7 @@ PyDoc_STRVAR(_sha3_shake_128_digest__doc__, "Return the digest value as a bytes object."); #define _SHA3_SHAKE_128_DIGEST_METHODDEF \ - {"digest", _sha3_shake_128_digest, METH_O, _sha3_shake_128_digest__doc__}, + {"digest", (PyCFunction)_sha3_shake_128_digest, METH_O, _sha3_shake_128_digest__doc__}, static PyObject * _sha3_shake_128_digest_impl(SHA3object *self, unsigned long length); @@ -189,7 +189,7 @@ PyDoc_STRVAR(_sha3_shake_128_hexdigest__doc__, "Return the digest value as a string of hexadecimal digits."); #define _SHA3_SHAKE_128_HEXDIGEST_METHODDEF \ - {"hexdigest", _sha3_shake_128_hexdigest, METH_O, _sha3_shake_128_hexdigest__doc__}, + {"hexdigest", (PyCFunction)_sha3_shake_128_hexdigest, METH_O, _sha3_shake_128_hexdigest__doc__}, static PyObject * _sha3_shake_128_hexdigest_impl(SHA3object *self, unsigned long length); @@ -208,4 +208,4 @@ _sha3_shake_128_hexdigest(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=dc7dfb8a3a529719 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=437023d9eac08551 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index 9e3d72fc8755c6..dd8da456ce08ce 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -53,7 +53,7 @@ PyDoc_STRVAR(signal_alarm__doc__, "Arrange for SIGALRM to arrive after the given number of seconds."); #define SIGNAL_ALARM_METHODDEF \ - {"alarm", signal_alarm, METH_O, signal_alarm__doc__}, + {"alarm", (PyCFunction)signal_alarm, METH_O, signal_alarm__doc__}, static long signal_alarm_impl(PyObject *module, int seconds); @@ -90,7 +90,7 @@ PyDoc_STRVAR(signal_pause__doc__, "Wait until a signal arrives."); #define SIGNAL_PAUSE_METHODDEF \ - {"pause", signal_pause, METH_NOARGS, signal_pause__doc__}, + {"pause", (PyCFunction)signal_pause, METH_NOARGS, signal_pause__doc__}, static PyObject * signal_pause_impl(PyObject *module); @@ -110,7 +110,7 @@ PyDoc_STRVAR(signal_raise_signal__doc__, "Send a signal to the executing process."); #define SIGNAL_RAISE_SIGNAL_METHODDEF \ - {"raise_signal", signal_raise_signal, METH_O, signal_raise_signal__doc__}, + {"raise_signal", (PyCFunction)signal_raise_signal, METH_O, signal_raise_signal__doc__}, static PyObject * signal_raise_signal_impl(PyObject *module, int signalnum); @@ -184,7 +184,7 @@ PyDoc_STRVAR(signal_getsignal__doc__, " anything else -- the callable Python object used as a handler"); #define SIGNAL_GETSIGNAL_METHODDEF \ - {"getsignal", signal_getsignal, METH_O, signal_getsignal__doc__}, + {"getsignal", (PyCFunction)signal_getsignal, METH_O, signal_getsignal__doc__}, static PyObject * signal_getsignal_impl(PyObject *module, int signalnum); @@ -216,7 +216,7 @@ PyDoc_STRVAR(signal_strsignal__doc__, "description. Raises :exc:`ValueError` if *signalnum* is invalid."); #define SIGNAL_STRSIGNAL_METHODDEF \ - {"strsignal", signal_strsignal, METH_O, signal_strsignal__doc__}, + {"strsignal", (PyCFunction)signal_strsignal, METH_O, signal_strsignal__doc__}, static PyObject * signal_strsignal_impl(PyObject *module, int signalnum); @@ -410,7 +410,7 @@ PyDoc_STRVAR(signal_getitimer__doc__, "Returns current value of given itimer."); #define SIGNAL_GETITIMER_METHODDEF \ - {"getitimer", signal_getitimer, METH_O, signal_getitimer__doc__}, + {"getitimer", (PyCFunction)signal_getitimer, METH_O, signal_getitimer__doc__}, static PyObject * signal_getitimer_impl(PyObject *module, int which); @@ -484,7 +484,7 @@ PyDoc_STRVAR(signal_sigpending__doc__, "the calling thread."); #define SIGNAL_SIGPENDING_METHODDEF \ - {"sigpending", signal_sigpending, METH_NOARGS, signal_sigpending__doc__}, + {"sigpending", (PyCFunction)signal_sigpending, METH_NOARGS, signal_sigpending__doc__}, static PyObject * signal_sigpending_impl(PyObject *module); @@ -510,7 +510,7 @@ PyDoc_STRVAR(signal_sigwait__doc__, "and returns the signal number."); #define SIGNAL_SIGWAIT_METHODDEF \ - {"sigwait", signal_sigwait, METH_O, signal_sigwait__doc__}, + {"sigwait", (PyCFunction)signal_sigwait, METH_O, signal_sigwait__doc__}, static PyObject * signal_sigwait_impl(PyObject *module, sigset_t sigset); @@ -544,7 +544,7 @@ PyDoc_STRVAR(signal_valid_signals__doc__, "functions like `pthread_sigmask`."); #define SIGNAL_VALID_SIGNALS_METHODDEF \ - {"valid_signals", signal_valid_signals, METH_NOARGS, signal_valid_signals__doc__}, + {"valid_signals", (PyCFunction)signal_valid_signals, METH_NOARGS, signal_valid_signals__doc__}, static PyObject * signal_valid_signals_impl(PyObject *module); @@ -568,7 +568,7 @@ PyDoc_STRVAR(signal_sigwaitinfo__doc__, "Returns a struct_siginfo containing information about the signal."); #define SIGNAL_SIGWAITINFO_METHODDEF \ - {"sigwaitinfo", signal_sigwaitinfo, METH_O, signal_sigwaitinfo__doc__}, + {"sigwaitinfo", (PyCFunction)signal_sigwaitinfo, METH_O, signal_sigwaitinfo__doc__}, static PyObject * signal_sigwaitinfo_impl(PyObject *module, sigset_t sigset); @@ -777,4 +777,4 @@ signal_pidfd_send_signal(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF #define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF #endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */ -/*[clinic end generated code: output=86c4efb878e7f49d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=356e1acc44a4f377 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/socketmodule.c.h b/Modules/clinic/socketmodule.c.h index a4921edd751b7a..dc62c4290d3e3b 100644 --- a/Modules/clinic/socketmodule.c.h +++ b/Modules/clinic/socketmodule.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(_socket_socket_close__doc__, "Close the socket. It cannot be used after this call."); #define _SOCKET_SOCKET_CLOSE_METHODDEF \ - {"close", _socket_socket_close, METH_NOARGS, _socket_socket_close__doc__}, + {"close", (PyCFunction)_socket_socket_close, METH_NOARGS, _socket_socket_close__doc__}, static PyObject * _socket_socket_close_impl(PySocketSockObject *s); @@ -120,7 +120,7 @@ PyDoc_STRVAR(_socket_socket_ntohs__doc__, "Convert a 16-bit unsigned integer from network to host byte order."); #define _SOCKET_SOCKET_NTOHS_METHODDEF \ - {"ntohs", _socket_socket_ntohs, METH_O, _socket_socket_ntohs__doc__}, + {"ntohs", (PyCFunction)_socket_socket_ntohs, METH_O, _socket_socket_ntohs__doc__}, static PyObject * _socket_socket_ntohs_impl(PySocketSockObject *self, int x); @@ -148,7 +148,7 @@ PyDoc_STRVAR(_socket_socket_htons__doc__, "Convert a 16-bit unsigned integer from host to network byte order."); #define _SOCKET_SOCKET_HTONS_METHODDEF \ - {"htons", _socket_socket_htons, METH_O, _socket_socket_htons__doc__}, + {"htons", (PyCFunction)_socket_socket_htons, METH_O, _socket_socket_htons__doc__}, static PyObject * _socket_socket_htons_impl(PySocketSockObject *self, int x); @@ -176,7 +176,7 @@ PyDoc_STRVAR(_socket_socket_inet_aton__doc__, "Convert an IP address in string format (123.45.67.89) to the 32-bit packed binary format used in low-level network functions."); #define _SOCKET_SOCKET_INET_ATON_METHODDEF \ - {"inet_aton", _socket_socket_inet_aton, METH_O, _socket_socket_inet_aton__doc__}, + {"inet_aton", (PyCFunction)_socket_socket_inet_aton, METH_O, _socket_socket_inet_aton__doc__}, static PyObject * _socket_socket_inet_aton_impl(PySocketSockObject *self, const char *ip_addr); @@ -215,7 +215,7 @@ PyDoc_STRVAR(_socket_socket_inet_ntoa__doc__, "Convert an IP address from 32-bit packed binary format to string format."); #define _SOCKET_SOCKET_INET_NTOA_METHODDEF \ - {"inet_ntoa", _socket_socket_inet_ntoa, METH_O, _socket_socket_inet_ntoa__doc__}, + {"inet_ntoa", (PyCFunction)_socket_socket_inet_ntoa, METH_O, _socket_socket_inet_ntoa__doc__}, static PyObject * _socket_socket_inet_ntoa_impl(PySocketSockObject *self, Py_buffer *packed_ip); @@ -251,7 +251,7 @@ PyDoc_STRVAR(_socket_socket_if_nametoindex__doc__, "Returns the interface index corresponding to the interface name if_name."); #define _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF \ - {"if_nametoindex", _socket_socket_if_nametoindex, METH_O, _socket_socket_if_nametoindex__doc__}, + {"if_nametoindex", (PyCFunction)_socket_socket_if_nametoindex, METH_O, _socket_socket_if_nametoindex__doc__}, static PyObject * _socket_socket_if_nametoindex_impl(PySocketSockObject *self, PyObject *oname); @@ -280,4 +280,4 @@ _socket_socket_if_nametoindex(PyObject *self, PyObject *arg) #ifndef _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF #define _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF #endif /* !defined(_SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF) */ -/*[clinic end generated code: output=bd2b487f6158be18 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d39efc30d811e74b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/syslogmodule.c.h b/Modules/clinic/syslogmodule.c.h index a6779afc206e5a..7c3fcd64191500 100644 --- a/Modules/clinic/syslogmodule.c.h +++ b/Modules/clinic/syslogmodule.c.h @@ -103,7 +103,7 @@ PyDoc_STRVAR(syslog_syslog__doc__, "Send the string message to the system logger."); #define SYSLOG_SYSLOG_METHODDEF \ - {"syslog", syslog_syslog, METH_VARARGS, syslog_syslog__doc__}, + {"syslog", (PyCFunction)syslog_syslog, METH_VARARGS, syslog_syslog__doc__}, static PyObject * syslog_syslog_impl(PyObject *module, int group_left_1, int priority, @@ -148,7 +148,7 @@ PyDoc_STRVAR(syslog_closelog__doc__, "Reset the syslog module values and call the system library closelog()."); #define SYSLOG_CLOSELOG_METHODDEF \ - {"closelog", syslog_closelog, METH_NOARGS, syslog_closelog__doc__}, + {"closelog", (PyCFunction)syslog_closelog, METH_NOARGS, syslog_closelog__doc__}, static PyObject * syslog_closelog_impl(PyObject *module); @@ -172,7 +172,7 @@ PyDoc_STRVAR(syslog_setlogmask__doc__, "Set the priority mask to maskpri and return the previous mask value."); #define SYSLOG_SETLOGMASK_METHODDEF \ - {"setlogmask", syslog_setlogmask, METH_O, syslog_setlogmask__doc__}, + {"setlogmask", (PyCFunction)syslog_setlogmask, METH_O, syslog_setlogmask__doc__}, static long syslog_setlogmask_impl(PyObject *module, long maskpri); @@ -205,7 +205,7 @@ PyDoc_STRVAR(syslog_LOG_MASK__doc__, "Calculates the mask for the individual priority pri."); #define SYSLOG_LOG_MASK_METHODDEF \ - {"LOG_MASK", syslog_LOG_MASK, METH_O, syslog_LOG_MASK__doc__}, + {"LOG_MASK", (PyCFunction)syslog_LOG_MASK, METH_O, syslog_LOG_MASK__doc__}, static long syslog_LOG_MASK_impl(PyObject *module, long pri); @@ -238,7 +238,7 @@ PyDoc_STRVAR(syslog_LOG_UPTO__doc__, "Calculates the mask for all priorities up to and including pri."); #define SYSLOG_LOG_UPTO_METHODDEF \ - {"LOG_UPTO", syslog_LOG_UPTO, METH_O, syslog_LOG_UPTO__doc__}, + {"LOG_UPTO", (PyCFunction)syslog_LOG_UPTO, METH_O, syslog_LOG_UPTO__doc__}, static long syslog_LOG_UPTO_impl(PyObject *module, long pri); @@ -263,4 +263,4 @@ syslog_LOG_UPTO(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=f3101e6b4c13a76f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f867a4f7a9267de1 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/termios.c.h b/Modules/clinic/termios.c.h index c1e202465ab7bc..83f5a4f6e9f882 100644 --- a/Modules/clinic/termios.c.h +++ b/Modules/clinic/termios.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(termios_tcgetattr__doc__, "done using the symbolic constants defined in this module."); #define TERMIOS_TCGETATTR_METHODDEF \ - {"tcgetattr", termios_tcgetattr, METH_O, termios_tcgetattr__doc__}, + {"tcgetattr", (PyCFunction)termios_tcgetattr, METH_O, termios_tcgetattr__doc__}, static PyObject * termios_tcgetattr_impl(PyObject *module, int fd); @@ -130,7 +130,7 @@ PyDoc_STRVAR(termios_tcdrain__doc__, "Wait until all output written to file descriptor fd has been transmitted."); #define TERMIOS_TCDRAIN_METHODDEF \ - {"tcdrain", termios_tcdrain, METH_O, termios_tcdrain__doc__}, + {"tcdrain", (PyCFunction)termios_tcdrain, METH_O, termios_tcdrain__doc__}, static PyObject * termios_tcdrain_impl(PyObject *module, int fd); @@ -242,7 +242,7 @@ PyDoc_STRVAR(termios_tcgetwinsize__doc__, "Returns a tuple (ws_row, ws_col)."); #define TERMIOS_TCGETWINSIZE_METHODDEF \ - {"tcgetwinsize", termios_tcgetwinsize, METH_O, termios_tcgetwinsize__doc__}, + {"tcgetwinsize", (PyCFunction)termios_tcgetwinsize, METH_O, termios_tcgetwinsize__doc__}, static PyObject * termios_tcgetwinsize_impl(PyObject *module, int fd); @@ -299,4 +299,4 @@ termios_tcsetwinsize(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=2ee49d5de55b30c6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c6c6192583b0da36 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/timemodule.c.h b/Modules/clinic/timemodule.c.h index 09717c2176c3bd..bbc0748f9a9c0d 100644 --- a/Modules/clinic/timemodule.c.h +++ b/Modules/clinic/timemodule.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(time_clock_gettime__doc__, "Return the time of the specified clock clk_id as a float."); #define TIME_CLOCK_GETTIME_METHODDEF \ - {"clock_gettime", time_clock_gettime, METH_O, time_clock_gettime__doc__}, + {"clock_gettime", (PyCFunction)time_clock_gettime, METH_O, time_clock_gettime__doc__}, static PyObject * time_clock_gettime_impl(PyObject *module, clockid_t clk_id); @@ -42,7 +42,7 @@ PyDoc_STRVAR(time_clock_gettime_ns__doc__, "Return the time of the specified clock clk_id as nanoseconds (int)."); #define TIME_CLOCK_GETTIME_NS_METHODDEF \ - {"clock_gettime_ns", time_clock_gettime_ns, METH_O, time_clock_gettime_ns__doc__}, + {"clock_gettime_ns", (PyCFunction)time_clock_gettime_ns, METH_O, time_clock_gettime_ns__doc__}, static PyObject * time_clock_gettime_ns_impl(PyObject *module, clockid_t clk_id); @@ -71,4 +71,4 @@ time_clock_gettime_ns(PyObject *module, PyObject *arg) #ifndef TIME_CLOCK_GETTIME_NS_METHODDEF #define TIME_CLOCK_GETTIME_NS_METHODDEF #endif /* !defined(TIME_CLOCK_GETTIME_NS_METHODDEF) */ -/*[clinic end generated code: output=0a5e10de8e92d3da input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b589a2132aa9df47 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h index d77e577b781167..345440eeee89a6 100644 --- a/Modules/clinic/unicodedata.c.h +++ b/Modules/clinic/unicodedata.c.h @@ -160,7 +160,7 @@ PyDoc_STRVAR(unicodedata_UCD_category__doc__, "Returns the general category assigned to the character chr as string."); #define UNICODEDATA_UCD_CATEGORY_METHODDEF \ - {"category", unicodedata_UCD_category, METH_O, unicodedata_UCD_category__doc__}, + {"category", (PyCFunction)unicodedata_UCD_category, METH_O, unicodedata_UCD_category__doc__}, static PyObject * unicodedata_UCD_category_impl(PyObject *self, int chr); @@ -198,7 +198,7 @@ PyDoc_STRVAR(unicodedata_UCD_bidirectional__doc__, "If no such value is defined, an empty string is returned."); #define UNICODEDATA_UCD_BIDIRECTIONAL_METHODDEF \ - {"bidirectional", unicodedata_UCD_bidirectional, METH_O, unicodedata_UCD_bidirectional__doc__}, + {"bidirectional", (PyCFunction)unicodedata_UCD_bidirectional, METH_O, unicodedata_UCD_bidirectional__doc__}, static PyObject * unicodedata_UCD_bidirectional_impl(PyObject *self, int chr); @@ -236,7 +236,7 @@ PyDoc_STRVAR(unicodedata_UCD_combining__doc__, "Returns 0 if no combining class is defined."); #define UNICODEDATA_UCD_COMBINING_METHODDEF \ - {"combining", unicodedata_UCD_combining, METH_O, unicodedata_UCD_combining__doc__}, + {"combining", (PyCFunction)unicodedata_UCD_combining, METH_O, unicodedata_UCD_combining__doc__}, static int unicodedata_UCD_combining_impl(PyObject *self, int chr); @@ -280,7 +280,7 @@ PyDoc_STRVAR(unicodedata_UCD_mirrored__doc__, "character in bidirectional text, 0 otherwise."); #define UNICODEDATA_UCD_MIRRORED_METHODDEF \ - {"mirrored", unicodedata_UCD_mirrored, METH_O, unicodedata_UCD_mirrored__doc__}, + {"mirrored", (PyCFunction)unicodedata_UCD_mirrored, METH_O, unicodedata_UCD_mirrored__doc__}, static int unicodedata_UCD_mirrored_impl(PyObject *self, int chr); @@ -321,7 +321,7 @@ PyDoc_STRVAR(unicodedata_UCD_east_asian_width__doc__, "Returns the east asian width assigned to the character chr as string."); #define UNICODEDATA_UCD_EAST_ASIAN_WIDTH_METHODDEF \ - {"east_asian_width", unicodedata_UCD_east_asian_width, METH_O, unicodedata_UCD_east_asian_width__doc__}, + {"east_asian_width", (PyCFunction)unicodedata_UCD_east_asian_width, METH_O, unicodedata_UCD_east_asian_width__doc__}, static PyObject * unicodedata_UCD_east_asian_width_impl(PyObject *self, int chr); @@ -359,7 +359,7 @@ PyDoc_STRVAR(unicodedata_UCD_decomposition__doc__, "An empty string is returned in case no such mapping is defined."); #define UNICODEDATA_UCD_DECOMPOSITION_METHODDEF \ - {"decomposition", unicodedata_UCD_decomposition, METH_O, unicodedata_UCD_decomposition__doc__}, + {"decomposition", (PyCFunction)unicodedata_UCD_decomposition, METH_O, unicodedata_UCD_decomposition__doc__}, static PyObject * unicodedata_UCD_decomposition_impl(PyObject *self, int chr); @@ -528,7 +528,7 @@ PyDoc_STRVAR(unicodedata_UCD_lookup__doc__, "corresponding character. If not found, KeyError is raised."); #define UNICODEDATA_UCD_LOOKUP_METHODDEF \ - {"lookup", unicodedata_UCD_lookup, METH_O, unicodedata_UCD_lookup__doc__}, + {"lookup", (PyCFunction)unicodedata_UCD_lookup, METH_O, unicodedata_UCD_lookup__doc__}, static PyObject * unicodedata_UCD_lookup_impl(PyObject *self, const char *name, @@ -549,4 +549,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=21e9a48655bd516f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8a59d430cee41058 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index 9837ccb6086a28..262438f830a9ad 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -214,7 +214,7 @@ PyDoc_STRVAR(bytearray_clear__doc__, "Remove all items from the bytearray."); #define BYTEARRAY_CLEAR_METHODDEF \ - {"clear", bytearray_clear, METH_NOARGS, bytearray_clear__doc__}, + {"clear", (PyCFunction)bytearray_clear, METH_NOARGS, bytearray_clear__doc__}, static PyObject * bytearray_clear_impl(PyByteArrayObject *self); @@ -232,7 +232,7 @@ PyDoc_STRVAR(bytearray_copy__doc__, "Return a copy of B."); #define BYTEARRAY_COPY_METHODDEF \ - {"copy", bytearray_copy, METH_NOARGS, bytearray_copy__doc__}, + {"copy", (PyCFunction)bytearray_copy, METH_NOARGS, bytearray_copy__doc__}, static PyObject * bytearray_copy_impl(PyByteArrayObject *self); @@ -525,7 +525,7 @@ PyDoc_STRVAR(bytearray_removeprefix__doc__, "bytearray."); #define BYTEARRAY_REMOVEPREFIX_METHODDEF \ - {"removeprefix", bytearray_removeprefix, METH_O, bytearray_removeprefix__doc__}, + {"removeprefix", (PyCFunction)bytearray_removeprefix, METH_O, bytearray_removeprefix__doc__}, static PyObject * bytearray_removeprefix_impl(PyByteArrayObject *self, Py_buffer *prefix); @@ -563,7 +563,7 @@ PyDoc_STRVAR(bytearray_removesuffix__doc__, "the original bytearray."); #define BYTEARRAY_REMOVESUFFIX_METHODDEF \ - {"removesuffix", bytearray_removesuffix, METH_O, bytearray_removesuffix__doc__}, + {"removesuffix", (PyCFunction)bytearray_removesuffix, METH_O, bytearray_removesuffix__doc__}, static PyObject * bytearray_removesuffix_impl(PyByteArrayObject *self, Py_buffer *suffix); @@ -600,7 +600,7 @@ PyDoc_STRVAR(bytearray_resize__doc__, " New size to resize to.."); #define BYTEARRAY_RESIZE_METHODDEF \ - {"resize", bytearray_resize, METH_O, bytearray_resize__doc__}, + {"resize", (PyCFunction)bytearray_resize, METH_O, bytearray_resize__doc__}, static PyObject * bytearray_resize_impl(PyByteArrayObject *self, Py_ssize_t size); @@ -923,7 +923,7 @@ PyDoc_STRVAR(bytearray_partition__doc__, "original bytearray object and two empty bytearray objects."); #define BYTEARRAY_PARTITION_METHODDEF \ - {"partition", bytearray_partition, METH_O, bytearray_partition__doc__}, + {"partition", (PyCFunction)bytearray_partition, METH_O, bytearray_partition__doc__}, static PyObject * bytearray_partition_impl(PyByteArrayObject *self, PyObject *sep); @@ -955,7 +955,7 @@ PyDoc_STRVAR(bytearray_rpartition__doc__, "objects and the copy of the original bytearray object."); #define BYTEARRAY_RPARTITION_METHODDEF \ - {"rpartition", bytearray_rpartition, METH_O, bytearray_rpartition__doc__}, + {"rpartition", (PyCFunction)bytearray_rpartition, METH_O, bytearray_rpartition__doc__}, static PyObject * bytearray_rpartition_impl(PyByteArrayObject *self, PyObject *sep); @@ -1071,7 +1071,7 @@ PyDoc_STRVAR(bytearray_reverse__doc__, "Reverse the order of the values in B in place."); #define BYTEARRAY_REVERSE_METHODDEF \ - {"reverse", bytearray_reverse, METH_NOARGS, bytearray_reverse__doc__}, + {"reverse", (PyCFunction)bytearray_reverse, METH_NOARGS, bytearray_reverse__doc__}, static PyObject * bytearray_reverse_impl(PyByteArrayObject *self); @@ -1148,7 +1148,7 @@ PyDoc_STRVAR(bytearray_append__doc__, " The item to be appended."); #define BYTEARRAY_APPEND_METHODDEF \ - {"append", bytearray_append, METH_O, bytearray_append__doc__}, + {"append", (PyCFunction)bytearray_append, METH_O, bytearray_append__doc__}, static PyObject * bytearray_append_impl(PyByteArrayObject *self, int item); @@ -1180,7 +1180,7 @@ PyDoc_STRVAR(bytearray_extend__doc__, " The iterable of items to append."); #define BYTEARRAY_EXTEND_METHODDEF \ - {"extend", bytearray_extend, METH_O, bytearray_extend__doc__}, + {"extend", (PyCFunction)bytearray_extend, METH_O, bytearray_extend__doc__}, static PyObject * bytearray_extend_impl(PyByteArrayObject *self, PyObject *iterable_of_ints); @@ -1258,7 +1258,7 @@ PyDoc_STRVAR(bytearray_remove__doc__, " The value to remove."); #define BYTEARRAY_REMOVE_METHODDEF \ - {"remove", bytearray_remove, METH_O, bytearray_remove__doc__}, + {"remove", (PyCFunction)bytearray_remove, METH_O, bytearray_remove__doc__}, static PyObject * bytearray_remove_impl(PyByteArrayObject *self, int value); @@ -1503,7 +1503,7 @@ PyDoc_STRVAR(bytearray_join__doc__, "The result is returned as a new bytearray object."); #define BYTEARRAY_JOIN_METHODDEF \ - {"join", bytearray_join, METH_O, bytearray_join__doc__}, + {"join", (PyCFunction)bytearray_join, METH_O, bytearray_join__doc__}, static PyObject * bytearray_join_impl(PyByteArrayObject *self, PyObject *iterable_of_bytes); @@ -1599,7 +1599,7 @@ PyDoc_STRVAR(bytearray_fromhex__doc__, "Example: bytearray.fromhex(\'B9 01EF\') -> bytearray(b\'\\\\xb9\\\\x01\\\\xef\')"); #define BYTEARRAY_FROMHEX_METHODDEF \ - {"fromhex", bytearray_fromhex, METH_O|METH_CLASS, bytearray_fromhex__doc__}, + {"fromhex", (PyCFunction)bytearray_fromhex, METH_O|METH_CLASS, bytearray_fromhex__doc__}, static PyObject * bytearray_fromhex_impl(PyTypeObject *type, PyObject *string); @@ -1711,7 +1711,7 @@ PyDoc_STRVAR(bytearray_reduce__doc__, "Return state information for pickling."); #define BYTEARRAY_REDUCE_METHODDEF \ - {"__reduce__", bytearray_reduce, METH_NOARGS, bytearray_reduce__doc__}, + {"__reduce__", (PyCFunction)bytearray_reduce, METH_NOARGS, bytearray_reduce__doc__}, static PyObject * bytearray_reduce_impl(PyByteArrayObject *self); @@ -1772,7 +1772,7 @@ PyDoc_STRVAR(bytearray_sizeof__doc__, "Returns the size of the bytearray object in memory, in bytes."); #define BYTEARRAY_SIZEOF_METHODDEF \ - {"__sizeof__", bytearray_sizeof, METH_NOARGS, bytearray_sizeof__doc__}, + {"__sizeof__", (PyCFunction)bytearray_sizeof, METH_NOARGS, bytearray_sizeof__doc__}, static PyObject * bytearray_sizeof_impl(PyByteArrayObject *self); @@ -1782,4 +1782,4 @@ bytearray_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl((PyByteArrayObject *)self); } -/*[clinic end generated code: output=8d5aaf1f23292613 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0d1d1abc8b701ad9 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index d55458dec7b839..f1f16de0c8af54 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(bytes___bytes____doc__, "Convert this value to exact type bytes."); #define BYTES___BYTES___METHODDEF \ - {"__bytes__", bytes___bytes__, METH_NOARGS, bytes___bytes____doc__}, + {"__bytes__", (PyCFunction)bytes___bytes__, METH_NOARGS, bytes___bytes____doc__}, static PyObject * bytes___bytes___impl(PyBytesObject *self); @@ -128,7 +128,7 @@ PyDoc_STRVAR(bytes_partition__doc__, "object and two empty bytes objects."); #define BYTES_PARTITION_METHODDEF \ - {"partition", bytes_partition, METH_O, bytes_partition__doc__}, + {"partition", (PyCFunction)bytes_partition, METH_O, bytes_partition__doc__}, static PyObject * bytes_partition_impl(PyBytesObject *self, Py_buffer *sep); @@ -167,7 +167,7 @@ PyDoc_STRVAR(bytes_rpartition__doc__, "objects and the original bytes object."); #define BYTES_RPARTITION_METHODDEF \ - {"rpartition", bytes_rpartition, METH_O, bytes_rpartition__doc__}, + {"rpartition", (PyCFunction)bytes_rpartition, METH_O, bytes_rpartition__doc__}, static PyObject * bytes_rpartition_impl(PyBytesObject *self, Py_buffer *sep); @@ -294,7 +294,7 @@ PyDoc_STRVAR(bytes_join__doc__, "Example: b\'.\'.join([b\'ab\', b\'pq\', b\'rs\']) -> b\'ab.pq.rs\'."); #define BYTES_JOIN_METHODDEF \ - {"join", bytes_join, METH_O, bytes_join__doc__}, + {"join", (PyCFunction)bytes_join, METH_O, bytes_join__doc__}, static PyObject * bytes_join_impl(PyBytesObject *self, PyObject *iterable_of_bytes); @@ -860,7 +860,7 @@ PyDoc_STRVAR(bytes_removeprefix__doc__, "Otherwise, return a copy of the original bytes."); #define BYTES_REMOVEPREFIX_METHODDEF \ - {"removeprefix", bytes_removeprefix, METH_O, bytes_removeprefix__doc__}, + {"removeprefix", (PyCFunction)bytes_removeprefix, METH_O, bytes_removeprefix__doc__}, static PyObject * bytes_removeprefix_impl(PyBytesObject *self, Py_buffer *prefix); @@ -896,7 +896,7 @@ PyDoc_STRVAR(bytes_removesuffix__doc__, "bytes."); #define BYTES_REMOVESUFFIX_METHODDEF \ - {"removesuffix", bytes_removesuffix, METH_O, bytes_removesuffix__doc__}, + {"removesuffix", (PyCFunction)bytes_removesuffix, METH_O, bytes_removesuffix__doc__}, static PyObject * bytes_removesuffix_impl(PyBytesObject *self, Py_buffer *suffix); @@ -1202,7 +1202,7 @@ PyDoc_STRVAR(bytes_fromhex__doc__, "Example: bytes.fromhex(\'B9 01EF\') -> b\'\\\\xb9\\\\x01\\\\xef\'."); #define BYTES_FROMHEX_METHODDEF \ - {"fromhex", bytes_fromhex, METH_O|METH_CLASS, bytes_fromhex__doc__}, + {"fromhex", (PyCFunction)bytes_fromhex, METH_O|METH_CLASS, bytes_fromhex__doc__}, static PyObject * bytes_fromhex_impl(PyTypeObject *type, PyObject *string); @@ -1397,4 +1397,4 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=1ad32b60503522c2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c607024162df3ea8 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/classobject.c.h b/Objects/clinic/classobject.c.h index f74fefc66fb8e3..5934f1c2a41669 100644 --- a/Objects/clinic/classobject.c.h +++ b/Objects/clinic/classobject.c.h @@ -10,7 +10,7 @@ PyDoc_STRVAR(method___reduce____doc__, "\n"); #define METHOD___REDUCE___METHODDEF \ - {"__reduce__", method___reduce__, METH_NOARGS, method___reduce____doc__}, + {"__reduce__", (PyCFunction)method___reduce__, METH_NOARGS, method___reduce____doc__}, static PyObject * method___reduce___impl(PyMethodObject *self); @@ -82,4 +82,4 @@ instancemethod_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=bebe7e84ba161657 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ab546abf90aac94e input=a9049054013a1b77]*/ diff --git a/Objects/clinic/complexobject.c.h b/Objects/clinic/complexobject.c.h index c72c63a61eebca..2988664317eede 100644 --- a/Objects/clinic/complexobject.c.h +++ b/Objects/clinic/complexobject.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(complex_conjugate__doc__, "Return the complex conjugate of its argument. (3-4j).conjugate() == 3+4j."); #define COMPLEX_CONJUGATE_METHODDEF \ - {"conjugate", complex_conjugate, METH_NOARGS, complex_conjugate__doc__}, + {"conjugate", (PyCFunction)complex_conjugate, METH_NOARGS, complex_conjugate__doc__}, static PyObject * complex_conjugate_impl(PyComplexObject *self); @@ -32,7 +32,7 @@ PyDoc_STRVAR(complex___getnewargs____doc__, "\n"); #define COMPLEX___GETNEWARGS___METHODDEF \ - {"__getnewargs__", complex___getnewargs__, METH_NOARGS, complex___getnewargs____doc__}, + {"__getnewargs__", (PyCFunction)complex___getnewargs__, METH_NOARGS, complex___getnewargs____doc__}, static PyObject * complex___getnewargs___impl(PyComplexObject *self); @@ -50,7 +50,7 @@ PyDoc_STRVAR(complex___format____doc__, "Convert to a string according to format_spec."); #define COMPLEX___FORMAT___METHODDEF \ - {"__format__", complex___format__, METH_O, complex___format____doc__}, + {"__format__", (PyCFunction)complex___format__, METH_O, complex___format____doc__}, static PyObject * complex___format___impl(PyComplexObject *self, PyObject *format_spec); @@ -79,7 +79,7 @@ PyDoc_STRVAR(complex___complex____doc__, "Convert this value to exact type complex."); #define COMPLEX___COMPLEX___METHODDEF \ - {"__complex__", complex___complex__, METH_NOARGS, complex___complex____doc__}, + {"__complex__", (PyCFunction)complex___complex__, METH_NOARGS, complex___complex____doc__}, static PyObject * complex___complex___impl(PyComplexObject *self); @@ -169,7 +169,7 @@ PyDoc_STRVAR(complex_from_number__doc__, "Convert number to a complex floating-point number."); #define COMPLEX_FROM_NUMBER_METHODDEF \ - {"from_number", complex_from_number, METH_O|METH_CLASS, complex_from_number__doc__}, + {"from_number", (PyCFunction)complex_from_number, METH_O|METH_CLASS, complex_from_number__doc__}, static PyObject * complex_from_number_impl(PyTypeObject *type, PyObject *number); @@ -183,4 +183,4 @@ complex_from_number(PyObject *type, PyObject *number) return return_value; } -/*[clinic end generated code: output=46767f8412462a4e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=307531cd6d6e7544 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h index aa0e84af416e2e..abf6b38449fcb0 100644 --- a/Objects/clinic/dictobject.c.h +++ b/Objects/clinic/dictobject.c.h @@ -46,7 +46,7 @@ PyDoc_STRVAR(dict_copy__doc__, "Return a shallow copy of the dict."); #define DICT_COPY_METHODDEF \ - {"copy", dict_copy, METH_NOARGS, dict_copy__doc__}, + {"copy", (PyCFunction)dict_copy, METH_NOARGS, dict_copy__doc__}, static PyObject * dict_copy_impl(PyDictObject *self); @@ -64,7 +64,7 @@ PyDoc_STRVAR(dict___contains____doc__, "True if the dictionary has the specified key, else False."); #define DICT___CONTAINS___METHODDEF \ - {"__contains__", dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__}, + {"__contains__", (PyCFunction)dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__}, static PyObject * dict___contains___impl(PyDictObject *self, PyObject *key); @@ -159,7 +159,7 @@ PyDoc_STRVAR(dict_clear__doc__, "Remove all items from the dict."); #define DICT_CLEAR_METHODDEF \ - {"clear", dict_clear, METH_NOARGS, dict_clear__doc__}, + {"clear", (PyCFunction)dict_clear, METH_NOARGS, dict_clear__doc__}, static PyObject * dict_clear_impl(PyDictObject *self); @@ -217,7 +217,7 @@ PyDoc_STRVAR(dict_popitem__doc__, "Raises KeyError if the dict is empty."); #define DICT_POPITEM_METHODDEF \ - {"popitem", dict_popitem, METH_NOARGS, dict_popitem__doc__}, + {"popitem", (PyCFunction)dict_popitem, METH_NOARGS, dict_popitem__doc__}, static PyObject * dict_popitem_impl(PyDictObject *self); @@ -241,7 +241,7 @@ PyDoc_STRVAR(dict___sizeof____doc__, "Return the size of the dict in memory, in bytes."); #define DICT___SIZEOF___METHODDEF \ - {"__sizeof__", dict___sizeof__, METH_NOARGS, dict___sizeof____doc__}, + {"__sizeof__", (PyCFunction)dict___sizeof__, METH_NOARGS, dict___sizeof____doc__}, static PyObject * dict___sizeof___impl(PyDictObject *self); @@ -259,7 +259,7 @@ PyDoc_STRVAR(dict___reversed____doc__, "Return a reverse iterator over the dict keys."); #define DICT___REVERSED___METHODDEF \ - {"__reversed__", dict___reversed__, METH_NOARGS, dict___reversed____doc__}, + {"__reversed__", (PyCFunction)dict___reversed__, METH_NOARGS, dict___reversed____doc__}, static PyObject * dict___reversed___impl(PyDictObject *self); @@ -277,7 +277,7 @@ PyDoc_STRVAR(dict_keys__doc__, "Return a set-like object providing a view on the dict\'s keys."); #define DICT_KEYS_METHODDEF \ - {"keys", dict_keys, METH_NOARGS, dict_keys__doc__}, + {"keys", (PyCFunction)dict_keys, METH_NOARGS, dict_keys__doc__}, static PyObject * dict_keys_impl(PyDictObject *self); @@ -295,7 +295,7 @@ PyDoc_STRVAR(dict_items__doc__, "Return a set-like object providing a view on the dict\'s items."); #define DICT_ITEMS_METHODDEF \ - {"items", dict_items, METH_NOARGS, dict_items__doc__}, + {"items", (PyCFunction)dict_items, METH_NOARGS, dict_items__doc__}, static PyObject * dict_items_impl(PyDictObject *self); @@ -313,7 +313,7 @@ PyDoc_STRVAR(dict_values__doc__, "Return an object providing a view on the dict\'s values."); #define DICT_VALUES_METHODDEF \ - {"values", dict_values, METH_NOARGS, dict_values__doc__}, + {"values", (PyCFunction)dict_values, METH_NOARGS, dict_values__doc__}, static PyObject * dict_values_impl(PyDictObject *self); @@ -323,4 +323,4 @@ dict_values(PyObject *self, PyObject *Py_UNUSED(ignored)) { return dict_values_impl((PyDictObject *)self); } -/*[clinic end generated code: output=0ab6938dd62a694b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9007b74432217017 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/exceptions.c.h b/Objects/clinic/exceptions.c.h index 19674c276c9aff..9baac8b1cc660b 100644 --- a/Objects/clinic/exceptions.c.h +++ b/Objects/clinic/exceptions.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(BaseException___reduce____doc__, "\n"); #define BASEEXCEPTION___REDUCE___METHODDEF \ - {"__reduce__", BaseException___reduce__, METH_NOARGS, BaseException___reduce____doc__}, + {"__reduce__", (PyCFunction)BaseException___reduce__, METH_NOARGS, BaseException___reduce____doc__}, static PyObject * BaseException___reduce___impl(PyBaseExceptionObject *self); @@ -34,7 +34,7 @@ PyDoc_STRVAR(BaseException___setstate____doc__, "\n"); #define BASEEXCEPTION___SETSTATE___METHODDEF \ - {"__setstate__", BaseException___setstate__, METH_O, BaseException___setstate____doc__}, + {"__setstate__", (PyCFunction)BaseException___setstate__, METH_O, BaseException___setstate____doc__}, static PyObject * BaseException___setstate___impl(PyBaseExceptionObject *self, PyObject *state); @@ -58,7 +58,7 @@ PyDoc_STRVAR(BaseException_with_traceback__doc__, "Set self.__traceback__ to tb and return self."); #define BASEEXCEPTION_WITH_TRACEBACK_METHODDEF \ - {"with_traceback", BaseException_with_traceback, METH_O, BaseException_with_traceback__doc__}, + {"with_traceback", (PyCFunction)BaseException_with_traceback, METH_O, BaseException_with_traceback__doc__}, static PyObject * BaseException_with_traceback_impl(PyBaseExceptionObject *self, PyObject *tb); @@ -82,7 +82,7 @@ PyDoc_STRVAR(BaseException_add_note__doc__, "Add a note to the exception"); #define BASEEXCEPTION_ADD_NOTE_METHODDEF \ - {"add_note", BaseException_add_note, METH_O, BaseException_add_note__doc__}, + {"add_note", (PyCFunction)BaseException_add_note, METH_O, BaseException_add_note__doc__}, static PyObject * BaseException_add_note_impl(PyBaseExceptionObject *self, PyObject *note); @@ -315,7 +315,7 @@ PyDoc_STRVAR(BaseExceptionGroup_derive__doc__, "\n"); #define BASEEXCEPTIONGROUP_DERIVE_METHODDEF \ - {"derive", BaseExceptionGroup_derive, METH_O, BaseExceptionGroup_derive__doc__}, + {"derive", (PyCFunction)BaseExceptionGroup_derive, METH_O, BaseExceptionGroup_derive__doc__}, static PyObject * BaseExceptionGroup_derive_impl(PyBaseExceptionGroupObject *self, @@ -339,7 +339,7 @@ PyDoc_STRVAR(BaseExceptionGroup_split__doc__, "\n"); #define BASEEXCEPTIONGROUP_SPLIT_METHODDEF \ - {"split", BaseExceptionGroup_split, METH_O, BaseExceptionGroup_split__doc__}, + {"split", (PyCFunction)BaseExceptionGroup_split, METH_O, BaseExceptionGroup_split__doc__}, static PyObject * BaseExceptionGroup_split_impl(PyBaseExceptionGroupObject *self, @@ -363,7 +363,7 @@ PyDoc_STRVAR(BaseExceptionGroup_subgroup__doc__, "\n"); #define BASEEXCEPTIONGROUP_SUBGROUP_METHODDEF \ - {"subgroup", BaseExceptionGroup_subgroup, METH_O, BaseExceptionGroup_subgroup__doc__}, + {"subgroup", (PyCFunction)BaseExceptionGroup_subgroup, METH_O, BaseExceptionGroup_subgroup__doc__}, static PyObject * BaseExceptionGroup_subgroup_impl(PyBaseExceptionGroupObject *self, @@ -380,4 +380,4 @@ BaseExceptionGroup_subgroup(PyObject *self, PyObject *matcher_value) return return_value; } -/*[clinic end generated code: output=a1c7821f60d77ad1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fcf70b3b71f3d14a input=a9049054013a1b77]*/ diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h index 798bc87fb320b0..4051131f480ccb 100644 --- a/Objects/clinic/floatobject.c.h +++ b/Objects/clinic/floatobject.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(float_is_integer__doc__, "Return True if the float is an integer."); #define FLOAT_IS_INTEGER_METHODDEF \ - {"is_integer", float_is_integer, METH_NOARGS, float_is_integer__doc__}, + {"is_integer", (PyCFunction)float_is_integer, METH_NOARGS, float_is_integer__doc__}, static PyObject * float_is_integer_impl(PyObject *self); @@ -29,7 +29,7 @@ PyDoc_STRVAR(float___trunc____doc__, "Return the Integral closest to x between 0 and x."); #define FLOAT___TRUNC___METHODDEF \ - {"__trunc__", float___trunc__, METH_NOARGS, float___trunc____doc__}, + {"__trunc__", (PyCFunction)float___trunc__, METH_NOARGS, float___trunc____doc__}, static PyObject * float___trunc___impl(PyObject *self); @@ -47,7 +47,7 @@ PyDoc_STRVAR(float___floor____doc__, "Return the floor as an Integral."); #define FLOAT___FLOOR___METHODDEF \ - {"__floor__", float___floor__, METH_NOARGS, float___floor____doc__}, + {"__floor__", (PyCFunction)float___floor__, METH_NOARGS, float___floor____doc__}, static PyObject * float___floor___impl(PyObject *self); @@ -65,7 +65,7 @@ PyDoc_STRVAR(float___ceil____doc__, "Return the ceiling as an Integral."); #define FLOAT___CEIL___METHODDEF \ - {"__ceil__", float___ceil__, METH_NOARGS, float___ceil____doc__}, + {"__ceil__", (PyCFunction)float___ceil__, METH_NOARGS, float___ceil____doc__}, static PyObject * float___ceil___impl(PyObject *self); @@ -117,7 +117,7 @@ PyDoc_STRVAR(float_conjugate__doc__, "Return self, the complex conjugate of any float."); #define FLOAT_CONJUGATE_METHODDEF \ - {"conjugate", float_conjugate, METH_NOARGS, float_conjugate__doc__}, + {"conjugate", (PyCFunction)float_conjugate, METH_NOARGS, float_conjugate__doc__}, static PyObject * float_conjugate_impl(PyObject *self); @@ -140,7 +140,7 @@ PyDoc_STRVAR(float_hex__doc__, "\'0x1.921f9f01b866ep+1\'"); #define FLOAT_HEX_METHODDEF \ - {"hex", float_hex, METH_NOARGS, float_hex__doc__}, + {"hex", (PyCFunction)float_hex, METH_NOARGS, float_hex__doc__}, static PyObject * float_hex_impl(PyObject *self); @@ -163,7 +163,7 @@ PyDoc_STRVAR(float_fromhex__doc__, "-5e-324"); #define FLOAT_FROMHEX_METHODDEF \ - {"fromhex", float_fromhex, METH_O|METH_CLASS, float_fromhex__doc__}, + {"fromhex", (PyCFunction)float_fromhex, METH_O|METH_CLASS, float_fromhex__doc__}, static PyObject * float_fromhex_impl(PyTypeObject *type, PyObject *string); @@ -195,7 +195,7 @@ PyDoc_STRVAR(float_as_integer_ratio__doc__, "(-1, 4)"); #define FLOAT_AS_INTEGER_RATIO_METHODDEF \ - {"as_integer_ratio", float_as_integer_ratio, METH_NOARGS, float_as_integer_ratio__doc__}, + {"as_integer_ratio", (PyCFunction)float_as_integer_ratio, METH_NOARGS, float_as_integer_ratio__doc__}, static PyObject * float_as_integer_ratio_impl(PyObject *self); @@ -247,7 +247,7 @@ PyDoc_STRVAR(float_from_number__doc__, "Convert real number to a floating-point number."); #define FLOAT_FROM_NUMBER_METHODDEF \ - {"from_number", float_from_number, METH_O|METH_CLASS, float_from_number__doc__}, + {"from_number", (PyCFunction)float_from_number, METH_O|METH_CLASS, float_from_number__doc__}, static PyObject * float_from_number_impl(PyTypeObject *type, PyObject *number); @@ -268,7 +268,7 @@ PyDoc_STRVAR(float___getnewargs____doc__, "\n"); #define FLOAT___GETNEWARGS___METHODDEF \ - {"__getnewargs__", float___getnewargs__, METH_NOARGS, float___getnewargs____doc__}, + {"__getnewargs__", (PyCFunction)float___getnewargs__, METH_NOARGS, float___getnewargs____doc__}, static PyObject * float___getnewargs___impl(PyObject *self); @@ -295,7 +295,7 @@ PyDoc_STRVAR(float___getformat____doc__, "C type named by typestr."); #define FLOAT___GETFORMAT___METHODDEF \ - {"__getformat__", float___getformat__, METH_O|METH_CLASS, float___getformat____doc__}, + {"__getformat__", (PyCFunction)float___getformat__, METH_O|METH_CLASS, float___getformat____doc__}, static PyObject * float___getformat___impl(PyTypeObject *type, const char *typestr); @@ -332,7 +332,7 @@ PyDoc_STRVAR(float___format____doc__, "Formats the float according to format_spec."); #define FLOAT___FORMAT___METHODDEF \ - {"__format__", float___format__, METH_O, float___format____doc__}, + {"__format__", (PyCFunction)float___format__, METH_O, float___format____doc__}, static PyObject * float___format___impl(PyObject *self, PyObject *format_spec); @@ -353,4 +353,4 @@ float___format__(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=188bb8fc6137be75 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=927035897ea3573f input=a9049054013a1b77]*/ diff --git a/Objects/clinic/frameobject.c.h b/Objects/clinic/frameobject.c.h index 4317987ef7f8de..327896f4b97c68 100644 --- a/Objects/clinic/frameobject.c.h +++ b/Objects/clinic/frameobject.c.h @@ -393,7 +393,7 @@ PyDoc_STRVAR(frame_clear__doc__, "Clear all references held by the frame."); #define FRAME_CLEAR_METHODDEF \ - {"clear", frame_clear, METH_NOARGS, frame_clear__doc__}, + {"clear", (PyCFunction)frame_clear, METH_NOARGS, frame_clear__doc__}, static PyObject * frame_clear_impl(PyFrameObject *self); @@ -417,7 +417,7 @@ PyDoc_STRVAR(frame___sizeof____doc__, "Return the size of the frame in memory, in bytes."); #define FRAME___SIZEOF___METHODDEF \ - {"__sizeof__", frame___sizeof__, METH_NOARGS, frame___sizeof____doc__}, + {"__sizeof__", (PyCFunction)frame___sizeof__, METH_NOARGS, frame___sizeof____doc__}, static PyObject * frame___sizeof___impl(PyFrameObject *self); @@ -433,4 +433,4 @@ frame___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored)) return return_value; } -/*[clinic end generated code: output=2292649a947634ce input=a9049054013a1b77]*/ +/*[clinic end generated code: output=74abf652547c0c11 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/listobject.c.h b/Objects/clinic/listobject.c.h index 5f82b2099a2579..3f4e7e72f85dc2 100644 --- a/Objects/clinic/listobject.c.h +++ b/Objects/clinic/listobject.c.h @@ -60,7 +60,7 @@ PyDoc_STRVAR(py_list_clear__doc__, "Remove all items from list."); #define PY_LIST_CLEAR_METHODDEF \ - {"clear", py_list_clear, METH_NOARGS, py_list_clear__doc__}, + {"clear", (PyCFunction)py_list_clear, METH_NOARGS, py_list_clear__doc__}, static PyObject * py_list_clear_impl(PyListObject *self); @@ -84,7 +84,7 @@ PyDoc_STRVAR(list_copy__doc__, "Return a shallow copy of the list."); #define LIST_COPY_METHODDEF \ - {"copy", list_copy, METH_NOARGS, list_copy__doc__}, + {"copy", (PyCFunction)list_copy, METH_NOARGS, list_copy__doc__}, static PyObject * list_copy_impl(PyListObject *self); @@ -108,7 +108,7 @@ PyDoc_STRVAR(list_append__doc__, "Append object to the end of the list."); #define LIST_APPEND_METHODDEF \ - {"append", list_append, METH_O, list_append__doc__}, + {"append", (PyCFunction)list_append, METH_O, list_append__doc__}, static PyObject * list_append_impl(PyListObject *self, PyObject *object); @@ -132,7 +132,7 @@ PyDoc_STRVAR(list_extend__doc__, "Extend list by appending elements from the iterable."); #define LIST_EXTEND_METHODDEF \ - {"extend", list_extend, METH_O, list_extend__doc__}, + {"extend", (PyCFunction)list_extend, METH_O, list_extend__doc__}, static PyObject * list_extend_impl(PyListObject *self, PyObject *iterable); @@ -282,7 +282,7 @@ PyDoc_STRVAR(list_reverse__doc__, "Reverse *IN PLACE*."); #define LIST_REVERSE_METHODDEF \ - {"reverse", list_reverse, METH_NOARGS, list_reverse__doc__}, + {"reverse", (PyCFunction)list_reverse, METH_NOARGS, list_reverse__doc__}, static PyObject * list_reverse_impl(PyListObject *self); @@ -352,7 +352,7 @@ PyDoc_STRVAR(list_count__doc__, "Return number of occurrences of value."); #define LIST_COUNT_METHODDEF \ - {"count", list_count, METH_O, list_count__doc__}, + {"count", (PyCFunction)list_count, METH_O, list_count__doc__}, static PyObject * list_count_impl(PyListObject *self, PyObject *value); @@ -376,7 +376,7 @@ PyDoc_STRVAR(list_remove__doc__, "Raises ValueError if the value is not present."); #define LIST_REMOVE_METHODDEF \ - {"remove", list_remove, METH_O, list_remove__doc__}, + {"remove", (PyCFunction)list_remove, METH_O, list_remove__doc__}, static PyObject * list_remove_impl(PyListObject *self, PyObject *value); @@ -438,7 +438,7 @@ PyDoc_STRVAR(list___sizeof____doc__, "Return the size of the list in memory, in bytes."); #define LIST___SIZEOF___METHODDEF \ - {"__sizeof__", list___sizeof__, METH_NOARGS, list___sizeof____doc__}, + {"__sizeof__", (PyCFunction)list___sizeof__, METH_NOARGS, list___sizeof____doc__}, static PyObject * list___sizeof___impl(PyListObject *self); @@ -456,7 +456,7 @@ PyDoc_STRVAR(list___reversed____doc__, "Return a reverse iterator over the list."); #define LIST___REVERSED___METHODDEF \ - {"__reversed__", list___reversed__, METH_NOARGS, list___reversed____doc__}, + {"__reversed__", (PyCFunction)list___reversed__, METH_NOARGS, list___reversed____doc__}, static PyObject * list___reversed___impl(PyListObject *self); @@ -466,4 +466,4 @@ list___reversed__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return list___reversed___impl((PyListObject *)self); } -/*[clinic end generated code: output=920ebb1a2c7fcf77 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bc45e43a621ac833 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h index 1317c6f177bfa4..9043ab3d516ea0 100644 --- a/Objects/clinic/longobject.c.h +++ b/Objects/clinic/longobject.c.h @@ -76,7 +76,7 @@ PyDoc_STRVAR(int___getnewargs____doc__, "\n"); #define INT___GETNEWARGS___METHODDEF \ - {"__getnewargs__", int___getnewargs__, METH_NOARGS, int___getnewargs____doc__}, + {"__getnewargs__", (PyCFunction)int___getnewargs__, METH_NOARGS, int___getnewargs____doc__}, static PyObject * int___getnewargs___impl(PyObject *self); @@ -94,7 +94,7 @@ PyDoc_STRVAR(int___format____doc__, "Convert to a string according to format_spec."); #define INT___FORMAT___METHODDEF \ - {"__format__", int___format__, METH_O, int___format____doc__}, + {"__format__", (PyCFunction)int___format__, METH_O, int___format____doc__}, static PyObject * int___format___impl(PyObject *self, PyObject *format_spec); @@ -157,7 +157,7 @@ PyDoc_STRVAR(int___sizeof____doc__, "Returns size in memory, in bytes."); #define INT___SIZEOF___METHODDEF \ - {"__sizeof__", int___sizeof__, METH_NOARGS, int___sizeof____doc__}, + {"__sizeof__", (PyCFunction)int___sizeof__, METH_NOARGS, int___sizeof____doc__}, static Py_ssize_t int___sizeof___impl(PyObject *self); @@ -190,7 +190,7 @@ PyDoc_STRVAR(int_bit_length__doc__, "6"); #define INT_BIT_LENGTH_METHODDEF \ - {"bit_length", int_bit_length, METH_NOARGS, int_bit_length__doc__}, + {"bit_length", (PyCFunction)int_bit_length, METH_NOARGS, int_bit_length__doc__}, static PyObject * int_bit_length_impl(PyObject *self); @@ -215,7 +215,7 @@ PyDoc_STRVAR(int_bit_count__doc__, "3"); #define INT_BIT_COUNT_METHODDEF \ - {"bit_count", int_bit_count, METH_NOARGS, int_bit_count__doc__}, + {"bit_count", (PyCFunction)int_bit_count, METH_NOARGS, int_bit_count__doc__}, static PyObject * int_bit_count_impl(PyObject *self); @@ -242,7 +242,7 @@ PyDoc_STRVAR(int_as_integer_ratio__doc__, "(0, 1)"); #define INT_AS_INTEGER_RATIO_METHODDEF \ - {"as_integer_ratio", int_as_integer_ratio, METH_NOARGS, int_as_integer_ratio__doc__}, + {"as_integer_ratio", (PyCFunction)int_as_integer_ratio, METH_NOARGS, int_as_integer_ratio__doc__}, static PyObject * int_as_integer_ratio_impl(PyObject *self); @@ -469,7 +469,7 @@ PyDoc_STRVAR(int_is_integer__doc__, "Returns True. Exists for duck type compatibility with float.is_integer."); #define INT_IS_INTEGER_METHODDEF \ - {"is_integer", int_is_integer, METH_NOARGS, int_is_integer__doc__}, + {"is_integer", (PyCFunction)int_is_integer, METH_NOARGS, int_is_integer__doc__}, static PyObject * int_is_integer_impl(PyObject *self); @@ -479,4 +479,4 @@ int_is_integer(PyObject *self, PyObject *Py_UNUSED(ignored)) { return int_is_integer_impl(self); } -/*[clinic end generated code: output=a8319a611dd6fa31 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=591cffa2b80b5184 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/memoryobject.c.h b/Objects/clinic/memoryobject.c.h index bc1ff38392bd3c..b3240c7e6c4363 100644 --- a/Objects/clinic/memoryobject.c.h +++ b/Objects/clinic/memoryobject.c.h @@ -131,7 +131,7 @@ PyDoc_STRVAR(memoryview_release__doc__, "Release the underlying buffer exposed by the memoryview object."); #define MEMORYVIEW_RELEASE_METHODDEF \ - {"release", memoryview_release, METH_NOARGS, memoryview_release__doc__}, + {"release", (PyCFunction)memoryview_release, METH_NOARGS, memoryview_release__doc__}, static PyObject * memoryview_release_impl(PyMemoryViewObject *self); @@ -217,7 +217,7 @@ PyDoc_STRVAR(memoryview_toreadonly__doc__, "Return a readonly version of the memoryview."); #define MEMORYVIEW_TOREADONLY_METHODDEF \ - {"toreadonly", memoryview_toreadonly, METH_NOARGS, memoryview_toreadonly__doc__}, + {"toreadonly", (PyCFunction)memoryview_toreadonly, METH_NOARGS, memoryview_toreadonly__doc__}, static PyObject * memoryview_toreadonly_impl(PyMemoryViewObject *self); @@ -235,7 +235,7 @@ PyDoc_STRVAR(memoryview_tolist__doc__, "Return the data in the buffer as a list of elements."); #define MEMORYVIEW_TOLIST_METHODDEF \ - {"tolist", memoryview_tolist, METH_NOARGS, memoryview_tolist__doc__}, + {"tolist", (PyCFunction)memoryview_tolist, METH_NOARGS, memoryview_tolist__doc__}, static PyObject * memoryview_tolist_impl(PyMemoryViewObject *self); @@ -426,7 +426,7 @@ PyDoc_STRVAR(memoryview_count__doc__, "Count the number of occurrences of a value."); #define MEMORYVIEW_COUNT_METHODDEF \ - {"count", memoryview_count, METH_O, memoryview_count__doc__}, + {"count", (PyCFunction)memoryview_count, METH_O, memoryview_count__doc__}, static PyObject * memoryview_count_impl(PyMemoryViewObject *self, PyObject *value); @@ -486,4 +486,4 @@ memoryview_index(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=c32614e84c83e729 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ae3414e9311c02fb input=a9049054013a1b77]*/ diff --git a/Objects/clinic/setobject.c.h b/Objects/clinic/setobject.c.h index fdc7a8a6c50b73..96c70d0ae95a46 100644 --- a/Objects/clinic/setobject.c.h +++ b/Objects/clinic/setobject.c.h @@ -13,7 +13,7 @@ PyDoc_STRVAR(set_pop__doc__, "Raises KeyError if the set is empty."); #define SET_POP_METHODDEF \ - {"pop", set_pop, METH_NOARGS, set_pop__doc__}, + {"pop", (PyCFunction)set_pop, METH_NOARGS, set_pop__doc__}, static PyObject * set_pop_impl(PySetObject *so); @@ -64,7 +64,7 @@ PyDoc_STRVAR(set_copy__doc__, "Return a shallow copy of a set."); #define SET_COPY_METHODDEF \ - {"copy", set_copy, METH_NOARGS, set_copy__doc__}, + {"copy", (PyCFunction)set_copy, METH_NOARGS, set_copy__doc__}, static PyObject * set_copy_impl(PySetObject *so); @@ -88,7 +88,7 @@ PyDoc_STRVAR(frozenset_copy__doc__, "Return a shallow copy of a set."); #define FROZENSET_COPY_METHODDEF \ - {"copy", frozenset_copy, METH_NOARGS, frozenset_copy__doc__}, + {"copy", (PyCFunction)frozenset_copy, METH_NOARGS, frozenset_copy__doc__}, static PyObject * frozenset_copy_impl(PySetObject *so); @@ -112,7 +112,7 @@ PyDoc_STRVAR(set_clear__doc__, "Remove all elements from this set."); #define SET_CLEAR_METHODDEF \ - {"clear", set_clear, METH_NOARGS, set_clear__doc__}, + {"clear", (PyCFunction)set_clear, METH_NOARGS, set_clear__doc__}, static PyObject * set_clear_impl(PySetObject *so); @@ -217,7 +217,7 @@ PyDoc_STRVAR(set_isdisjoint__doc__, "Return True if two sets have a null intersection."); #define SET_ISDISJOINT_METHODDEF \ - {"isdisjoint", set_isdisjoint, METH_O, set_isdisjoint__doc__}, + {"isdisjoint", (PyCFunction)set_isdisjoint, METH_O, set_isdisjoint__doc__}, static PyObject * set_isdisjoint_impl(PySetObject *so, PyObject *other); @@ -295,7 +295,7 @@ PyDoc_STRVAR(set_symmetric_difference_update__doc__, "Update the set, keeping only elements found in either set, but not in both."); #define SET_SYMMETRIC_DIFFERENCE_UPDATE_METHODDEF \ - {"symmetric_difference_update", set_symmetric_difference_update, METH_O, set_symmetric_difference_update__doc__}, + {"symmetric_difference_update", (PyCFunction)set_symmetric_difference_update, METH_O, set_symmetric_difference_update__doc__}, static PyObject * set_symmetric_difference_update_impl(PySetObject *so, PyObject *other); @@ -317,7 +317,7 @@ PyDoc_STRVAR(set_symmetric_difference__doc__, "Return a new set with elements in either the set or other but not both."); #define SET_SYMMETRIC_DIFFERENCE_METHODDEF \ - {"symmetric_difference", set_symmetric_difference, METH_O, set_symmetric_difference__doc__}, + {"symmetric_difference", (PyCFunction)set_symmetric_difference, METH_O, set_symmetric_difference__doc__}, static PyObject * set_symmetric_difference_impl(PySetObject *so, PyObject *other); @@ -341,7 +341,7 @@ PyDoc_STRVAR(set_issubset__doc__, "Report whether another set contains this set."); #define SET_ISSUBSET_METHODDEF \ - {"issubset", set_issubset, METH_O, set_issubset__doc__}, + {"issubset", (PyCFunction)set_issubset, METH_O, set_issubset__doc__}, static PyObject * set_issubset_impl(PySetObject *so, PyObject *other); @@ -365,7 +365,7 @@ PyDoc_STRVAR(set_issuperset__doc__, "Report whether this set contains another set."); #define SET_ISSUPERSET_METHODDEF \ - {"issuperset", set_issuperset, METH_O, set_issuperset__doc__}, + {"issuperset", (PyCFunction)set_issuperset, METH_O, set_issuperset__doc__}, static PyObject * set_issuperset_impl(PySetObject *so, PyObject *other); @@ -391,7 +391,7 @@ PyDoc_STRVAR(set_add__doc__, "This has no effect if the element is already present."); #define SET_ADD_METHODDEF \ - {"add", set_add, METH_O, set_add__doc__}, + {"add", (PyCFunction)set_add, METH_O, set_add__doc__}, static PyObject * set_add_impl(PySetObject *so, PyObject *key); @@ -415,7 +415,7 @@ PyDoc_STRVAR(set___contains____doc__, "x.__contains__(y) <==> y in x."); #define SET___CONTAINS___METHODDEF \ - {"__contains__", set___contains__, METH_O|METH_COEXIST, set___contains____doc__}, + {"__contains__", (PyCFunction)set___contains__, METH_O|METH_COEXIST, set___contains____doc__}, static PyObject * set___contains___impl(PySetObject *so, PyObject *key); @@ -441,7 +441,7 @@ PyDoc_STRVAR(set_remove__doc__, "If the element is not a member, raise a KeyError."); #define SET_REMOVE_METHODDEF \ - {"remove", set_remove, METH_O, set_remove__doc__}, + {"remove", (PyCFunction)set_remove, METH_O, set_remove__doc__}, static PyObject * set_remove_impl(PySetObject *so, PyObject *key); @@ -468,7 +468,7 @@ PyDoc_STRVAR(set_discard__doc__, "an exception when an element is missing from the set."); #define SET_DISCARD_METHODDEF \ - {"discard", set_discard, METH_O, set_discard__doc__}, + {"discard", (PyCFunction)set_discard, METH_O, set_discard__doc__}, static PyObject * set_discard_impl(PySetObject *so, PyObject *key); @@ -492,7 +492,7 @@ PyDoc_STRVAR(set___reduce____doc__, "Return state information for pickling."); #define SET___REDUCE___METHODDEF \ - {"__reduce__", set___reduce__, METH_NOARGS, set___reduce____doc__}, + {"__reduce__", (PyCFunction)set___reduce__, METH_NOARGS, set___reduce____doc__}, static PyObject * set___reduce___impl(PySetObject *so); @@ -516,7 +516,7 @@ PyDoc_STRVAR(set___sizeof____doc__, "S.__sizeof__() -> size of S in memory, in bytes."); #define SET___SIZEOF___METHODDEF \ - {"__sizeof__", set___sizeof__, METH_NOARGS, set___sizeof____doc__}, + {"__sizeof__", (PyCFunction)set___sizeof__, METH_NOARGS, set___sizeof____doc__}, static PyObject * set___sizeof___impl(PySetObject *so); @@ -532,4 +532,4 @@ set___sizeof__(PyObject *so, PyObject *Py_UNUSED(ignored)) return return_value; } -/*[clinic end generated code: output=222f962570251614 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e2f1470de062d661 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/tupleobject.c.h b/Objects/clinic/tupleobject.c.h index b71f3d3711673f..1c12706c0bb43b 100644 --- a/Objects/clinic/tupleobject.c.h +++ b/Objects/clinic/tupleobject.c.h @@ -57,7 +57,7 @@ PyDoc_STRVAR(tuple_count__doc__, "Return number of occurrences of value."); #define TUPLE_COUNT_METHODDEF \ - {"count", tuple_count, METH_O, tuple_count__doc__}, + {"count", (PyCFunction)tuple_count, METH_O, tuple_count__doc__}, static PyObject * tuple_count_impl(PyTupleObject *self, PyObject *value); @@ -117,7 +117,7 @@ PyDoc_STRVAR(tuple___getnewargs____doc__, "\n"); #define TUPLE___GETNEWARGS___METHODDEF \ - {"__getnewargs__", tuple___getnewargs__, METH_NOARGS, tuple___getnewargs____doc__}, + {"__getnewargs__", (PyCFunction)tuple___getnewargs__, METH_NOARGS, tuple___getnewargs____doc__}, static PyObject * tuple___getnewargs___impl(PyTupleObject *self); @@ -127,4 +127,4 @@ tuple___getnewargs__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return tuple___getnewargs___impl((PyTupleObject *)self); } -/*[clinic end generated code: output=8345867f523906f3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bd11662d62d973c2 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typeobject.c.h b/Objects/clinic/typeobject.c.h index 0ed4fca818755f..24a25f27ea3cc3 100644 --- a/Objects/clinic/typeobject.c.h +++ b/Objects/clinic/typeobject.c.h @@ -11,7 +11,7 @@ PyDoc_STRVAR(type___instancecheck____doc__, "Check if an object is an instance."); #define TYPE___INSTANCECHECK___METHODDEF \ - {"__instancecheck__", type___instancecheck__, METH_O, type___instancecheck____doc__}, + {"__instancecheck__", (PyCFunction)type___instancecheck__, METH_O, type___instancecheck____doc__}, static int type___instancecheck___impl(PyTypeObject *self, PyObject *instance); @@ -39,7 +39,7 @@ PyDoc_STRVAR(type___subclasscheck____doc__, "Check if a class is a subclass."); #define TYPE___SUBCLASSCHECK___METHODDEF \ - {"__subclasscheck__", type___subclasscheck__, METH_O, type___subclasscheck____doc__}, + {"__subclasscheck__", (PyCFunction)type___subclasscheck__, METH_O, type___subclasscheck____doc__}, static int type___subclasscheck___impl(PyTypeObject *self, PyObject *subclass); @@ -67,7 +67,7 @@ PyDoc_STRVAR(type_mro__doc__, "Return a type\'s method resolution order."); #define TYPE_MRO_METHODDEF \ - {"mro", type_mro, METH_NOARGS, type_mro__doc__}, + {"mro", (PyCFunction)type_mro, METH_NOARGS, type_mro__doc__}, static PyObject * type_mro_impl(PyTypeObject *self); @@ -85,7 +85,7 @@ PyDoc_STRVAR(type___subclasses____doc__, "Return a list of immediate subclasses."); #define TYPE___SUBCLASSES___METHODDEF \ - {"__subclasses__", type___subclasses__, METH_NOARGS, type___subclasses____doc__}, + {"__subclasses__", (PyCFunction)type___subclasses__, METH_NOARGS, type___subclasses____doc__}, static PyObject * type___subclasses___impl(PyTypeObject *self); @@ -103,7 +103,7 @@ PyDoc_STRVAR(type___dir____doc__, "Specialized __dir__ implementation for types."); #define TYPE___DIR___METHODDEF \ - {"__dir__", type___dir__, METH_NOARGS, type___dir____doc__}, + {"__dir__", (PyCFunction)type___dir__, METH_NOARGS, type___dir____doc__}, static PyObject * type___dir___impl(PyTypeObject *self); @@ -121,7 +121,7 @@ PyDoc_STRVAR(type___sizeof____doc__, "Return memory consumption of the type object."); #define TYPE___SIZEOF___METHODDEF \ - {"__sizeof__", type___sizeof__, METH_NOARGS, type___sizeof____doc__}, + {"__sizeof__", (PyCFunction)type___sizeof__, METH_NOARGS, type___sizeof____doc__}, static PyObject * type___sizeof___impl(PyTypeObject *self); @@ -139,7 +139,7 @@ PyDoc_STRVAR(object___getstate____doc__, "Helper for pickle."); #define OBJECT___GETSTATE___METHODDEF \ - {"__getstate__", object___getstate__, METH_NOARGS, object___getstate____doc__}, + {"__getstate__", (PyCFunction)object___getstate__, METH_NOARGS, object___getstate____doc__}, static PyObject * object___getstate___impl(PyObject *self); @@ -157,7 +157,7 @@ PyDoc_STRVAR(object___reduce____doc__, "Helper for pickle."); #define OBJECT___REDUCE___METHODDEF \ - {"__reduce__", object___reduce__, METH_NOARGS, object___reduce____doc__}, + {"__reduce__", (PyCFunction)object___reduce__, METH_NOARGS, object___reduce____doc__}, static PyObject * object___reduce___impl(PyObject *self); @@ -175,7 +175,7 @@ PyDoc_STRVAR(object___reduce_ex____doc__, "Helper for pickle."); #define OBJECT___REDUCE_EX___METHODDEF \ - {"__reduce_ex__", object___reduce_ex__, METH_O, object___reduce_ex____doc__}, + {"__reduce_ex__", (PyCFunction)object___reduce_ex__, METH_O, object___reduce_ex____doc__}, static PyObject * object___reduce_ex___impl(PyObject *self, int protocol); @@ -205,7 +205,7 @@ PyDoc_STRVAR(object___format____doc__, "Return str(self) if format_spec is empty. Raise TypeError otherwise."); #define OBJECT___FORMAT___METHODDEF \ - {"__format__", object___format__, METH_O, object___format____doc__}, + {"__format__", (PyCFunction)object___format__, METH_O, object___format____doc__}, static PyObject * object___format___impl(PyObject *self, PyObject *format_spec); @@ -234,7 +234,7 @@ PyDoc_STRVAR(object___sizeof____doc__, "Size of object in memory, in bytes."); #define OBJECT___SIZEOF___METHODDEF \ - {"__sizeof__", object___sizeof__, METH_NOARGS, object___sizeof____doc__}, + {"__sizeof__", (PyCFunction)object___sizeof__, METH_NOARGS, object___sizeof____doc__}, static PyObject * object___sizeof___impl(PyObject *self); @@ -252,7 +252,7 @@ PyDoc_STRVAR(object___dir____doc__, "Default dir() implementation."); #define OBJECT___DIR___METHODDEF \ - {"__dir__", object___dir__, METH_NOARGS, object___dir____doc__}, + {"__dir__", (PyCFunction)object___dir__, METH_NOARGS, object___dir____doc__}, static PyObject * object___dir___impl(PyObject *self); @@ -262,4 +262,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return object___dir___impl(self); } -/*[clinic end generated code: output=731c0d5d3f99d593 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b55c0d257e2518d2 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typevarobject.c.h b/Objects/clinic/typevarobject.c.h index 870ef19e9ad23c..87e0fd77203f75 100644 --- a/Objects/clinic/typevarobject.c.h +++ b/Objects/clinic/typevarobject.c.h @@ -128,7 +128,7 @@ PyDoc_STRVAR(typevar_typing_subst__doc__, "\n"); #define TYPEVAR_TYPING_SUBST_METHODDEF \ - {"__typing_subst__", typevar_typing_subst, METH_O, typevar_typing_subst__doc__}, + {"__typing_subst__", (PyCFunction)typevar_typing_subst, METH_O, typevar_typing_subst__doc__}, static PyObject * typevar_typing_subst_impl(typevarobject *self, PyObject *arg); @@ -179,7 +179,7 @@ PyDoc_STRVAR(typevar_reduce__doc__, "\n"); #define TYPEVAR_REDUCE_METHODDEF \ - {"__reduce__", typevar_reduce, METH_NOARGS, typevar_reduce__doc__}, + {"__reduce__", (PyCFunction)typevar_reduce, METH_NOARGS, typevar_reduce__doc__}, static PyObject * typevar_reduce_impl(typevarobject *self); @@ -196,7 +196,7 @@ PyDoc_STRVAR(typevar_has_default__doc__, "\n"); #define TYPEVAR_HAS_DEFAULT_METHODDEF \ - {"has_default", typevar_has_default, METH_NOARGS, typevar_has_default__doc__}, + {"has_default", (PyCFunction)typevar_has_default, METH_NOARGS, typevar_has_default__doc__}, static PyObject * typevar_has_default_impl(typevarobject *self); @@ -429,7 +429,7 @@ PyDoc_STRVAR(paramspec_typing_subst__doc__, "\n"); #define PARAMSPEC_TYPING_SUBST_METHODDEF \ - {"__typing_subst__", paramspec_typing_subst, METH_O, paramspec_typing_subst__doc__}, + {"__typing_subst__", (PyCFunction)paramspec_typing_subst, METH_O, paramspec_typing_subst__doc__}, static PyObject * paramspec_typing_subst_impl(paramspecobject *self, PyObject *arg); @@ -480,7 +480,7 @@ PyDoc_STRVAR(paramspec_reduce__doc__, "\n"); #define PARAMSPEC_REDUCE_METHODDEF \ - {"__reduce__", paramspec_reduce, METH_NOARGS, paramspec_reduce__doc__}, + {"__reduce__", (PyCFunction)paramspec_reduce, METH_NOARGS, paramspec_reduce__doc__}, static PyObject * paramspec_reduce_impl(paramspecobject *self); @@ -497,7 +497,7 @@ PyDoc_STRVAR(paramspec_has_default__doc__, "\n"); #define PARAMSPEC_HAS_DEFAULT_METHODDEF \ - {"has_default", paramspec_has_default, METH_NOARGS, paramspec_has_default__doc__}, + {"has_default", (PyCFunction)paramspec_has_default, METH_NOARGS, paramspec_has_default__doc__}, static PyObject * paramspec_has_default_impl(paramspecobject *self); @@ -581,7 +581,7 @@ PyDoc_STRVAR(typevartuple_typing_subst__doc__, "\n"); #define TYPEVARTUPLE_TYPING_SUBST_METHODDEF \ - {"__typing_subst__", typevartuple_typing_subst, METH_O, typevartuple_typing_subst__doc__}, + {"__typing_subst__", (PyCFunction)typevartuple_typing_subst, METH_O, typevartuple_typing_subst__doc__}, static PyObject * typevartuple_typing_subst_impl(typevartupleobject *self, PyObject *arg); @@ -632,7 +632,7 @@ PyDoc_STRVAR(typevartuple_reduce__doc__, "\n"); #define TYPEVARTUPLE_REDUCE_METHODDEF \ - {"__reduce__", typevartuple_reduce, METH_NOARGS, typevartuple_reduce__doc__}, + {"__reduce__", (PyCFunction)typevartuple_reduce, METH_NOARGS, typevartuple_reduce__doc__}, static PyObject * typevartuple_reduce_impl(typevartupleobject *self); @@ -649,7 +649,7 @@ PyDoc_STRVAR(typevartuple_has_default__doc__, "\n"); #define TYPEVARTUPLE_HAS_DEFAULT_METHODDEF \ - {"has_default", typevartuple_has_default, METH_NOARGS, typevartuple_has_default__doc__}, + {"has_default", (PyCFunction)typevartuple_has_default, METH_NOARGS, typevartuple_has_default__doc__}, static PyObject * typevartuple_has_default_impl(typevartupleobject *self); @@ -666,7 +666,7 @@ PyDoc_STRVAR(typealias_reduce__doc__, "\n"); #define TYPEALIAS_REDUCE_METHODDEF \ - {"__reduce__", typealias_reduce, METH_NOARGS, typealias_reduce__doc__}, + {"__reduce__", (PyCFunction)typealias_reduce, METH_NOARGS, typealias_reduce__doc__}, static PyObject * typealias_reduce_impl(typealiasobject *self); @@ -745,4 +745,4 @@ typealias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=b28d41c4b35c5b40 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d0cdf708e2e315a4 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index 965014313fad7f..c299cf2cfc8bc1 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -16,7 +16,7 @@ PyDoc_STRVAR(EncodingMap_size__doc__, "Return the size (in bytes) of this object."); #define ENCODINGMAP_SIZE_METHODDEF \ - {"size", EncodingMap_size, METH_NOARGS, EncodingMap_size__doc__}, + {"size", (PyCFunction)EncodingMap_size, METH_NOARGS, EncodingMap_size__doc__}, static PyObject * EncodingMap_size_impl(struct encoding_map *self); @@ -37,7 +37,7 @@ PyDoc_STRVAR(unicode_title__doc__, "cased characters have lower case."); #define UNICODE_TITLE_METHODDEF \ - {"title", unicode_title, METH_NOARGS, unicode_title__doc__}, + {"title", (PyCFunction)unicode_title, METH_NOARGS, unicode_title__doc__}, static PyObject * unicode_title_impl(PyObject *self); @@ -58,7 +58,7 @@ PyDoc_STRVAR(unicode_capitalize__doc__, "case."); #define UNICODE_CAPITALIZE_METHODDEF \ - {"capitalize", unicode_capitalize, METH_NOARGS, unicode_capitalize__doc__}, + {"capitalize", (PyCFunction)unicode_capitalize, METH_NOARGS, unicode_capitalize__doc__}, static PyObject * unicode_capitalize_impl(PyObject *self); @@ -76,7 +76,7 @@ PyDoc_STRVAR(unicode_casefold__doc__, "Return a version of the string suitable for caseless comparisons."); #define UNICODE_CASEFOLD_METHODDEF \ - {"casefold", unicode_casefold, METH_NOARGS, unicode_casefold__doc__}, + {"casefold", (PyCFunction)unicode_casefold, METH_NOARGS, unicode_casefold__doc__}, static PyObject * unicode_casefold_impl(PyObject *self); @@ -480,7 +480,7 @@ PyDoc_STRVAR(unicode_isascii__doc__, "Empty string is ASCII too."); #define UNICODE_ISASCII_METHODDEF \ - {"isascii", unicode_isascii, METH_NOARGS, unicode_isascii__doc__}, + {"isascii", (PyCFunction)unicode_isascii, METH_NOARGS, unicode_isascii__doc__}, static PyObject * unicode_isascii_impl(PyObject *self); @@ -501,7 +501,7 @@ PyDoc_STRVAR(unicode_islower__doc__, "there is at least one cased character in the string."); #define UNICODE_ISLOWER_METHODDEF \ - {"islower", unicode_islower, METH_NOARGS, unicode_islower__doc__}, + {"islower", (PyCFunction)unicode_islower, METH_NOARGS, unicode_islower__doc__}, static PyObject * unicode_islower_impl(PyObject *self); @@ -522,7 +522,7 @@ PyDoc_STRVAR(unicode_isupper__doc__, "there is at least one cased character in the string."); #define UNICODE_ISUPPER_METHODDEF \ - {"isupper", unicode_isupper, METH_NOARGS, unicode_isupper__doc__}, + {"isupper", (PyCFunction)unicode_isupper, METH_NOARGS, unicode_isupper__doc__}, static PyObject * unicode_isupper_impl(PyObject *self); @@ -543,7 +543,7 @@ PyDoc_STRVAR(unicode_istitle__doc__, "follow uncased characters and lowercase characters only cased ones."); #define UNICODE_ISTITLE_METHODDEF \ - {"istitle", unicode_istitle, METH_NOARGS, unicode_istitle__doc__}, + {"istitle", (PyCFunction)unicode_istitle, METH_NOARGS, unicode_istitle__doc__}, static PyObject * unicode_istitle_impl(PyObject *self); @@ -564,7 +564,7 @@ PyDoc_STRVAR(unicode_isspace__doc__, "is at least one character in the string."); #define UNICODE_ISSPACE_METHODDEF \ - {"isspace", unicode_isspace, METH_NOARGS, unicode_isspace__doc__}, + {"isspace", (PyCFunction)unicode_isspace, METH_NOARGS, unicode_isspace__doc__}, static PyObject * unicode_isspace_impl(PyObject *self); @@ -585,7 +585,7 @@ PyDoc_STRVAR(unicode_isalpha__doc__, "is at least one character in the string."); #define UNICODE_ISALPHA_METHODDEF \ - {"isalpha", unicode_isalpha, METH_NOARGS, unicode_isalpha__doc__}, + {"isalpha", (PyCFunction)unicode_isalpha, METH_NOARGS, unicode_isalpha__doc__}, static PyObject * unicode_isalpha_impl(PyObject *self); @@ -606,7 +606,7 @@ PyDoc_STRVAR(unicode_isalnum__doc__, "there is at least one character in the string."); #define UNICODE_ISALNUM_METHODDEF \ - {"isalnum", unicode_isalnum, METH_NOARGS, unicode_isalnum__doc__}, + {"isalnum", (PyCFunction)unicode_isalnum, METH_NOARGS, unicode_isalnum__doc__}, static PyObject * unicode_isalnum_impl(PyObject *self); @@ -627,7 +627,7 @@ PyDoc_STRVAR(unicode_isdecimal__doc__, "there is at least one character in the string."); #define UNICODE_ISDECIMAL_METHODDEF \ - {"isdecimal", unicode_isdecimal, METH_NOARGS, unicode_isdecimal__doc__}, + {"isdecimal", (PyCFunction)unicode_isdecimal, METH_NOARGS, unicode_isdecimal__doc__}, static PyObject * unicode_isdecimal_impl(PyObject *self); @@ -648,7 +648,7 @@ PyDoc_STRVAR(unicode_isdigit__doc__, "is at least one character in the string."); #define UNICODE_ISDIGIT_METHODDEF \ - {"isdigit", unicode_isdigit, METH_NOARGS, unicode_isdigit__doc__}, + {"isdigit", (PyCFunction)unicode_isdigit, METH_NOARGS, unicode_isdigit__doc__}, static PyObject * unicode_isdigit_impl(PyObject *self); @@ -669,7 +669,7 @@ PyDoc_STRVAR(unicode_isnumeric__doc__, "least one character in the string."); #define UNICODE_ISNUMERIC_METHODDEF \ - {"isnumeric", unicode_isnumeric, METH_NOARGS, unicode_isnumeric__doc__}, + {"isnumeric", (PyCFunction)unicode_isnumeric, METH_NOARGS, unicode_isnumeric__doc__}, static PyObject * unicode_isnumeric_impl(PyObject *self); @@ -690,7 +690,7 @@ PyDoc_STRVAR(unicode_isidentifier__doc__, "such as \"def\" or \"class\"."); #define UNICODE_ISIDENTIFIER_METHODDEF \ - {"isidentifier", unicode_isidentifier, METH_NOARGS, unicode_isidentifier__doc__}, + {"isidentifier", (PyCFunction)unicode_isidentifier, METH_NOARGS, unicode_isidentifier__doc__}, static PyObject * unicode_isidentifier_impl(PyObject *self); @@ -710,7 +710,7 @@ PyDoc_STRVAR(unicode_isprintable__doc__, "A character is printable if repr() may use it in its output."); #define UNICODE_ISPRINTABLE_METHODDEF \ - {"isprintable", unicode_isprintable, METH_NOARGS, unicode_isprintable__doc__}, + {"isprintable", (PyCFunction)unicode_isprintable, METH_NOARGS, unicode_isprintable__doc__}, static PyObject * unicode_isprintable_impl(PyObject *self); @@ -733,7 +733,7 @@ PyDoc_STRVAR(unicode_join__doc__, "Example: \'.\'.join([\'ab\', \'pq\', \'rs\']) -> \'ab.pq.rs\'"); #define UNICODE_JOIN_METHODDEF \ - {"join", unicode_join, METH_O, unicode_join__doc__}, + {"join", (PyCFunction)unicode_join, METH_O, unicode_join__doc__}, PyDoc_STRVAR(unicode_ljust__doc__, "ljust($self, width, fillchar=\' \', /)\n" @@ -791,7 +791,7 @@ PyDoc_STRVAR(unicode_lower__doc__, "Return a copy of the string converted to lowercase."); #define UNICODE_LOWER_METHODDEF \ - {"lower", unicode_lower, METH_NOARGS, unicode_lower__doc__}, + {"lower", (PyCFunction)unicode_lower, METH_NOARGS, unicode_lower__doc__}, static PyObject * unicode_lower_impl(PyObject *self); @@ -1006,7 +1006,7 @@ PyDoc_STRVAR(unicode_removeprefix__doc__, "Otherwise, return a copy of the original string."); #define UNICODE_REMOVEPREFIX_METHODDEF \ - {"removeprefix", unicode_removeprefix, METH_O, unicode_removeprefix__doc__}, + {"removeprefix", (PyCFunction)unicode_removeprefix, METH_O, unicode_removeprefix__doc__}, static PyObject * unicode_removeprefix_impl(PyObject *self, PyObject *prefix); @@ -1039,7 +1039,7 @@ PyDoc_STRVAR(unicode_removesuffix__doc__, "string."); #define UNICODE_REMOVESUFFIX_METHODDEF \ - {"removesuffix", unicode_removesuffix, METH_O, unicode_removesuffix__doc__}, + {"removesuffix", (PyCFunction)unicode_removesuffix, METH_O, unicode_removesuffix__doc__}, static PyObject * unicode_removesuffix_impl(PyObject *self, PyObject *suffix); @@ -1331,7 +1331,7 @@ PyDoc_STRVAR(unicode_partition__doc__, "and two empty strings."); #define UNICODE_PARTITION_METHODDEF \ - {"partition", unicode_partition, METH_O, unicode_partition__doc__}, + {"partition", (PyCFunction)unicode_partition, METH_O, unicode_partition__doc__}, PyDoc_STRVAR(unicode_rpartition__doc__, "rpartition($self, sep, /)\n" @@ -1347,7 +1347,7 @@ PyDoc_STRVAR(unicode_rpartition__doc__, "and the original string."); #define UNICODE_RPARTITION_METHODDEF \ - {"rpartition", unicode_rpartition, METH_O, unicode_rpartition__doc__}, + {"rpartition", (PyCFunction)unicode_rpartition, METH_O, unicode_rpartition__doc__}, PyDoc_STRVAR(unicode_rsplit__doc__, "rsplit($self, /, sep=None, maxsplit=-1)\n" @@ -1514,7 +1514,7 @@ PyDoc_STRVAR(unicode_swapcase__doc__, "Convert uppercase characters to lowercase and lowercase characters to uppercase."); #define UNICODE_SWAPCASE_METHODDEF \ - {"swapcase", unicode_swapcase, METH_NOARGS, unicode_swapcase__doc__}, + {"swapcase", (PyCFunction)unicode_swapcase, METH_NOARGS, unicode_swapcase__doc__}, static PyObject * unicode_swapcase_impl(PyObject *self); @@ -1595,7 +1595,7 @@ PyDoc_STRVAR(unicode_translate__doc__, "left untouched. Characters mapped to None are deleted."); #define UNICODE_TRANSLATE_METHODDEF \ - {"translate", unicode_translate, METH_O, unicode_translate__doc__}, + {"translate", (PyCFunction)unicode_translate, METH_O, unicode_translate__doc__}, PyDoc_STRVAR(unicode_upper__doc__, "upper($self, /)\n" @@ -1604,7 +1604,7 @@ PyDoc_STRVAR(unicode_upper__doc__, "Return a copy of the string converted to uppercase."); #define UNICODE_UPPER_METHODDEF \ - {"upper", unicode_upper, METH_NOARGS, unicode_upper__doc__}, + {"upper", (PyCFunction)unicode_upper, METH_NOARGS, unicode_upper__doc__}, static PyObject * unicode_upper_impl(PyObject *self); @@ -1624,7 +1624,7 @@ PyDoc_STRVAR(unicode_zfill__doc__, "The string is never truncated."); #define UNICODE_ZFILL_METHODDEF \ - {"zfill", unicode_zfill, METH_O, unicode_zfill__doc__}, + {"zfill", (PyCFunction)unicode_zfill, METH_O, unicode_zfill__doc__}, static PyObject * unicode_zfill_impl(PyObject *self, Py_ssize_t width); @@ -1762,7 +1762,7 @@ PyDoc_STRVAR(unicode___format____doc__, "Return a formatted version of the string as described by format_spec."); #define UNICODE___FORMAT___METHODDEF \ - {"__format__", unicode___format__, METH_O, unicode___format____doc__}, + {"__format__", (PyCFunction)unicode___format__, METH_O, unicode___format____doc__}, static PyObject * unicode___format___impl(PyObject *self, PyObject *format_spec); @@ -1791,7 +1791,7 @@ PyDoc_STRVAR(unicode_sizeof__doc__, "Return the size of the string in memory, in bytes."); #define UNICODE_SIZEOF_METHODDEF \ - {"__sizeof__", unicode_sizeof, METH_NOARGS, unicode_sizeof__doc__}, + {"__sizeof__", (PyCFunction)unicode_sizeof, METH_NOARGS, unicode_sizeof__doc__}, static PyObject * unicode_sizeof_impl(PyObject *self); @@ -1894,4 +1894,4 @@ unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=511da6f2cde6dab3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=81d703159f829f1f input=a9049054013a1b77]*/ diff --git a/Objects/stringlib/clinic/transmogrify.h.h b/Objects/stringlib/clinic/transmogrify.h.h index 018c09c512ae04..5b82c2de737249 100644 --- a/Objects/stringlib/clinic/transmogrify.h.h +++ b/Objects/stringlib/clinic/transmogrify.h.h @@ -294,7 +294,7 @@ PyDoc_STRVAR(stringlib_zfill__doc__, "The original string is never truncated."); #define STRINGLIB_ZFILL_METHODDEF \ - {"zfill", stringlib_zfill, METH_O, stringlib_zfill__doc__}, + {"zfill", (PyCFunction)stringlib_zfill, METH_O, stringlib_zfill__doc__}, static PyObject * stringlib_zfill_impl(PyObject *self, Py_ssize_t width); @@ -322,4 +322,4 @@ stringlib_zfill(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=3847956f44e24623 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0e24a10bac3ec053 input=a9049054013a1b77]*/ diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index a13903a7331bd9..a77d0855af293f 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -14,7 +14,7 @@ PyDoc_STRVAR(msvcrt_heapmin__doc__, "to the operating system. On failure, this raises OSError."); #define MSVCRT_HEAPMIN_METHODDEF \ - {"heapmin", msvcrt_heapmin, METH_NOARGS, msvcrt_heapmin__doc__}, + {"heapmin", (PyCFunction)msvcrt_heapmin, METH_NOARGS, msvcrt_heapmin__doc__}, static PyObject * msvcrt_heapmin_impl(PyObject *module); @@ -173,7 +173,7 @@ PyDoc_STRVAR(msvcrt_get_osfhandle__doc__, "Raises OSError if fd is not recognized."); #define MSVCRT_GET_OSFHANDLE_METHODDEF \ - {"get_osfhandle", msvcrt_get_osfhandle, METH_O, msvcrt_get_osfhandle__doc__}, + {"get_osfhandle", (PyCFunction)msvcrt_get_osfhandle, METH_O, msvcrt_get_osfhandle__doc__}, static void * msvcrt_get_osfhandle_impl(PyObject *module, int fd); @@ -206,7 +206,7 @@ PyDoc_STRVAR(msvcrt_kbhit__doc__, "Returns a nonzero value if a keypress is waiting to be read. Otherwise, return 0."); #define MSVCRT_KBHIT_METHODDEF \ - {"kbhit", msvcrt_kbhit, METH_NOARGS, msvcrt_kbhit__doc__}, + {"kbhit", (PyCFunction)msvcrt_kbhit, METH_NOARGS, msvcrt_kbhit__doc__}, static long msvcrt_kbhit_impl(PyObject *module); @@ -240,7 +240,7 @@ PyDoc_STRVAR(msvcrt_getch__doc__, "cannot be read with this function."); #define MSVCRT_GETCH_METHODDEF \ - {"getch", msvcrt_getch, METH_NOARGS, msvcrt_getch__doc__}, + {"getch", (PyCFunction)msvcrt_getch, METH_NOARGS, msvcrt_getch__doc__}, static int msvcrt_getch_impl(PyObject *module); @@ -266,7 +266,7 @@ PyDoc_STRVAR(msvcrt_getwch__doc__, "Wide char variant of getch(), returning a Unicode value."); #define MSVCRT_GETWCH_METHODDEF \ - {"getwch", msvcrt_getwch, METH_NOARGS, msvcrt_getwch__doc__}, + {"getwch", (PyCFunction)msvcrt_getwch, METH_NOARGS, msvcrt_getwch__doc__}, static wchar_t msvcrt_getwch_impl(PyObject *module); @@ -292,7 +292,7 @@ PyDoc_STRVAR(msvcrt_getche__doc__, "Similar to getch(), but the keypress will be echoed if possible."); #define MSVCRT_GETCHE_METHODDEF \ - {"getche", msvcrt_getche, METH_NOARGS, msvcrt_getche__doc__}, + {"getche", (PyCFunction)msvcrt_getche, METH_NOARGS, msvcrt_getche__doc__}, static int msvcrt_getche_impl(PyObject *module); @@ -318,7 +318,7 @@ PyDoc_STRVAR(msvcrt_getwche__doc__, "Wide char variant of getche(), returning a Unicode value."); #define MSVCRT_GETWCHE_METHODDEF \ - {"getwche", msvcrt_getwche, METH_NOARGS, msvcrt_getwche__doc__}, + {"getwche", (PyCFunction)msvcrt_getwche, METH_NOARGS, msvcrt_getwche__doc__}, static wchar_t msvcrt_getwche_impl(PyObject *module); @@ -344,7 +344,7 @@ PyDoc_STRVAR(msvcrt_putch__doc__, "Print the byte string char to the console without buffering."); #define MSVCRT_PUTCH_METHODDEF \ - {"putch", msvcrt_putch, METH_O, msvcrt_putch__doc__}, + {"putch", (PyCFunction)msvcrt_putch, METH_O, msvcrt_putch__doc__}, static PyObject * msvcrt_putch_impl(PyObject *module, char char_value); @@ -394,7 +394,7 @@ PyDoc_STRVAR(msvcrt_putwch__doc__, "Wide char variant of putch(), accepting a Unicode value."); #define MSVCRT_PUTWCH_METHODDEF \ - {"putwch", msvcrt_putwch, METH_O, msvcrt_putwch__doc__}, + {"putwch", (PyCFunction)msvcrt_putwch, METH_O, msvcrt_putwch__doc__}, static PyObject * msvcrt_putwch_impl(PyObject *module, int unicode_char); @@ -436,7 +436,7 @@ PyDoc_STRVAR(msvcrt_ungetch__doc__, "getch() or getche()."); #define MSVCRT_UNGETCH_METHODDEF \ - {"ungetch", msvcrt_ungetch, METH_O, msvcrt_ungetch__doc__}, + {"ungetch", (PyCFunction)msvcrt_ungetch, METH_O, msvcrt_ungetch__doc__}, static PyObject * msvcrt_ungetch_impl(PyObject *module, char char_value); @@ -486,7 +486,7 @@ PyDoc_STRVAR(msvcrt_ungetwch__doc__, "Wide char variant of ungetch(), accepting a Unicode value."); #define MSVCRT_UNGETWCH_METHODDEF \ - {"ungetwch", msvcrt_ungetwch, METH_O, msvcrt_ungetwch__doc__}, + {"ungetwch", (PyCFunction)msvcrt_ungetwch, METH_O, msvcrt_ungetwch__doc__}, static PyObject * msvcrt_ungetwch_impl(PyObject *module, int unicode_char); @@ -622,7 +622,7 @@ PyDoc_STRVAR(msvcrt_set_error_mode__doc__, "Only available on Debug builds."); #define MSVCRT_SET_ERROR_MODE_METHODDEF \ - {"set_error_mode", msvcrt_set_error_mode, METH_O, msvcrt_set_error_mode__doc__}, + {"set_error_mode", (PyCFunction)msvcrt_set_error_mode, METH_O, msvcrt_set_error_mode__doc__}, static long msvcrt_set_error_mode_impl(PyObject *module, int mode); @@ -659,7 +659,7 @@ PyDoc_STRVAR(msvcrt_GetErrorMode__doc__, "Wrapper around GetErrorMode."); #define MSVCRT_GETERRORMODE_METHODDEF \ - {"GetErrorMode", msvcrt_GetErrorMode, METH_NOARGS, msvcrt_GetErrorMode__doc__}, + {"GetErrorMode", (PyCFunction)msvcrt_GetErrorMode, METH_NOARGS, msvcrt_GetErrorMode__doc__}, static PyObject * msvcrt_GetErrorMode_impl(PyObject *module); @@ -679,7 +679,7 @@ PyDoc_STRVAR(msvcrt_SetErrorMode__doc__, "Wrapper around SetErrorMode."); #define MSVCRT_SETERRORMODE_METHODDEF \ - {"SetErrorMode", msvcrt_SetErrorMode, METH_O, msvcrt_SetErrorMode__doc__}, + {"SetErrorMode", (PyCFunction)msvcrt_SetErrorMode, METH_O, msvcrt_SetErrorMode__doc__}, static PyObject * msvcrt_SetErrorMode_impl(PyObject *module, unsigned int mode); @@ -731,4 +731,4 @@ msvcrt_SetErrorMode(PyObject *module, PyObject *arg) #ifndef MSVCRT_GETERRORMODE_METHODDEF #define MSVCRT_GETERRORMODE_METHODDEF #endif /* !defined(MSVCRT_GETERRORMODE_METHODDEF) */ -/*[clinic end generated code: output=849e852d970e7b24 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=692c6f52bb9193ce input=a9049054013a1b77]*/ diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 73299aa21e947c..00fa6a75ec113e 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -20,7 +20,7 @@ PyDoc_STRVAR(winreg_HKEYType_Close__doc__, "If the handle is already closed, no error is raised."); #define WINREG_HKEYTYPE_CLOSE_METHODDEF \ - {"Close", winreg_HKEYType_Close, METH_NOARGS, winreg_HKEYType_Close__doc__}, + {"Close", (PyCFunction)winreg_HKEYType_Close, METH_NOARGS, winreg_HKEYType_Close__doc__}, static PyObject * winreg_HKEYType_Close_impl(PyHKEYObject *self); @@ -50,7 +50,7 @@ PyDoc_STRVAR(winreg_HKEYType_Detach__doc__, "handle object."); #define WINREG_HKEYTYPE_DETACH_METHODDEF \ - {"Detach", winreg_HKEYType_Detach, METH_NOARGS, winreg_HKEYType_Detach__doc__}, + {"Detach", (PyCFunction)winreg_HKEYType_Detach, METH_NOARGS, winreg_HKEYType_Detach__doc__}, static PyObject * winreg_HKEYType_Detach_impl(PyHKEYObject *self); @@ -71,7 +71,7 @@ PyDoc_STRVAR(winreg_HKEYType___enter____doc__, "\n"); #define WINREG_HKEYTYPE___ENTER___METHODDEF \ - {"__enter__", winreg_HKEYType___enter__, METH_NOARGS, winreg_HKEYType___enter____doc__}, + {"__enter__", (PyCFunction)winreg_HKEYType___enter__, METH_NOARGS, winreg_HKEYType___enter____doc__}, static PyHKEYObject * winreg_HKEYType___enter___impl(PyHKEYObject *self); @@ -141,7 +141,7 @@ PyDoc_STRVAR(winreg_CloseKey__doc__, "closed when the hkey object is destroyed by Python."); #define WINREG_CLOSEKEY_METHODDEF \ - {"CloseKey", winreg_CloseKey, METH_O, winreg_CloseKey__doc__}, + {"CloseKey", (PyCFunction)winreg_CloseKey, METH_O, winreg_CloseKey__doc__}, #endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES)) */ @@ -749,7 +749,7 @@ PyDoc_STRVAR(winreg_ExpandEnvironmentStrings__doc__, "Expand environment vars."); #define WINREG_EXPANDENVIRONMENTSTRINGS_METHODDEF \ - {"ExpandEnvironmentStrings", winreg_ExpandEnvironmentStrings, METH_O, winreg_ExpandEnvironmentStrings__doc__}, + {"ExpandEnvironmentStrings", (PyCFunction)winreg_ExpandEnvironmentStrings, METH_O, winreg_ExpandEnvironmentStrings__doc__}, static PyObject * winreg_ExpandEnvironmentStrings_impl(PyObject *module, const wchar_t *string); @@ -801,7 +801,7 @@ PyDoc_STRVAR(winreg_FlushKey__doc__, "a FlushKey() call is required, it probably isn\'t."); #define WINREG_FLUSHKEY_METHODDEF \ - {"FlushKey", winreg_FlushKey, METH_O, winreg_FlushKey__doc__}, + {"FlushKey", (PyCFunction)winreg_FlushKey, METH_O, winreg_FlushKey__doc__}, static PyObject * winreg_FlushKey_impl(PyObject *module, HKEY key); @@ -1157,7 +1157,7 @@ PyDoc_STRVAR(winreg_QueryInfoKey__doc__, "as 100\'s of nanoseconds since Jan 1, 1600."); #define WINREG_QUERYINFOKEY_METHODDEF \ - {"QueryInfoKey", winreg_QueryInfoKey, METH_O, winreg_QueryInfoKey__doc__}, + {"QueryInfoKey", (PyCFunction)winreg_QueryInfoKey, METH_O, winreg_QueryInfoKey__doc__}, static PyObject * winreg_QueryInfoKey_impl(PyObject *module, HKEY key); @@ -1563,7 +1563,7 @@ PyDoc_STRVAR(winreg_DisableReflectionKey__doc__, "of any subkeys."); #define WINREG_DISABLEREFLECTIONKEY_METHODDEF \ - {"DisableReflectionKey", winreg_DisableReflectionKey, METH_O, winreg_DisableReflectionKey__doc__}, + {"DisableReflectionKey", (PyCFunction)winreg_DisableReflectionKey, METH_O, winreg_DisableReflectionKey__doc__}, static PyObject * winreg_DisableReflectionKey_impl(PyObject *module, HKEY key); @@ -1601,7 +1601,7 @@ PyDoc_STRVAR(winreg_EnableReflectionKey__doc__, "subkeys."); #define WINREG_ENABLEREFLECTIONKEY_METHODDEF \ - {"EnableReflectionKey", winreg_EnableReflectionKey, METH_O, winreg_EnableReflectionKey__doc__}, + {"EnableReflectionKey", (PyCFunction)winreg_EnableReflectionKey, METH_O, winreg_EnableReflectionKey__doc__}, static PyObject * winreg_EnableReflectionKey_impl(PyObject *module, HKEY key); @@ -1637,7 +1637,7 @@ PyDoc_STRVAR(winreg_QueryReflectionKey__doc__, "Will generally raise NotImplementedError if executed on a 32bit OS."); #define WINREG_QUERYREFLECTIONKEY_METHODDEF \ - {"QueryReflectionKey", winreg_QueryReflectionKey, METH_O, winreg_QueryReflectionKey__doc__}, + {"QueryReflectionKey", (PyCFunction)winreg_QueryReflectionKey, METH_O, winreg_QueryReflectionKey__doc__}, static PyObject * winreg_QueryReflectionKey_impl(PyObject *module, HKEY key); @@ -1766,4 +1766,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) #ifndef WINREG_QUERYREFLECTIONKEY_METHODDEF #define WINREG_QUERYREFLECTIONKEY_METHODDEF #endif /* !defined(WINREG_QUERYREFLECTIONKEY_METHODDEF) */ -/*[clinic end generated code: output=e273adb99f26e8fb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fbe9b075cd2fa833 input=a9049054013a1b77]*/ diff --git a/Python/clinic/_warnings.c.h b/Python/clinic/_warnings.c.h index 6dfe94094725fb..bcb4b344fa4370 100644 --- a/Python/clinic/_warnings.c.h +++ b/Python/clinic/_warnings.c.h @@ -15,7 +15,7 @@ PyDoc_STRVAR(warnings_acquire_lock__doc__, "\n"); #define WARNINGS_ACQUIRE_LOCK_METHODDEF \ - {"_acquire_lock", warnings_acquire_lock, METH_NOARGS, warnings_acquire_lock__doc__}, + {"_acquire_lock", (PyCFunction)warnings_acquire_lock, METH_NOARGS, warnings_acquire_lock__doc__}, static PyObject * warnings_acquire_lock_impl(PyObject *module); @@ -32,7 +32,7 @@ PyDoc_STRVAR(warnings_release_lock__doc__, "\n"); #define WARNINGS_RELEASE_LOCK_METHODDEF \ - {"_release_lock", warnings_release_lock, METH_NOARGS, warnings_release_lock__doc__}, + {"_release_lock", (PyCFunction)warnings_release_lock, METH_NOARGS, warnings_release_lock__doc__}, static PyObject * warnings_release_lock_impl(PyObject *module); @@ -270,7 +270,7 @@ PyDoc_STRVAR(warnings_filters_mutated_lock_held__doc__, "\n"); #define WARNINGS_FILTERS_MUTATED_LOCK_HELD_METHODDEF \ - {"_filters_mutated_lock_held", warnings_filters_mutated_lock_held, METH_NOARGS, warnings_filters_mutated_lock_held__doc__}, + {"_filters_mutated_lock_held", (PyCFunction)warnings_filters_mutated_lock_held, METH_NOARGS, warnings_filters_mutated_lock_held__doc__}, static PyObject * warnings_filters_mutated_lock_held_impl(PyObject *module); @@ -280,4 +280,4 @@ warnings_filters_mutated_lock_held(PyObject *module, PyObject *Py_UNUSED(ignored { return warnings_filters_mutated_lock_held_impl(module); } -/*[clinic end generated code: output=71dbb864ea857762 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d9d32a8b59a30683 input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index b1bc8dc1fb22db..e5f634e34cb32f 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -118,7 +118,7 @@ PyDoc_STRVAR(builtin_abs__doc__, "Return the absolute value of the argument."); #define BUILTIN_ABS_METHODDEF \ - {"abs", builtin_abs, METH_O, builtin_abs__doc__}, + {"abs", (PyCFunction)builtin_abs, METH_O, builtin_abs__doc__}, PyDoc_STRVAR(builtin_all__doc__, "all($module, iterable, /)\n" @@ -129,7 +129,7 @@ PyDoc_STRVAR(builtin_all__doc__, "If the iterable is empty, return True."); #define BUILTIN_ALL_METHODDEF \ - {"all", builtin_all, METH_O, builtin_all__doc__}, + {"all", (PyCFunction)builtin_all, METH_O, builtin_all__doc__}, PyDoc_STRVAR(builtin_any__doc__, "any($module, iterable, /)\n" @@ -140,7 +140,7 @@ PyDoc_STRVAR(builtin_any__doc__, "If the iterable is empty, return False."); #define BUILTIN_ANY_METHODDEF \ - {"any", builtin_any, METH_O, builtin_any__doc__}, + {"any", (PyCFunction)builtin_any, METH_O, builtin_any__doc__}, PyDoc_STRVAR(builtin_ascii__doc__, "ascii($module, obj, /)\n" @@ -154,7 +154,7 @@ PyDoc_STRVAR(builtin_ascii__doc__, "to that returned by repr() in Python 2."); #define BUILTIN_ASCII_METHODDEF \ - {"ascii", builtin_ascii, METH_O, builtin_ascii__doc__}, + {"ascii", (PyCFunction)builtin_ascii, METH_O, builtin_ascii__doc__}, PyDoc_STRVAR(builtin_bin__doc__, "bin($module, number, /)\n" @@ -166,7 +166,7 @@ PyDoc_STRVAR(builtin_bin__doc__, " \'0b1010101010101010101010\'"); #define BUILTIN_BIN_METHODDEF \ - {"bin", builtin_bin, METH_O, builtin_bin__doc__}, + {"bin", (PyCFunction)builtin_bin, METH_O, builtin_bin__doc__}, PyDoc_STRVAR(builtin_callable__doc__, "callable($module, obj, /)\n" @@ -178,7 +178,7 @@ PyDoc_STRVAR(builtin_callable__doc__, "__call__() method."); #define BUILTIN_CALLABLE_METHODDEF \ - {"callable", builtin_callable, METH_O, builtin_callable__doc__}, + {"callable", (PyCFunction)builtin_callable, METH_O, builtin_callable__doc__}, PyDoc_STRVAR(builtin_format__doc__, "format($module, value, format_spec=\'\', /)\n" @@ -232,7 +232,7 @@ PyDoc_STRVAR(builtin_chr__doc__, "Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."); #define BUILTIN_CHR_METHODDEF \ - {"chr", builtin_chr, METH_O, builtin_chr__doc__}, + {"chr", (PyCFunction)builtin_chr, METH_O, builtin_chr__doc__}, PyDoc_STRVAR(builtin_compile__doc__, "compile($module, /, source, filename, mode, flags=0,\n" @@ -573,7 +573,7 @@ PyDoc_STRVAR(builtin_globals__doc__, "global scope and vice-versa."); #define BUILTIN_GLOBALS_METHODDEF \ - {"globals", builtin_globals, METH_NOARGS, builtin_globals__doc__}, + {"globals", (PyCFunction)builtin_globals, METH_NOARGS, builtin_globals__doc__}, static PyObject * builtin_globals_impl(PyObject *module); @@ -626,7 +626,7 @@ PyDoc_STRVAR(builtin_id__doc__, "(CPython uses the object\'s memory address.)"); #define BUILTIN_ID_METHODDEF \ - {"id", builtin_id, METH_O, builtin_id__doc__}, + {"id", (PyCFunction)builtin_id, METH_O, builtin_id__doc__}, static PyObject * builtin_id_impl(PyModuleDef *self, PyObject *v); @@ -718,7 +718,7 @@ PyDoc_STRVAR(builtin_hash__doc__, "reverse is not necessarily true."); #define BUILTIN_HASH_METHODDEF \ - {"hash", builtin_hash, METH_O, builtin_hash__doc__}, + {"hash", (PyCFunction)builtin_hash, METH_O, builtin_hash__doc__}, PyDoc_STRVAR(builtin_hex__doc__, "hex($module, number, /)\n" @@ -730,7 +730,7 @@ PyDoc_STRVAR(builtin_hex__doc__, " \'0xc0ffee\'"); #define BUILTIN_HEX_METHODDEF \ - {"hex", builtin_hex, METH_O, builtin_hex__doc__}, + {"hex", (PyCFunction)builtin_hex, METH_O, builtin_hex__doc__}, PyDoc_STRVAR(builtin_aiter__doc__, "aiter($module, async_iterable, /)\n" @@ -739,7 +739,7 @@ PyDoc_STRVAR(builtin_aiter__doc__, "Return an AsyncIterator for an AsyncIterable object."); #define BUILTIN_AITER_METHODDEF \ - {"aiter", builtin_aiter, METH_O, builtin_aiter__doc__}, + {"aiter", (PyCFunction)builtin_aiter, METH_O, builtin_aiter__doc__}, PyDoc_STRVAR(builtin_anext__doc__, "anext($module, aiterator, default=, /)\n" @@ -786,7 +786,7 @@ PyDoc_STRVAR(builtin_len__doc__, "Return the number of items in a container."); #define BUILTIN_LEN_METHODDEF \ - {"len", builtin_len, METH_O, builtin_len__doc__}, + {"len", (PyCFunction)builtin_len, METH_O, builtin_len__doc__}, PyDoc_STRVAR(builtin_locals__doc__, "locals($module, /)\n" @@ -799,7 +799,7 @@ PyDoc_STRVAR(builtin_locals__doc__, "covered by any backwards compatibility guarantees."); #define BUILTIN_LOCALS_METHODDEF \ - {"locals", builtin_locals, METH_NOARGS, builtin_locals__doc__}, + {"locals", (PyCFunction)builtin_locals, METH_NOARGS, builtin_locals__doc__}, static PyObject * builtin_locals_impl(PyObject *module); @@ -820,7 +820,7 @@ PyDoc_STRVAR(builtin_oct__doc__, " \'0o1234567\'"); #define BUILTIN_OCT_METHODDEF \ - {"oct", builtin_oct, METH_O, builtin_oct__doc__}, + {"oct", (PyCFunction)builtin_oct, METH_O, builtin_oct__doc__}, PyDoc_STRVAR(builtin_ord__doc__, "ord($module, c, /)\n" @@ -829,7 +829,7 @@ PyDoc_STRVAR(builtin_ord__doc__, "Return the Unicode code point for a one-character string."); #define BUILTIN_ORD_METHODDEF \ - {"ord", builtin_ord, METH_O, builtin_ord__doc__}, + {"ord", (PyCFunction)builtin_ord, METH_O, builtin_ord__doc__}, PyDoc_STRVAR(builtin_pow__doc__, "pow($module, /, base, exp, mod=None)\n" @@ -1048,7 +1048,7 @@ PyDoc_STRVAR(builtin_repr__doc__, "For many object types, including most builtins, eval(repr(obj)) == obj."); #define BUILTIN_REPR_METHODDEF \ - {"repr", builtin_repr, METH_O, builtin_repr__doc__}, + {"repr", (PyCFunction)builtin_repr, METH_O, builtin_repr__doc__}, PyDoc_STRVAR(builtin_round__doc__, "round($module, /, number, ndigits=None)\n" @@ -1252,4 +1252,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=95665fce5b257fe3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c08e0e086a791ff0 input=a9049054013a1b77]*/ diff --git a/Python/clinic/context.c.h b/Python/clinic/context.c.h index 77f1762e4a3dd8..5ed74e6e6ddb6b 100644 --- a/Python/clinic/context.c.h +++ b/Python/clinic/context.c.h @@ -51,7 +51,7 @@ PyDoc_STRVAR(_contextvars_Context_items__doc__, "The result is returned as a list of 2-tuples (variable, value)."); #define _CONTEXTVARS_CONTEXT_ITEMS_METHODDEF \ - {"items", _contextvars_Context_items, METH_NOARGS, _contextvars_Context_items__doc__}, + {"items", (PyCFunction)_contextvars_Context_items, METH_NOARGS, _contextvars_Context_items__doc__}, static PyObject * _contextvars_Context_items_impl(PyContext *self); @@ -69,7 +69,7 @@ PyDoc_STRVAR(_contextvars_Context_keys__doc__, "Return a list of all variables in the context object."); #define _CONTEXTVARS_CONTEXT_KEYS_METHODDEF \ - {"keys", _contextvars_Context_keys, METH_NOARGS, _contextvars_Context_keys__doc__}, + {"keys", (PyCFunction)_contextvars_Context_keys, METH_NOARGS, _contextvars_Context_keys__doc__}, static PyObject * _contextvars_Context_keys_impl(PyContext *self); @@ -87,7 +87,7 @@ PyDoc_STRVAR(_contextvars_Context_values__doc__, "Return a list of all variables\' values in the context object."); #define _CONTEXTVARS_CONTEXT_VALUES_METHODDEF \ - {"values", _contextvars_Context_values, METH_NOARGS, _contextvars_Context_values__doc__}, + {"values", (PyCFunction)_contextvars_Context_values, METH_NOARGS, _contextvars_Context_values__doc__}, static PyObject * _contextvars_Context_values_impl(PyContext *self); @@ -105,7 +105,7 @@ PyDoc_STRVAR(_contextvars_Context_copy__doc__, "Return a shallow copy of the context object."); #define _CONTEXTVARS_CONTEXT_COPY_METHODDEF \ - {"copy", _contextvars_Context_copy, METH_NOARGS, _contextvars_Context_copy__doc__}, + {"copy", (PyCFunction)_contextvars_Context_copy, METH_NOARGS, _contextvars_Context_copy__doc__}, static PyObject * _contextvars_Context_copy_impl(PyContext *self); @@ -166,7 +166,7 @@ PyDoc_STRVAR(_contextvars_ContextVar_set__doc__, "value via the `ContextVar.reset()` method."); #define _CONTEXTVARS_CONTEXTVAR_SET_METHODDEF \ - {"set", _contextvars_ContextVar_set, METH_O, _contextvars_ContextVar_set__doc__}, + {"set", (PyCFunction)_contextvars_ContextVar_set, METH_O, _contextvars_ContextVar_set__doc__}, static PyObject * _contextvars_ContextVar_set_impl(PyContextVar *self, PyObject *value); @@ -191,7 +191,7 @@ PyDoc_STRVAR(_contextvars_ContextVar_reset__doc__, "created the token was used."); #define _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF \ - {"reset", _contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__}, + {"reset", (PyCFunction)_contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__}, static PyObject * _contextvars_ContextVar_reset_impl(PyContextVar *self, PyObject *token); @@ -213,7 +213,7 @@ PyDoc_STRVAR(token_enter__doc__, "Enter into Token context manager."); #define TOKEN_ENTER_METHODDEF \ - {"__enter__", token_enter, METH_NOARGS, token_enter__doc__}, + {"__enter__", (PyCFunction)token_enter, METH_NOARGS, token_enter__doc__}, static PyObject * token_enter_impl(PyContextToken *self); @@ -256,4 +256,4 @@ token_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=7c953506c4fc86ec input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3a04b2fddf24c3e9 input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 467bf3d26ee259..0e6a560d57c8ba 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -17,7 +17,7 @@ PyDoc_STRVAR(_imp_lock_held__doc__, "On platforms without threads, return False."); #define _IMP_LOCK_HELD_METHODDEF \ - {"lock_held", _imp_lock_held, METH_NOARGS, _imp_lock_held__doc__}, + {"lock_held", (PyCFunction)_imp_lock_held, METH_NOARGS, _imp_lock_held__doc__}, static PyObject * _imp_lock_held_impl(PyObject *module); @@ -38,7 +38,7 @@ PyDoc_STRVAR(_imp_acquire_lock__doc__, "modules. On platforms without threads, this function does nothing."); #define _IMP_ACQUIRE_LOCK_METHODDEF \ - {"acquire_lock", _imp_acquire_lock, METH_NOARGS, _imp_acquire_lock__doc__}, + {"acquire_lock", (PyCFunction)_imp_acquire_lock, METH_NOARGS, _imp_acquire_lock__doc__}, static PyObject * _imp_acquire_lock_impl(PyObject *module); @@ -58,7 +58,7 @@ PyDoc_STRVAR(_imp_release_lock__doc__, "On platforms without threads, this function does nothing."); #define _IMP_RELEASE_LOCK_METHODDEF \ - {"release_lock", _imp_release_lock, METH_NOARGS, _imp_release_lock__doc__}, + {"release_lock", (PyCFunction)_imp_release_lock, METH_NOARGS, _imp_release_lock__doc__}, static PyObject * _imp_release_lock_impl(PyObject *module); @@ -120,7 +120,7 @@ PyDoc_STRVAR(_imp_create_builtin__doc__, "Create an extension module."); #define _IMP_CREATE_BUILTIN_METHODDEF \ - {"create_builtin", _imp_create_builtin, METH_O, _imp_create_builtin__doc__}, + {"create_builtin", (PyCFunction)_imp_create_builtin, METH_O, _imp_create_builtin__doc__}, PyDoc_STRVAR(_imp_extension_suffixes__doc__, "extension_suffixes($module, /)\n" @@ -129,7 +129,7 @@ PyDoc_STRVAR(_imp_extension_suffixes__doc__, "Returns the list of file suffixes used to identify extension modules."); #define _IMP_EXTENSION_SUFFIXES_METHODDEF \ - {"extension_suffixes", _imp_extension_suffixes, METH_NOARGS, _imp_extension_suffixes__doc__}, + {"extension_suffixes", (PyCFunction)_imp_extension_suffixes, METH_NOARGS, _imp_extension_suffixes__doc__}, static PyObject * _imp_extension_suffixes_impl(PyObject *module); @@ -147,7 +147,7 @@ PyDoc_STRVAR(_imp_init_frozen__doc__, "Initializes a frozen module."); #define _IMP_INIT_FROZEN_METHODDEF \ - {"init_frozen", _imp_init_frozen, METH_O, _imp_init_frozen__doc__}, + {"init_frozen", (PyCFunction)_imp_init_frozen, METH_O, _imp_init_frozen__doc__}, static PyObject * _imp_init_frozen_impl(PyObject *module, PyObject *name); @@ -293,7 +293,7 @@ PyDoc_STRVAR(_imp_is_frozen_package__doc__, "Returns True if the module name is of a frozen package."); #define _IMP_IS_FROZEN_PACKAGE_METHODDEF \ - {"is_frozen_package", _imp_is_frozen_package, METH_O, _imp_is_frozen_package__doc__}, + {"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_O, _imp_is_frozen_package__doc__}, static PyObject * _imp_is_frozen_package_impl(PyObject *module, PyObject *name); @@ -322,7 +322,7 @@ PyDoc_STRVAR(_imp_is_builtin__doc__, "Returns True if the module name corresponds to a built-in module."); #define _IMP_IS_BUILTIN_METHODDEF \ - {"is_builtin", _imp_is_builtin, METH_O, _imp_is_builtin__doc__}, + {"is_builtin", (PyCFunction)_imp_is_builtin, METH_O, _imp_is_builtin__doc__}, static PyObject * _imp_is_builtin_impl(PyObject *module, PyObject *name); @@ -351,7 +351,7 @@ PyDoc_STRVAR(_imp_is_frozen__doc__, "Returns True if the module name corresponds to a frozen module."); #define _IMP_IS_FROZEN_METHODDEF \ - {"is_frozen", _imp_is_frozen, METH_O, _imp_is_frozen__doc__}, + {"is_frozen", (PyCFunction)_imp_is_frozen, METH_O, _imp_is_frozen__doc__}, static PyObject * _imp_is_frozen_impl(PyObject *module, PyObject *name); @@ -380,7 +380,7 @@ PyDoc_STRVAR(_imp__frozen_module_names__doc__, "Returns the list of available frozen modules."); #define _IMP__FROZEN_MODULE_NAMES_METHODDEF \ - {"_frozen_module_names", _imp__frozen_module_names, METH_NOARGS, _imp__frozen_module_names__doc__}, + {"_frozen_module_names", (PyCFunction)_imp__frozen_module_names, METH_NOARGS, _imp__frozen_module_names__doc__}, static PyObject * _imp__frozen_module_names_impl(PyObject *module); @@ -401,7 +401,7 @@ PyDoc_STRVAR(_imp__override_frozen_modules_for_tests__doc__, "See frozen_modules() in Lib/test/support/import_helper.py."); #define _IMP__OVERRIDE_FROZEN_MODULES_FOR_TESTS_METHODDEF \ - {"_override_frozen_modules_for_tests", _imp__override_frozen_modules_for_tests, METH_O, _imp__override_frozen_modules_for_tests__doc__}, + {"_override_frozen_modules_for_tests", (PyCFunction)_imp__override_frozen_modules_for_tests, METH_O, _imp__override_frozen_modules_for_tests__doc__}, static PyObject * _imp__override_frozen_modules_for_tests_impl(PyObject *module, int override); @@ -431,7 +431,7 @@ PyDoc_STRVAR(_imp__override_multi_interp_extensions_check__doc__, "(-1: \"never\", 1: \"always\", 0: no override)"); #define _IMP__OVERRIDE_MULTI_INTERP_EXTENSIONS_CHECK_METHODDEF \ - {"_override_multi_interp_extensions_check", _imp__override_multi_interp_extensions_check, METH_O, _imp__override_multi_interp_extensions_check__doc__}, + {"_override_multi_interp_extensions_check", (PyCFunction)_imp__override_multi_interp_extensions_check, METH_O, _imp__override_multi_interp_extensions_check__doc__}, static PyObject * _imp__override_multi_interp_extensions_check_impl(PyObject *module, @@ -500,7 +500,7 @@ PyDoc_STRVAR(_imp_exec_dynamic__doc__, "Initialize an extension module."); #define _IMP_EXEC_DYNAMIC_METHODDEF \ - {"exec_dynamic", _imp_exec_dynamic, METH_O, _imp_exec_dynamic__doc__}, + {"exec_dynamic", (PyCFunction)_imp_exec_dynamic, METH_O, _imp_exec_dynamic__doc__}, static int _imp_exec_dynamic_impl(PyObject *module, PyObject *mod); @@ -530,7 +530,7 @@ PyDoc_STRVAR(_imp_exec_builtin__doc__, "Initialize a built-in module."); #define _IMP_EXEC_BUILTIN_METHODDEF \ - {"exec_builtin", _imp_exec_builtin, METH_O, _imp_exec_builtin__doc__}, + {"exec_builtin", (PyCFunction)_imp_exec_builtin, METH_O, _imp_exec_builtin__doc__}, static int _imp_exec_builtin_impl(PyObject *module, PyObject *mod); @@ -625,4 +625,4 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=0b5e92e1f66778a4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d0e278351d6adbb1 input=a9049054013a1b77]*/ diff --git a/Python/clinic/instruction_sequence.c.h b/Python/clinic/instruction_sequence.c.h index 6920bbb3efa279..41ab2de44e426e 100644 --- a/Python/clinic/instruction_sequence.c.h +++ b/Python/clinic/instruction_sequence.c.h @@ -191,7 +191,7 @@ PyDoc_STRVAR(InstructionSequenceType_new_label__doc__, "Return a new label."); #define INSTRUCTIONSEQUENCETYPE_NEW_LABEL_METHODDEF \ - {"new_label", InstructionSequenceType_new_label, METH_NOARGS, InstructionSequenceType_new_label__doc__}, + {"new_label", (PyCFunction)InstructionSequenceType_new_label, METH_NOARGS, InstructionSequenceType_new_label__doc__}, static int InstructionSequenceType_new_label_impl(_PyInstructionSequence *self); @@ -276,7 +276,7 @@ PyDoc_STRVAR(InstructionSequenceType_get_nested__doc__, "Add a nested sequence."); #define INSTRUCTIONSEQUENCETYPE_GET_NESTED_METHODDEF \ - {"get_nested", InstructionSequenceType_get_nested, METH_NOARGS, InstructionSequenceType_get_nested__doc__}, + {"get_nested", (PyCFunction)InstructionSequenceType_get_nested, METH_NOARGS, InstructionSequenceType_get_nested__doc__}, static PyObject * InstructionSequenceType_get_nested_impl(_PyInstructionSequence *self); @@ -294,7 +294,7 @@ PyDoc_STRVAR(InstructionSequenceType_get_instructions__doc__, "Return the instructions as a list of tuples or labels."); #define INSTRUCTIONSEQUENCETYPE_GET_INSTRUCTIONS_METHODDEF \ - {"get_instructions", InstructionSequenceType_get_instructions, METH_NOARGS, InstructionSequenceType_get_instructions__doc__}, + {"get_instructions", (PyCFunction)InstructionSequenceType_get_instructions, METH_NOARGS, InstructionSequenceType_get_instructions__doc__}, static PyObject * InstructionSequenceType_get_instructions_impl(_PyInstructionSequence *self); @@ -304,4 +304,4 @@ InstructionSequenceType_get_instructions(PyObject *self, PyObject *Py_UNUSED(ign { return InstructionSequenceType_get_instructions_impl((_PyInstructionSequence *)self); } -/*[clinic end generated code: output=608608dbfba9a80c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e6b5d05bde008cc2 input=a9049054013a1b77]*/ diff --git a/Python/clinic/instrumentation.c.h b/Python/clinic/instrumentation.c.h index 7fee9c3b3628cf..9b3373bc1a67a5 100644 --- a/Python/clinic/instrumentation.c.h +++ b/Python/clinic/instrumentation.c.h @@ -42,7 +42,7 @@ PyDoc_STRVAR(monitoring_clear_tool_id__doc__, "\n"); #define MONITORING_CLEAR_TOOL_ID_METHODDEF \ - {"clear_tool_id", monitoring_clear_tool_id, METH_O, monitoring_clear_tool_id__doc__}, + {"clear_tool_id", (PyCFunction)monitoring_clear_tool_id, METH_O, monitoring_clear_tool_id__doc__}, static PyObject * monitoring_clear_tool_id_impl(PyObject *module, int tool_id); @@ -69,7 +69,7 @@ PyDoc_STRVAR(monitoring_free_tool_id__doc__, "\n"); #define MONITORING_FREE_TOOL_ID_METHODDEF \ - {"free_tool_id", monitoring_free_tool_id, METH_O, monitoring_free_tool_id__doc__}, + {"free_tool_id", (PyCFunction)monitoring_free_tool_id, METH_O, monitoring_free_tool_id__doc__}, static PyObject * monitoring_free_tool_id_impl(PyObject *module, int tool_id); @@ -96,7 +96,7 @@ PyDoc_STRVAR(monitoring_get_tool__doc__, "\n"); #define MONITORING_GET_TOOL_METHODDEF \ - {"get_tool", monitoring_get_tool, METH_O, monitoring_get_tool__doc__}, + {"get_tool", (PyCFunction)monitoring_get_tool, METH_O, monitoring_get_tool__doc__}, static PyObject * monitoring_get_tool_impl(PyObject *module, int tool_id); @@ -161,7 +161,7 @@ PyDoc_STRVAR(monitoring_get_events__doc__, "\n"); #define MONITORING_GET_EVENTS_METHODDEF \ - {"get_events", monitoring_get_events, METH_O, monitoring_get_events__doc__}, + {"get_events", (PyCFunction)monitoring_get_events, METH_O, monitoring_get_events__doc__}, static int monitoring_get_events_impl(PyObject *module, int tool_id); @@ -304,7 +304,7 @@ PyDoc_STRVAR(monitoring_restart_events__doc__, "\n"); #define MONITORING_RESTART_EVENTS_METHODDEF \ - {"restart_events", monitoring_restart_events, METH_NOARGS, monitoring_restart_events__doc__}, + {"restart_events", (PyCFunction)monitoring_restart_events, METH_NOARGS, monitoring_restart_events__doc__}, static PyObject * monitoring_restart_events_impl(PyObject *module); @@ -321,7 +321,7 @@ PyDoc_STRVAR(monitoring__all_events__doc__, "\n"); #define MONITORING__ALL_EVENTS_METHODDEF \ - {"_all_events", monitoring__all_events, METH_NOARGS, monitoring__all_events__doc__}, + {"_all_events", (PyCFunction)monitoring__all_events, METH_NOARGS, monitoring__all_events__doc__}, static PyObject * monitoring__all_events_impl(PyObject *module); @@ -331,4 +331,4 @@ monitoring__all_events(PyObject *module, PyObject *Py_UNUSED(ignored)) { return monitoring__all_events_impl(module); } -/*[clinic end generated code: output=c67603c41007f5ba input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8f81876c6aba9be8 input=a9049054013a1b77]*/ diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index 8392497177b2f0..1e53624d4d45d7 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -120,7 +120,7 @@ PyDoc_STRVAR(sys_displayhook__doc__, "Print an object to sys.stdout and also save it in builtins._"); #define SYS_DISPLAYHOOK_METHODDEF \ - {"displayhook", sys_displayhook, METH_O, sys_displayhook__doc__}, + {"displayhook", (PyCFunction)sys_displayhook, METH_O, sys_displayhook__doc__}, PyDoc_STRVAR(sys_excepthook__doc__, "excepthook($module, exctype, value, traceback, /)\n" @@ -166,7 +166,7 @@ PyDoc_STRVAR(sys_exception__doc__, "if no such exception exists."); #define SYS_EXCEPTION_METHODDEF \ - {"exception", sys_exception, METH_NOARGS, sys_exception__doc__}, + {"exception", (PyCFunction)sys_exception, METH_NOARGS, sys_exception__doc__}, static PyObject * sys_exception_impl(PyObject *module); @@ -187,7 +187,7 @@ PyDoc_STRVAR(sys_exc_info__doc__, "clause in the current stack frame or in an older stack frame."); #define SYS_EXC_INFO_METHODDEF \ - {"exc_info", sys_exc_info, METH_NOARGS, sys_exc_info__doc__}, + {"exc_info", (PyCFunction)sys_exc_info, METH_NOARGS, sys_exc_info__doc__}, static PyObject * sys_exc_info_impl(PyObject *module); @@ -213,7 +213,7 @@ PyDoc_STRVAR(sys_unraisablehook__doc__, "* object: Object causing the exception, can be None."); #define SYS_UNRAISABLEHOOK_METHODDEF \ - {"unraisablehook", sys_unraisablehook, METH_O, sys_unraisablehook__doc__}, + {"unraisablehook", (PyCFunction)sys_unraisablehook, METH_O, sys_unraisablehook__doc__}, PyDoc_STRVAR(sys_exit__doc__, "exit($module, status=None, /)\n" @@ -259,7 +259,7 @@ PyDoc_STRVAR(sys_getdefaultencoding__doc__, "Return the current default encoding used by the Unicode implementation."); #define SYS_GETDEFAULTENCODING_METHODDEF \ - {"getdefaultencoding", sys_getdefaultencoding, METH_NOARGS, sys_getdefaultencoding__doc__}, + {"getdefaultencoding", (PyCFunction)sys_getdefaultencoding, METH_NOARGS, sys_getdefaultencoding__doc__}, static PyObject * sys_getdefaultencoding_impl(PyObject *module); @@ -277,7 +277,7 @@ PyDoc_STRVAR(sys_getfilesystemencoding__doc__, "Return the encoding used to convert Unicode filenames to OS filenames."); #define SYS_GETFILESYSTEMENCODING_METHODDEF \ - {"getfilesystemencoding", sys_getfilesystemencoding, METH_NOARGS, sys_getfilesystemencoding__doc__}, + {"getfilesystemencoding", (PyCFunction)sys_getfilesystemencoding, METH_NOARGS, sys_getfilesystemencoding__doc__}, static PyObject * sys_getfilesystemencoding_impl(PyObject *module); @@ -295,7 +295,7 @@ PyDoc_STRVAR(sys_getfilesystemencodeerrors__doc__, "Return the error mode used Unicode to OS filename conversion."); #define SYS_GETFILESYSTEMENCODEERRORS_METHODDEF \ - {"getfilesystemencodeerrors", sys_getfilesystemencodeerrors, METH_NOARGS, sys_getfilesystemencodeerrors__doc__}, + {"getfilesystemencodeerrors", (PyCFunction)sys_getfilesystemencodeerrors, METH_NOARGS, sys_getfilesystemencodeerrors__doc__}, static PyObject * sys_getfilesystemencodeerrors_impl(PyObject *module); @@ -317,7 +317,7 @@ PyDoc_STRVAR(sys_intern__doc__, "the previously interned string object with the same value."); #define SYS_INTERN_METHODDEF \ - {"intern", sys_intern, METH_O, sys_intern__doc__}, + {"intern", (PyCFunction)sys_intern, METH_O, sys_intern__doc__}, static PyObject * sys_intern_impl(PyObject *module, PyObject *s); @@ -346,7 +346,7 @@ PyDoc_STRVAR(sys__is_interned__doc__, "Return True if the given string is \"interned\"."); #define SYS__IS_INTERNED_METHODDEF \ - {"_is_interned", sys__is_interned, METH_O, sys__is_interned__doc__}, + {"_is_interned", (PyCFunction)sys__is_interned, METH_O, sys__is_interned__doc__}, static int sys__is_interned_impl(PyObject *module, PyObject *string); @@ -382,7 +382,7 @@ PyDoc_STRVAR(sys__is_immortal__doc__, "This function should be used for specialized purposes only."); #define SYS__IS_IMMORTAL_METHODDEF \ - {"_is_immortal", sys__is_immortal, METH_O, sys__is_immortal__doc__}, + {"_is_immortal", (PyCFunction)sys__is_immortal, METH_O, sys__is_immortal__doc__}, static int sys__is_immortal_impl(PyObject *module, PyObject *op); @@ -413,7 +413,7 @@ PyDoc_STRVAR(sys_settrace__doc__, "in the library manual."); #define SYS_SETTRACE_METHODDEF \ - {"settrace", sys_settrace, METH_O, sys_settrace__doc__}, + {"settrace", (PyCFunction)sys_settrace, METH_O, sys_settrace__doc__}, PyDoc_STRVAR(sys__settraceallthreads__doc__, "_settraceallthreads($module, function, /)\n" @@ -425,7 +425,7 @@ PyDoc_STRVAR(sys__settraceallthreads__doc__, "in the library manual."); #define SYS__SETTRACEALLTHREADS_METHODDEF \ - {"_settraceallthreads", sys__settraceallthreads, METH_O, sys__settraceallthreads__doc__}, + {"_settraceallthreads", (PyCFunction)sys__settraceallthreads, METH_O, sys__settraceallthreads__doc__}, PyDoc_STRVAR(sys_gettrace__doc__, "gettrace($module, /)\n" @@ -436,7 +436,7 @@ PyDoc_STRVAR(sys_gettrace__doc__, "See the debugger chapter in the library manual."); #define SYS_GETTRACE_METHODDEF \ - {"gettrace", sys_gettrace, METH_NOARGS, sys_gettrace__doc__}, + {"gettrace", (PyCFunction)sys_gettrace, METH_NOARGS, sys_gettrace__doc__}, static PyObject * sys_gettrace_impl(PyObject *module); @@ -457,7 +457,7 @@ PyDoc_STRVAR(sys_setprofile__doc__, "chapter in the library manual."); #define SYS_SETPROFILE_METHODDEF \ - {"setprofile", sys_setprofile, METH_O, sys_setprofile__doc__}, + {"setprofile", (PyCFunction)sys_setprofile, METH_O, sys_setprofile__doc__}, PyDoc_STRVAR(sys__setprofileallthreads__doc__, "_setprofileallthreads($module, function, /)\n" @@ -469,7 +469,7 @@ PyDoc_STRVAR(sys__setprofileallthreads__doc__, "chapter in the library manual."); #define SYS__SETPROFILEALLTHREADS_METHODDEF \ - {"_setprofileallthreads", sys__setprofileallthreads, METH_O, sys__setprofileallthreads__doc__}, + {"_setprofileallthreads", (PyCFunction)sys__setprofileallthreads, METH_O, sys__setprofileallthreads__doc__}, PyDoc_STRVAR(sys_getprofile__doc__, "getprofile($module, /)\n" @@ -480,7 +480,7 @@ PyDoc_STRVAR(sys_getprofile__doc__, "See the profiler chapter in the library manual."); #define SYS_GETPROFILE_METHODDEF \ - {"getprofile", sys_getprofile, METH_NOARGS, sys_getprofile__doc__}, + {"getprofile", (PyCFunction)sys_getprofile, METH_NOARGS, sys_getprofile__doc__}, static PyObject * sys_getprofile_impl(PyObject *module); @@ -505,7 +505,7 @@ PyDoc_STRVAR(sys_setswitchinterval__doc__, "A typical value is 0.005 (5 milliseconds)."); #define SYS_SETSWITCHINTERVAL_METHODDEF \ - {"setswitchinterval", sys_setswitchinterval, METH_O, sys_setswitchinterval__doc__}, + {"setswitchinterval", (PyCFunction)sys_setswitchinterval, METH_O, sys_setswitchinterval__doc__}, static PyObject * sys_setswitchinterval_impl(PyObject *module, double interval); @@ -539,7 +539,7 @@ PyDoc_STRVAR(sys_getswitchinterval__doc__, "Return the current thread switch interval; see sys.setswitchinterval()."); #define SYS_GETSWITCHINTERVAL_METHODDEF \ - {"getswitchinterval", sys_getswitchinterval, METH_NOARGS, sys_getswitchinterval__doc__}, + {"getswitchinterval", (PyCFunction)sys_getswitchinterval, METH_NOARGS, sys_getswitchinterval__doc__}, static double sys_getswitchinterval_impl(PyObject *module); @@ -571,7 +571,7 @@ PyDoc_STRVAR(sys_setrecursionlimit__doc__, "dependent."); #define SYS_SETRECURSIONLIMIT_METHODDEF \ - {"setrecursionlimit", sys_setrecursionlimit, METH_O, sys_setrecursionlimit__doc__}, + {"setrecursionlimit", (PyCFunction)sys_setrecursionlimit, METH_O, sys_setrecursionlimit__doc__}, static PyObject * sys_setrecursionlimit_impl(PyObject *module, int new_limit); @@ -663,7 +663,7 @@ PyDoc_STRVAR(sys_get_coroutine_origin_tracking_depth__doc__, "Check status of origin tracking for coroutine objects in this thread."); #define SYS_GET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF \ - {"get_coroutine_origin_tracking_depth", sys_get_coroutine_origin_tracking_depth, METH_NOARGS, sys_get_coroutine_origin_tracking_depth__doc__}, + {"get_coroutine_origin_tracking_depth", (PyCFunction)sys_get_coroutine_origin_tracking_depth, METH_NOARGS, sys_get_coroutine_origin_tracking_depth__doc__}, static int sys_get_coroutine_origin_tracking_depth_impl(PyObject *module); @@ -693,7 +693,7 @@ PyDoc_STRVAR(sys_get_asyncgen_hooks__doc__, "This returns a namedtuple of the form (firstiter, finalizer)."); #define SYS_GET_ASYNCGEN_HOOKS_METHODDEF \ - {"get_asyncgen_hooks", sys_get_asyncgen_hooks, METH_NOARGS, sys_get_asyncgen_hooks__doc__}, + {"get_asyncgen_hooks", (PyCFunction)sys_get_asyncgen_hooks, METH_NOARGS, sys_get_asyncgen_hooks__doc__}, static PyObject * sys_get_asyncgen_hooks_impl(PyObject *module); @@ -715,7 +715,7 @@ PyDoc_STRVAR(sys_getrecursionlimit__doc__, "of the C stack and crashing Python."); #define SYS_GETRECURSIONLIMIT_METHODDEF \ - {"getrecursionlimit", sys_getrecursionlimit, METH_NOARGS, sys_getrecursionlimit__doc__}, + {"getrecursionlimit", (PyCFunction)sys_getrecursionlimit, METH_NOARGS, sys_getrecursionlimit__doc__}, static PyObject * sys_getrecursionlimit_impl(PyObject *module); @@ -745,7 +745,7 @@ PyDoc_STRVAR(sys_getwindowsversion__doc__, "intended for identifying the OS rather than feature detection."); #define SYS_GETWINDOWSVERSION_METHODDEF \ - {"getwindowsversion", sys_getwindowsversion, METH_NOARGS, sys_getwindowsversion__doc__}, + {"getwindowsversion", (PyCFunction)sys_getwindowsversion, METH_NOARGS, sys_getwindowsversion__doc__}, static PyObject * sys_getwindowsversion_impl(PyObject *module); @@ -773,7 +773,7 @@ PyDoc_STRVAR(sys__enablelegacywindowsfsencoding__doc__, "environment variable before launching Python."); #define SYS__ENABLELEGACYWINDOWSFSENCODING_METHODDEF \ - {"_enablelegacywindowsfsencoding", sys__enablelegacywindowsfsencoding, METH_NOARGS, sys__enablelegacywindowsfsencoding__doc__}, + {"_enablelegacywindowsfsencoding", (PyCFunction)sys__enablelegacywindowsfsencoding, METH_NOARGS, sys__enablelegacywindowsfsencoding__doc__}, static PyObject * sys__enablelegacywindowsfsencoding_impl(PyObject *module); @@ -803,7 +803,7 @@ PyDoc_STRVAR(sys_setdlopenflags__doc__, "os.RTLD_LAZY)."); #define SYS_SETDLOPENFLAGS_METHODDEF \ - {"setdlopenflags", sys_setdlopenflags, METH_O, sys_setdlopenflags__doc__}, + {"setdlopenflags", (PyCFunction)sys_setdlopenflags, METH_O, sys_setdlopenflags__doc__}, static PyObject * sys_setdlopenflags_impl(PyObject *module, int new_val); @@ -837,7 +837,7 @@ PyDoc_STRVAR(sys_getdlopenflags__doc__, "The flag constants are defined in the os module."); #define SYS_GETDLOPENFLAGS_METHODDEF \ - {"getdlopenflags", sys_getdlopenflags, METH_NOARGS, sys_getdlopenflags__doc__}, + {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_NOARGS, sys_getdlopenflags__doc__}, static PyObject * sys_getdlopenflags_impl(PyObject *module); @@ -858,7 +858,7 @@ PyDoc_STRVAR(sys_mdebug__doc__, "\n"); #define SYS_MDEBUG_METHODDEF \ - {"mdebug", sys_mdebug, METH_O, sys_mdebug__doc__}, + {"mdebug", (PyCFunction)sys_mdebug, METH_O, sys_mdebug__doc__}, static PyObject * sys_mdebug_impl(PyObject *module, int flag); @@ -888,7 +888,7 @@ PyDoc_STRVAR(sys_get_int_max_str_digits__doc__, "Return the maximum string digits limit for non-binary int<->str conversions."); #define SYS_GET_INT_MAX_STR_DIGITS_METHODDEF \ - {"get_int_max_str_digits", sys_get_int_max_str_digits, METH_NOARGS, sys_get_int_max_str_digits__doc__}, + {"get_int_max_str_digits", (PyCFunction)sys_get_int_max_str_digits, METH_NOARGS, sys_get_int_max_str_digits__doc__}, static PyObject * sys_get_int_max_str_digits_impl(PyObject *module); @@ -969,7 +969,7 @@ PyDoc_STRVAR(sys_getrefcount__doc__, "getrefcount()."); #define SYS_GETREFCOUNT_METHODDEF \ - {"getrefcount", sys_getrefcount, METH_O, sys_getrefcount__doc__}, + {"getrefcount", (PyCFunction)sys_getrefcount, METH_O, sys_getrefcount__doc__}, static Py_ssize_t sys_getrefcount_impl(PyObject *module, PyObject *object); @@ -998,7 +998,7 @@ PyDoc_STRVAR(sys_gettotalrefcount__doc__, "\n"); #define SYS_GETTOTALREFCOUNT_METHODDEF \ - {"gettotalrefcount", sys_gettotalrefcount, METH_NOARGS, sys_gettotalrefcount__doc__}, + {"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS, sys_gettotalrefcount__doc__}, static Py_ssize_t sys_gettotalrefcount_impl(PyObject *module); @@ -1028,7 +1028,7 @@ PyDoc_STRVAR(sys_getallocatedblocks__doc__, "Return the number of memory blocks currently allocated."); #define SYS_GETALLOCATEDBLOCKS_METHODDEF \ - {"getallocatedblocks", sys_getallocatedblocks, METH_NOARGS, sys_getallocatedblocks__doc__}, + {"getallocatedblocks", (PyCFunction)sys_getallocatedblocks, METH_NOARGS, sys_getallocatedblocks__doc__}, static Py_ssize_t sys_getallocatedblocks_impl(PyObject *module); @@ -1170,7 +1170,7 @@ PyDoc_STRVAR(sys__current_frames__doc__, "This function should be used for specialized purposes only."); #define SYS__CURRENT_FRAMES_METHODDEF \ - {"_current_frames", sys__current_frames, METH_NOARGS, sys__current_frames__doc__}, + {"_current_frames", (PyCFunction)sys__current_frames, METH_NOARGS, sys__current_frames__doc__}, static PyObject * sys__current_frames_impl(PyObject *module); @@ -1190,7 +1190,7 @@ PyDoc_STRVAR(sys__current_exceptions__doc__, "This function should be used for specialized purposes only."); #define SYS__CURRENT_EXCEPTIONS_METHODDEF \ - {"_current_exceptions", sys__current_exceptions, METH_NOARGS, sys__current_exceptions__doc__}, + {"_current_exceptions", (PyCFunction)sys__current_exceptions, METH_NOARGS, sys__current_exceptions__doc__}, static PyObject * sys__current_exceptions_impl(PyObject *module); @@ -1249,7 +1249,7 @@ PyDoc_STRVAR(sys__debugmallocstats__doc__, "checks."); #define SYS__DEBUGMALLOCSTATS_METHODDEF \ - {"_debugmallocstats", sys__debugmallocstats, METH_NOARGS, sys__debugmallocstats__doc__}, + {"_debugmallocstats", (PyCFunction)sys__debugmallocstats, METH_NOARGS, sys__debugmallocstats__doc__}, static PyObject * sys__debugmallocstats_impl(PyObject *module); @@ -1267,7 +1267,7 @@ PyDoc_STRVAR(sys__clear_type_cache__doc__, "Clear the internal type lookup cache."); #define SYS__CLEAR_TYPE_CACHE_METHODDEF \ - {"_clear_type_cache", sys__clear_type_cache, METH_NOARGS, sys__clear_type_cache__doc__}, + {"_clear_type_cache", (PyCFunction)sys__clear_type_cache, METH_NOARGS, sys__clear_type_cache__doc__}, static PyObject * sys__clear_type_cache_impl(PyObject *module); @@ -1285,7 +1285,7 @@ PyDoc_STRVAR(sys__clear_internal_caches__doc__, "Clear all internal performance-related caches."); #define SYS__CLEAR_INTERNAL_CACHES_METHODDEF \ - {"_clear_internal_caches", sys__clear_internal_caches, METH_NOARGS, sys__clear_internal_caches__doc__}, + {"_clear_internal_caches", (PyCFunction)sys__clear_internal_caches, METH_NOARGS, sys__clear_internal_caches__doc__}, static PyObject * sys__clear_internal_caches_impl(PyObject *module); @@ -1303,7 +1303,7 @@ PyDoc_STRVAR(sys_is_finalizing__doc__, "Return True if Python is exiting."); #define SYS_IS_FINALIZING_METHODDEF \ - {"is_finalizing", sys_is_finalizing, METH_NOARGS, sys_is_finalizing__doc__}, + {"is_finalizing", (PyCFunction)sys_is_finalizing, METH_NOARGS, sys_is_finalizing__doc__}, static PyObject * sys_is_finalizing_impl(PyObject *module); @@ -1323,7 +1323,7 @@ PyDoc_STRVAR(sys__stats_on__doc__, "Turns on stats gathering (stats gathering is off by default)."); #define SYS__STATS_ON_METHODDEF \ - {"_stats_on", sys__stats_on, METH_NOARGS, sys__stats_on__doc__}, + {"_stats_on", (PyCFunction)sys__stats_on, METH_NOARGS, sys__stats_on__doc__}, static PyObject * sys__stats_on_impl(PyObject *module); @@ -1345,7 +1345,7 @@ PyDoc_STRVAR(sys__stats_off__doc__, "Turns off stats gathering (stats gathering is off by default)."); #define SYS__STATS_OFF_METHODDEF \ - {"_stats_off", sys__stats_off, METH_NOARGS, sys__stats_off__doc__}, + {"_stats_off", (PyCFunction)sys__stats_off, METH_NOARGS, sys__stats_off__doc__}, static PyObject * sys__stats_off_impl(PyObject *module); @@ -1367,7 +1367,7 @@ PyDoc_STRVAR(sys__stats_clear__doc__, "Clears the stats."); #define SYS__STATS_CLEAR_METHODDEF \ - {"_stats_clear", sys__stats_clear, METH_NOARGS, sys__stats_clear__doc__}, + {"_stats_clear", (PyCFunction)sys__stats_clear, METH_NOARGS, sys__stats_clear__doc__}, static PyObject * sys__stats_clear_impl(PyObject *module); @@ -1391,7 +1391,7 @@ PyDoc_STRVAR(sys__stats_dump__doc__, "Return False if no statistics were not dumped because stats gathering was off."); #define SYS__STATS_DUMP_METHODDEF \ - {"_stats_dump", sys__stats_dump, METH_NOARGS, sys__stats_dump__doc__}, + {"_stats_dump", (PyCFunction)sys__stats_dump, METH_NOARGS, sys__stats_dump__doc__}, static int sys__stats_dump_impl(PyObject *module); @@ -1423,7 +1423,7 @@ PyDoc_STRVAR(sys_getandroidapilevel__doc__, "Return the build time API version of Android as an integer."); #define SYS_GETANDROIDAPILEVEL_METHODDEF \ - {"getandroidapilevel", sys_getandroidapilevel, METH_NOARGS, sys_getandroidapilevel__doc__}, + {"getandroidapilevel", (PyCFunction)sys_getandroidapilevel, METH_NOARGS, sys_getandroidapilevel__doc__}, static PyObject * sys_getandroidapilevel_impl(PyObject *module); @@ -1443,7 +1443,7 @@ PyDoc_STRVAR(sys_activate_stack_trampoline__doc__, "Activate stack profiler trampoline *backend*."); #define SYS_ACTIVATE_STACK_TRAMPOLINE_METHODDEF \ - {"activate_stack_trampoline", sys_activate_stack_trampoline, METH_O, sys_activate_stack_trampoline__doc__}, + {"activate_stack_trampoline", (PyCFunction)sys_activate_stack_trampoline, METH_O, sys_activate_stack_trampoline__doc__}, static PyObject * sys_activate_stack_trampoline_impl(PyObject *module, const char *backend); @@ -1482,7 +1482,7 @@ PyDoc_STRVAR(sys_deactivate_stack_trampoline__doc__, "If no stack profiler is activated, this function has no effect."); #define SYS_DEACTIVATE_STACK_TRAMPOLINE_METHODDEF \ - {"deactivate_stack_trampoline", sys_deactivate_stack_trampoline, METH_NOARGS, sys_deactivate_stack_trampoline__doc__}, + {"deactivate_stack_trampoline", (PyCFunction)sys_deactivate_stack_trampoline, METH_NOARGS, sys_deactivate_stack_trampoline__doc__}, static PyObject * sys_deactivate_stack_trampoline_impl(PyObject *module); @@ -1500,7 +1500,7 @@ PyDoc_STRVAR(sys_is_stack_trampoline_active__doc__, "Return *True* if a stack profiler trampoline is active."); #define SYS_IS_STACK_TRAMPOLINE_ACTIVE_METHODDEF \ - {"is_stack_trampoline_active", sys_is_stack_trampoline_active, METH_NOARGS, sys_is_stack_trampoline_active__doc__}, + {"is_stack_trampoline_active", (PyCFunction)sys_is_stack_trampoline_active, METH_NOARGS, sys_is_stack_trampoline_active__doc__}, static PyObject * sys_is_stack_trampoline_active_impl(PyObject *module); @@ -1644,7 +1644,7 @@ PyDoc_STRVAR(sys__get_cpu_count_config__doc__, "Private function for getting PyConfig.cpu_count"); #define SYS__GET_CPU_COUNT_CONFIG_METHODDEF \ - {"_get_cpu_count_config", sys__get_cpu_count_config, METH_NOARGS, sys__get_cpu_count_config__doc__}, + {"_get_cpu_count_config", (PyCFunction)sys__get_cpu_count_config, METH_NOARGS, sys__get_cpu_count_config__doc__}, static int sys__get_cpu_count_config_impl(PyObject *module); @@ -1672,7 +1672,7 @@ PyDoc_STRVAR(sys__baserepl__doc__, "Private function for getting the base REPL"); #define SYS__BASEREPL_METHODDEF \ - {"_baserepl", sys__baserepl, METH_NOARGS, sys__baserepl__doc__}, + {"_baserepl", (PyCFunction)sys__baserepl, METH_NOARGS, sys__baserepl__doc__}, static PyObject * sys__baserepl_impl(PyObject *module); @@ -1690,7 +1690,7 @@ PyDoc_STRVAR(sys__is_gil_enabled__doc__, "Return True if the GIL is currently enabled and False otherwise."); #define SYS__IS_GIL_ENABLED_METHODDEF \ - {"_is_gil_enabled", sys__is_gil_enabled, METH_NOARGS, sys__is_gil_enabled__doc__}, + {"_is_gil_enabled", (PyCFunction)sys__is_gil_enabled, METH_NOARGS, sys__is_gil_enabled__doc__}, static int sys__is_gil_enabled_impl(PyObject *module); @@ -1754,4 +1754,4 @@ sys__is_gil_enabled(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=f600d96ec198ada5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1e5f608092c12636 input=a9049054013a1b77]*/ diff --git a/Tools/clinic/libclinic/parse_args.py b/Tools/clinic/libclinic/parse_args.py index a28167441a2b39..b357e9d53c6131 100644 --- a/Tools/clinic/libclinic/parse_args.py +++ b/Tools/clinic/libclinic/parse_args.py @@ -834,9 +834,9 @@ def handle_new_or_init(self) -> None: def process_methoddef(self, clang: CLanguage) -> None: methoddef_cast_end = "" if self.flags in ('METH_NOARGS', 'METH_O', 'METH_VARARGS'): - methoddef_cast = "" # no need to cast to PyCFunction + methoddef_cast = "(PyCFunction)" elif self.func.kind is GETTER: - methoddef_cast = "" # This should end up unused + methoddef_cast = "" # This should end up unused elif self.limited_capi: methoddef_cast = "(PyCFunction)(void(*)(void))" else: From abd0f7c10a92a0f35189c1a4c1fc49b20a303c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Mon, 24 Mar 2025 10:52:31 +0100 Subject: [PATCH 09/12] make clinic --- Lib/test/clinic.test.c | 76 +++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/Lib/test/clinic.test.c b/Lib/test/clinic.test.c index 7097e284be49ea..cf7cff857a538c 100644 --- a/Lib/test/clinic.test.c +++ b/Lib/test/clinic.test.c @@ -133,11 +133,11 @@ PyDoc_STRVAR(test_object_converter_one_arg__doc__, "\n"); #define TEST_OBJECT_CONVERTER_ONE_ARG_METHODDEF \ - {"test_object_converter_one_arg", test_object_converter_one_arg, METH_O, test_object_converter_one_arg__doc__}, + {"test_object_converter_one_arg", (PyCFunction)test_object_converter_one_arg, METH_O, test_object_converter_one_arg__doc__}, static PyObject * test_object_converter_one_arg(PyObject *module, PyObject *a) -/*[clinic end generated code: output=a1272d4a621e3280 input=d635d92a421f1ca3]*/ +/*[clinic end generated code: output=6da755f8502139df input=d635d92a421f1ca3]*/ /*[clinic input] @@ -315,7 +315,7 @@ PyDoc_STRVAR(test_PyBytesObject_converter__doc__, "\n"); #define TEST_PYBYTESOBJECT_CONVERTER_METHODDEF \ - {"test_PyBytesObject_converter", test_PyBytesObject_converter, METH_O, test_PyBytesObject_converter__doc__}, + {"test_PyBytesObject_converter", (PyCFunction)test_PyBytesObject_converter, METH_O, test_PyBytesObject_converter__doc__}, static PyObject * test_PyBytesObject_converter_impl(PyObject *module, PyBytesObject *a); @@ -339,7 +339,7 @@ test_PyBytesObject_converter(PyObject *module, PyObject *arg) static PyObject * test_PyBytesObject_converter_impl(PyObject *module, PyBytesObject *a) -/*[clinic end generated code: output=a1f2b92832ee6372 input=12b10c7cb5750400]*/ +/*[clinic end generated code: output=7539d628e6fceace input=12b10c7cb5750400]*/ /*[clinic input] @@ -356,7 +356,7 @@ PyDoc_STRVAR(test_PyByteArrayObject_converter__doc__, "\n"); #define TEST_PYBYTEARRAYOBJECT_CONVERTER_METHODDEF \ - {"test_PyByteArrayObject_converter", test_PyByteArrayObject_converter, METH_O, test_PyByteArrayObject_converter__doc__}, + {"test_PyByteArrayObject_converter", (PyCFunction)test_PyByteArrayObject_converter, METH_O, test_PyByteArrayObject_converter__doc__}, static PyObject * test_PyByteArrayObject_converter_impl(PyObject *module, PyByteArrayObject *a); @@ -380,7 +380,7 @@ test_PyByteArrayObject_converter(PyObject *module, PyObject *arg) static PyObject * test_PyByteArrayObject_converter_impl(PyObject *module, PyByteArrayObject *a) -/*[clinic end generated code: output=745c66001160f9cf input=5a657da535d194ae]*/ +/*[clinic end generated code: output=1245af9f5b3e355e input=5a657da535d194ae]*/ /*[clinic input] @@ -397,7 +397,7 @@ PyDoc_STRVAR(test_unicode_converter__doc__, "\n"); #define TEST_UNICODE_CONVERTER_METHODDEF \ - {"test_unicode_converter", test_unicode_converter, METH_O, test_unicode_converter__doc__}, + {"test_unicode_converter", (PyCFunction)test_unicode_converter, METH_O, test_unicode_converter__doc__}, static PyObject * test_unicode_converter_impl(PyObject *module, PyObject *a); @@ -421,7 +421,7 @@ test_unicode_converter(PyObject *module, PyObject *arg) static PyObject * test_unicode_converter_impl(PyObject *module, PyObject *a) -/*[clinic end generated code: output=d3eba4040b357127 input=aa33612df92aa9c5]*/ +/*[clinic end generated code: output=8c1625cc272c1f3d input=aa33612df92aa9c5]*/ /*[clinic input] @@ -1857,7 +1857,7 @@ PyDoc_STRVAR(test_Py_complex_converter__doc__, "\n"); #define TEST_PY_COMPLEX_CONVERTER_METHODDEF \ - {"test_Py_complex_converter", test_Py_complex_converter, METH_O, test_Py_complex_converter__doc__}, + {"test_Py_complex_converter", (PyCFunction)test_Py_complex_converter, METH_O, test_Py_complex_converter__doc__}, static PyObject * test_Py_complex_converter_impl(PyObject *module, Py_complex a); @@ -1880,7 +1880,7 @@ test_Py_complex_converter(PyObject *module, PyObject *arg) static PyObject * test_Py_complex_converter_impl(PyObject *module, Py_complex a) -/*[clinic end generated code: output=86f47ff04e11183c input=070f216a515beb79]*/ +/*[clinic end generated code: output=c2ecbec2144ca540 input=070f216a515beb79]*/ /*[clinic input] @@ -4001,7 +4001,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_condition_a__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF \ - {"test_preprocessor_guarded_condition_a", test_preprocessor_guarded_condition_a, METH_NOARGS, test_preprocessor_guarded_condition_a__doc__}, + {"test_preprocessor_guarded_condition_a", (PyCFunction)test_preprocessor_guarded_condition_a, METH_NOARGS, test_preprocessor_guarded_condition_a__doc__}, static PyObject * test_preprocessor_guarded_condition_a(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4019,7 +4019,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_elif_condition_b__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF \ - {"test_preprocessor_guarded_elif_condition_b", test_preprocessor_guarded_elif_condition_b, METH_NOARGS, test_preprocessor_guarded_elif_condition_b__doc__}, + {"test_preprocessor_guarded_elif_condition_b", (PyCFunction)test_preprocessor_guarded_elif_condition_b, METH_NOARGS, test_preprocessor_guarded_elif_condition_b__doc__}, static PyObject * test_preprocessor_guarded_elif_condition_b(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4037,7 +4037,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_else__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF \ - {"test_preprocessor_guarded_else", test_preprocessor_guarded_else, METH_NOARGS, test_preprocessor_guarded_else__doc__}, + {"test_preprocessor_guarded_else", (PyCFunction)test_preprocessor_guarded_else, METH_NOARGS, test_preprocessor_guarded_else__doc__}, static PyObject * test_preprocessor_guarded_else(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4055,7 +4055,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_ifndef_condition_c__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_IFNDEF_CONDITION_C_METHODDEF \ - {"test_preprocessor_guarded_ifndef_condition_c", test_preprocessor_guarded_ifndef_condition_c, METH_NOARGS, test_preprocessor_guarded_ifndef_condition_c__doc__}, + {"test_preprocessor_guarded_ifndef_condition_c", (PyCFunction)test_preprocessor_guarded_ifndef_condition_c, METH_NOARGS, test_preprocessor_guarded_ifndef_condition_c__doc__}, static PyObject * test_preprocessor_guarded_ifndef_condition_c(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4073,7 +4073,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_ifndef_not_condition_c__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_IFNDEF_NOT_CONDITION_C_METHODDEF \ - {"test_preprocessor_guarded_ifndef_not_condition_c", test_preprocessor_guarded_ifndef_not_condition_c, METH_NOARGS, test_preprocessor_guarded_ifndef_not_condition_c__doc__}, + {"test_preprocessor_guarded_ifndef_not_condition_c", (PyCFunction)test_preprocessor_guarded_ifndef_not_condition_c, METH_NOARGS, test_preprocessor_guarded_ifndef_not_condition_c__doc__}, static PyObject * test_preprocessor_guarded_ifndef_not_condition_c(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4091,7 +4091,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_if_with_continuation__doc__, "\n"); #define TEST_PREPROCESSOR_GUARDED_IF_WITH_CONTINUATION_METHODDEF \ - {"test_preprocessor_guarded_if_with_continuation", test_preprocessor_guarded_if_with_continuation, METH_NOARGS, test_preprocessor_guarded_if_with_continuation__doc__}, + {"test_preprocessor_guarded_if_with_continuation", (PyCFunction)test_preprocessor_guarded_if_with_continuation, METH_NOARGS, test_preprocessor_guarded_if_with_continuation__doc__}, static PyObject * test_preprocessor_guarded_if_with_continuation(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4110,7 +4110,7 @@ PyDoc_STRVAR(test_preprocessor_guarded_if_e_or_f__doc__, "Makes sure cpp.Monitor handles other directives than preprocessor conditionals."); #define TEST_PREPROCESSOR_GUARDED_IF_E_OR_F_METHODDEF \ - {"test_preprocessor_guarded_if_e_or_f", test_preprocessor_guarded_if_e_or_f, METH_NOARGS, test_preprocessor_guarded_if_e_or_f__doc__}, + {"test_preprocessor_guarded_if_e_or_f", (PyCFunction)test_preprocessor_guarded_if_e_or_f, METH_NOARGS, test_preprocessor_guarded_if_e_or_f__doc__}, static PyObject * test_preprocessor_guarded_if_e_or_f(PyObject *module, PyObject *Py_UNUSED(ignored)) @@ -4147,7 +4147,7 @@ test_preprocessor_guarded_if_e_or_f(PyObject *module, PyObject *Py_UNUSED(ignore #ifndef TEST_PREPROCESSOR_GUARDED_IF_E_OR_F_METHODDEF #define TEST_PREPROCESSOR_GUARDED_IF_E_OR_F_METHODDEF #endif /* !defined(TEST_PREPROCESSOR_GUARDED_IF_E_OR_F_METHODDEF) */ -/*[clinic end generated code: output=e693034dd5190490 input=3fc80c9989d2f2e1]*/ +/*[clinic end generated code: output=fcfae7cac7a99e62 input=3fc80c9989d2f2e1]*/ /*[clinic input] test_vararg_and_posonly @@ -4934,7 +4934,7 @@ PyDoc_STRVAR(Test_metho_not_default_return_converter__doc__, "\n"); #define TEST_METHO_NOT_DEFAULT_RETURN_CONVERTER_METHODDEF \ - {"metho_not_default_return_converter", Test_metho_not_default_return_converter, METH_O, Test_metho_not_default_return_converter__doc__}, + {"metho_not_default_return_converter", (PyCFunction)Test_metho_not_default_return_converter, METH_O, Test_metho_not_default_return_converter__doc__}, static int Test_metho_not_default_return_converter_impl(TestObj *self, PyObject *a); @@ -4957,7 +4957,7 @@ Test_metho_not_default_return_converter(PyObject *self, PyObject *a) static int Test_metho_not_default_return_converter_impl(TestObj *self, PyObject *a) -/*[clinic end generated code: output=463ed281a4a3746b input=428657129b521177]*/ +/*[clinic end generated code: output=8b03f5213c312138 input=428657129b521177]*/ /*[clinic input] @@ -4977,7 +4977,7 @@ PyDoc_STRVAR(Test_an_metho_arg_named_arg__doc__, " Name should be mangled to \'arg_\' in generated output."); #define TEST_AN_METHO_ARG_NAMED_ARG_METHODDEF \ - {"an_metho_arg_named_arg", Test_an_metho_arg_named_arg, METH_O, Test_an_metho_arg_named_arg__doc__}, + {"an_metho_arg_named_arg", (PyCFunction)Test_an_metho_arg_named_arg, METH_O, Test_an_metho_arg_named_arg__doc__}, static PyObject * Test_an_metho_arg_named_arg_impl(TestObj *self, int arg); @@ -5000,7 +5000,7 @@ Test_an_metho_arg_named_arg(PyObject *self, PyObject *arg_) static PyObject * Test_an_metho_arg_named_arg_impl(TestObj *self, int arg) -/*[clinic end generated code: output=bc7ffcb6f7243cdd input=2a53a57cf5624f95]*/ +/*[clinic end generated code: output=38554f09950d07e7 input=2a53a57cf5624f95]*/ /*[clinic input] @@ -5229,7 +5229,7 @@ PyDoc_STRVAR(Test_class_method__doc__, "\n"); #define TEST_CLASS_METHOD_METHODDEF \ - {"class_method", Test_class_method, METH_NOARGS|METH_CLASS, Test_class_method__doc__}, + {"class_method", (PyCFunction)Test_class_method, METH_NOARGS|METH_CLASS, Test_class_method__doc__}, static PyObject * Test_class_method_impl(PyTypeObject *type); @@ -5242,7 +5242,7 @@ Test_class_method(PyObject *type, PyObject *Py_UNUSED(ignored)) static PyObject * Test_class_method_impl(PyTypeObject *type) -/*[clinic end generated code: output=dbf944c1125c4c79 input=43bc4a0494547b80]*/ +/*[clinic end generated code: output=64f93e6252bde409 input=43bc4a0494547b80]*/ /*[clinic input] @@ -5256,7 +5256,7 @@ PyDoc_STRVAR(Test_static_method__doc__, "\n"); #define TEST_STATIC_METHOD_METHODDEF \ - {"static_method", Test_static_method, METH_NOARGS|METH_STATIC, Test_static_method__doc__}, + {"static_method", (PyCFunction)Test_static_method, METH_NOARGS|METH_STATIC, Test_static_method__doc__}, static PyObject * Test_static_method_impl(); @@ -5269,7 +5269,7 @@ Test_static_method(PyObject *null, PyObject *Py_UNUSED(ignored)) static PyObject * Test_static_method_impl() -/*[clinic end generated code: output=e21462ae93b4645c input=dae892fac55ae72b]*/ +/*[clinic end generated code: output=9e401fb6ed56a4f3 input=dae892fac55ae72b]*/ /*[clinic input] @@ -5283,7 +5283,7 @@ PyDoc_STRVAR(Test_meth_coexist__doc__, "\n"); #define TEST_METH_COEXIST_METHODDEF \ - {"meth_coexist", Test_meth_coexist, METH_NOARGS|METH_COEXIST, Test_meth_coexist__doc__}, + {"meth_coexist", (PyCFunction)Test_meth_coexist, METH_NOARGS|METH_COEXIST, Test_meth_coexist__doc__}, static PyObject * Test_meth_coexist_impl(TestObj *self); @@ -5296,7 +5296,7 @@ Test_meth_coexist(PyObject *self, PyObject *Py_UNUSED(ignored)) static PyObject * Test_meth_coexist_impl(TestObj *self) -/*[clinic end generated code: output=9e43248bae46ad30 input=2a1d75b5e6fec6dd]*/ +/*[clinic end generated code: output=7edf4e95b29f06fa input=2a1d75b5e6fec6dd]*/ /*[clinic input] @getter @@ -5563,7 +5563,7 @@ PyDoc_STRVAR(bool_return__doc__, "\n"); #define BOOL_RETURN_METHODDEF \ - {"bool_return", bool_return, METH_NOARGS, bool_return__doc__}, + {"bool_return", (PyCFunction)bool_return, METH_NOARGS, bool_return__doc__}, static int bool_return_impl(PyObject *module); @@ -5586,7 +5586,7 @@ bool_return(PyObject *module, PyObject *Py_UNUSED(ignored)) static int bool_return_impl(PyObject *module) -/*[clinic end generated code: output=6c8ef775e67e345f input=93ba95d39ee98f39]*/ +/*[clinic end generated code: output=3a65f07830e48e98 input=93ba95d39ee98f39]*/ /*[clinic input] @@ -5599,7 +5599,7 @@ PyDoc_STRVAR(double_return__doc__, "\n"); #define DOUBLE_RETURN_METHODDEF \ - {"double_return", double_return, METH_NOARGS, double_return__doc__}, + {"double_return", (PyCFunction)double_return, METH_NOARGS, double_return__doc__}, static double double_return_impl(PyObject *module); @@ -5622,7 +5622,7 @@ double_return(PyObject *module, PyObject *Py_UNUSED(ignored)) static double double_return_impl(PyObject *module) -/*[clinic end generated code: output=9730b7e722925cec input=da11b6255e4cbfd7]*/ +/*[clinic end generated code: output=076dc72595d3f66d input=da11b6255e4cbfd7]*/ /*[clinic input] @@ -5912,7 +5912,7 @@ PyDoc_STRVAR(test_critical_section__doc__, "\n"); #define TEST_CRITICAL_SECTION_METHODDEF \ - {"test_critical_section", test_critical_section, METH_NOARGS, test_critical_section__doc__}, + {"test_critical_section", (PyCFunction)test_critical_section, METH_NOARGS, test_critical_section__doc__}, static PyObject * test_critical_section_impl(PyObject *module); @@ -5931,7 +5931,7 @@ test_critical_section(PyObject *module, PyObject *Py_UNUSED(ignored)) static PyObject * test_critical_section_impl(PyObject *module) -/*[clinic end generated code: output=94a82ca7cb65a84a input=8c58956d6ff00f80]*/ +/*[clinic end generated code: output=9d5a87bb28aa3f0c input=8c58956d6ff00f80]*/ /*[clinic input] @@ -5947,7 +5947,7 @@ PyDoc_STRVAR(test_critical_section_meth_o__doc__, "\n"); #define TEST_CRITICAL_SECTION_METH_O_METHODDEF \ - {"test_critical_section_meth_o", test_critical_section_meth_o, METH_O, test_critical_section_meth_o__doc__}, + {"test_critical_section_meth_o", (PyCFunction)test_critical_section_meth_o, METH_O, test_critical_section_meth_o__doc__}, static PyObject * test_critical_section_meth_o_impl(PyObject *module, PyObject *a); @@ -5973,7 +5973,7 @@ test_critical_section_meth_o(PyObject *module, PyObject *arg) static PyObject * test_critical_section_meth_o_impl(PyObject *module, PyObject *a) -/*[clinic end generated code: output=6276bd911b60c196 input=376533f51eceb6c3]*/ +/*[clinic end generated code: output=7a9d7420802d1202 input=376533f51eceb6c3]*/ /*[clinic input] @critical_section a @@ -5990,7 +5990,7 @@ PyDoc_STRVAR(test_critical_section_object__doc__, "test_critical_section_object"); #define TEST_CRITICAL_SECTION_OBJECT_METHODDEF \ - {"test_critical_section_object", test_critical_section_object, METH_O, test_critical_section_object__doc__}, + {"test_critical_section_object", (PyCFunction)test_critical_section_object, METH_O, test_critical_section_object__doc__}, static PyObject * test_critical_section_object_impl(PyObject *module, PyObject *a); @@ -6016,7 +6016,7 @@ test_critical_section_object(PyObject *module, PyObject *arg) static PyObject * test_critical_section_object_impl(PyObject *module, PyObject *a) -/*[clinic end generated code: output=975dc9674e9c5bfa input=6f67f91b523c875f]*/ +/*[clinic end generated code: output=ec06df92232b0fb5 input=6f67f91b523c875f]*/ PyDoc_STRVAR(test_critical_section_object__doc__, "test_critical_section_object($module, a, /)\n" From 0b437c4e94f1dabb4acdd31f3ee392583cd77a88 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Fri, 4 Apr 2025 17:59:36 +0100 Subject: [PATCH 10/12] GH-131498: Cases generator: manage stacks automatically (GH-132074) --- Include/internal/pycore_opcode_metadata.h | 12 +- Include/internal/pycore_stackref.h | 5 - Include/internal/pycore_structs.h | 6 + Python/bytecodes.c | 67 ++++++----- Python/ceval.c | 44 +++---- Python/ceval_macros.h | 40 ------- Python/executor_cases.c.h | 23 +--- Python/generated_cases.c.h | 120 ++++++++++--------- Python/optimizer_cases.c.h | 9 -- Python/stackrefs.c | 3 + Tools/cases_generator/generators_common.py | 32 +++-- Tools/cases_generator/optimizer_generator.py | 2 +- Tools/cases_generator/stack.py | 71 ++++++----- Tools/cases_generator/tier1_generator.py | 29 +++-- Tools/cases_generator/tier2_generator.py | 2 +- 15 files changed, 215 insertions(+), 250 deletions(-) diff --git a/Include/internal/pycore_opcode_metadata.h b/Include/internal/pycore_opcode_metadata.h index 5a165a5a3a2675..3a32967e721903 100644 --- a/Include/internal/pycore_opcode_metadata.h +++ b/Include/internal/pycore_opcode_metadata.h @@ -234,7 +234,7 @@ int _PyOpcode_num_popped(int opcode, int oparg) { case INSTRUMENTED_END_SEND: return 2; case INSTRUMENTED_FOR_ITER: - return 0; + return 1; case INSTRUMENTED_INSTRUCTION: return 0; case INSTRUMENTED_JUMP_BACKWARD: @@ -250,13 +250,13 @@ int _PyOpcode_num_popped(int opcode, int oparg) { case INSTRUMENTED_POP_ITER: return 1; case INSTRUMENTED_POP_JUMP_IF_FALSE: - return 0; + return 1; case INSTRUMENTED_POP_JUMP_IF_NONE: - return 0; + return 1; case INSTRUMENTED_POP_JUMP_IF_NOT_NONE: - return 0; + return 1; case INSTRUMENTED_POP_JUMP_IF_TRUE: - return 0; + return 1; case INSTRUMENTED_RESUME: return 0; case INSTRUMENTED_RETURN_VALUE: @@ -713,7 +713,7 @@ int _PyOpcode_num_pushed(int opcode, int oparg) { case INSTRUMENTED_END_SEND: return 1; case INSTRUMENTED_FOR_ITER: - return 0; + return 2; case INSTRUMENTED_INSTRUCTION: return 0; case INSTRUMENTED_JUMP_BACKWARD: diff --git a/Include/internal/pycore_stackref.h b/Include/internal/pycore_stackref.h index e6772c96eeb79c..5683b98470d3ea 100644 --- a/Include/internal/pycore_stackref.h +++ b/Include/internal/pycore_stackref.h @@ -4,11 +4,6 @@ extern "C" { #endif -// Define this to get precise tracking of closed stackrefs. -// This will use unbounded memory, as it can only grow. -// Use this to track double closes in short-lived programs -// #define Py_STACKREF_CLOSE_DEBUG 1 - #ifndef Py_BUILD_CORE # error "this header requires Py_BUILD_CORE define" #endif diff --git a/Include/internal/pycore_structs.h b/Include/internal/pycore_structs.h index b54d61197ad789..0d5f5dc7acc773 100644 --- a/Include/internal/pycore_structs.h +++ b/Include/internal/pycore_structs.h @@ -57,6 +57,12 @@ typedef struct { // Define this to get precise tracking of stackrefs. // #define Py_STACKREF_DEBUG 1 +// Define this to get precise tracking of closed stackrefs. +// This will use unbounded memory, as it can only grow. +// Use this to track double closes in short-lived programs +// #define Py_STACKREF_CLOSE_DEBUG 1 + + typedef union _PyStackRef { #if !defined(Py_GIL_DISABLED) && defined(Py_STACKREF_DEBUG) uint64_t index; diff --git a/Python/bytecodes.c b/Python/bytecodes.c index b2900ba951a52f..a6cdc089d7a851 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -204,7 +204,7 @@ dummy_func( ptrdiff_t off = this_instr - _PyFrame_GetBytecode(frame); frame->tlbc_index = ((_PyThreadStateImpl *)tstate)->tlbc_index; frame->instr_ptr = bytecode + off; - // Make sure this_instr gets reset correctley for any uops that + // Make sure this_instr gets reset correctly for any uops that // follow next_instr = frame->instr_ptr; DISPATCH(); @@ -1111,7 +1111,7 @@ dummy_func( tstate->current_frame = frame->previous; assert(!_PyErr_Occurred(tstate)); PyObject *result = PyStackRef_AsPyObjectSteal(retval); - SYNC_SP(); /* Not strictly necessary, but prevents warnings */ + LLTRACE_RESUME_FRAME(); return result; } @@ -1123,7 +1123,7 @@ dummy_func( _PyStackRef temp = PyStackRef_MakeHeapSafe(retval); DEAD(retval); SAVE_STACK(); - assert(EMPTY()); + assert(STACK_LEVEL() == 0); _Py_LeaveRecursiveCallPy(tstate); // GH-99729: We need to unlink the frame *before* clearing it: _PyInterpreterFrame *dying = frame; @@ -1223,8 +1223,9 @@ dummy_func( { PyGenObject *gen = (PyGenObject *)receiver_o; _PyInterpreterFrame *gen_frame = &gen->gi_iframe; - STACK_SHRINK(1); _PyFrame_StackPush(gen_frame, PyStackRef_MakeHeapSafe(v)); + DEAD(v); + SYNC_SP(); gen->gi_frame_state = FRAME_EXECUTING; gen->gi_exc_state.previous_item = tstate->exc_info; tstate->exc_info = &gen->gi_exc_state; @@ -2436,10 +2437,10 @@ dummy_func( PyObject *name = GETITEM(FRAME_CO_NAMES, oparg >> 1); _PyInterpreterFrame *new_frame = _PyFrame_PushUnchecked( tstate, PyStackRef_FromPyObjectNew(f), 2, frame); - // Manipulate stack directly because we exit with DISPATCH_INLINED(). - STACK_SHRINK(1); new_frame->localsplus[0] = owner; DEAD(owner); + // Manipulate stack directly because we exit with DISPATCH_INLINED(). + SYNC_SP(); new_frame->localsplus[1] = PyStackRef_FromPyObjectNew(name); frame->return_offset = INSTRUCTION_SIZE; DISPATCH_INLINED(new_frame); @@ -3083,12 +3084,11 @@ dummy_func( macro(FOR_ITER) = _SPECIALIZE_FOR_ITER + _FOR_ITER; - inst(INSTRUMENTED_FOR_ITER, (unused/1 -- )) { - _PyStackRef iter_stackref = TOP(); - PyObject *iter = PyStackRef_AsPyObjectBorrow(iter_stackref); - PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter); - if (next != NULL) { - PUSH(PyStackRef_FromPyObjectSteal(next)); + inst(INSTRUMENTED_FOR_ITER, (unused/1, iter -- iter, next)) { + PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter); + PyObject *next_o = (*Py_TYPE(iter_o)->tp_iternext)(iter_o); + if (next_o != NULL) { + next = PyStackRef_FromPyObjectSteal(next_o); INSTRUMENTED_JUMP(this_instr, next_instr, PY_MONITORING_EVENT_BRANCH_LEFT); } else { @@ -3105,6 +3105,7 @@ dummy_func( next_instr[oparg].op.code == INSTRUMENTED_END_FOR); /* Skip END_FOR */ JUMPBY(oparg + 1); + DISPATCH(); } } @@ -4022,7 +4023,6 @@ dummy_func( _PUSH_FRAME; inst(EXIT_INIT_CHECK, (should_be_none -- )) { - assert(STACK_LEVEL() == 2); if (!PyStackRef_IsNone(should_be_none)) { PyErr_Format(PyExc_TypeError, "__init__() should return None, not '%.200s'", @@ -4813,7 +4813,7 @@ dummy_func( PyFunctionObject *func = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(frame->f_funcobj); PyGenObject *gen = (PyGenObject *)_Py_MakeCoro(func); ERROR_IF(gen == NULL, error); - assert(EMPTY()); + assert(STACK_LEVEL() == 0); SAVE_STACK(); _PyInterpreterFrame *gen_frame = &gen->gi_iframe; frame->instr_ptr++; @@ -4932,6 +4932,7 @@ dummy_func( } next_instr = frame->instr_ptr; if (next_instr != this_instr) { + SYNC_SP(); DISPATCH(); } } @@ -4976,46 +4977,48 @@ dummy_func( _CHECK_PERIODIC + _MONITOR_JUMP_BACKWARD; - inst(INSTRUMENTED_POP_JUMP_IF_TRUE, (unused/1 -- )) { - _PyStackRef cond = POP(); + inst(INSTRUMENTED_POP_JUMP_IF_TRUE, (unused/1, cond -- )) { assert(PyStackRef_BoolCheck(cond)); int jump = PyStackRef_IsTrue(cond); + DEAD(cond); RECORD_BRANCH_TAKEN(this_instr[1].cache, jump); if (jump) { INSTRUMENTED_JUMP(this_instr, next_instr + oparg, PY_MONITORING_EVENT_BRANCH_RIGHT); } } - inst(INSTRUMENTED_POP_JUMP_IF_FALSE, (unused/1 -- )) { - _PyStackRef cond = POP(); + inst(INSTRUMENTED_POP_JUMP_IF_FALSE, (unused/1, cond -- )) { assert(PyStackRef_BoolCheck(cond)); int jump = PyStackRef_IsFalse(cond); + DEAD(cond); RECORD_BRANCH_TAKEN(this_instr[1].cache, jump); if (jump) { INSTRUMENTED_JUMP(this_instr, next_instr + oparg, PY_MONITORING_EVENT_BRANCH_RIGHT); } } - inst(INSTRUMENTED_POP_JUMP_IF_NONE, (unused/1 -- )) { - _PyStackRef value_stackref = POP(); - int jump = PyStackRef_IsNone(value_stackref); + inst(INSTRUMENTED_POP_JUMP_IF_NONE, (unused/1, value -- )) { + int jump = PyStackRef_IsNone(value); RECORD_BRANCH_TAKEN(this_instr[1].cache, jump); if (jump) { + DEAD(value); INSTRUMENTED_JUMP(this_instr, next_instr + oparg, PY_MONITORING_EVENT_BRANCH_RIGHT); } else { - PyStackRef_CLOSE(value_stackref); + PyStackRef_CLOSE(value); } } - inst(INSTRUMENTED_POP_JUMP_IF_NOT_NONE, (unused/1 -- )) { - _PyStackRef value_stackref = POP(); - int jump = !PyStackRef_IsNone(value_stackref); + inst(INSTRUMENTED_POP_JUMP_IF_NOT_NONE, (unused/1, value -- )) { + int jump = !PyStackRef_IsNone(value); RECORD_BRANCH_TAKEN(this_instr[1].cache, jump); if (jump) { - PyStackRef_CLOSE(value_stackref); + PyStackRef_CLOSE(value); INSTRUMENTED_JUMP(this_instr, next_instr + oparg, PY_MONITORING_EVENT_BRANCH_RIGHT); } + else { + DEAD(value); + } } tier1 inst(EXTENDED_ARG, ( -- )) { @@ -5219,22 +5222,26 @@ dummy_func( } label(pop_4_error) { - STACK_SHRINK(4); + stack_pointer -= 4; + assert(WITHIN_STACK_BOUNDS()); goto error; } label(pop_3_error) { - STACK_SHRINK(3); + stack_pointer -= 3; + assert(WITHIN_STACK_BOUNDS()); goto error; } label(pop_2_error) { - STACK_SHRINK(2); + stack_pointer -= 2; + assert(WITHIN_STACK_BOUNDS()); goto error; } label(pop_1_error) { - STACK_SHRINK(1); + stack_pointer -= 1; + assert(WITHIN_STACK_BOUNDS()); goto error; } diff --git a/Python/ceval.c b/Python/ceval.c index add8c2a28c74e3..a59b2b7a16866d 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -151,18 +151,6 @@ dump_item(_PyStackRef item) printf(""); return; } - if ( - obj == Py_None - || PyBool_Check(obj) - || PyLong_CheckExact(obj) - || PyFloat_CheckExact(obj) - || PyUnicode_CheckExact(obj) - ) { - if (PyObject_Print(obj, stdout, 0) == 0) { - return; - } - PyErr_Clear(); - } // Don't call __repr__(), it might recurse into the interpreter. printf("<%s at %p>", Py_TYPE(obj)->tp_name, (void *)obj); } @@ -182,14 +170,19 @@ dump_stack(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer) dump_item(*ptr); } printf("]\n"); - printf(" stack=["); - for (_PyStackRef *ptr = stack_base; ptr < stack_pointer; ptr++) { - if (ptr != stack_base) { - printf(", "); + if (stack_pointer < stack_base) { + printf(" stack=%d\n", (int)(stack_pointer-stack_base)); + } + else { + printf(" stack=["); + for (_PyStackRef *ptr = stack_base; ptr < stack_pointer; ptr++) { + if (ptr != stack_base) { + printf(", "); + } + dump_item(*ptr); } - dump_item(*ptr); + printf("]\n"); } - printf("]\n"); fflush(stdout); PyErr_SetRaisedException(exc); _PyFrame_GetStackPointer(frame); @@ -202,13 +195,13 @@ lltrace_instruction(_PyInterpreterFrame *frame, int opcode, int oparg) { - if (frame->owner >= FRAME_OWNED_BY_INTERPRETER) { - return; + int offset = 0; + if (frame->owner < FRAME_OWNED_BY_INTERPRETER) { + dump_stack(frame, stack_pointer); + offset = (int)(next_instr - _PyFrame_GetBytecode(frame)); } - dump_stack(frame, stack_pointer); const char *opname = _PyOpcode_OpName[opcode]; assert(opname != NULL); - int offset = (int)(next_instr - _PyFrame_GetBytecode(frame)); if (OPCODE_HAS_ARG((int)_PyOpcode_Deopt[opcode])) { printf("%d: %s %d\n", offset * 2, opname, oparg); } @@ -986,8 +979,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int * These are cached values from the frame and code object. */ _Py_CODEUNIT *next_instr; _PyStackRef *stack_pointer; - -#if defined(Py_DEBUG) && !defined(Py_STACKREF_DEBUG) + entry_frame.localsplus[0] = PyStackRef_NULL; +#ifdef Py_STACKREF_DEBUG + entry_frame.f_funcobj = PyStackRef_None; +#elif defined(Py_DEBUG) /* Set these to invalid but identifiable values for debugging. */ entry_frame.f_funcobj = (_PyStackRef){.bits = 0xaaa0}; entry_frame.f_locals = (PyObject*)0xaaa1; @@ -1044,7 +1039,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int _PyExecutorObject *current_executor = NULL; const _PyUOpInstruction *next_uop = NULL; #endif - #if Py_TAIL_CALL_INTERP return _TAIL_CALL_start_frame(frame, NULL, tstate, NULL, 0); #else diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h index f19ffd23161ace..3dca4e46ee75e4 100644 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@ -194,48 +194,8 @@ GETITEM(PyObject *v, Py_ssize_t i) { #define JUMPBY(x) (next_instr += (x)) #define SKIP_OVER(x) (next_instr += (x)) - -/* Stack manipulation macros */ - -/* The stack can grow at most MAXINT deep, as co_nlocals and - co_stacksize are ints. */ #define STACK_LEVEL() ((int)(stack_pointer - _PyFrame_Stackbase(frame))) #define STACK_SIZE() (_PyFrame_GetCode(frame)->co_stacksize) -#define EMPTY() (STACK_LEVEL() == 0) -#define TOP() (stack_pointer[-1]) -#define SECOND() (stack_pointer[-2]) -#define THIRD() (stack_pointer[-3]) -#define FOURTH() (stack_pointer[-4]) -#define PEEK(n) (stack_pointer[-(n)]) -#define POKE(n, v) (stack_pointer[-(n)] = (v)) -#define SET_TOP(v) (stack_pointer[-1] = (v)) -#define SET_SECOND(v) (stack_pointer[-2] = (v)) -#define BASIC_STACKADJ(n) (stack_pointer += n) -#define BASIC_PUSH(v) (*stack_pointer++ = (v)) -#define BASIC_POP() (*--stack_pointer) - -#ifdef Py_DEBUG -#define PUSH(v) do { \ - BASIC_PUSH(v); \ - assert(STACK_LEVEL() <= STACK_SIZE()); \ - } while (0) -#define POP() (assert(STACK_LEVEL() > 0), BASIC_POP()) -#define STACK_GROW(n) do { \ - assert(n >= 0); \ - BASIC_STACKADJ(n); \ - assert(STACK_LEVEL() <= STACK_SIZE()); \ - } while (0) -#define STACK_SHRINK(n) do { \ - assert(n >= 0); \ - assert(STACK_LEVEL() >= n); \ - BASIC_STACKADJ(-(n)); \ - } while (0) -#else -#define PUSH(v) BASIC_PUSH(v) -#define POP() BASIC_POP() -#define STACK_GROW(n) BASIC_STACKADJ(n) -#define STACK_SHRINK(n) BASIC_STACKADJ(-(n)) -#endif #define WITHIN_STACK_BOUNDS() \ (frame->owner == FRAME_OWNED_BY_INTERPRETER || (STACK_LEVEL() >= 0 && STACK_LEVEL() <= STACK_SIZE())) diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index ccdf74a575baa2..c0422d87bfd78b 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -714,7 +714,6 @@ stack_pointer = _PyFrame_GetStackPointer(frame); res = PyStackRef_True; stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; break; @@ -798,7 +797,6 @@ stack_pointer = _PyFrame_GetStackPointer(frame); res = PyStackRef_True; stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; break; @@ -1206,7 +1204,6 @@ Py_DECREF(slice); stack_pointer = _PyFrame_GetStackPointer(frame); stack_pointer += 2; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer += -3; assert(WITHIN_STACK_BOUNDS()); @@ -1248,21 +1245,18 @@ Py_DECREF(slice); stack_pointer = _PyFrame_GetStackPointer(frame); stack_pointer += 2; - assert(WITHIN_STACK_BOUNDS()); } - stack_pointer += -2; - assert(WITHIN_STACK_BOUNDS()); _PyFrame_SetStackPointer(frame, stack_pointer); _PyStackRef tmp = container; container = PyStackRef_NULL; - stack_pointer[-1] = container; + stack_pointer[-3] = container; PyStackRef_CLOSE(tmp); tmp = v; v = PyStackRef_NULL; - stack_pointer[-2] = v; + stack_pointer[-4] = v; PyStackRef_CLOSE(tmp); stack_pointer = _PyFrame_GetStackPointer(frame); - stack_pointer += -2; + stack_pointer += -4; assert(WITHIN_STACK_BOUNDS()); if (err) { JUMP_TO_ERROR(); @@ -1732,7 +1726,7 @@ stack_pointer += -1; assert(WITHIN_STACK_BOUNDS()); _PyFrame_SetStackPointer(frame, stack_pointer); - assert(EMPTY()); + assert(STACK_LEVEL() == 0); _Py_LeaveRecursiveCallPy(tstate); _PyInterpreterFrame *dying = frame; frame = tstate->current_frame = dying->previous; @@ -2073,7 +2067,6 @@ _PyFrame_SetStackPointer(frame, stack_pointer); PyStackRef_CLOSE(seq); stack_pointer = _PyFrame_GetStackPointer(frame); - stack_pointer[-1] = val0; break; } @@ -3004,7 +2997,6 @@ stack_pointer = _PyFrame_GetStackPointer(frame); self_or_null = PyStackRef_NULL; stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer += -1; assert(WITHIN_STACK_BOUNDS()); @@ -3057,7 +3049,6 @@ } self_or_null[0] = PyStackRef_NULL; stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); } } else { @@ -3073,7 +3064,6 @@ JUMP_TO_ERROR(); } stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); } attr = PyStackRef_FromPyObjectSteal(attr_o); stack_pointer[-1] = attr; @@ -5289,7 +5279,6 @@ case _EXIT_INIT_CHECK: { _PyStackRef should_be_none; should_be_none = stack_pointer[-1]; - assert(STACK_LEVEL() == 2); if (!PyStackRef_IsNone(should_be_none)) { _PyFrame_SetStackPointer(frame, stack_pointer); PyErr_Format(PyExc_TypeError, @@ -6347,7 +6336,6 @@ stack_pointer = _PyFrame_GetStackPointer(frame); tuple = PyStackRef_FromPyObjectSteal(tuple_o); stack_pointer += 2; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-2] = tuple; stack_pointer[-1] = kwargs_out; @@ -6414,7 +6402,7 @@ if (gen == NULL) { JUMP_TO_ERROR(); } - assert(EMPTY()); + assert(STACK_LEVEL() == 0); _PyFrame_SetStackPointer(frame, stack_pointer); _PyInterpreterFrame *gen_frame = &gen->gi_iframe; frame->instr_ptr++; @@ -6513,7 +6501,6 @@ else { res = value; stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[0] = res; stack_pointer += 1; diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index c75371d12b0ba1..4a3884b9568b98 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -1062,7 +1062,6 @@ Py_DECREF(slice); stack_pointer = _PyFrame_GetStackPointer(frame); stack_pointer += 2; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer += -3; assert(WITHIN_STACK_BOUNDS()); @@ -1498,7 +1497,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -1983,7 +1981,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -2097,7 +2094,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -2212,7 +2208,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -2305,7 +2300,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -2366,7 +2360,6 @@ stack_pointer = _PyFrame_GetStackPointer(frame); tuple = PyStackRef_FromPyObjectSteal(tuple_o); stack_pointer += 2; - assert(WITHIN_STACK_BOUNDS()); } } // _DO_CALL_FUNCTION_EX @@ -2494,7 +2487,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = result; @@ -2736,7 +2728,6 @@ } STACKREFS_TO_PYOBJECTS(arguments, total_args, args_o); if (CONVERSION_FAILED(args_o)) { - stack_pointer[-1] = kwnames; _PyFrame_SetStackPointer(frame, stack_pointer); _PyStackRef tmp = kwnames; kwnames = PyStackRef_NULL; @@ -3070,7 +3061,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -3422,7 +3412,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -3544,7 +3533,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -3646,7 +3634,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -3759,7 +3746,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -3879,7 +3865,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -4154,7 +4139,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -4227,7 +4211,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -5310,7 +5293,6 @@ INSTRUCTION_STATS(EXIT_INIT_CHECK); _PyStackRef should_be_none; should_be_none = stack_pointer[-1]; - assert(STACK_LEVEL() == 2); if (!PyStackRef_IsNone(should_be_none)) { _PyFrame_SetStackPointer(frame, stack_pointer); PyErr_Format(PyExc_TypeError, @@ -5369,7 +5351,6 @@ else { res = value; stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[0] = res; stack_pointer += 1; @@ -6130,8 +6111,9 @@ } // _DO_CALL { - self_or_null = maybe_self; - callable = func; + args = &stack_pointer[-oparg]; + self_or_null = &stack_pointer[-1 - oparg]; + callable = &stack_pointer[-2 - oparg]; PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]); int total_args = oparg; _PyStackRef *arguments = args; @@ -6246,7 +6228,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = res; @@ -6307,7 +6288,6 @@ stack_pointer = _PyFrame_GetStackPointer(frame); tuple = PyStackRef_FromPyObjectSteal(tuple_o); stack_pointer += 2; - assert(WITHIN_STACK_BOUNDS()); } } // _DO_CALL_FUNCTION_EX @@ -6435,7 +6415,6 @@ JUMP_TO_LABEL(error); } stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[0] = result; @@ -6753,14 +6732,16 @@ frame->instr_ptr = next_instr; next_instr += 2; INSTRUCTION_STATS(INSTRUMENTED_FOR_ITER); + _PyStackRef iter; + _PyStackRef next; /* Skip 1 cache entry */ - _PyStackRef iter_stackref = TOP(); - PyObject *iter = PyStackRef_AsPyObjectBorrow(iter_stackref); + iter = stack_pointer[-1]; + PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter); _PyFrame_SetStackPointer(frame, stack_pointer); - PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter); + PyObject *next_o = (*Py_TYPE(iter_o)->tp_iternext)(iter_o); stack_pointer = _PyFrame_GetStackPointer(frame); - if (next != NULL) { - PUSH(PyStackRef_FromPyObjectSteal(next)); + if (next_o != NULL) { + next = PyStackRef_FromPyObjectSteal(next_o); INSTRUMENTED_JUMP(this_instr, next_instr, PY_MONITORING_EVENT_BRANCH_LEFT); } else { @@ -6779,7 +6760,11 @@ assert(next_instr[oparg].op.code == END_FOR || next_instr[oparg].op.code == INSTRUMENTED_END_FOR); JUMPBY(oparg + 1); + DISPATCH(); } + stack_pointer[0] = next; + stack_pointer += 1; + assert(WITHIN_STACK_BOUNDS()); DISPATCH(); } @@ -7063,14 +7048,17 @@ frame->instr_ptr = next_instr; next_instr += 2; INSTRUCTION_STATS(INSTRUMENTED_POP_JUMP_IF_FALSE); + _PyStackRef cond; /* Skip 1 cache entry */ - _PyStackRef cond = POP(); + cond = stack_pointer[-1]; assert(PyStackRef_BoolCheck(cond)); int jump = PyStackRef_IsFalse(cond); RECORD_BRANCH_TAKEN(this_instr[1].cache, jump); if (jump) { INSTRUMENTED_JUMP(this_instr, next_instr + oparg, PY_MONITORING_EVENT_BRANCH_RIGHT); } + stack_pointer += -1; + assert(WITHIN_STACK_BOUNDS()); DISPATCH(); } @@ -7084,18 +7072,24 @@ frame->instr_ptr = next_instr; next_instr += 2; INSTRUCTION_STATS(INSTRUMENTED_POP_JUMP_IF_NONE); + _PyStackRef value; /* Skip 1 cache entry */ - _PyStackRef value_stackref = POP(); - int jump = PyStackRef_IsNone(value_stackref); + value = stack_pointer[-1]; + int jump = PyStackRef_IsNone(value); RECORD_BRANCH_TAKEN(this_instr[1].cache, jump); if (jump) { INSTRUMENTED_JUMP(this_instr, next_instr + oparg, PY_MONITORING_EVENT_BRANCH_RIGHT); } else { + stack_pointer += -1; + assert(WITHIN_STACK_BOUNDS()); _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(value_stackref); + PyStackRef_CLOSE(value); stack_pointer = _PyFrame_GetStackPointer(frame); + stack_pointer += 1; } + stack_pointer += -1; + assert(WITHIN_STACK_BOUNDS()); DISPATCH(); } @@ -7109,16 +7103,22 @@ frame->instr_ptr = next_instr; next_instr += 2; INSTRUCTION_STATS(INSTRUMENTED_POP_JUMP_IF_NOT_NONE); + _PyStackRef value; /* Skip 1 cache entry */ - _PyStackRef value_stackref = POP(); - int jump = !PyStackRef_IsNone(value_stackref); + value = stack_pointer[-1]; + int jump = !PyStackRef_IsNone(value); RECORD_BRANCH_TAKEN(this_instr[1].cache, jump); if (jump) { + stack_pointer += -1; + assert(WITHIN_STACK_BOUNDS()); _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(value_stackref); + PyStackRef_CLOSE(value); stack_pointer = _PyFrame_GetStackPointer(frame); INSTRUMENTED_JUMP(this_instr, next_instr + oparg, PY_MONITORING_EVENT_BRANCH_RIGHT); } + else { + stack_pointer += -1; + } DISPATCH(); } @@ -7132,14 +7132,17 @@ frame->instr_ptr = next_instr; next_instr += 2; INSTRUCTION_STATS(INSTRUMENTED_POP_JUMP_IF_TRUE); + _PyStackRef cond; /* Skip 1 cache entry */ - _PyStackRef cond = POP(); + cond = stack_pointer[-1]; assert(PyStackRef_BoolCheck(cond)); int jump = PyStackRef_IsTrue(cond); RECORD_BRANCH_TAKEN(this_instr[1].cache, jump); if (jump) { INSTRUMENTED_JUMP(this_instr, next_instr + oparg, PY_MONITORING_EVENT_BRANCH_RIGHT); } + stack_pointer += -1; + assert(WITHIN_STACK_BOUNDS()); DISPATCH(); } @@ -7254,7 +7257,7 @@ stack_pointer += -1; assert(WITHIN_STACK_BOUNDS()); _PyFrame_SetStackPointer(frame, stack_pointer); - assert(EMPTY()); + assert(STACK_LEVEL() == 0); _Py_LeaveRecursiveCallPy(tstate); _PyInterpreterFrame *dying = frame; frame = tstate->current_frame = dying->previous; @@ -7353,9 +7356,11 @@ tstate->current_frame = frame->previous; assert(!_PyErr_Occurred(tstate)); PyObject *result = PyStackRef_AsPyObjectSteal(retval); + LLTRACE_RESUME_FRAME(); + return result; stack_pointer += -1; assert(WITHIN_STACK_BOUNDS()); - return result; + DISPATCH(); } TARGET(IS_OP) { @@ -7684,7 +7689,6 @@ } self_or_null[0] = PyStackRef_NULL; stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); } } else { @@ -7700,7 +7704,6 @@ JUMP_TO_LABEL(error); } stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); } attr = PyStackRef_FromPyObjectSteal(attr_o); } @@ -7886,8 +7889,9 @@ PyObject *name = GETITEM(FRAME_CO_NAMES, oparg >> 1); _PyInterpreterFrame *new_frame = _PyFrame_PushUnchecked( tstate, PyStackRef_FromPyObjectNew(f), 2, frame); - STACK_SHRINK(1); new_frame->localsplus[0] = owner; + stack_pointer += -1; + assert(WITHIN_STACK_BOUNDS()); new_frame->localsplus[1] = PyStackRef_FromPyObjectNew(name); frame->return_offset = 10 ; DISPATCH_INLINED(new_frame); @@ -9551,7 +9555,6 @@ stack_pointer = _PyFrame_GetStackPointer(frame); self_or_null = PyStackRef_NULL; stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer += -1; assert(WITHIN_STACK_BOUNDS()); @@ -10243,7 +10246,7 @@ if (gen == NULL) { JUMP_TO_LABEL(error); } - assert(EMPTY()); + assert(STACK_LEVEL() == 0); _PyFrame_SetStackPointer(frame, stack_pointer); _PyInterpreterFrame *gen_frame = &gen->gi_iframe; frame->instr_ptr++; @@ -10281,7 +10284,7 @@ stack_pointer += -1; assert(WITHIN_STACK_BOUNDS()); _PyFrame_SetStackPointer(frame, stack_pointer); - assert(EMPTY()); + assert(STACK_LEVEL() == 0); _Py_LeaveRecursiveCallPy(tstate); _PyInterpreterFrame *dying = frame; frame = tstate->current_frame = dying->previous; @@ -10339,8 +10342,9 @@ { PyGenObject *gen = (PyGenObject *)receiver_o; _PyInterpreterFrame *gen_frame = &gen->gi_iframe; - STACK_SHRINK(1); _PyFrame_StackPush(gen_frame, PyStackRef_MakeHeapSafe(v)); + stack_pointer += -1; + assert(WITHIN_STACK_BOUNDS()); gen->gi_frame_state = FRAME_EXECUTING; gen->gi_exc_state.previous_item = tstate->exc_info; tstate->exc_info = &gen->gi_exc_state; @@ -11095,21 +11099,18 @@ Py_DECREF(slice); stack_pointer = _PyFrame_GetStackPointer(frame); stack_pointer += 2; - assert(WITHIN_STACK_BOUNDS()); } - stack_pointer += -2; - assert(WITHIN_STACK_BOUNDS()); _PyFrame_SetStackPointer(frame, stack_pointer); _PyStackRef tmp = container; container = PyStackRef_NULL; - stack_pointer[-1] = container; + stack_pointer[-3] = container; PyStackRef_CLOSE(tmp); tmp = v; v = PyStackRef_NULL; - stack_pointer[-2] = v; + stack_pointer[-4] = v; PyStackRef_CLOSE(tmp); stack_pointer = _PyFrame_GetStackPointer(frame); - stack_pointer += -2; + stack_pointer += -4; assert(WITHIN_STACK_BOUNDS()); if (err) { JUMP_TO_LABEL(error); @@ -11465,7 +11466,6 @@ stack_pointer = _PyFrame_GetStackPointer(frame); res = PyStackRef_True; stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; DISPATCH(); @@ -11573,7 +11573,6 @@ stack_pointer = _PyFrame_GetStackPointer(frame); res = PyStackRef_True; stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); } } stack_pointer[-1] = res; @@ -11861,7 +11860,6 @@ _PyFrame_SetStackPointer(frame, stack_pointer); PyStackRef_CLOSE(seq); stack_pointer = _PyFrame_GetStackPointer(frame); - stack_pointer[-1] = val0; DISPATCH(); } @@ -11984,25 +11982,29 @@ JUMP_TO_LABEL(error); LABEL(pop_4_error) { - STACK_SHRINK(4); + stack_pointer -= 4; + assert(WITHIN_STACK_BOUNDS()); JUMP_TO_LABEL(error); } LABEL(pop_3_error) { - STACK_SHRINK(3); + stack_pointer -= 3; + assert(WITHIN_STACK_BOUNDS()); JUMP_TO_LABEL(error); } LABEL(pop_2_error) { - STACK_SHRINK(2); + stack_pointer -= 2; + assert(WITHIN_STACK_BOUNDS()); JUMP_TO_LABEL(error); } LABEL(pop_1_error) { - STACK_SHRINK(1); + stack_pointer -= 1; + assert(WITHIN_STACK_BOUNDS()); JUMP_TO_LABEL(error); } diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h index ea25b8224a459b..f5cd1697fbacda 100644 --- a/Python/optimizer_cases.c.h +++ b/Python/optimizer_cases.c.h @@ -310,7 +310,6 @@ else { res = sym_new_type(ctx, &PyLong_Type); stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; break; @@ -339,7 +338,6 @@ else { res = sym_new_type(ctx, &PyLong_Type); stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; break; @@ -368,7 +366,6 @@ else { res = sym_new_type(ctx, &PyLong_Type); stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; break; @@ -418,7 +415,6 @@ else { res = sym_new_type(ctx, &PyFloat_Type); stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; break; @@ -448,7 +444,6 @@ else { res = sym_new_type(ctx, &PyFloat_Type); stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; break; @@ -478,7 +473,6 @@ else { res = sym_new_type(ctx, &PyFloat_Type); stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; break; @@ -506,7 +500,6 @@ else { res = sym_new_type(ctx, &PyUnicode_Type); stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; break; @@ -1257,7 +1250,6 @@ else { res = sym_new_type(ctx, &PyBool_Type); stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } stack_pointer[-1] = res; break; @@ -2031,7 +2023,6 @@ if (co == NULL) { ctx->done = true; } - stack_pointer[-1] = res; break; } diff --git a/Python/stackrefs.c b/Python/stackrefs.c index 450dacde6d29e5..1a2f66feb04c4d 100644 --- a/Python/stackrefs.c +++ b/Python/stackrefs.c @@ -71,6 +71,9 @@ _Py_stackref_close(_PyStackRef ref, const char *filename, int linenumber) } PyObject *obj; if (ref.index <= LAST_PREDEFINED_STACKREF_INDEX) { + if (ref.index == 0) { + _Py_FatalErrorFormat(__func__, "Passing NULL to PyStackRef_CLOSE at %s:%d\n", filename, linenumber); + } // Pre-allocated reference to None, False or True -- Do not clear TableEntry *entry = _Py_hashtable_get(interp->open_stackrefs_table, (void *)ref.index); obj = entry->obj; diff --git a/Tools/cases_generator/generators_common.py b/Tools/cases_generator/generators_common.py index 4571811bcdff3c..ca6104705fb3f2 100644 --- a/Tools/cases_generator/generators_common.py +++ b/Tools/cases_generator/generators_common.py @@ -13,9 +13,8 @@ from lexer import Token from stack import Storage, StackError from parser import Stmt, SimpleStmt, BlockStmt, IfStmt, ForStmt, WhileStmt, MacroIfStmt - -# Set this to true for voluminous output showing state of stack and locals -PRINT_STACKS = False +from stack import PRINT_STACKS +DEBUG = False class TokenIterator: @@ -161,7 +160,7 @@ def deopt_if( self.emit(") {\n") next(tkn_iter) # Semi colon assert inst is not None - assert inst.family is not None, inst + assert inst.family is not None family_name = inst.family.name self.emit(f"UPDATE_MISS_STATS({family_name});\n") self.emit(f"assert(_PyOpcode_Deopt[opcode] == ({family_name}));\n") @@ -242,6 +241,7 @@ def decref_inputs( next(tkn_iter) next(tkn_iter) next(tkn_iter) + self._print_storage("DECREF_INPUTS", storage) try: storage.close_inputs(self.out) except StackError as ex: @@ -249,7 +249,6 @@ def decref_inputs( except Exception as ex: ex.args = (ex.args[0] + str(tkn),) raise - self._print_storage(storage) return True def kill_inputs( @@ -372,7 +371,7 @@ def sync_sp( next(tkn_iter) storage.clear_inputs("when syncing stack") storage.flush(self.out) - self._print_storage(storage) + storage.stack.clear(self.out) return True def stack_pointer( @@ -406,7 +405,6 @@ def goto_label(self, goto: Token, label: Token, storage: Storage) -> None: def emit_save(self, storage: Storage) -> None: storage.flush(self.out) storage.save(self.out) - self._print_storage(storage) def save_stack( self, @@ -424,7 +422,6 @@ def save_stack( def emit_reload(self, storage: Storage) -> None: storage.reload(self.out) - self._print_storage(storage) def reload_stack( self, @@ -453,9 +450,10 @@ def instruction_size(self, self.out.emit(f" {uop.instruction_size} ") return True - def _print_storage(self, storage: Storage) -> None: - if PRINT_STACKS: + def _print_storage(self, reason:str, storage: Storage) -> None: + if DEBUG: self.out.start_line() + self.emit(f"/* {reason} */\n") self.emit(storage.as_comment()) self.out.start_line() @@ -514,7 +512,6 @@ def emit_SimpleStmt( var.memory_offset = None break if tkn.text.startswith("DISPATCH"): - self._print_storage(storage) reachable = False self.out.emit(tkn) else: @@ -536,6 +533,8 @@ def emit_MacroIfStmt( self.out.emit(stmt.condition) branch = stmt.else_ is not None reachable = True + if branch: + else_storage = storage.copy() for s in stmt.body: r, tkn, storage = self._emit_stmt(s, uop, storage, inst) if tkn is not None: @@ -543,7 +542,6 @@ def emit_MacroIfStmt( if not r: reachable = False if branch: - else_storage = storage.copy() assert stmt.else_ is not None self.out.emit(stmt.else_) assert stmt.else_body is not None @@ -553,7 +551,8 @@ def emit_MacroIfStmt( self.out.emit(tkn) if not r: reachable = False - storage.merge(else_storage, self.out) + else_storage.merge(storage, self.out) # type: ignore[possibly-undefined] + storage = else_storage self.out.emit(stmt.endif) return reachable, None, storage @@ -596,7 +595,6 @@ def emit_IfStmt( reachable = True return reachable, rbrace, storage except StackError as ex: - self._print_storage(if_storage) assert rbrace is not None raise analysis_error(ex.args[0], rbrace) from None @@ -659,20 +657,18 @@ def emit_tokens( storage: Storage, inst: Instruction | None, emit_braces: bool = True - ) -> Storage: + ) -> tuple[bool, Storage]: self.out.start_line() reachable, tkn, storage = self.emit_BlockStmt(code.body, code, storage, inst, emit_braces) assert tkn is not None try: if reachable: - self._print_storage(storage) storage.push_outputs() - self._print_storage(storage) if emit_braces: self.out.emit(tkn) except StackError as ex: raise analysis_error(ex.args[0], tkn) from None - return storage + return reachable, storage def emit(self, txt: str | Token) -> None: self.out.emit(txt) diff --git a/Tools/cases_generator/optimizer_generator.py b/Tools/cases_generator/optimizer_generator.py index f515bb6fdc9213..7a32275347e896 100644 --- a/Tools/cases_generator/optimizer_generator.py +++ b/Tools/cases_generator/optimizer_generator.py @@ -145,7 +145,7 @@ def write_uop( # No reference management of inputs needed. for var in storage.inputs: # type: ignore[possibly-undefined] var.in_local = False - storage = emitter.emit_tokens(override, storage, None, False) + _, storage = emitter.emit_tokens(override, storage, None, False) out.start_line() storage.flush(out) else: diff --git a/Tools/cases_generator/stack.py b/Tools/cases_generator/stack.py index 76dfc48a6b594e..14d06948ba1602 100644 --- a/Tools/cases_generator/stack.py +++ b/Tools/cases_generator/stack.py @@ -6,6 +6,8 @@ UNUSED = {"unused"} +# Set this to true for voluminous output showing state of stack and locals +PRINT_STACKS = False def maybe_parenthesize(sym: str) -> str: """Add parentheses around a string if it contains an operator @@ -131,9 +133,6 @@ def as_int(self) -> int | None: return None return self.numeric - def __bool__(self) -> bool: - return self.numeric != 0 or bool(self.positive) or bool(self.negative) - def __str__(self) -> str: return self.to_c() @@ -151,7 +150,7 @@ def __repr__(self) -> str: def compact_str(self) -> str: mtag = "M" if self.memory_offset else "" - dtag = "D" if self.in_local else "" + dtag = "L" if self.in_local else "" atag = "A" if self.is_array() else "" return f"'{self.item.name}'{mtag}{dtag}{atag}" @@ -167,6 +166,11 @@ def undefined(defn: StackItem) -> "Local": def from_memory(defn: StackItem, offset: PointerOffset) -> "Local": return Local(defn, offset, True) + @staticmethod + def register(name: str) -> "Local": + item = StackItem(name, None, "", False, True) + return Local(item, None, True) + def kill(self) -> None: self.in_local = False self.memory_offset = None @@ -230,20 +234,16 @@ def drop(self, var: StackItem, check_liveness: bool) -> None: raise StackError(f"Dropping live value '{var.name}'") def pop(self, var: StackItem, out: CWriter) -> Local: + if self.variables: + top = self.variables[-1] + if var.is_array() != top.is_array() or top.size != var.size: + # Mismatch in variables + self.clear(out) self.logical_sp = self.logical_sp.pop(var) indirect = "&" if var.is_array() else "" if self.variables: popped = self.variables.pop() - if var.is_array() ^ popped.is_array(): - raise StackError( - f"Array mismatch when popping '{popped.name}' from stack to assign to '{var.name}'. " - f"Expected {array_or_scalar(var)} got {array_or_scalar(popped)}" - ) - if popped.size != var.size: - raise StackError( - f"Size mismatch when popping '{popped.name}' from stack to assign to '{var.name}'. " - f"Expected {var_size(var)} got {var_size(popped.item)}" - ) + assert var.is_array() == popped.is_array() and popped.size == var.size if not var.used: return popped if popped.name != var.name: @@ -255,27 +255,33 @@ def pop(self, var: StackItem, out: CWriter) -> Local: if popped.memory_offset is None: popped.memory_offset = self.logical_sp assert popped.memory_offset == self.logical_sp, (popped, self.as_comment()) - offset = popped.memory_offset.to_c() + offset = popped.memory_offset - self.physical_sp if var.is_array(): - defn = f"{var.name} = &stack_pointer[{offset}];\n" + defn = f"{var.name} = &stack_pointer[{offset.to_c()}];\n" else: - defn = f"{var.name} = stack_pointer[{offset}];\n" + defn = f"{var.name} = stack_pointer[{offset.to_c()}];\n" popped.in_local = True else: defn = rename out.emit(defn) return popped - self.base_offset = self.logical_sp if var.name in UNUSED or not var.used: return Local.unused(var, self.base_offset) cast = f"({var.type})" if (not indirect and var.type) else "" bits = ".bits" if cast and self.extract_bits else "" - offset = (self.base_offset - self.physical_sp).to_c() - assign = f"{var.name} = {cast}{indirect}stack_pointer[{offset}]{bits};\n" + c_offset = (self.base_offset - self.physical_sp).to_c() + assign = f"{var.name} = {cast}{indirect}stack_pointer[{c_offset}]{bits};\n" out.emit(assign) + self._print(out) return Local.from_memory(var, self.base_offset) + def clear(self, out: CWriter) -> None: + "Flush to memory and clear variables stack" + self.flush(out) + self.variables = [] + self.base_offset = self.logical_sp + def push(self, var: Local) -> None: assert(var not in self.variables) self.variables.append(var) @@ -298,10 +304,11 @@ def _save_physical_sp(self, out: CWriter) -> None: diff = self.logical_sp - self.physical_sp out.start_line() out.emit(f"stack_pointer += {diff.to_c()};\n") - out.emit("assert(WITHIN_STACK_BOUNDS());\n") + out.emit(f"assert(WITHIN_STACK_BOUNDS());\n") self.physical_sp = self.logical_sp + self._print(out) - def flush(self, out: CWriter) -> None: + def save_variables(self, out: CWriter) -> None: out.start_line() var_offset = self.base_offset for var in self.variables: @@ -310,10 +317,15 @@ def flush(self, out: CWriter) -> None: not var.memory_offset and not var.is_array() ): + self._print(out) var.memory_offset = var_offset stack_offset = var_offset - self.physical_sp Stack._do_emit(out, var.item, stack_offset, self.cast_type, self.extract_bits) + self._print(out) var_offset = var_offset.push(var.item) + + def flush(self, out: CWriter) -> None: + self.save_variables(out) self._save_physical_sp(out) out.start_line() @@ -329,9 +341,13 @@ def sp_offset(self) -> str: def as_comment(self) -> str: variables = ", ".join([v.compact_str() for v in self.variables]) return ( - f"/* Variables: {variables}. base: {self.base_offset.to_c()}. sp: {self.physical_sp.to_c()}. logical_sp: {self.logical_sp.to_c()} */" + f"/* Variables=[{variables}]; base={self.base_offset.to_c()}; sp={self.physical_sp.to_c()}; logical_sp={self.logical_sp.to_c()} */" ) + def _print(self, out: CWriter) -> None: + if PRINT_STACKS: + out.emit(self.as_comment() + "\n") + def copy(self) -> "Stack": other = Stack(self.extract_bits, self.cast_type) other.base_offset = self.base_offset @@ -358,7 +374,6 @@ def align(self, other: "Stack", out: CWriter) -> None: diff = other.physical_sp - self.physical_sp out.start_line() out.emit(f"stack_pointer += {diff.to_c()};\n") - out.emit("assert(WITHIN_STACK_BOUNDS());\n") self.physical_sp = other.physical_sp def merge(self, other: "Stack", out: CWriter) -> None: @@ -621,10 +636,10 @@ def push_outputs(self) -> None: def as_comment(self) -> str: stack_comment = self.stack.as_comment() - next_line = "\n " + next_line = "\n " inputs = ", ".join([var.compact_str() for var in self.inputs]) outputs = ", ".join([var.compact_str() for var in self.outputs]) - return f"{stack_comment[:-2]}{next_line}inputs: {inputs}{next_line}outputs: {outputs}*/" + return f"{stack_comment[:-2]}{next_line}inputs: {inputs} outputs: {outputs}*/" def close_inputs(self, out: CWriter) -> None: @@ -637,7 +652,7 @@ def close_named(close: str, name: str, overwrite: str) -> None: tmp_defined = True out.emit(f"tmp = {name};\n") out.emit(f"{name} = {overwrite};\n") - self.stack.flush(out) + self.stack.save_variables(out) out.emit(f"{close}(tmp);\n") else: out.emit(f"{close}({name});\n") @@ -678,7 +693,6 @@ def close_variable(var: Local, overwrite: str) -> None: if output is not None: raise StackError("Cannot call DECREF_INPUTS with more than one live output") output = var - self.stack.flush(out) if output is not None: if output.is_array(): assert len(self.inputs) == 1 @@ -691,6 +705,7 @@ def close_variable(var: Local, overwrite: str) -> None: return if var_size(lowest.item) != var_size(output.item): raise StackError("Cannot call DECREF_INPUTS with live output not matching first input size") + self.stack.flush(out) lowest.in_local = True close_variable(lowest, output.name) assert lowest.memory_offset is not None diff --git a/Tools/cases_generator/tier1_generator.py b/Tools/cases_generator/tier1_generator.py index ccf2dfe2d2e684..5a49c239ed1aa7 100644 --- a/Tools/cases_generator/tier1_generator.py +++ b/Tools/cases_generator/tier1_generator.py @@ -9,6 +9,8 @@ Analysis, Instruction, Uop, + Label, + CodeSection, Part, analyze_files, Skip, @@ -22,9 +24,13 @@ write_header, type_and_null, Emitter, + TokenIterator, + always_true, + emit_to, ) from cwriter import CWriter from typing import TextIO +from lexer import Token from stack import Local, Stack, StackError, get_stack_effect, Storage DEFAULT_OUTPUT = ROOT / "Python/generated_cases.c.h" @@ -69,23 +75,23 @@ def write_uop( stack: Stack, inst: Instruction, braces: bool, -) -> tuple[int, Stack]: +) -> tuple[bool, int, Stack]: # out.emit(stack.as_comment() + "\n") if isinstance(uop, Skip): entries = "entries" if uop.size > 1 else "entry" emitter.emit(f"/* Skip {uop.size} cache {entries} */\n") - return (offset + uop.size), stack + return True, (offset + uop.size), stack if isinstance(uop, Flush): emitter.emit(f"// flush\n") stack.flush(emitter.out) - return offset, stack + return True, offset, stack locals: dict[str, Local] = {} emitter.out.start_line() if braces: emitter.out.emit(f"// {uop.name}\n") emitter.emit("{\n") + stack._print(emitter.out) storage = Storage.for_uop(stack, uop, emitter.out) - emitter._print_storage(storage) for cache in uop.caches: if cache.name != "unused": @@ -102,12 +108,12 @@ def write_uop( emitter.emit(f"(void){cache.name};\n") offset += cache.size - storage = emitter.emit_tokens(uop, storage, inst, False) + reachable, storage = emitter.emit_tokens(uop, storage, inst, False) if braces: emitter.out.start_line() emitter.emit("}\n") # emitter.emit(stack.as_comment() + "\n") - return offset, storage.stack + return reachable, offset, storage.stack def uses_this(inst: Instruction) -> bool: @@ -204,6 +210,9 @@ def generate_tier1_labels( emitter.emit_tokens(label, storage, None) emitter.emit("\n\n") +def get_popped(inst: Instruction, analysis: Analysis) -> str: + stack = get_stack_effect(inst) + return (-stack.base_offset).to_c() def generate_tier1_cases( analysis: Analysis, outfile: TextIO, lines: bool @@ -214,6 +223,7 @@ def generate_tier1_cases( for name, inst in sorted(analysis.instructions.items()): out.emit("\n") out.emit(f"TARGET({name}) {{\n") + popped = get_popped(inst, analysis) # We need to ifdef it because this breaks platforms # without computed gotos/tail calling. out.emit(f"#if Py_TAIL_CALL_INTERP\n") @@ -251,11 +261,10 @@ def generate_tier1_cases( for part in inst.parts: # Only emit braces if more than one uop insert_braces = len([p for p in inst.parts if isinstance(p, Uop)]) > 1 - offset, stack = write_uop(part, emitter, offset, stack, inst, insert_braces) + reachable, offset, stack = write_uop(part, emitter, offset, stack, inst, insert_braces) out.start_line() - - stack.flush(out) - if not inst.parts[-1].properties.always_exits: + if reachable: # type: ignore[possibly-undefined] + stack.flush(out) out.emit("DISPATCH();\n") out.start_line() out.emit("}") diff --git a/Tools/cases_generator/tier2_generator.py b/Tools/cases_generator/tier2_generator.py index 75b0d5cb51072c..0ac2a0497e5d02 100644 --- a/Tools/cases_generator/tier2_generator.py +++ b/Tools/cases_generator/tier2_generator.py @@ -154,7 +154,7 @@ def write_uop(uop: Uop, emitter: Emitter, stack: Stack) -> Stack: cast = f"uint{cache.size*16}_t" emitter.emit(f"{type}{cache.name} = ({cast})CURRENT_OPERAND{idx}();\n") idx += 1 - storage = emitter.emit_tokens(uop, storage, None, False) + _, storage = emitter.emit_tokens(uop, storage, None, False) storage.flush(emitter.out) except StackError as ex: raise analysis_error(ex.args[0], uop.body.open) from None From e115ce3be9d28c0d7fb3ac0627439b33d809a121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Fri, 4 Apr 2025 19:04:00 +0200 Subject: [PATCH 11/12] gh-99108: Implement HACL* HMAC (#130157) A new extension module, `_hmac`, now exposes the HACL* HMAC (formally verified) implementation. The HACL* implementation is used as a fallback implementation when the OpenSSL implementation of HMAC is not available or disabled. For now, only named hash algorithms are recognized and SIMD support provided by HACL* for the BLAKE2 hash functions is not yet used. --- Doc/whatsnew/3.14.rst | 16 + Lib/hmac.py | 96 +- Lib/test/support/hashlib_helper.py | 9 + Lib/test/test_hmac.py | 147 +- Makefile.pre.in | 123 +- ...5-02-15-14-36-32.gh-issue-99108.u6CfmK.rst | 2 + Misc/sbom.spdx.json | 137 +- Modules/Setup | 11 +- Modules/Setup.stdlib.in | 12 +- Modules/_hacl/Hacl_HMAC.c | 1567 ++++++++++ Modules/_hacl/Hacl_HMAC.h | 224 ++ Modules/_hacl/Hacl_Streaming_HMAC.c | 2551 +++++++++++++++++ Modules/_hacl/Hacl_Streaming_HMAC.h | 134 + Modules/_hacl/README.md | 14 +- Modules/_hacl/internal/Hacl_HMAC.h | 52 + Modules/_hacl/internal/Hacl_Streaming_HMAC.h | 94 + Modules/_hacl/libintvector-shim.h | 35 + Modules/_hacl/python_hacl_namespaces.h | 27 + Modules/_hacl/refresh.sh | 21 +- Modules/clinic/hmacmodule.c.h | 673 +++++ Modules/hmacmodule.c | 1758 ++++++++++++ PC/config.c | 30 +- PCbuild/pythoncore.vcxproj | 3 + PCbuild/pythoncore.vcxproj.filters | 12 + Python/stdlib_module_names.h | 1 + Tools/c-analyzer/cpython/_parser.py | 1 + Tools/c-analyzer/cpython/ignored.tsv | 1 + configure | 47 + configure.ac | 7 + 29 files changed, 7702 insertions(+), 103 deletions(-) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2025-02-15-14-36-32.gh-issue-99108.u6CfmK.rst create mode 100644 Modules/_hacl/Hacl_HMAC.c create mode 100644 Modules/_hacl/Hacl_HMAC.h create mode 100644 Modules/_hacl/Hacl_Streaming_HMAC.c create mode 100644 Modules/_hacl/Hacl_Streaming_HMAC.h create mode 100644 Modules/_hacl/internal/Hacl_HMAC.h create mode 100644 Modules/_hacl/internal/Hacl_Streaming_HMAC.h create mode 100644 Modules/_hacl/libintvector-shim.h create mode 100644 Modules/clinic/hmacmodule.c.h create mode 100644 Modules/hmacmodule.c diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index a561d3b3383fc5..c475d33472a318 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -455,6 +455,13 @@ Other language changes The testbed can also be used to run the test suite of projects other than CPython itself. (Contributed by Russell Keith-Magee in :gh:`127592`.) +* Add a built-in implementation for HMAC (:rfc:`2104`) using formally verified + code from the `HACL* `__ project. + This implementation is used as a fallback when the OpenSSL implementation + of HMAC is not available. + (Contributed by Bénédikt Tran in :gh:`99108`.) + + .. _whatsnew314-pep765: PEP 765: Disallow return/break/continue that exit a finally block @@ -464,6 +471,7 @@ The compiler emits a :exc:`SyntaxWarning` when a :keyword:`return`, :keyword:`br :keyword:`continue` statements appears where it exits a :keyword:`finally` block. This change is specified in :pep:`765`. + New modules =========== @@ -705,6 +713,14 @@ graphlib (Contributed by Daniel Pope in :gh:`130914`) +hmac +---- + +* Add a built-in implementation for HMAC (:rfc:`2104`) using formally verified + code from the `HACL* `__ project. + (Contributed by Bénédikt Tran in :gh:`99108`.) + + http ---- diff --git a/Lib/hmac.py b/Lib/hmac.py index 30b6b478734dfc..2af11c26947064 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -3,7 +3,6 @@ Implements the HMAC algorithm as described by RFC 2104. """ -import warnings as _warnings try: import _hashlib as _hashopenssl except ImportError: @@ -14,7 +13,10 @@ compare_digest = _hashopenssl.compare_digest _functype = type(_hashopenssl.openssl_sha256) # builtin type -import hashlib as _hashlib +try: + import _hmac +except ImportError: + _hmac = None trans_5C = bytes((x ^ 0x5C) for x in range(256)) trans_36 = bytes((x ^ 0x36) for x in range(256)) @@ -24,11 +26,27 @@ digest_size = None +def _get_digest_constructor(digest_like): + if callable(digest_like): + return digest_like + if isinstance(digest_like, str): + def digest_wrapper(d=b''): + import hashlib + return hashlib.new(digest_like, d) + else: + def digest_wrapper(d=b''): + return digest_like.new(d) + return digest_wrapper + + class HMAC: """RFC 2104 HMAC class. Also complies with RFC 4231. This supports the API for Cryptographic Hash Functions (PEP 247). """ + + # Note: self.blocksize is the default blocksize; self.block_size + # is effective block size as well as the public API attribute. blocksize = 64 # 512-bit HMAC; can be changed in subclasses. __slots__ = ( @@ -50,32 +68,47 @@ def __init__(self, key, msg=None, digestmod=''): """ if not isinstance(key, (bytes, bytearray)): - raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__) + raise TypeError(f"key: expected bytes or bytearray, " + f"but got {type(key).__name__!r}") if not digestmod: raise TypeError("Missing required argument 'digestmod'.") + self.__init(key, msg, digestmod) + + def __init(self, key, msg, digestmod): if _hashopenssl and isinstance(digestmod, (str, _functype)): try: - self._init_hmac(key, msg, digestmod) + self._init_openssl_hmac(key, msg, digestmod) + return except _hashopenssl.UnsupportedDigestmodError: - self._init_old(key, msg, digestmod) - else: - self._init_old(key, msg, digestmod) + pass + if _hmac and isinstance(digestmod, str): + try: + self._init_builtin_hmac(key, msg, digestmod) + return + except _hmac.UnknownHashError: + pass + self._init_old(key, msg, digestmod) - def _init_hmac(self, key, msg, digestmod): + def _init_openssl_hmac(self, key, msg, digestmod): self._hmac = _hashopenssl.hmac_new(key, msg, digestmod=digestmod) self._inner = self._outer = None # because the slots are defined self.digest_size = self._hmac.digest_size self.block_size = self._hmac.block_size + _init_hmac = _init_openssl_hmac # for backward compatibility (if any) + + def _init_builtin_hmac(self, key, msg, digestmod): + self._hmac = _hmac.new(key, msg, digestmod=digestmod) + self._inner = self._outer = None # because the slots are defined + self.digest_size = self._hmac.digest_size + self.block_size = self._hmac.block_size + def _init_old(self, key, msg, digestmod): - if callable(digestmod): - digest_cons = digestmod - elif isinstance(digestmod, str): - digest_cons = lambda d=b'': _hashlib.new(digestmod, d) - else: - digest_cons = lambda d=b'': digestmod.new(d) + import warnings + + digest_cons = _get_digest_constructor(digestmod) self._hmac = None self._outer = digest_cons() @@ -85,21 +118,19 @@ def _init_old(self, key, msg, digestmod): if hasattr(self._inner, 'block_size'): blocksize = self._inner.block_size if blocksize < 16: - _warnings.warn('block_size of %d seems too small; using our ' - 'default of %d.' % (blocksize, self.blocksize), - RuntimeWarning, 2) + warnings.warn(f"block_size of {blocksize} seems too small; " + f"using our default of {self.blocksize}.", + RuntimeWarning, 2) blocksize = self.blocksize else: - _warnings.warn('No block_size attribute on given digest object; ' - 'Assuming %d.' % (self.blocksize), - RuntimeWarning, 2) + warnings.warn("No block_size attribute on given digest object; " + f"Assuming {self.blocksize}.", + RuntimeWarning, 2) blocksize = self.blocksize if len(key) > blocksize: key = digest_cons(key).digest() - # self.blocksize is the default blocksize. self.block_size is - # effective block size as well as the public API attribute. self.block_size = blocksize key = key.ljust(blocksize, b'\0') @@ -165,6 +196,7 @@ def hexdigest(self): h = self._current() return h.hexdigest() + def new(key, msg=None, digestmod=''): """Create a new hashing object and return it. @@ -194,25 +226,29 @@ def digest(key, msg, digest): A hashlib constructor returning a new hash object. *OR* A module supporting PEP 247. """ - if _hashopenssl is not None and isinstance(digest, (str, _functype)): + if _hashopenssl and isinstance(digest, (str, _functype)): try: return _hashopenssl.hmac_digest(key, msg, digest) except _hashopenssl.UnsupportedDigestmodError: pass - if callable(digest): - digest_cons = digest - elif isinstance(digest, str): - digest_cons = lambda d=b'': _hashlib.new(digest, d) - else: - digest_cons = lambda d=b'': digest.new(d) + if _hmac and isinstance(digest, str): + try: + return _hmac.compute_digest(key, msg, digest) + except (OverflowError, _hmac.UnknownHashError): + pass + + return _compute_digest_fallback(key, msg, digest) + +def _compute_digest_fallback(key, msg, digest): + digest_cons = _get_digest_constructor(digest) inner = digest_cons() outer = digest_cons() blocksize = getattr(inner, 'block_size', 64) if len(key) > blocksize: key = digest_cons(key).digest() - key = key + b'\x00' * (blocksize - len(key)) + key = key.ljust(blocksize, b'\0') inner.update(key.translate(trans_36)) outer.update(key.translate(trans_5C)) inner.update(msg) diff --git a/Lib/test/support/hashlib_helper.py b/Lib/test/support/hashlib_helper.py index bed3d696cb384d..06fac410a5e20f 100644 --- a/Lib/test/support/hashlib_helper.py +++ b/Lib/test/support/hashlib_helper.py @@ -8,11 +8,20 @@ except ImportError: _hashlib = None +try: + import _hmac +except ImportError: + _hmac = None + def requires_hashlib(): return unittest.skipIf(_hashlib is None, "requires _hashlib") +def requires_builtin_hmac(): + return unittest.skipIf(_hmac is None, "requires _hmac") + + def _decorate_func_or_class(func_or_class, decorator_func): if not isinstance(func_or_class, type): return decorator_func(func_or_class) diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py index 03b9defdce87d7..42b8a91ae580d2 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -4,6 +4,7 @@ import hashlib import random import test.support.hashlib_helper as hashlib_helper +import types import unittest import unittest.mock import warnings @@ -47,7 +48,7 @@ def setUpClass(cls): cls.hmac = import_fresh_module('hmac', blocked=['_hashlib', '_hmac']) -@unittest.skip("no builtin implementation for HMAC for now") +@hashlib_helper.requires_builtin_hmac() class BuiltinModuleMixin(ModuleMixin): """Built-in HACL* implementation of HMAC.""" @@ -128,6 +129,16 @@ def hmac_digest(self, key, msg=None, digestmod=None): return _hashlib.hmac_digest(key, msg, digest=digestmod) +class ThroughBuiltinAPIMixin(BuiltinModuleMixin, CreatorMixin, DigestMixin): + """Mixin delegating to _hmac.new() and _hmac.compute_digest().""" + + def hmac_new(self, key, msg=None, digestmod=None): + return self.hmac.new(key, msg, digestmod=digestmod) + + def hmac_digest(self, key, msg=None, digestmod=None): + return self.hmac.compute_digest(key, msg, digest=digestmod) + + class ObjectCheckerMixin: """Mixin for checking HMAC objects (pure Python, OpenSSL or built-in).""" @@ -205,6 +216,10 @@ def assert_hmac( self.assert_hmac_hexdigest( key, msg, hexdigest, digestmod, digest_size ) + self.assert_hmac_common_cases( + key, msg, hexdigest, digestmod, + hashname, digest_size, block_size + ) self.assert_hmac_extra_cases( key, msg, hexdigest, digestmod, hashname, digest_size, block_size @@ -224,7 +239,7 @@ def assert_hmac_new( This test uses the `hmac_new()` method to create HMAC objects. """ - self._check_hmac_new( + self.check_hmac_new( key, msg, hexdigest, hashname, digest_size, block_size, hmac_new_func=self.hmac_new, hmac_new_kwds={'digestmod': digestmod}, @@ -237,15 +252,15 @@ def assert_hmac_new_by_name( This test uses the `hmac_new_by_name()` method to create HMAC objects. """ - self._check_hmac_new( + self.check_hmac_new( key, msg, hexdigest, hashname, digest_size, block_size, hmac_new_func=self.hmac_new_by_name, hmac_new_kwds={'hashname': hashname}, ) - def _check_hmac_new( + def check_hmac_new( self, key, msg, hexdigest, hashname, digest_size, block_size, - hmac_new_func, hmac_new_kwds, + hmac_new_func, hmac_new_kwds=types.MappingProxyType({}), ): """Check that HMAC(key, msg) == digest. @@ -272,7 +287,7 @@ def assert_hmac_hexdigest( self, key, msg, hexdigest, digestmod, digest_size, ): """Check a HMAC digest computed by hmac_digest().""" - self._check_hmac_hexdigest( + self.check_hmac_hexdigest( key, msg, hexdigest, digest_size, hmac_digest_func=self.hmac_digest, hmac_digest_kwds={'digestmod': digestmod}, @@ -283,40 +298,50 @@ def assert_hmac_hexdigest_by_name( ): """Check a HMAC digest computed by hmac_digest_by_name().""" self.assertIsInstance(hashname, str) - self._check_hmac_hexdigest( + self.check_hmac_hexdigest( key, msg, hexdigest, digest_size, hmac_digest_func=self.hmac_digest_by_name, hmac_digest_kwds={'hashname': hashname}, ) - def _check_hmac_hexdigest( + def check_hmac_hexdigest( self, key, msg, hexdigest, digest_size, - hmac_digest_func, hmac_digest_kwds, + hmac_digest_func, hmac_digest_kwds=types.MappingProxyType({}), ): + """Check and return a HMAC digest computed by hmac_digest_func(). + + This HMAC digest is computed by: + + hmac_digest_func(key, msg, **hmac_digest_kwds) + + This is typically useful for checking one-shot HMAC functions. + """ d = hmac_digest_func(key, msg, **hmac_digest_kwds) self.assertEqual(len(d), digest_size) self.assertEqual(d, binascii.unhexlify(hexdigest)) + return d - def assert_hmac_extra_cases( + def assert_hmac_common_cases( self, key, msg, hexdigest, digestmod, hashname, digest_size, block_size ): - """Extra tests that can be added in subclasses.""" + """Common tests executed by all subclasses.""" h1 = self.hmac_new_by_name(key, hashname=hashname) h2 = h1.copy() h2.update(b"test update should not affect original") h1.update(msg) self.check_object(h1, hexdigest, hashname, digest_size, block_size) + def assert_hmac_extra_cases( + self, key, msg, hexdigest, digestmod, hashname, digest_size, block_size + ): + """Extra tests that can be added in subclasses.""" + class PyAssertersMixin(PyModuleMixin, AssertersMixin): def assert_hmac_extra_cases( self, key, msg, hexdigest, digestmod, hashname, digest_size, block_size ): - super().assert_hmac_extra_cases( - key, msg, hexdigest, digestmod, hashname, digest_size, block_size - ) - h = self.hmac.HMAC.__new__(self.hmac.HMAC) h._init_old(key, msg, digestmod=digestmod) self.check_object(h, hexdigest, hashname, digest_size, block_size) @@ -335,6 +360,10 @@ def hmac_digest_by_name(self, key, msg=None, *, hashname): return self.hmac_digest(key, msg, digestmod=openssl_func) +class BuiltinAssertersMixin(ThroughBuiltinAPIMixin, AssertersMixin): + pass + + class HashFunctionsTrait: """Trait class for 'hashfunc' in hmac_new() and hmac_digest().""" @@ -719,6 +748,24 @@ class OpenSSLRFCTestCase(OpenSSLAssertersMixin, """ +class BuiltinRFCTestCase(BuiltinAssertersMixin, + WithNamedHashFunctions, RFCTestCaseMixin, + unittest.TestCase): + """Built-in HACL* implementation of HMAC. + + The underlying hash functions are also HACL*-based. + """ + + def assert_hmac_extra_cases( + self, key, msg, hexdigest, digestmod, hashname, digest_size, block_size + ): + # assert one-shot HMAC at the same time + with self.subTest(key=key, msg=msg, hashname=hashname): + func = getattr(self.hmac, f'compute_{hashname}') + self.assertTrue(callable(func)) + self.check_hmac_hexdigest(key, msg, hexdigest, digest_size, func) + + # TODO(picnixz): once we have a HACL* HMAC, we should also test the Python # implementation of HMAC with a HACL*-based hash function. For now, we only # test it partially via the '_sha2' module, but for completeness we could @@ -726,7 +773,7 @@ class OpenSSLRFCTestCase(OpenSSLAssertersMixin, class DigestModTestCaseMixin(CreatorMixin, DigestMixin): - """Tests for the 'digestmod' parameter.""" + """Tests for the 'digestmod' parameter for hmac_new() and hmac_digest().""" def assert_raises_missing_digestmod(self): """A context manager catching errors when a digestmod is missing.""" @@ -869,11 +916,15 @@ def raiser(): class ExtensionConstructorTestCaseMixin(DigestModTestCaseMixin, ConstructorTestCaseMixin): - # The underlying C class. - obj_type = None + @property + def obj_type(self): + """The underlying (non-instantiable) C class.""" + raise NotImplementedError - # The exact exception class raised when a 'digestmod' parameter is invalid. - exc_type = None + @property + def exc_type(self): + """The exact exception class raised upon invalid 'digestmod' values.""" + raise NotImplementedError def test_internal_types(self): # internal C types are immutable and cannot be instantiated @@ -920,6 +971,24 @@ def test_hmac_digest_digestmod_parameter(self): self.hmac_digest(b'key', b'msg', value) +class BuiltinConstructorTestCase(ThroughBuiltinAPIMixin, + ExtensionConstructorTestCaseMixin, + unittest.TestCase): + + @property + def obj_type(self): + return self.hmac.HMAC + + @property + def exc_type(self): + return self.hmac.UnknownHashError + + def test_hmac_digest_digestmod_parameter(self): + for value in [object, 'unknown', 1234, None]: + with self.subTest(value=value), self.assert_digestmod_error(): + self.hmac_digest(b'key', b'msg', value) + + class SanityTestCaseMixin(CreatorMixin): """Sanity checks for HMAC objects and their object interface. @@ -975,6 +1044,20 @@ def test_repr(self): self.assertStartsWith(repr(h), f"<{self.digestname} HMAC object @") +class BuiltinSanityTestCase(ThroughBuiltinAPIMixin, SanityTestCaseMixin, + unittest.TestCase): + + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.hmac_class = cls.hmac.HMAC + cls.digestname = 'sha256' + + def test_repr(self): + h = self.hmac_new(b"my secret key", digestmod=self.digestname) + self.assertStartsWith(repr(h), f"<{self.digestname} HMAC object @") + + class UpdateTestCaseMixin: """Tests for the update() method (streaming HMAC).""" @@ -1006,7 +1089,7 @@ class PyUpdateTestCase(UpdateTestCaseMixin, unittest.TestCase): @classmethod def setUpClass(cls): super().setUpClass() - cls.hmac = import_fresh_module('hmac', blocked=['_hashlib']) + cls.hmac = import_fresh_module('hmac', blocked=['_hashlib', '_hmac']) def HMAC(self, key, msg=None): return self.hmac.HMAC(key, msg, digestmod='sha256') @@ -1016,7 +1099,16 @@ def HMAC(self, key, msg=None): class OpenSSLUpdateTestCase(UpdateTestCaseMixin, unittest.TestCase): def HMAC(self, key, msg=None): - return hmac.new(key, msg, digestmod='sha256') + return _hashlib.hmac_new(key, msg, digestmod='sha256') + + +class BuiltinUpdateTestCase(BuiltinModuleMixin, + UpdateTestCaseMixin, unittest.TestCase): + + def HMAC(self, key, msg=None): + # Even if Python does not build '_sha2', the HACL* sources + # are still built, making it possible to use SHA-2 hashes. + return self.hmac.new(key, msg, digestmod='sha256') class CopyBaseTestCase: @@ -1107,7 +1199,16 @@ def test_realcopy(self): class OpenSSLCopyTestCase(ExtensionCopyTestCase, unittest.TestCase): def init(self, h): - h._init_hmac(b"key", b"msg", digestmod="sha256") + h._init_openssl_hmac(b"key", b"msg", digestmod="sha256") + + +@hashlib_helper.requires_builtin_hmac() +class BuiltinCopyTestCase(ExtensionCopyTestCase, unittest.TestCase): + + def init(self, h): + # Even if Python does not build '_sha2', the HACL* sources + # are still built, making it possible to use SHA-2 hashes. + h._init_builtin_hmac(b"key", b"msg", digestmod="sha256") class CompareDigestMixin: diff --git a/Makefile.pre.in b/Makefile.pre.in index 3ef0c6320c85db..e10c78d6403472 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -227,8 +227,12 @@ ENSUREPIP= @ENSUREPIP@ # Internal static libraries LIBMPDEC_A= Modules/_decimal/libmpdec/libmpdec.a LIBEXPAT_A= Modules/expat/libexpat.a +LIBHACL_MD5_A= Modules/_hacl/libHacl_Hash_MD5.a +LIBHACL_SHA1_A= Modules/_hacl/libHacl_Hash_SHA1.a LIBHACL_SHA2_A= Modules/_hacl/libHacl_Hash_SHA2.a +LIBHACL_SHA3_A= Modules/_hacl/libHacl_Hash_SHA3.a LIBHACL_BLAKE2_A= Modules/_hacl/libHacl_Hash_Blake2.a +LIBHACL_HMAC_A= Modules/_hacl/libHacl_HMAC.a LIBHACL_CFLAGS=@LIBHACL_CFLAGS@ LIBHACL_SIMD128_FLAGS=@LIBHACL_SIMD128_FLAGS@ LIBHACL_SIMD256_FLAGS=@LIBHACL_SIMD256_FLAGS@ @@ -656,30 +660,65 @@ LIBEXPAT_HEADERS= \ ########################################################################## # hashlib's HACL* library +LIBHACL_MD5_OBJS= \ + Modules/_hacl/Hacl_Hash_MD5.o + +LIBHACL_SHA1_OBJS= \ + Modules/_hacl/Hacl_Hash_SHA1.o + LIBHACL_SHA2_OBJS= \ - Modules/_hacl/Hacl_Hash_SHA2.o + Modules/_hacl/Hacl_Hash_SHA2.o + +LIBHACL_SHA3_OBJS= \ + Modules/_hacl/Hacl_Hash_SHA3.o LIBHACL_BLAKE2_OBJS= \ - Modules/_hacl/Hacl_Hash_Blake2s.o \ - Modules/_hacl/Hacl_Hash_Blake2b.o \ - Modules/_hacl/Lib_Memzero0.o \ + Modules/_hacl/Hacl_Hash_Blake2s.o \ + Modules/_hacl/Hacl_Hash_Blake2b.o \ + Modules/_hacl/Lib_Memzero0.o \ $(LIBHACL_SIMD128_OBJS) \ $(LIBHACL_SIMD256_OBJS) +LIBHACL_HMAC_OBJS= \ + Modules/_hacl/Hacl_HMAC.o \ + Modules/_hacl/Hacl_Streaming_HMAC.o \ + $(LIBHACL_MD5_OBJS) \ + $(LIBHACL_SHA1_OBJS) \ + $(LIBHACL_SHA2_OBJS) \ + $(LIBHACL_SHA3_OBJS) \ + $(LIBHACL_BLAKE2_OBJS) + LIBHACL_HEADERS= \ - Modules/_hacl/include/krml/FStar_UInt128_Verified.h \ - Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h \ - Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h \ - Modules/_hacl/include/krml/internal/compat.h \ - Modules/_hacl/include/krml/internal/target.h \ - Modules/_hacl/include/krml/internal/types.h \ - Modules/_hacl/include/krml/lowstar_endianness.h \ + Modules/_hacl/include/krml/FStar_UInt128_Verified.h \ + Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h \ + Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h \ + Modules/_hacl/include/krml/internal/compat.h \ + Modules/_hacl/include/krml/internal/target.h \ + Modules/_hacl/include/krml/internal/types.h \ + Modules/_hacl/include/krml/lowstar_endianness.h \ Modules/_hacl/Hacl_Streaming_Types.h \ - Modules/_hacl/python_hacl_namespaces.h + Modules/_hacl/internal/Hacl_Streaming_Types.h \ + Modules/_hacl/libintvector.h \ + Modules/_hacl/python_hacl_namespaces.h + +LIBHACL_MD5_HEADERS= \ + Modules/_hacl/Hacl_Hash_MD5.h \ + Modules/_hacl/internal/Hacl_Hash_MD5.h \ + $(LIBHACL_HEADERS) + +LIBHACL_SHA1_HEADERS= \ + Modules/_hacl/Hacl_Hash_SHA1.h \ + Modules/_hacl/internal/Hacl_Hash_SHA1.h \ + $(LIBHACL_HEADERS) LIBHACL_SHA2_HEADERS= \ - Modules/_hacl/Hacl_Hash_SHA2.h \ - Modules/_hacl/internal/Hacl_Hash_SHA2.h \ + Modules/_hacl/Hacl_Hash_SHA2.h \ + Modules/_hacl/internal/Hacl_Hash_SHA2.h \ + $(LIBHACL_HEADERS) + +LIBHACL_SHA3_HEADERS= \ + Modules/_hacl/Hacl_Hash_SHA3.h \ + Modules/_hacl/internal/Hacl_Hash_SHA3.h \ $(LIBHACL_HEADERS) LIBHACL_BLAKE2_HEADERS= \ @@ -695,6 +734,19 @@ LIBHACL_BLAKE2_HEADERS= \ Modules/_hacl/internal/Hacl_Streaming_Types.h \ $(LIBHACL_HEADERS) +LIBHACL_HMAC_HEADERS= \ + Modules/_hacl/Hacl_HMAC.h \ + Modules/_hacl/Hacl_Streaming_HMAC.h \ + Modules/_hacl/internal/Hacl_HMAC.h \ + Modules/_hacl/internal/Hacl_Streaming_HMAC.h \ + Modules/_hacl/libintvector-shim.h \ + $(LIBHACL_MD5_HEADERS) \ + $(LIBHACL_SHA1_HEADERS) \ + $(LIBHACL_SHA2_HEADERS) \ + $(LIBHACL_SHA3_HEADERS) \ + $(LIBHACL_BLAKE2_HEADERS) \ + $(LIBHACL_HEADERS) + ######################################################################### # Rules @@ -1408,10 +1460,25 @@ $(LIBEXPAT_A): $(LIBEXPAT_OBJS) $(AR) $(ARFLAGS) $@ $(LIBEXPAT_OBJS) ########################################################################## -# Build HACL* static libraries for hashlib: libHacl_Hash_SHA2.a, and -# libHacl_Blake2.a -- the contents of the latter vary depending on whether we +# Build HACL* static libraries for hashlib and HACL* HMAC. +# +# The contents of libHacl_Blake2.a vary depending on whether we # have the ability to compile vectorized versions +Modules/_hacl/Hacl_Hash_MD5.o: $(srcdir)/Modules/_hacl/Hacl_Hash_MD5.c $(LIBHACL_MD5_HEADERS) + $(CC) -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_Hash_MD5.c + +$(LIBHACL_MD5_A): $(LIBHACL_MD5_OBJS) + -rm -f $@ + $(AR) $(ARFLAGS) $@ $(LIBHACL_MD5_OBJS) + +Modules/_hacl/Hacl_Hash_SHA1.o: $(srcdir)/Modules/_hacl/Hacl_Hash_SHA1.c $(LIBHACL_SHA1_HEADERS) + $(CC) -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_Hash_SHA1.c + +$(LIBHACL_SHA1_A): $(LIBHACL_SHA1_OBJS) + -rm -f $@ + $(AR) $(ARFLAGS) $@ $(LIBHACL_SHA1_OBJS) + Modules/_hacl/Hacl_Hash_SHA2.o: $(srcdir)/Modules/_hacl/Hacl_Hash_SHA2.c $(LIBHACL_SHA2_HEADERS) $(CC) -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_Hash_SHA2.c @@ -1419,6 +1486,13 @@ $(LIBHACL_SHA2_A): $(LIBHACL_SHA2_OBJS) -rm -f $@ $(AR) $(ARFLAGS) $@ $(LIBHACL_SHA2_OBJS) +Modules/_hacl/Hacl_Hash_SHA3.o: $(srcdir)/Modules/_hacl/Hacl_Hash_SHA3.c $(LIBHACL_SHA3_HEADERS) + $(CC) -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_Hash_SHA3.c + +$(LIBHACL_SHA3_A): $(LIBHACL_SHA3_OBJS) + -rm -f $@ + $(AR) $(ARFLAGS) $@ $(LIBHACL_SHA3_OBJS) + Modules/_hacl/Hacl_Hash_Blake2s.o: $(srcdir)/Modules/_hacl/Hacl_Hash_Blake2s.c $(LIBHACL_BLAKE2_HEADERS) $(CC) -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_Hash_Blake2s.c @@ -1444,6 +1518,16 @@ $(LIBHACL_BLAKE2_A): $(LIBHACL_BLAKE2_OBJS) -rm -f $@ $(AR) $(ARFLAGS) $@ $(LIBHACL_BLAKE2_OBJS) +Modules/_hacl/Hacl_HMAC.o: $(srcdir)/Modules/_hacl/Hacl_HMAC.c $(LIBHACL_HMAC_HEADERS) + $(CC) -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_HMAC.c + +Modules/_hacl/Hacl_Streaming_HMAC.o: $(srcdir)/Modules/_hacl/Hacl_Streaming_HMAC.c $(LIBHACL_HMAC_HEADERS) + $(CC) -Wno-unused-variable -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_Streaming_HMAC.c + +$(LIBHACL_HMAC_A): $(LIBHACL_HMAC_OBJS) + -rm -f $@ + $(AR) $(ARFLAGS) $@ $(LIBHACL_HMAC_OBJS) + # create relative links from build/lib.platform/egg.so to Modules/egg.so # pybuilddir.txt is created too late. We cannot use it in Makefile # targets. ln --relative is not portable. @@ -3216,11 +3300,12 @@ MODULE__DECIMAL_DEPS=$(srcdir)/Modules/_decimal/docstrings.h @LIBMPDEC_INTERNAL@ MODULE__ELEMENTTREE_DEPS=$(srcdir)/Modules/pyexpat.c @LIBEXPAT_INTERNAL@ MODULE__HASHLIB_DEPS=$(srcdir)/Modules/hashlib.h MODULE__IO_DEPS=$(srcdir)/Modules/_io/_iomodule.h -MODULE__MD5_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_HEADERS) Modules/_hacl/Hacl_Hash_MD5.h Modules/_hacl/internal/Hacl_Hash_MD5.h Modules/_hacl/Hacl_Hash_MD5.c -MODULE__SHA1_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_HEADERS) Modules/_hacl/Hacl_Hash_SHA1.h Modules/_hacl/internal/Hacl_Hash_SHA1.h Modules/_hacl/Hacl_Hash_SHA1.c +MODULE__MD5_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_MD5_HEADERS) $(LIBHACL_MD5_A) +MODULE__SHA1_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_SHA1_HEADERS) $(LIBHACL_SHA1_A) MODULE__SHA2_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_SHA2_HEADERS) $(LIBHACL_SHA2_A) -MODULE__SHA3_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_HEADERS) Modules/_hacl/Hacl_Hash_SHA3.h Modules/_hacl/internal/Hacl_Hash_SHA3.h Modules/_hacl/Hacl_Hash_SHA3.c +MODULE__SHA3_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_SHA3_HEADERS) $(LIBHACL_SHA3_A) MODULE__BLAKE2_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_BLAKE2_HEADERS) $(LIBHACL_BLAKE2_A) +MODULE__HMAC_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_HMAC_HEADERS) $(LIBHACL_HMAC_A) MODULE__SOCKET_DEPS=$(srcdir)/Modules/socketmodule.h $(srcdir)/Modules/addrinfo.h $(srcdir)/Modules/getaddrinfo.c $(srcdir)/Modules/getnameinfo.c MODULE__SSL_DEPS=$(srcdir)/Modules/_ssl.h $(srcdir)/Modules/_ssl/cert.c $(srcdir)/Modules/_ssl/debughelpers.c $(srcdir)/Modules/_ssl/misc.c $(srcdir)/Modules/_ssl_data_111.h $(srcdir)/Modules/_ssl_data_300.h $(srcdir)/Modules/socketmodule.h MODULE__TESTCAPI_DEPS=$(srcdir)/Modules/_testcapi/parts.h $(srcdir)/Modules/_testcapi/util.h diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-02-15-14-36-32.gh-issue-99108.u6CfmK.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-02-15-14-36-32.gh-issue-99108.u6CfmK.rst new file mode 100644 index 00000000000000..4cb6af14ee6c65 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-02-15-14-36-32.gh-issue-99108.u6CfmK.rst @@ -0,0 +1,2 @@ +Add support for built-in implementation of HMAC (:rfc:`2104`) based on +HACL*. Patch by Bénédikt Tran. diff --git a/Misc/sbom.spdx.json b/Misc/sbom.spdx.json index 617c631c357db2..678a64df977432 100644 --- a/Misc/sbom.spdx.json +++ b/Misc/sbom.spdx.json @@ -281,6 +281,34 @@ ], "fileName": "Modules/expat/xmltok_ns.c" }, + { + "SPDXID": "SPDXRef-FILE-Modules-hacl-Hacl-HMAC.c", + "checksums": [ + { + "algorithm": "SHA1", + "checksumValue": "705dc7220dad725881592749f7febaf6135cc9fd" + }, + { + "algorithm": "SHA256", + "checksumValue": "142adb769ff02b8a5327f0eb837e1f9a797bdf9a1684d21acd749dbb5b2e5be2" + } + ], + "fileName": "Modules/_hacl/Hacl_HMAC.c" + }, + { + "SPDXID": "SPDXRef-FILE-Modules-hacl-Hacl-HMAC.h", + "checksums": [ + { + "algorithm": "SHA1", + "checksumValue": "de7179fe6970e2b5d281dfed977ed91be635b8d2" + }, + { + "algorithm": "SHA256", + "checksumValue": "c0ba888d87775c7d7f7d8a08dac7b3988fed81e11bb52396d90f762a8e90a7eb" + } + ], + "fileName": "Modules/_hacl/Hacl_HMAC.h" + }, { "SPDXID": "SPDXRef-FILE-Modules-hacl-Hacl-Hash-Blake2b.c", "checksums": [ @@ -533,6 +561,34 @@ ], "fileName": "Modules/_hacl/Hacl_Hash_SHA3.h" }, + { + "SPDXID": "SPDXRef-FILE-Modules-hacl-Hacl-Streaming-HMAC.c", + "checksums": [ + { + "algorithm": "SHA1", + "checksumValue": "8140310f505bb2619a749777a91487d666237bcf" + }, + { + "algorithm": "SHA256", + "checksumValue": "9d95e6a651c22185d9b7c38f363d30159f810e6fcdc2208f29492837ed891e82" + } + ], + "fileName": "Modules/_hacl/Hacl_Streaming_HMAC.c" + }, + { + "SPDXID": "SPDXRef-FILE-Modules-hacl-Hacl-Streaming-HMAC.h", + "checksums": [ + { + "algorithm": "SHA1", + "checksumValue": "49523144583a15d96ba1646af02dc292e633bf8f" + }, + { + "algorithm": "SHA256", + "checksumValue": "78345519bf6789264f6792b809ee97a9ecf7cb5829c674c61e2d99bfdfdc36fc" + } + ], + "fileName": "Modules/_hacl/Hacl_Streaming_HMAC.h" + }, { "SPDXID": "SPDXRef-FILE-Modules-hacl-Hacl-Streaming-Types.h", "checksums": [ @@ -659,6 +715,20 @@ ], "fileName": "Modules/_hacl/include/krml/lowstar_endianness.h" }, + { + "SPDXID": "SPDXRef-FILE-Modules-hacl-internal-Hacl-HMAC.h", + "checksums": [ + { + "algorithm": "SHA1", + "checksumValue": "aaa656e25a92ba83655e1398a97efa6981f60fc4" + }, + { + "algorithm": "SHA256", + "checksumValue": "a59abc6e9b3019cb18976a15e634f5146bd965fc9babf4ccbf2b531164a34f85" + } + ], + "fileName": "Modules/_hacl/internal/Hacl_HMAC.h" + }, { "SPDXID": "SPDXRef-FILE-Modules-hacl-internal-Hacl-Hash-Blake2b.h", "checksums": [ @@ -785,6 +855,20 @@ ], "fileName": "Modules/_hacl/internal/Hacl_Impl_Blake2_Constants.h" }, + { + "SPDXID": "SPDXRef-FILE-Modules-hacl-internal-Hacl-Streaming-HMAC.h", + "checksums": [ + { + "algorithm": "SHA1", + "checksumValue": "2048f3cd61dbda2df862a2982ebaf24b6815ed51" + }, + { + "algorithm": "SHA256", + "checksumValue": "b0f5a79c98525b0cb1659238e095641328b7da16a94cb57a0793e635d1da3653" + } + ], + "fileName": "Modules/_hacl/internal/Hacl_Streaming_HMAC.h" + }, { "SPDXID": "SPDXRef-FILE-Modules-hacl-internal-Hacl-Streaming-Types.h", "checksums": [ @@ -813,6 +897,20 @@ ], "fileName": "Modules/_hacl/lib_memzero0.h" }, + { + "SPDXID": "SPDXRef-FILE-Modules-hacl-libintvector-shim.h", + "checksums": [ + { + "algorithm": "SHA1", + "checksumValue": "a28d706b06985c14f01a5527e568beb28f28109e" + }, + { + "algorithm": "SHA256", + "checksumValue": "f26e8339da7e0db3d6c8f70247300bd5876110a30e1fb883e59370da48e38f9e" + } + ], + "fileName": "Modules/_hacl/libintvector-shim.h" + }, { "SPDXID": "SPDXRef-FILE-Modules-hacl-libintvector.h", "checksums": [ @@ -832,11 +930,11 @@ "checksums": [ { "algorithm": "SHA1", - "checksumValue": "37e3eb63c5c6f8ae671748bfde642c180b96d2de" + "checksumValue": "dbed915328619b1159012649a427c6928033dd90" }, { "algorithm": "SHA256", - "checksumValue": "0b5c7892cc25a2b3467936c1f346a6186d9d0a257d1bd5671beda253b66e0f68" + "checksumValue": "0297ea0a5d1117e001d5dbb90f99d47ee9e0f9d3dd45da02ba5dc477e551cb5a" } ], "fileName": "Modules/_hacl/python_hacl_namespaces.h" @@ -1817,6 +1915,16 @@ "relationshipType": "CONTAINS", "spdxElementId": "SPDXRef-PACKAGE-expat" }, + { + "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-Hacl-HMAC.c", + "relationshipType": "CONTAINS", + "spdxElementId": "SPDXRef-PACKAGE-hacl-star" + }, + { + "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-Hacl-HMAC.h", + "relationshipType": "CONTAINS", + "spdxElementId": "SPDXRef-PACKAGE-hacl-star" + }, { "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-Hacl-Hash-Blake2b.c", "relationshipType": "CONTAINS", @@ -1907,6 +2015,16 @@ "relationshipType": "CONTAINS", "spdxElementId": "SPDXRef-PACKAGE-hacl-star" }, + { + "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-Hacl-Streaming-HMAC.c", + "relationshipType": "CONTAINS", + "spdxElementId": "SPDXRef-PACKAGE-hacl-star" + }, + { + "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-Hacl-Streaming-HMAC.h", + "relationshipType": "CONTAINS", + "spdxElementId": "SPDXRef-PACKAGE-hacl-star" + }, { "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-Hacl-Streaming-Types.h", "relationshipType": "CONTAINS", @@ -1952,6 +2070,11 @@ "relationshipType": "CONTAINS", "spdxElementId": "SPDXRef-PACKAGE-hacl-star" }, + { + "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-internal-Hacl-HMAC.h", + "relationshipType": "CONTAINS", + "spdxElementId": "SPDXRef-PACKAGE-hacl-star" + }, { "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-internal-Hacl-Hash-Blake2b.h", "relationshipType": "CONTAINS", @@ -1997,6 +2120,11 @@ "relationshipType": "CONTAINS", "spdxElementId": "SPDXRef-PACKAGE-hacl-star" }, + { + "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-internal-Hacl-Streaming-HMAC.h", + "relationshipType": "CONTAINS", + "spdxElementId": "SPDXRef-PACKAGE-hacl-star" + }, { "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-internal-Hacl-Streaming-Types.h", "relationshipType": "CONTAINS", @@ -2007,6 +2135,11 @@ "relationshipType": "CONTAINS", "spdxElementId": "SPDXRef-PACKAGE-hacl-star" }, + { + "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-libintvector-shim.h", + "relationshipType": "CONTAINS", + "spdxElementId": "SPDXRef-PACKAGE-hacl-star" + }, { "relatedSpdxElement": "SPDXRef-FILE-Modules-hacl-libintvector.h", "relationshipType": "CONTAINS", diff --git a/Modules/Setup b/Modules/Setup index ddf39e0b966610..f075571ab94577 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -165,11 +165,12 @@ PYTHONPATH=$(COREPYTHONPATH) #pyexpat pyexpat.c # hashing builtins -#_blake2 blake2module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_Blake2.a -#_md5 md5module.c -I$(srcdir)/Modules/_hacl/include _hacl/Hacl_Hash_MD5.c -D_BSD_SOURCE -D_DEFAULT_SOURCE -#_sha1 sha1module.c -I$(srcdir)/Modules/_hacl/include _hacl/Hacl_Hash_SHA1.c -D_BSD_SOURCE -D_DEFAULT_SOURCE -#_sha2 sha2module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_SHA2.a -#_sha3 sha3module.c -I$(srcdir)/Modules/_hacl/include _hacl/Hacl_Hash_SHA3.c -D_BSD_SOURCE -D_DEFAULT_SOURCE +#_blake2 blake2module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_Blake2.a -D_BSD_SOURCE -D_DEFAULT_SOURCE +#_md5 md5module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_MD5.a -D_BSD_SOURCE -D_DEFAULT_SOURCE +#_sha1 sha1module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_SHA1.a -D_BSD_SOURCE -D_DEFAULT_SOURCE +#_sha2 sha2module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_SHA2.a -D_BSD_SOURCE -D_DEFAULT_SOURCE +#_sha3 sha3module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_SHA3.a -D_BSD_SOURCE -D_DEFAULT_SOURCE +#_hmac hmacmodule.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_HMAC.a -D_BSD_SOURCE -D_DEFAULT_SOURCE # text encodings and unicode #_codecs_cn cjkcodecs/_codecs_cn.c diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in index 6bb05a06a3465d..913c804c34ef76 100644 --- a/Modules/Setup.stdlib.in +++ b/Modules/Setup.stdlib.in @@ -78,11 +78,13 @@ @MODULE_READLINE_TRUE@readline readline.c # hashing builtins, can be disabled with --without-builtin-hashlib-hashes -@MODULE__MD5_TRUE@_md5 md5module.c -I$(srcdir)/Modules/_hacl/include _hacl/Hacl_Hash_MD5.c -D_BSD_SOURCE -D_DEFAULT_SOURCE -@MODULE__SHA1_TRUE@_sha1 sha1module.c -I$(srcdir)/Modules/_hacl/include _hacl/Hacl_Hash_SHA1.c -D_BSD_SOURCE -D_DEFAULT_SOURCE -@MODULE__SHA2_TRUE@_sha2 sha2module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_SHA2.a -@MODULE__SHA3_TRUE@_sha3 sha3module.c -I$(srcdir)/Modules/_hacl/include _hacl/Hacl_Hash_SHA3.c -D_BSD_SOURCE -D_DEFAULT_SOURCE -@MODULE__BLAKE2_TRUE@_blake2 blake2module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_Blake2.a +@MODULE__MD5_TRUE@_md5 md5module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_MD5.a -D_BSD_SOURCE -D_DEFAULT_SOURCE +@MODULE__SHA1_TRUE@_sha1 sha1module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_SHA1.a -D_BSD_SOURCE -D_DEFAULT_SOURCE +@MODULE__SHA2_TRUE@_sha2 sha2module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_SHA2.a -D_BSD_SOURCE -D_DEFAULT_SOURCE +@MODULE__SHA3_TRUE@_sha3 sha3module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_SHA3.a -D_BSD_SOURCE -D_DEFAULT_SOURCE +@MODULE__BLAKE2_TRUE@_blake2 blake2module.c -I$(srcdir)/Modules/_hacl/include Modules/_hacl/libHacl_Hash_Blake2.a -D_BSD_SOURCE -D_DEFAULT_SOURCE + +@MODULE__HMAC_TRUE@_hmac hmacmodule.c ############################################################################ # XML and text diff --git a/Modules/_hacl/Hacl_HMAC.c b/Modules/_hacl/Hacl_HMAC.c new file mode 100644 index 00000000000000..5299830865448a --- /dev/null +++ b/Modules/_hacl/Hacl_HMAC.c @@ -0,0 +1,1567 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#include "internal/Hacl_HMAC.h" + +#include "Hacl_Streaming_Types.h" + +#include "Hacl_Hash_SHA3.h" +#include "Hacl_Hash_SHA2.h" +#include "Hacl_Hash_Blake2s.h" +#include "Hacl_Hash_Blake2b.h" + +#include "internal/Hacl_Hash_SHA3.h" +#include "internal/Hacl_Hash_SHA2.h" +#include "internal/Hacl_Hash_SHA1.h" +#include "internal/Hacl_Hash_MD5.h" +#include "internal/Hacl_Hash_Blake2s.h" +#include "internal/Hacl_Hash_Blake2b.h" + +/** +Write the HMAC-MD5 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 64 byte. +`dst` must point to 16 bytes of memory. +*/ +void +Hacl_HMAC_compute_md5( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[64U]; + memset(key_block, 0U, 64U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 64U) + { + ite = key_len; + } + else + { + ite = 16U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 64U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_MD5_hash_oneshot(nkey, key, key_len); + } + uint8_t ipad[64U]; + memset(ipad, 0x36U, 64U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 64U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[64U]; + memset(opad, 0x5cU, 64U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 64U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint32_t s[4U] = { 0x67452301U, 0xefcdab89U, 0x98badcfeU, 0x10325476U }; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + Hacl_Hash_MD5_update_last(s, 0ULL, ipad, 64U); + } + else + { + uint32_t block_len = 64U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + Hacl_Hash_MD5_update_multi(s, ipad, 1U); + Hacl_Hash_MD5_update_multi(s, full_blocks, n_blocks); + Hacl_Hash_MD5_update_last(s, (uint64_t)64U + (uint64_t)full_blocks_len, rem, rem_len); + } + Hacl_Hash_MD5_finish(s, dst1); + uint8_t *hash1 = ipad; + Hacl_Hash_MD5_init(s); + uint32_t block_len = 64U; + uint32_t n_blocks0 = 16U / block_len; + uint32_t rem0 = 16U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 16U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + Hacl_Hash_MD5_update_multi(s, opad, 1U); + Hacl_Hash_MD5_update_multi(s, full_blocks, n_blocks); + Hacl_Hash_MD5_update_last(s, (uint64_t)64U + (uint64_t)full_blocks_len, rem, rem_len); + Hacl_Hash_MD5_finish(s, dst); +} + +/** +Write the HMAC-SHA-1 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 64 byte. +`dst` must point to 20 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha1( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[64U]; + memset(key_block, 0U, 64U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 64U) + { + ite = key_len; + } + else + { + ite = 20U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 64U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_SHA1_hash_oneshot(nkey, key, key_len); + } + uint8_t ipad[64U]; + memset(ipad, 0x36U, 64U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 64U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[64U]; + memset(opad, 0x5cU, 64U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 64U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint32_t s[5U] = { 0x67452301U, 0xefcdab89U, 0x98badcfeU, 0x10325476U, 0xc3d2e1f0U }; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + Hacl_Hash_SHA1_update_last(s, 0ULL, ipad, 64U); + } + else + { + uint32_t block_len = 64U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + Hacl_Hash_SHA1_update_multi(s, ipad, 1U); + Hacl_Hash_SHA1_update_multi(s, full_blocks, n_blocks); + Hacl_Hash_SHA1_update_last(s, (uint64_t)64U + (uint64_t)full_blocks_len, rem, rem_len); + } + Hacl_Hash_SHA1_finish(s, dst1); + uint8_t *hash1 = ipad; + Hacl_Hash_SHA1_init(s); + uint32_t block_len = 64U; + uint32_t n_blocks0 = 20U / block_len; + uint32_t rem0 = 20U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 20U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + Hacl_Hash_SHA1_update_multi(s, opad, 1U); + Hacl_Hash_SHA1_update_multi(s, full_blocks, n_blocks); + Hacl_Hash_SHA1_update_last(s, (uint64_t)64U + (uint64_t)full_blocks_len, rem, rem_len); + Hacl_Hash_SHA1_finish(s, dst); +} + +/** +Write the HMAC-SHA-2-224 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 64 bytes. +`dst` must point to 28 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha2_224( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[64U]; + memset(key_block, 0U, 64U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 64U) + { + ite = key_len; + } + else + { + ite = 28U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 64U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_SHA2_hash_224(nkey, key, key_len); + } + uint8_t ipad[64U]; + memset(ipad, 0x36U, 64U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 64U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[64U]; + memset(opad, 0x5cU, 64U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 64U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint32_t st[8U] = { 0U }; + KRML_MAYBE_FOR8(i, + 0U, + 8U, + 1U, + uint32_t *os = st; + uint32_t x = Hacl_Hash_SHA2_h224[i]; + os[i] = x;); + uint32_t *s = st; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + Hacl_Hash_SHA2_sha224_update_last(0ULL + (uint64_t)64U, 64U, ipad, s); + } + else + { + uint32_t block_len = 64U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + Hacl_Hash_SHA2_sha224_update_nblocks(64U, ipad, s); + Hacl_Hash_SHA2_sha224_update_nblocks(n_blocks * 64U, full_blocks, s); + Hacl_Hash_SHA2_sha224_update_last((uint64_t)64U + (uint64_t)full_blocks_len + (uint64_t)rem_len, + rem_len, + rem, + s); + } + Hacl_Hash_SHA2_sha224_finish(s, dst1); + uint8_t *hash1 = ipad; + Hacl_Hash_SHA2_sha224_init(s); + uint32_t block_len = 64U; + uint32_t n_blocks0 = 28U / block_len; + uint32_t rem0 = 28U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 28U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + Hacl_Hash_SHA2_sha224_update_nblocks(64U, opad, s); + Hacl_Hash_SHA2_sha224_update_nblocks(n_blocks * 64U, full_blocks, s); + Hacl_Hash_SHA2_sha224_update_last((uint64_t)64U + (uint64_t)full_blocks_len + (uint64_t)rem_len, + rem_len, + rem, + s); + Hacl_Hash_SHA2_sha224_finish(s, dst); +} + +/** +Write the HMAC-SHA-2-256 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 64 bytes. +`dst` must point to 32 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha2_256( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[64U]; + memset(key_block, 0U, 64U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 64U) + { + ite = key_len; + } + else + { + ite = 32U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 64U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_SHA2_hash_256(nkey, key, key_len); + } + uint8_t ipad[64U]; + memset(ipad, 0x36U, 64U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 64U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[64U]; + memset(opad, 0x5cU, 64U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 64U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint32_t st[8U] = { 0U }; + KRML_MAYBE_FOR8(i, + 0U, + 8U, + 1U, + uint32_t *os = st; + uint32_t x = Hacl_Hash_SHA2_h256[i]; + os[i] = x;); + uint32_t *s = st; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + Hacl_Hash_SHA2_sha256_update_last(0ULL + (uint64_t)64U, 64U, ipad, s); + } + else + { + uint32_t block_len = 64U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + Hacl_Hash_SHA2_sha256_update_nblocks(64U, ipad, s); + Hacl_Hash_SHA2_sha256_update_nblocks(n_blocks * 64U, full_blocks, s); + Hacl_Hash_SHA2_sha256_update_last((uint64_t)64U + (uint64_t)full_blocks_len + (uint64_t)rem_len, + rem_len, + rem, + s); + } + Hacl_Hash_SHA2_sha256_finish(s, dst1); + uint8_t *hash1 = ipad; + Hacl_Hash_SHA2_sha256_init(s); + uint32_t block_len = 64U; + uint32_t n_blocks0 = 32U / block_len; + uint32_t rem0 = 32U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 32U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + Hacl_Hash_SHA2_sha256_update_nblocks(64U, opad, s); + Hacl_Hash_SHA2_sha256_update_nblocks(n_blocks * 64U, full_blocks, s); + Hacl_Hash_SHA2_sha256_update_last((uint64_t)64U + (uint64_t)full_blocks_len + (uint64_t)rem_len, + rem_len, + rem, + s); + Hacl_Hash_SHA2_sha256_finish(s, dst); +} + +/** +Write the HMAC-SHA-2-384 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 128 bytes. +`dst` must point to 48 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha2_384( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[128U]; + memset(key_block, 0U, 128U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 128U) + { + ite = key_len; + } + else + { + ite = 48U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 128U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_SHA2_hash_384(nkey, key, key_len); + } + uint8_t ipad[128U]; + memset(ipad, 0x36U, 128U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 128U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[128U]; + memset(opad, 0x5cU, 128U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 128U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint64_t st[8U] = { 0U }; + KRML_MAYBE_FOR8(i, + 0U, + 8U, + 1U, + uint64_t *os = st; + uint64_t x = Hacl_Hash_SHA2_h384[i]; + os[i] = x;); + uint64_t *s = st; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + Hacl_Hash_SHA2_sha384_update_last(FStar_UInt128_add(FStar_UInt128_uint64_to_uint128(0ULL), + FStar_UInt128_uint64_to_uint128((uint64_t)128U)), + 128U, + ipad, + s); + } + else + { + uint32_t block_len = 128U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + Hacl_Hash_SHA2_sha384_update_nblocks(128U, ipad, s); + Hacl_Hash_SHA2_sha384_update_nblocks(n_blocks * 128U, full_blocks, s); + Hacl_Hash_SHA2_sha384_update_last(FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_uint64_to_uint128((uint64_t)128U), + FStar_UInt128_uint64_to_uint128((uint64_t)full_blocks_len)), + FStar_UInt128_uint64_to_uint128((uint64_t)rem_len)), + rem_len, + rem, + s); + } + Hacl_Hash_SHA2_sha384_finish(s, dst1); + uint8_t *hash1 = ipad; + Hacl_Hash_SHA2_sha384_init(s); + uint32_t block_len = 128U; + uint32_t n_blocks0 = 48U / block_len; + uint32_t rem0 = 48U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 48U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + Hacl_Hash_SHA2_sha384_update_nblocks(128U, opad, s); + Hacl_Hash_SHA2_sha384_update_nblocks(n_blocks * 128U, full_blocks, s); + Hacl_Hash_SHA2_sha384_update_last(FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_uint64_to_uint128((uint64_t)128U), + FStar_UInt128_uint64_to_uint128((uint64_t)full_blocks_len)), + FStar_UInt128_uint64_to_uint128((uint64_t)rem_len)), + rem_len, + rem, + s); + Hacl_Hash_SHA2_sha384_finish(s, dst); +} + +/** +Write the HMAC-SHA-2-512 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 128 bytes. +`dst` must point to 64 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha2_512( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[128U]; + memset(key_block, 0U, 128U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 128U) + { + ite = key_len; + } + else + { + ite = 64U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 128U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_SHA2_hash_512(nkey, key, key_len); + } + uint8_t ipad[128U]; + memset(ipad, 0x36U, 128U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 128U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[128U]; + memset(opad, 0x5cU, 128U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 128U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint64_t st[8U] = { 0U }; + KRML_MAYBE_FOR8(i, + 0U, + 8U, + 1U, + uint64_t *os = st; + uint64_t x = Hacl_Hash_SHA2_h512[i]; + os[i] = x;); + uint64_t *s = st; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + Hacl_Hash_SHA2_sha512_update_last(FStar_UInt128_add(FStar_UInt128_uint64_to_uint128(0ULL), + FStar_UInt128_uint64_to_uint128((uint64_t)128U)), + 128U, + ipad, + s); + } + else + { + uint32_t block_len = 128U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + Hacl_Hash_SHA2_sha512_update_nblocks(128U, ipad, s); + Hacl_Hash_SHA2_sha512_update_nblocks(n_blocks * 128U, full_blocks, s); + Hacl_Hash_SHA2_sha512_update_last(FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_uint64_to_uint128((uint64_t)128U), + FStar_UInt128_uint64_to_uint128((uint64_t)full_blocks_len)), + FStar_UInt128_uint64_to_uint128((uint64_t)rem_len)), + rem_len, + rem, + s); + } + Hacl_Hash_SHA2_sha512_finish(s, dst1); + uint8_t *hash1 = ipad; + Hacl_Hash_SHA2_sha512_init(s); + uint32_t block_len = 128U; + uint32_t n_blocks0 = 64U / block_len; + uint32_t rem0 = 64U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 64U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + Hacl_Hash_SHA2_sha512_update_nblocks(128U, opad, s); + Hacl_Hash_SHA2_sha512_update_nblocks(n_blocks * 128U, full_blocks, s); + Hacl_Hash_SHA2_sha512_update_last(FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_uint64_to_uint128((uint64_t)128U), + FStar_UInt128_uint64_to_uint128((uint64_t)full_blocks_len)), + FStar_UInt128_uint64_to_uint128((uint64_t)rem_len)), + rem_len, + rem, + s); + Hacl_Hash_SHA2_sha512_finish(s, dst); +} + +/** +Write the HMAC-SHA-3-224 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 144 bytes. +`dst` must point to 28 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha3_224( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[144U]; + memset(key_block, 0U, 144U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 144U) + { + ite = key_len; + } + else + { + ite = 28U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 144U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_SHA3_sha3_224(nkey, key, key_len); + } + uint8_t ipad[144U]; + memset(ipad, 0x36U, 144U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 144U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[144U]; + memset(opad, 0x5cU, 144U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 144U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint64_t s[25U] = { 0U }; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_224, s, ipad, 144U); + } + else + { + uint32_t block_len = 144U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_224, s, ipad, 1U); + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_224, s, full_blocks, n_blocks); + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_224, s, rem, rem_len); + } + uint32_t remOut = 28U; + uint8_t hbuf0[256U] = { 0U }; + uint64_t ws0[32U] = { 0U }; + memcpy(ws0, s, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf0 + i * 8U, ws0[i]); + } + memcpy(dst1 + 28U - remOut, hbuf0, remOut * sizeof (uint8_t)); + uint8_t *hash1 = ipad; + Hacl_Hash_SHA3_init_(Spec_Hash_Definitions_SHA3_224, s); + uint32_t block_len = 144U; + uint32_t n_blocks0 = 28U / block_len; + uint32_t rem0 = 28U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 28U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_224, s, opad, 1U); + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_224, s, full_blocks, n_blocks); + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_224, s, rem, rem_len); + uint32_t remOut0 = 28U; + uint8_t hbuf[256U] = { 0U }; + uint64_t ws[32U] = { 0U }; + memcpy(ws, s, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf + i * 8U, ws[i]); + } + memcpy(dst + 28U - remOut0, hbuf, remOut0 * sizeof (uint8_t)); +} + +/** +Write the HMAC-SHA-3-256 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 136 bytes. +`dst` must point to 32 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha3_256( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[136U]; + memset(key_block, 0U, 136U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 136U) + { + ite = key_len; + } + else + { + ite = 32U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 136U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_SHA3_sha3_256(nkey, key, key_len); + } + uint8_t ipad[136U]; + memset(ipad, 0x36U, 136U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 136U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[136U]; + memset(opad, 0x5cU, 136U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 136U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint64_t s[25U] = { 0U }; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_256, s, ipad, 136U); + } + else + { + uint32_t block_len = 136U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_256, s, ipad, 1U); + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_256, s, full_blocks, n_blocks); + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_256, s, rem, rem_len); + } + uint32_t remOut = 32U; + uint8_t hbuf0[256U] = { 0U }; + uint64_t ws0[32U] = { 0U }; + memcpy(ws0, s, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf0 + i * 8U, ws0[i]); + } + memcpy(dst1 + 32U - remOut, hbuf0, remOut * sizeof (uint8_t)); + uint8_t *hash1 = ipad; + Hacl_Hash_SHA3_init_(Spec_Hash_Definitions_SHA3_256, s); + uint32_t block_len = 136U; + uint32_t n_blocks0 = 32U / block_len; + uint32_t rem0 = 32U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 32U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_256, s, opad, 1U); + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_256, s, full_blocks, n_blocks); + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_256, s, rem, rem_len); + uint32_t remOut0 = 32U; + uint8_t hbuf[256U] = { 0U }; + uint64_t ws[32U] = { 0U }; + memcpy(ws, s, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf + i * 8U, ws[i]); + } + memcpy(dst + 32U - remOut0, hbuf, remOut0 * sizeof (uint8_t)); +} + +/** +Write the HMAC-SHA-3-384 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 104 bytes. +`dst` must point to 48 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha3_384( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[104U]; + memset(key_block, 0U, 104U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 104U) + { + ite = key_len; + } + else + { + ite = 48U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 104U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_SHA3_sha3_384(nkey, key, key_len); + } + uint8_t ipad[104U]; + memset(ipad, 0x36U, 104U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 104U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[104U]; + memset(opad, 0x5cU, 104U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 104U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint64_t s[25U] = { 0U }; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_384, s, ipad, 104U); + } + else + { + uint32_t block_len = 104U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_384, s, ipad, 1U); + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_384, s, full_blocks, n_blocks); + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_384, s, rem, rem_len); + } + uint32_t remOut = 48U; + uint8_t hbuf0[256U] = { 0U }; + uint64_t ws0[32U] = { 0U }; + memcpy(ws0, s, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf0 + i * 8U, ws0[i]); + } + memcpy(dst1 + 48U - remOut, hbuf0, remOut * sizeof (uint8_t)); + uint8_t *hash1 = ipad; + Hacl_Hash_SHA3_init_(Spec_Hash_Definitions_SHA3_384, s); + uint32_t block_len = 104U; + uint32_t n_blocks0 = 48U / block_len; + uint32_t rem0 = 48U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 48U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_384, s, opad, 1U); + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_384, s, full_blocks, n_blocks); + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_384, s, rem, rem_len); + uint32_t remOut0 = 48U; + uint8_t hbuf[256U] = { 0U }; + uint64_t ws[32U] = { 0U }; + memcpy(ws, s, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf + i * 8U, ws[i]); + } + memcpy(dst + 48U - remOut0, hbuf, remOut0 * sizeof (uint8_t)); +} + +/** +Write the HMAC-SHA-3-512 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 72 bytes. +`dst` must point to 64 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha3_512( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[72U]; + memset(key_block, 0U, 72U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 72U) + { + ite = key_len; + } + else + { + ite = 64U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 72U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_SHA3_sha3_512(nkey, key, key_len); + } + uint8_t ipad[72U]; + memset(ipad, 0x36U, 72U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 72U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[72U]; + memset(opad, 0x5cU, 72U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 72U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint64_t s[25U] = { 0U }; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_512, s, ipad, 72U); + } + else + { + uint32_t block_len = 72U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_512, s, ipad, 1U); + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_512, s, full_blocks, n_blocks); + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_512, s, rem, rem_len); + } + uint32_t remOut = 64U; + uint8_t hbuf0[256U] = { 0U }; + uint64_t ws0[32U] = { 0U }; + memcpy(ws0, s, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf0 + i * 8U, ws0[i]); + } + memcpy(dst1 + 64U - remOut, hbuf0, remOut * sizeof (uint8_t)); + uint8_t *hash1 = ipad; + Hacl_Hash_SHA3_init_(Spec_Hash_Definitions_SHA3_512, s); + uint32_t block_len = 72U; + uint32_t n_blocks0 = 64U / block_len; + uint32_t rem0 = 64U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 64U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_512, s, opad, 1U); + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_512, s, full_blocks, n_blocks); + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_512, s, rem, rem_len); + uint32_t remOut0 = 64U; + uint8_t hbuf[256U] = { 0U }; + uint64_t ws[32U] = { 0U }; + memcpy(ws, s, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf + i * 8U, ws[i]); + } + memcpy(dst + 64U - remOut0, hbuf, remOut0 * sizeof (uint8_t)); +} + +/** +Write the HMAC-BLAKE2s MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 64 bytes. +`dst` must point to 32 bytes of memory. +*/ +void +Hacl_HMAC_compute_blake2s_32( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[64U]; + memset(key_block, 0U, 64U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 64U) + { + ite = key_len; + } + else + { + ite = 32U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 64U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_Blake2s_hash_with_key(nkey, 32U, key, key_len, NULL, 0U); + } + uint8_t ipad[64U]; + memset(ipad, 0x36U, 64U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 64U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[64U]; + memset(opad, 0x5cU, 64U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 64U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint32_t s[16U] = { 0U }; + Hacl_Hash_Blake2s_init(s, 0U, 32U); + uint32_t *s0 = s; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + uint32_t wv[16U] = { 0U }; + Hacl_Hash_Blake2s_update_last(64U, wv, s0, false, 0ULL, 64U, ipad); + } + else + { + uint32_t block_len = 64U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + uint32_t wv[16U] = { 0U }; + Hacl_Hash_Blake2s_update_multi(64U, wv, s0, 0ULL, ipad, 1U); + uint32_t wv0[16U] = { 0U }; + Hacl_Hash_Blake2s_update_multi(n_blocks * 64U, + wv0, + s0, + (uint64_t)block_len, + full_blocks, + n_blocks); + uint32_t wv1[16U] = { 0U }; + Hacl_Hash_Blake2s_update_last(rem_len, + wv1, + s0, + false, + (uint64_t)64U + (uint64_t)full_blocks_len, + rem_len, + rem); + } + Hacl_Hash_Blake2s_finish(32U, dst1, s0); + uint8_t *hash1 = ipad; + Hacl_Hash_Blake2s_init(s0, 0U, 32U); + uint32_t block_len = 64U; + uint32_t n_blocks0 = 32U / block_len; + uint32_t rem0 = 32U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 32U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + uint32_t wv[16U] = { 0U }; + Hacl_Hash_Blake2s_update_multi(64U, wv, s0, 0ULL, opad, 1U); + uint32_t wv0[16U] = { 0U }; + Hacl_Hash_Blake2s_update_multi(n_blocks * 64U, + wv0, + s0, + (uint64_t)block_len, + full_blocks, + n_blocks); + uint32_t wv1[16U] = { 0U }; + Hacl_Hash_Blake2s_update_last(rem_len, + wv1, + s0, + false, + (uint64_t)64U + (uint64_t)full_blocks_len, + rem_len, + rem); + Hacl_Hash_Blake2s_finish(32U, dst, s0); +} + +/** +Write the HMAC-BLAKE2b MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 128 bytes. +`dst` must point to 64 bytes of memory. +*/ +void +Hacl_HMAC_compute_blake2b_32( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +) +{ + uint8_t key_block[128U]; + memset(key_block, 0U, 128U * sizeof (uint8_t)); + uint8_t *nkey = key_block; + uint32_t ite; + if (key_len <= 128U) + { + ite = key_len; + } + else + { + ite = 64U; + } + uint8_t *zeroes = key_block + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (key_len <= 128U) + { + memcpy(nkey, key, key_len * sizeof (uint8_t)); + } + else + { + Hacl_Hash_Blake2b_hash_with_key(nkey, 64U, key, key_len, NULL, 0U); + } + uint8_t ipad[128U]; + memset(ipad, 0x36U, 128U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 128U; i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = key_block[i]; + ipad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint8_t opad[128U]; + memset(opad, 0x5cU, 128U * sizeof (uint8_t)); + for (uint32_t i = 0U; i < 128U; i++) + { + uint8_t xi = opad[i]; + uint8_t yi = key_block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + uint64_t s[16U] = { 0U }; + Hacl_Hash_Blake2b_init(s, 0U, 64U); + uint64_t *s0 = s; + uint8_t *dst1 = ipad; + if (data_len == 0U) + { + uint64_t wv[16U] = { 0U }; + Hacl_Hash_Blake2b_update_last(128U, + wv, + s0, + false, + FStar_UInt128_uint64_to_uint128(0ULL), + 128U, + ipad); + } + else + { + uint32_t block_len = 128U; + uint32_t n_blocks0 = data_len / block_len; + uint32_t rem0 = data_len % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = data_len - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = data; + uint8_t *rem = data + full_blocks_len; + uint64_t wv[16U] = { 0U }; + Hacl_Hash_Blake2b_update_multi(128U, wv, s0, FStar_UInt128_uint64_to_uint128(0ULL), ipad, 1U); + uint64_t wv0[16U] = { 0U }; + Hacl_Hash_Blake2b_update_multi(n_blocks * 128U, + wv0, + s0, + FStar_UInt128_uint64_to_uint128((uint64_t)block_len), + full_blocks, + n_blocks); + uint64_t wv1[16U] = { 0U }; + Hacl_Hash_Blake2b_update_last(rem_len, + wv1, + s0, + false, + FStar_UInt128_add(FStar_UInt128_uint64_to_uint128((uint64_t)128U), + FStar_UInt128_uint64_to_uint128((uint64_t)full_blocks_len)), + rem_len, + rem); + } + Hacl_Hash_Blake2b_finish(64U, dst1, s0); + uint8_t *hash1 = ipad; + Hacl_Hash_Blake2b_init(s0, 0U, 64U); + uint32_t block_len = 128U; + uint32_t n_blocks0 = 64U / block_len; + uint32_t rem0 = 64U % block_len; + K___uint32_t_uint32_t scrut; + if (n_blocks0 > 0U && rem0 == 0U) + { + uint32_t n_blocks_ = n_blocks0 - 1U; + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks_, .snd = 64U - n_blocks_ * block_len }); + } + else + { + scrut = ((K___uint32_t_uint32_t){ .fst = n_blocks0, .snd = rem0 }); + } + uint32_t n_blocks = scrut.fst; + uint32_t rem_len = scrut.snd; + uint32_t full_blocks_len = n_blocks * block_len; + uint8_t *full_blocks = hash1; + uint8_t *rem = hash1 + full_blocks_len; + uint64_t wv[16U] = { 0U }; + Hacl_Hash_Blake2b_update_multi(128U, wv, s0, FStar_UInt128_uint64_to_uint128(0ULL), opad, 1U); + uint64_t wv0[16U] = { 0U }; + Hacl_Hash_Blake2b_update_multi(n_blocks * 128U, + wv0, + s0, + FStar_UInt128_uint64_to_uint128((uint64_t)block_len), + full_blocks, + n_blocks); + uint64_t wv1[16U] = { 0U }; + Hacl_Hash_Blake2b_update_last(rem_len, + wv1, + s0, + false, + FStar_UInt128_add(FStar_UInt128_uint64_to_uint128((uint64_t)128U), + FStar_UInt128_uint64_to_uint128((uint64_t)full_blocks_len)), + rem_len, + rem); + Hacl_Hash_Blake2b_finish(64U, dst, s0); +} + diff --git a/Modules/_hacl/Hacl_HMAC.h b/Modules/_hacl/Hacl_HMAC.h new file mode 100644 index 00000000000000..10ff15183f2834 --- /dev/null +++ b/Modules/_hacl/Hacl_HMAC.h @@ -0,0 +1,224 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_HMAC_H +#define __Hacl_HMAC_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "python_hacl_namespaces.h" +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +/** +Write the HMAC-MD5 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 64 byte. +`dst` must point to 16 bytes of memory. +*/ +void +Hacl_HMAC_compute_md5( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-SHA-1 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 64 byte. +`dst` must point to 20 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha1( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-SHA-2-224 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 64 bytes. +`dst` must point to 28 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha2_224( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-SHA-2-256 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 64 bytes. +`dst` must point to 32 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha2_256( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-SHA-2-384 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 128 bytes. +`dst` must point to 48 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha2_384( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-SHA-2-512 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 128 bytes. +`dst` must point to 64 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha2_512( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-SHA-3-224 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 144 bytes. +`dst` must point to 28 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha3_224( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-SHA-3-256 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 136 bytes. +`dst` must point to 32 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha3_256( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-SHA-3-384 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 104 bytes. +`dst` must point to 48 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha3_384( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-SHA-3-512 MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 72 bytes. +`dst` must point to 64 bytes of memory. +*/ +void +Hacl_HMAC_compute_sha3_512( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-BLAKE2s MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 64 bytes. +`dst` must point to 32 bytes of memory. +*/ +void +Hacl_HMAC_compute_blake2s_32( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +/** +Write the HMAC-BLAKE2b MAC of a message (`data`) by using a key (`key`) into `dst`. + +The key can be any length and will be hashed if it is longer and padded if it is shorter than 128 bytes. +`dst` must point to 64 bytes of memory. +*/ +void +Hacl_HMAC_compute_blake2b_32( + uint8_t *dst, + uint8_t *key, + uint32_t key_len, + uint8_t *data, + uint32_t data_len +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_HMAC_H_DEFINED +#endif diff --git a/Modules/_hacl/Hacl_Streaming_HMAC.c b/Modules/_hacl/Hacl_Streaming_HMAC.c new file mode 100644 index 00000000000000..d28b39792af576 --- /dev/null +++ b/Modules/_hacl/Hacl_Streaming_HMAC.c @@ -0,0 +1,2551 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#include "internal/Hacl_Streaming_HMAC.h" + +#include "Hacl_Streaming_Types.h" + +#include "Hacl_Hash_SHA3.h" +#include "Hacl_Hash_SHA2.h" +#include "Hacl_Hash_Blake2s_Simd128.h" +#include "Hacl_Hash_Blake2s.h" +#include "Hacl_Hash_Blake2b_Simd256.h" +#include "Hacl_Hash_Blake2b.h" +#include "internal/Hacl_Streaming_Types.h" + +#include "internal/Hacl_Hash_SHA3.h" +#include "internal/Hacl_Hash_SHA2.h" +#include "internal/Hacl_Hash_SHA1.h" +#include "internal/Hacl_Hash_MD5.h" +#include "internal/Hacl_Hash_Blake2s_Simd128.h" +#include "internal/Hacl_Hash_Blake2s.h" +#include "internal/Hacl_Hash_Blake2b_Simd256.h" +#include "internal/Hacl_Hash_Blake2b.h" + +static Spec_Hash_Definitions_hash_alg alg_of_impl(Hacl_Agile_Hash_impl i) +{ + switch (i) + { + case Hacl_Agile_Hash_MD5: + { + return Spec_Hash_Definitions_MD5; + } + case Hacl_Agile_Hash_SHA1: + { + return Spec_Hash_Definitions_SHA1; + } + case Hacl_Agile_Hash_SHA2_224: + { + return Spec_Hash_Definitions_SHA2_224; + } + case Hacl_Agile_Hash_SHA2_256: + { + return Spec_Hash_Definitions_SHA2_256; + } + case Hacl_Agile_Hash_SHA2_384: + { + return Spec_Hash_Definitions_SHA2_384; + } + case Hacl_Agile_Hash_SHA2_512: + { + return Spec_Hash_Definitions_SHA2_512; + } + case Hacl_Agile_Hash_SHA3_224: + { + return Spec_Hash_Definitions_SHA3_224; + } + case Hacl_Agile_Hash_SHA3_256: + { + return Spec_Hash_Definitions_SHA3_256; + } + case Hacl_Agile_Hash_SHA3_384: + { + return Spec_Hash_Definitions_SHA3_384; + } + case Hacl_Agile_Hash_SHA3_512: + { + return Spec_Hash_Definitions_SHA3_512; + } + case Hacl_Agile_Hash_Blake2S_32: + { + return Spec_Hash_Definitions_Blake2S; + } + case Hacl_Agile_Hash_Blake2S_128: + { + return Spec_Hash_Definitions_Blake2S; + } + case Hacl_Agile_Hash_Blake2B_32: + { + return Spec_Hash_Definitions_Blake2B; + } + case Hacl_Agile_Hash_Blake2B_256: + { + return Spec_Hash_Definitions_Blake2B; + } + default: + { + KRML_HOST_EPRINTF("KaRaMeL incomplete match at %s:%d\n", __FILE__, __LINE__); + KRML_HOST_EXIT(253U); + } + } +} + +static Hacl_Agile_Hash_impl impl_of_state_s(Hacl_Agile_Hash_state_s s) +{ + if (s.tag == Hacl_Agile_Hash_MD5_a) + { + return Hacl_Agile_Hash_MD5; + } + if (s.tag == Hacl_Agile_Hash_SHA1_a) + { + return Hacl_Agile_Hash_SHA1; + } + if (s.tag == Hacl_Agile_Hash_SHA2_224_a) + { + return Hacl_Agile_Hash_SHA2_224; + } + if (s.tag == Hacl_Agile_Hash_SHA2_256_a) + { + return Hacl_Agile_Hash_SHA2_256; + } + if (s.tag == Hacl_Agile_Hash_SHA2_384_a) + { + return Hacl_Agile_Hash_SHA2_384; + } + if (s.tag == Hacl_Agile_Hash_SHA2_512_a) + { + return Hacl_Agile_Hash_SHA2_512; + } + if (s.tag == Hacl_Agile_Hash_SHA3_224_a) + { + return Hacl_Agile_Hash_SHA3_224; + } + if (s.tag == Hacl_Agile_Hash_SHA3_256_a) + { + return Hacl_Agile_Hash_SHA3_256; + } + if (s.tag == Hacl_Agile_Hash_SHA3_384_a) + { + return Hacl_Agile_Hash_SHA3_384; + } + if (s.tag == Hacl_Agile_Hash_SHA3_512_a) + { + return Hacl_Agile_Hash_SHA3_512; + } + if (s.tag == Hacl_Agile_Hash_Blake2S_a) + { + return Hacl_Agile_Hash_Blake2S_32; + } + if (s.tag == Hacl_Agile_Hash_Blake2S_128_a) + { + return Hacl_Agile_Hash_Blake2S_128; + } + if (s.tag == Hacl_Agile_Hash_Blake2B_a) + { + return Hacl_Agile_Hash_Blake2B_32; + } + if (s.tag == Hacl_Agile_Hash_Blake2B_256_a) + { + return Hacl_Agile_Hash_Blake2B_256; + } + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "unreachable (pattern matches are exhaustive in F*)"); + KRML_HOST_EXIT(255U); +} + +static Hacl_Agile_Hash_impl impl_of_state(Hacl_Agile_Hash_state_s *s) +{ + return impl_of_state_s(*s); +} + +static Hacl_Agile_Hash_state_s *malloc_(Hacl_Agile_Hash_impl a) +{ + switch (a) + { + case Hacl_Agile_Hash_MD5: + { + uint32_t *s = (uint32_t *)KRML_HOST_CALLOC(4U, sizeof (uint32_t)); + if (s == NULL) + { + return NULL; + } + uint32_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = ((Hacl_Agile_Hash_state_s){ .tag = Hacl_Agile_Hash_MD5_a, { .case_MD5_a = s1 } }); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_SHA1: + { + uint32_t *s = (uint32_t *)KRML_HOST_CALLOC(5U, sizeof (uint32_t)); + if (s == NULL) + { + return NULL; + } + uint32_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = ((Hacl_Agile_Hash_state_s){ .tag = Hacl_Agile_Hash_SHA1_a, { .case_SHA1_a = s1 } }); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_SHA2_224: + { + uint32_t *s = (uint32_t *)KRML_HOST_CALLOC(8U, sizeof (uint32_t)); + if (s == NULL) + { + return NULL; + } + uint32_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_SHA2_224_a, + { .case_SHA2_224_a = s1 } + } + ); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_SHA2_256: + { + uint32_t *s = (uint32_t *)KRML_HOST_CALLOC(8U, sizeof (uint32_t)); + if (s == NULL) + { + return NULL; + } + uint32_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_SHA2_256_a, + { .case_SHA2_256_a = s1 } + } + ); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_SHA2_384: + { + uint64_t *s = (uint64_t *)KRML_HOST_CALLOC(8U, sizeof (uint64_t)); + if (s == NULL) + { + return NULL; + } + uint64_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_SHA2_384_a, + { .case_SHA2_384_a = s1 } + } + ); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_SHA2_512: + { + uint64_t *s = (uint64_t *)KRML_HOST_CALLOC(8U, sizeof (uint64_t)); + if (s == NULL) + { + return NULL; + } + uint64_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_SHA2_512_a, + { .case_SHA2_512_a = s1 } + } + ); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_SHA3_224: + { + uint64_t *s = (uint64_t *)KRML_HOST_CALLOC(25U, sizeof (uint64_t)); + if (s == NULL) + { + return NULL; + } + uint64_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_SHA3_224_a, + { .case_SHA3_224_a = s1 } + } + ); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_SHA3_256: + { + uint64_t *s = (uint64_t *)KRML_HOST_CALLOC(25U, sizeof (uint64_t)); + if (s == NULL) + { + return NULL; + } + uint64_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_SHA3_256_a, + { .case_SHA3_256_a = s1 } + } + ); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_SHA3_384: + { + uint64_t *s = (uint64_t *)KRML_HOST_CALLOC(25U, sizeof (uint64_t)); + if (s == NULL) + { + return NULL; + } + uint64_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_SHA3_384_a, + { .case_SHA3_384_a = s1 } + } + ); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_SHA3_512: + { + uint64_t *s = (uint64_t *)KRML_HOST_CALLOC(25U, sizeof (uint64_t)); + if (s == NULL) + { + return NULL; + } + uint64_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_SHA3_512_a, + { .case_SHA3_512_a = s1 } + } + ); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_Blake2S_32: + { + uint32_t *s = (uint32_t *)KRML_HOST_CALLOC(16U, sizeof (uint32_t)); + if (s == NULL) + { + return NULL; + } + uint32_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_Blake2S_a, + { .case_Blake2S_a = s1 } + } + ); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_Blake2S_128: + { + #if HACL_CAN_COMPILE_VEC128 + Lib_IntVector_Intrinsics_vec128 + *s = Hacl_Hash_Blake2s_Simd128_malloc_internal_state_with_key(); + if (s == NULL) + { + return NULL; + } + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_Blake2S_128_a, + { .case_Blake2S_128_a = s } + } + ); + } + if (st == NULL) + { + KRML_ALIGNED_FREE(s); + return NULL; + } + return st; + #else + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "provably unreachable code: did an unverified caller violate a precondition\?"); + KRML_HOST_EXIT(255U); + #endif + break; + } + case Hacl_Agile_Hash_Blake2B_32: + { + uint64_t *s = (uint64_t *)KRML_HOST_CALLOC(16U, sizeof (uint64_t)); + if (s == NULL) + { + return NULL; + } + uint64_t *s1 = s; + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_Blake2B_a, + { .case_Blake2B_a = s1 } + } + ); + } + if (st == NULL) + { + KRML_HOST_FREE(s1); + return NULL; + } + return st; + } + case Hacl_Agile_Hash_Blake2B_256: + { + #if HACL_CAN_COMPILE_VEC256 + Lib_IntVector_Intrinsics_vec256 + *s = Hacl_Hash_Blake2b_Simd256_malloc_internal_state_with_key(); + if (s == NULL) + { + return NULL; + } + Hacl_Agile_Hash_state_s + *st = (Hacl_Agile_Hash_state_s *)KRML_HOST_MALLOC(sizeof (Hacl_Agile_Hash_state_s)); + if (st != NULL) + { + st[0U] + = + ( + (Hacl_Agile_Hash_state_s){ + .tag = Hacl_Agile_Hash_Blake2B_256_a, + { .case_Blake2B_256_a = s } + } + ); + } + if (st == NULL) + { + KRML_ALIGNED_FREE(s); + return NULL; + } + return st; + #else + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "provably unreachable code: did an unverified caller violate a precondition\?"); + KRML_HOST_EXIT(255U); + #endif + break; + } + default: + { + KRML_HOST_EPRINTF("KaRaMeL incomplete match at %s:%d\n", __FILE__, __LINE__); + KRML_HOST_EXIT(253U); + } + } +} + +static void init(Hacl_Agile_Hash_state_s *s) +{ + Hacl_Agile_Hash_state_s scrut = *s; + if (scrut.tag == Hacl_Agile_Hash_MD5_a) + { + uint32_t *p1 = scrut.case_MD5_a; + Hacl_Hash_MD5_init(p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA1_a) + { + uint32_t *p1 = scrut.case_SHA1_a; + Hacl_Hash_SHA1_init(p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_224_a) + { + uint32_t *p1 = scrut.case_SHA2_224_a; + Hacl_Hash_SHA2_sha224_init(p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_256_a) + { + uint32_t *p1 = scrut.case_SHA2_256_a; + Hacl_Hash_SHA2_sha256_init(p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_384_a) + { + uint64_t *p1 = scrut.case_SHA2_384_a; + Hacl_Hash_SHA2_sha384_init(p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_512_a) + { + uint64_t *p1 = scrut.case_SHA2_512_a; + Hacl_Hash_SHA2_sha512_init(p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_224_a) + { + uint64_t *p1 = scrut.case_SHA3_224_a; + Hacl_Hash_SHA3_init_(Spec_Hash_Definitions_SHA3_224, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_256_a) + { + uint64_t *p1 = scrut.case_SHA3_256_a; + Hacl_Hash_SHA3_init_(Spec_Hash_Definitions_SHA3_256, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_384_a) + { + uint64_t *p1 = scrut.case_SHA3_384_a; + Hacl_Hash_SHA3_init_(Spec_Hash_Definitions_SHA3_384, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_512_a) + { + uint64_t *p1 = scrut.case_SHA3_512_a; + Hacl_Hash_SHA3_init_(Spec_Hash_Definitions_SHA3_512, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2S_a) + { + uint32_t *p1 = scrut.case_Blake2S_a; + Hacl_Hash_Blake2s_init(p1, 0U, 32U); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2S_128_a) + { + Lib_IntVector_Intrinsics_vec128 *p1 = scrut.case_Blake2S_128_a; + #if HACL_CAN_COMPILE_VEC128 + Hacl_Hash_Blake2s_Simd128_init(p1, 0U, 32U); + return; + #else + KRML_MAYBE_UNUSED_VAR(p1); + return; + #endif + } + if (scrut.tag == Hacl_Agile_Hash_Blake2B_a) + { + uint64_t *p1 = scrut.case_Blake2B_a; + Hacl_Hash_Blake2b_init(p1, 0U, 64U); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2B_256_a) + { + Lib_IntVector_Intrinsics_vec256 *p1 = scrut.case_Blake2B_256_a; + #if HACL_CAN_COMPILE_VEC256 + Hacl_Hash_Blake2b_Simd256_init(p1, 0U, 64U); + return; + #else + KRML_MAYBE_UNUSED_VAR(p1); + return; + #endif + } + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "unreachable (pattern matches are exhaustive in F*)"); + KRML_HOST_EXIT(255U); +} + +static void +update_multi(Hacl_Agile_Hash_state_s *s, uint64_t prevlen, uint8_t *blocks, uint32_t len) +{ + Hacl_Agile_Hash_state_s scrut = *s; + if (scrut.tag == Hacl_Agile_Hash_MD5_a) + { + uint32_t *p1 = scrut.case_MD5_a; + uint32_t n = len / 64U; + Hacl_Hash_MD5_update_multi(p1, blocks, n); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA1_a) + { + uint32_t *p1 = scrut.case_SHA1_a; + uint32_t n = len / 64U; + Hacl_Hash_SHA1_update_multi(p1, blocks, n); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_224_a) + { + uint32_t *p1 = scrut.case_SHA2_224_a; + uint32_t n = len / 64U; + Hacl_Hash_SHA2_sha224_update_nblocks(n * 64U, blocks, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_256_a) + { + uint32_t *p1 = scrut.case_SHA2_256_a; + uint32_t n = len / 64U; + Hacl_Hash_SHA2_sha256_update_nblocks(n * 64U, blocks, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_384_a) + { + uint64_t *p1 = scrut.case_SHA2_384_a; + uint32_t n = len / 128U; + Hacl_Hash_SHA2_sha384_update_nblocks(n * 128U, blocks, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_512_a) + { + uint64_t *p1 = scrut.case_SHA2_512_a; + uint32_t n = len / 128U; + Hacl_Hash_SHA2_sha512_update_nblocks(n * 128U, blocks, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_224_a) + { + uint64_t *p1 = scrut.case_SHA3_224_a; + uint32_t n = len / 144U; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_224, p1, blocks, n); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_256_a) + { + uint64_t *p1 = scrut.case_SHA3_256_a; + uint32_t n = len / 136U; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_256, p1, blocks, n); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_384_a) + { + uint64_t *p1 = scrut.case_SHA3_384_a; + uint32_t n = len / 104U; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_384, p1, blocks, n); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_512_a) + { + uint64_t *p1 = scrut.case_SHA3_512_a; + uint32_t n = len / 72U; + Hacl_Hash_SHA3_update_multi_sha3(Spec_Hash_Definitions_SHA3_512, p1, blocks, n); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2S_a) + { + uint32_t *p1 = scrut.case_Blake2S_a; + uint32_t n = len / 64U; + uint32_t wv[16U] = { 0U }; + Hacl_Hash_Blake2s_update_multi(n * 64U, wv, p1, prevlen, blocks, n); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2S_128_a) + { + Lib_IntVector_Intrinsics_vec128 *p1 = scrut.case_Blake2S_128_a; + #if HACL_CAN_COMPILE_VEC128 + uint32_t n = len / 64U; + Hacl_Hash_Blake2s_Simd128_update_multi_no_inline(p1, prevlen, blocks, n); + return; + #else + KRML_MAYBE_UNUSED_VAR(p1); + return; + #endif + } + if (scrut.tag == Hacl_Agile_Hash_Blake2B_a) + { + uint64_t *p1 = scrut.case_Blake2B_a; + uint32_t n = len / 128U; + uint64_t wv[16U] = { 0U }; + Hacl_Hash_Blake2b_update_multi(n * 128U, + wv, + p1, + FStar_UInt128_uint64_to_uint128(prevlen), + blocks, + n); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2B_256_a) + { + Lib_IntVector_Intrinsics_vec256 *p1 = scrut.case_Blake2B_256_a; + #if HACL_CAN_COMPILE_VEC256 + uint32_t n = len / 128U; + Hacl_Hash_Blake2b_Simd256_update_multi_no_inline(p1, + FStar_UInt128_uint64_to_uint128(prevlen), + blocks, + n); + return; + #else + KRML_MAYBE_UNUSED_VAR(p1); + return; + #endif + } + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "unreachable (pattern matches are exhaustive in F*)"); + KRML_HOST_EXIT(255U); +} + +static void +update_last(Hacl_Agile_Hash_state_s *s, uint64_t prev_len, uint8_t *last, uint32_t last_len) +{ + Hacl_Agile_Hash_state_s scrut = *s; + if (scrut.tag == Hacl_Agile_Hash_MD5_a) + { + uint32_t *p1 = scrut.case_MD5_a; + Hacl_Hash_MD5_update_last(p1, prev_len, last, last_len); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA1_a) + { + uint32_t *p1 = scrut.case_SHA1_a; + Hacl_Hash_SHA1_update_last(p1, prev_len, last, last_len); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_224_a) + { + uint32_t *p1 = scrut.case_SHA2_224_a; + Hacl_Hash_SHA2_sha224_update_last(prev_len + (uint64_t)last_len, last_len, last, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_256_a) + { + uint32_t *p1 = scrut.case_SHA2_256_a; + Hacl_Hash_SHA2_sha256_update_last(prev_len + (uint64_t)last_len, last_len, last, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_384_a) + { + uint64_t *p1 = scrut.case_SHA2_384_a; + Hacl_Hash_SHA2_sha384_update_last(FStar_UInt128_add(FStar_UInt128_uint64_to_uint128(prev_len), + FStar_UInt128_uint64_to_uint128((uint64_t)last_len)), + last_len, + last, + p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_512_a) + { + uint64_t *p1 = scrut.case_SHA2_512_a; + Hacl_Hash_SHA2_sha512_update_last(FStar_UInt128_add(FStar_UInt128_uint64_to_uint128(prev_len), + FStar_UInt128_uint64_to_uint128((uint64_t)last_len)), + last_len, + last, + p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_224_a) + { + uint64_t *p1 = scrut.case_SHA3_224_a; + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_224, p1, last, last_len); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_256_a) + { + uint64_t *p1 = scrut.case_SHA3_256_a; + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_256, p1, last, last_len); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_384_a) + { + uint64_t *p1 = scrut.case_SHA3_384_a; + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_384, p1, last, last_len); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_512_a) + { + uint64_t *p1 = scrut.case_SHA3_512_a; + Hacl_Hash_SHA3_update_last_sha3(Spec_Hash_Definitions_SHA3_512, p1, last, last_len); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2S_a) + { + uint32_t *p1 = scrut.case_Blake2S_a; + uint32_t wv[16U] = { 0U }; + Hacl_Hash_Blake2s_update_last(last_len, wv, p1, false, prev_len, last_len, last); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2S_128_a) + { + Lib_IntVector_Intrinsics_vec128 *p1 = scrut.case_Blake2S_128_a; + #if HACL_CAN_COMPILE_VEC128 + Hacl_Hash_Blake2s_Simd128_update_last_no_inline(p1, prev_len, last, last_len); + return; + #else + KRML_MAYBE_UNUSED_VAR(p1); + return; + #endif + } + if (scrut.tag == Hacl_Agile_Hash_Blake2B_a) + { + uint64_t *p1 = scrut.case_Blake2B_a; + uint64_t wv[16U] = { 0U }; + Hacl_Hash_Blake2b_update_last(last_len, + wv, + p1, + false, + FStar_UInt128_uint64_to_uint128(prev_len), + last_len, + last); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2B_256_a) + { + Lib_IntVector_Intrinsics_vec256 *p1 = scrut.case_Blake2B_256_a; + #if HACL_CAN_COMPILE_VEC256 + Hacl_Hash_Blake2b_Simd256_update_last_no_inline(p1, + FStar_UInt128_uint64_to_uint128(prev_len), + last, + last_len); + return; + #else + KRML_MAYBE_UNUSED_VAR(p1); + return; + #endif + } + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "unreachable (pattern matches are exhaustive in F*)"); + KRML_HOST_EXIT(255U); +} + +static void finish(Hacl_Agile_Hash_state_s *s, uint8_t *dst) +{ + Hacl_Agile_Hash_state_s scrut = *s; + if (scrut.tag == Hacl_Agile_Hash_MD5_a) + { + uint32_t *p1 = scrut.case_MD5_a; + Hacl_Hash_MD5_finish(p1, dst); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA1_a) + { + uint32_t *p1 = scrut.case_SHA1_a; + Hacl_Hash_SHA1_finish(p1, dst); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_224_a) + { + uint32_t *p1 = scrut.case_SHA2_224_a; + Hacl_Hash_SHA2_sha224_finish(p1, dst); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_256_a) + { + uint32_t *p1 = scrut.case_SHA2_256_a; + Hacl_Hash_SHA2_sha256_finish(p1, dst); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_384_a) + { + uint64_t *p1 = scrut.case_SHA2_384_a; + Hacl_Hash_SHA2_sha384_finish(p1, dst); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_512_a) + { + uint64_t *p1 = scrut.case_SHA2_512_a; + Hacl_Hash_SHA2_sha512_finish(p1, dst); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_224_a) + { + uint64_t *p1 = scrut.case_SHA3_224_a; + uint32_t remOut = 28U; + uint8_t hbuf[256U] = { 0U }; + uint64_t ws[32U] = { 0U }; + memcpy(ws, p1, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf + i * 8U, ws[i]); + } + memcpy(dst + 28U - remOut, hbuf, remOut * sizeof (uint8_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_256_a) + { + uint64_t *p1 = scrut.case_SHA3_256_a; + uint32_t remOut = 32U; + uint8_t hbuf[256U] = { 0U }; + uint64_t ws[32U] = { 0U }; + memcpy(ws, p1, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf + i * 8U, ws[i]); + } + memcpy(dst + 32U - remOut, hbuf, remOut * sizeof (uint8_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_384_a) + { + uint64_t *p1 = scrut.case_SHA3_384_a; + uint32_t remOut = 48U; + uint8_t hbuf[256U] = { 0U }; + uint64_t ws[32U] = { 0U }; + memcpy(ws, p1, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf + i * 8U, ws[i]); + } + memcpy(dst + 48U - remOut, hbuf, remOut * sizeof (uint8_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_512_a) + { + uint64_t *p1 = scrut.case_SHA3_512_a; + uint32_t remOut = 64U; + uint8_t hbuf[256U] = { 0U }; + uint64_t ws[32U] = { 0U }; + memcpy(ws, p1, 25U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < 32U; i++) + { + store64_le(hbuf + i * 8U, ws[i]); + } + memcpy(dst + 64U - remOut, hbuf, remOut * sizeof (uint8_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2S_a) + { + uint32_t *p1 = scrut.case_Blake2S_a; + Hacl_Hash_Blake2s_finish(32U, dst, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2S_128_a) + { + Lib_IntVector_Intrinsics_vec128 *p1 = scrut.case_Blake2S_128_a; + #if HACL_CAN_COMPILE_VEC128 + Hacl_Hash_Blake2s_Simd128_finish(32U, dst, p1); + return; + #else + KRML_MAYBE_UNUSED_VAR(p1); + return; + #endif + } + if (scrut.tag == Hacl_Agile_Hash_Blake2B_a) + { + uint64_t *p1 = scrut.case_Blake2B_a; + Hacl_Hash_Blake2b_finish(64U, dst, p1); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2B_256_a) + { + Lib_IntVector_Intrinsics_vec256 *p1 = scrut.case_Blake2B_256_a; + #if HACL_CAN_COMPILE_VEC256 + Hacl_Hash_Blake2b_Simd256_finish(64U, dst, p1); + return; + #else + KRML_MAYBE_UNUSED_VAR(p1); + return; + #endif + } + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "unreachable (pattern matches are exhaustive in F*)"); + KRML_HOST_EXIT(255U); +} + +static void free_(Hacl_Agile_Hash_state_s *s) +{ + Hacl_Agile_Hash_state_s scrut = *s; + if (scrut.tag == Hacl_Agile_Hash_MD5_a) + { + uint32_t *p1 = scrut.case_MD5_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_SHA1_a) + { + uint32_t *p1 = scrut.case_SHA1_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_SHA2_224_a) + { + uint32_t *p1 = scrut.case_SHA2_224_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_SHA2_256_a) + { + uint32_t *p1 = scrut.case_SHA2_256_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_SHA2_384_a) + { + uint64_t *p1 = scrut.case_SHA2_384_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_SHA2_512_a) + { + uint64_t *p1 = scrut.case_SHA2_512_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_SHA3_224_a) + { + uint64_t *p1 = scrut.case_SHA3_224_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_SHA3_256_a) + { + uint64_t *p1 = scrut.case_SHA3_256_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_SHA3_384_a) + { + uint64_t *p1 = scrut.case_SHA3_384_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_SHA3_512_a) + { + uint64_t *p1 = scrut.case_SHA3_512_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_Blake2S_a) + { + uint32_t *p1 = scrut.case_Blake2S_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_Blake2S_128_a) + { + Lib_IntVector_Intrinsics_vec128 *p1 = scrut.case_Blake2S_128_a; + KRML_ALIGNED_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_Blake2B_a) + { + uint64_t *p1 = scrut.case_Blake2B_a; + KRML_HOST_FREE(p1); + } + else if (scrut.tag == Hacl_Agile_Hash_Blake2B_256_a) + { + Lib_IntVector_Intrinsics_vec256 *p1 = scrut.case_Blake2B_256_a; + KRML_ALIGNED_FREE(p1); + } + else + { + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "unreachable (pattern matches are exhaustive in F*)"); + KRML_HOST_EXIT(255U); + } + KRML_HOST_FREE(s); +} + +static void copy(Hacl_Agile_Hash_state_s *s_src, Hacl_Agile_Hash_state_s *s_dst) +{ + Hacl_Agile_Hash_state_s scrut = *s_src; + if (scrut.tag == Hacl_Agile_Hash_MD5_a) + { + uint32_t *p_src = scrut.case_MD5_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint32_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_MD5_a) + { + p_dst = x1.case_MD5_a; + } + else + { + p_dst = KRML_EABORT(uint32_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 4U * sizeof (uint32_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA1_a) + { + uint32_t *p_src = scrut.case_SHA1_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint32_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_SHA1_a) + { + p_dst = x1.case_SHA1_a; + } + else + { + p_dst = KRML_EABORT(uint32_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 5U * sizeof (uint32_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_224_a) + { + uint32_t *p_src = scrut.case_SHA2_224_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint32_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_SHA2_224_a) + { + p_dst = x1.case_SHA2_224_a; + } + else + { + p_dst = KRML_EABORT(uint32_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 8U * sizeof (uint32_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_256_a) + { + uint32_t *p_src = scrut.case_SHA2_256_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint32_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_SHA2_256_a) + { + p_dst = x1.case_SHA2_256_a; + } + else + { + p_dst = KRML_EABORT(uint32_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 8U * sizeof (uint32_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_384_a) + { + uint64_t *p_src = scrut.case_SHA2_384_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint64_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_SHA2_384_a) + { + p_dst = x1.case_SHA2_384_a; + } + else + { + p_dst = KRML_EABORT(uint64_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 8U * sizeof (uint64_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA2_512_a) + { + uint64_t *p_src = scrut.case_SHA2_512_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint64_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_SHA2_512_a) + { + p_dst = x1.case_SHA2_512_a; + } + else + { + p_dst = KRML_EABORT(uint64_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 8U * sizeof (uint64_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_224_a) + { + uint64_t *p_src = scrut.case_SHA3_224_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint64_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_SHA3_224_a) + { + p_dst = x1.case_SHA3_224_a; + } + else + { + p_dst = KRML_EABORT(uint64_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 25U * sizeof (uint64_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_256_a) + { + uint64_t *p_src = scrut.case_SHA3_256_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint64_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_SHA3_256_a) + { + p_dst = x1.case_SHA3_256_a; + } + else + { + p_dst = KRML_EABORT(uint64_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 25U * sizeof (uint64_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_384_a) + { + uint64_t *p_src = scrut.case_SHA3_384_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint64_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_SHA3_384_a) + { + p_dst = x1.case_SHA3_384_a; + } + else + { + p_dst = KRML_EABORT(uint64_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 25U * sizeof (uint64_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_SHA3_512_a) + { + uint64_t *p_src = scrut.case_SHA3_512_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint64_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_SHA3_512_a) + { + p_dst = x1.case_SHA3_512_a; + } + else + { + p_dst = KRML_EABORT(uint64_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 25U * sizeof (uint64_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2S_a) + { + uint32_t *p_src = scrut.case_Blake2S_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint32_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_Blake2S_a) + { + p_dst = x1.case_Blake2S_a; + } + else + { + p_dst = KRML_EABORT(uint32_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 16U * sizeof (uint32_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2S_128_a) + { + Lib_IntVector_Intrinsics_vec128 *p_src = scrut.case_Blake2S_128_a; + KRML_MAYBE_UNUSED_VAR(p_src); + #if HACL_CAN_COMPILE_VEC128 + Hacl_Agile_Hash_state_s x1 = *s_dst; + Lib_IntVector_Intrinsics_vec128 *p_dst; + if (x1.tag == Hacl_Agile_Hash_Blake2S_128_a) + { + p_dst = x1.case_Blake2S_128_a; + } + else + { + p_dst = + KRML_EABORT(Lib_IntVector_Intrinsics_vec128 *, + "unreachable (pattern matches are exhaustive in F*)"); + } + Hacl_Hash_Blake2s_Simd128_copy_internal_state(p_src, p_dst); + return; + #else + return; + #endif + } + if (scrut.tag == Hacl_Agile_Hash_Blake2B_a) + { + uint64_t *p_src = scrut.case_Blake2B_a; + Hacl_Agile_Hash_state_s x1 = *s_dst; + uint64_t *p_dst; + if (x1.tag == Hacl_Agile_Hash_Blake2B_a) + { + p_dst = x1.case_Blake2B_a; + } + else + { + p_dst = KRML_EABORT(uint64_t *, "unreachable (pattern matches are exhaustive in F*)"); + } + memcpy(p_dst, p_src, 16U * sizeof (uint64_t)); + return; + } + if (scrut.tag == Hacl_Agile_Hash_Blake2B_256_a) + { + Lib_IntVector_Intrinsics_vec256 *p_src = scrut.case_Blake2B_256_a; + KRML_MAYBE_UNUSED_VAR(p_src); + #if HACL_CAN_COMPILE_VEC256 + Hacl_Agile_Hash_state_s x1 = *s_dst; + Lib_IntVector_Intrinsics_vec256 *p_dst; + if (x1.tag == Hacl_Agile_Hash_Blake2B_256_a) + { + p_dst = x1.case_Blake2B_256_a; + } + else + { + p_dst = + KRML_EABORT(Lib_IntVector_Intrinsics_vec256 *, + "unreachable (pattern matches are exhaustive in F*)"); + } + Hacl_Hash_Blake2b_Simd256_copy_internal_state(p_src, p_dst); + return; + #else + return; + #endif + } + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "unreachable (pattern matches are exhaustive in F*)"); + KRML_HOST_EXIT(255U); +} + +static void hash(Hacl_Agile_Hash_impl i, uint8_t *dst, uint8_t *input, uint32_t input_len) +{ + switch (i) + { + case Hacl_Agile_Hash_MD5: + { + Hacl_Hash_MD5_hash_oneshot(dst, input, input_len); + break; + } + case Hacl_Agile_Hash_SHA1: + { + Hacl_Hash_SHA1_hash_oneshot(dst, input, input_len); + break; + } + case Hacl_Agile_Hash_SHA2_224: + { + Hacl_Hash_SHA2_hash_224(dst, input, input_len); + break; + } + case Hacl_Agile_Hash_SHA2_256: + { + Hacl_Hash_SHA2_hash_256(dst, input, input_len); + break; + } + case Hacl_Agile_Hash_SHA2_384: + { + Hacl_Hash_SHA2_hash_384(dst, input, input_len); + break; + } + case Hacl_Agile_Hash_SHA2_512: + { + Hacl_Hash_SHA2_hash_512(dst, input, input_len); + break; + } + case Hacl_Agile_Hash_SHA3_224: + { + Hacl_Hash_SHA3_sha3_224(dst, input, input_len); + break; + } + case Hacl_Agile_Hash_SHA3_256: + { + Hacl_Hash_SHA3_sha3_256(dst, input, input_len); + break; + } + case Hacl_Agile_Hash_SHA3_384: + { + Hacl_Hash_SHA3_sha3_384(dst, input, input_len); + break; + } + case Hacl_Agile_Hash_SHA3_512: + { + Hacl_Hash_SHA3_sha3_512(dst, input, input_len); + break; + } + case Hacl_Agile_Hash_Blake2S_32: + { + Hacl_Hash_Blake2s_hash_with_key(dst, 32U, input, input_len, NULL, 0U); + break; + } + case Hacl_Agile_Hash_Blake2S_128: + { + #if HACL_CAN_COMPILE_VEC128 + Hacl_Hash_Blake2s_Simd128_hash_with_key(dst, 32U, input, input_len, NULL, 0U); + #endif + break; + } + case Hacl_Agile_Hash_Blake2B_32: + { + Hacl_Hash_Blake2b_hash_with_key(dst, 64U, input, input_len, NULL, 0U); + break; + } + case Hacl_Agile_Hash_Blake2B_256: + { + #if HACL_CAN_COMPILE_VEC256 + Hacl_Hash_Blake2b_Simd256_hash_with_key(dst, 64U, input, input_len, NULL, 0U); + #endif + break; + } + default: + { + KRML_HOST_EPRINTF("KaRaMeL incomplete match at %s:%d\n", __FILE__, __LINE__); + KRML_HOST_EXIT(253U); + } + } +} + +static uint32_t hash_len(Spec_Hash_Definitions_hash_alg a) +{ + switch (a) + { + case Spec_Hash_Definitions_MD5: + { + return 16U; + } + case Spec_Hash_Definitions_SHA1: + { + return 20U; + } + case Spec_Hash_Definitions_SHA2_224: + { + return 28U; + } + case Spec_Hash_Definitions_SHA2_256: + { + return 32U; + } + case Spec_Hash_Definitions_SHA2_384: + { + return 48U; + } + case Spec_Hash_Definitions_SHA2_512: + { + return 64U; + } + case Spec_Hash_Definitions_Blake2S: + { + return 32U; + } + case Spec_Hash_Definitions_Blake2B: + { + return 64U; + } + case Spec_Hash_Definitions_SHA3_224: + { + return 28U; + } + case Spec_Hash_Definitions_SHA3_256: + { + return 32U; + } + case Spec_Hash_Definitions_SHA3_384: + { + return 48U; + } + case Spec_Hash_Definitions_SHA3_512: + { + return 64U; + } + default: + { + KRML_HOST_EPRINTF("KaRaMeL incomplete match at %s:%d\n", __FILE__, __LINE__); + KRML_HOST_EXIT(253U); + } + } +} + +static uint32_t block_len(Spec_Hash_Definitions_hash_alg a) +{ + switch (a) + { + case Spec_Hash_Definitions_MD5: + { + return 64U; + } + case Spec_Hash_Definitions_SHA1: + { + return 64U; + } + case Spec_Hash_Definitions_SHA2_224: + { + return 64U; + } + case Spec_Hash_Definitions_SHA2_256: + { + return 64U; + } + case Spec_Hash_Definitions_SHA2_384: + { + return 128U; + } + case Spec_Hash_Definitions_SHA2_512: + { + return 128U; + } + case Spec_Hash_Definitions_SHA3_224: + { + return 144U; + } + case Spec_Hash_Definitions_SHA3_256: + { + return 136U; + } + case Spec_Hash_Definitions_SHA3_384: + { + return 104U; + } + case Spec_Hash_Definitions_SHA3_512: + { + return 72U; + } + case Spec_Hash_Definitions_Shake128: + { + return 168U; + } + case Spec_Hash_Definitions_Shake256: + { + return 136U; + } + case Spec_Hash_Definitions_Blake2S: + { + return 64U; + } + case Spec_Hash_Definitions_Blake2B: + { + return 128U; + } + default: + { + KRML_HOST_EPRINTF("KaRaMeL incomplete match at %s:%d\n", __FILE__, __LINE__); + KRML_HOST_EXIT(253U); + } + } +} + +static uint64_t max_input_len64(Spec_Hash_Definitions_hash_alg a) +{ + switch (a) + { + case Spec_Hash_Definitions_MD5: + { + return 2305843009213693951ULL; + } + case Spec_Hash_Definitions_SHA1: + { + return 2305843009213693951ULL; + } + case Spec_Hash_Definitions_SHA2_224: + { + return 2305843009213693951ULL; + } + case Spec_Hash_Definitions_SHA2_256: + { + return 2305843009213693951ULL; + } + case Spec_Hash_Definitions_SHA2_384: + { + return 18446744073709551615ULL; + } + case Spec_Hash_Definitions_SHA2_512: + { + return 18446744073709551615ULL; + } + case Spec_Hash_Definitions_Blake2S: + { + return 18446744073709551615ULL; + } + case Spec_Hash_Definitions_Blake2B: + { + return 18446744073709551615ULL; + } + case Spec_Hash_Definitions_SHA3_224: + { + return 18446744073709551615ULL; + } + case Spec_Hash_Definitions_SHA3_256: + { + return 18446744073709551615ULL; + } + case Spec_Hash_Definitions_SHA3_384: + { + return 18446744073709551615ULL; + } + case Spec_Hash_Definitions_SHA3_512: + { + return 18446744073709551615ULL; + } + case Spec_Hash_Definitions_Shake128: + { + return 18446744073709551615ULL; + } + case Spec_Hash_Definitions_Shake256: + { + return 18446744073709551615ULL; + } + default: + { + KRML_HOST_EPRINTF("KaRaMeL incomplete match at %s:%d\n", __FILE__, __LINE__); + KRML_HOST_EXIT(253U); + } + } +} + +static void wrap_key(Hacl_Agile_Hash_impl impl, uint8_t *output, uint8_t *key, uint32_t len) +{ + uint8_t *nkey = output; + uint32_t ite; + if (len <= block_len(alg_of_impl(impl))) + { + ite = len; + } + else + { + ite = hash_len(alg_of_impl(impl)); + } + uint8_t *zeroes = output + ite; + KRML_MAYBE_UNUSED_VAR(zeroes); + if (len <= block_len(alg_of_impl(impl))) + { + if (len > 0U) + { + memcpy(nkey, key, len * sizeof (uint8_t)); + return; + } + return; + } + hash(impl, nkey, key, len); +} + +static void init0(uint8_t *k, uint8_t *buf, Hacl_Streaming_HMAC_Definitions_two_state s) +{ + uint32_t k_len = s.fst; + Hacl_Agile_Hash_state_s *s1 = s.snd; + Hacl_Agile_Hash_state_s *s2 = s.thd; + init(s1); + init(s2); + Hacl_Agile_Hash_impl i1 = impl_of_state(s1); + Spec_Hash_Definitions_hash_alg a = alg_of_impl(i1); + uint8_t b0[168U] = { 0U }; + uint8_t *block = b0; + wrap_key(i1, block, k, k_len); + uint8_t b1[168U]; + memset(b1, 0x36U, 168U * sizeof (uint8_t)); + uint8_t *ipad = b1; + uint8_t b[168U]; + memset(b, 0x5cU, 168U * sizeof (uint8_t)); + uint8_t *opad = b; + for (uint32_t i = 0U; i < block_len(a); i++) + { + uint8_t xi = ipad[i]; + uint8_t yi = block[i]; + buf[i] = (uint32_t)xi ^ (uint32_t)yi; + } + for (uint32_t i = 0U; i < block_len(a); i++) + { + uint8_t xi = opad[i]; + uint8_t yi = block[i]; + opad[i] = (uint32_t)xi ^ (uint32_t)yi; + } + update_multi(s2, 0ULL, opad, block_len(a)); +} + +static void finish0(Hacl_Streaming_HMAC_Definitions_two_state s, uint8_t *dst) +{ + Hacl_Agile_Hash_state_s *s2 = s.thd; + Hacl_Agile_Hash_state_s *s1 = s.snd; + Hacl_Agile_Hash_impl i1 = impl_of_state(s1); + Spec_Hash_Definitions_hash_alg a = alg_of_impl(i1); + finish(s1, dst); + update_last(s2, (uint64_t)block_len(a), dst, hash_len(a)); + finish(s2, dst); +} + +Hacl_Agile_Hash_state_s +*Hacl_Streaming_HMAC_s1( + Hacl_Streaming_HMAC_Definitions_index i, + Hacl_Streaming_HMAC_Definitions_two_state s +) +{ + KRML_MAYBE_UNUSED_VAR(i); + return s.snd; +} + +Hacl_Agile_Hash_state_s +*Hacl_Streaming_HMAC_s2( + Hacl_Streaming_HMAC_Definitions_index i, + Hacl_Streaming_HMAC_Definitions_two_state s +) +{ + KRML_MAYBE_UNUSED_VAR(i); + return s.thd; +} + +Hacl_Streaming_HMAC_Definitions_index +Hacl_Streaming_HMAC_index_of_state(Hacl_Streaming_HMAC_Definitions_two_state s) +{ + Hacl_Agile_Hash_state_s *s11 = s.snd; + uint32_t kl = s.fst; + Hacl_Agile_Hash_impl i1 = impl_of_state(s11); + return ((Hacl_Streaming_HMAC_Definitions_index){ .fst = i1, .snd = kl }); +} + +static Hacl_Agile_Hash_impl +__proj__Mkdtuple2__item___1__Hacl_Agile_Hash_impl_uint32_t( + Hacl_Streaming_HMAC_Definitions_index pair +) +{ + return pair.fst; +} + +static Hacl_Agile_Hash_impl +dfst__Hacl_Agile_Hash_impl_uint32_t(Hacl_Streaming_HMAC_Definitions_index t) +{ + return __proj__Mkdtuple2__item___1__Hacl_Agile_Hash_impl_uint32_t(t); +} + +static uint32_t +__proj__Mkdtuple2__item___2__Hacl_Agile_Hash_impl_uint32_t( + Hacl_Streaming_HMAC_Definitions_index pair +) +{ + return pair.snd; +} + +static uint32_t dsnd__Hacl_Agile_Hash_impl_uint32_t(Hacl_Streaming_HMAC_Definitions_index t) +{ + return __proj__Mkdtuple2__item___2__Hacl_Agile_Hash_impl_uint32_t(t); +} + +typedef struct option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s___s +{ + Hacl_Streaming_Types_optional tag; + Hacl_Streaming_HMAC_Definitions_two_state v; +} +option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__; + +KRML_MAYBE_UNUSED static Hacl_Streaming_HMAC_agile_state +*malloc_internal(Hacl_Streaming_HMAC_Definitions_index i, uint8_t *key) +{ + KRML_CHECK_SIZE(sizeof (uint8_t), + block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i)))); + uint8_t + *buf = + (uint8_t *)KRML_HOST_CALLOC(block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i))), + sizeof (uint8_t)); + if (buf == NULL) + { + return NULL; + } + uint8_t *buf1 = buf; + Hacl_Agile_Hash_state_s *s110 = malloc_(dfst__Hacl_Agile_Hash_impl_uint32_t(i)); + option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__ block_state; + if (s110 == NULL) + { + block_state = + ( + (option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__){ + .tag = Hacl_Streaming_Types_None + } + ); + } + else + { + Hacl_Agile_Hash_state_s *s21 = malloc_(dfst__Hacl_Agile_Hash_impl_uint32_t(i)); + if (s21 == NULL) + { + KRML_HOST_FREE(s110); + block_state = + ( + (option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__){ + .tag = Hacl_Streaming_Types_None + } + ); + } + else + { + block_state = + ( + (option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__){ + .tag = Hacl_Streaming_Types_Some, + .v = { .fst = dsnd__Hacl_Agile_Hash_impl_uint32_t(i), .snd = s110, .thd = s21 } + } + ); + } + } + if (block_state.tag == Hacl_Streaming_Types_None) + { + KRML_HOST_FREE(buf1); + return NULL; + } + if (block_state.tag == Hacl_Streaming_Types_Some) + { + Hacl_Streaming_HMAC_Definitions_two_state block_state1 = block_state.v; + Hacl_Streaming_Types_optional k_ = Hacl_Streaming_Types_Some; + switch (k_) + { + case Hacl_Streaming_Types_None: + { + return NULL; + } + case Hacl_Streaming_Types_Some: + { + Hacl_Streaming_HMAC_agile_state + s = + { + .block_state = block_state1, + .buf = buf1, + .total_len = (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i))) + }; + Hacl_Streaming_HMAC_agile_state + *p = + (Hacl_Streaming_HMAC_agile_state *)KRML_HOST_MALLOC(sizeof ( + Hacl_Streaming_HMAC_agile_state + )); + if (p != NULL) + { + p[0U] = s; + } + if (p == NULL) + { + Hacl_Agile_Hash_state_s *s21 = block_state1.thd; + Hacl_Agile_Hash_state_s *s11 = block_state1.snd; + free_(s11); + free_(s21); + KRML_HOST_FREE(buf1); + return NULL; + } + init0(key, buf1, block_state1); + return p; + } + default: + { + KRML_HOST_EPRINTF("KaRaMeL incomplete match at %s:%d\n", __FILE__, __LINE__); + KRML_HOST_EXIT(253U); + } + } + } + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "unreachable (pattern matches are exhaustive in F*)"); + KRML_HOST_EXIT(255U); +} + +KRML_MAYBE_UNUSED static bool is_blake2b_256(Hacl_Agile_Hash_impl uu___) +{ + switch (uu___) + { + case Hacl_Agile_Hash_Blake2B_256: + { + return true; + } + default: + { + return false; + } + } +} + +KRML_MAYBE_UNUSED static bool is_blake2s_128(Hacl_Agile_Hash_impl uu___) +{ + switch (uu___) + { + case Hacl_Agile_Hash_Blake2S_128: + { + return true; + } + default: + { + return false; + } + } +} + +Hacl_Streaming_Types_error_code +Hacl_Streaming_HMAC_malloc_( + Hacl_Agile_Hash_impl impl, + uint8_t *key, + uint32_t key_length, + Hacl_Streaming_HMAC_agile_state **dst +) +{ + KRML_MAYBE_UNUSED_VAR(key); + KRML_MAYBE_UNUSED_VAR(key_length); + KRML_MAYBE_UNUSED_VAR(dst); + #if !HACL_CAN_COMPILE_VEC256 + if (is_blake2b_256(impl)) + { + return Hacl_Streaming_Types_InvalidAlgorithm; + } + #endif + #if !HACL_CAN_COMPILE_VEC128 + if (is_blake2s_128(impl)) + { + return Hacl_Streaming_Types_InvalidAlgorithm; + } + #endif + Hacl_Streaming_HMAC_agile_state + *st = + malloc_internal(((Hacl_Streaming_HMAC_Definitions_index){ .fst = impl, .snd = key_length }), + key); + if (st == NULL) + { + return Hacl_Streaming_Types_OutOfMemory; + } + *dst = st; + return Hacl_Streaming_Types_Success; +} + +Hacl_Streaming_HMAC_Definitions_index +Hacl_Streaming_HMAC_get_impl(Hacl_Streaming_HMAC_agile_state *s) +{ + Hacl_Streaming_HMAC_Definitions_two_state block_state = (*s).block_state; + return Hacl_Streaming_HMAC_index_of_state(block_state); +} + +static void reset_internal(Hacl_Streaming_HMAC_agile_state *state, uint8_t *key) +{ + Hacl_Streaming_HMAC_agile_state scrut = *state; + uint8_t *buf = scrut.buf; + Hacl_Streaming_HMAC_Definitions_two_state block_state = scrut.block_state; + Hacl_Streaming_HMAC_Definitions_index i1 = Hacl_Streaming_HMAC_index_of_state(block_state); + KRML_MAYBE_UNUSED_VAR(i1); + init0(key, buf, block_state); + Hacl_Streaming_HMAC_agile_state + tmp = + { + .block_state = block_state, + .buf = buf, + .total_len = (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) + }; + state[0U] = tmp; +} + +Hacl_Streaming_Types_error_code +Hacl_Streaming_HMAC_reset( + Hacl_Streaming_HMAC_agile_state *state, + uint8_t *key, + uint32_t key_length +) +{ + uint32_t k_len = Hacl_Streaming_HMAC_get_impl(state).snd; + if (key_length != k_len) + { + return Hacl_Streaming_Types_InvalidLength; + } + reset_internal(state, key); + return Hacl_Streaming_Types_Success; +} + +Hacl_Streaming_Types_error_code +Hacl_Streaming_HMAC_update( + Hacl_Streaming_HMAC_agile_state *state, + uint8_t *chunk, + uint32_t chunk_len +) +{ + Hacl_Streaming_HMAC_agile_state s = *state; + Hacl_Streaming_HMAC_Definitions_two_state block_state = s.block_state; + uint64_t total_len = s.total_len; + Hacl_Streaming_HMAC_Definitions_index i1 = Hacl_Streaming_HMAC_index_of_state(block_state); + if + ( + (uint64_t)chunk_len + > max_input_len64(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) - total_len + ) + { + return Hacl_Streaming_Types_MaximumLengthExceeded; + } + uint32_t sz; + if + ( + total_len + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) + == 0ULL + && total_len > 0ULL + ) + { + sz = block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + } + else + { + sz = + (uint32_t)(total_len + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + } + if (chunk_len <= block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) - sz) + { + Hacl_Streaming_HMAC_agile_state s3 = *state; + Hacl_Streaming_HMAC_Definitions_two_state block_state1 = s3.block_state; + uint8_t *buf = s3.buf; + uint64_t total_len1 = s3.total_len; + uint32_t sz1; + if + ( + total_len1 + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) + == 0ULL + && total_len1 > 0ULL + ) + { + sz1 = block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + } + else + { + sz1 = + (uint32_t)(total_len1 + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + } + uint8_t *buf2 = buf + sz1; + memcpy(buf2, chunk, chunk_len * sizeof (uint8_t)); + uint64_t total_len2 = total_len1 + (uint64_t)chunk_len; + *state + = + ( + (Hacl_Streaming_HMAC_agile_state){ + .block_state = block_state1, + .buf = buf, + .total_len = total_len2 + } + ); + } + else if (sz == 0U) + { + Hacl_Streaming_HMAC_agile_state s3 = *state; + Hacl_Streaming_HMAC_Definitions_two_state block_state1 = s3.block_state; + uint8_t *buf = s3.buf; + uint64_t total_len1 = s3.total_len; + uint32_t sz1; + if + ( + total_len1 + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) + == 0ULL + && total_len1 > 0ULL + ) + { + sz1 = block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + } + else + { + sz1 = + (uint32_t)(total_len1 + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + } + if (!(sz1 == 0U)) + { + uint64_t prevlen = total_len1 - (uint64_t)sz1; + Hacl_Agile_Hash_state_s *s11 = block_state1.snd; + update_multi(s11, + prevlen, + buf, + block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + } + uint32_t ite; + if + ( + (uint64_t)chunk_len + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) + == 0ULL + && (uint64_t)chunk_len > 0ULL + ) + { + ite = block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + } + else + { + ite = + (uint32_t)((uint64_t)chunk_len + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + } + uint32_t + n_blocks = (chunk_len - ite) / block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + uint32_t + data1_len = n_blocks * block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + uint32_t data2_len = chunk_len - data1_len; + uint8_t *data1 = chunk; + uint8_t *data2 = chunk + data1_len; + Hacl_Agile_Hash_state_s *s11 = block_state1.snd; + update_multi(s11, total_len1, data1, data1_len); + uint8_t *dst = buf; + memcpy(dst, data2, data2_len * sizeof (uint8_t)); + *state + = + ( + (Hacl_Streaming_HMAC_agile_state){ + .block_state = block_state1, + .buf = buf, + .total_len = total_len1 + (uint64_t)chunk_len + } + ); + } + else + { + uint32_t diff = block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) - sz; + uint8_t *chunk1 = chunk; + uint8_t *chunk2 = chunk + diff; + Hacl_Streaming_HMAC_agile_state s3 = *state; + Hacl_Streaming_HMAC_Definitions_two_state block_state10 = s3.block_state; + uint8_t *buf0 = s3.buf; + uint64_t total_len10 = s3.total_len; + uint32_t sz10; + if + ( + total_len10 + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) + == 0ULL + && total_len10 > 0ULL + ) + { + sz10 = block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + } + else + { + sz10 = + (uint32_t)(total_len10 + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + } + uint8_t *buf2 = buf0 + sz10; + memcpy(buf2, chunk1, diff * sizeof (uint8_t)); + uint64_t total_len2 = total_len10 + (uint64_t)diff; + *state + = + ( + (Hacl_Streaming_HMAC_agile_state){ + .block_state = block_state10, + .buf = buf0, + .total_len = total_len2 + } + ); + Hacl_Streaming_HMAC_agile_state s30 = *state; + Hacl_Streaming_HMAC_Definitions_two_state block_state1 = s30.block_state; + uint8_t *buf = s30.buf; + uint64_t total_len1 = s30.total_len; + uint32_t sz1; + if + ( + total_len1 + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) + == 0ULL + && total_len1 > 0ULL + ) + { + sz1 = block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + } + else + { + sz1 = + (uint32_t)(total_len1 + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + } + if (!(sz1 == 0U)) + { + uint64_t prevlen = total_len1 - (uint64_t)sz1; + Hacl_Agile_Hash_state_s *s11 = block_state1.snd; + update_multi(s11, + prevlen, + buf, + block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + } + uint32_t ite; + if + ( + (uint64_t)(chunk_len - diff) + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) + == 0ULL + && (uint64_t)(chunk_len - diff) > 0ULL + ) + { + ite = block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + } + else + { + ite = + (uint32_t)((uint64_t)(chunk_len - diff) + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + } + uint32_t + n_blocks = + (chunk_len - diff - ite) + / block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + uint32_t + data1_len = n_blocks * block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + uint32_t data2_len = chunk_len - diff - data1_len; + uint8_t *data1 = chunk2; + uint8_t *data2 = chunk2 + data1_len; + Hacl_Agile_Hash_state_s *s11 = block_state1.snd; + update_multi(s11, total_len1, data1, data1_len); + uint8_t *dst = buf; + memcpy(dst, data2, data2_len * sizeof (uint8_t)); + *state + = + ( + (Hacl_Streaming_HMAC_agile_state){ + .block_state = block_state1, + .buf = buf, + .total_len = total_len1 + (uint64_t)(chunk_len - diff) + } + ); + } + return Hacl_Streaming_Types_Success; +} + +typedef struct +___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s____uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s___s +{ + Hacl_Streaming_HMAC_Definitions_two_state fst; + Hacl_Streaming_HMAC_Definitions_two_state snd; +} +___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s____uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__; + +Hacl_Streaming_Types_error_code +Hacl_Streaming_HMAC_digest( + Hacl_Streaming_HMAC_agile_state *state, + uint8_t *output, + uint32_t digest_length +) +{ + KRML_MAYBE_UNUSED_VAR(digest_length); + Hacl_Streaming_HMAC_Definitions_two_state block_state0 = (*state).block_state; + Hacl_Streaming_HMAC_Definitions_index i1 = Hacl_Streaming_HMAC_index_of_state(block_state0); + Hacl_Streaming_HMAC_agile_state scrut0 = *state; + Hacl_Streaming_HMAC_Definitions_two_state block_state = scrut0.block_state; + uint8_t *buf_ = scrut0.buf; + uint64_t total_len = scrut0.total_len; + uint32_t r; + if + ( + total_len + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) + == 0ULL + && total_len > 0ULL + ) + { + r = block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + } + else + { + r = + (uint32_t)(total_len + % (uint64_t)block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + } + uint8_t *buf_1 = buf_; + Hacl_Agile_Hash_state_s *s110 = malloc_(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)); + option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__ tmp_block_state; + if (s110 == NULL) + { + tmp_block_state = + ( + (option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__){ + .tag = Hacl_Streaming_Types_None + } + ); + } + else + { + Hacl_Agile_Hash_state_s *s21 = malloc_(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)); + if (s21 == NULL) + { + KRML_HOST_FREE(s110); + tmp_block_state = + ( + (option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__){ + .tag = Hacl_Streaming_Types_None + } + ); + } + else + { + tmp_block_state = + ( + (option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__){ + .tag = Hacl_Streaming_Types_Some, + .v = { .fst = dsnd__Hacl_Agile_Hash_impl_uint32_t(i1), .snd = s110, .thd = s21 } + } + ); + } + } + if (tmp_block_state.tag == Hacl_Streaming_Types_None) + { + return Hacl_Streaming_Types_OutOfMemory; + } + if (tmp_block_state.tag == Hacl_Streaming_Types_Some) + { + Hacl_Streaming_HMAC_Definitions_two_state tmp_block_state1 = tmp_block_state.v; + ___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s____uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__ + scrut = { .fst = block_state, .snd = tmp_block_state1 }; + Hacl_Agile_Hash_state_s *s2_ = scrut.snd.thd; + Hacl_Agile_Hash_state_s *s1_ = scrut.snd.snd; + Hacl_Agile_Hash_state_s *s21 = scrut.fst.thd; + Hacl_Agile_Hash_state_s *s111 = scrut.fst.snd; + copy(s111, s1_); + copy(s21, s2_); + uint64_t prev_len = total_len - (uint64_t)r; + uint32_t ite; + if (r % block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) == 0U && r > 0U) + { + ite = block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + } + else + { + ite = r % block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))); + } + uint8_t *buf_last = buf_1 + r - ite; + uint8_t *buf_multi = buf_1; + Hacl_Agile_Hash_state_s *s112 = tmp_block_state1.snd; + update_multi(s112, prev_len, buf_multi, 0U); + uint64_t prev_len_last = total_len - (uint64_t)r; + Hacl_Agile_Hash_state_s *s11 = tmp_block_state1.snd; + update_last(s11, prev_len_last, buf_last, r); + finish0(tmp_block_state1, output); + return Hacl_Streaming_Types_Success; + } + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "unreachable (pattern matches are exhaustive in F*)"); + KRML_HOST_EXIT(255U); +} + +void Hacl_Streaming_HMAC_free(Hacl_Streaming_HMAC_agile_state *state) +{ + Hacl_Streaming_HMAC_Definitions_two_state block_state0 = (*state).block_state; + Hacl_Streaming_HMAC_Definitions_index i1 = Hacl_Streaming_HMAC_index_of_state(block_state0); + KRML_MAYBE_UNUSED_VAR(i1); + Hacl_Streaming_HMAC_agile_state scrut = *state; + uint8_t *buf = scrut.buf; + Hacl_Streaming_HMAC_Definitions_two_state block_state = scrut.block_state; + Hacl_Agile_Hash_state_s *s21 = block_state.thd; + Hacl_Agile_Hash_state_s *s11 = block_state.snd; + free_(s11); + free_(s21); + KRML_HOST_FREE(buf); + KRML_HOST_FREE(state); +} + +Hacl_Streaming_HMAC_agile_state +*Hacl_Streaming_HMAC_copy(Hacl_Streaming_HMAC_agile_state *state) +{ + Hacl_Streaming_HMAC_agile_state scrut0 = *state; + Hacl_Streaming_HMAC_Definitions_two_state block_state0 = scrut0.block_state; + uint8_t *buf0 = scrut0.buf; + uint64_t total_len0 = scrut0.total_len; + Hacl_Streaming_HMAC_Definitions_index i1 = Hacl_Streaming_HMAC_index_of_state(block_state0); + KRML_CHECK_SIZE(sizeof (uint8_t), + block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)))); + uint8_t + *buf = + (uint8_t *)KRML_HOST_CALLOC(block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))), + sizeof (uint8_t)); + if (buf == NULL) + { + return NULL; + } + memcpy(buf, + buf0, + block_len(alg_of_impl(dfst__Hacl_Agile_Hash_impl_uint32_t(i1))) * sizeof (uint8_t)); + Hacl_Agile_Hash_state_s *s110 = malloc_(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)); + option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__ block_state; + if (s110 == NULL) + { + block_state = + ( + (option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__){ + .tag = Hacl_Streaming_Types_None + } + ); + } + else + { + Hacl_Agile_Hash_state_s *s21 = malloc_(dfst__Hacl_Agile_Hash_impl_uint32_t(i1)); + if (s21 == NULL) + { + KRML_HOST_FREE(s110); + block_state = + ( + (option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__){ + .tag = Hacl_Streaming_Types_None + } + ); + } + else + { + block_state = + ( + (option___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__){ + .tag = Hacl_Streaming_Types_Some, + .v = { .fst = dsnd__Hacl_Agile_Hash_impl_uint32_t(i1), .snd = s110, .thd = s21 } + } + ); + } + } + if (block_state.tag == Hacl_Streaming_Types_None) + { + KRML_HOST_FREE(buf); + return NULL; + } + if (block_state.tag == Hacl_Streaming_Types_Some) + { + Hacl_Streaming_HMAC_Definitions_two_state block_state1 = block_state.v; + ___uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s____uint32_t____Hacl_Agile_Hash_state_s_____Hacl_Agile_Hash_state_s__ + scrut = { .fst = block_state0, .snd = block_state1 }; + Hacl_Agile_Hash_state_s *s2_ = scrut.snd.thd; + Hacl_Agile_Hash_state_s *s1_ = scrut.snd.snd; + Hacl_Agile_Hash_state_s *s21 = scrut.fst.thd; + Hacl_Agile_Hash_state_s *s111 = scrut.fst.snd; + copy(s111, s1_); + copy(s21, s2_); + Hacl_Streaming_Types_optional k_ = Hacl_Streaming_Types_Some; + switch (k_) + { + case Hacl_Streaming_Types_None: + { + return NULL; + } + case Hacl_Streaming_Types_Some: + { + Hacl_Streaming_HMAC_agile_state + s = { .block_state = block_state1, .buf = buf, .total_len = total_len0 }; + Hacl_Streaming_HMAC_agile_state + *p = + (Hacl_Streaming_HMAC_agile_state *)KRML_HOST_MALLOC(sizeof ( + Hacl_Streaming_HMAC_agile_state + )); + if (p != NULL) + { + p[0U] = s; + } + if (p == NULL) + { + Hacl_Agile_Hash_state_s *s210 = block_state1.thd; + Hacl_Agile_Hash_state_s *s11 = block_state1.snd; + free_(s11); + free_(s210); + KRML_HOST_FREE(buf); + return NULL; + } + return p; + } + default: + { + KRML_HOST_EPRINTF("KaRaMeL incomplete match at %s:%d\n", __FILE__, __LINE__); + KRML_HOST_EXIT(253U); + } + } + } + KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n", + __FILE__, + __LINE__, + "unreachable (pattern matches are exhaustive in F*)"); + KRML_HOST_EXIT(255U); +} + diff --git a/Modules/_hacl/Hacl_Streaming_HMAC.h b/Modules/_hacl/Hacl_Streaming_HMAC.h new file mode 100644 index 00000000000000..a0806c02d0bb9f --- /dev/null +++ b/Modules/_hacl/Hacl_Streaming_HMAC.h @@ -0,0 +1,134 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_Streaming_HMAC_H +#define __Hacl_Streaming_HMAC_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "python_hacl_namespaces.h" +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Streaming_Types.h" + +#define Hacl_Agile_Hash_MD5 0 +#define Hacl_Agile_Hash_SHA1 1 +#define Hacl_Agile_Hash_SHA2_224 2 +#define Hacl_Agile_Hash_SHA2_256 3 +#define Hacl_Agile_Hash_SHA2_384 4 +#define Hacl_Agile_Hash_SHA2_512 5 +#define Hacl_Agile_Hash_SHA3_224 6 +#define Hacl_Agile_Hash_SHA3_256 7 +#define Hacl_Agile_Hash_SHA3_384 8 +#define Hacl_Agile_Hash_SHA3_512 9 +#define Hacl_Agile_Hash_Blake2S_32 10 +#define Hacl_Agile_Hash_Blake2S_128 11 +#define Hacl_Agile_Hash_Blake2B_32 12 +#define Hacl_Agile_Hash_Blake2B_256 13 + +typedef uint8_t Hacl_Agile_Hash_impl; + +typedef struct Hacl_Agile_Hash_state_s_s Hacl_Agile_Hash_state_s; + +typedef struct Hacl_Streaming_HMAC_Definitions_index_s +{ + Hacl_Agile_Hash_impl fst; + uint32_t snd; +} +Hacl_Streaming_HMAC_Definitions_index; + +typedef struct Hacl_Streaming_HMAC_Definitions_two_state_s +{ + uint32_t fst; + Hacl_Agile_Hash_state_s *snd; + Hacl_Agile_Hash_state_s *thd; +} +Hacl_Streaming_HMAC_Definitions_two_state; + +Hacl_Agile_Hash_state_s +*Hacl_Streaming_HMAC_s1( + Hacl_Streaming_HMAC_Definitions_index i, + Hacl_Streaming_HMAC_Definitions_two_state s +); + +Hacl_Agile_Hash_state_s +*Hacl_Streaming_HMAC_s2( + Hacl_Streaming_HMAC_Definitions_index i, + Hacl_Streaming_HMAC_Definitions_two_state s +); + +Hacl_Streaming_HMAC_Definitions_index +Hacl_Streaming_HMAC_index_of_state(Hacl_Streaming_HMAC_Definitions_two_state s); + +typedef struct Hacl_Streaming_HMAC_agile_state_s Hacl_Streaming_HMAC_agile_state; + +Hacl_Streaming_Types_error_code +Hacl_Streaming_HMAC_malloc_( + Hacl_Agile_Hash_impl impl, + uint8_t *key, + uint32_t key_length, + Hacl_Streaming_HMAC_agile_state **dst +); + +Hacl_Streaming_HMAC_Definitions_index +Hacl_Streaming_HMAC_get_impl(Hacl_Streaming_HMAC_agile_state *s); + +Hacl_Streaming_Types_error_code +Hacl_Streaming_HMAC_reset( + Hacl_Streaming_HMAC_agile_state *state, + uint8_t *key, + uint32_t key_length +); + +Hacl_Streaming_Types_error_code +Hacl_Streaming_HMAC_update( + Hacl_Streaming_HMAC_agile_state *state, + uint8_t *chunk, + uint32_t chunk_len +); + +Hacl_Streaming_Types_error_code +Hacl_Streaming_HMAC_digest( + Hacl_Streaming_HMAC_agile_state *state, + uint8_t *output, + uint32_t digest_length +); + +void Hacl_Streaming_HMAC_free(Hacl_Streaming_HMAC_agile_state *state); + +Hacl_Streaming_HMAC_agile_state +*Hacl_Streaming_HMAC_copy(Hacl_Streaming_HMAC_agile_state *state); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_Streaming_HMAC_H_DEFINED +#endif diff --git a/Modules/_hacl/README.md b/Modules/_hacl/README.md index e6a156a54b3cee..0d6454cdd6efb3 100644 --- a/Modules/_hacl/README.md +++ b/Modules/_hacl/README.md @@ -8,10 +8,10 @@ safety, functional correctness, and secret independence. ## Updating HACL* -Use the `refresh.sh` script in this directory to pull in a new upstream code -version. The upstream git hash used for the most recent code pull is recorded -in the script. Modify the script as needed to bring in more if changes are -needed based on upstream code refactoring. +Use the [refresh.sh](refresh.sh) script in this directory to pull in a new +upstream code version. The upstream git hash used for the most recent code +pull is recorded in the script. Modify the script as needed to bring in more +if changes are needed based on upstream code refactoring. Never manually edit HACL\* files. Always add transformation shell code to the `refresh.sh` script to perform any necessary edits. If there are serious code @@ -19,9 +19,9 @@ changes needed, work with the upstream repository. ## Local files -1. `./include/python_hacl_namespaces.h` -1. `./README.md` -1. `./refresh.sh` +* [python_hacl_namespaces.h](python_hacl_namespaces.h) +* [README.md](README.md) +* [refresh.sh](refresh.sh) ## ACKS diff --git a/Modules/_hacl/internal/Hacl_HMAC.h b/Modules/_hacl/internal/Hacl_HMAC.h new file mode 100644 index 00000000000000..ad29d50760c3aa --- /dev/null +++ b/Modules/_hacl/internal/Hacl_HMAC.h @@ -0,0 +1,52 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __internal_Hacl_HMAC_H +#define __internal_Hacl_HMAC_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "../Hacl_HMAC.h" + +typedef struct K___uint32_t_uint32_t_s +{ + uint32_t fst; + uint32_t snd; +} +K___uint32_t_uint32_t; + +#if defined(__cplusplus) +} +#endif + +#define __internal_Hacl_HMAC_H_DEFINED +#endif diff --git a/Modules/_hacl/internal/Hacl_Streaming_HMAC.h b/Modules/_hacl/internal/Hacl_Streaming_HMAC.h new file mode 100644 index 00000000000000..acc4f3996026ee --- /dev/null +++ b/Modules/_hacl/internal/Hacl_Streaming_HMAC.h @@ -0,0 +1,94 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __internal_Hacl_Streaming_HMAC_H +#define __internal_Hacl_Streaming_HMAC_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "../Hacl_Streaming_HMAC.h" +#include "libintvector-shim.h" + +#define Hacl_Agile_Hash_MD5_a 0 +#define Hacl_Agile_Hash_SHA1_a 1 +#define Hacl_Agile_Hash_SHA2_224_a 2 +#define Hacl_Agile_Hash_SHA2_256_a 3 +#define Hacl_Agile_Hash_SHA2_384_a 4 +#define Hacl_Agile_Hash_SHA2_512_a 5 +#define Hacl_Agile_Hash_SHA3_224_a 6 +#define Hacl_Agile_Hash_SHA3_256_a 7 +#define Hacl_Agile_Hash_SHA3_384_a 8 +#define Hacl_Agile_Hash_SHA3_512_a 9 +#define Hacl_Agile_Hash_Blake2S_a 10 +#define Hacl_Agile_Hash_Blake2S_128_a 11 +#define Hacl_Agile_Hash_Blake2B_a 12 +#define Hacl_Agile_Hash_Blake2B_256_a 13 + +typedef uint8_t Hacl_Agile_Hash_state_s_tags; + +typedef struct Hacl_Agile_Hash_state_s_s +{ + Hacl_Agile_Hash_state_s_tags tag; + union { + uint32_t *case_MD5_a; + uint32_t *case_SHA1_a; + uint32_t *case_SHA2_224_a; + uint32_t *case_SHA2_256_a; + uint64_t *case_SHA2_384_a; + uint64_t *case_SHA2_512_a; + uint64_t *case_SHA3_224_a; + uint64_t *case_SHA3_256_a; + uint64_t *case_SHA3_384_a; + uint64_t *case_SHA3_512_a; + uint32_t *case_Blake2S_a; + Lib_IntVector_Intrinsics_vec128 *case_Blake2S_128_a; + uint64_t *case_Blake2B_a; + Lib_IntVector_Intrinsics_vec256 *case_Blake2B_256_a; + } + ; +} +Hacl_Agile_Hash_state_s; + +typedef struct Hacl_Streaming_HMAC_agile_state_s +{ + Hacl_Streaming_HMAC_Definitions_two_state block_state; + uint8_t *buf; + uint64_t total_len; +} +Hacl_Streaming_HMAC_agile_state; + +#if defined(__cplusplus) +} +#endif + +#define __internal_Hacl_Streaming_HMAC_H_DEFINED +#endif diff --git a/Modules/_hacl/libintvector-shim.h b/Modules/_hacl/libintvector-shim.h new file mode 100644 index 00000000000000..34e0161b33b951 --- /dev/null +++ b/Modules/_hacl/libintvector-shim.h @@ -0,0 +1,35 @@ +/* Some older compilers do not let you include, e.g., unless you also use e.g. -mavx. + * This poses a problem for files like Hacl_Streaming_HMAC.c, which *do* need a vec128 type defined + * in scope (so that their state type can be defined), but which *must not* be compiled with -mavx + * (otherwise it would result in illegal instruction errors on machines without -mavx). + * + * Rather than add another layer of hacks with `[@ CAbstractStruct ]` and another internal + * abstraction barrier between Hacl_Streaming_HMAC and optimized files, we simply define the two + * relevant types to be an incomplete struct (we could also define them to be void). Two + * consequences: + * - these types cannot be constructed, which enforces the abstraction barrier -- you can define the + * Hacl_Streaming_HMAC state type but only if it uses vec128 behind a pointer, which is exactly + * the intent, and + * - the absence of actual operations over these types once again enforces that a client module + * which relies on this header only does type definitions, nothing more, and leaves the actual + * operations to the relevant module (e.g. Hacl_Hash_Blake2b_256) -- that one will include + * libintvector.h + * + * See https://github.com/python/cpython/issues/130213 for a detailed description of the issue + * including actual problematic compilers. + * + * Currently, only Hacl_Streaming_HMAC is crafted carefully enough to do this. + */ + +typedef struct __vec128 Lib_IntVector_Intrinsics_vec128; +typedef struct __vec256 Lib_IntVector_Intrinsics_vec256; + +/* If a module includes this header, it almost certainly has #ifdef HACL_CAN_COMPILE_XXX all over + * the place, so bring that into scope too via config.h */ +#if defined(__has_include) +#if __has_include("config.h") +#include "config.h" +#endif +#endif + +#define HACL_INTRINSICS_SHIMMED diff --git a/Modules/_hacl/python_hacl_namespaces.h b/Modules/_hacl/python_hacl_namespaces.h index 8a1f4aef384d62..e234a123e1606d 100644 --- a/Modules/_hacl/python_hacl_namespaces.h +++ b/Modules/_hacl/python_hacl_namespaces.h @@ -209,4 +209,31 @@ #define Hacl_Hash_SHA3_state_free python_hashlib_Hacl_Hash_SHA3_state_free #define Hacl_Hash_SHA3_state_malloc python_hashlib_Hacl_Hash_SHA3_state_malloc +// Streaming HMAC +#define Hacl_Streaming_HMAC_malloc_ python_hashlib_Hacl_Streaming_HMAC_malloc_ +#define Hacl_Streaming_HMAC_get_impl python_hashlib_Hacl_Streaming_HMAC_get_impl +#define Hacl_Streaming_HMAC_reset python_hashlib_Hacl_Streaming_HMAC_reset +#define Hacl_Streaming_HMAC_update python_hashlib_Hacl_Streaming_HMAC_update +#define Hacl_Streaming_HMAC_digest python_hashlib_Hacl_Streaming_HMAC_digest +#define Hacl_Streaming_HMAC_copy python_hashlib_Hacl_Streaming_HMAC_copy +#define Hacl_Streaming_HMAC_free python_hashlib_Hacl_Streaming_HMAC_free + +// HMAC-MD5 +#define Hacl_HMAC_compute_md5 python_hashlib_Hacl_HMAC_compute_md5 +// HMAC-SHA-1 +#define Hacl_HMAC_compute_sha1 python_hashlib_Hacl_HMAC_compute_sha1 +// HMAC-SHA-2 +#define Hacl_HMAC_compute_sha2_224 python_hashlib_Hacl_HMAC_compute_sha2_224 +#define Hacl_HMAC_compute_sha2_256 python_hashlib_Hacl_HMAC_compute_sha2_256 +#define Hacl_HMAC_compute_sha2_384 python_hashlib_Hacl_HMAC_compute_sha2_384 +#define Hacl_HMAC_compute_sha2_512 python_hashlib_Hacl_HMAC_compute_sha2_512 +// HMAC-SHA-3 +#define Hacl_HMAC_compute_sha3_224 python_hashlib_Hacl_HMAC_compute_sha3_224 +#define Hacl_HMAC_compute_sha3_256 python_hashlib_Hacl_HMAC_compute_sha3_256 +#define Hacl_HMAC_compute_sha3_384 python_hashlib_Hacl_HMAC_compute_sha3_384 +#define Hacl_HMAC_compute_sha3_512 python_hashlib_Hacl_HMAC_compute_sha3_512 +// HMAC-BLAKE +#define Hacl_HMAC_compute_blake2s_32 python_hashlib_Hacl_HMAC_compute_blake2s_32 +#define Hacl_HMAC_compute_blake2b_32 python_hashlib_Hacl_HMAC_compute_blake2b_32 + #endif // _PYTHON_HACL_NAMESPACES_H diff --git a/Modules/_hacl/refresh.sh b/Modules/_hacl/refresh.sh index 86e5b4b0161072..903d7fb2afd362 100755 --- a/Modules/_hacl/refresh.sh +++ b/Modules/_hacl/refresh.sh @@ -41,6 +41,8 @@ fi declare -a dist_files dist_files=( Hacl_Streaming_Types.h + internal/Hacl_Streaming_Types.h +# Cryptographic Hash Functions (headers) Hacl_Hash_MD5.h Hacl_Hash_SHA1.h Hacl_Hash_SHA2.h @@ -49,6 +51,10 @@ dist_files=( Hacl_Hash_Blake2s.h Hacl_Hash_Blake2b_Simd256.h Hacl_Hash_Blake2s_Simd128.h +# Cryptographic Primitives (headers) + Hacl_HMAC.h + Hacl_Streaming_HMAC.h +# Cryptographic Hash Functions (internal headers) internal/Hacl_Hash_MD5.h internal/Hacl_Hash_SHA1.h internal/Hacl_Hash_SHA2.h @@ -58,7 +64,10 @@ dist_files=( internal/Hacl_Hash_Blake2b_Simd256.h internal/Hacl_Hash_Blake2s_Simd128.h internal/Hacl_Impl_Blake2_Constants.h - internal/Hacl_Streaming_Types.h +# Cryptographic Primitives (internal headers) + internal/Hacl_HMAC.h + internal/Hacl_Streaming_HMAC.h +# Cryptographic Hash Functions (sources) Hacl_Hash_MD5.c Hacl_Hash_SHA1.c Hacl_Hash_SHA2.c @@ -67,7 +76,12 @@ dist_files=( Hacl_Hash_Blake2s.c Hacl_Hash_Blake2b_Simd256.c Hacl_Hash_Blake2s_Simd128.c +# Cryptographic Primitives (sources) + Hacl_HMAC.c + Hacl_Streaming_HMAC.c +# Miscellaneous libintvector.h + libintvector-shim.h lib_memzero0.h Lib_Memzero0.c ) @@ -126,7 +140,10 @@ $sed -i -z 's!#define KRML_TYPES_H!#define KRML_TYPES_H\n#define KRML_VERIFIED_U $sed -i 's!#include.*Hacl_Krmllib.h"!!g' "${all_files[@]}" # Use globally unique names for the Hacl_ C APIs to avoid linkage conflicts. -$sed -i -z 's!#include !#include \n#include "python_hacl_namespaces.h"!' Hacl_Hash_*.h +$sed -i -z 's!#include !#include \n#include "python_hacl_namespaces.h"!' \ + Hacl_Hash_*.h \ + Hacl_HMAC.h \ + Hacl_Streaming_HMAC.h # Step 3: trim whitespace (for the linter) diff --git a/Modules/clinic/hmacmodule.c.h b/Modules/clinic/hmacmodule.c.h new file mode 100644 index 00000000000000..1ceb2d809e830a --- /dev/null +++ b/Modules/clinic/hmacmodule.c.h @@ -0,0 +1,673 @@ +/*[clinic input] +preserve +[clinic start generated code]*/ + +#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) +# include "pycore_gc.h" // PyGC_Head +# include "pycore_runtime.h" // _Py_ID() +#endif +#include "pycore_modsupport.h" // _PyArg_UnpackKeywords() + +PyDoc_STRVAR(_hmac_new__doc__, +"new($module, /, key, msg=None, digestmod=None)\n" +"--\n" +"\n" +"Return a new HMAC object."); + +#define _HMAC_NEW_METHODDEF \ + {"new", _PyCFunction_CAST(_hmac_new), METH_FASTCALL|METH_KEYWORDS, _hmac_new__doc__}, + +static PyObject * +_hmac_new_impl(PyObject *module, PyObject *keyobj, PyObject *msgobj, + PyObject *hash_info_ref); + +static PyObject * +_hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) + + #define NUM_KEYWORDS 3 + static struct { + PyGC_Head _this_is_not_used; + PyObject_VAR_HEAD + Py_hash_t ob_hash; + PyObject *ob_item[NUM_KEYWORDS]; + } _kwtuple = { + .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, + .ob_item = { &_Py_ID(key), &_Py_ID(msg), &_Py_ID(digestmod), }, + }; + #undef NUM_KEYWORDS + #define KWTUPLE (&_kwtuple.ob_base.ob_base) + + #else // !Py_BUILD_CORE + # define KWTUPLE NULL + #endif // !Py_BUILD_CORE + + static const char * const _keywords[] = {"key", "msg", "digestmod", NULL}; + static _PyArg_Parser _parser = { + .keywords = _keywords, + .fname = "new", + .kwtuple = KWTUPLE, + }; + #undef KWTUPLE + PyObject *argsbuf[3]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; + PyObject *keyobj; + PyObject *msgobj = NULL; + PyObject *hash_info_ref = NULL; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, + /*minpos*/ 1, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf); + if (!args) { + goto exit; + } + keyobj = args[0]; + if (!noptargs) { + goto skip_optional_pos; + } + if (args[1]) { + msgobj = args[1]; + if (!--noptargs) { + goto skip_optional_pos; + } + } + hash_info_ref = args[2]; +skip_optional_pos: + return_value = _hmac_new_impl(module, keyobj, msgobj, hash_info_ref); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_HMAC_copy__doc__, +"copy($self, /)\n" +"--\n" +"\n" +"Return a copy (\"clone\") of the HMAC object."); + +#define _HMAC_HMAC_COPY_METHODDEF \ + {"copy", _PyCFunction_CAST(_hmac_HMAC_copy), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _hmac_HMAC_copy__doc__}, + +static PyObject * +_hmac_HMAC_copy_impl(HMACObject *self, PyTypeObject *cls); + +static PyObject * +_hmac_HMAC_copy(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { + PyErr_SetString(PyExc_TypeError, "copy() takes no arguments"); + return NULL; + } + return _hmac_HMAC_copy_impl((HMACObject *)self, cls); +} + +PyDoc_STRVAR(_hmac_HMAC_update__doc__, +"update($self, /, msg)\n" +"--\n" +"\n" +"Update the HMAC object with the given message."); + +#define _HMAC_HMAC_UPDATE_METHODDEF \ + {"update", _PyCFunction_CAST(_hmac_HMAC_update), METH_FASTCALL|METH_KEYWORDS, _hmac_HMAC_update__doc__}, + +static PyObject * +_hmac_HMAC_update_impl(HMACObject *self, PyObject *msgobj); + +static PyObject * +_hmac_HMAC_update(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) + + #define NUM_KEYWORDS 1 + static struct { + PyGC_Head _this_is_not_used; + PyObject_VAR_HEAD + Py_hash_t ob_hash; + PyObject *ob_item[NUM_KEYWORDS]; + } _kwtuple = { + .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, + .ob_item = { &_Py_ID(msg), }, + }; + #undef NUM_KEYWORDS + #define KWTUPLE (&_kwtuple.ob_base.ob_base) + + #else // !Py_BUILD_CORE + # define KWTUPLE NULL + #endif // !Py_BUILD_CORE + + static const char * const _keywords[] = {"msg", NULL}; + static _PyArg_Parser _parser = { + .keywords = _keywords, + .fname = "update", + .kwtuple = KWTUPLE, + }; + #undef KWTUPLE + PyObject *argsbuf[1]; + PyObject *msgobj; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, + /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf); + if (!args) { + goto exit; + } + msgobj = args[0]; + return_value = _hmac_HMAC_update_impl((HMACObject *)self, msgobj); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_HMAC_digest__doc__, +"digest($self, /)\n" +"--\n" +"\n" +"Return the digest of the bytes passed to the update() method so far.\n" +"\n" +"This method may raise a MemoryError."); + +#define _HMAC_HMAC_DIGEST_METHODDEF \ + {"digest", (PyCFunction)_hmac_HMAC_digest, METH_NOARGS, _hmac_HMAC_digest__doc__}, + +static PyObject * +_hmac_HMAC_digest_impl(HMACObject *self); + +static PyObject * +_hmac_HMAC_digest(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _hmac_HMAC_digest_impl((HMACObject *)self); +} + +PyDoc_STRVAR(_hmac_HMAC_hexdigest__doc__, +"hexdigest($self, /)\n" +"--\n" +"\n" +"Return hexadecimal digest of the bytes passed to the update() method so far.\n" +"\n" +"This may be used to exchange the value safely in email or other non-binary\n" +"environments.\n" +"\n" +"This method may raise a MemoryError."); + +#define _HMAC_HMAC_HEXDIGEST_METHODDEF \ + {"hexdigest", (PyCFunction)_hmac_HMAC_hexdigest, METH_NOARGS, _hmac_HMAC_hexdigest__doc__}, + +static PyObject * +_hmac_HMAC_hexdigest_impl(HMACObject *self); + +static PyObject * +_hmac_HMAC_hexdigest(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _hmac_HMAC_hexdigest_impl((HMACObject *)self); +} + +#if !defined(_hmac_HMAC_name_DOCSTR) +# define _hmac_HMAC_name_DOCSTR NULL +#endif +#if defined(_HMAC_HMAC_NAME_GETSETDEF) +# undef _HMAC_HMAC_NAME_GETSETDEF +# define _HMAC_HMAC_NAME_GETSETDEF {"name", (getter)_hmac_HMAC_name_get, (setter)_hmac_HMAC_name_set, _hmac_HMAC_name_DOCSTR}, +#else +# define _HMAC_HMAC_NAME_GETSETDEF {"name", (getter)_hmac_HMAC_name_get, NULL, _hmac_HMAC_name_DOCSTR}, +#endif + +static PyObject * +_hmac_HMAC_name_get_impl(HMACObject *self); + +static PyObject * +_hmac_HMAC_name_get(PyObject *self, void *Py_UNUSED(context)) +{ + return _hmac_HMAC_name_get_impl((HMACObject *)self); +} + +#if !defined(_hmac_HMAC_block_size_DOCSTR) +# define _hmac_HMAC_block_size_DOCSTR NULL +#endif +#if defined(_HMAC_HMAC_BLOCK_SIZE_GETSETDEF) +# undef _HMAC_HMAC_BLOCK_SIZE_GETSETDEF +# define _HMAC_HMAC_BLOCK_SIZE_GETSETDEF {"block_size", (getter)_hmac_HMAC_block_size_get, (setter)_hmac_HMAC_block_size_set, _hmac_HMAC_block_size_DOCSTR}, +#else +# define _HMAC_HMAC_BLOCK_SIZE_GETSETDEF {"block_size", (getter)_hmac_HMAC_block_size_get, NULL, _hmac_HMAC_block_size_DOCSTR}, +#endif + +static PyObject * +_hmac_HMAC_block_size_get_impl(HMACObject *self); + +static PyObject * +_hmac_HMAC_block_size_get(PyObject *self, void *Py_UNUSED(context)) +{ + return _hmac_HMAC_block_size_get_impl((HMACObject *)self); +} + +#if !defined(_hmac_HMAC_digest_size_DOCSTR) +# define _hmac_HMAC_digest_size_DOCSTR NULL +#endif +#if defined(_HMAC_HMAC_DIGEST_SIZE_GETSETDEF) +# undef _HMAC_HMAC_DIGEST_SIZE_GETSETDEF +# define _HMAC_HMAC_DIGEST_SIZE_GETSETDEF {"digest_size", (getter)_hmac_HMAC_digest_size_get, (setter)_hmac_HMAC_digest_size_set, _hmac_HMAC_digest_size_DOCSTR}, +#else +# define _HMAC_HMAC_DIGEST_SIZE_GETSETDEF {"digest_size", (getter)_hmac_HMAC_digest_size_get, NULL, _hmac_HMAC_digest_size_DOCSTR}, +#endif + +static PyObject * +_hmac_HMAC_digest_size_get_impl(HMACObject *self); + +static PyObject * +_hmac_HMAC_digest_size_get(PyObject *self, void *Py_UNUSED(context)) +{ + return _hmac_HMAC_digest_size_get_impl((HMACObject *)self); +} + +PyDoc_STRVAR(_hmac_compute_digest__doc__, +"compute_digest($module, /, key, msg, digest)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_DIGEST_METHODDEF \ + {"compute_digest", _PyCFunction_CAST(_hmac_compute_digest), METH_FASTCALL|METH_KEYWORDS, _hmac_compute_digest__doc__}, + +static PyObject * +_hmac_compute_digest_impl(PyObject *module, PyObject *key, PyObject *msg, + PyObject *digest); + +static PyObject * +_hmac_compute_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) + + #define NUM_KEYWORDS 3 + static struct { + PyGC_Head _this_is_not_used; + PyObject_VAR_HEAD + Py_hash_t ob_hash; + PyObject *ob_item[NUM_KEYWORDS]; + } _kwtuple = { + .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_hash = -1, + .ob_item = { &_Py_ID(key), &_Py_ID(msg), &_Py_ID(digest), }, + }; + #undef NUM_KEYWORDS + #define KWTUPLE (&_kwtuple.ob_base.ob_base) + + #else // !Py_BUILD_CORE + # define KWTUPLE NULL + #endif // !Py_BUILD_CORE + + static const char * const _keywords[] = {"key", "msg", "digest", NULL}; + static _PyArg_Parser _parser = { + .keywords = _keywords, + .fname = "compute_digest", + .kwtuple = KWTUPLE, + }; + #undef KWTUPLE + PyObject *argsbuf[3]; + PyObject *key; + PyObject *msg; + PyObject *digest; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, + /*minpos*/ 3, /*maxpos*/ 3, /*minkw*/ 0, /*varpos*/ 0, argsbuf); + if (!args) { + goto exit; + } + key = args[0]; + msg = args[1]; + digest = args[2]; + return_value = _hmac_compute_digest_impl(module, key, msg, digest); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_md5__doc__, +"compute_md5($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_MD5_METHODDEF \ + {"compute_md5", _PyCFunction_CAST(_hmac_compute_md5), METH_FASTCALL, _hmac_compute_md5__doc__}, + +static PyObject * +_hmac_compute_md5_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_md5", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_md5_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_sha1__doc__, +"compute_sha1($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_SHA1_METHODDEF \ + {"compute_sha1", _PyCFunction_CAST(_hmac_compute_sha1), METH_FASTCALL, _hmac_compute_sha1__doc__}, + +static PyObject * +_hmac_compute_sha1_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_sha1", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_sha1_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_sha2_224__doc__, +"compute_sha224($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_SHA2_224_METHODDEF \ + {"compute_sha224", _PyCFunction_CAST(_hmac_compute_sha2_224), METH_FASTCALL, _hmac_compute_sha2_224__doc__}, + +static PyObject * +_hmac_compute_sha2_224_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_sha2_224(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_sha224", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_sha2_224_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_sha2_256__doc__, +"compute_sha256($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_SHA2_256_METHODDEF \ + {"compute_sha256", _PyCFunction_CAST(_hmac_compute_sha2_256), METH_FASTCALL, _hmac_compute_sha2_256__doc__}, + +static PyObject * +_hmac_compute_sha2_256_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_sha2_256(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_sha256", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_sha2_256_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_sha2_384__doc__, +"compute_sha384($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_SHA2_384_METHODDEF \ + {"compute_sha384", _PyCFunction_CAST(_hmac_compute_sha2_384), METH_FASTCALL, _hmac_compute_sha2_384__doc__}, + +static PyObject * +_hmac_compute_sha2_384_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_sha2_384(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_sha384", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_sha2_384_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_sha2_512__doc__, +"compute_sha512($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_SHA2_512_METHODDEF \ + {"compute_sha512", _PyCFunction_CAST(_hmac_compute_sha2_512), METH_FASTCALL, _hmac_compute_sha2_512__doc__}, + +static PyObject * +_hmac_compute_sha2_512_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_sha2_512(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_sha512", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_sha2_512_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_sha3_224__doc__, +"compute_sha3_224($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_SHA3_224_METHODDEF \ + {"compute_sha3_224", _PyCFunction_CAST(_hmac_compute_sha3_224), METH_FASTCALL, _hmac_compute_sha3_224__doc__}, + +static PyObject * +_hmac_compute_sha3_224_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_sha3_224(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_sha3_224", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_sha3_224_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_sha3_256__doc__, +"compute_sha3_256($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_SHA3_256_METHODDEF \ + {"compute_sha3_256", _PyCFunction_CAST(_hmac_compute_sha3_256), METH_FASTCALL, _hmac_compute_sha3_256__doc__}, + +static PyObject * +_hmac_compute_sha3_256_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_sha3_256(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_sha3_256", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_sha3_256_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_sha3_384__doc__, +"compute_sha3_384($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_SHA3_384_METHODDEF \ + {"compute_sha3_384", _PyCFunction_CAST(_hmac_compute_sha3_384), METH_FASTCALL, _hmac_compute_sha3_384__doc__}, + +static PyObject * +_hmac_compute_sha3_384_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_sha3_384(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_sha3_384", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_sha3_384_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_sha3_512__doc__, +"compute_sha3_512($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_SHA3_512_METHODDEF \ + {"compute_sha3_512", _PyCFunction_CAST(_hmac_compute_sha3_512), METH_FASTCALL, _hmac_compute_sha3_512__doc__}, + +static PyObject * +_hmac_compute_sha3_512_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_sha3_512(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_sha3_512", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_sha3_512_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_blake2s_32__doc__, +"compute_blake2s_32($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_BLAKE2S_32_METHODDEF \ + {"compute_blake2s_32", _PyCFunction_CAST(_hmac_compute_blake2s_32), METH_FASTCALL, _hmac_compute_blake2s_32__doc__}, + +static PyObject * +_hmac_compute_blake2s_32_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_blake2s_32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_blake2s_32", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_blake2s_32_impl(module, key, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_hmac_compute_blake2b_32__doc__, +"compute_blake2b_32($module, key, msg, /)\n" +"--\n" +"\n"); + +#define _HMAC_COMPUTE_BLAKE2B_32_METHODDEF \ + {"compute_blake2b_32", _PyCFunction_CAST(_hmac_compute_blake2b_32), METH_FASTCALL, _hmac_compute_blake2b_32__doc__}, + +static PyObject * +_hmac_compute_blake2b_32_impl(PyObject *module, PyObject *key, PyObject *msg); + +static PyObject * +_hmac_compute_blake2b_32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *key; + PyObject *msg; + + if (!_PyArg_CheckPositional("compute_blake2b_32", nargs, 2, 2)) { + goto exit; + } + key = args[0]; + msg = args[1]; + return_value = _hmac_compute_blake2b_32_impl(module, key, msg); + +exit: + return return_value; +} +/*[clinic end generated code: output=30c0614482d963f5 input=a9049054013a1b77]*/ diff --git a/Modules/hmacmodule.c b/Modules/hmacmodule.c new file mode 100644 index 00000000000000..faf4e0a023147e --- /dev/null +++ b/Modules/hmacmodule.c @@ -0,0 +1,1758 @@ +/* + * @author Bénédikt Tran + * + * Implement the HMAC algorithm as described by RFC 2104 using HACL*. + * + * Using HACL* implementation implicitly assumes that the caller wants + * a formally verified implementation. In particular, only algorithms + * given by their names will be recognized. + * + * Some algorithms exposed by `_hashlib` such as truncated SHA-2-512-224/256 + * are not yet implemented by the HACL* project. Nonetheless, the supported + * HMAC algorithms form a subset of those supported by '_hashlib'. + */ + +#ifndef Py_BUILD_CORE_BUILTIN +# define Py_BUILD_CORE_MODULE 1 +#endif + +#include "Python.h" +#include "pycore_hashtable.h" +#include "pycore_strhex.h" // _Py_strhex() + +// Small mismatch between the variable names Python defines as part of configure +// at the ones HACL* expects to be set in order to enable those headers. +#define HACL_CAN_COMPILE_VEC128 HACL_CAN_COMPILE_SIMD128 +#define HACL_CAN_COMPILE_VEC256 HACL_CAN_COMPILE_SIMD256 + +#include "_hacl/Hacl_HMAC.h" +#include "_hacl/Hacl_Streaming_HMAC.h" // Hacl_Agile_Hash_* identifiers +#include "_hacl/Hacl_Streaming_Types.h" // Hacl_Streaming_Types_error_code + +#include + +#include "hashlib.h" + +// --- Reusable error messages ------------------------------------------------ + +#define INVALID_KEY_LENGTH "key length exceeds UINT32_MAX" +#define INVALID_MSG_LENGTH "message length exceeds UINT32_MAX" + +// --- HMAC underlying hash function static information ----------------------- + +#define UINT32_MAX_AS_SSIZE_T ((Py_ssize_t)UINT32_MAX) + +#define Py_hmac_hash_max_block_size 144 +#define Py_hmac_hash_max_digest_size 64 + +/* MD-5 */ +// HACL_HID = md5 +#define Py_hmac_md5_block_size 64 +#define Py_hmac_md5_digest_size 16 + +#define Py_hmac_md5_compute_func Hacl_HMAC_compute_md5 + +/* SHA-1 family */ +// HACL_HID = sha1 +#define Py_hmac_sha1_block_size 64 +#define Py_hmac_sha1_digest_size 20 + +#define Py_hmac_sha1_compute_func Hacl_HMAC_compute_sha1 + +/* SHA-2 family */ +// HACL_HID = sha2_224 +#define Py_hmac_sha2_224_block_size 64 +#define Py_hmac_sha2_224_digest_size 28 + +#define Py_hmac_sha2_224_compute_func Hacl_HMAC_compute_sha2_224 + +// HACL_HID = sha2_256 +#define Py_hmac_sha2_256_block_size 64 +#define Py_hmac_sha2_256_digest_size 32 + +#define Py_hmac_sha2_256_compute_func Hacl_HMAC_compute_sha2_256 + +// HACL_HID = sha2_384 +#define Py_hmac_sha2_384_block_size 128 +#define Py_hmac_sha2_384_digest_size 48 + +#define Py_hmac_sha2_384_compute_func Hacl_HMAC_compute_sha2_384 + +// HACL_HID = sha2_512 +#define Py_hmac_sha2_512_block_size 128 +#define Py_hmac_sha2_512_digest_size 64 + +#define Py_hmac_sha2_512_compute_func Hacl_HMAC_compute_sha2_512 + +/* SHA-3 family */ +// HACL_HID = sha3_224 +#define Py_hmac_sha3_224_block_size 144 +#define Py_hmac_sha3_224_digest_size 28 + +#define Py_hmac_sha3_224_compute_func Hacl_HMAC_compute_sha3_224 + +// HACL_HID = sha3_256 +#define Py_hmac_sha3_256_block_size 136 +#define Py_hmac_sha3_256_digest_size 32 + +#define Py_hmac_sha3_256_compute_func Hacl_HMAC_compute_sha3_256 + +// HACL_HID = sha3_384 +#define Py_hmac_sha3_384_block_size 104 +#define Py_hmac_sha3_384_digest_size 48 + +#define Py_hmac_sha3_384_compute_func Hacl_HMAC_compute_sha3_384 + +// HACL_HID = sha3_512 +#define Py_hmac_sha3_512_block_size 72 +#define Py_hmac_sha3_512_digest_size 64 + +#define Py_hmac_sha3_512_compute_func Hacl_HMAC_compute_sha3_512 + +/* Blake2 family */ +// HACL_HID = blake2s_32 +#define Py_hmac_blake2s_32_block_size 64 +#define Py_hmac_blake2s_32_digest_size 32 + +#define Py_hmac_blake2s_32_compute_func Hacl_HMAC_compute_blake2s_32 + +// HACL_HID = blake2b_32 +#define Py_hmac_blake2b_32_block_size 128 +#define Py_hmac_blake2b_32_digest_size 64 + +#define Py_hmac_blake2b_32_compute_func Hacl_HMAC_compute_blake2b_32 + +/* Enumeration indicating the underlying hash function used by HMAC. */ +typedef enum HMAC_Hash_Kind { + Py_hmac_kind_hash_unknown = -1, +#define DECL_HACL_HMAC_HASH_KIND(NAME, HACL_NAME) \ + Py_hmac_kind_hmac_ ## NAME = Hacl_Agile_Hash_ ## HACL_NAME, + /* MD5 */ + DECL_HACL_HMAC_HASH_KIND(md5, MD5) + /* SHA-1 */ + DECL_HACL_HMAC_HASH_KIND(sha1, SHA1) + /* SHA-2 family */ + DECL_HACL_HMAC_HASH_KIND(sha2_224, SHA2_224) + DECL_HACL_HMAC_HASH_KIND(sha2_256, SHA2_256) + DECL_HACL_HMAC_HASH_KIND(sha2_384, SHA2_384) + DECL_HACL_HMAC_HASH_KIND(sha2_512, SHA2_512) + /* SHA-3 family */ + DECL_HACL_HMAC_HASH_KIND(sha3_224, SHA3_224) + DECL_HACL_HMAC_HASH_KIND(sha3_256, SHA3_256) + DECL_HACL_HMAC_HASH_KIND(sha3_384, SHA3_384) + DECL_HACL_HMAC_HASH_KIND(sha3_512, SHA3_512) + /* Blake family */ + DECL_HACL_HMAC_HASH_KIND(blake2s_32, Blake2S_32) + DECL_HACL_HMAC_HASH_KIND(blake2b_32, Blake2B_32) + /* Blake runtime family (should not be used statically) */ + DECL_HACL_HMAC_HASH_KIND(vectorized_blake2s_32, Blake2S_128) + DECL_HACL_HMAC_HASH_KIND(vectorized_blake2b_32, Blake2B_256) +#undef DECL_HACL_HMAC_HASH_KIND +} HMAC_Hash_Kind; + +typedef Hacl_Streaming_Types_error_code hacl_errno_t; + +/* Function pointer type for 1-shot HACL* HMAC functions. */ +typedef void +(*HACL_HMAC_compute_func)(uint8_t *out, + uint8_t *key, uint32_t keylen, + uint8_t *msg, uint32_t msglen); +/* Function pointer type for 1-shot HACL* HMAC CPython AC functions. */ +typedef PyObject * +(*PyAC_HMAC_compute_func)(PyObject *module, PyObject *key, PyObject *msg); + +/* + * HACL* HMAC minimal interface. + */ +typedef struct py_hmac_hacl_api { + HACL_HMAC_compute_func compute; + PyAC_HMAC_compute_func compute_py; +} py_hmac_hacl_api; + +#if PY_SSIZE_T_MAX > UINT32_MAX +#define Py_HMAC_SSIZE_LARGER_THAN_UINT32 +#endif + +/* + * Assert that 'LEN' can be safely casted to uint32_t. + * + * The 'LEN' parameter should be convertible to Py_ssize_t. + */ +#ifdef Py_HMAC_SSIZE_LARGER_THAN_UINT32 +#define Py_CHECK_HACL_UINT32_T_LENGTH(LEN) \ + do { \ + assert((Py_ssize_t)(LEN) <= UINT32_MAX_AS_SSIZE_T); \ + } while (0) +#else +#define Py_CHECK_HACL_UINT32_T_LENGTH(LEN) +#endif + +/* + * Call the HACL* HMAC-HASH update function on the given data. + * + * The magnitude of 'LEN' is not checked and thus 'LEN' must be + * safely convertible to a uint32_t value. + */ +#define Py_HMAC_HACL_UPDATE_CALL(HACL_STATE, BUF, LEN) \ + Hacl_Streaming_HMAC_update(HACL_STATE, BUF, (uint32_t)(LEN)) + +/* + * Call the HACL* HMAC-HASH update function on the given data. + * + * On DEBUG builds, the 'ERRACTION' statements are executed if + * the update() call returned a non-successful HACL* exit code. + * + * The buffer 'BUF' and its length 'LEN' are left untouched. + * + * The formal signature of this macro is: + * + * (HACL_HMAC_state *, uint8_t *, uint32_t, PyObject *, (C statements)) + */ +#ifndef NDEBUG +#define Py_HMAC_HACL_UPDATE_ONCE( \ + HACL_STATE, BUF, LEN, \ + ALGORITHM, ERRACTION \ +) \ + do { \ + Py_CHECK_HACL_UINT32_T_LENGTH(LEN); \ + hacl_errno_t code = Py_HMAC_HACL_UPDATE_CALL(HACL_STATE, BUF, LEN); \ + if (_hacl_convert_errno(code, (ALGORITHM)) < 0) { \ + ERRACTION; \ + } \ + } while (0) +#else +#define Py_HMAC_HACL_UPDATE_ONCE( \ + HACL_STATE, BUF, LEN, \ + _ALGORITHM, _ERRACTION \ +) \ + do { \ + (void)Py_HMAC_HACL_UPDATE_CALL(HACL_STATE, BUF, (LEN)); \ + } while (0) +#endif + +/* + * Repetivively call the HACL* HMAC-HASH update function on the given + * data until the buffer length 'LEN' is strictly less than UINT32_MAX. + * + * On builds with PY_SSIZE_T_MAX <= UINT32_MAX, this is a no-op. + * + * The buffer 'BUF' (resp. 'LEN') is advanced (resp. decremented) + * by UINT32_MAX after each update. On DEBUG builds, each update() + * call is verified and the 'ERRACTION' statements are executed if + * a non-successful HACL* exit code is being returned. + * + * In particular, 'BUF' and 'LEN' must be variable names and not + * expressions on their own. + * + * The formal signature of this macro is: + * + * (HACL_HMAC_state *, uint8_t *, C integer, PyObject *, (C statements)) + */ +#ifdef Py_HMAC_SSIZE_LARGER_THAN_UINT32 +#define Py_HMAC_HACL_UPDATE_LOOP( \ + HACL_STATE, BUF, LEN, \ + ALGORITHM, ERRACTION \ +) \ + do { \ + while ((Py_ssize_t)LEN > UINT32_MAX_AS_SSIZE_T) { \ + Py_HMAC_HACL_UPDATE_ONCE(HACL_STATE, BUF, UINT32_MAX, \ + ALGORITHM, ERRACTION); \ + BUF += UINT32_MAX; \ + LEN -= UINT32_MAX; \ + } \ + } while (0) +#else +#define Py_HMAC_HACL_UPDATE_LOOP( \ + HACL_STATE, BUF, LEN, \ + _ALGORITHM, _ERRACTION \ +) +#endif + +/* + * Perform the HMAC-HASH update() operation in a streaming fashion. + * + * The formal signature of this macro is: + * + * (HACL_HMAC_state *, uint8_t *, C integer, PyObject *, (C statements)) + */ +#define Py_HMAC_HACL_UPDATE( \ + HACL_STATE, BUF, LEN, \ + ALGORITHM, ERRACTION \ +) \ + do { \ + Py_HMAC_HACL_UPDATE_LOOP(HACL_STATE, BUF, LEN, \ + ALGORITHM, ERRACTION); \ + Py_HMAC_HACL_UPDATE_ONCE(HACL_STATE, BUF, LEN, \ + ALGORITHM, ERRACTION); \ + } while (0) + +/* + * HMAC underlying hash function static information. + */ +typedef struct py_hmac_hinfo { + /* + * Name of the hash function used by the HACL* HMAC module. + * + * This name may differ from the hashlib names. For instance, + * SHA-2/224 is named "sha2_224" instead of "sha224" as it is + * done by 'hashlib'. + */ + const char *name; + + /* hash function information */ + HMAC_Hash_Kind kind; + uint32_t block_size; + uint32_t digest_size; + + /* HACL* HMAC API */ + py_hmac_hacl_api api; + + /* + * Cached field storing the 'hashlib_name' field as a Python string. + * + * This field is NULL by default in the items of "py_hmac_static_hinfo" + * but will be populated when creating the module's state "hinfo_table". + */ + PyObject *display_name; + const char *hashlib_name; /* hashlib preferred name (default: name) */ + + Py_ssize_t refcnt; +} py_hmac_hinfo; + +// --- HMAC module state ------------------------------------------------------ + +typedef struct hmacmodule_state { + _Py_hashtable_t *hinfo_table; + PyObject *unknown_hash_error; + /* HMAC object type */ + PyTypeObject *hmac_type; + /* interned strings */ + PyObject *str_lower; + + bool can_run_simd128; + bool can_run_simd256; +} hmacmodule_state; + +static inline hmacmodule_state * +get_hmacmodule_state(PyObject *module) +{ + void *state = PyModule_GetState(module); + assert(state != NULL); + return (hmacmodule_state *)state; +} + +static inline hmacmodule_state * +get_hmacmodule_state_by_cls(PyTypeObject *cls) +{ + void *state = PyType_GetModuleState(cls); + assert(state != NULL); + return (hmacmodule_state *)state; +} + +// --- HMAC Object ------------------------------------------------------------ + +typedef Hacl_Streaming_HMAC_agile_state HACL_HMAC_state; + +typedef struct HMACObject { + PyObject_HEAD + + bool use_mutex; + PyMutex mutex; + + // Hash function information + PyObject *name; // rendered name (exact unicode object) + HMAC_Hash_Kind kind; // can be used for runtime dispatch (must be known) + uint32_t block_size; + uint32_t digest_size; + py_hmac_hacl_api api; + + // HMAC HACL* internal state. + HACL_HMAC_state *state; +} HMACObject; + +#define HMACObject_CAST(op) ((HMACObject *)(op)) + +// --- HMAC module clinic configuration --------------------------------------- + +/*[clinic input] +module _hmac +class _hmac.HMAC "HMACObject *" "clinic_state()->hmac_type" +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c8bab73fde49ba8a]*/ + +#define clinic_state() (get_hmacmodule_state_by_cls(Py_TYPE(self))) +#include "clinic/hmacmodule.c.h" +#undef clinic_state + +// --- Helpers ---------------------------------------------------------------- +// +// The helpers have the following naming conventions: +// +// - Helpers with the "_hacl" prefix are thin wrappers around HACL* functions. +// Buffer lengths given as inputs should fit on 32-bit integers. +// +// - Helpers with the "hmac_" prefix act on HMAC objects and accept buffers +// whose length fits on 32-bit or 64-bit integers (depending on the host +// machine). + +/* + * Assert that a HMAC hash kind is a static kind. + * + * A "static" kind is specified in the 'py_hmac_static_hinfo' + * table and is always independent of the host CPUID features. + */ +#ifndef NDEBUG +static void +assert_is_static_hmac_hash_kind(HMAC_Hash_Kind kind) +{ + switch (kind) { + case Py_hmac_kind_hash_unknown: { + Py_FatalError("HMAC hash kind must be a known kind"); + return; + } + case Py_hmac_kind_hmac_vectorized_blake2s_32: + case Py_hmac_kind_hmac_vectorized_blake2b_32: { + Py_FatalError("HMAC hash kind must not be a vectorized kind"); + return; + } + default: + return; + } +} +#else +static inline void +assert_is_static_hmac_hash_kind(HMAC_Hash_Kind Py_UNUSED(kind)) {} +#endif + +/* + * Convert a HMAC hash static kind into a runtime kind. + * + * A "runtime" kind is derived from a static kind and depends + * on the host CPUID features. In particular, this is the kind + * that a HMAC object internally stores. + */ +static HMAC_Hash_Kind +narrow_hmac_hash_kind(hmacmodule_state *state, HMAC_Hash_Kind kind) +{ + switch (kind) { + case Py_hmac_kind_hmac_blake2s_32: { +#if HACL_CAN_COMPILE_SIMD128 + if (state->can_run_simd128) { + return Py_hmac_kind_hmac_vectorized_blake2s_32; + } +#endif + return kind; + } + case Py_hmac_kind_hmac_blake2b_32: { +#if HACL_CAN_COMPILE_SIMD256 + if (state->can_run_simd256) { + return Py_hmac_kind_hmac_vectorized_blake2b_32; + } +#endif + return kind; + } + default: + return kind; + } +} + +/* + * Handle the HACL* exit code. + * + * If 'code' represents a successful operation, this returns 0. + * Otherwise, this sets an appropriate exception and returns -1. + */ +static int +_hacl_convert_errno(hacl_errno_t code, PyObject *algorithm) +{ + switch (code) { + case Hacl_Streaming_Types_Success: { + return 0; + } + case Hacl_Streaming_Types_InvalidAlgorithm: { + // only makes sense if an algorithm is known at call time + assert(algorithm != NULL); + assert(PyUnicode_CheckExact(algorithm)); + PyErr_Format(PyExc_ValueError, "invalid algorithm: %U", algorithm); + return -1; + } + case Hacl_Streaming_Types_InvalidLength: { + PyErr_SetString(PyExc_ValueError, "invalid length"); + return -1; + } + case Hacl_Streaming_Types_MaximumLengthExceeded: { + PyErr_SetString(PyExc_OverflowError, "maximum length exceeded"); + return -1; + } + case Hacl_Streaming_Types_OutOfMemory: { + PyErr_NoMemory(); + return -1; + } + default: { + PyErr_Format(PyExc_RuntimeError, + "HACL* internal routine failed with error code: %d", + code); + return -1; + } + } +} + +/* + * Return a new HACL* internal state or return NULL on failure. + * + * An appropriate exception is set if the state cannot be created. + */ +static HACL_HMAC_state * +_hacl_hmac_state_new(HMAC_Hash_Kind kind, uint8_t *key, uint32_t len) +{ + assert(kind != Py_hmac_kind_hash_unknown); + HACL_HMAC_state *state = NULL; + hacl_errno_t retcode = Hacl_Streaming_HMAC_malloc_(kind, key, len, &state); + if (_hacl_convert_errno(retcode, NULL) < 0) { + assert(state == NULL); + return NULL; + } + return state; +} + +/* + * Free the HACL* internal state. + */ +static inline void +_hacl_hmac_state_free(HACL_HMAC_state *state) +{ + if (state != NULL) { + Hacl_Streaming_HMAC_free(state); + } +} + +/* Static information used to construct the hash table. */ +static const py_hmac_hinfo py_hmac_static_hinfo[] = { +#define Py_HMAC_HINFO_HACL_API(HACL_HID) \ + { \ + /* one-shot helpers */ \ + .compute = &Py_hmac_## HACL_HID ##_compute_func, \ + .compute_py = &_hmac_compute_## HACL_HID ##_impl, \ + } + +#define Py_HMAC_HINFO_ENTRY(HACL_HID, HLIB_NAME) \ + { \ + .name = Py_STRINGIFY(HACL_HID), \ + .kind = Py_hmac_kind_hmac_ ## HACL_HID, \ + .block_size = Py_hmac_## HACL_HID ##_block_size, \ + .digest_size = Py_hmac_## HACL_HID ##_digest_size, \ + .api = Py_HMAC_HINFO_HACL_API(HACL_HID), \ + .display_name = NULL, \ + .hashlib_name = HLIB_NAME, \ + .refcnt = 0, \ + } + /* MD5 */ + Py_HMAC_HINFO_ENTRY(md5, NULL), + /* SHA-1 */ + Py_HMAC_HINFO_ENTRY(sha1, NULL), + /* SHA-2 family */ + Py_HMAC_HINFO_ENTRY(sha2_224, "sha224"), + Py_HMAC_HINFO_ENTRY(sha2_256, "sha256"), + Py_HMAC_HINFO_ENTRY(sha2_384, "sha384"), + Py_HMAC_HINFO_ENTRY(sha2_512, "sha512"), + /* SHA-3 family */ + Py_HMAC_HINFO_ENTRY(sha3_224, NULL), + Py_HMAC_HINFO_ENTRY(sha3_256, NULL), + Py_HMAC_HINFO_ENTRY(sha3_384, NULL), + Py_HMAC_HINFO_ENTRY(sha3_512, NULL), + /* Blake family */ + Py_HMAC_HINFO_ENTRY(blake2s_32, "blake2s"), + Py_HMAC_HINFO_ENTRY(blake2b_32, "blake2b"), +#undef Py_HMAC_HINFO_ENTRY +#undef Py_HMAC_HINFO_HACL_API + /* sentinel */ + { + NULL, Py_hmac_kind_hash_unknown, 0, 0, + {NULL, NULL}, + NULL, NULL, + 0, + }, +}; + +/* + * Check whether 'name' is a known HMAC hash function name, + * storing the corresponding static information in 'info'. + * + * This function always succeeds and never set an exception. + */ +static inline bool +find_hash_info_by_utf8name(hmacmodule_state *state, + const char *name, + const py_hmac_hinfo **info) +{ + assert(name != NULL); + *info = _Py_hashtable_get(state->hinfo_table, name); + return *info != NULL; +} + +/* + * Find the corresponding HMAC hash function static information by its name. + * + * On error, propagate the exception, set 'info' to NULL and return -1. + * + * If no correspondence exists, set 'info' to NULL and return 0. + * Otherwise, set 'info' to the deduced information and return 1. + * + * Parameters + * + * state The HMAC module state. + * name The hash function name. + * info The deduced information, if any. + */ +static int +find_hash_info_by_name(hmacmodule_state *state, + PyObject *name, + const py_hmac_hinfo **info) +{ + const char *utf8name = PyUnicode_AsUTF8(name); + if (utf8name == NULL) { + goto error; + } + if (find_hash_info_by_utf8name(state, utf8name, info)) { + return 1; + } + + // try to find an alternative using the lowercase name + PyObject *lower = PyObject_CallMethodNoArgs(name, state->str_lower); + if (lower == NULL) { + goto error; + } + const char *utf8lower = PyUnicode_AsUTF8(lower); + if (utf8lower == NULL) { + Py_DECREF(lower); + goto error; + } + int found = find_hash_info_by_utf8name(state, utf8lower, info); + Py_DECREF(lower); + return found; + +error: + *info = NULL; + return -1; +} + +/* + * Find the corresponding HMAC hash function static information. + * + * On error, propagate the exception, set 'info' to NULL and return -1. + * + * If no correspondence exists, set 'info' to NULL and return 0. + * Otherwise, set 'info' to the deduced information and return 1. + * + * Parameters + * + * state The HMAC module state. + * hash_info_ref An input to hashlib.new(). + * info The deduced information, if any. + */ +static int +find_hash_info_impl(hmacmodule_state *state, + PyObject *hash_info_ref, + const py_hmac_hinfo **info) +{ + if (PyUnicode_Check(hash_info_ref)) { + return find_hash_info_by_name(state, hash_info_ref, info); + } + // NOTE(picnixz): For now, we only support named algorithms. + // In the future, we need to decide whether 'hashlib.openssl_md5' + // would make sense as an alias to 'md5' and how to remove OpenSSL. + *info = NULL; + return 0; +} + +/* + * Find the corresponding HMAC hash function static information. + * + * If nothing can be found or if an error occurred, return NULL + * with an exception set. Otherwise return a non-NULL object. + */ +static const py_hmac_hinfo * +find_hash_info(hmacmodule_state *state, PyObject *hash_info_ref) +{ + const py_hmac_hinfo *info = NULL; + int rc = find_hash_info_impl(state, hash_info_ref, &info); + // The code below could be simplfied with only 'rc == 0' case, + // but we are deliberately verbose to ease future improvements. + if (rc < 0) { + return NULL; + } + if (rc == 0) { + PyErr_Format(state->unknown_hash_error, + "unsupported hash type: %R", hash_info_ref); + return NULL; + } + assert(info != NULL); + return info; +} + +/* Check that the buffer length fits on a uint32_t. */ +static inline int +has_uint32_t_buffer_length(const Py_buffer *buffer) +{ +#ifdef Py_HMAC_SSIZE_LARGER_THAN_UINT32 + return buffer->len <= UINT32_MAX_AS_SSIZE_T; +#else + return 1; +#endif +} + +// --- HMAC object ------------------------------------------------------------ + +/* + * Use the HMAC information 'info' to populate the corresponding fields. + * + * The real 'kind' for BLAKE-2 is obtained once and depends on both static + * capabilities (supported compiler flags) and runtime CPUID features. + */ +static void +hmac_set_hinfo(hmacmodule_state *state, + HMACObject *self, const py_hmac_hinfo *info) +{ + assert(info->display_name != NULL); + self->name = Py_NewRef(info->display_name); + assert_is_static_hmac_hash_kind(info->kind); + self->kind = narrow_hmac_hash_kind(state, info->kind); + assert(info->block_size <= Py_hmac_hash_max_block_size); + self->block_size = info->block_size; + assert(info->digest_size <= Py_hmac_hash_max_digest_size); + self->digest_size = info->digest_size; + assert(info->api.compute != NULL); + assert(info->api.compute_py != NULL); + self->api = info->api; +} + +/* + * Create initial HACL* internal state with the given key. + * + * This function MUST only be called by the HMAC object constructor + * and after hmac_set_hinfo() has been called, lest the behaviour is + * undefined. + * + * Return 0 on success; otherwise, set an exception and return -1 on failure. + */ +static int +hmac_new_initial_state(HMACObject *self, uint8_t *key, Py_ssize_t len) +{ + assert(key != NULL); +#ifdef Py_HMAC_SSIZE_LARGER_THAN_UINT32 + // Technically speaking, we could hash the key to make it small + // but it would require to call the hash functions ourselves and + // not rely on HACL* implementation anymore. As such, we explicitly + // reject keys that do not fit on 32 bits until HACL* handles them. + if (len > UINT32_MAX_AS_SSIZE_T) { + PyErr_SetString(PyExc_OverflowError, INVALID_KEY_LENGTH); + return -1; + } +#endif + assert(self->kind != Py_hmac_kind_hash_unknown); + // cast to uint32_t is now safe even on 32-bit platforms + self->state = _hacl_hmac_state_new(self->kind, key, (uint32_t)len); + // _hacl_hmac_state_new() may set an exception on error + return self->state == NULL ? -1 : 0; +} + +/* + * Feed initial data. + * + * This function MUST only be called by the HMAC object constructor + * and after hmac_set_hinfo() and hmac_new_initial_state() have been + * called, lest the behaviour is undefined. + * + * Return 0 on success; otherwise, set an exception and return -1 on failure. + */ +static int +hmac_feed_initial_data(HMACObject *self, uint8_t *msg, Py_ssize_t len) +{ + assert(self->name != NULL); + assert(self->state != NULL); + if (len == 0) { + // do nothing if the buffer is empty + return 0; + } + + if (len < HASHLIB_GIL_MINSIZE) { + Py_HMAC_HACL_UPDATE(self->state, msg, len, self->name, return -1); + return 0; + } + + int res = 0; + Py_BEGIN_ALLOW_THREADS + Py_HMAC_HACL_UPDATE(self->state, msg, len, self->name, goto error); + goto done; +#ifndef NDEBUG +error: + res = -1; +#else + Py_UNREACHABLE(); +#endif +done: + Py_END_ALLOW_THREADS + return res; +} + +/*[clinic input] +_hmac.new + + key as keyobj: object + msg as msgobj: object(c_default="NULL") = None + digestmod as hash_info_ref: object(c_default="NULL") = None + +Return a new HMAC object. +[clinic start generated code]*/ + +static PyObject * +_hmac_new_impl(PyObject *module, PyObject *keyobj, PyObject *msgobj, + PyObject *hash_info_ref) +/*[clinic end generated code: output=7c7573a427d58758 input=92fc7c0a00707d42]*/ +{ + hmacmodule_state *state = get_hmacmodule_state(module); + if (hash_info_ref == NULL) { + PyErr_SetString(PyExc_TypeError, + "new() missing 1 required argument 'digestmod'"); + return NULL; + } + + const py_hmac_hinfo *info = find_hash_info(state, hash_info_ref); + if (info == NULL) { + return NULL; + } + + HMACObject *self = PyObject_GC_New(HMACObject, state->hmac_type); + if (self == NULL) { + return NULL; + } + HASHLIB_INIT_MUTEX(self); + hmac_set_hinfo(state, self, info); + int rc; + // Create the HACL* internal state with the given key. + Py_buffer key; + GET_BUFFER_VIEW_OR_ERROR(keyobj, &key, goto error_on_key); + rc = hmac_new_initial_state(self, key.buf, key.len); + PyBuffer_Release(&key); + if (rc < 0) { + goto error; + } + // Feed the internal state the initial message if any. + if (msgobj != NULL && msgobj != Py_None) { + Py_buffer msg; + GET_BUFFER_VIEW_OR_ERROR(msgobj, &msg, goto error); + rc = hmac_feed_initial_data(self, msg.buf, msg.len); + PyBuffer_Release(&msg); +#ifndef NDEBUG + if (rc < 0) { + goto error; + } +#else + (void)rc; +#endif + } + assert(rc == 0); + PyObject_GC_Track(self); + return (PyObject *)self; + +error_on_key: + self->state = NULL; +error: + Py_DECREF(self); + return NULL; +} + +/* + * Copy HMAC hash information from 'src' to 'out'. + */ +static void +hmac_copy_hinfo(HMACObject *out, const HMACObject *src) +{ + assert(src->name != NULL); + out->name = Py_NewRef(src->name); + assert(src->kind != Py_hmac_kind_hash_unknown); + out->kind = src->kind; + assert(src->block_size <= Py_hmac_hash_max_block_size); + out->block_size = src->block_size; + assert(src->digest_size <= Py_hmac_hash_max_digest_size); + out->digest_size = src->digest_size; + assert(src->api.compute != NULL); + assert(src->api.compute_py != NULL); + out->api = src->api; +} + +/* + * Copy the HMAC internal state from 'src' to 'out'. + * + * The internal state of 'out' must not already exist. + * + * Return 0 on success; otherwise, set an exception and return -1 on failure. + */ +static int +hmac_copy_state(HMACObject *out, const HMACObject *src) +{ + assert(src->state != NULL); + out->state = Hacl_Streaming_HMAC_copy(src->state); + if (out->state == NULL) { + PyErr_NoMemory(); + return -1; + } + return 0; +} + +/*[clinic input] +_hmac.HMAC.copy + + cls: defining_class + +Return a copy ("clone") of the HMAC object. +[clinic start generated code]*/ + +static PyObject * +_hmac_HMAC_copy_impl(HMACObject *self, PyTypeObject *cls) +/*[clinic end generated code: output=a955bfa55b65b215 input=17b2c0ad0b147e36]*/ +{ + hmacmodule_state *state = get_hmacmodule_state_by_cls(cls); + HMACObject *copy = PyObject_GC_New(HMACObject, state->hmac_type); + if (copy == NULL) { + return NULL; + } + + ENTER_HASHLIB(self); + /* copy hash information */ + hmac_copy_hinfo(copy, self); + /* copy internal state */ + int rc = hmac_copy_state(copy, self); + LEAVE_HASHLIB(self); + + if (rc < 0) { + Py_DECREF(copy); + return NULL; + } + + HASHLIB_INIT_MUTEX(copy); + PyObject_GC_Track(copy); + return (PyObject *)copy; +} + +/* + * Update the HMAC object with the given buffer. + * + * This unconditionally acquires the lock on the HMAC object. + * + * On DEBUG builds, each update() call is verified. + * + * Return 0 on success; otherwise, set an exception and return -1 on failure. + */ +static int +hmac_update_state_with_lock(HMACObject *self, uint8_t *buf, Py_ssize_t len) +{ + int res = 0; + Py_BEGIN_ALLOW_THREADS + PyMutex_Lock(&self->mutex); // unconditionally acquire a lock + Py_HMAC_HACL_UPDATE(self->state, buf, len, self->name, goto error); + goto done; +#ifndef NDEBUG +error: + res = -1; +#else + Py_UNREACHABLE(); +#endif +done: + PyMutex_Unlock(&self->mutex); + Py_END_ALLOW_THREADS + return res; +} + +/* + * Update the HMAC object with the given buffer. + * + * This conditionally acquires the lock on the HMAC object. + * + * On DEBUG builds, each update() call is verified. + * + * Return 0 on success; otherwise, set an exception and return -1 on failure. + */ +static int +hmac_update_state_cond_lock(HMACObject *self, uint8_t *buf, Py_ssize_t len) +{ + ENTER_HASHLIB(self); // conditionally acquire a lock + Py_HMAC_HACL_UPDATE(self->state, buf, len, self->name, goto error); + LEAVE_HASHLIB(self); + return 0; + +#ifndef NDEBUG +error: + LEAVE_HASHLIB(self); + return -1; +#else + Py_UNREACHABLE(); +#endif +} + +/* + * Update the internal HMAC state with the given buffer. + * + * Return 0 on success; otherwise, set an exception and return -1 on failure. + */ +static inline int +hmac_update_state(HMACObject *self, uint8_t *buf, Py_ssize_t len) +{ + assert(buf != 0); + assert(len >= 0); + return len == 0 + ? 0 /* nothing to do */ + : len < HASHLIB_GIL_MINSIZE + ? hmac_update_state_cond_lock(self, buf, len) + : hmac_update_state_with_lock(self, buf, len); +} + +/*[clinic input] +_hmac.HMAC.update + + msg as msgobj: object + +Update the HMAC object with the given message. +[clinic start generated code]*/ + +static PyObject * +_hmac_HMAC_update_impl(HMACObject *self, PyObject *msgobj) +/*[clinic end generated code: output=962134ada5e55985 input=7c0ea830efb03367]*/ +{ + Py_buffer msg; + GET_BUFFER_VIEW_OR_ERROUT(msgobj, &msg); + int rc = hmac_update_state(self, msg.buf, msg.len); + PyBuffer_Release(&msg); + return rc < 0 ? NULL : Py_None; +} + +/* + * Compute the HMAC-HASH digest from the internal HACL* state. + * + * At least 'self->digest_size' bytes should be available + * in the 'digest' pointed memory area. + * + * Return 0 on success; otherwise, set an exception and return -1 on failure. + * + * Note: this function may raise a MemoryError. + */ +static int +hmac_digest_compute_cond_lock(HMACObject *self, uint8_t *digest) +{ + assert(digest != NULL); + hacl_errno_t rc; + ENTER_HASHLIB(self); // conditionally acquire a lock + rc = Hacl_Streaming_HMAC_digest(self->state, digest, self->digest_size); + LEAVE_HASHLIB(self); + assert( + rc == Hacl_Streaming_Types_Success || + rc == Hacl_Streaming_Types_OutOfMemory + ); + return _hacl_convert_errno(rc, NULL); +} + +/*[clinic input] +_hmac.HMAC.digest + +Return the digest of the bytes passed to the update() method so far. + +This method may raise a MemoryError. +[clinic start generated code]*/ + +static PyObject * +_hmac_HMAC_digest_impl(HMACObject *self) +/*[clinic end generated code: output=5bf3cc5862d26ada input=a70feb0b8e2bbe7d]*/ +{ + assert(self->digest_size <= Py_hmac_hash_max_digest_size); + uint8_t digest[Py_hmac_hash_max_digest_size]; + if (hmac_digest_compute_cond_lock(self, digest) < 0) { + return NULL; + } + return PyBytes_FromStringAndSize((const char *)digest, self->digest_size); +} + +/*[clinic input] +_hmac.HMAC.hexdigest + +Return hexadecimal digest of the bytes passed to the update() method so far. + +This may be used to exchange the value safely in email or other non-binary +environments. + +This method may raise a MemoryError. +[clinic start generated code]*/ + +static PyObject * +_hmac_HMAC_hexdigest_impl(HMACObject *self) +/*[clinic end generated code: output=6659807a09ae14ec input=493b2db8013982b9]*/ +{ + assert(self->digest_size <= Py_hmac_hash_max_digest_size); + uint8_t digest[Py_hmac_hash_max_digest_size]; + if (hmac_digest_compute_cond_lock(self, digest) < 0) { + return NULL; + } + return _Py_strhex((const char *)digest, self->digest_size); +} + +/*[clinic input] +@getter +_hmac.HMAC.name +[clinic start generated code]*/ + +static PyObject * +_hmac_HMAC_name_get_impl(HMACObject *self) +/*[clinic end generated code: output=ae693f09778d96d9 input=41c2c5dd1cf47fbc]*/ +{ + assert(self->name != NULL); + return PyUnicode_FromFormat("hmac-%U", self->name); +} + +/*[clinic input] +@getter +_hmac.HMAC.block_size +[clinic start generated code]*/ + +static PyObject * +_hmac_HMAC_block_size_get_impl(HMACObject *self) +/*[clinic end generated code: output=52cb11dee4e80cae input=9dda6b8d43e995b4]*/ +{ + return PyLong_FromUInt32(self->block_size); +} + +/*[clinic input] +@getter +_hmac.HMAC.digest_size +[clinic start generated code]*/ + +static PyObject * +_hmac_HMAC_digest_size_get_impl(HMACObject *self) +/*[clinic end generated code: output=22eeca1010ac6255 input=5622bb2840025b5a]*/ +{ + return PyLong_FromUInt32(self->digest_size); +} + +static PyObject * +HMACObject_repr(PyObject *op) +{ + HMACObject *self = HMACObject_CAST(op); + assert(self->name != NULL); + return PyUnicode_FromFormat("<%U HMAC object @ %p>", self->name, self); +} + +static int +HMACObject_clear(PyObject *op) +{ + HMACObject *self = HMACObject_CAST(op); + Py_CLEAR(self->name); + _hacl_hmac_state_free(self->state); + self->state = NULL; + return 0; +} + +static void +HMACObject_dealloc(PyObject *op) +{ + PyTypeObject *type = Py_TYPE(op); + PyObject_GC_UnTrack(op); + (void)HMACObject_clear(op); + type->tp_free(op); + Py_DECREF(type); +} + +static int +HMACObject_traverse(PyObject *op, visitproc visit, void *arg) +{ + Py_VISIT(Py_TYPE(op)); + return 0; +} + +static PyMethodDef HMACObject_methods[] = { + _HMAC_HMAC_COPY_METHODDEF + _HMAC_HMAC_UPDATE_METHODDEF + _HMAC_HMAC_DIGEST_METHODDEF + _HMAC_HMAC_HEXDIGEST_METHODDEF + {NULL, NULL, 0, NULL} /* sentinel */ +}; + +static PyGetSetDef HMACObject_getsets[] = { + _HMAC_HMAC_NAME_GETSETDEF + _HMAC_HMAC_BLOCK_SIZE_GETSETDEF + _HMAC_HMAC_DIGEST_SIZE_GETSETDEF + {NULL, NULL, NULL, NULL, NULL} /* sentinel */ +}; + +static PyType_Slot HMACObject_Type_slots[] = { + {Py_tp_repr, HMACObject_repr}, + {Py_tp_methods, HMACObject_methods}, + {Py_tp_getset, HMACObject_getsets}, + {Py_tp_clear, HMACObject_clear}, + {Py_tp_dealloc, HMACObject_dealloc}, + {Py_tp_traverse, HMACObject_traverse}, + {0, NULL} /* sentinel */ +}; + +static PyType_Spec HMAC_Type_spec = { + .name = "_hmac.HMAC", + .basicsize = sizeof(HMACObject), + .flags = Py_TPFLAGS_DEFAULT + | Py_TPFLAGS_DISALLOW_INSTANTIATION + | Py_TPFLAGS_HEAPTYPE + | Py_TPFLAGS_IMMUTABLETYPE + | Py_TPFLAGS_HAVE_GC, + .slots = HMACObject_Type_slots, +}; + +// --- One-shot HMAC-HASH interface ------------------------------------------- + +/*[clinic input] +_hmac.compute_digest + + key: object + msg: object + digest: object + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_digest_impl(PyObject *module, PyObject *key, PyObject *msg, + PyObject *digest) +/*[clinic end generated code: output=c519b7c4c9f57333 input=1c2bfc2cd8598574]*/ +{ + hmacmodule_state *state = get_hmacmodule_state(module); + const py_hmac_hinfo *info = find_hash_info(state, digest); + if (info == NULL) { + return NULL; + } + assert(info->api.compute_py != NULL); + return info->api.compute_py(module, key, msg); +} + +/* + * One-shot HMAC-HASH using the given HACL_HID. + * + * The length of the key and message buffers must not exceed UINT32_MAX, + * lest an OverflowError is raised. The Python implementation takes care + * of dispatching to the OpenSSL implementation in this case. + */ +#define Py_HMAC_HACL_ONESHOT(HACL_HID, KEY, MSG) \ + do { \ + Py_buffer keyview, msgview; \ + GET_BUFFER_VIEW_OR_ERROUT((KEY), &keyview); \ + if (!has_uint32_t_buffer_length(&keyview)) { \ + PyBuffer_Release(&keyview); \ + PyErr_SetString(PyExc_OverflowError, INVALID_KEY_LENGTH); \ + return NULL; \ + } \ + GET_BUFFER_VIEW_OR_ERROR((MSG), &msgview, \ + PyBuffer_Release(&keyview); \ + return NULL); \ + if (!has_uint32_t_buffer_length(&msgview)) { \ + PyBuffer_Release(&msgview); \ + PyBuffer_Release(&keyview); \ + PyErr_SetString(PyExc_OverflowError, INVALID_MSG_LENGTH); \ + return NULL; \ + } \ + uint8_t out[Py_hmac_## HACL_HID ##_digest_size]; \ + Py_hmac_## HACL_HID ##_compute_func( \ + out, \ + (uint8_t *)keyview.buf, (uint32_t)keyview.len, \ + (uint8_t *)msgview.buf, (uint32_t)msgview.len \ + ); \ + PyBuffer_Release(&msgview); \ + PyBuffer_Release(&keyview); \ + return PyBytes_FromStringAndSize( \ + (const char *)out, \ + Py_hmac_## HACL_HID ##_digest_size \ + ); \ + } while (0) + +/*[clinic input] +_hmac.compute_md5 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_md5_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=7837a4ceccbbf636 input=77a4b774c7d61218]*/ +{ + Py_HMAC_HACL_ONESHOT(md5, key, msg); +} + +/*[clinic input] +_hmac.compute_sha1 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_sha1_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=79fd7689c83691d8 input=3b64dccc6bdbe4ba]*/ +{ + Py_HMAC_HACL_ONESHOT(sha1, key, msg); +} + +/*[clinic input] +_hmac.compute_sha224 as _hmac_compute_sha2_224 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_sha2_224_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=7f21f1613e53979e input=a1a75f25f23449af]*/ +{ + Py_HMAC_HACL_ONESHOT(sha2_224, key, msg); +} + +/*[clinic input] +_hmac.compute_sha256 as _hmac_compute_sha2_256 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_sha2_256_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=d4a291f7d9a82459 input=5c9ccf2df048ace3]*/ +{ + Py_HMAC_HACL_ONESHOT(sha2_256, key, msg); +} + +/*[clinic input] +_hmac.compute_sha384 as _hmac_compute_sha2_384 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_sha2_384_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=f211fa26e3700c27 input=2fee2c14766af231]*/ +{ + Py_HMAC_HACL_ONESHOT(sha2_384, key, msg); +} + +/*[clinic input] +_hmac.compute_sha512 as _hmac_compute_sha2_512 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_sha2_512_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=d5c20373762cecca input=3371eaac315c7864]*/ +{ + Py_HMAC_HACL_ONESHOT(sha2_512, key, msg); +} + +/*[clinic input] +_hmac.compute_sha3_224 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_sha3_224_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=a242ccac9ad9c22b input=d0ab0c7d189c3d87]*/ +{ + Py_HMAC_HACL_ONESHOT(sha3_224, key, msg); +} + +/*[clinic input] +_hmac.compute_sha3_256 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_sha3_256_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=b539dbb61af2fe0b input=f05d7b6364b35d02]*/ +{ + Py_HMAC_HACL_ONESHOT(sha3_256, key, msg); +} + +/*[clinic input] +_hmac.compute_sha3_384 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_sha3_384_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=5eb372fb5c4ffd3a input=d842d393e7aa05ae]*/ +{ + Py_HMAC_HACL_ONESHOT(sha3_384, key, msg); +} + +/*[clinic input] +_hmac.compute_sha3_512 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_sha3_512_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=154bcbf8c2eacac1 input=166fe5baaeaabfde]*/ +{ + Py_HMAC_HACL_ONESHOT(sha3_512, key, msg); +} + +/*[clinic input] +_hmac.compute_blake2s_32 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_blake2s_32_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=cfc730791bc62361 input=d22c36e7fe31a985]*/ +{ + Py_HMAC_HACL_ONESHOT(blake2s_32, key, msg); +} + +/*[clinic input] +_hmac.compute_blake2b_32 + + key: object + msg: object + / + +[clinic start generated code]*/ + +static PyObject * +_hmac_compute_blake2b_32_impl(PyObject *module, PyObject *key, PyObject *msg) +/*[clinic end generated code: output=765c5c4fb9124636 input=4a35ee058d172f4b]*/ +{ + Py_HMAC_HACL_ONESHOT(blake2b_32, key, msg); +} + +// --- HMAC module methods ---------------------------------------------------- + +static PyMethodDef hmacmodule_methods[] = { + _HMAC_NEW_METHODDEF + /* one-shot dispatcher */ + _HMAC_COMPUTE_DIGEST_METHODDEF + /* one-shot methods */ + _HMAC_COMPUTE_MD5_METHODDEF + _HMAC_COMPUTE_SHA1_METHODDEF + _HMAC_COMPUTE_SHA2_224_METHODDEF + _HMAC_COMPUTE_SHA2_256_METHODDEF + _HMAC_COMPUTE_SHA2_384_METHODDEF + _HMAC_COMPUTE_SHA2_512_METHODDEF + _HMAC_COMPUTE_SHA3_224_METHODDEF + _HMAC_COMPUTE_SHA3_256_METHODDEF + _HMAC_COMPUTE_SHA3_384_METHODDEF + _HMAC_COMPUTE_SHA3_512_METHODDEF + _HMAC_COMPUTE_BLAKE2S_32_METHODDEF + _HMAC_COMPUTE_BLAKE2B_32_METHODDEF + {NULL, NULL, 0, NULL} /* sentinel */ +}; + +// --- HMAC static information table ------------------------------------------ + +static inline Py_uhash_t +py_hmac_hinfo_ht_hash(const void *name) +{ + return Py_HashBuffer(name, strlen((const char *)name)); +} + +static inline int +py_hmac_hinfo_ht_comp(const void *a, const void *b) +{ + return strcmp((const char *)a, (const char *)b) == 0; +} + +static void +py_hmac_hinfo_ht_free(void *hinfo) +{ + py_hmac_hinfo *entry = (py_hmac_hinfo *)hinfo; + assert(entry->display_name != NULL); + if (--(entry->refcnt) == 0) { + Py_CLEAR(entry->display_name); + PyMem_Free(hinfo); + } +} + +/* + * Equivalent to table.setdefault(key, info). + * + * Return 1 if a new item has been created, 0 if 'key' is NULL or + * an entry 'table[key]' existed, and -1 if a memory error occurs. + * + * To reduce memory footprint, 'info' may be a borrowed reference, + * namely, multiple keys can be associated with the same 'info'. + * + * In particular, resources owned by 'info' must only be released + * when a single key associated with 'info' remains. + */ +static int +py_hmac_hinfo_ht_add(_Py_hashtable_t *table, const void *key, void *info) +{ + if (key == NULL || _Py_hashtable_get_entry(table, key) != NULL) { + return 0; + } + if (_Py_hashtable_set(table, key, info) < 0) { + assert(!PyErr_Occurred()); + PyErr_NoMemory(); + return -1; + } + return 1; +} + +/* + * Create a new hashtable from the static 'py_hmac_static_hinfo' object, + * or set an exception and return NULL if an error occurs. + */ +static _Py_hashtable_t * +py_hmac_hinfo_ht_new(void) +{ + _Py_hashtable_t *table = _Py_hashtable_new_full( + py_hmac_hinfo_ht_hash, + py_hmac_hinfo_ht_comp, + NULL, + py_hmac_hinfo_ht_free, + NULL + ); + + if (table == NULL) { + assert(!PyErr_Occurred()); + PyErr_NoMemory(); + return NULL; + } + + for (const py_hmac_hinfo *e = py_hmac_static_hinfo; e->name != NULL; e++) { + /* + * The real kind of a HMAC object is obtained only once and is + * derived from the kind of the 'py_hmac_hinfo' that could be + * found by its name. + * + * Since 'vectorized_blake2{s,b}_32' depend on the runtime CPUID + * features, we should not create 'py_hmac_hinfo' entries for them. + */ + assert_is_static_hmac_hash_kind(e->kind); + + py_hmac_hinfo *value = PyMem_Malloc(sizeof(py_hmac_hinfo)); + if (value == NULL) { + PyErr_NoMemory(); + goto error; + } + + memcpy(value, e, sizeof(py_hmac_hinfo)); + assert(value->display_name == NULL); + value->refcnt = 0; + +#define Py_HMAC_HINFO_LINK(KEY) \ + do { \ + int rc = py_hmac_hinfo_ht_add(table, KEY, value); \ + if (rc < 0) { \ + PyMem_Free(value); \ + goto error; \ + } \ + else if (rc == 1) { \ + value->refcnt++; \ + } \ + } while (0) + Py_HMAC_HINFO_LINK(e->name); + Py_HMAC_HINFO_LINK(e->hashlib_name); +#undef Py_HMAC_HINFO_LINK + assert(value->refcnt > 0); + assert(value->display_name == NULL); + value->display_name = PyUnicode_FromString( + /* display name is synchronized with hashlib's name */ + e->hashlib_name == NULL ? e->name : e->hashlib_name + ); + if (value->display_name == NULL) { + PyMem_Free(value); + goto error; + } + } + + return table; + +error: + _Py_hashtable_destroy(table); + return NULL; +} + +// --- HMAC module initialization and finalization functions ------------------ + +static int +hmacmodule_init_hash_info_table(hmacmodule_state *state) +{ + // py_hmac_hinfo_ht_new() sets an exception on error + state->hinfo_table = py_hmac_hinfo_ht_new(); + return state->hinfo_table == NULL ? -1 : 0; +} + +static int +hmacmodule_init_exceptions(PyObject *module, hmacmodule_state *state) +{ +#define ADD_EXC(ATTR, NAME, BASE) \ + do { \ + state->ATTR = PyErr_NewException("_hmac." NAME, BASE, NULL); \ + if (state->ATTR == NULL) { \ + return -1; \ + } \ + if (PyModule_AddObjectRef(module, NAME, state->ATTR) < 0) { \ + return -1; \ + } \ + } while (0) + ADD_EXC(unknown_hash_error, "UnknownHashError", PyExc_ValueError); +#undef ADD_EXC + return 0; +} + +static int +hmacmodule_init_hmac_type(PyObject *module, hmacmodule_state *state) +{ + state->hmac_type = (PyTypeObject *)PyType_FromModuleAndSpec(module, + &HMAC_Type_spec, + NULL); + if (state->hmac_type == NULL) { + return -1; + } + if (PyModule_AddType(module, state->hmac_type) < 0) { + return -1; + } + return 0; +} + +static int +hmacmodule_init_strings(hmacmodule_state *state) +{ +#define ADD_STR(ATTR, STRING) \ + do { \ + state->ATTR = PyUnicode_FromString(STRING); \ + if (state->ATTR == NULL) { \ + return -1; \ + } \ + } while (0) + ADD_STR(str_lower, "lower"); +#undef ADD_STR + return 0; +} + +static void +hmacmodule_init_cpu_features(hmacmodule_state *state) +{ +#if HACL_CAN_COMPILE_SIMD128 + // TODO: use py_cpuid_features (gh-125022) to deduce what we want + state->can_run_simd128 = false; +#else + state->can_run_simd128 = false; +#endif + +#if HACL_CAN_COMPILE_SIMD256 + // TODO: use py_cpuid_features (gh-125022) to deduce what we want + state->can_run_simd256 = false; +#else + state->can_run_simd256 = false; +#endif +} + +static int +hmacmodule_exec(PyObject *module) +{ + hmacmodule_state *state = get_hmacmodule_state(module); + if (hmacmodule_init_hash_info_table(state) < 0) { + return -1; + } + if (hmacmodule_init_exceptions(module, state) < 0) { + return -1; + } + if (hmacmodule_init_hmac_type(module, state) < 0) { + return -1; + } + if (hmacmodule_init_strings(state) < 0) { + return -1; + } + hmacmodule_init_cpu_features(state); + return 0; +} + +static int +hmacmodule_traverse(PyObject *mod, visitproc visit, void *arg) +{ + Py_VISIT(Py_TYPE(mod)); + hmacmodule_state *state = get_hmacmodule_state(mod); + Py_VISIT(state->unknown_hash_error); + Py_VISIT(state->hmac_type); + Py_VISIT(state->str_lower); + return 0; +} + +static int +hmacmodule_clear(PyObject *mod) +{ + hmacmodule_state *state = get_hmacmodule_state(mod); + if (state->hinfo_table != NULL) { + _Py_hashtable_destroy(state->hinfo_table); + state->hinfo_table = NULL; + } + Py_CLEAR(state->unknown_hash_error); + Py_CLEAR(state->hmac_type); + Py_CLEAR(state->str_lower); + return 0; +} + +static inline void +hmacmodule_free(void *mod) +{ + (void)hmacmodule_clear((PyObject *)mod); +} + +static struct PyModuleDef_Slot hmacmodule_slots[] = { + {Py_mod_exec, hmacmodule_exec}, + {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED}, + {Py_mod_gil, Py_MOD_GIL_NOT_USED}, + {0, NULL} /* sentinel */ +}; + +static struct PyModuleDef _hmacmodule = { + PyModuleDef_HEAD_INIT, + .m_name = "_hmac", + .m_size = sizeof(hmacmodule_state), + .m_methods = hmacmodule_methods, + .m_slots = hmacmodule_slots, + .m_traverse = hmacmodule_traverse, + .m_clear = hmacmodule_clear, + .m_free = hmacmodule_free, +}; + +PyMODINIT_FUNC +PyInit__hmac(void) +{ + return PyModuleDef_Init(&_hmacmodule); +} diff --git a/PC/config.c b/PC/config.c index 873f93063057dc..5c6f37ccf21896 100644 --- a/PC/config.c +++ b/PC/config.c @@ -14,19 +14,24 @@ extern PyObject* PyInit_faulthandler(void); extern PyObject* PyInit__tracemalloc(void); extern PyObject* PyInit_gc(void); extern PyObject* PyInit_math(void); -extern PyObject* PyInit__md5(void); extern PyObject* PyInit_nt(void); extern PyObject* PyInit__operator(void); extern PyObject* PyInit__signal(void); -extern PyObject* PyInit__sha1(void); -extern PyObject* PyInit__sha2(void); -extern PyObject* PyInit__sha3(void); extern PyObject* PyInit__statistics(void); extern PyObject* PyInit__sysconfig(void); extern PyObject* PyInit__typing(void); -extern PyObject* PyInit__blake2(void); extern PyObject* PyInit_time(void); extern PyObject* PyInit__thread(void); + +/* cryptographic hash functions */ +extern PyObject* PyInit__blake2(void); +extern PyObject* PyInit__md5(void); +extern PyObject* PyInit__sha1(void); +extern PyObject* PyInit__sha2(void); +extern PyObject* PyInit__sha3(void); +/* other cryptographic primitives */ +extern PyObject* PyInit__hmac(void); + #ifdef WIN32 extern PyObject* PyInit_msvcrt(void); extern PyObject* PyInit__locale(void); @@ -98,17 +103,22 @@ struct _inittab _PyImport_Inittab[] = { {"nt", PyInit_nt}, /* Use the NT os functions, not posix */ {"_operator", PyInit__operator}, {"_signal", PyInit__signal}, - {"_md5", PyInit__md5}, - {"_sha1", PyInit__sha1}, - {"_sha2", PyInit__sha2}, - {"_sha3", PyInit__sha3}, - {"_blake2", PyInit__blake2}, {"_sysconfig", PyInit__sysconfig}, {"time", PyInit_time}, {"_thread", PyInit__thread}, {"_tokenize", PyInit__tokenize}, {"_typing", PyInit__typing}, {"_statistics", PyInit__statistics}, + + /* cryptographic hash functions */ + {"_blake2", PyInit__blake2}, + {"_md5", PyInit__md5}, + {"_sha1", PyInit__sha1}, + {"_sha2", PyInit__sha2}, + {"_sha3", PyInit__sha3}, + /* other cryptographic primitives */ + {"_hmac", PyInit__hmac}, + #ifdef WIN32 {"msvcrt", PyInit_msvcrt}, {"_locale", PyInit__locale}, diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 009e4f2302e311..27c50fa53dab87 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -428,6 +428,8 @@ + + @@ -464,6 +466,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 134212662ab379..617165b576e362 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -959,6 +959,12 @@ Modules + + Modules + + + Modules + Modules @@ -1013,6 +1019,9 @@ Modules + + Modules + Modules @@ -1028,6 +1037,9 @@ Modules + + Modules + Modules diff --git a/Python/stdlib_module_names.h b/Python/stdlib_module_names.h index ec8976277aad4c..29dd5c1df0f23a 100644 --- a/Python/stdlib_module_names.h +++ b/Python/stdlib_module_names.h @@ -40,6 +40,7 @@ static const char* _Py_stdlib_module_names[] = { "_gdbm", "_hashlib", "_heapq", +"_hmac", "_imp", "_interpchannels", "_interpqueues", diff --git a/Tools/c-analyzer/cpython/_parser.py b/Tools/c-analyzer/cpython/_parser.py index a08b32fa45db3e..037fe11ea223c7 100644 --- a/Tools/c-analyzer/cpython/_parser.py +++ b/Tools/c-analyzer/cpython/_parser.py @@ -126,6 +126,7 @@ def clean_lines(text): Modules/sha2module.c Modules/_hacl/include Modules/sha3module.c Modules/_hacl/include Modules/blake2module.c Modules/_hacl/include +Modules/hmacmodule.c Modules/_hacl/include Objects/stringlib/*.h Objects # possible system-installed headers, just in case diff --git a/Tools/c-analyzer/cpython/ignored.tsv b/Tools/c-analyzer/cpython/ignored.tsv index 9b624d809879ff..18e543ab33bb16 100644 --- a/Tools/c-analyzer/cpython/ignored.tsv +++ b/Tools/c-analyzer/cpython/ignored.tsv @@ -308,6 +308,7 @@ Modules/cmathmodule.c - tanh_special_values - Modules/config.c - _PyImport_Inittab - Modules/faulthandler.c - faulthandler_handlers - Modules/getnameinfo.c - gni_afdl - +Modules/hmacmodule.c - py_hmac_static_hinfo - Modules/posixmodule.c os_getxattr_impl buffer_sizes - Modules/posixmodule.c os_listxattr_impl buffer_sizes - Modules/posixmodule.c - posix_constants_confstr - diff --git a/configure b/configure index d7153914fe7b5e..49de2f5db55e71 100755 --- a/configure +++ b/configure @@ -706,6 +706,8 @@ MODULE__CURSES_FALSE MODULE__CURSES_TRUE MODULE__CTYPES_FALSE MODULE__CTYPES_TRUE +MODULE__HMAC_FALSE +MODULE__HMAC_TRUE LIBHACL_SIMD256_OBJS LIBHACL_SIMD256_FLAGS LIBHACL_SIMD128_OBJS @@ -32267,6 +32269,47 @@ fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module _hmac" >&5 +printf %s "checking for stdlib extension module _hmac... " >&6; } + if test "$py_cv_module__hmac" != "n/a" +then : + + if true +then : + if true +then : + py_cv_module__hmac=yes +else case e in #( + e) py_cv_module__hmac=missing ;; +esac +fi +else case e in #( + e) py_cv_module__hmac=disabled ;; +esac +fi + +fi + as_fn_append MODULE_BLOCK "MODULE__HMAC_STATE=$py_cv_module__hmac$as_nl" + if test "x$py_cv_module__hmac" = xyes +then : + + as_fn_append MODULE_BLOCK "MODULE__HMAC_CFLAGS=$LIBHACL_CFLAGS$as_nl" + as_fn_append MODULE_BLOCK "MODULE__HMAC_LDFLAGS=$LIBHACL_CFLAGS Modules/_hacl/libHacl_HMAC.a$as_nl" + +fi + if test "$py_cv_module__hmac" = yes; then + MODULE__HMAC_TRUE= + MODULE__HMAC_FALSE='#' +else + MODULE__HMAC_TRUE='#' + MODULE__HMAC_FALSE= +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $py_cv_module__hmac" >&5 +printf "%s\n" "$py_cv_module__hmac" >&6; } + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module _ctypes" >&5 printf %s "checking for stdlib extension module _ctypes... " >&6; } if test "$py_cv_module__ctypes" != "n/a" @@ -33820,6 +33863,10 @@ if test -z "${MODULE__BLAKE2_TRUE}" && test -z "${MODULE__BLAKE2_FALSE}"; then as_fn_error $? "conditional \"MODULE__BLAKE2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${MODULE__HMAC_TRUE}" && test -z "${MODULE__HMAC_FALSE}"; then + as_fn_error $? "conditional \"MODULE__HMAC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${MODULE__CTYPES_TRUE}" && test -z "${MODULE__CTYPES_FALSE}"; then as_fn_error $? "conditional \"MODULE__CTYPES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/configure.ac b/configure.ac index 4e24930662c1f8..ac86a1f847e675 100644 --- a/configure.ac +++ b/configure.ac @@ -7920,6 +7920,13 @@ fi AC_SUBST([LIBHACL_SIMD256_FLAGS]) AC_SUBST([LIBHACL_SIMD256_OBJS]) +dnl HMAC builtin library does not need OpenSSL for now. In the future +dnl we might want to rely on OpenSSL EVP/NID interface or implement +dnl our own for algorithm resolution. +PY_STDLIB_MOD([_hmac], [], [], + [$LIBHACL_CFLAGS], + [$LIBHACL_CFLAGS Modules/_hacl/libHacl_HMAC.a]) + PY_STDLIB_MOD([_ctypes], [], [test "$have_libffi" = yes], [$NO_STRICT_OVERFLOW_CFLAGS $LIBFFI_CFLAGS], [$LIBFFI_LIBS]) From 65c64bc4809b3a996fe05fd5addba8629df1ba8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sat, 5 Apr 2025 11:35:28 +0200 Subject: [PATCH 12/12] check arguments given to the 'disable' directive --- Tools/clinic/libclinic/dsl_parser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tools/clinic/libclinic/dsl_parser.py b/Tools/clinic/libclinic/dsl_parser.py index b5d04edf247c0d..282ff64cd33089 100644 --- a/Tools/clinic/libclinic/dsl_parser.py +++ b/Tools/clinic/libclinic/dsl_parser.py @@ -430,7 +430,12 @@ def at_disable(self, *args: str) -> None: fail("Can't set @disable, function is not a normal callable") if not args: fail("@disable expects at least one argument") - self.disable_fastcall = 'fastcall' in args + features = list(args) + if 'fastcall' in features: + features.remove('fastcall') + self.disable_fastcall = True + if features: + fail("invalid argument for @disable:", features[0]) def at_getter(self) -> None: match self.kind: