From a8c8c3bd1b06b34a00c62967cc3026b6017f71d5 Mon Sep 17 00:00:00 2001 From: Roland Jax Date: Sun, 27 Apr 2014 20:40:27 +0200 Subject: [PATCH] atoX functions replaced with strtoX implementation. --- src/baseloop.cpp | 4 ++-- src/cycdata.cpp | 2 +- utils/appl.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/baseloop.cpp b/src/baseloop.cpp index 9e46b225..02a62241 100644 --- a/src/baseloop.cpp +++ b/src/baseloop.cpp @@ -102,7 +102,7 @@ std::string BaseLoop::decodeMessage(const std::string& data) Command* command = new Command(index, (*m_commands)[index], busCommand->getResult().c_str()); // return result - result << command->getResult(cmd); + result << command->calcResult(cmd); delete command; delete busCommand; @@ -129,7 +129,7 @@ std::string BaseLoop::decodeMessage(const std::string& data) Command* command = new Command(index, (*m_commands)[index], cycdata.c_str()); // return result - result << command->getResult(cmd); + result << command->calcResult(cmd); delete command; } else { diff --git a/src/cycdata.cpp b/src/cycdata.cpp index e240f29d..dda75a63 100644 --- a/src/cycdata.cpp +++ b/src/cycdata.cpp @@ -95,7 +95,7 @@ int CYCData::findData(const std::string& data) const return -3; // preapre string for searching command - std::string search(data.substr(2, 8 + atoi(data.substr(8,2).c_str()) * 2)); + std::string search(data.substr(2, 8 + strtol(data.substr(8,2).c_str(), NULL, 16) * 2)); std::size_t index; mapCI_t i = m_cycDB.begin(); diff --git a/utils/appl.cpp b/utils/appl.cpp index 63c3ce5c..6bccd76e 100644 --- a/utils/appl.cpp +++ b/utils/appl.cpp @@ -142,13 +142,13 @@ void Appl::addParam(const char* name, const std::string arg, Datatype datatype) m_params[name] = true; break; case type_int: - m_params[name] = atoi(arg.c_str()); + m_params[name] = strtol(arg.c_str(), NULL, 10); break; case type_long: - m_params[name] = atol(arg.c_str()); + m_params[name] = strtol(arg.c_str(), NULL, 10); break; case type_float: - m_params[name] = (float) atof(arg.c_str()); + m_params[name] = static_cast(strtod(arg.c_str(), NULL)); break; case type_string: m_params[name] = arg.c_str();