]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-131296: fix clang-cl warning on Windows in pytime.c (GH-131297)
authorChris Eibl <138194463+chris-eibl@users.noreply.github.com>
Sat, 15 Mar 2025 18:41:34 +0000 (19:41 +0100)
committerGitHub <noreply@github.com>
Sat, 15 Mar 2025 18:41:34 +0000 (11:41 -0700)
fix warning : integer literal is too large

to be represented in a signed integer type,
interpreting as unsigned [-Wimplicitly-unsigned-literal]

Python/pytime.c

index 2ca92037c2e2f14f46ad5e31c0da10f283c49b41..23e1608633940efc5028fb04b6274bdde4216e29 100644 (file)
@@ -915,7 +915,7 @@ py_get_system_clock(PyTime_t *tp, _Py_clock_info_t *info, int raise_exc)
     /* 11,644,473,600,000,000,000: number of nanoseconds between
        the 1st january 1601 and the 1st january 1970 (369 years + 89 leap
        days). */
-    PyTime_t ns = large.QuadPart * 100 - 11644473600000000000;
+    PyTime_t ns = (large.QuadPart - 116444736000000000) * 100;
     *tp = ns;
     if (info) {
         // GetSystemTimePreciseAsFileTime() is implemented using