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.
This commit is contained in:
Serhiy Storchaka 2018-11-27 13:27:31 +02:00 committed by GitHub
parent 81524022d0
commit 62be74290a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 174 additions and 174 deletions

View file

@ -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 */
};