diff options
Diffstat (limited to 'passes/cmds')
-rw-r--r-- | passes/cmds/add.cc | 2 | ||||
-rw-r--r-- | passes/cmds/chformal.cc | 4 | ||||
-rw-r--r-- | passes/cmds/qwp.cc | 2 | ||||
-rw-r--r-- | passes/cmds/scc.cc | 4 | ||||
-rw-r--r-- | passes/cmds/select.cc | 16 | ||||
-rw-r--r-- | passes/cmds/setundef.cc | 2 | ||||
-rw-r--r-- | passes/cmds/show.cc | 2 | ||||
-rw-r--r-- | passes/cmds/tee.cc | 2 |
8 files changed, 17 insertions, 17 deletions
diff --git a/passes/cmds/add.cc b/passes/cmds/add.cc index af6f7043d..971de1d00 100644 --- a/passes/cmds/add.cc +++ b/passes/cmds/add.cc @@ -130,7 +130,7 @@ struct AddPass : public Pass { if (arg == "-global_input") arg_flag_global = true; arg_name = args[++argidx]; - arg_width = atoi(args[++argidx].c_str()); + arg_width = std::stoi(args[++argidx]); continue; } break; diff --git a/passes/cmds/chformal.cc b/passes/cmds/chformal.cc index 7e32da65f..c97b204af 100644 --- a/passes/cmds/chformal.cc +++ b/passes/cmds/chformal.cc @@ -106,12 +106,12 @@ struct ChformalPass : public Pass { } if (mode == 0 && args[argidx] == "-delay" && argidx+1 < args.size()) { mode = 'd'; - mode_arg = atoi(args[++argidx].c_str()); + mode_arg = std::stoi(args[++argidx]); continue; } if (mode == 0 && args[argidx] == "-skip" && argidx+1 < args.size()) { mode = 's'; - mode_arg = atoi(args[++argidx].c_str()); + mode_arg = std::stoi(args[++argidx]); continue; } if ((mode == 0 || mode == 'c') && args[argidx] == "-assert2assume") { diff --git a/passes/cmds/qwp.cc b/passes/cmds/qwp.cc index adbe89e31..4d53b3995 100644 --- a/passes/cmds/qwp.cc +++ b/passes/cmds/qwp.cc @@ -830,7 +830,7 @@ struct QwpPass : public Pass { continue; } if (args[argidx] == "-grid" && argidx+1 < args.size()) { - config.grid = 1.0 / atoi(args[++argidx].c_str()); + config.grid = 1.0 / std::stoi(args[++argidx]); continue; } if (args[argidx] == "-dump" && argidx+1 < args.size()) { diff --git a/passes/cmds/scc.cc b/passes/cmds/scc.cc index 99f4fbae8..ad924e1bf 100644 --- a/passes/cmds/scc.cc +++ b/passes/cmds/scc.cc @@ -269,11 +269,11 @@ struct SccPass : public Pass { size_t argidx; for (argidx = 1; argidx < args.size(); argidx++) { if (args[argidx] == "-max_depth" && argidx+1 < args.size()) { - maxDepth = atoi(args[++argidx].c_str()); + maxDepth = std::stoi(args[++argidx]); continue; } if (args[argidx] == "-expect" && argidx+1 < args.size()) { - expect = atoi(args[++argidx].c_str()); + expect = std::stoi(args[++argidx]); continue; } if (args[argidx] == "-nofeedback") { diff --git a/passes/cmds/select.cc b/passes/cmds/select.cc index b5e8ef1af..e857e655f 100644 --- a/passes/cmds/select.cc +++ b/passes/cmds/select.cc @@ -517,7 +517,7 @@ static void select_op_expand(RTLIL::Design *design, std::string arg, char mode, size_t endpos = arg.find_first_not_of("0123456789", pos); if (endpos == std::string::npos) endpos = arg.size(); - levels = atoi(arg.substr(pos, endpos-pos).c_str()); + levels = std::stoi(arg.substr(pos, endpos-pos)); pos = endpos; } @@ -526,7 +526,7 @@ static void select_op_expand(RTLIL::Design *design, std::string arg, char mode, if (endpos == std::string::npos) endpos = arg.size(); if (int(endpos) > pos) - rem_objects = atoi(arg.substr(pos, endpos-pos).c_str()); + rem_objects = std::stoi(arg.substr(pos, endpos-pos)); pos = endpos; } @@ -823,15 +823,15 @@ static void select_stmt(RTLIL::Design *design, std::string arg) if (arg_memb.substr(0, 2) == "s:") { size_t delim = arg_memb.substr(2).find(':'); if (delim == std::string::npos) { - int width = atoi(arg_memb.substr(2).c_str()); + int width = std::stoi(arg_memb.substr(2)); for (auto &it : mod->wires_) if (it.second->width == width) sel.selected_members[mod->name].insert(it.first); } else { std::string min_str = arg_memb.substr(2, delim); std::string max_str = arg_memb.substr(2+delim+1); - int min_width = min_str.empty() ? 0 : atoi(min_str.c_str()); - int max_width = max_str.empty() ? -1 : atoi(max_str.c_str()); + int min_width = min_str.empty() ? 0 : std::stoi(min_str); + int max_width = max_str.empty() ? -1 : std::stoi(max_str); for (auto &it : mod->wires_) if (min_width <= it.second->width && (it.second->width <= max_width || max_width == -1)) sel.selected_members[mod->name].insert(it.first); @@ -1230,15 +1230,15 @@ struct SelectPass : public Pass { continue; } if (arg == "-assert-count" && argidx+1 < args.size()) { - assert_count = atoi(args[++argidx].c_str()); + assert_count = std::stoi(args[++argidx]); continue; } if (arg == "-assert-max" && argidx+1 < args.size()) { - assert_max = atoi(args[++argidx].c_str()); + assert_max = std::stoi(args[++argidx]); continue; } if (arg == "-assert-min" && argidx+1 < args.size()) { - assert_min = atoi(args[++argidx].c_str()); + assert_min = std::stoi(args[++argidx]); continue; } if (arg == "-clear") { diff --git a/passes/cmds/setundef.cc b/passes/cmds/setundef.cc index 3eedc86b8..0e3c0c853 100644 --- a/passes/cmds/setundef.cc +++ b/passes/cmds/setundef.cc @@ -210,7 +210,7 @@ struct SetundefPass : public Pass { if (args[argidx] == "-random" && !got_value && argidx+1 < args.size()) { got_value = true; worker.next_bit_mode = MODE_RANDOM; - worker.next_bit_state = atoi(args[++argidx].c_str()) + 1; + worker.next_bit_state = std::stoi(args[++argidx]) + 1; for (int i = 0; i < 10; i++) worker.next_bit(); continue; diff --git a/passes/cmds/show.cc b/passes/cmds/show.cc index cf729215f..3af477bd9 100644 --- a/passes/cmds/show.cc +++ b/passes/cmds/show.cc @@ -740,7 +740,7 @@ struct ShowPass : public Pass { continue; } if (arg == "-colors" && argidx+1 < args.size()) { - colorSeed = atoi(args[++argidx].c_str()); + colorSeed = std::stoi(args[++argidx]); for (int i = 0; i < 100; i++) colorSeed = ShowWorker::xorshift32(colorSeed); continue; diff --git a/passes/cmds/tee.cc b/passes/cmds/tee.cc index 1a44bdaec..e0a74099a 100644 --- a/passes/cmds/tee.cc +++ b/passes/cmds/tee.cc @@ -79,7 +79,7 @@ struct TeePass : public Pass { continue; } if (GetSize(args[argidx]) >= 2 && (args[argidx][0] == '-' || args[argidx][0] == '+') && args[argidx][1] >= '0' && args[argidx][1] <= '9') { - log_verbose_level += atoi(args[argidx].c_str()); + log_verbose_level += std::stoi(args[argidx]); continue; } break; |