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

Unified Diff: media/cast/test/receiver.cc

Issue 655063002: Use uint16 for port numbers more pervasively. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert bad change Created 6 years, 1 month 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 | « extensions/common/permissions/socket_permission_entry.cc ('k') | media/cast/test/sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/test/receiver.cc
diff --git a/media/cast/test/receiver.cc b/media/cast/test/receiver.cc
index d608669d62a56c70571580dc04488b65035ab86c..72dda6955a1e6e0805218ce8551aac84350bbc1f 100644
--- a/media/cast/test/receiver.cc
+++ b/media/cast/test/receiver.cc
@@ -65,14 +65,14 @@ const char* kVideoWindowWidth = "1280";
const char* kVideoWindowHeight = "720";
#endif // defined(USE_X11)
-void GetPorts(int* tx_port, int* rx_port) {
+void GetPorts(uint16* tx_port, uint16* rx_port) {
test::InputBuilder tx_input(
- "Enter send port.", DEFAULT_SEND_PORT, 1, INT_MAX);
- *tx_port = tx_input.GetIntInput();
+ "Enter send port.", DEFAULT_SEND_PORT, 1, 65535);
+ *tx_port = static_cast<uint16>(tx_input.GetIntInput());
test::InputBuilder rx_input(
- "Enter receive port.", DEFAULT_RECEIVE_PORT, 1, INT_MAX);
- *rx_port = rx_input.GetIntInput();
+ "Enter receive port.", DEFAULT_RECEIVE_PORT, 1, 65535);
+ *rx_port = static_cast<uint16>(rx_input.GetIntInput());
}
std::string GetIpAddress(const std::string display_text) {
@@ -558,7 +558,7 @@ int main(int argc, char** argv) {
media::cast::GetVideoReceiverConfig();
// Determine local and remote endpoints.
- int remote_port, local_port;
+ uint16 remote_port, local_port;
media::cast::GetPorts(&remote_port, &local_port);
if (!local_port) {
LOG(ERROR) << "Invalid local port.";
« no previous file with comments | « extensions/common/permissions/socket_permission_entry.cc ('k') | media/cast/test/sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698