Fix an erroneous const declaration in ArgParser
authorAkos Ladanyi <ladanyi@tmit.bme.hu>
Thu, 09 Oct 2008 11:58:24 +0100
changeset 315c887e703b566
parent 313 e57e10a8ea1b
child 316 a4d499904482
Fix an erroneous const declaration in ArgParser
demo/arg_parser_demo.cc
lemon/arg_parser.cc
lemon/arg_parser.h
     1.1 --- a/demo/arg_parser_demo.cc	Wed Oct 08 17:05:01 2008 +0100
     1.2 +++ b/demo/arg_parser_demo.cc	Thu Oct 09 11:58:24 2008 +0100
     1.3 @@ -27,7 +27,7 @@
     1.4  #include <lemon/arg_parser.h>
     1.5  
     1.6  using namespace lemon;
     1.7 -int main(int argc, const char **argv)
     1.8 +int main(int argc, char **argv)
     1.9  {
    1.10    // Initialize the argument parser
    1.11    ArgParser ap(argc, argv);
     2.1 --- a/lemon/arg_parser.cc	Wed Oct 08 17:05:01 2008 +0100
     2.2 +++ b/lemon/arg_parser.cc	Thu Oct 09 11:58:24 2008 +0100
     2.3 @@ -26,12 +26,11 @@
     2.4      exit(1);
     2.5    }
     2.6  
     2.7 -  ArgParser::ArgParser(int argc, const char **argv) :_argc(argc), _argv(argv),
     2.8 -                                                     _command_name(argv[0]) {
     2.9 +  ArgParser::ArgParser(int argc, const char * const *argv)
    2.10 +    :_argc(argc), _argv(argv), _command_name(argv[0]) {
    2.11      funcOption("-help","Print a short help message",_showHelp,this);
    2.12      synonym("help","-help");
    2.13      synonym("h","-help");
    2.14 -
    2.15    }
    2.16  
    2.17    ArgParser::~ArgParser()
     3.1 --- a/lemon/arg_parser.h	Wed Oct 08 17:05:01 2008 +0100
     3.2 +++ b/lemon/arg_parser.h	Thu Oct 09 11:58:24 2008 +0100
     3.3 @@ -46,7 +46,7 @@
     3.4    protected:
     3.5  
     3.6      int _argc;
     3.7 -    const char **_argv;
     3.8 +    const char * const *_argv;
     3.9  
    3.10      enum OptType { UNKNOWN=0, BOOL=1, STRING=2, DOUBLE=3, INTEGER=4, FUNC=5 };
    3.11  
    3.12 @@ -119,7 +119,7 @@
    3.13    public:
    3.14  
    3.15      ///Constructor
    3.16 -    ArgParser(int argc, const char **argv);
    3.17 +    ArgParser(int argc, const char * const *argv);
    3.18  
    3.19      ~ArgParser();
    3.20