pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

RE-flex: Update to v4.1.2



Module Name:	pkgsrc-wip
Committed By:	Malte Dehling <mdehling%gmail.com@localhost>
Pushed By:	mdehling
Date:		Sun Mar 17 16:02:25 2024 -0700
Changeset:	002453219a91f396c84f7632608f593b40be0e3e

Modified Files:
	RE-flex/COMMIT_MSG
	RE-flex/Makefile
	RE-flex/distinfo
	RE-flex/patches/patch-lib_Makefile.in
	RE-flex/patches/patch-src_Makefile.in
	RE-flex/patches/patch-src_reflex.cpp
Removed Files:
	RE-flex/patches/patch-examples_gz.l
	RE-flex/patches/patch-examples_lua.hpp
	RE-flex/patches/patch-examples_minic.hpp
	RE-flex/patches/patch-lib_convert.cpp
	RE-flex/patches/patch-lib_pattern.cpp

Log Message:
RE-flex: Update to v4.1.2

Mar 17, 2024: 4.1.2 updated configure scripts; cast negative ctype function arguments (problem detected on NetBSD 10).

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=002453219a91f396c84f7632608f593b40be0e3e

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 RE-flex/COMMIT_MSG                       |   3 +-
 RE-flex/Makefile                         |   3 +-
 RE-flex/distinfo                         |  17 +--
 RE-flex/patches/patch-examples_gz.l      |  14 --
 RE-flex/patches/patch-examples_lua.hpp   |  16 ---
 RE-flex/patches/patch-examples_minic.hpp |  14 --
 RE-flex/patches/patch-lib_Makefile.in    |  12 +-
 RE-flex/patches/patch-lib_convert.cpp    | 132 ------------------
 RE-flex/patches/patch-lib_pattern.cpp    |  25 ----
 RE-flex/patches/patch-src_Makefile.in    |   4 +-
 RE-flex/patches/patch-src_reflex.cpp     | 232 +------------------------------
 11 files changed, 19 insertions(+), 453 deletions(-)

diffs:
diff --git a/RE-flex/COMMIT_MSG b/RE-flex/COMMIT_MSG
index 776379bff6..143936f68f 100644
--- a/RE-flex/COMMIT_MSG
+++ b/RE-flex/COMMIT_MSG
@@ -1,4 +1,4 @@
-devel/RE-flex: Update to v4.1.1
+devel/RE-flex: Update to v4.1.2
 
 Dec 10, 2021: 3.1.0 improved buffering mechanism with reduced buffer sizes; faster columno() for long lines; fix CP-1251 table typo.
 Feb 20, 2022: 3.2.0 new %option ctorinit; faster compilation of regular expressions to tables and direct code DFAs; refactored SIMD source code to enable AVX2 and AVX512BW optimizations in multi-version matcher code; updated Windows binary file opening.
@@ -32,3 +32,4 @@ Feb 17, 2024: 4.0.0 faster Matcher::find() with a new DFA cut algorithm to optim
 Feb 23, 2024: 4.0.1 new rawk example to demonstrate awk-like fast search in C++; enable <<EOF>> rules for option find to generate a fast search engine.
 Mar 5, 2024: 4.1.0 improved lazy quantifiers for POSIX regex lazy matching in linear time using an advanced DFA transformation algorithm introduced in RE/flex in 2016.
 Mar 11, 2024: 4.1.1 minor update to correct a DFA construction problem for POSIX regex lazy quantifiers matching too much in some cases.
+Mar 17, 2024: 4.1.2 updated configure scripts; cast negative ctype function arguments (problem detected on NetBSD 10).
diff --git a/RE-flex/Makefile b/RE-flex/Makefile
index 0300910c35..7901c0df9a 100644
--- a/RE-flex/Makefile
+++ b/RE-flex/Makefile
@@ -1,7 +1,6 @@
 # $NetBSD$
 
-DISTNAME=	RE-flex-4.1.1
-PKGREVISION=	2
+DISTNAME=	RE-flex-4.1.2
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_GITHUB:=Genivia/}
 GITHUB_TAG=	v${PKGVERSION_NOREV}
diff --git a/RE-flex/distinfo b/RE-flex/distinfo
index 849eadde06..e0b3ef4a02 100644
--- a/RE-flex/distinfo
+++ b/RE-flex/distinfo
@@ -1,17 +1,12 @@
 $NetBSD$
 
