diff --git a/parser/libapparmor_re/expr-tree.h b/parser/libapparmor_re/expr-tree.h index 5e9cf1c6e..930fffcf0 100644 --- a/parser/libapparmor_re/expr-tree.h +++ b/parser/libapparmor_re/expr-tree.h @@ -81,17 +81,15 @@ ostream &operator<<(ostream &os, const NodeSet &state); * (i.e., following an AnyCharNode or NotCharSetNode). This avoids * enumerating all the explicit tranitions for default matches. */ -typedef struct NodeCases { +typedef struct Cases { typedef map::iterator iterator; iterator begin() { return cases.begin(); } iterator end() { return cases.end(); } - NodeCases(): otherwise(0) { } + Cases(): otherwise(0) { } map cases; NodeSet *otherwise; -} - -NodeCases; +} Cases; ostream &operator<<(ostream &os, Node &node); @@ -205,7 +203,7 @@ public: ImportantNode(): LeafNode() { } void compute_firstpos() { firstpos.insert(this); } void compute_lastpos() { lastpos.insert(this); } - virtual void follow(NodeCases &cases) = 0; + virtual void follow(Cases &cases) = 0; }; /* common base class for all the different classes that contain @@ -220,7 +218,7 @@ public: class CharNode: public CNode { public: CharNode(uchar c): c(c) { } - void follow(NodeCases &cases) + void follow(Cases &cases) { NodeSet **x = &cases.cases[c]; if (!*x) { @@ -251,7 +249,7 @@ public: class CharSetNode: public CNode { public: CharSetNode(Chars &chars): chars(chars) { } - void follow(NodeCases &cases) + void follow(Cases &cases) { for (Chars::iterator i = chars.begin(); i != chars.end(); i++) { NodeSet **x = &cases.cases[*i]; @@ -292,7 +290,7 @@ public: class NotCharSetNode: public CNode { public: NotCharSetNode(Chars &chars): chars(chars) { } - void follow(NodeCases & cases) + void follow(Cases &cases) { if (!cases.otherwise) cases.otherwise = new NodeSet; @@ -305,7 +303,7 @@ public: * the old otherwise state for the matching characters. */ cases.otherwise->insert(followpos.begin(), followpos.end()); - for (NodeCases::iterator i = cases.begin(); i != cases.end(); + for (Cases::iterator i = cases.begin(); i != cases.end(); i++) { if (chars.find(i->first) == chars.end()) i->second->insert(followpos.begin(), @@ -340,12 +338,12 @@ public: class AnyCharNode: public CNode { public: AnyCharNode() { } - void follow(NodeCases &cases) + void follow(Cases &cases) { if (!cases.otherwise) cases.otherwise = new NodeSet; cases.otherwise->insert(followpos.begin(), followpos.end()); - for (NodeCases::iterator i = cases.begin(); i != cases.end(); + for (Cases::iterator i = cases.begin(); i != cases.end(); i++) i->second->insert(followpos.begin(), followpos.end()); } @@ -372,7 +370,7 @@ public: */ } - void follow(NodeCases &cases __attribute__ ((unused))) + void follow(Cases &cases __attribute__ ((unused))) { /* Nothing to follow. */ } diff --git a/parser/libapparmor_re/hfa.cc b/parser/libapparmor_re/hfa.cc index 9bee40ce9..79bcac733 100644 --- a/parser/libapparmor_re/hfa.cc +++ b/parser/libapparmor_re/hfa.cc @@ -92,7 +92,7 @@ void DFA::update_state_transitions(NodeMap &nodemap, list &work_queue, * The resultant transition set is a mapping of characters to * sets of nodes. */ - NodeCases cases; + Cases cases; for (NodeSet::iterator i = state->nodes->begin(); i != state->nodes->end(); i++) (*i)->follow(cases); @@ -110,7 +110,7 @@ void DFA::update_state_transitions(NodeMap &nodemap, list &work_queue, /* For each transition from *from, check if the set of nodes it * transitions to already has been mapped to a state */ - for (NodeCases::iterator j = cases.begin(); j != cases.end(); j++) { + for (Cases::iterator j = cases.begin(); j != cases.end(); j++) { State *target; target = find_target_state(nodemap, work_queue, j->second, stats);