atoX functions replaced with strtoX implementation.
This commit is contained in:
+2
-2
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
+3
-3
@@ -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<float>(strtod(arg.c_str(), NULL));
|
||||
break;
|
||||
case type_string:
|
||||
m_params[name] = arg.c_str();
|
||||
|
||||
Reference in New Issue
Block a user