mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-19 12:23:39 +00:00
Use std::stoi instead of atoi(<str>.c_str())
This commit is contained in:
parent
e38f40af5b
commit
c11ad24fd7
36 changed files with 109 additions and 109 deletions
|
@ -1564,10 +1564,10 @@ struct AbcPass : public Pass {
|
|||
size_t pos = arg.find_first_of(':');
|
||||
int lut_mode = 0, lut_mode2 = 0;
|
||||
if (pos != string::npos) {
|
||||
lut_mode = atoi(arg.substr(0, pos).c_str());
|
||||
lut_mode2 = atoi(arg.substr(pos+1).c_str());
|
||||
lut_mode = std::stoi(arg.substr(0, pos));
|
||||
lut_mode2 = std::stoi(arg.substr(pos+1));
|
||||
} else {
|
||||
lut_mode = atoi(arg.c_str());
|
||||
lut_mode = std::stoi(arg);
|
||||
lut_mode2 = lut_mode;
|
||||
}
|
||||
lut_costs.clear();
|
||||
|
@ -1584,10 +1584,10 @@ struct AbcPass : public Pass {
|
|||
if (GetSize(parts) == 0 && !lut_costs.empty())
|
||||
lut_costs.push_back(lut_costs.back());
|
||||
else if (GetSize(parts) == 1)
|
||||
lut_costs.push_back(atoi(parts.at(0).c_str()));
|
||||
lut_costs.push_back(std::stoi(parts.at(0)));
|
||||
else if (GetSize(parts) == 2)
|
||||
while (GetSize(lut_costs) < atoi(parts.at(0).c_str()))
|
||||
lut_costs.push_back(atoi(parts.at(1).c_str()));
|
||||
while (GetSize(lut_costs) < std::stoi(parts.at(0)))
|
||||
lut_costs.push_back(std::stoi(parts.at(1)));
|
||||
else
|
||||
log_cmd_error("Invalid -luts syntax.\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue