From 500ca5b8fc6cd17e224f154de0914e95f080f51e Mon Sep 17 00:00:00 2001 From: couriersud Date: Tue, 17 Sep 2019 21:05:01 +0200 Subject: 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 --- src/lib/netlist/plib/pparser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 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 +//#include 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 &sexpr, std::size_t &start, i else { // FIXME: error handling - val = plib::pstonum(tok); + val = plib::pstonum(tok); start++; } } -- cgit v1.2.3-70-g09d2