From 1e40d95e8b47d834d1ede706921dc19850aaaff2 Mon Sep 17 00:00:00 2001 From: couriersud Date: Thu, 21 Jul 2016 11:05:55 +0200 Subject: Netlist updates: - Removed trampolines (OUTLOGIC, INPLOGIC and friends). - Started using doxygen comment and documentation style. Added doxygen files to documentation folder. - Refactored code triggered by doxygen output. - Moved internal and support classes into namespace detail. - Use an anordered map in parser. - -Wconversion fixes - All done now. - Fixed -Wold-style-cast warnings in netlist code. - Added iterators to pstring. - Moved two macros, added more RAII and improved exceptions. Fixed some bugs in parser code. - Fixed a number of bugs in parser code and exception handling. [Couriersud] --- src/lib/netlist/plib/poptions.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/lib/netlist/plib/poptions.cpp') diff --git a/src/lib/netlist/plib/poptions.cpp b/src/lib/netlist/plib/poptions.cpp index e6bc45d15eb..2060e8ec46c 100644 --- a/src/lib/netlist/plib/poptions.cpp +++ b/src/lib/netlist/plib/poptions.cpp @@ -113,11 +113,13 @@ namespace plib { } else if (arg.startsWith("-")) { - opt = getopt_short(arg.substr(1,1)); - if (arg.len() > 2) + auto p = arg.begin() + 1; + opt = getopt_short(arg.substr(p,p + 1)); + ++p; + if (p != arg.end()) { has_equal_arg = true; - opt_arg = arg.substr(2); + opt_arg = arg.substr(p); } } else @@ -204,7 +206,7 @@ namespace plib { { line += v + "|"; } - line = line.left(line.len() - 1); + line = line.left(line.begin() + (line.len() - 1)); } else line += "Value"; -- cgit v1.2.3-70-g09d2