-BLAKE2s (RE-flex-4.1.1.tar.gz) = 8a1ffaa6146926e1ba24587d55a29607023041ae36f851aec4c6151c297450c9
-SHA512 (RE-flex-4.1.1.tar.gz) = 277540226c251af2c190435e71b77a946ec5eaf256c0798982245179152cfe319f9686c563fa1dca6bd8dc5b8bd052bdb1f0ba8f3a2af96f9135e068bdc19626
-Size (RE-flex-4.1.1.tar.gz) = 6599405 bytes
+BLAKE2s (RE-flex-4.1.2.tar.gz) = 1d4cd5a78522ecfdb3deae59e3de1114b4452a8a4b9de41ab99da83194ce5956
+SHA512 (RE-flex-4.1.2.tar.gz) = 964567b865316f00a5f9cb1ca93ca29fd96ff79f02253c960dd5965e750e0fd30a3dbb5d4d51992b5359b0a89637ab98fd215bd41f48a47372f9ae1a8d5fcefa
+Size (RE-flex-4.1.2.tar.gz) = 6600481 bytes
 SHA1 (patch-doc_index.md) = 382df877d351eff1df7ccd2b919331db67c4ee21
 SHA1 (patch-examples_Make) = 2e7a07f62cf80ef502cb76b8cdb980c7a2d0773b
-SHA1 (patch-examples_gz.l) = 09e92adbd4f6aa0b8fa358d6c0fc4778a67209fd
-SHA1 (patch-examples_lua.hpp) = adbd495c9818d4feff9a9454ddc1402a2a6aa859
-SHA1 (patch-examples_minic.hpp) = bf914d2ca8b9e1bf22dfd339c4be2b5dde1f8852
 SHA1 (patch-include_reflex_convert.h) = ed9fbae2d615907a0b596ba5ee9080eb3129c9dc
 SHA1 (patch-include_reflex_pattern.h) = 3dee984028b48ecc7c34aa1e6b487bb4de89c079
-SHA1 (patch-lib_Makefile.in) = 88346027298afc3a8f92fca9d44e077297bd5b79
-SHA1 (patch-lib_convert.cpp) = cf5dc968fb89d04bdffbcc195b8c23523859c175
-SHA1 (patch-lib_pattern.cpp) = b76731e862a021d334bc6bb9fbbb696a82f5333d
-SHA1 (patch-src_Makefile.in) = 504f8e3d7532b5dd26ae7793662c309597015527
-SHA1 (patch-src_reflex.cpp) = bea742ae06954a6666175d89585434ab7bc8db13
+SHA1 (patch-lib_Makefile.in) = 470fe61aa837f3321e749096a00062b0a19da007
+SHA1 (patch-src_Makefile.in) = 8b0e6c6e1acf266cce75fa264ad91f89862fbb88
+SHA1 (patch-src_reflex.cpp) = 194f655b8f2fc15e8d09c66618c9981c5d70b6ce
diff --git a/RE-flex/patches/patch-examples_gz.l b/RE-flex/patches/patch-examples_gz.l
deleted file mode 100644
index 9e49dd1001..0000000000
--- a/RE-flex/patches/patch-examples_gz.l
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-examples_gz.l,v 1.1 2020/06/15 15:11:50 scole Exp $
-
-include unistd.h for dup()
-
---- examples/gz.l.orig	2020-05-25 23:34:27.000000000 +0000
-+++ examples/gz.l
-@@ -10,6 +10,7 @@
- #include <streambuf>
- #include <cstring>
- #include <zlib.h>
-+#include <unistd.h>
- 
- #ifndef Z_BUF_LEN
- #define Z_BUF_LEN (65536)
diff --git a/RE-flex/patches/patch-examples_lua.hpp b/RE-flex/patches/patch-examples_lua.hpp
deleted file mode 100644
index 24ad29dde9..0000000000
--- a/RE-flex/patches/patch-examples_lua.hpp
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD$
-
-include cstring for strcmp()
-include memory for std::unique_ptr<>
-
---- examples/lua.hpp.orig	2024-03-13 18:32:59.378866419 +0000
-+++ examples/lua.hpp
-@@ -7,6 +7,8 @@
- #include <cstdlib>
- #include <cstdio>
- #include <cstdint>
-+#include <cstring>
-+#include <memory>
- #include <string>
- #include <set>
- #include <stack>
diff --git a/RE-flex/patches/patch-examples_minic.hpp b/RE-flex/patches/patch-examples_minic.hpp
deleted file mode 100644
index 0ae817fa01..0000000000
--- a/RE-flex/patches/patch-examples_minic.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD$
-
-include cstring for strcmp()
-
---- examples/minic.hpp.orig	2024-03-13 18:36:35.967481074 +0000
-+++ examples/minic.hpp
-@@ -9,6 +9,7 @@
- #include <cstdlib>
- #include <cstdio>
- #include <cstdint>
-+#include <cstring>
- #include <string>
- #include <map>
- #include <set>
diff --git a/RE-flex/patches/patch-lib_Makefile.in b/RE-flex/patches/patch-lib_Makefile.in
index 7432530df4..bb13a0a9ee 100644
--- a/RE-flex/patches/patch-lib_Makefile.in
+++ b/RE-flex/patches/patch-lib_Makefile.in
@@ -2,9 +2,9 @@ $NetBSD$
 
 use libtool
 
