summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-11-27 11:27:31 (GMT)
committerGitHub <noreply@github.com>2018-11-27 11:27:31 (GMT)
commit62be74290aca26d16f3f55ece7ff6dad14e60e8d (patch)
tree656625bee7ca61fd87c6370407162522d8fb277f /Modules
parent81524022d0c0df7a41f9b2b2df41e2ebe140e610 (diff)
downloadcpython-62be74290aca26d16f3f55ece7ff6dad14e60e8d.zip
cpython-62be74290aca26d16f3f55ece7ff6dad14e60e8d.tar.gz
cpython-62be74290aca26d16f3f55ece7ff6dad14e60e8d.tar.bz2
bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)
Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_bisectmodule.c8
-rw-r--r--Modules/_collectionsmodule.c6
-rw-r--r--Modules/_csv.c6
-rw-r--r--Modules/_datetimemodule.c20
-rw-r--r--Modules/_decimal/_decimal.c76
-rw-r--r--Modules/_elementtree.c2
-rw-r--r--Modules/_functoolsmodule.c2
-rw-r--r--Modules/_hashopenssl.c6
-rw-r--r--Modules/_lsprof.c2
-rw-r--r--Modules/_multiprocessing/semaphore.c4
-rw-r--r--Modules/_sqlite/connection.c14
-rw-r--r--Modules/_sqlite/cursor.c2
-rw-r--r--Modules/_sqlite/module.c6
-rw-r--r--Modules/_struct.c8
-rw-r--r--Modules/_testbuffer.c2
-rw-r--r--Modules/_testcapimodule.c14
-rw-r--r--Modules/_threadmodule.c10
-rw-r--r--Modules/_xxsubinterpretersmodule.c20
-rw-r--r--Modules/atexitmodule.c2
-rw-r--r--Modules/faulthandler.c10
-rw-r--r--Modules/nismodule.c6
-rw-r--r--Modules/parsermodule.c28
-rw-r--r--Modules/posixmodule.c2
-rw-r--r--Modules/signalmodule.c2
-rw-r--r--Modules/socketmodule.c8
-rw-r--r--Modules/syslogmodule.c2
-rw-r--r--Modules/xxsubtype.c4
27 files changed, 136 insertions, 136 deletions
diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c
index 7dd73f9..461a11f 100644
--- a/Modules/_bisectmodule.c
+++ b/Modules/_bisectmodule.c
@@ -241,13 +241,13 @@ Optional args lo (default 0) and hi (default len(a)) bound the\n\
slice of a to be searched.\n");
static PyMethodDef bisect_methods[] = {
- {"bisect_right", (PyCFunction)bisect_right,
+ {"bisect_right", (PyCFunction)(void(*)(void))bisect_right,
METH_VARARGS|METH_KEYWORDS, bisect_right_doc},
- {"insort_right", (PyCFunction)insort_right,
+ {"insort_right", (PyCFunction)(void(*)(void))insort_right,
METH_VARARGS|METH_KEYWORDS, insort_right_doc},
- {"bisect_left", (PyCFunction)bisect_left,
+ {"bisect_left", (PyCFunction)(void(*)(void))bisect_left,
METH_VARARGS|METH_KEYWORDS, bisect_left_doc},
- {"insort_left", (PyCFunction)insort_left,
+ {"insort_left", (PyCFunction)(void(*)(void))insort_left,
METH_VARARGS|METH_KEYWORDS, insort_left_doc},
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index a495e5f..1ad4a03 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -1573,9 +1573,9 @@ static PyMethodDef deque_methods[] = {
METH_O, extend_doc},
{"extendleft", (PyCFunction)deque_extendleft,
METH_O, extendleft_doc},
- {"index", (PyCFunction)deque_index,
+ {"index", (PyCFunction)(void(*)(void))deque_index,
METH_FASTCALL, index_doc},
- {"insert", (PyCFunction)deque_insert,
+ {"insert", (PyCFunction)(void(*)(void))deque_insert,
METH_FASTCALL, insert_doc},
{"pop", (PyCFunction)deque_pop,
METH_NOARGS, pop_doc},
@@ -1589,7 +1589,7 @@ static PyMethodDef deque_methods[] = {
METH_NOARGS, reversed_doc},
{"reverse", (PyCFunction)deque_reverse,
METH_NOARGS, reverse_doc},
- {"rotate", (PyCFunction)deque_rotate,
+ {"rotate", (PyCFunction)(void(*)(void))deque_rotate,
METH_FASTCALL, rotate_doc},
{"__sizeof__", (PyCFunction)deque_sizeof,
METH_NOARGS, sizeof_doc},
diff --git a/Modules/_csv.c b/Modules/_csv.c
index 4cc1f7c..b4e92de 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -1583,13 +1583,13 @@ PyDoc_STRVAR(csv_field_size_limit_doc,
"the old limit is returned");
static struct PyMethodDef csv_methods[] = {
- { "reader", (PyCFunction)csv_reader,
+ { "reader", (PyCFunction)(void(*)(void))csv_reader,
METH_VARARGS | METH_KEYWORDS, csv_reader_doc},
- { "writer", (PyCFunction)csv_writer,
+ { "writer", (PyCFunction)(void(*)(void))csv_writer,
METH_VARARGS | METH_KEYWORDS, csv_writer_doc},
{ "list_dialects", (PyCFunction)csv_list_dialects,
METH_NOARGS, csv_list_dialects_doc},
- { "register_dialect", (PyCFunction)csv_register_dialect,
+ { "register_dialect", (PyCFunction)(void(*)(void))csv_register_dialect,
METH_VARARGS | METH_KEYWORDS, csv_register_dialect_doc},
{ "unregister_dialect", (PyCFunction)csv_unregister_dialect,
METH_O, csv_unregister_dialect_doc},
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 0054ea8..eb9c35d 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -3255,7 +3255,7 @@ static PyMethodDef date_methods[] = {
{"ctime", (PyCFunction)date_ctime, METH_NOARGS,
PyDoc_STR("Return ctime() style string.")},
- {"strftime", (PyCFunction)date_strftime, METH_VARARGS | METH_KEYWORDS,
+ {"strftime", (PyCFunction)(void(*)(void))date_strftime, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("format -> strftime() style string.")},
{"__format__", (PyCFunction)date_format, METH_VARARGS,
@@ -3283,7 +3283,7 @@ static PyMethodDef date_methods[] = {
PyDoc_STR("Return the day of the week represented by the date.\n"
"Monday == 0 ... Sunday == 6")},
- {"replace", (PyCFunction)date_replace, METH_VARARGS | METH_KEYWORDS,
+ {"replace", (PyCFunction)(void(*)(void))date_replace, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("Return date with new specified fields.")},
{"__reduce__", (PyCFunction)date_reduce, METH_NOARGS,
@@ -4392,12 +4392,12 @@ time_reduce(PyDateTime_Time *self, PyObject *arg)
static PyMethodDef time_methods[] = {
- {"isoformat", (PyCFunction)time_isoformat, METH_VARARGS | METH_KEYWORDS,
+ {"isoformat", (PyCFunction)(void(*)(void))time_isoformat, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("Return string in ISO 8601 format, [HH[:MM[:SS[.mmm[uuu]]]]]"
"[+HH:MM].\n\n"
"timespec specifies what components of the time to include.\n")},
- {"strftime", (PyCFunction)time_strftime, METH_VARARGS | METH_KEYWORDS,
+ {"strftime", (PyCFunction)(void(*)(void))time_strftime, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("format -> strftime() style string.")},
{"__format__", (PyCFunction)date_format, METH_VARARGS,
@@ -4412,7 +4412,7 @@ static PyMethodDef time_methods[] = {
{"dst", (PyCFunction)time_dst, METH_NOARGS,
PyDoc_STR("Return self.tzinfo.dst(self).")},
- {"replace", (PyCFunction)time_replace, METH_VARARGS | METH_KEYWORDS,
+ {"replace", (PyCFunction)(void(*)(void))time_replace, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("Return time with new specified fields.")},
{"fromisoformat", (PyCFunction)time_fromisoformat, METH_O | METH_CLASS,
@@ -6025,7 +6025,7 @@ static PyMethodDef datetime_methods[] = {
METH_NOARGS | METH_CLASS,
PyDoc_STR("Return a new datetime representing UTC day and time.")},
- {"fromtimestamp", (PyCFunction)datetime_fromtimestamp,
+ {"fromtimestamp", (PyCFunction)(void(*)(void))datetime_fromtimestamp,
METH_VARARGS | METH_KEYWORDS | METH_CLASS,
PyDoc_STR("timestamp[, tz] -> tz's local time from POSIX timestamp.")},
@@ -6038,7 +6038,7 @@ static PyMethodDef datetime_methods[] = {
PyDoc_STR("string, format -> new datetime parsed from a string "
"(like time.strptime()).")},
- {"combine", (PyCFunction)datetime_combine,
+ {"combine", (PyCFunction)(void(*)(void))datetime_combine,
METH_VARARGS | METH_KEYWORDS | METH_CLASS,
PyDoc_STR("date, time -> datetime with same date and time fields")},
@@ -6069,7 +6069,7 @@ static PyMethodDef datetime_methods[] = {
{"utctimetuple", (PyCFunction)datetime_utctimetuple, METH_NOARGS,
PyDoc_STR("Return UTC time tuple, compatible with time.localtime().")},
- {"isoformat", (PyCFunction)datetime_isoformat, METH_VARARGS | METH_KEYWORDS,
+ {"isoformat", (PyCFunction)(void(*)(void))datetime_isoformat, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("[sep] -> string in ISO 8601 format, "
"YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\n"
"sep is used to separate the year from the time, and "
@@ -6087,10 +6087,10 @@ static PyMethodDef datetime_methods[] = {
{"dst", (PyCFunction)datetime_dst, METH_NOARGS,
PyDoc_STR("Return self.tzinfo.dst(self).")},
- {"replace", (PyCFunction)datetime_replace, METH_VARARGS | METH_KEYWORDS,
+ {"replace", (PyCFunction)(void(*)(void))datetime_replace, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("Return datetime with new specified fields.")},
- {"astimezone", (PyCFunction)datetime_astimezone, METH_VARARGS | METH_KEYWORDS,
+ {"astimezone", (PyCFunction)(void(*)(void))datetime_astimezone, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("tz -> convert to local time in new timezone tz\n")},
{"__reduce_ex__", (PyCFunction)datetime_reduce_ex, METH_VARARGS,
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index 1e58d3d..51aed2c 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -4598,30 +4598,30 @@ static PyNumberMethods dec_number_methods =
static PyMethodDef dec_methods [] =
{
/* Unary arithmetic functions, optional context arg */
- { "exp", (PyCFunction)dec_mpd_qexp, METH_VARARGS|METH_KEYWORDS, doc_exp },
- { "ln", (PyCFunction)dec_mpd_qln, METH_VARARGS|METH_KEYWORDS, doc_ln },
- { "log10", (PyCFunction)dec_mpd_qlog10, METH_VARARGS|METH_KEYWORDS, doc_log10 },
- { "next_minus", (PyCFunction)dec_mpd_qnext_minus, METH_VARARGS|METH_KEYWORDS, doc_next_minus },
- { "next_plus", (PyCFunction)dec_mpd_qnext_plus, METH_VARARGS|METH_KEYWORDS, doc_next_plus },
- { "normalize", (PyCFunction)dec_mpd_qreduce, METH_VARARGS|METH_KEYWORDS, doc_normalize },
- { "to_integral", (PyCFunction)PyDec_ToIntegralValue, METH_VARARGS|METH_KEYWORDS, doc_to_integral },
- { "to_integral_exact", (PyCFunction)PyDec_ToIntegralExact, METH_VARARGS|METH_KEYWORDS, doc_to_integral_exact },
- { "to_integral_value", (PyCFunction)PyDec_ToIntegralValue, METH_VARARGS|METH_KEYWORDS, doc_to_integral_value },
- { "sqrt", (PyCFunction)dec_mpd_qsqrt, METH_VARARGS|METH_KEYWORDS, doc_sqrt },
+ { "exp", (PyCFunction)(void(*)(void))dec_mpd_qexp, METH_VARARGS|METH_KEYWORDS, doc_exp },
+ { "ln", (PyCFunction)(void(*)(void))dec_mpd_qln, METH_VARARGS|METH_KEYWORDS, doc_ln },
+ { "log10", (PyCFunction)(void(*)(void))dec_mpd_qlog10, METH_VARARGS|METH_KEYWORDS, doc_log10 },
+ { "next_minus", (PyCFunction)(void(*)(void))dec_mpd_qnext_minus, METH_VARARGS|METH_KEYWORDS, doc_next_minus },
+ { "next_plus", (PyCFunction)(void(*)(void))dec_mpd_qnext_plus, METH_VARARGS|METH_KEYWORDS, doc_next_plus },
+ { "normalize", (PyCFunction)(void(*)(void))dec_mpd_qreduce, METH_VARARGS|METH_KEYWORDS, doc_normalize },
+ { "to_integral", (PyCFunction)(void(*)(void))PyDec_ToIntegralValue, METH_VARARGS|METH_KEYWORDS, doc_to_integral },
+ { "to_integral_exact", (PyCFunction)(void(*)(void))PyDec_ToIntegralExact, METH_VARARGS|METH_KEYWORDS, doc_to_integral_exact },
+ { "to_integral_value", (PyCFunction)(void(*)(void))PyDec_ToIntegralValue, METH_VARARGS|METH_KEYWORDS, doc_to_integral_value },
+ { "sqrt", (PyCFunction)(void(*)(void))dec_mpd_qsqrt, METH_VARARGS|METH_KEYWORDS, doc_sqrt },
/* Binary arithmetic functions, optional context arg */
- { "compare", (PyCFunction)dec_mpd_qcompare, METH_VARARGS|METH_KEYWORDS, doc_compare },
- { "compare_signal", (PyCFunction)dec_mpd_qcompare_signal, METH_VARARGS|METH_KEYWORDS, doc_compare_signal },
- { "max", (PyCFunction)dec_mpd_qmax, METH_VARARGS|METH_KEYWORDS, doc_max },
- { "max_mag", (PyCFunction)dec_mpd_qmax_mag, METH_VARARGS|METH_KEYWORDS, doc_max_mag },
- { "min", (PyCFunction)dec_mpd_qmin, METH_VARARGS|METH_KEYWORDS, doc_min },
- { "min_mag", (PyCFunction)dec_mpd_qmin_mag, METH_VARARGS|METH_KEYWORDS, doc_min_mag },
- { "next_toward", (PyCFunction)dec_mpd_qnext_toward, METH_VARARGS|METH_KEYWORDS, doc_next_toward },
- { "quantize", (PyCFunction)dec_mpd_qquantize, METH_VARARGS|METH_KEYWORDS, doc_quantize },
- { "remainder_near", (PyCFunction)dec_mpd_qrem_near, METH_VARARGS|METH_KEYWORDS, doc_remainder_near },
+ { "compare", (PyCFunction)(void(*)(void))dec_mpd_qcompare, METH_VARARGS|METH_KEYWORDS, doc_compare },
+ { "compare_signal", (PyCFunction)(void(*)(void))dec_mpd_qcompare_signal, METH_VARARGS|METH_KEYWORDS, doc_compare_signal },
+ { "max", (PyCFunction)(void(*)(void))dec_mpd_qmax, METH_VARARGS|METH_KEYWORDS, doc_max },
+ { "max_mag", (PyCFunction)(void(*)(void))dec_mpd_qmax_mag, METH_VARARGS|METH_KEYWORDS, doc_max_mag },
+ { "min", (PyCFunction)(void(*)(void))dec_mpd_qmin, METH_VARARGS|METH_KEYWORDS, doc_min },
+ { "min_mag", (PyCFunction)(void(*)(void))dec_mpd_qmin_mag, METH_VARARGS|METH_KEYWORDS, doc_min_mag },
+ { "next_toward", (PyCFunction)(void(*)(void))dec_mpd_qnext_toward, METH_VARARGS|METH_KEYWORDS, doc_next_toward },
+ { "quantize", (PyCFunction)(void(*)(void))dec_mpd_qquantize, METH_VARARGS|METH_KEYWORDS, doc_quantize },
+ { "remainder_near", (PyCFunction)(void(*)(void))dec_mpd_qrem_near, METH_VARARGS|METH_KEYWORDS, doc_remainder_near },
/* Ternary arithmetic functions, optional context arg */
- { "fma", (PyCFunction)dec_mpd_qfma, METH_VARARGS|METH_KEYWORDS, doc_fma },
+ { "fma", (PyCFunction)(void(*)(void))dec_mpd_qfma, METH_VARARGS|METH_KEYWORDS, doc_fma },
/* Boolean functions, no context arg */
{ "is_canonical", dec_mpd_iscanonical, METH_NOARGS, doc_is_canonical },
@@ -4634,8 +4634,8 @@ static PyMethodDef dec_methods [] =
{ "is_zero", dec_mpd_iszero, METH_NOARGS, doc_is_zero },
/* Boolean functions, optional context arg */
- { "is_normal", (PyCFunction)dec_mpd_isnormal, METH_VARARGS|METH_KEYWORDS, doc_is_normal },
- { "is_subnormal", (PyCFunction)dec_mpd_issubnormal, METH_VARARGS|METH_KEYWORDS, doc_is_subnormal },
+ { "is_normal", (PyCFunction)(void(*)(void))dec_mpd_isnormal, METH_VARARGS|METH_KEYWORDS, doc_is_normal },
+ { "is_subnormal", (PyCFunction)(void(*)(void))dec_mpd_issubnormal, METH_VARARGS|METH_KEYWORDS, doc_is_subnormal },
/* Unary functions, no context arg */
{ "adjusted", dec_mpd_adjexp, METH_NOARGS, doc_adjusted },
@@ -4648,24 +4648,24 @@ static PyMethodDef dec_methods [] =
{ "copy_negate", dec_mpd_qcopy_negate, METH_NOARGS, doc_copy_negate },
/* Unary functions, optional context arg */
- { "logb", (PyCFunction)dec_mpd_qlogb, METH_VARARGS|METH_KEYWORDS, doc_logb },
- { "logical_invert", (PyCFunction)dec_mpd_qinvert, METH_VARARGS|METH_KEYWORDS, doc_logical_invert },
- { "number_class", (PyCFunction)dec_mpd_class, METH_VARARGS|METH_KEYWORDS, doc_number_class },
- { "to_eng_string", (PyCFunction)dec_mpd_to_eng, METH_VARARGS|METH_KEYWORDS, doc_to_eng_string },
+ { "logb", (PyCFunction)(void(*)(void))dec_mpd_qlogb, METH_VARARGS|METH_KEYWORDS, doc_logb },
+ { "logical_invert", (PyCFunction)(void(*)(void))dec_mpd_qinvert, METH_VARARGS|METH_KEYWORDS, doc_logical_invert },
+ { "number_class", (PyCFunction)(void(*)(void))dec_mpd_class, METH_VARARGS|METH_KEYWORDS, doc_number_class },
+ { "to_eng_string", (PyCFunction)(void(*)(void))dec_mpd_to_eng, METH_VARARGS|METH_KEYWORDS, doc_to_eng_string },
/* Binary functions, optional context arg for conversion errors */
- { "compare_total", (PyCFunction)dec_mpd_compare_total, METH_VARARGS|METH_KEYWORDS, doc_compare_total },
- { "compare_total_mag", (PyCFunction)dec_mpd_compare_total_mag, METH_VARARGS|METH_KEYWORDS, doc_compare_total_mag },
- { "copy_sign", (PyCFunction)dec_mpd_qcopy_sign, METH_VARARGS|METH_KEYWORDS, doc_copy_sign },
- { "same_quantum", (PyCFunction)dec_mpd_same_quantum, METH_VARARGS|METH_KEYWORDS, doc_same_quantum },
+ { "compare_total", (PyCFunction)(void(*)(void))dec_mpd_compare_total, METH_VARARGS|METH_KEYWORDS, doc_compare_total },
+ { "compare_total_mag", (PyCFunction)(void(*)(void))dec_mpd_compare_total_mag, METH_VARARGS|METH_KEYWORDS, doc_compare_total_mag },
+ { "copy_sign", (PyCFunction)(void(*)(void))dec_mpd_qcopy_sign, METH_VARARGS|METH_KEYWORDS, doc_copy_sign },
+ { "same_quantum", (PyCFunction)(void(*)(void))dec_mpd_same_quantum, METH_VARARGS|METH_KEYWORDS, doc_same_quantum },
/* Binary functions, optional context arg */
- { "logical_and", (PyCFunction)dec_mpd_qand, METH_VARARGS|METH_KEYWORDS, doc_logical_and },
- { "logical_or", (PyCFunction)dec_mpd_qor, METH_VARARGS|METH_KEYWORDS, doc_logical_or },
- { "logical_xor", (PyCFunction)dec_mpd_qxor, METH_VARARGS|METH_KEYWORDS, doc_logical_xor },
- { "rotate", (PyCFunction)dec_mpd_qrotate, METH_VARARGS|METH_KEYWORDS, doc_rotate },
- { "scaleb", (PyCFunction)dec_mpd_qscaleb, METH_VARARGS|METH_KEYWORDS, doc_scaleb },
- { "shift", (PyCFunction)dec_mpd_qshift, METH_VARARGS|METH_KEYWORDS, doc_shift },
+ { "logical_and", (PyCFunction)(void(*)(void))dec_mpd_qand, METH_VARARGS|METH_KEYWORDS, doc_logical_and },
+ { "logical_or", (PyCFunction)(void(*)(void))dec_mpd_qor, METH_VARARGS|METH_KEYWORDS, doc_logical_or },
+ { "logical_xor", (PyCFunction)(void(*)(void))dec_mpd_qxor, METH_VARARGS|METH_KEYWORDS, doc_logical_xor },
+ { "rotate", (PyCFunction)(void(*)(void))dec_mpd_qrotate, METH_VARARGS|METH_KEYWORDS, doc_rotate },
+ { "scaleb", (PyCFunction)(void(*)(void))dec_mpd_qscaleb, METH_VARARGS|METH_KEYWORDS, doc_scaleb },
+ { "shift", (PyCFunction)(void(*)(void))dec_mpd_qshift, METH_VARARGS|METH_KEYWORDS, doc_shift },
/* Miscellaneous */
{ "from_float", dec_from_float, METH_O|METH_CLASS, doc_from_float },
@@ -5303,7 +5303,7 @@ static PyMethodDef context_methods [] =
{ "subtract", ctx_mpd_qsub, METH_VARARGS, doc_ctx_subtract },
/* Binary or ternary arithmetic functions */
- { "power", (PyCFunction)ctx_mpd_qpow, METH_VARARGS|METH_KEYWORDS, doc_ctx_power },
+ { "power", (PyCFunction)(void(*)(void))ctx_mpd_qpow, METH_VARARGS|METH_KEYWORDS, doc_ctx_power },
/* Ternary arithmetic functions */
{ "fma", ctx_mpd_qfma, METH_VARARGS, doc_ctx_fma },
@@ -5421,7 +5421,7 @@ static PyMethodDef _decimal_methods [] =
{
{ "getcontext", (PyCFunction)PyDec_GetCurrentContext, METH_NOARGS, doc_getcontext},
{ "setcontext", (PyCFunction)PyDec_SetCurrentContext, METH_O, doc_setcontext},
- { "localcontext", (PyCFunction)ctxmanager_new, METH_VARARGS|METH_KEYWORDS, doc_localcontext},
+ { "localcontext", (PyCFunction)(void(*)(void))ctxmanager_new, METH_VARARGS|METH_KEYWORDS, doc_localcontext},
#ifdef EXTRA_FUNCTIONALITY
{ "IEEEContext", (PyCFunction)ieee_context, METH_O, doc_ieee_context},
#endif
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 2f1c4c0..62374d8 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -3968,7 +3968,7 @@ static PyTypeObject XMLParser_Type = {
/* python module interface */
static PyMethodDef _functions[] = {
- {"SubElement", (PyCFunction) subelement, METH_VARARGS | METH_KEYWORDS},
+ {"SubElement", (PyCFunction)(void(*)(void)) subelement, METH_VARARGS | METH_KEYWORDS},
{NULL, NULL}
};
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index 8701f6c..0fb4847 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -1236,7 +1236,7 @@ PyDoc_STRVAR(module_doc,
static PyMethodDef module_methods[] = {
{"reduce", functools_reduce, METH_VARARGS, functools_reduce_doc},
- {"cmp_to_key", (PyCFunction)functools_cmp_to_key,
+ {"cmp_to_key", (PyCFunction)(void(*)(void))functools_cmp_to_key,
METH_VARARGS | METH_KEYWORDS, functools_cmp_to_key_doc},
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index 42ea997..d7e613c 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -1011,7 +1011,7 @@ generate_hash_name_list(void)
/* a PyMethodDef structure for the constructor */
#define CONSTRUCTOR_METH_DEF(NAME) \
- {"openssl_" #NAME, (PyCFunction)EVP_new_ ## NAME, METH_FASTCALL, \
+ {"openssl_" #NAME, (PyCFunction)(void(*)(void))EVP_new_ ## NAME, METH_FASTCALL, \
PyDoc_STR("Returns a " #NAME \
" hash object; optionally initialized with a string") \
}
@@ -1034,9 +1034,9 @@ GEN_CONSTRUCTOR(sha512)
/* List of functions exported by this module */
static struct PyMethodDef EVP_functions[] = {
- {"new", (PyCFunction)EVP_new, METH_VARARGS|METH_KEYWORDS, EVP_new__doc__},
+ {"new", (PyCFunction)(void(*)(void))EVP_new, METH_VARARGS|METH_KEYWORDS, EVP_new__doc__},
#ifdef PY_PBKDF2_HMAC
- {"pbkdf2_hmac", (PyCFunction)pbkdf2_hmac, METH_VARARGS|METH_KEYWORDS,
+ {"pbkdf2_hmac", (PyCFunction)(void(*)(void))pbkdf2_hmac, METH_VARARGS|METH_KEYWORDS,
pbkdf2_hmac__doc__},
#endif
_HASHLIB_SCRYPT_METHODDEF
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 233f62f..4508f5e 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -778,7 +778,7 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw)
static PyMethodDef profiler_methods[] = {
{"getstats", (PyCFunction)profiler_getstats,
METH_NOARGS, getstats_doc},
- {"enable", (PyCFunction)profiler_enable,
+ {"enable", (PyCFunction)(void(*)(void))profiler_enable,
METH_VARARGS | METH_KEYWORDS, enable_doc},
{"disable", (PyCFunction)profiler_disable,
METH_NOARGS, disable_doc},
diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c
index b1d3a21..e15adfb 100644
--- a/Modules/_multiprocessing/semaphore.c
+++ b/Modules/_multiprocessing/semaphore.c
@@ -581,11 +581,11 @@ semlock_afterfork(SemLockObject *self, PyObject *Py_UNUSED(ignored))
*/
static PyMethodDef semlock_methods[] = {
- {"acquire", (PyCFunction)semlock_acquire, METH_VARARGS | METH_KEYWORDS,
+ {"acquire", (PyCFunction)(void(*)(void))semlock_acquire, METH_VARARGS | METH_KEYWORDS,
"acquire the semaphore/lock"},
{"release", (PyCFunction)semlock_release, METH_NOARGS,
"release the semaphore/lock"},
- {"__enter__", (PyCFunction)semlock_acquire, METH_VARARGS | METH_KEYWORDS,
+ {"__enter__", (PyCFunction)(void(*)(void))semlock_acquire, METH_VARARGS | METH_KEYWORDS,
"enter the semaphore/lock"},
{"__exit__", (PyCFunction)semlock_release, METH_VARARGS,
"exit the semaphore/lock"},
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 89a8751..65e8df4 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1764,7 +1764,7 @@ static PyGetSetDef connection_getset[] = {
};
static PyMethodDef connection_methods[] = {
- {"cursor", (PyCFunction)pysqlite_connection_cursor, METH_VARARGS|METH_KEYWORDS,
+ {"cursor", (PyCFunction)(void(*)(void))pysqlite_connection_cursor, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("Return a cursor for the connection.")},
{"close", (PyCFunction)pysqlite_connection_close, METH_NOARGS,
PyDoc_STR("Closes the connection.")},
@@ -1772,11 +1772,11 @@ static PyMethodDef connection_methods[] = {
PyDoc_STR("Commit the current transaction.")},
{"rollback", (PyCFunction)pysqlite_connection_rollback, METH_NOARGS,
PyDoc_STR("Roll back the current transaction.")},
- {"create_function", (PyCFunction)pysqlite_connection_create_function, METH_VARARGS|METH_KEYWORDS,
+ {"create_function", (PyCFunction)(void(*)(void))pysqlite_connection_create_function, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("Creates a new function. Non-standard.")},
- {"create_aggregate", (PyCFunction)pysqlite_connection_create_aggregate, METH_VARARGS|METH_KEYWORDS,
+ {"create_aggregate", (PyCFunction)(void(*)(void))pysqlite_connection_create_aggregate, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("Creates a new aggregate. Non-standard.")},
- {"set_authorizer", (PyCFunction)pysqlite_connection_set_authorizer, METH_VARARGS|METH_KEYWORDS,
+ {"set_authorizer", (PyCFunction)(void(*)(void))pysqlite_connection_set_authorizer, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("Sets authorizer callback. Non-standard.")},
#ifdef HAVE_LOAD_EXTENSION
{"enable_load_extension", (PyCFunction)pysqlite_enable_load_extension, METH_VARARGS,
@@ -1784,9 +1784,9 @@ static PyMethodDef connection_methods[] = {
{"load_extension", (PyCFunction)pysqlite_load_extension, METH_VARARGS,
PyDoc_STR("Load SQLite extension module. Non-standard.")},
#endif
- {"set_progress_handler", (PyCFunction)pysqlite_connection_set_progress_handler, METH_VARARGS|METH_KEYWORDS,
+ {"set_progress_handler", (PyCFunction)(void(*)(void))pysqlite_connection_set_progress_handler, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("Sets progress handler callback. Non-standard.")},
- {"set_trace_callback", (PyCFunction)pysqlite_connection_set_trace_callback, METH_VARARGS|METH_KEYWORDS,
+ {"set_trace_callback", (PyCFunction)(void(*)(void))pysqlite_connection_set_trace_callback, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("Sets a trace callback called for each SQL statement (passed as unicode). Non-standard.")},
{"execute", (PyCFunction)pysqlite_connection_execute, METH_VARARGS,
PyDoc_STR("Executes a SQL statement. Non-standard.")},
@@ -1801,7 +1801,7 @@ static PyMethodDef connection_methods[] = {
{"iterdump", (PyCFunction)pysqlite_connection_iterdump, METH_NOARGS,
PyDoc_STR("Returns iterator to the dump of the database in an SQL text format. Non-standard.")},
#ifdef HAVE_BACKUP_API
- {"backup", (PyCFunction)pysqlite_connection_backup, METH_VARARGS | METH_KEYWORDS,
+ {"backup", (PyCFunction)(void(*)(void))pysqlite_connection_backup, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("Makes a backup of the database. Non-standard.")},
#endif
{"__enter__", (PyCFunction)pysqlite_connection_enter, METH_NOARGS,
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index c62ad5d..8a46e5c 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -908,7 +908,7 @@ static PyMethodDef cursor_methods[] = {
PyDoc_STR("Executes a multiple SQL statements at once. Non-standard.")},
{"fetchone", (PyCFunction)pysqlite_cursor_fetchone, METH_NOARGS,
PyDoc_STR("Fetches one row from the resultset.")},
- {"fetchmany", (PyCFunction)pysqlite_cursor_fetchmany, METH_VARARGS|METH_KEYWORDS,
+ {"fetchmany", (PyCFunction)(void(*)(void))pysqlite_cursor_fetchmany, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("Fetches several rows from the resultset.")},
{"fetchall", (PyCFunction)pysqlite_cursor_fetchall, METH_NOARGS,
PyDoc_STR("Fetches all rows from the resultset.")},
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index db2b495..274ee13 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -245,12 +245,12 @@ static void converters_init(PyObject* dict)
}
static PyMethodDef module_methods[] = {
- {"connect", (PyCFunction)module_connect,
+ {"connect", (PyCFunction)(void(*)(void))module_connect,
METH_VARARGS | METH_KEYWORDS, module_connect_doc},
- {"complete_statement", (PyCFunction)module_complete,
+ {"complete_statement", (PyCFunction)(void(*)(void))module_complete,
METH_VARARGS | METH_KEYWORDS, module_complete_doc},
#ifdef HAVE_SHARED_CACHE
- {"enable_shared_cache", (PyCFunction)module_enable_shared_cache,
+ {"enable_shared_cache", (PyCFunction)(void(*)(void))module_enable_shared_cache,
METH_VARARGS | METH_KEYWORDS, module_enable_shared_cache_doc},
#endif
{"register_adapter", (PyCFunction)module_register_adapter,
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 0be52d9..6767330 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -2006,8 +2006,8 @@ s_sizeof(PyStructObject *self, void *unused)
static struct PyMethodDef s_methods[] = {
STRUCT_ITER_UNPACK_METHODDEF
- {"pack", (PyCFunction)s_pack, METH_FASTCALL, s_pack__doc__},
- {"pack_into", (PyCFunction)s_pack_into, METH_FASTCALL, s_pack_into__doc__},
+ {"pack", (PyCFunction)(void(*)(void))s_pack, METH_FASTCALL, s_pack__doc__},
+ {"pack_into", (PyCFunction)(void(*)(void))s_pack_into, METH_FASTCALL, s_pack_into__doc__},
STRUCT_UNPACK_METHODDEF
STRUCT_UNPACK_FROM_METHODDEF
{"__sizeof__", (PyCFunction)s_sizeof, METH_NOARGS, s_sizeof__doc__},
@@ -2264,8 +2264,8 @@ static struct PyMethodDef module_functions[] = {
_CLEARCACHE_METHODDEF
CALCSIZE_METHODDEF
ITER_UNPACK_METHODDEF
- {"pack", (PyCFunction)pack, METH_FASTCALL, pack_doc},
- {"pack_into", (PyCFunction)pack_into, METH_FASTCALL, pack_into_doc},
+ {"pack", (PyCFunction)(void(*)(void))pack, METH_FASTCALL, pack_doc},
+ {"pack_into", (PyCFunction)(void(*)(void))pack_into, METH_FASTCALL, pack_into_doc},
UNPACK_METHODDEF
UNPACK_FROM_METHODDEF
{NULL, NULL} /* sentinel */
diff --git a/Modules/_testbuffer.c b/Modules/_testbuffer.c
index b1b8ff3..4ff44f9 100644
--- a/Modules/_testbuffer.c
+++ b/Modules/_testbuffer.c
@@ -2635,7 +2635,7 @@ static PyMethodDef ndarray_methods [] =
{
{ "tolist", ndarray_tolist, METH_NOARGS, NULL },
{ "tobytes", ndarray_tobytes, METH_NOARGS, NULL },
- { "push", (PyCFunction)ndarray_push, METH_VARARGS|METH_KEYWORDS, NULL },
+ { "push", (PyCFunction)(void(*)(void))ndarray_push, METH_VARARGS|METH_KEYWORDS, NULL },
{ "pop", ndarray_pop, METH_NOARGS, NULL },
{ "add_suboffsets", ndarray_add_suboffsets, METH_NOARGS, NULL },
{ "memoryview_from_buffer", ndarray_memoryview_from_buffer, METH_NOARGS, NULL },
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 4715f39..4933ef3 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -4787,14 +4787,14 @@ static PyMethodDef TestMethods[] = {
{"getbuffer_with_null_view", getbuffer_with_null_view, METH_O},
{"test_buildvalue_N", test_buildvalue_N, METH_NOARGS},
{"get_args", get_args, METH_VARARGS},
- {"get_kwargs", (PyCFunction)get_kwargs, METH_VARARGS|METH_KEYWORDS},
+ {"get_kwargs", (PyCFunction)(void(*)(void))get_kwargs, METH_VARARGS|METH_KEYWORDS},
{"getargs_tuple", getargs_tuple, METH_VARARGS},
- {"getargs_keywords", (PyCFunction)getargs_keywords,
+ {"getargs_keywords", (PyCFunction)(void(*)(void))getargs_keywords,
METH_VARARGS|METH_KEYWORDS},
- {"getargs_keyword_only", (PyCFunction)getargs_keyword_only,
+ {"getargs_keyword_only", (PyCFunction)(void(*)(void))getargs_keyword_only,
METH_VARARGS|METH_KEYWORDS},
{"getargs_positional_only_and_keywords",
- (PyCFunction)getargs_positional_only_and_keywords,
+ (PyCFunction)(void(*)(void))getargs_positional_only_and_keywords,
METH_VARARGS|METH_KEYWORDS},
{"getargs_b", getargs_b, METH_VARARGS},
{"getargs_B", getargs_B, METH_VARARGS},
@@ -4863,7 +4863,7 @@ static PyMethodDef TestMethods[] = {
{"set_exc_info", test_set_exc_info, METH_VARARGS},
{"argparsing", argparsing, METH_VARARGS},
{"code_newempty", code_newempty, METH_VARARGS},
- {"make_exception_with_doc", (PyCFunction)make_exception_with_doc,
+ {"make_exception_with_doc", (PyCFunction)(void(*)(void))make_exception_with_doc,
METH_VARARGS | METH_KEYWORDS},
{"make_memoryview_from_NULL_pointer", make_memoryview_from_NULL_pointer,
METH_NOARGS},
@@ -4960,7 +4960,7 @@ static PyMethodDef TestMethods[] = {
{"get_mapping_items", get_mapping_items, METH_O},
{"test_pythread_tss_key_state", test_pythread_tss_key_state, METH_VARARGS},
{"hamt", new_hamt, METH_NOARGS},
- {"bad_get", (PyCFunction)bad_get, METH_FASTCALL},
+ {"bad_get", (PyCFunction)(void(*)(void))bad_get, METH_FASTCALL},
{"EncodeLocaleEx", encode_locale_ex, METH_VARARGS},
{"DecodeLocaleEx", decode_locale_ex, METH_VARARGS},
{"get_global_config", get_global_config, METH_NOARGS},
@@ -5388,7 +5388,7 @@ generic_alias_mro_entries(PyGenericAliasObject *self, PyObject *bases)
}
static PyMethodDef generic_alias_methods[] = {
- {"__mro_entries__", (PyCFunction) generic_alias_mro_entries, METH_O, NULL},
+ {"__mro_entries__", (PyCFunction)(void(*)(void))generic_alias_mro_entries, METH_O, NULL},
{NULL} /* sentinel */
};
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index a4ddb87..d075ef7 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -204,9 +204,9 @@ lock_repr(lockobject *self)
}
static PyMethodDef lock_methods[] = {
- {"acquire_lock", (PyCFunction)lock_PyThread_acquire_lock,
+ {"acquire_lock", (PyCFunction)(void(*)(void))lock_PyThread_acquire_lock,
METH_VARARGS | METH_KEYWORDS, acquire_doc},
- {"acquire", (PyCFunction)lock_PyThread_acquire_lock,
+ {"acquire", (PyCFunction)(void(*)(void))lock_PyThread_acquire_lock,
METH_VARARGS | METH_KEYWORDS, acquire_doc},
{"release_lock", (PyCFunction)lock_PyThread_release_lock,
METH_NOARGS, release_doc},
@@ -216,7 +216,7 @@ static PyMethodDef lock_methods[] = {
METH_NOARGS, locked_doc},
{"locked", (PyCFunction)lock_locked_lock,
METH_NOARGS, locked_doc},
- {"__enter__", (PyCFunction)lock_PyThread_acquire_lock,
+ {"__enter__", (PyCFunction)(void(*)(void))lock_PyThread_acquire_lock,
METH_VARARGS | METH_KEYWORDS, acquire_doc},
{"__exit__", (PyCFunction)lock_PyThread_release_lock,
METH_VARARGS, release_doc},
@@ -466,7 +466,7 @@ rlock_repr(rlockobject *self)
static PyMethodDef rlock_methods[] = {
- {"acquire", (PyCFunction)rlock_acquire,
+ {"acquire", (PyCFunction)(void(*)(void))rlock_acquire,
METH_VARARGS | METH_KEYWORDS, rlock_acquire_doc},
{"release", (PyCFunction)rlock_release,
METH_NOARGS, rlock_release_doc},
@@ -476,7 +476,7 @@ static PyMethodDef rlock_methods[] = {
METH_VARARGS, rlock_acquire_restore_doc},
{"_release_save", (PyCFunction)rlock_release_save,
METH_NOARGS, rlock_release_save_doc},
- {"__enter__", (PyCFunction)rlock_acquire,
+ {"__enter__", (PyCFunction)(void(*)(void))rlock_acquire,
METH_VARARGS | METH_KEYWORDS, rlock_acquire_doc},
{"__exit__", (PyCFunction)rlock_release,
METH_VARARGS, rlock_release_doc},
diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c
index 33509ef..235df70 100644
--- a/Modules/_xxsubinterpretersmodule.c
+++ b/Modules/_xxsubinterpretersmodule.c
@@ -2768,7 +2768,7 @@ channel__channel_id(PyObject *self, PyObject *args, PyObject *kwds)
static PyMethodDef module_functions[] = {
{"create", (PyCFunction)interp_create,
METH_VARARGS, create_doc},
- {"destroy", (PyCFunction)interp_destroy,
+ {"destroy", (PyCFunction)(void(*)(void))interp_destroy,
METH_VARARGS | METH_KEYWORDS, destroy_doc},
{"list_all", interp_list_all,
METH_NOARGS, list_all_doc},
@@ -2776,29 +2776,29 @@ static PyMethodDef module_functions[] = {
METH_NOARGS, get_current_doc},
{"get_main", interp_get_main,
METH_NOARGS, get_main_doc},
- {"is_running", (PyCFunction)interp_is_running,
+ {"is_running", (PyCFunction)(void(*)(void))interp_is_running,
METH_VARARGS | METH_KEYWORDS, is_running_doc},
- {"run_string", (PyCFunction)interp_run_string,
+ {"run_string", (PyCFunction)(void(*)(void))interp_run_string,
METH_VARARGS | METH_KEYWORDS, run_string_doc},
- {"is_shareable", (PyCFunction)object_is_shareable,
+ {"is_shareable", (PyCFunction)(void(*)(void))object_is_shareable,
METH_VARARGS | METH_KEYWORDS, is_shareable_doc},
{"channel_create", channel_create,
METH_NOARGS, channel_create_doc},
- {"channel_destroy", (PyCFunction)channel_destroy,
+ {"channel_destroy", (PyCFunction)(void(*)(void))channel_destroy,
METH_VARARGS | METH_KEYWORDS, channel_destroy_doc},
{"channel_list_all", channel_list_all,
METH_NOARGS, channel_list_all_doc},
- {"channel_send", (PyCFunction)channel_send,
+ {"channel_send", (PyCFunction)(void(*)(void))channel_send,
METH_VARARGS | METH_KEYWORDS, channel_send_doc},
- {"channel_recv", (PyCFunction)channel_recv,
+ {"channel_recv", (PyCFunction)(void(*)(void))channel_recv,
METH_VARARGS | METH_KEYWORDS, channel_recv_doc},
- {"channel_close", (PyCFunction)channel_close,
+ {"channel_close", (PyCFunction)(void(*)(void))channel_close,
METH_VARARGS | METH_KEYWORDS, channel_close_doc},
- {"channel_release", (PyCFunction)channel_release,
+ {"channel_release", (PyCFunction)(void(*)(void))channel_release,
METH_VARARGS | METH_KEYWORDS, channel_release_doc},
- {"_channel_id", (PyCFunction)channel__channel_id,
+ {"_channel_id", (PyCFunction)(void(*)(void))channel__channel_id,
METH_VARARGS | METH_KEYWORDS, NULL},
{NULL, NULL} /* sentinel */
diff --git a/Modules/atexitmodule.c b/Modules/atexitmodule.c
index afa1cfa..1d6d6e5 100644
--- a/Modules/atexitmodule.c
+++ b/Modules/atexitmodule.c
@@ -291,7 +291,7 @@ atexit_unregister(PyObject *self, PyObject *func)
}
static PyMethodDef atexit_methods[] = {
- {"register", (PyCFunction) atexit_register, METH_VARARGS|METH_KEYWORDS,
+ {"register", (PyCFunction)(void(*)(void)) atexit_register, METH_VARARGS|METH_KEYWORDS,
atexit_register__doc__},
{"_clear", (PyCFunction) atexit_clear, METH_NOARGS,
atexit_clear__doc__},
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 17bf3fa..30fe186 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -1175,7 +1175,7 @@ PyDoc_STRVAR(module_doc,
static PyMethodDef module_methods[] = {
{"enable",
- (PyCFunction)faulthandler_py_enable, METH_VARARGS|METH_KEYWORDS,
+ (PyCFunction)(void(*)(void))faulthandler_py_enable, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("enable(file=sys.stderr, all_threads=True): "
"enable the fault handler")},
{"disable", faulthandler_disable_py, METH_NOARGS,
@@ -1183,13 +1183,13 @@ static PyMethodDef module_methods[] = {
{"is_enabled", faulthandler_is_enabled, METH_NOARGS,
PyDoc_STR("is_enabled()->bool: check if the handler is enabled")},
{"dump_traceback",
- (PyCFunction)faulthandler_dump_traceback_py, METH_VARARGS|METH_KEYWORDS,
+ (PyCFunction)(void(*)(void))faulthandler_dump_traceback_py, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("dump_traceback(file=sys.stderr, all_threads=True): "
"dump the traceback of the current thread, or of all threads "
"if all_threads is True, into file")},
#ifdef FAULTHANDLER_LATER
{"dump_traceback_later",
- (PyCFunction)faulthandler_dump_traceback_later, METH_VARARGS|METH_KEYWORDS,
+ (PyCFunction)(void(*)(void))faulthandler_dump_traceback_later, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("dump_traceback_later(timeout, repeat=False, file=sys.stderrn, exit=False):\n"
"dump the traceback of all threads in timeout seconds,\n"
"or each timeout seconds if repeat is True. If exit is True, "
@@ -1202,13 +1202,13 @@ static PyMethodDef module_methods[] = {
#ifdef FAULTHANDLER_USER
{"register",
- (PyCFunction)faulthandler_register_py, METH_VARARGS|METH_KEYWORDS,
+ (PyCFunction)(void(*)(void))faulthandler_register_py, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("register(signum, file=sys.stderr, all_threads=True, chain=False): "
"register a handler for the signal 'signum': dump the "
"traceback of the current thread, or of all threads if "
"all_threads is True, into file")},
{"unregister",
- faulthandler_unregister_py, METH_VARARGS|METH_KEYWORDS,
+ (PyCFunction)(void(*)(void))faulthandler_unregister_py, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("unregister(signum): unregister the handler of the signal "
"'signum' registered by register()")},
#endif
diff --git a/Modules/nismodule.c b/Modules/nismodule.c
index 1a538dc..bc6796c 100644
--- a/Modules/nismodule.c
+++ b/Modules/nismodule.c
@@ -423,13 +423,13 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict)
}
static PyMethodDef nis_methods[] = {
- {"match", (PyCFunction)nis_match,
+ {"match", (PyCFunction)(void(*)(void))nis_match,
METH_VARARGS | METH_KEYWORDS,
match__doc__},
- {"cat", (PyCFunction)nis_cat,
+ {"cat", (PyCFunction)(void(*)(void))nis_cat,
METH_VARARGS | METH_KEYWORDS,
cat__doc__},
- {"maps", (PyCFunction)nis_maps,
+ {"maps", (PyCFunction)(void(*)(void))nis_maps,
METH_VARARGS | METH_KEYWORDS,
maps__doc__},
{"get_default_domain", nis_get_default_domain,
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index c8fb3d2..8f88657 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -206,15 +206,15 @@ static PyObject* parser_st2tuple(PyST_Object *, PyObject *, PyObject *);
#define PUBLIC_METHOD_TYPE (METH_VARARGS|METH_KEYWORDS)
static PyMethodDef parser_methods[] = {
- {"compile", (PyCFunction)parser_compilest, PUBLIC_METHOD_TYPE,
+ {"compile", (PyCFunction)(void(*)(void))parser_compilest, PUBLIC_METHOD_TYPE,
PyDoc_STR("Compile this ST object into a code object.")},
- {"isexpr", (PyCFunction)parser_isexpr, PUBLIC_METHOD_TYPE,
+ {"isexpr", (PyCFunction)(void(*)(void))parser_isexpr, PUBLIC_METHOD_TYPE,
PyDoc_STR("Determines if this ST object was created from an expression.")},
- {"issuite", (PyCFunction)parser_issuite, PUBLIC_METHOD_TYPE,
+ {"issuite", (PyCFunction)(void(*)(void))parser_issuite, PUBLIC_METHOD_TYPE,
PyDoc_STR("Determines if this ST object was created from a suite.")},
- {"tolist", (PyCFunction)parser_st2list, PUBLIC_METHOD_TYPE,
+ {"tolist", (PyCFunction)(void(*)(void))parser_st2list, PUBLIC_METHOD_TYPE,
PyDoc_STR("Creates a list-tree representation of this ST.")},
- {"totuple", (PyCFunction)parser_st2tuple, PUBLIC_METHOD_TYPE,
+ {"totuple", (PyCFunction)(void(*)(void))parser_st2tuple, PUBLIC_METHOD_TYPE,
PyDoc_STR("Creates a tuple-tree representation of this ST.")},
{"__sizeof__", (PyCFunction)parser_sizeof, METH_NOARGS,
PyDoc_STR("Returns size in memory, in bytes.")},
@@ -1087,23 +1087,23 @@ parser__pickler(PyObject *self, PyObject *args)
* inheritance.
*/
static PyMethodDef parser_functions[] = {
- {"compilest", (PyCFunction)parser_compilest, PUBLIC_METHOD_TYPE,
+ {"compilest", (PyCFunction)(void(*)(void))parser_compilest, PUBLIC_METHOD_TYPE,
PyDoc_STR("Compiles an ST object into a code object.")},
- {"expr", (PyCFunction)parser_expr, PUBLIC_METHOD_TYPE,
+ {"expr", (PyCFunction)(void(*)(void))parser_expr, PUBLIC_METHOD_TYPE,
PyDoc_STR("Creates an ST object from an expression.")},
- {"isexpr", (PyCFunction)parser_isexpr, PUBLIC_METHOD_TYPE,
+ {"isexpr", (PyCFunction)(void(*)(void))parser_isexpr, PUBLIC_METHOD_TYPE,
PyDoc_STR("Determines if an ST object was created from an expression.")},
- {"issuite", (PyCFunction)parser_issuite, PUBLIC_METHOD_TYPE,
+ {"issuite", (PyCFunction)(void(*)(void))parser_issuite, PUBLIC_METHOD_TYPE,
PyDoc_STR("Determines if an ST object was created from a suite.")},
- {"suite", (PyCFunction)parser_suite, PUBLIC_METHOD_TYPE,
+ {"suite", (PyCFunction)(void(*)(void))parser_suite, PUBLIC_METHOD_TYPE,
PyDoc_STR("Creates an ST object from a suite.")},
- {"sequence2st", (PyCFunction)parser_tuple2st, PUBLIC_METHOD_TYPE,
+ {"sequence2st", (PyCFunction)(void(*)(void))parser_tuple2st, PUBLIC_METHOD_TYPE,
PyDoc_STR("Creates an ST object from a tree representation.")},
- {"st2tuple", (PyCFunction)parser_st2tuple, PUBLIC_METHOD_TYPE,
+ {"st2tuple", (PyCFunction)(void(*)(void))parser_st2tuple, PUBLIC_METHOD_TYPE,
PyDoc_STR("Creates a tuple-tree representation of an ST.")},
- {"st2list", (PyCFunction)parser_st2list, PUBLIC_METHOD_TYPE,
+ {"st2list", (PyCFunction)(void(*)(void))parser_st2list, PUBLIC_METHOD_TYPE,
PyDoc_STR("Creates a list-tree representation of an ST.")},
- {"tuple2st", (PyCFunction)parser_tuple2st, PUBLIC_METHOD_TYPE,
+ {"tuple2st", (PyCFunction)(void(*)(void))parser_tuple2st, PUBLIC_METHOD_TYPE,
PyDoc_STR("Creates an ST object from a tree representation.")},
/* private stuff: support pickle module */
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 44d6009..d42e40f 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -13175,7 +13175,7 @@ static PyMethodDef posix_methods[] = {
OS_PWRITE_METHODDEF
OS_PWRITEV_METHODDEF
#ifdef HAVE_SENDFILE
- {"sendfile", (PyCFunction)posix_sendfile, METH_VARARGS | METH_KEYWORDS,
+ {"sendfile", (PyCFunction)(void(*)(void))posix_sendfile, METH_VARARGS | METH_KEYWORDS,
posix_sendfile__doc__},
#endif
OS_FSTAT_METHODDEF
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 1915fd9..52ab4e9 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -1210,7 +1210,7 @@ static PyMethodDef signal_methods[] = {
SIGNAL_SIGNAL_METHODDEF
SIGNAL_STRSIGNAL_METHODDEF
SIGNAL_GETSIGNAL_METHODDEF
- {"set_wakeup_fd", (PyCFunction)signal_set_wakeup_fd, METH_VARARGS | METH_KEYWORDS, set_wakeup_fd_doc},
+ {"set_wakeup_fd", (PyCFunction)(void(*)(void))signal_set_wakeup_fd, METH_VARARGS | METH_KEYWORDS, set_wakeup_fd_doc},
SIGNAL_SIGINTERRUPT_METHODDEF
SIGNAL_PAUSE_METHODDEF
SIGNAL_PTHREAD_KILL_METHODDEF
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index a47f031..04bfdaf 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -4810,11 +4810,11 @@ static PyMethodDef sock_methods[] = {
listen_doc},
{"recv", (PyCFunction)sock_recv, METH_VARARGS,
recv_doc},
- {"recv_into", (PyCFunction)sock_recv_into, METH_VARARGS | METH_KEYWORDS,
+ {"recv_into", (PyCFunction)(void(*)(void))sock_recv_into, METH_VARARGS | METH_KEYWORDS,
recv_into_doc},
{"recvfrom", (PyCFunction)sock_recvfrom, METH_VARARGS,
recvfrom_doc},
- {"recvfrom_into", (PyCFunction)sock_recvfrom_into, METH_VARARGS | METH_KEYWORDS,
+ {"recvfrom_into", (PyCFunction)(void(*)(void))sock_recvfrom_into, METH_VARARGS | METH_KEYWORDS,
recvfrom_into_doc},
{"send", (PyCFunction)sock_send, METH_VARARGS,
send_doc},
@@ -4843,7 +4843,7 @@ static PyMethodDef sock_methods[] = {
sendmsg_doc},
#endif
#ifdef HAVE_SOCKADDR_ALG
- {"sendmsg_afalg", (PyCFunction)sock_sendmsg_afalg, METH_VARARGS | METH_KEYWORDS,
+ {"sendmsg_afalg", (PyCFunction)(void(*)(void))sock_sendmsg_afalg, METH_VARARGS | METH_KEYWORDS,
sendmsg_afalg_doc},
#endif
{NULL, NULL} /* sentinel */
@@ -6741,7 +6741,7 @@ static PyMethodDef socket_methods[] = {
{"inet_ntop", socket_inet_ntop,
METH_VARARGS, inet_ntop_doc},
#endif
- {"getaddrinfo", (PyCFunction)socket_getaddrinfo,
+ {"getaddrinfo", (PyCFunction)(void(*)(void))socket_getaddrinfo,
METH_VARARGS | METH_KEYWORDS, getaddrinfo_doc},
{"getnameinfo", socket_getnameinfo,
METH_VARARGS, getnameinfo_doc},
diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c
index a5807dc..b2ea73b 100644
--- a/Modules/syslogmodule.c
+++ b/Modules/syslogmodule.c
@@ -238,7 +238,7 @@ syslog_log_upto(PyObject *self, PyObject *args)
/* List of functions defined in the module */
static PyMethodDef syslog_methods[] = {
- {"openlog", (PyCFunction) syslog_openlog, METH_VARARGS | METH_KEYWORDS},
+ {"openlog", (PyCFunction)(void(*)(void)) syslog_openlog, METH_VARARGS | METH_KEYWORDS},
{"closelog", syslog_closelog, METH_NOARGS},
{"syslog", syslog_syslog, METH_VARARGS},
{"setlogmask", syslog_setlogmask, METH_VARARGS},
diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c
index 11242d7..d9cb4cd 100644
--- a/Modules/xxsubtype.c
+++ b/Modules/xxsubtype.c
@@ -70,10 +70,10 @@ static PyMethodDef spamlist_methods[] = {
PyDoc_STR("setstate(state)")},
/* These entries differ only in the flags; they are used by the tests
in test.test_descr. */
- {"classmeth", (PyCFunction)spamlist_specialmeth,
+ {"classmeth", (PyCFunction)(void(*)(void))spamlist_specialmeth,
METH_VARARGS | METH_KEYWORDS | METH_CLASS,
PyDoc_STR("classmeth(*args, **kw)")},
- {"staticmeth", (PyCFunction)spamlist_specialmeth,
+ {"staticmeth", (PyCFunction)(void(*)(void))spamlist_specialmeth,
METH_VARARGS | METH_KEYWORDS | METH_STATIC,
PyDoc_STR("staticmeth(*args, **kw)")},
{NULL, NULL},