diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-11-11 02:05:51 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-11-11 04:08:05 +0300 |
commit | 9826599cb089611f78532e583acb467572868732 (patch) | |
tree | bf9d0844287da6d25d58cdcc817e7563a053bd64 /moses/Parameter.cpp | |
parent | d7278293877afe443a8668d5abea25bb37542c6e (diff) |
Enforce const-ness of command line arguments; bug fix in mosesserver.cpp.
Diffstat (limited to 'moses/Parameter.cpp')
-rw-r--r-- | moses/Parameter.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/moses/Parameter.cpp b/moses/Parameter.cpp index 183519247..8ab5d7ad2 100644 --- a/moses/Parameter.cpp +++ b/moses/Parameter.cpp @@ -444,17 +444,17 @@ Parameter:: LoadParam(const string &filePath) { const char *argv[] = {"executable", "-f", filePath.c_str() }; - return LoadParam(3, (char**) argv); + return LoadParam(3, (char const**) argv); } /** load all parameters from the configuration file and the command line switches */ bool Parameter:: -LoadParam(int argc, char* xargv[]) +LoadParam(int argc, char const* xargv[]) { // legacy parameter handling: all parameters are expected // to start with a single dash - char* argv[argc+1]; + char const* argv[argc+1]; for (int i = 0; i < argc; ++i) { argv[i] = xargv[i]; if (strlen(argv[i]) > 2 && argv[i][0] == '-' && argv[i][1] == '-') @@ -1330,7 +1330,7 @@ FilesExist(const string ¶mName, int fieldNo, // in moses-cmd string Parameter:: -FindParam(const string ¶mSwitch, int argc, char* argv[]) +FindParam(const string ¶mSwitch, int argc, char const* argv[]) { for (int i = 0 ; i < argc ; i++) { if (string(argv[i]) == paramSwitch) { @@ -1352,7 +1352,8 @@ FindParam(const string ¶mSwitch, int argc, char* argv[]) * \param argv values of paramters on command line */ void Parameter:: -OverwriteParam(const string ¶mSwitch, const string ¶mName, int argc, char* argv[]) +OverwriteParam(const string ¶mSwitch, const string ¶mName, + int argc, char const* argv[]) { int startPos = -1; for (int i = 0 ; i < argc ; i++) { |