@@ -33,13 +33,13 @@ void EdgeLabeledModeFSM::removeDanglingStates() {
3333 ELSSetOfStateRefs statesToBeRemoved;
3434
3535 // const ELSSetOfStates& elsStates = this->getStates();
36- auto &elsEdges = dynamic_cast <const ELSSetOfEdges &>(this ->getEdges ());
36+ const auto &elsEdges = dynamic_cast <const ELSSetOfEdges &>(this ->getEdges ());
3737
3838 /* go through all edges and find all edges that end in
3939 dangling states. Also store dangling states.*/
4040 for (const auto &it : elsEdges) {
4141
42- auto e = dynamic_cast <ELSEdgeRef>(&(*it.second ));
42+ const auto * e = dynamic_cast <ELSEdgeRef>(&(*it.second ));
4343 const auto &s = dynamic_cast <ELSStateRef>(e->getDestination ());
4444 const auto &oEdges = dynamic_cast <const ELSSetOfEdges &>(s->getOutgoingEdges ());
4545 if (oEdges.empty ()) {
@@ -77,8 +77,8 @@ void EdgeLabeledModeFSM::removeDanglingStates() {
7777 dangling states. Also store dangling states.*/
7878 for (const auto &it : elsEdges2) {
7979
80- auto e = dynamic_cast <ELSEdgeRef>(&(*(it.second )));
81- const auto s = dynamic_cast <ELSStateRef>(e->getDestination ());
80+ const auto * e = dynamic_cast <ELSEdgeRef>(&(*(it.second )));
81+ const auto * const s = dynamic_cast <ELSStateRef>(e->getDestination ());
8282 const auto &oEdges = dynamic_cast <const ELSSetOfEdges &>(s->getOutgoingEdges ());
8383 if (oEdges.empty ()) {
8484 edgesToBeRemoved.insert (e);
@@ -188,7 +188,7 @@ std::shared_ptr<MaxPlusAutomaton> SMPLS::convertToMaxPlusAutomaton() const {
188188 auto &q1 = dynamic_cast <ELSState &>(*(q.second ));
189189 CId q1Id = q1.getLabel ();
190190
191- std::map<int , MPAStateRef> q1StateMap;
191+ std::map<size_t , MPAStateRef> q1StateMap;
192192
193193 // for every outgoing edge of the state
194194 const auto &t = dynamic_cast <const ELSSetOfEdgeRefs &>(q1.getOutgoingEdges ());
@@ -251,7 +251,7 @@ void SMPLSwithEvents::saveDeterminizedIOAtoFile(const MPString &file) {
251251
252252 MPString errMsg = " " ;
253253 auto i = I.begin ();
254- auto &s = dynamic_cast <const IOAState &>(*(*i));
254+ const auto &s = dynamic_cast <const IOAState &>(*(*i));
255255 i++;
256256 // we remove the rest of the initial states since only one is allowed
257257 for (; i != I.end ();) {
@@ -310,14 +310,14 @@ std::shared_ptr<MaxPlusAutomaton> SMPLSwithEvents::convertToMaxPlusAutomaton() {
310310
311311 const auto &I2 = this ->ioa ->getInitialStates ();
312312 for (const auto &i : I2) {
313- auto s = dynamic_cast <IOAStateRef>(i);
313+ const auto * s = dynamic_cast <IOAStateRef>(i);
314314 prepareMatrices (*s, eventList, visitedEdges);
315- auto sr = this ->elsFSM .getStateLabeled (s->getLabel ());
315+ const auto * sr = this ->elsFSM .getStateLabeled (s->getLabel ());
316316 this ->elsFSM .addInitialState (*sr);
317317 }
318318 const auto &I3 = this ->ioa ->getFinalStates ();
319319 for (const auto &i : I3) {
320- auto s = dynamic_cast <IOAStateRef>(i);
320+ const auto * s = dynamic_cast <IOAStateRef>(i);
321321 this ->elsFSM .addFinalState (*this ->elsFSM .getStateLabeled (s->getLabel ()));
322322 }
323323 return SMPLS::convertToMaxPlusAutomaton ();
@@ -631,7 +631,7 @@ void SMPLSwithEvents::isConsistentUtil(const IOAState &s,
631631 }
632632 }
633633 }
634- const auto s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
634+ const auto * const s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
635635
636636 isConsistentUtil (*s2, eList, finalStates, errMsg, visited);
637637 }
@@ -666,7 +666,7 @@ void SMPLSwithEvents::determinizeUtil(const IOAState &s,
666666 const auto *e = dynamic_cast <const IOAEdge *>(*i);
667667 InputAction input = e->getLabel ().first ;
668668 if (input.empty ()) {
669- const auto s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
669+ const auto * const s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
670670 outfile << s.stateLabel << " -," << e->getLabel ().second << " ->" << s2->stateLabel ;
671671 ioa->removeEdge (*e);
672672
@@ -702,7 +702,7 @@ void SMPLSwithEvents::determinizeUtil(const IOAState &s,
702702 } else {
703703 // only allow edges with the outcome of the same event
704704 if (this ->findEventByOutcome (input) == ev) {
705- const auto s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
705+ const auto * const s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
706706 outfile << s.stateLabel << " -" << e->getLabel ().first << " ,"
707707 << e->getLabel ().second << " ->" << s2->stateLabel ;
708708
0 commit comments