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
401static const QString STATE_NAV_FOCUSED = "NavigationFocused";401static const QString STATE_NAV_FOCUSED = "NavigationFocused";
402 402
403bool setupEssentials(int& argc, char** argv) {403bool setupEssentials(int& argc, char** argv) {
404 unsigned int listenPort = 0; // bind to an ephemeral port by default
405 const char** constArgv = const_cast<const char**>(argv);404 const char** constArgv = const_cast<const char**>(argv);
406 const char* portStr = getCmdOption(argc, constArgv, "--listenPort");405 const char* portStr = getCmdOption(argc, constArgv, "--listenPort");
407 if (portStr) {406 const int listenPort = portStr ? atoi(portStr) : INVALID_PORT;
408 listenPort = atoi(portStr);407
409 }
410 // Set build version408 // Set build version
411 QCoreApplication::setApplicationVersion(BuildInfo::VERSION);409 QCoreApplication::setApplicationVersion(BuildInfo::VERSION);
412 410