This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Cygwin: Make sure fraction of seconds constants enforce 64 bit computation
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org
- Date: 20 Feb 2018 14:07:40 -0000
- Subject: [newlib-cygwin] Cygwin: Make sure fraction of seconds constants enforce 64 bit computation
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=0a3f4e6087e0e44fd36ca2d88f619fae2dfaa02c
commit 0a3f4e6087e0e44fd36ca2d88f619fae2dfaa02c
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Tue Feb 20 15:05:23 2018 +0100
Cygwin: Make sure fraction of seconds constants enforce 64 bit computation
Dropping the 'LL' specifier leads to 32 bit truncation during timestamp
computation. Revert it. Exempt MSPERSEC which is used for 32 bit values.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/hires.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/winsup/cygwin/hires.h b/winsup/cygwin/hires.h
index a28efcd..5c75cf6 100644
--- a/winsup/cygwin/hires.h
+++ b/winsup/cygwin/hires.h
@@ -30,13 +30,13 @@ details. */
/* 100ns difference between Windows and UNIX timebase. */
#define FACTOR (0x19db1ded53e8000LL)
/* # of nanosecs per second. */
-#define NSPERSEC (1000000000)
+#define NSPERSEC (1000000000LL)
/* # of 100ns intervals per second. */
-#define NS100PERSEC (10000000)
+#define NS100PERSEC (10000000LL)
/* # of microsecs per second. */
-#define USPERSEC (1000000)
+#define USPERSEC (1000000LL)
/* # of millisecs per second. */
-#define MSPERSEC (1000)
+#define MSPERSEC (1000L)
class hires_base
{