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

Unified Diff: src/base/platform/time.cc

Issue 1111733002: [clang] Use -Wshorten-64-to-32 to enable warnings about 64bit to 32bit truncations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Win warnings. Created 5 years, 8 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 | « src/base/platform/platform-win32.cc ('k') | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/time.cc
diff --git a/src/base/platform/time.cc b/src/base/platform/time.cc
index a2594f471dab2aff5a114ce43b7e77caffdc5130..b6a11cff34f313661536eb0d20b43cf7d598e479 100644
--- a/src/base/platform/time.cc
+++ b/src/base/platform/time.cc
@@ -133,7 +133,7 @@ TimeDelta TimeDelta::FromTimespec(struct timespec ts) {
struct timespec TimeDelta::ToTimespec() const {
struct timespec ts;
- ts.tv_sec = delta_ / Time::kMicrosecondsPerSecond;
+ ts.tv_sec = static_cast<time_t>(delta_ / Time::kMicrosecondsPerSecond);
ts.tv_nsec = (delta_ % Time::kMicrosecondsPerSecond) *
Time::kNanosecondsPerMicrosecond;
return ts;
@@ -292,7 +292,7 @@ struct timespec Time::ToTimespec() const {
ts.tv_nsec = static_cast<long>(kNanosecondsPerSecond - 1); // NOLINT
return ts;
}
- ts.tv_sec = us_ / kMicrosecondsPerSecond;
+ ts.tv_sec = static_cast<time_t>(us_ / kMicrosecondsPerSecond);
ts.tv_nsec = (us_ % kMicrosecondsPerSecond) * kNanosecondsPerMicrosecond;
return ts;
}
@@ -324,7 +324,7 @@ struct timeval Time::ToTimeval() const {
tv.tv_usec = static_cast<suseconds_t>(kMicrosecondsPerSecond - 1);
return tv;
}
- tv.tv_sec = us_ / kMicrosecondsPerSecond;
+ tv.tv_sec = static_cast<time_t>(us_ / kMicrosecondsPerSecond);
tv.tv_usec = us_ % kMicrosecondsPerSecond;
return tv;
}
« no previous file with comments | « src/base/platform/platform-win32.cc ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698