From 023892a4d00b911e19330051d36989793fc371f6 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 16 Sep 2013 16:02:05 -0700 Subject: [PATCH] command line options --- libraries/voxel-server-library/src/VoxelServer.cpp | 6 +++--- libraries/voxel-server-library/src/VoxelServer.h | 2 +- voxel-server/src/main.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/voxel-server-library/src/VoxelServer.cpp b/libraries/voxel-server-library/src/VoxelServer.cpp index c4633ee1fe..c4f3d77dd9 100644 --- a/libraries/voxel-server-library/src/VoxelServer.cpp +++ b/libraries/voxel-server-library/src/VoxelServer.cpp @@ -63,7 +63,7 @@ pthread_mutex_t treeLock; NodeWatcher nodeWatcher; // used to cleanup AGENT data when agents are killed int VoxelServer::_argc = 0; -char** VoxelServer::_argv = NULL; +const char** VoxelServer::_argv = NULL; void attachVoxelNodeDataToNode(Node* newNode) { if (newNode->getLinkedData() == NULL) { @@ -73,7 +73,7 @@ void attachVoxelNodeDataToNode(Node* newNode) { void VoxelServer::setArguments(int argc, char** argv) { _argc = argc; - _argv = argv; + _argv = const_cast(argv); } @@ -86,7 +86,7 @@ void VoxelServer::run() { int listenPort = VOXEL_LISTEN_PORT; // Check to see if the user passed in a command line option for setting listen port const char* PORT_PARAMETER = "--port"; - const char* portParameter = getCmdOption(_argc, (const char*[])_argv, PORT_PARAMETER); + const char* portParameter = getCmdOption(_argc, _argv, PORT_PARAMETER); if (portParameter) { listenPort = atoi(portParameter); if (listenPort < 1) { diff --git a/libraries/voxel-server-library/src/VoxelServer.h b/libraries/voxel-server-library/src/VoxelServer.h index a778e96296..f9740e8c4b 100644 --- a/libraries/voxel-server-library/src/VoxelServer.h +++ b/libraries/voxel-server-library/src/VoxelServer.h @@ -64,7 +64,7 @@ public: private: static int _argc; - static char** _argv; + static const char** _argv; }; diff --git a/voxel-server/src/main.cpp b/voxel-server/src/main.cpp index 0e26de1f52..5a21b9fc76 100644 --- a/voxel-server/src/main.cpp +++ b/voxel-server/src/main.cpp @@ -9,7 +9,7 @@ #include int main(int argc, const char * argv[]) { - VoxelServer::setArguments(argc, argv[]); + VoxelServer::setArguments(argc, const_cast(argv)); VoxelServer::run(); }