]> granicus.if.org Git - re2c/commitdiff
Narrowed scope of local variables.
authorUlya Trofimovich <skvadrik@gmail.com>
Fri, 28 Aug 2015 22:10:33 +0000 (23:10 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Fri, 28 Aug 2015 22:10:33 +0000 (23:10 +0100)
re2c/src/ir/dfa/dfa.cc

index 00b4db3021cc51aa957e31ab4f77d1e7ba5d6b39..eeccf1576252f08cf7c97e4c2c829f38b75f2322 100644 (file)
@@ -60,12 +60,11 @@ DFA::DFA(Ins *ins, uint32_t ni, uint32_t lb, uint32_t ub, const Char *rep)
                State *s = toDo;
                toDo = s->link;
 
-               Ins **cP, **iP, *i;
                uint32_t nGoTos = 0;
 
                s->rule = NULL;
 
-               for (iP = s->kernel; (i = *iP); ++iP)
+               for (Ins ** iP = s->kernel, * i; (i = *iP); ++iP)
                {
                        if (i->i.tag == CHAR)
                        {
@@ -91,9 +90,10 @@ DFA::DFA(Ins *ins, uint32_t ni, uint32_t lb, uint32_t ub, const Char *rep)
                for (uint32_t j = 0; j < nGoTos; ++j)
                {
                        GoTo *go = &goTo[goTo[j].ch - lb];
-                       i = (Ins*) go->to;
+                       Ins * i = (Ins*) go->to;
 
-                       for (cP = work; i; i = (Ins*) i->c.link)
+                       Ins ** cP = work;
+                       for (; i; i = (Ins*) i->c.link)
                                cP = closure(cP, i + i->c.bump);
 
                        go->to = findState(work, cP);