summaryrefslogtreecommitdiff
path: root/Modules/_datetimemodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-11-27 13:27:31 +0200
committerGitHub <noreply@github.com>2018-11-27 13:27:31 +0200
commit62be74290aca26d16f3f55ece7ff6dad14e60e8d (patch)
tree656625bee7ca61fd87c6370407162522d8fb277f /Modules/_datetimemodule.c
parent81524022d0c0df7a41f9b2b2df41e2ebe140e610 (diff)
downloadcpython-git-62be74290aca26d16f3f55ece7ff6dad14e60e8d.tar.gz
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/_datetimemodule.c')
-rw-r--r--Modules/_datetimemodule.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 0054ea83c4..eb9c35d02d 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,