History

Use invalid port to signal no value passed

Atlante45 committed 10 years ago

Commit eb007b21 parent 12eb65c8 files · +19 −19Browse files

Showing the changes to interface/src/Application.cpp (1 of 8 files). Show all

Unified · Split

interface/src/Application.cpp+2−4
@@ -401,12 +401,10 @@ static const QString STATE_GROUNDED = "Grounded"; · 400 unmodified lines
401401 static const QString STATE_NAV_FOCUSED = "NavigationFocused";
402402
403403 bool setupEssentials(int& argc, char** argv) {
404− unsigned int listenPort = 0; // bind to an ephemeral port by default
405404 const char** constArgv = const_cast<const char**>(argv);
406405 const char* portStr = getCmdOption(argc, constArgv, "--listenPort");
407− if (portStr) {
408− listenPort = atoi(portStr);
409− }
406+ const int listenPort = portStr ? atoi(portStr) : INVALID_PORT;
407+
410408 // Set build version
411409 QCoreApplication::setApplicationVersion(BuildInfo::VERSION);
412410