command line options

This commit is contained in:
ZappoMan 2013-09-16 16:02:05 -07:00
parent c1e93b4bf1
commit 023892a4d0
3 changed files with 5 additions and 5 deletions

View file

@ -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<const char**>(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) {

View file

@ -64,7 +64,7 @@ public:
private:
static int _argc;
static char** _argv;
static const char** _argv;
};

View file

@ -9,7 +9,7 @@
#include <VoxelServer.h>
int main(int argc, const char * argv[]) {
VoxelServer::setArguments(argc, argv[]);
VoxelServer::setArguments(argc, const_cast<char**>(argv));
VoxelServer::run();
}