From: Ulya Trofimovich Date: Tue, 19 May 2015 17:45:55 +0000 (+0100) Subject: Fixed clang's "warning: declaration shadows a local variable [-Wshadow]" X-Git-Tag: 0.15~255 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d41cef7546d33bb4adec379a914fd29fc03f70d3;p=re2c Fixed clang's "warning: declaration shadows a local variable [-Wshadow]" --- diff --git a/re2c/src/codegen/prepare_dfa.cc b/re2c/src/codegen/prepare_dfa.cc index 8e3cd3b2..bd1113f6 100644 --- a/re2c/src/codegen/prepare_dfa.cc +++ b/re2c/src/codegen/prepare_dfa.cc @@ -155,9 +155,6 @@ void DFA::findBaseState() void DFA::prepare(uint32_t & max_fill) { - State *s; - uint32_t i; - bUsedYYBitmap = false; findSCCs(); @@ -165,7 +162,7 @@ void DFA::prepare(uint32_t & max_fill) uint32_t nRules = 0; - for (s = head; s; s = s->next) + for (State * s = head; s; s = s->next) { s->depth = maxDist(s); if (max_fill < s->depth) @@ -185,11 +182,11 @@ void DFA::prepare(uint32_t & max_fill) // mark backtracking points bSaveOnHead = false; - for (s = head; s; s = s->next) + for (State * s = head; s; s = s->next) { if (s->rule) { - for (i = 0; i < s->go.nSpans; ++i) + for (uint32_t i = 0; i < s->go.nSpans; ++i) { if (s->go.span[i].to && !s->go.span[i].to->rule) { @@ -212,7 +209,7 @@ void DFA::prepare(uint32_t & max_fill) State *accept = NULL; State *accfixup = NULL; - for (s = head; s; s = s->next) + for (State * s = head; s; s = s->next) { State * ow; @@ -233,7 +230,7 @@ void DFA::prepare(uint32_t & max_fill) ow = rules[s->rule->accept]; } - for (i = 0; i < s->go.nSpans; ++i) + for (uint32_t i = 0; i < s->go.nSpans; ++i) { if (!s->go.span[i].to) { @@ -263,13 +260,13 @@ void DFA::prepare(uint32_t & max_fill) delete [] rules; // split ``base'' states into two parts - for (s = head; s; s = s->next) + for (State * s = head; s; s = s->next) { s->isBase = false; if (s->link) { - for (i = 0; i < s->go.nSpans; ++i) + for (uint32_t i = 0; i < s->go.nSpans; ++i) { if (s->go.span[i].to == s) { @@ -291,7 +288,7 @@ void DFA::prepare(uint32_t & max_fill) // find ``base'' state, if possible findBaseState(); - for (s = head; s; s = s->next) + for (State * s = head; s; s = s->next) { s->go.init (s); }