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

Unified Diff: base/time/time_mac.cc

Issue 1538743002: Switch to standard integer types in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DEPS roll too Created 5 years 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 | « base/time/time.cc ('k') | base/time/time_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time_mac.cc
diff --git a/base/time/time_mac.cc b/base/time/time_mac.cc
index 139e0c9e297ad7ec3d95e61447c801c8689a45bc..f2bc5ed8c97df69d114a9a86d84e5ad4209c96b2 100644
--- a/base/time/time_mac.cc
+++ b/base/time/time_mac.cc
@@ -8,18 +8,20 @@
#include <CoreFoundation/CFTimeZone.h>
#include <mach/mach.h>
#include <mach/mach_time.h>
+#include <stddef.h>
#include <stdint.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/mac/mach_logging.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/mac/scoped_mach_port.h"
+#include "base/macros.h"
#include "base/numerics/safe_conversions.h"
+#include "build/build_config.h"
namespace {
@@ -117,16 +119,16 @@ namespace base {
// => Thu Jan 01 00:00:00 UTC 1970
// irb(main):011:0> Time.at(-11644473600).getutc()
// => Mon Jan 01 00:00:00 UTC 1601
-static const int64 kWindowsEpochDeltaSeconds = INT64_C(11644473600);
+static const int64_t kWindowsEpochDeltaSeconds = INT64_C(11644473600);
// static
-const int64 Time::kWindowsEpochDeltaMicroseconds =
+const int64_t Time::kWindowsEpochDeltaMicroseconds =
kWindowsEpochDeltaSeconds * Time::kMicrosecondsPerSecond;
// Some functions in time.cc use time_t directly, so we provide an offset
// to convert from time_t (Unix epoch) and internal (Windows epoch).
// static
-const int64 Time::kTimeTToMicrosecondsOffset = kWindowsEpochDeltaMicroseconds;
+const int64_t Time::kTimeTToMicrosecondsOffset = kWindowsEpochDeltaMicroseconds;
// static
Time Time::Now() {
@@ -141,9 +143,9 @@ Time Time::FromCFAbsoluteTime(CFAbsoluteTime t) {
return Time(); // Consider 0 as a null Time.
if (t == std::numeric_limits<CFAbsoluteTime>::infinity())
return Max();
- return Time(static_cast<int64>(
- (t + kCFAbsoluteTimeIntervalSince1970) * kMicrosecondsPerSecond) +
- kWindowsEpochDeltaMicroseconds);
+ return Time(static_cast<int64_t>((t + kCFAbsoluteTimeIntervalSince1970) *
+ kMicrosecondsPerSecond) +
+ kWindowsEpochDeltaMicroseconds);
}
CFAbsoluteTime Time::ToCFAbsoluteTime() const {
@@ -178,14 +180,14 @@ Time Time::FromExploded(bool is_local, const Exploded& exploded) {
is_local ? CFTimeZoneCopySystem() : NULL);
CFAbsoluteTime seconds = CFGregorianDateGetAbsoluteTime(date, time_zone) +
kCFAbsoluteTimeIntervalSince1970;
- return Time(static_cast<int64>(seconds * kMicrosecondsPerSecond) +
- kWindowsEpochDeltaMicroseconds);
+ return Time(static_cast<int64_t>(seconds * kMicrosecondsPerSecond) +
+ kWindowsEpochDeltaMicroseconds);
}
void Time::Explode(bool is_local, Exploded* exploded) const {
// Avoid rounding issues, by only putting the integral number of seconds
// (rounded towards -infinity) into a |CFAbsoluteTime| (which is a |double|).
- int64 microsecond = us_ % kMicrosecondsPerSecond;
+ int64_t microsecond = us_ % kMicrosecondsPerSecond;
if (microsecond < 0)
microsecond += kMicrosecondsPerSecond;
CFAbsoluteTime seconds = ((us_ - microsecond) / kMicrosecondsPerSecond) -
« no previous file with comments | « base/time/time.cc ('k') | base/time/time_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698