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

Unified Diff: webrtc/base/socketaddress.cc

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 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 | « webrtc/base/socketaddress.h ('k') | webrtc/base/sslfingerprint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/socketaddress.cc
diff --git a/webrtc/base/socketaddress.cc b/webrtc/base/socketaddress.cc
index b15c0c48b618a22df3e87fc78ee3b9e8cf5595b3..3f13c385a961da2b3df892400842f88b9ce66de1 100644
--- a/webrtc/base/socketaddress.cc
+++ b/webrtc/base/socketaddress.cc
@@ -47,7 +47,7 @@ SocketAddress::SocketAddress(const std::string& hostname, int port) {
SetPort(port);
}
-SocketAddress::SocketAddress(uint32 ip_as_host_order_integer, int port) {
+SocketAddress::SocketAddress(uint32_t ip_as_host_order_integer, int port) {
SetIP(IPAddress(ip_as_host_order_integer));
SetPort(port);
}
@@ -86,7 +86,7 @@ SocketAddress& SocketAddress::operator=(const SocketAddress& addr) {
return *this;
}
-void SocketAddress::SetIP(uint32 ip_as_host_order_integer) {
+void SocketAddress::SetIP(uint32_t ip_as_host_order_integer) {
hostname_.clear();
literal_ = false;
ip_ = IPAddress(ip_as_host_order_integer);
@@ -109,7 +109,7 @@ void SocketAddress::SetIP(const std::string& hostname) {
scope_id_ = 0;
}
-void SocketAddress::SetResolvedIP(uint32 ip_as_host_order_integer) {
+void SocketAddress::SetResolvedIP(uint32_t ip_as_host_order_integer) {
ip_ = IPAddress(ip_as_host_order_integer);
scope_id_ = 0;
}
@@ -121,10 +121,10 @@ void SocketAddress::SetResolvedIP(const IPAddress& ip) {
void SocketAddress::SetPort(int port) {
ASSERT((0 <= port) && (port < 65536));
- port_ = static_cast<uint16>(port);
+ port_ = static_cast<uint16_t>(port);
}
-uint32 SocketAddress::ip() const {
+uint32_t SocketAddress::ip() const {
return ip_.v4AddressAsHostOrderInteger();
}
@@ -132,7 +132,7 @@ const IPAddress& SocketAddress::ipaddr() const {
return ip_;
}
-uint16 SocketAddress::port() const {
+uint16_t SocketAddress::port() const {
return port_;
}
@@ -279,7 +279,9 @@ bool SocketAddress::FromSockAddr(const sockaddr_in& saddr) {
}
static size_t ToSockAddrStorageHelper(sockaddr_storage* addr,
- IPAddress ip, uint16 port, int scope_id) {
+ IPAddress ip,
+ uint16_t port,
+ int scope_id) {
memset(addr, 0, sizeof(sockaddr_storage));
addr->ss_family = static_cast<unsigned short>(ip.family());
if (addr->ss_family == AF_INET6) {
@@ -305,15 +307,15 @@ size_t SocketAddress::ToSockAddrStorage(sockaddr_storage* addr) const {
return ToSockAddrStorageHelper(addr, ip_, port_, scope_id_);
}
-std::string SocketAddress::IPToString(uint32 ip_as_host_order_integer) {
+std::string SocketAddress::IPToString(uint32_t ip_as_host_order_integer) {
return IPAddress(ip_as_host_order_integer).ToString();
}
-std::string IPToSensitiveString(uint32 ip_as_host_order_integer) {
+std::string IPToSensitiveString(uint32_t ip_as_host_order_integer) {
return IPAddress(ip_as_host_order_integer).ToSensitiveString();
}
-bool SocketAddress::StringToIP(const std::string& hostname, uint32* ip) {
+bool SocketAddress::StringToIP(const std::string& hostname, uint32_t* ip) {
in_addr addr;
if (rtc::inet_pton(AF_INET, hostname.c_str(), &addr) == 0)
return false;
@@ -340,8 +342,8 @@ bool SocketAddress::StringToIP(const std::string& hostname, IPAddress* ip) {
return false;
}
-uint32 SocketAddress::StringToIP(const std::string& hostname) {
- uint32 ip = 0;
+uint32_t SocketAddress::StringToIP(const std::string& hostname) {
+ uint32_t ip = 0;
StringToIP(hostname, &ip);
return ip;
}
« no previous file with comments | « webrtc/base/socketaddress.h ('k') | webrtc/base/sslfingerprint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698