diff options
author | erihel <erihel@gmail.com> | 2013-03-17 23:16:26 +0100 |
---|---|---|
committer | erihel <erihel@gmail.com> | 2013-03-17 23:16:26 +0100 |
commit | 4abcaae0f718ab861fcde194250b7ffe3bf1c521 (patch) | |
tree | eeff061f9b67fc3e3b2eb43b8492ce726a5e957b /src/ui | |
parent | 21de71f871bc5add11235de2c86b9f08237591b7 (diff) | |
download | colobot-4abcaae0f718ab861fcde194250b7ffe3bf1c521.tar.gz colobot-4abcaae0f718ab861fcde194250b7ffe3bf1c521.tar.bz2 colobot-4abcaae0f718ab861fcde194250b7ffe3bf1c521.zip |
* Changes std::stoi to atoi as gcc does not support it on windows platform
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/edit.cpp | 8 | ||||
-rw-r--r-- | src/ui/edit.h | 1 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index a96d231..5ae7162 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -1408,13 +1408,7 @@ int GetValueParam(std::string cmd, int rank) int return_value = 0; if (results.size() > static_cast<unsigned int>(rank)) { - try { - return_value = std::stoi(results.at(rank)); - } catch (std::invalid_argument &e) { - GetLogger()->Error("Exception std::invalid_argument caught in GetValueParam function"); - } catch (std::out_of_range &e) { - GetLogger()->Error("Exception std::out_of_range caught in GetValueParam function"); - } + return_value = atoi(results.at(rank).c_str()); } return return_value; diff --git a/src/ui/edit.h b/src/ui/edit.h index 72423fa..8b84fcd 100644 --- a/src/ui/edit.h +++ b/src/ui/edit.h @@ -36,6 +36,7 @@ #include <set> #include <string> +#include <cstdlib> #include <boost/filesystem.hpp> #include <boost/algorithm/string.hpp> |