Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: runtime/bin/eventhandler_macos.cc

Issue 139043003: - Address warnings about 64-bit to 32-bit conversions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/eventhandler.cc ('k') | runtime/bin/file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_macos.cc
===================================================================
--- runtime/bin/eventhandler_macos.cc (revision 31864)
+++ runtime/bin/eventhandler_macos.cc (working copy)
@@ -256,7 +256,9 @@
DartUtils::PostInt32(msg[i].dart_port, 1 << kCloseEvent);
} else {
// Setup events to wait for.
- sd->SetPortAndMask(msg[i].dart_port, msg[i].data);
+ ASSERT((msg[i].data > 0) && (msg[i].data < kIntptrMax));
+ sd->SetPortAndMask(msg[i].dart_port,
+ static_cast<intptr_t>(msg[i].data));
UpdateKqueue(kqueue_fd_, sd);
}
}
@@ -411,8 +413,10 @@
struct timespec* timeout = NULL;
struct timespec ts;
if (millis >= 0) {
- ts.tv_sec = millis / 1000;
- ts.tv_nsec = (millis - (ts.tv_sec * 1000)) * 1000000;
+ int32_t millis32 = static_cast<int32_t>(millis);
+ int32_t secs = millis32 / 1000;
+ ts.tv_sec = secs;
+ ts.tv_nsec = (millis32 - (secs * 1000)) * 1000000;
timeout = &ts;
}
intptr_t result = TEMP_FAILURE_RETRY(kevent(handler_impl->kqueue_fd_,
« no previous file with comments | « runtime/bin/eventhandler.cc ('k') | runtime/bin/file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698