3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 09:05:32 +00:00

Use std::stoi instead of atoi(<str>.c_str())

This commit is contained in:
Eddie Hung 2019-08-06 16:45:48 -07:00
parent e38f40af5b
commit c11ad24fd7
36 changed files with 109 additions and 109 deletions

View file

@ -3921,14 +3921,14 @@ bool RTLIL::SigSpec::parse(RTLIL::SigSpec &sig, RTLIL::Module *module, std::stri
sigspec_parse_split(index_tokens, indices.substr(1, indices.size()-2), ':');
if (index_tokens.size() == 1) {
cover("kernel.rtlil.sigspec.parse.bit_sel");
int a = atoi(index_tokens.at(0).c_str());
int a = std::stoi(index_tokens.at(0));
if (a < 0 || a >= wire->width)
return false;
sig.append(RTLIL::SigSpec(wire, a));
} else {
cover("kernel.rtlil.sigspec.parse.part_sel");
int a = atoi(index_tokens.at(0).c_str());
int b = atoi(index_tokens.at(1).c_str());
int a = std::stoi(index_tokens.at(0));
int b = std::stoi(index_tokens.at(1));
if (a > b) {
int tmp = a;
a = b, b = tmp;