]> granicus.if.org Git - python/commitdiff
extract_time(): Squash compiler warning about possibly information-
authorTim Peters <tim.peters@gmail.com>
Tue, 10 Sep 2002 15:37:28 +0000 (15:37 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 10 Sep 2002 15:37:28 +0000 (15:37 +0000)
losing implicit double->long cast.

Modules/posixmodule.c

index 465cb5181d9eabaea0b8001dac60c51080a6e4e9..90c0aaca49bb05fb69210e9352982436a3c2fd68 100644 (file)
@@ -1412,7 +1412,7 @@ extract_time(PyObject *t, long* sec, long* usec)
                intval = PyInt_AsLong(intobj);
                Py_DECREF(intobj);
                *sec = intval;
-               *usec = (tval - intval) * 1e6;
+               *usec = (long)((tval - intval) * 1e6); /* can't exceed 1000000 */
                if (*usec < 0)
                        /* If rounding gave us a negative number,
                           truncate.  */