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

Unified Diff: runtime/vm/os_macos.cc

Issue 415513002: - Fix a lot of warnings generated by -Wshorten-64-to-32 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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/vm/os_linux.cc ('k') | runtime/vm/os_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_macos.cc
===================================================================
--- runtime/vm/os_macos.cc (revision 38492)
+++ runtime/vm/os_macos.cc (working copy)
@@ -99,32 +99,19 @@
}
-word OS::ActivationFrameAlignment() {
+intptr_t OS::ActivationFrameAlignment() {
// OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI
// Function Call Guide".
return 16;
}
-word OS::PreferredCodeAlignment() {
+intptr_t OS::PreferredCodeAlignment() {
ASSERT(32 <= OS::kMaxPreferredCodeAlignment);
return 32;
}
-uword OS::GetStackSizeLimit() {
- struct rlimit stack_limit;
- int retval = getrlimit(RLIMIT_STACK, &stack_limit);
- ASSERT(retval == 0);
- if (stack_limit.rlim_cur > INT_MAX) {
- retval = INT_MAX;
- } else {
- retval = stack_limit.rlim_cur;
- }
- return retval;
-}
-
-
bool OS::AllowStackFrameIteratorFromAnotherThread() {
return false;
}
@@ -145,10 +132,14 @@
struct timespec req; // requested.
struct timespec rem; // remainder.
int64_t seconds = micros / kMicrosecondsPerSecond;
+ if (seconds > kMaxInt32) {
+ // Avoid truncation of overly large sleep values.
+ seconds = kMaxInt32;
+ }
micros = micros - seconds * kMicrosecondsPerSecond;
int64_t nanos = micros * kNanosecondsPerMicrosecond;
- req.tv_sec = seconds;
- req.tv_nsec = nanos;
+ req.tv_sec = static_cast<int32_t>(seconds);
+ req.tv_nsec = static_cast<long>(nanos); // NOLINT (long used in timespec).
while (true) {
int r = nanosleep(&req, &rem);
if (r == 0) {
« no previous file with comments | « runtime/vm/os_linux.cc ('k') | runtime/vm/os_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698