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/plib/pparser.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/plib/pparser.cpp')
-rw-r--r-- | src/lib/netlist/plib/pparser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index ab065495f41..b640cbeaaf6 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -9,7 +9,7 @@ #include "palloc.h" #include "putil.h" -#include <cstdarg> +//#include <cstdarg> namespace plib { // ---------------------------------------------------------------------------------------- @@ -296,14 +296,14 @@ void ppreprocessor::error(const pstring &err) throw pexception("PREPRO ERROR: " + err); } -pstream::size_type ppreprocessor::vread(value_type *buf, const pstream::size_type n) +pstream::size_type ppreprocessor::vread(char_type *buf, const pstream::size_type n) { size_type bytes = std::min(m_buf.size() - m_pos, n); if (bytes==0) return 0; - std::memcpy(buf, m_buf.c_str() + m_pos, bytes); + std::copy(m_buf.c_str() + m_pos, m_buf.c_str() + m_pos + bytes, buf); m_pos += bytes; return bytes; } @@ -357,7 +357,7 @@ int ppreprocessor::expr(const std::vector<pstring> &sexpr, std::size_t &start, i else { // FIXME: error handling - val = plib::pstonum<decltype(val), true>(tok); + val = plib::pstonum<decltype(val)>(tok); start++; } } |