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

Side by Side Diff: src/base/platform/time.cc

Issue 1237753004: Add -Wshorten-64-to-32 flag to mac builds. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix nit, clang formatted. Created 5 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 unified diff | Download patch
« no previous file with comments | « build/standalone.gypi ('k') | src/gdb-jit.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/base/platform/time.h" 5 #include "src/base/platform/time.h"
6 6
7 #if V8_OS_POSIX 7 #if V8_OS_POSIX
8 #include <fcntl.h> // for O_RDONLY 8 #include <fcntl.h> // for O_RDONLY
9 #include <sys/time.h> 9 #include <sys/time.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 DCHECK_LT(ts.tv_nsec, 104 DCHECK_LT(ts.tv_nsec,
105 static_cast<long>(Time::kNanosecondsPerSecond)); // NOLINT 105 static_cast<long>(Time::kNanosecondsPerSecond)); // NOLINT
106 return TimeDelta(ts.tv_sec * Time::kMicrosecondsPerSecond + 106 return TimeDelta(ts.tv_sec * Time::kMicrosecondsPerSecond +
107 ts.tv_nsec / Time::kNanosecondsPerMicrosecond); 107 ts.tv_nsec / Time::kNanosecondsPerMicrosecond);
108 } 108 }
109 109
110 110
111 struct mach_timespec TimeDelta::ToMachTimespec() const { 111 struct mach_timespec TimeDelta::ToMachTimespec() const {
112 struct mach_timespec ts; 112 struct mach_timespec ts;
113 DCHECK(delta_ >= 0); 113 DCHECK(delta_ >= 0);
114 ts.tv_sec = delta_ / Time::kMicrosecondsPerSecond; 114 ts.tv_sec = static_cast<unsigned>(delta_ / Time::kMicrosecondsPerSecond);
115 ts.tv_nsec = (delta_ % Time::kMicrosecondsPerSecond) * 115 ts.tv_nsec = (delta_ % Time::kMicrosecondsPerSecond) *
116 Time::kNanosecondsPerMicrosecond; 116 Time::kNanosecondsPerMicrosecond;
117 return ts; 117 return ts;
118 } 118 }
119 119
120 #endif // V8_OS_MACOSX 120 #endif // V8_OS_MACOSX
121 121
122 122
123 #if V8_OS_POSIX 123 #if V8_OS_POSIX
124 124
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 638
639 639
640 // static 640 // static
641 bool TimeTicks::KernelTimestampAvailable() { 641 bool TimeTicks::KernelTimestampAvailable() {
642 return kernel_tick_clock.Pointer()->Available(); 642 return kernel_tick_clock.Pointer()->Available();
643 } 643 }
644 644
645 #endif // V8_OS_WIN 645 #endif // V8_OS_WIN
646 646
647 } } // namespace v8::base 647 } } // namespace v8::base
OLDNEW
« no previous file with comments | « build/standalone.gypi ('k') | src/gdb-jit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698