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

Unified Diff: net/quic/quic_time.cc

Issue 1498003003: Remove kint64max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: INT64_MAX 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 | « net/quic/quic_time.h ('k') | ppapi/proxy/file_io_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_time.cc
diff --git a/net/quic/quic_time.cc b/net/quic/quic_time.cc
index 83217180c386fa70e93b93d514eae0966515bb67..2b3684bdca54109901e61ee029b12a444710e29c 100644
--- a/net/quic/quic_time.cc
+++ b/net/quic/quic_time.cc
@@ -4,17 +4,17 @@
#include "net/quic/quic_time.h"
-#include <stdint.h>
+#include <limits>
#include "base/logging.h"
namespace net {
-uint64 QuicWallTime::ToUNIXSeconds() const {
+uint64_t QuicWallTime::ToUNIXSeconds() const {
return microseconds_ / 1000000;
}
-uint64 QuicWallTime::ToUNIXMicroseconds() const {
+uint64_t QuicWallTime::ToUNIXMicroseconds() const {
return microseconds_;
}
@@ -31,7 +31,7 @@ bool QuicWallTime::IsZero() const {
}
QuicTime::Delta QuicWallTime::AbsoluteDifference(QuicWallTime other) const {
- uint64 d;
+ uint64_t d;
if (microseconds_ > other.microseconds_) {
d = microseconds_ - other.microseconds_;
@@ -39,23 +39,23 @@ QuicTime::Delta QuicWallTime::AbsoluteDifference(QuicWallTime other) const {
d = other.microseconds_ - microseconds_;
}
- if (d > static_cast<uint64>(kint64max)) {
- d = kint64max;
+ if (d > static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) {
+ d = std::numeric_limits<int64_t>::max();
}
return QuicTime::Delta::FromMicroseconds(d);
}
QuicWallTime QuicWallTime::Add(QuicTime::Delta delta) const {
- uint64 microseconds = microseconds_ + delta.ToMicroseconds();
+ uint64_t microseconds = microseconds_ + delta.ToMicroseconds();
if (microseconds < microseconds_) {
- microseconds = kuint64max;
+ microseconds = std::numeric_limits<uint64_t>::max();
}
return QuicWallTime(microseconds);
}
// TODO(ianswett) Test this.
QuicWallTime QuicWallTime::Subtract(QuicTime::Delta delta) const {
- uint64 microseconds = microseconds_ - delta.ToMicroseconds();
+ uint64_t microseconds = microseconds_ - delta.ToMicroseconds();
if (microseconds > microseconds_) {
microseconds = 0;
}
« no previous file with comments | « net/quic/quic_time.h ('k') | ppapi/proxy/file_io_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698