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

Unified Diff: webrtc/p2p/base/candidate.h

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/p2p/base/basicpacketsocketfactory.cc ('k') | webrtc/p2p/base/dtlstransport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/candidate.h
diff --git a/webrtc/p2p/base/candidate.h b/webrtc/p2p/base/candidate.h
index 2655c1b26c2b02639550cb3d88938274b7b62c79..3f0ea43cde21fd9239ceb48d65bdaa9b5fc1b8bf 100644
--- a/webrtc/p2p/base/candidate.h
+++ b/webrtc/p2p/base/candidate.h
@@ -43,11 +43,11 @@ class Candidate {
Candidate(int component,
const std::string& protocol,
const rtc::SocketAddress& address,
- uint32 priority,
+ uint32_t priority,
const std::string& username,
const std::string& password,
const std::string& type,
- uint32 generation,
+ uint32_t generation,
const std::string& foundation)
: id_(rtc::CreateRandomString(8)),
component_(component),
@@ -81,8 +81,8 @@ class Candidate {
address_ = address;
}
- uint32 priority() const { return priority_; }
- void set_priority(const uint32 priority) { priority_ = priority; }
+ uint32_t priority() const { return priority_; }
+ void set_priority(const uint32_t priority) { priority_ = priority; }
// TODO(pthatcher): Remove once Chromium's jingle/glue/utils.cc
// doesn't use it.
@@ -98,11 +98,11 @@ class Candidate {
// TODO(pthatcher): Remove once Chromium's jingle/glue/utils.cc
// doesn't use it.
void set_preference(float preference) {
- // Limiting priority to UINT_MAX when value exceeds uint32 max.
+ // Limiting priority to UINT_MAX when value exceeds uint32_t max.
// This can happen for e.g. when preference = 3.
- uint64 prio_val = static_cast<uint64>(preference * 127) << 24;
- priority_ =
- static_cast<uint32>(std::min(prio_val, static_cast<uint64>(UINT_MAX)));
+ uint64_t prio_val = static_cast<uint64_t>(preference * 127) << 24;
+ priority_ = static_cast<uint32_t>(
+ std::min(prio_val, static_cast<uint64_t>(UINT_MAX)));
}
const std::string & username() const { return username_; }
@@ -125,8 +125,8 @@ class Candidate {
}
// Candidates in a new generation replace those in the old generation.
- uint32 generation() const { return generation_; }
- void set_generation(uint32 generation) { generation_ = generation; }
+ uint32_t generation() const { return generation_; }
+ void set_generation(uint32_t generation) { generation_ = generation; }
const std::string generation_str() const {
std::ostringstream ost;
ost << generation_;
@@ -177,9 +177,9 @@ class Candidate {
return ToStringInternal(true);
}
- uint32 GetPriority(uint32 type_preference,
- int network_adapter_preference,
- int relay_preference) const {
+ uint32_t GetPriority(uint32_t type_preference,
+ int network_adapter_preference,
+ int relay_preference) const {
// RFC 5245 - 4.1.2.1.
// priority = (2^24)*(type preference) +
// (2^8)*(local preference) +
@@ -222,13 +222,13 @@ class Candidate {
std::string protocol_;
std::string relay_protocol_;
rtc::SocketAddress address_;
- uint32 priority_;
+ uint32_t priority_;
std::string username_;
std::string password_;
std::string type_;
std::string network_name_;
rtc::AdapterType network_type_;
- uint32 generation_;
+ uint32_t generation_;
std::string foundation_;
rtc::SocketAddress related_address_;
std::string tcptype_;
« no previous file with comments | « webrtc/p2p/base/basicpacketsocketfactory.cc ('k') | webrtc/p2p/base/dtlstransport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698