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

Unified Diff: net/quic/quic_socket_address_coder.cc

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef 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_socket_address_coder.h ('k') | net/quic/quic_socket_address_coder_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_socket_address_coder.cc
diff --git a/net/quic/quic_socket_address_coder.cc b/net/quic/quic_socket_address_coder.cc
index 3d0031d188f8b92d33fd18e0c39a62edf3301627..bd28353e8640fc19d8cd6fd6169d8b7ee635b21b 100644
--- a/net/quic/quic_socket_address_coder.cc
+++ b/net/quic/quic_socket_address_coder.cc
@@ -14,8 +14,8 @@ namespace {
// For convenience, the values of these constants match the values of AF_INET
// and AF_INET6 on Linux.
-const uint16 kIPv4 = 2;
-const uint16 kIPv6 = 10;
+const uint16_t kIPv4 = 2;
+const uint16_t kIPv6 = 10;
} // namespace
@@ -28,7 +28,7 @@ QuicSocketAddressCoder::~QuicSocketAddressCoder() {}
string QuicSocketAddressCoder::Encode() const {
string serialized;
- uint16 address_family;
+ uint16_t address_family;
switch (address_.GetSockAddrFamily()) {
case AF_INET:
address_family = kIPv4;
@@ -42,13 +42,13 @@ string QuicSocketAddressCoder::Encode() const {
serialized.append(reinterpret_cast<const char*>(&address_family),
sizeof(address_family));
serialized.append(IPAddressToPackedString(address_.address()));
- uint16 port = address_.port();
+ uint16_t port = address_.port();
serialized.append(reinterpret_cast<const char*>(&port), sizeof(port));
return serialized;
}
bool QuicSocketAddressCoder::Decode(const char* data, size_t length) {
- uint16 address_family;
+ uint16_t address_family;
if (length < sizeof(address_family)) {
return false;
}
@@ -75,7 +75,7 @@ bool QuicSocketAddressCoder::Decode(const char* data, size_t length) {
data += ip_length;
length -= ip_length;
- uint16 port;
+ uint16_t port;
if (length != sizeof(port)) {
return false;
}
« no previous file with comments | « net/quic/quic_socket_address_coder.h ('k') | net/quic/quic_socket_address_coder_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698