---- lib/Makefile.in.orig	2023-11-05 19:06:12.000000000 +0000
+--- lib/Makefile.in.orig	2024-03-17 20:54:34.000000000 +0000
 +++ lib/Makefile.in
-@@ -256,13 +256,14 @@ AUTOCONF = @AUTOCONF@
+@@ -259,13 +259,14 @@ AUTOCONF = @AUTOCONF@
  AUTOHEADER = @AUTOHEADER@
  AUTOMAKE = @AUTOMAKE@
  AWK = @AWK@
@@ -18,12 +18,12 @@ use libtool
 -CXX = @CXX@
 +CXXORIG = @CXX@
 +CXX = $(LIBTOOL) --mode=compile @CXX@
- CXXCPP = @CXXCPP@
  CXXDEPMODE = @CXXDEPMODE@
  CXXFLAGS = @CXXFLAGS@
-@@ -434,15 +435,15 @@ uninstall-libLIBRARIES:
- clean-libLIBRARIES:
- 	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+ CYGPATH_W = @CYGPATH_W@
+@@ -513,15 +514,15 @@ $(top_builddir)/unicode/libreflex_a-comp
+ 	$(top_builddir)/unicode/$(am__dirstamp) \
+ 	$(top_builddir)/unicode/$(DEPDIR)/$(am__dirstamp)
  
 -libreflex.a: $(libreflex_a_OBJECTS) $(libreflex_a_DEPENDENCIES) $(EXTRA_libreflex_a_DEPENDENCIES) 
 -	$(AM_V_at)-rm -f libreflex.a
