diff options
author | 2020-09-24 07:53:56 +0200 | |
---|---|---|
committer | 2020-09-24 15:22:25 +0200 | |
commit | 0acb9992f4c73db6f865ed89411ce4db20cee9f2 (patch) | |
tree | 21203310f91c9590da371e2826395e75eb00d99a /src/lib/netlist/plib/ppreprocessor.cpp | |
parent | dd5769bea9d3ef209c5cd46507ef6d4800ee1ccf (diff) |
netlist: make pstring length/size use consistent.
* length reports the number of character codes in the string
* size reports the size in memory units
* Reminder: Set PSTRING_USE_STD_STRING to 1 in pstring.h and get
native std::string
* pstrings are compatible to std::string but only support a limited
subset of functionality.
* By default (always like this) utf8 is supported and thus length
reports the number of multi-byte characters.
Diffstat (limited to 'src/lib/netlist/plib/ppreprocessor.cpp')
-rw-r--r-- | src/lib/netlist/plib/ppreprocessor.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/netlist/plib/ppreprocessor.cpp b/src/lib/netlist/plib/ppreprocessor.cpp index 320cbe23857..c203fea1753 100644 --- a/src/lib/netlist/plib/ppreprocessor.cpp +++ b/src/lib/netlist/plib/ppreprocessor.cpp @@ -245,10 +245,10 @@ namespace plib { else { pstring tok=tmp[pi]; - if (tok.size() >= 2 && pi < tmp.size() - 2 ) + if (tok.length() >= 2 && pi < tmp.size() - 2 ) { auto sc=tok.substr(0,1); - auto ec=tok.substr(tok.size()-1, 1); + auto ec=tok.substr(tok.length()-1, 1); if ((sc == "." || (sc>="0" && sc<="9")) && (ec=="e" || ec=="E")) { // looks like an incomplete float due splitting by - or + @@ -496,7 +496,7 @@ namespace plib { { bool line_cont = plib::right(line_in, 1) == "\\"; - pstring line = line_cont ? plib::left(line_in, line_in.size() - 1) : line_in; + pstring line = line_cont ? plib::left(line_in, line_in.length() - 1) : line_in; if (m_state == LINE_CONTINUATION) m_line += line; |