diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-08-06 16:45:48 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-08-06 16:45:48 -0700 |
commit | c11ad24fd7d961432cfdbca7497ba229d3b4f38d (patch) | |
tree | 5b6b9bdef66b60dd718fa7104765d38a1a21c8d9 /passes/techmap/abc9.cc | |
parent | e38f40af5b7cdd5c8b896ffba17069bd65f01f29 (diff) | |
download | yosys-c11ad24fd7d961432cfdbca7497ba229d3b4f38d.tar.gz yosys-c11ad24fd7d961432cfdbca7497ba229d3b4f38d.tar.bz2 yosys-c11ad24fd7d961432cfdbca7497ba229d3b4f38d.zip |
Use std::stoi instead of atoi(<str>.c_str())
Diffstat (limited to 'passes/techmap/abc9.cc')
-rw-r--r-- | passes/techmap/abc9.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/passes/techmap/abc9.cc b/passes/techmap/abc9.cc index 34919cf07..36e3b4e65 100644 --- a/passes/techmap/abc9.cc +++ b/passes/techmap/abc9.cc @@ -999,8 +999,8 @@ struct Abc9Pass : 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 { pos = arg.find_first_of('.'); if (pos != string::npos) { @@ -1010,7 +1010,7 @@ struct Abc9Pass : public Pass { lut_file = std::string(pwd) + "/" + lut_file; } else { - lut_mode = atoi(arg.c_str()); + lut_mode = std::stoi(arg); lut_mode2 = lut_mode; } } @@ -1028,10 +1028,10 @@ struct Abc9Pass : 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"); } |