summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nl_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/netlist/nl_parser.cpp')
-rw-r--r--src/lib/netlist/nl_parser.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp
index f28eb822a09..cecfbe862bf 100644
--- a/src/lib/netlist/nl_parser.cpp
+++ b/src/lib/netlist/nl_parser.cpp
@@ -357,7 +357,7 @@ void parser_t::device(const pstring &dev_type)
m_setup.register_dev(dev_type, devname);
m_setup.log().debug("Parser: IC: {1}\n", devname);
- for (pstring tp : paramlist)
+ for (const pstring &tp : paramlist)
{
require_token(m_tok_comma);
if (plib::startsWith(tp, "+"))
@@ -397,13 +397,12 @@ void parser_t::device(const pstring &dev_type)
nl_double parser_t::eval_param(const token_t &tok)
{
- static pstring macs[6] = {"", "RES_K", "RES_M", "CAP_U", "CAP_N", "CAP_P"};
- static nl_double facs[6] = {1, 1e3, 1e6, 1e-6, 1e-9, 1e-12};
- int i;
- int f=0;
+ static std::array<pstring, 6> macs = {"", "RES_K", "RES_M", "CAP_U", "CAP_N", "CAP_P"};
+ static std::array<nl_double, 6> facs = {1, 1e3, 1e6, 1e-6, 1e-9, 1e-12};
+ std::size_t f=0;
nl_double ret;
- for (i=1; i<6;i++)
+ for (std::size_t i=1; i<macs.size();i++)
if (tok.str() == macs[i])
f = i;
if (f>0)