mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-29 11:55:52 +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
|
@ -803,7 +803,7 @@ struct MutatePass : public Pass {
|
|||
for (argidx = 1; argidx < args.size(); argidx++)
|
||||
{
|
||||
if (args[argidx] == "-list" && argidx+1 < args.size()) {
|
||||
N = atoi(args[++argidx].c_str());
|
||||
N = std::stoi(args[++argidx]);
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-o" && argidx+1 < args.size()) {
|
||||
|
@ -815,7 +815,7 @@ struct MutatePass : public Pass {
|
|||
continue;
|
||||
}
|
||||
if (args[argidx] == "-seed" && argidx+1 < args.size()) {
|
||||
opts.seed = atoi(args[++argidx].c_str());
|
||||
opts.seed = std::stoi(args[++argidx]);
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-none") {
|
||||
|
@ -828,8 +828,8 @@ struct MutatePass : public Pass {
|
|||
}
|
||||
if (args[argidx] == "-ctrl" && argidx+3 < args.size()) {
|
||||
opts.ctrl_name = RTLIL::escape_id(args[++argidx]);
|
||||
opts.ctrl_width = atoi(args[++argidx].c_str());
|
||||
opts.ctrl_value = atoi(args[++argidx].c_str());
|
||||
opts.ctrl_width = std::stoi(args[++argidx]);
|
||||
opts.ctrl_value = std::stoi(args[++argidx]);
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-module" && argidx+1 < args.size()) {
|
||||
|
@ -845,11 +845,11 @@ struct MutatePass : public Pass {
|
|||
continue;
|
||||
}
|
||||
if (args[argidx] == "-portbit" && argidx+1 < args.size()) {
|
||||
opts.portbit = atoi(args[++argidx].c_str());
|
||||
opts.portbit = std::stoi(args[++argidx]);
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-ctrlbit" && argidx+1 < args.size()) {
|
||||
opts.ctrlbit = atoi(args[++argidx].c_str());
|
||||
opts.ctrlbit = std::stoi(args[++argidx]);
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-wire" && argidx+1 < args.size()) {
|
||||
|
@ -857,7 +857,7 @@ struct MutatePass : public Pass {
|
|||
continue;
|
||||
}
|
||||
if (args[argidx] == "-wirebit" && argidx+1 < args.size()) {
|
||||
opts.wirebit = atoi(args[++argidx].c_str());
|
||||
opts.wirebit = std::stoi(args[++argidx]);
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-src" && argidx+1 < args.size()) {
|
||||
|
@ -866,52 +866,52 @@ struct MutatePass : public Pass {
|
|||
}
|
||||
if (args[argidx] == "-cfg" && argidx+2 < args.size()) {
|
||||
if (args[argidx+1] == "pick_cover_prcnt") {
|
||||
opts.pick_cover_prcnt = atoi(args[argidx+2].c_str());
|
||||
opts.pick_cover_prcnt = std::stoi(args[argidx+2]);
|
||||
argidx += 2;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx+1] == "weight_cover") {
|
||||
opts.weight_cover = atoi(args[argidx+2].c_str());
|
||||
opts.weight_cover = std::stoi(args[argidx+2]);
|
||||
argidx += 2;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx+1] == "weight_pq_w") {
|
||||
opts.weight_pq_w = atoi(args[argidx+2].c_str());
|
||||
opts.weight_pq_w = std::stoi(args[argidx+2]);
|
||||
argidx += 2;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx+1] == "weight_pq_b") {
|
||||
opts.weight_pq_b = atoi(args[argidx+2].c_str());
|
||||
opts.weight_pq_b = std::stoi(args[argidx+2]);
|
||||
argidx += 2;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx+1] == "weight_pq_c") {
|
||||
opts.weight_pq_c = atoi(args[argidx+2].c_str());
|
||||
opts.weight_pq_c = std::stoi(args[argidx+2]);
|
||||
argidx += 2;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx+1] == "weight_pq_s") {
|
||||
opts.weight_pq_s = atoi(args[argidx+2].c_str());
|
||||
opts.weight_pq_s = std::stoi(args[argidx+2]);
|
||||
argidx += 2;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx+1] == "weight_pq_mw") {
|
||||
opts.weight_pq_mw = atoi(args[argidx+2].c_str());
|
||||
opts.weight_pq_mw = std::stoi(args[argidx+2]);
|
||||
argidx += 2;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx+1] == "weight_pq_mb") {
|
||||
opts.weight_pq_mb = atoi(args[argidx+2].c_str());
|
||||
opts.weight_pq_mb = std::stoi(args[argidx+2]);
|
||||
argidx += 2;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx+1] == "weight_pq_mc") {
|
||||
opts.weight_pq_mc = atoi(args[argidx+2].c_str());
|
||||
opts.weight_pq_mc = std::stoi(args[argidx+2]);
|
||||
argidx += 2;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx+1] == "weight_pq_ms") {
|
||||
opts.weight_pq_ms = atoi(args[argidx+2].c_str());
|
||||
opts.weight_pq_ms = std::stoi(args[argidx+2]);
|
||||
argidx += 2;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue