cpython: df074eb2a5be (original) (raw)
Mercurial > cpython
changeset 97574:df074eb2a5be
Issue #23517: Try to fix test_time on "x86 Ubuntu Shared 3.x" buildbot [#23517]
Victor Stinner victor.stinner@gmail.com | |
---|---|
date | Wed, 02 Sep 2015 11:58:56 +0200 |
parents | 3a361a56b88c |
children | 59185ef69166 |
files | Python/pytime.c |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-)[+] [-] Python/pytime.c 17 |
line wrap: on
line diff
--- a/Python/pytime.c +++ b/Python/pytime.c @@ -64,11 +64,13 @@ PyObject * static double _PyTime_RoundHalfUp(double x) {
- /* volatile avoids optimization changing how numbers are rounded */
- volatile double d = x;
- if (d >= 0.0)
elsed = floor(d + 0.5);[](#l1.12)
} @@ -77,7 +79,7 @@ static int double denominator, _PyTime_round_t round) { double intpart, err;
- /* volatile avoids optimization changing how numbers are rounded */ volatile double floatpart; floatpart = modf(d, &intpart); @@ -134,7 +136,8 @@ int _PyTime_ObjectToTime_t(PyObject *obj, time_t *sec, _PyTime_round_t round) { if (PyFloat_Check(obj)) {
double d, intpart, err;[](#l1.34)
/* volatile avoids optimization changing how numbers are rounded */[](#l1.35)
volatile double d, intpart, err;[](#l1.36)
d = PyFloat_AsDouble(obj); if (round == _PyTime_ROUND_HALF_UP) @@ -255,7 +258,7 @@ static int _PyTime_FromFloatObject(_PyTime_t *t, double value, _PyTime_round_t round, long to_nanoseconds) {