From a3688d07deaa0139e0576071da2df2dc40710a90 Mon Sep 17 00:00:00 2001 From: helly Date: Thu, 13 Mar 2008 17:38:12 +0000 Subject: [PATCH] - Type fixes - Add an assertion to catch unwanted situations and document what it is - Fix compiler warning with unused parameter --- re2c/code.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/re2c/code.cc b/re2c/code.cc index 540a47a1..326b60e4 100644 --- a/re2c/code.cc +++ b/re2c/code.cc @@ -46,7 +46,7 @@ std::string replaceParam(std::string str, const std::string& param, const _Ty& v return str; } -static void genYYFill(std::ostream &o, uint ind, uint need) +static void genYYFill(std::ostream &o, uint, uint need) { if (bUseYYFillParam) { @@ -1312,7 +1312,7 @@ uint merge(Span *x0, State *fg, State *bg) } } -const uint cInfinity = ~0; +const uint cInfinity = ~0u; class SCC { @@ -2036,6 +2036,8 @@ void genTypes(std::string& o, uint ind, const RegExpMap& specMap) for(RegExpMap::const_iterator itSpecMap = specMap.begin(); itSpecMap != specMap.end(); ++itSpecMap) { + // If an entry is < 0 then we did the 0/empty correction twice. + assert(itSpecMap->second.first >= 0); vCondList[itSpecMap->second.first] = itSpecMap->first; } -- 2.40.0