From 02c3f45bff27e8ca27d5f68f52c816e5f055eadf Mon Sep 17 00:00:00 2001 From: couriersud Date: Thu, 5 Jan 2017 01:43:12 +0100 Subject: Fix clang "-Wno-weak-vtables" warnings in netlist source. Refactored code along the way. (nw) --- src/lib/netlist/prg/nltool.cpp | 45 ++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'src/lib/netlist/prg/nltool.cpp') diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 60189bfb0cc..f96fd423530 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -102,25 +102,26 @@ public: { } - virtual std::unique_ptr stream(const pstring &file) override - { - pstring name = m_folder + "/" + file; - try - { - auto strm = plib::make_unique_base(name); - return strm; - } - catch (plib::pexception e) - { - - } - return std::unique_ptr(nullptr); - } + virtual std::unique_ptr stream(const pstring &file) override; private: pstring m_folder; }; +std::unique_ptr netlist_data_folder_t::stream(const pstring &file) +{ + pstring name = m_folder + "/" + file; + try + { + auto strm = plib::make_unique_base(name); + return strm; + } + catch (plib::pexception e) + { + + } + return std::unique_ptr(nullptr); +} class netlist_tool_t : public netlist::netlist_t { @@ -182,18 +183,20 @@ public: protected: - void vlog(const plib::plog_level &l, const pstring &ls) const override - { - pstring err = plib::pfmt("{}: {}\n")(l.name())(ls.c_str()); - pout("{}", err); - if (l == plib::plog_level::FATAL) - throw netlist::nl_exception(err); - } + void vlog(const plib::plog_level &l, const pstring &ls) const override; private: netlist::setup_t *m_setup; }; +void netlist_tool_t::vlog(const plib::plog_level &l, const pstring &ls) const +{ + pstring err = plib::pfmt("{}: {}\n")(l.name())(ls.c_str()); + pout("{}", err); + if (l == plib::plog_level::FATAL) + throw netlist::nl_exception(err); +} + // FIXME: usage should go elsewhere void usage(tool_options_t &opts); -- cgit v1.2.3-70-g09d2