diff --git a/RE-flex/patches/patch-lib_convert.cpp b/RE-flex/patches/patch-lib_convert.cpp
deleted file mode 100644
index c7628e7cfd..0000000000
--- a/RE-flex/patches/patch-lib_convert.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-$NetBSD$
-
-cast chars to unsigned for ctype functions
-
---- lib/convert.cpp.orig	2024-03-16 22:11:51.956647653 +0000
-+++ lib/convert.cpp
-@@ -283,7 +283,7 @@ static int convert_hex(const char *patte
-     size_t n = pos + 3;
-     if (c == 'u')
-       n += 2;
--    while (k < n && k < len && std::isxdigit(c = pattern[k++]))
-+    while (k < n && k < len && std::isxdigit(static_cast<unsigned char>(c = pattern[k++])))
-       *s++ = c;
-     *s = '\0';
-     --k;
-@@ -337,7 +337,7 @@ static const std::string& expand(const s
- {
-   // lookup {name} and expand without converting
-   size_t k = pos++;
--  while (pos < len && (std::isalnum(pattern[pos]) || pattern[pos] == '_' || (pattern[pos] & 0x80) == 0x80))
-+  while (pos < len && (std::isalnum(static_cast<unsigned char>(pattern[pos])) || pattern[pos] == '_' || (pattern[pos] & 0x80) == 0x80))
-     ++pos;
-   if (pos >= len || (pattern[pos] == '\\' ? pattern[pos + 1] != '}' : pattern[pos] != '}'))
-     throw regex_error(regex_error::undefined_name, pattern, pos);
-@@ -501,7 +501,7 @@ static void expand_list(const char *patt
-     else if ((c & 0xC0) == 0xC0 && is_modified(mod, 'u'))
-     {
-       // Unicode normalization may need to combine a previous ASCII character with a Unicode combining character
--      if (loc < pos && std::isalpha(pattern[pos - 1]))
-+      if (loc < pos && std::isalpha(static_cast<unsigned char>(pattern[pos - 1])))
-         --pos;
-       regex.append(&pattern[loc], pos - loc);
-       const char *s = &pattern[pos];
-@@ -551,7 +551,7 @@ static void insert_escape_class(const ch
-     wc = Posix::range(name);
-   if (wc == NULL)
-     throw regex_error(regex_error::invalid_class, pattern, pos);
--  if (std::islower(c))
-+  if (std::islower(static_cast<unsigned char>(c)))
-   {
-     if (wc[0] <= '\n' && wc[1] >= '\n' && (flags & convert_flag::notnewline))
-     {
-@@ -745,7 +745,7 @@ static int insert_escape(const char *pat
-     pos = k;
-     return -1;
-   }
--  else if (std::isalpha(c))
-+  else if (std::isalpha(static_cast<unsigned char>(c)))
-   {
-     const char *s = std::strchr(regex_abtnvfr, c);
-     if (s == NULL)
-@@ -1094,7 +1094,7 @@ static void convert_escape_char(const ch
-   else if (std::strchr(regex_meta, c) == NULL)
-   {
-     char buf[3] = { '^', static_cast<char>(lowercase(c)), '\0' };
--    bool invert = std::isupper(c) != 0;
-+    bool invert = std::isupper(static_cast<unsigned char>(c)) != 0;
-     if (c == 'n' || (invert && strchr("DHLUWX", c) != NULL))
-       nl = true;
-     const char *name = buf + !invert;
-@@ -1286,7 +1286,7 @@ static void convert_escape(const char *p
-       throw regex_error(regex_error::invalid_escape, pattern, pos);
-     if (wc == '\n')
-       nl = true;
--    if (std::isalpha(wc) && is_modified(mod, 'i'))
-+    if (std::isalpha(static_cast<unsigned char>(wc)) && is_modified(mod, 'i'))
-     {
-       // anycase: translate A to [Aa]
-       regex.append(&pattern[loc], pos - loc - 1).push_back('[');
-@@ -1335,7 +1335,7 @@ static void convert_escape(const char *p
-         if (wc <= 0xFF)
-         {
-           // translate \u{X}, \u00XX (convert_flag::u4) and \x{X} to \xXX
--          if (std::isalpha(wc) && is_modified(mod, 'i'))
-+          if (std::isalpha(static_cast<unsigned char>(wc)) && is_modified(mod, 'i'))
-           {
-             // anycase: translate A to [Aa]
-             regex.append(&pattern[loc], pos - loc - 1).push_back('[');
-@@ -1498,7 +1498,7 @@ std::string convert(const char *pattern,
-       mods.push_back('m');
-     size_t k = 2;
-     bool invert = false;
--    while (k < len && (pattern[k] == '-' || std::isalpha(pattern[k])))
-+    while (k < len && (pattern[k] == '-' || std::isalpha(static_cast<unsigned char>(pattern[k]))))
-     {
-       if (pattern[k] == '-')
-       {
-@@ -1711,7 +1711,7 @@ std::string convert(const char *pattern,
-                 std::string mods, unmods;
-                 size_t k = pos;
-                 bool invert = false;
--                while (k < len && (pattern[k] == '-' || std::isalnum(pattern[k])))
-+                while (k < len && (pattern[k] == '-' || std::isalnum(static_cast<unsigned char>(pattern[k]))))
-                 {
-                   if (pattern[k] == '-')
-                   {
-@@ -2006,7 +2006,7 @@ std::string convert(const char *pattern,
-         }
-         else
-         {
--          if (macros != NULL && pos + 1 < len && (std::isalpha(pattern[pos + 1]) || pattern[pos + 1] == '_' || pattern[pos + 1] == '$' || (pattern[pos + 1] & 0x80) == 0x80))
-+          if (macros != NULL && pos + 1 < len && (std::isalpha(static_cast<unsigned char>(pattern[pos + 1])) || pattern[pos + 1] == '_' || pattern[pos + 1] == '$' || (pattern[pos + 1] & 0x80) == 0x80))
-           {
-             // if macros are provided: lookup {name} and expand without converting
-             regex.append(&pattern[loc], pos - loc);
-@@ -2039,7 +2039,7 @@ std::string convert(const char *pattern,
-             if (beg)
-               throw regex_error(regex_error::empty_expression, pattern, pos);
-             ++pos;
--            if (pos >= len || !std::isdigit(pattern[pos]))
-+            if (pos >= len || !std::isdigit(static_cast<unsigned char>(pattern[pos])))
-               throw regex_error(regex_error::invalid_repeat, pattern, pos);
-             char *s;
-             size_t n = static_cast<size_t>(std::strtoul(&pattern[pos], &s, 10));
-@@ -2204,7 +2204,7 @@ std::string convert(const char *pattern,
-         beg = false;
-         break;
-       default:
--        if (std::isalpha(pattern[pos]))
-+        if (std::isalpha(static_cast<unsigned char>(pattern[pos])))
-         {
-           if (is_modified(mod, 'i'))
-           {
-@@ -2219,7 +2219,7 @@ std::string convert(const char *pattern,
-         else if ((c & 0xC0) == 0xC0 && is_modified(mod, 'u'))
-         {
-           // Unicode normalization may need to combine a previous ASCII character with a Unicode combining character
--          if (loc < pos && std::isalpha(pattern[pos - 1]))
-+          if (loc < pos && std::isalpha(static_cast<unsigned char>(pattern[pos - 1])))
-             --pos;
-           regex.append(&pattern[loc], pos - loc);
-           const char *s = &pattern[pos];
diff --git a/RE-flex/patches/patch-lib_pattern.cpp b/RE-flex/patches/patch-lib_pattern.cpp
deleted file mode 100644
index 572dd12779..0000000000
--- a/RE-flex/patches/patch-lib_pattern.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD$
-
-- cast chars to unsigned for ctype functions
-- fix debug log statement
-
---- lib/pattern.cpp.orig	2024-03-16 22:12:13.189685354 +0000
-+++ lib/pattern.cpp
-@@ -537,7 +537,7 @@ void Pattern::init_options(const char *o
-         case 'z':
-           for (const char *t = s += (s[1] == '='); *s != ';' && *s != '\0'; ++t)
-           {
--            if (std::isspace(*t) || *t == ';' || *t == '\0')
-+            if (std::isspace(static_cast<unsigned char>(*t)) || *t == ';' || *t == '\0')
-             {
-               if (t > s + 1)
-                 opt_.z = std::string(s + 1, t - s - 1);
-@@ -4414,7 +4414,7 @@ void Pattern::gen_match_hfa_start(DFA::S
-       hfa_.states[start->index].insert(next_state->index);
-       Char lo = edge->first;
-       Char hi = edge->second.first;
--      DBGLOG("0 HFA %p: %u..%u -> %p", state, lo, hi, next_state);
-+      DBGLOG("0 HFA %p: %u..%u -> %p", start, lo, hi, next_state);
-       hashes[next_state][0].insert(lo, hi);
-     }
-   }
diff --git a/RE-flex/patches/patch-src_Makefile.in b/RE-flex/patches/patch-src_Makefile.in
index 5ffced1b41..dee7c6971e 100644
--- a/RE-flex/patches/patch-src_Makefile.in
+++ b/RE-flex/patches/patch-src_Makefile.in
@@ -27,10 +27,10 @@ use libtool
 -CXX = @CXX@
 +CXXORIG = @CXX@
 +CXX = $(LIBTOOL) --mode=compile @CXX@
- CXXCPP = @CXXCPP@
  CXXDEPMODE = @CXXDEPMODE@
  CXXFLAGS = @CXXFLAGS@
-@@ -369,9 +370,10 @@ uninstall-binPROGRAMS:
+ CYGPATH_W = @CYGPATH_W@
+@@ -381,9 +381,10 @@ uninstall-binPROGRAMS:
  clean-binPROGRAMS:
  	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
  
diff --git a/RE-flex/patches/patch-src_reflex.cpp b/RE-flex/patches/patch-src_reflex.cpp
index cbdf2b09ef..c8037f176c 100644
--- a/RE-flex/patches/patch-src_reflex.cpp
+++ b/RE-flex/patches/patch-src_reflex.cpp
@@ -1,9 +1,8 @@
 $NetBSD$
 
-- cast chars to unsigned for ctype functions
-- fix doxygen errors
+fix doxygen errors
 
---- src/reflex.cpp.orig	2024-03-11 17:59:51.000000000 +0000
+--- src/reflex.cpp.orig	2024-03-17 20:54:34.000000000 +0000
 +++ src/reflex.cpp
 @@ -194,8 +194,8 @@ static const char *options_table[] = {
  /// - `x` for `\xXX` 8-bit character encoding in hexadecimal
@@ -25,233 +24,6 @@ $NetBSD$
  /// \d, \D, \l, \L, \u, \U, \N, and \x{X}.  Basically, 'p' prevents conversion
  /// of Unicode patterns to UTF8.  This special case does not support {NAME}
  /// expansions in bracket lists such as [a-z||{upper}] and {lower}{+}{upper}
-@@ -274,10 +274,10 @@ static const Reflex::Library library_tab
- ////////////////////////////////////////////////////////////////////////////////
- 
- /// Convert to lower case
--inline int lower(int c)
-+inline char char_tolower(char c)
-   /// @returns lower case char
- {
--  return std::isalpha(c) ? (c | 0x20) : c;
-+  return static_cast<char>(std::isalpha(static_cast<unsigned char>(c)) ? (c | 0x20) : c);
- }
- 
- /// Add file extension if not present, modifies the string argument and returns a copy
-@@ -778,7 +778,7 @@ bool Reflex::get_line()
-       line.push_back(c);
-   }
-   linelen = line.length();
--  while (linelen > 0 && std::isspace(line.at(linelen - 1)))
-+  while (linelen > 0 && std::isspace(static_cast<unsigned char>(line.at(linelen - 1))))
-     --linelen;
-   line.resize(linelen);
-   if (in.eof() && line.empty())
-@@ -828,7 +828,7 @@ bool Reflex::skip_comment(size_t& pos)
- /// Match case-insensitive string s while ignoring the rest of the line, return true if OK
- bool Reflex::is(const char *s)
- {
--  for (size_t pos = 0; pos < linelen && *s != '\0' && lower(line.at(pos)) == *s; ++pos, ++s)
-+  for (size_t pos = 0; pos < linelen && *s != '\0' && char_tolower(line.at(pos)) == *s; ++pos, ++s)
-     continue;
-   return *s == '\0';
- }
-@@ -837,9 +837,9 @@ bool Reflex::is(const char *s)
- bool Reflex::ins(const char *s)
- {
-   size_t pos = 0;
--  while (pos < linelen && std::isspace(line.at(pos)))
-+  while (pos < linelen && std::isspace(static_cast<unsigned char>(line.at(pos))))
-     ++pos;
--  while (pos < linelen && *s != '\0' && lower(line.at(pos)) == *s)
-+  while (pos < linelen && *s != '\0' && char_tolower(line.at(pos)) == *s)
-   {
-     ++pos;
-     ++s;
-@@ -852,17 +852,17 @@ bool Reflex::br(size_t pos, const char *
- {
-   if (s != NULL)
-   {
--    if (pos >= linelen || *s == '\0' || lower(line.at(pos)) != *s++)
-+    if (pos >= linelen || *s == '\0' || char_tolower(line.at(pos)) != *s++)
-       return false;
--    while (++pos < linelen && *s != '\0' && lower(line.at(pos)) == *s++)
-+    while (++pos < linelen && *s != '\0' && char_tolower(line.at(pos)) == *s++)
-       continue;
-   }
--  while (pos < linelen && std::isspace(line.at(pos)))
-+  while (pos < linelen && std::isspace(static_cast<unsigned char>(line.at(pos))))
-     ++pos;
-   if (pos >= linelen || line.at(pos) != '{')
-     return false;
-   ++pos;
--  while (pos < linelen && std::isspace(line.at(pos)))
-+  while (pos < linelen && std::isspace(static_cast<unsigned char>(line.at(pos))))
-     ++pos;
-   if (pos >= linelen)
-     return true;
-@@ -872,9 +872,9 @@ bool Reflex::br(size_t pos, const char *
- /// Advance pos to match case-insensitive initial part of the string s followed by white space, return true if OK
- bool Reflex::as(size_t& pos, const char *s)
- {
--  if (pos >= linelen || *s == '\0' || lower(line.at(pos)) != *s++)
-+  if (pos >= linelen || *s == '\0' || char_tolower(line.at(pos)) != *s++)
-     return false;
--  while (++pos < linelen && *s != '\0' && lower(line.at(pos)) == *s++)
-+  while (++pos < linelen && *s != '\0' && char_tolower(line.at(pos)) == *s++)
-     continue;
-   return ws(pos);
- }
-@@ -882,9 +882,9 @@ bool Reflex::as(size_t& pos, const char 
- /// Advance pos over whitespace, returns true if whitespace was found
- bool Reflex::ws(size_t& pos)
- {
--  if (pos >= linelen || (pos > 0 && !std::isspace(line.at(pos))))
-+  if (pos >= linelen || (pos > 0 && !std::isspace(static_cast<unsigned char>(line.at(pos)))))
-     return false;
--  while (pos < linelen && std::isspace(line.at(pos)))
-+  while (pos < linelen && std::isspace(static_cast<unsigned char>(line.at(pos))))
-     ++pos;
-   return true;
- }
-@@ -903,7 +903,7 @@ bool Reflex::eq(size_t& pos)
- /// Advance pos to end of line while skipping whitespace, return true if end of line
- bool Reflex::nl(size_t& pos)
- {
--  while (pos < linelen && std::isspace(line.at(pos)))
-+  while (pos < linelen && std::isspace(static_cast<unsigned char>(line.at(pos))))
-     ++pos;
-   return pos >= linelen;
- }
-@@ -911,7 +911,7 @@ bool Reflex::nl(size_t& pos)
- /// Check if current line starts a block of code or a comment
- bool Reflex::is_code()
- {
--  return linelen > 0 && ((std::isspace(line.at(0)) && options["freespace"].empty()) || is("%{") || is("//") || is("/*"));
-+  return linelen > 0 && ((std::isspace(static_cast<unsigned char>(line.at(0))) && options["freespace"].empty()) || is("%{") || is("//") || is("/*"));
- }
- 
- /// Check if current line starts a block of %top code
-@@ -941,12 +941,12 @@ bool Reflex::is_begin_code()
- /// Advance pos over name (letters, digits, ., -, _ or any non-ASCII character > U+007F), return name
- std::string Reflex::get_name(size_t& pos)
- {
--  if (pos >= linelen || (!std::isalnum(line.at(pos)) && line.at(pos) != '_' && (line.at(pos) & 0x80) != 0x80))
-+  if (pos >= linelen || (!std::isalnum(static_cast<unsigned char>(line.at(pos))) && line.at(pos) != '_' && (line.at(pos) & 0x80) != 0x80))
-     return "";
-   size_t loc = pos++;
-   while (pos < linelen)
-   {
--    if (!std::isalnum(line.at(pos)) && line.at(pos) != '_' && line.at(pos) != '-' && line.at(pos) != '.' && (line.at(pos) & 0x80) != 0x80)
-+    if (!std::isalnum(static_cast<unsigned char>(line.at(pos))) && line.at(pos) != '_' && line.at(pos) != '-' && line.at(pos) != '.' && (line.at(pos) & 0x80) != 0x80)
-       break;
-     ++pos;
-   }
-@@ -961,7 +961,7 @@ std::string Reflex::get_namespace(size_t
-   {
-     if (line.at(pos) == ':' && pos + 1 < linelen && line.at(pos + 1) == ':') // parse ::
-       ++pos;
--    else if (!std::isalnum(line.at(pos)) && line.at(pos) != '_' && line.at(pos) != '-' && line.at(pos) != '.' && (line.at(pos) & 0x80) != 0x80)
-+    else if (!std::isalnum(static_cast<unsigned char>(line.at(pos))) && line.at(pos) != '_' && line.at(pos) != '-' && line.at(pos) != '.' && (line.at(pos) & 0x80) != 0x80)
-       break;
-     ++pos;
-   }
-@@ -971,14 +971,14 @@ std::string Reflex::get_namespace(size_t
- /// Advance pos over option name (letters, digits, +/hyphen/underscore), return name
- std::string Reflex::get_option(size_t& pos)
- {
--  if (pos >= linelen || !std::isalnum(line.at(pos)))
-+  if (pos >= linelen || !std::isalnum(static_cast<unsigned char>(line.at(pos))))
-     return "";
-   size_t loc = pos++;
-   while (pos < linelen)
-   {
-     if (line.at(pos) == '-' || line.at(pos) == '+') // normalize - and + to _
-       line[pos] = '_';
--    else if (!std::isalnum(line.at(pos)) && line.at(pos) != '_')
-+    else if (!std::isalnum(static_cast<unsigned char>(line.at(pos))) && line.at(pos) != '_')
-       break;
-     ++pos;
-   }
-@@ -995,7 +995,7 @@ std::string Reflex::get_start(size_t& po
-   {
-     if (line.at(pos) == '-') // normalize - to _
-       line[pos] = '_';
--    else if (!std::isalnum(line.at(pos)) && line.at(pos) != '_' && (line.at(pos) & 0x80) != 0x80)
-+    else if (!std::isalnum(static_cast<unsigned char>(line.at(pos))) && line.at(pos) != '_' && (line.at(pos) & 0x80) != 0x80)
-       break;
-     ++pos;
-   }
-@@ -1047,7 +1047,7 @@ bool Reflex::get_pattern(size_t& pos, st
-     if (fsp)
-     {
-       if (nsp < pos && (
--            (c == '{' && (pos + 1 == linelen || line.at(pos + 1) == '}' || std::isspace(line.at(pos + 1)))) ||
-+            (c == '{' && (pos + 1 == linelen || line.at(pos + 1) == '}' || std::isspace(static_cast<unsigned char>(line.at(pos + 1))))) ||
-             (c == '|' && pos + 1 == linelen) ||
-             (c == '/' && pos + 1 < linelen && (line.at(pos + 1) == '/' || line.at(pos + 1) == '*'))))
-       {
-@@ -1055,7 +1055,7 @@ bool Reflex::get_pattern(size_t& pos, st
-         break;
-       }
-     }
--    else if (std::isspace(c))
-+    else if (std::isspace(static_cast<unsigned char>(c)))
-     {
-       break;
-     }
-@@ -1134,7 +1134,7 @@ bool Reflex::get_pattern(size_t& pos, st
-         ++pos;
-       }
-     }
--    if (fsp && !std::isspace(c))
-+    if (fsp && !std::isspace(static_cast<unsigned char>(c)))
-       nsp = pos;
-   }
-   pattern.append(line.substr(loc, pos - loc));
-@@ -1239,7 +1239,7 @@ std::string Reflex::get_code(size_t& pos
-         }
-         else
-         {
--          if (blk == 0 && lev == 0 && linelen > 0 && (!std::isspace(line.at(0)) || !options["freespace"].empty()))
-+          if (blk == 0 && lev == 0 && linelen > 0 && (!std::isspace(static_cast<unsigned char>(line.at(0))) || !options["freespace"].empty()))
-             return code;
-           code.append("\n").append(line);
-         }
-@@ -1312,8 +1312,8 @@ std::string Reflex::upper_name(const std
-   std::string t;
-   for (size_t i = 0; i < s.size(); ++i)
-   {
--    if (std::isalnum(s.at(i)))
--      t.push_back(std::toupper(s.at(i)));
-+    if (std::isalnum(static_cast<unsigned char>(s.at(i))))
-+      t.push_back(static_cast<char>(std::toupper(static_cast<unsigned char>(s.at(i)))));
-     else
-       t.push_back('_');
-   }
-@@ -1337,11 +1337,11 @@ std::string Reflex::param_args(const std
-     if (i <= from)
-       i = to;
-     while (--i > from)
--      if (!std::isspace(params.at(i)))
-+      if (!std::isspace(static_cast<unsigned char>(params.at(i))))
-         break;
-     size_t j = i++;
-     while (--i > from)
--      if (!std::isalnum(params.at(i)) && params.at(i) != '_')
-+      if (!std::isalnum(static_cast<unsigned char>(params.at(i))) && params.at(i) != '_')
-         break;
-     if (!args.empty())
-       args.append(", ");
-@@ -1355,7 +1355,7 @@ std::string Reflex::param_args(const std
- bool Reflex::get_starts(size_t& pos, Starts& starts)
- {
-   pos = 0;
--  if (linelen > 1 && line.at(0) == '<' && (std::isalpha(line.at(1)) || line.at(1) == '_' || line.at(1) == '*' || (line.at(1) & 0x80) == 0x80 || line.at(1) == '^') && line.find('>') != std::string::npos)
-+  if (linelen > 1 && line.at(0) == '<' && (std::isalpha(static_cast<unsigned char>(line.at(1))) || line.at(1) == '_' || line.at(1) == '*' || (line.at(1) & 0x80) == 0x80 || line.at(1) == '^') && line.find('>') != std::string::npos)
-   {
-     do
-     {
 @@ -1915,7 +1915,7 @@ void Reflex::write_prelude()
      *out << "\n// --perf-report option requires a timer:\n#include <reflex/timer.h>\n";
  }


Home | Main Index | Thread Index | Old Index