]> granicus.if.org Git - re2c/commitdiff
Fixed clang's "warning: declaration shadows a local variable [-Wshadow]"
authorUlya Trofimovich <skvadrik@gmail.com>
Mon, 18 May 2015 11:58:04 +0000 (12:58 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Mon, 18 May 2015 11:58:04 +0000 (12:58 +0100)
re2c/src/dfa/actions.cc
re2c/src/dfa/dfa.cc

index cb93d5682e5b924ab896bd2a9b545b7876bda933..b6ae6e2e4f69c09f507f6b9dfcea0c180acd830c 100644 (file)
@@ -792,7 +792,7 @@ RegExp * Scanner::strToCaseInsensitiveRE (SubStr & s) const
 
        while (s.len > 0)
        {
-               uint32_t c = unescape(s);
+               c = unescape(s);
 
                if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
                {
index e1010bf5b29ffa69ba828ffbc3209ef592eb012e..35e7ac941ad61de6aa5ea0c0aa480634cb971a8b 100644 (file)
@@ -63,7 +63,6 @@ DFA::DFA(Ins *ins, uint32_t ni, uint32_t lb, uint32_t ub, const Char *rep)
 
                Ins **cP, **iP, *i;
                uint32_t nGoTos = 0;
-               uint32_t j;
 
                s->rule = NULL;
 
@@ -90,7 +89,7 @@ DFA::DFA(Ins *ins, uint32_t ni, uint32_t lb, uint32_t ub, const Char *rep)
                        }
                }
 
-               for (j = 0; j < nGoTos; ++j)
+               for (uint32_t j = 0; j < nGoTos; ++j)
                {
                        GoTo *go = &goTo[goTo[j].ch - lb];
                        i = (Ins*) go->to;
@@ -103,7 +102,7 @@ DFA::DFA(Ins *ins, uint32_t ni, uint32_t lb, uint32_t ub, const Char *rep)
 
                s->go.nSpans = 0;
 
-               for (j = 0; j < nc;)
+               for (uint32_t j = 0; j < nc;)
                {
                        State *to = (State*) goTo[rep[j]].to;
 
@@ -116,7 +115,7 @@ DFA::DFA(Ins *ins, uint32_t ni, uint32_t lb, uint32_t ub, const Char *rep)
                        s->go.nSpans++;
                }
 
-               for (j = nGoTos; j-- > 0;)
+               for (uint32_t j = nGoTos; j-- > 0;)
                        goTo[goTo[j].ch - lb].to = NULL;
 
                s->go.span = allocate<Span> (s->go.nSpans);