about summary refs log tree commit diff
path: root/src/libnative
diff options
context:
space:
mode:
authorFalco Hirschenberger <falco.hirschenberger@gmail.com>2014-05-03 00:13:26 +0200
committerFalco Hirschenberger <falco.hirschenberger@gmail.com>2014-05-03 00:13:26 +0200
commit6c26cbb6026194a280fa0f33c794d4397ad426da (patch)
treeb648bcff3efbbaa001274ccd134f3476bfa68359 /src/libnative
parent239557de6de72748a5c7604081b202d53f7d9ac9 (diff)
downloadrust-6c26cbb6026194a280fa0f33c794d4397ad426da.tar.gz
rust-6c26cbb6026194a280fa0f33c794d4397ad426da.zip
Add lint check for negating uint literals and variables.
See #11273 and #13318
Diffstat (limited to 'src/libnative')
-rw-r--r--src/libnative/io/timer_win32.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libnative/io/timer_win32.rs b/src/libnative/io/timer_win32.rs
index 588ec367d81..15e6e62421a 100644
--- a/src/libnative/io/timer_win32.rs
+++ b/src/libnative/io/timer_win32.rs
@@ -137,7 +137,7 @@ impl rtio::RtioTimer for Timer {
 
         // there are 10^6 nanoseconds in a millisecond, and the parameter is in
         // 100ns intervals, so we multiply by 10^4.
-        let due = -(msecs * 10000) as libc::LARGE_INTEGER;
+        let due = -(msecs as i64 * 10000) as libc::LARGE_INTEGER;
         assert_eq!(unsafe {
             imp::SetWaitableTimer(self.obj, &due, 0, ptr::null(),
                                   ptr::mut_null(), 0)
@@ -151,7 +151,7 @@ impl rtio::RtioTimer for Timer {
         let (tx, rx) = channel();
 
         // see above for the calculation
-        let due = -(msecs * 10000) as libc::LARGE_INTEGER;
+        let due = -(msecs as i64 * 10000) as libc::LARGE_INTEGER;
         assert_eq!(unsafe {
             imp::SetWaitableTimer(self.obj, &due, 0, ptr::null(),
                                   ptr::mut_null(), 0)
@@ -167,7 +167,7 @@ impl rtio::RtioTimer for Timer {
         let (tx, rx) = channel();
 
         // see above for the calculation
-        let due = -(msecs * 10000) as libc::LARGE_INTEGER;
+        let due = -(msecs as i64 * 10000) as libc::LARGE_INTEGER;
         assert_eq!(unsafe {
             imp::SetWaitableTimer(self.obj, &due, msecs as libc::LONG,
                                   ptr::null(), ptr::mut_null(), 0)