mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
_datetimemodule.c: fix the compilation warning "conversion from 'double' to
'long', possible loss of data" in delta_new(), use an explicit cast from double to long
This commit is contained in:
parent
b9981ba680
commit
36a5a062dc
1 changed files with 1 additions and 1 deletions
|
@ -2160,7 +2160,7 @@ delta_new(PyTypeObject *type, PyObject *args, PyObject *kw)
|
||||||
whole_us = 2.0 * round((leftover_us + x_is_odd) * 0.5) - x_is_odd;
|
whole_us = 2.0 * round((leftover_us + x_is_odd) * 0.5) - x_is_odd;
|
||||||
}
|
}
|
||||||
|
|
||||||
temp = PyLong_FromLong(whole_us);
|
temp = PyLong_FromLong((long)whole_us);
|
||||||
|
|
||||||
if (temp == NULL) {
|
if (temp == NULL) {
|
||||||
Py_DECREF(x);
|
Py_DECREF(x);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue