diff options
author | 2019-09-17 21:05:01 +0200 | |
---|---|---|
committer | 2019-09-17 21:05:01 +0200 | |
commit | 500ca5b8fc6cd17e224f154de0914e95f080f51e (patch) | |
tree | 8708ae27ba19ab8164bef760577ef269e11e631b /src/lib/netlist/prg/nltool.cpp | |
parent | 4495c351139f13d46e087c448e3b2418491485e2 (diff) |
netlist code maintenance. (nw)
- remove a lot of c library use and instead use c++
- improved pstring compatibility to std::string
- prepare removal of pstream
Diffstat (limited to 'src/lib/netlist/prg/nltool.cpp')
-rw-r--r-- | src/lib/netlist/prg/nltool.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index ee0b80f7e08..2e5fa28ea80 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -15,7 +15,7 @@ #include "netlist/solver/nld_solver.h" #include "netlist/tools/nl_convert.h" -#include <cstring> +#include <cstdio> // scanf #define NLTOOL_VERSION 20190420 @@ -292,7 +292,7 @@ struct input_t std::array<char, 400> buf; // NOLINT(cppcoreguidelines-pro-type-member-init) double t; // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) - int e = sscanf(line.c_str(), "%lf,%[^,],%lf", &t, buf.data(), &m_value); + int e = std::sscanf(line.c_str(), "%lf,%[^,],%lf", &t, buf.data(), &m_value); if (e != 3) throw netlist::nl_exception(plib::pfmt("error {1} scanning line {2}\n")(e)(line)); m_time = netlist::netlist_time::from_double(t); @@ -794,6 +794,8 @@ int tool_app_t::execute() if (opt_help()) { + pout(plib::pfmt("{:10.3}\n").f(20.0)); + //pout(plib::pfmt("{10.3}\n").f(20)); pout(usage()); return 0; } |