]> rtime.felk.cvut.cz Git - boost-statechart-viewer.git/blobdiff - src/visualizer.cpp
Order Diag parameters as expected by diag_warning template
[boost-statechart-viewer.git] / src / visualizer.cpp
index f22ff3ce885704ce665e46b5aab75032cfc888bd..068926d57a0e3ba525d8dca131178c60263ccc23 100644 (file)
@@ -62,10 +62,10 @@ namespace Model
     {
        string initialInnerState;
        list<string> defferedEvents;
+       bool noTypedef;
     public:
        const string name;
-       bool noTypedef;
-       explicit State(string name) : name(name), noTypedef(false) {}
+       explicit State(string name) : noTypedef(false), name(name) {}
        void setInitialInnerState(string name) { initialInnerState = name; }
        void addDeferredEvent(const string &name) { defferedEvents.push_back(name); }
        void setNoTypedef() { noTypedef = true;}
@@ -451,15 +451,12 @@ public:
        IdentifierInfo& II = ASTCtx->Idents.get("reactions");
        // TODO: Lookup for reactions even in base classes - probably by using Sema::LookupQualifiedName()
        for (DeclContext::lookup_result Reactions = RecordDecl->lookup(DeclarationName(&II));
-            Reactions.first != Reactions.second; ++Reactions.first)
-       {           
-               HandleReaction(*Reactions.first, RecordDecl);
-               typedef_num++;
-       }
+            Reactions.first != Reactions.second; ++Reactions.first, typedef_num++)
+           HandleReaction(*Reactions.first, RecordDecl);
        if(typedef_num == 0) {
-               Diag(RecordDecl->getLocStart(), diag_warning)
-                   << " missing typedef for reactions in state : " << RecordDecl->getName();
-                   state->setNoTypedef();
+           Diag(RecordDecl->getLocStart(), diag_warning)
+               << RecordDecl->getName() << "state has no typedef for reactions";
+           state->setNoTypedef();
        }
     }