summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/plib/poptions.cpp
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2019-01-10 00:30:51 +0100
committer couriersud <couriersud@gmx.org>2019-01-10 00:30:51 +0100
commit4213a396d8652e7ea26c07c133932bd9f5a87faa (patch)
tree8f20d8db7d066c535f2ea5d60b5556537219de59 /src/lib/netlist/plib/poptions.cpp
parentf8d5b95e373ede549c730998d9cfe3be04fdbd43 (diff)
Improve type safety on string->numeric conversions. (nw)
Also fixed an issue with 7497. ./nltool -t 5 -f src/mame/machine/nl_tp1983.cpp -v now runs again.
Diffstat (limited to 'src/lib/netlist/plib/poptions.cpp')
-rw-r--r--src/lib/netlist/plib/poptions.cpp40
1 files changed, 2 insertions, 38 deletions
diff --git a/src/lib/netlist/plib/poptions.cpp b/src/lib/netlist/plib/poptions.cpp
index d576eff0bb2..c790d1f55af 100644
--- a/src/lib/netlist/plib/poptions.cpp
+++ b/src/lib/netlist/plib/poptions.cpp
@@ -46,49 +46,13 @@ namespace plib {
return 0;
}
- int option_str_limit::parse(const pstring &argument)
- {
- if (plib::container::contains(m_limit, argument))
- {
- m_val = argument;
- return 0;
- }
- else
- return 1;
- }
-
int option_bool::parse(const pstring &argument)
{
+ unused_var(argument);
m_val = true;
return 0;
}
- int option_double::parse(const pstring &argument)
- {
- try
- {
- m_val = plib::pstod(argument);
- return 0;
- }
- catch (...)
- {
- return 1;
- }
- }
-
- int option_long::parse(const pstring &argument)
- {
- try
- {
- m_val = plib::pstol(argument);
- return 0;
- }
- catch (...)
- {
- return 1;
- }
- }
-
int option_vec::parse(const pstring &argument)
{
bool err = false;
@@ -233,7 +197,7 @@ namespace plib {
if (opt->has_argument())
{
line += "=";
- option_str_limit *ol = dynamic_cast<option_str_limit *>(opt);
+ option_str_limit_base *ol = dynamic_cast<option_str_limit_base *>(opt);
if (ol)
{
for (auto &v : ol->limit())