From db318046c4ed54fa7822b6aec55bec6d427e1e95 Mon Sep 17 00:00:00 2001 From: couriersud Date: Thu, 17 Oct 2019 10:21:00 +0200 Subject: Netlist: code maintenance and bug fixes. (nw) - solver now uses dynamic allocation on systems larger than 512x512 - fixed osx build - moved nl_lists.h classes to plists.h - fixed netlist makefile clint section - readability and typos --- src/lib/netlist/plib/pparser.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/lib/netlist/plib/pparser.cpp') diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index 796a18d8d26..74d0b137829 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -261,8 +261,8 @@ ptokenizer::token_t ptokenizer::get_token_internal() ppreprocessor::ppreprocessor(defines_map_type *defines) : std::istream(new readbuffer(this)) -, m_ifflag(0) -, m_level(0) +, m_if_flag(0) +, m_if_level(0) , m_lineno(0) , m_pos(0) , m_state(PROCESS) @@ -473,34 +473,34 @@ pstring ppreprocessor::process_line(pstring line) std::vector lti(psplit(lt, " ", true)); if (lti[0] == "#if") { - m_level++; + m_if_level++; std::size_t start = 0; lt = replace_macros(lt); std::vector t(psplit(replace_all(lt.substr(3), " ", ""), m_expr_sep)); auto val = static_cast(expr(t, start, 255)); if (val == 0) - m_ifflag |= (1 << m_level); + m_if_flag |= (1 << m_if_level); } else if (lti[0] == "#ifdef") { - m_level++; + m_if_level++; if (get_define(lti[1]) == nullptr) - m_ifflag |= (1 << m_level); + m_if_flag |= (1 << m_if_level); } else if (lti[0] == "#ifndef") { - m_level++; + m_if_level++; if (get_define(lti[1]) != nullptr) - m_ifflag |= (1 << m_level); + m_if_flag |= (1 << m_if_level); } else if (lti[0] == "#else") { - m_ifflag ^= (1 << m_level); + m_if_flag ^= (1 << m_if_level); } else if (lti[0] == "#endif") { - m_ifflag &= ~(1 << m_level); - m_level--; + m_if_flag &= ~(1 << m_if_level); + m_if_level--; } else if (lti[0] == "#include") { @@ -508,7 +508,7 @@ pstring ppreprocessor::process_line(pstring line) } else if (lti[0] == "#pragma") { - if (m_ifflag == 0 && lti.size() > 3 && lti[1] == "NETLIST") + if (m_if_flag == 0 && lti.size() > 3 && lti[1] == "NETLIST") { if (lti[2] == "warning") error("NETLIST: " + catremainder(lti, 3, " ")); @@ -516,7 +516,7 @@ pstring ppreprocessor::process_line(pstring line) } else if (lti[0] == "#define") { - if (m_ifflag == 0) + if (m_if_flag == 0) { if (lti.size() < 2) error("PREPRO: define needs at least one argument: " + line); @@ -534,14 +534,14 @@ pstring ppreprocessor::process_line(pstring line) } else { - if (m_ifflag == 0) + if (m_if_flag == 0) error(pfmt("unknown directive on line {1}: {2}")(m_lineno)(replace_macros(line))); } } else { lt = replace_macros(lt); - if (m_ifflag == 0) + if (m_if_flag == 0) ret += lt; } return ret; -- cgit v1.2.3-70-g09d2