Tests: Fix glib warning

This commit is contained in:
Wilson Snyder 2019-06-30 21:35:55 -04:00
parent 0e8dfdbb71
commit 5cd531a5e0

View File

@ -220,9 +220,12 @@ private:
// Expand the nfasWithInput list to include epsilon states // Expand the nfasWithInput list to include epsilon states
// reachable by those on nfasWithInput // reachable by those on nfasWithInput
for (DfaStates::iterator nfaIt=nfasWithInput.begin(); {
nfaIt!=nfasWithInput.end(); ++nfaIt) { DfaStates nfasTodo = nfasWithInput;
DfaVertex* nfaStatep = *nfaIt; nfasWithInput.clear(); // Now the completed list
while (!nfasTodo.empty()) {
DfaVertex* nfaStatep = nfasTodo.front(); nfasTodo.pop_front();
nfasWithInput.push_back(nfaStatep);
// Foreach epsilon-reachable (on this nfaStatep) // Foreach epsilon-reachable (on this nfaStatep)
for (V3GraphEdge* nfaEdgep = nfaStatep->outBeginp(); for (V3GraphEdge* nfaEdgep = nfaStatep->outBeginp();
nfaEdgep; nfaEdgep=nfaEdgep->outNextp()) { nfaEdgep; nfaEdgep=nfaEdgep->outNextp()) {
@ -230,7 +233,7 @@ private:
if (cNfaEdgep->epsilon()) { if (cNfaEdgep->epsilon()) {
DfaVertex* nextStatep = static_cast<DfaVertex*>(cNfaEdgep->top()); DfaVertex* nextStatep = static_cast<DfaVertex*>(cNfaEdgep->top());
if (unseenNfaThisStep(nextStatep)) { // Not processed? if (unseenNfaThisStep(nextStatep)) { // Not processed?
nfasWithInput.push_back(nextStatep); nfasTodo.push_back(nextStatep);
nextStatep->user(m_step); nextStatep->user(m_step);
UINFO(9," Epsilon Reachable "<<nextStatep<<endl); UINFO(9," Epsilon Reachable "<<nextStatep<<endl);
} }
@ -238,6 +241,7 @@ private:
} }
} }
} }
}
void main() { void main() {
UINFO(5,"Dfa to Nfa conversion...\n"); UINFO(5,"Dfa to Nfa conversion...\n");