# HG changeset patch # User Akos Ladanyi # Date 2008-10-09 12:58:24 # Node ID c887e703b5668cf917c2c632ae605c498efb6f50 # Parent e57e10a8ea1b3b89a3350af00e85ca51d7ad1dfc Fix an erroneous const declaration in ArgParser diff --git a/demo/arg_parser_demo.cc b/demo/arg_parser_demo.cc --- a/demo/arg_parser_demo.cc +++ b/demo/arg_parser_demo.cc @@ -27,7 +27,7 @@ #include using namespace lemon; -int main(int argc, const char **argv) +int main(int argc, char **argv) { // Initialize the argument parser ArgParser ap(argc, argv); diff --git a/lemon/arg_parser.cc b/lemon/arg_parser.cc --- a/lemon/arg_parser.cc +++ b/lemon/arg_parser.cc @@ -26,12 +26,11 @@ exit(1); } - ArgParser::ArgParser(int argc, const char **argv) :_argc(argc), _argv(argv), - _command_name(argv[0]) { + ArgParser::ArgParser(int argc, const char * const *argv) + :_argc(argc), _argv(argv), _command_name(argv[0]) { funcOption("-help","Print a short help message",_showHelp,this); synonym("help","-help"); synonym("h","-help"); - } ArgParser::~ArgParser() diff --git a/lemon/arg_parser.h b/lemon/arg_parser.h --- a/lemon/arg_parser.h +++ b/lemon/arg_parser.h @@ -46,7 +46,7 @@ protected: int _argc; - const char **_argv; + const char * const *_argv; enum OptType { UNKNOWN=0, BOOL=1, STRING=2, DOUBLE=3, INTEGER=4, FUNC=5 }; @@ -119,7 +119,7 @@ public: ///Constructor - ArgParser(int argc, const char **argv); + ArgParser(int argc, const char * const *argv); ~ArgParser();