Xcos MVC: slight corrections 14/15114/4
Paul Bignier [Thu, 28 Aug 2014 09:11:41 +0000 (11:11 +0200)]
Change-Id: Iacebdeef3b8523c3eda776da6ad81eb89e99f84d

scilab/modules/scicos/src/cpp/view_scilab/GraphicsAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/ModelAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/ports_management.hxx

index d895e7d..be43e5f 100644 (file)
@@ -229,7 +229,7 @@ struct exprs
             }
 
             model::Block* adaptee = adaptor.getAdaptee();
-            std::vector<std::string> exprs = std::vector<std::string>(current->getSize());
+            std::vector<std::string> exprs (current->getSize());
             for (size_t i = 0; i < exprs.size(); ++i)
             {
                 char* c_str = wide_string_to_UTF8(current->get(i));
index 0a12e2d..c909afb 100644 (file)
@@ -277,7 +277,7 @@ struct state
 
         model::Block* adaptee = adaptor.getAdaptee();
 
-        std::vector<double> state;
+        std::vector<double> state (current->getSize());
         std::copy(current->getReal(), current->getReal() + current->getSize(), state.begin());
 
         controller.setObjectProperty(adaptee->id(), adaptee->kind(), STATE, state);
@@ -319,7 +319,7 @@ struct dstate
 
         model::Block* adaptee = adaptor.getAdaptee();
 
-        std::vector<double> dstate;
+        std::vector<double> dstate (current->getSize());
         std::copy(current->getReal(), current->getReal() + current->getSize(), dstate.begin());
 
         controller.setObjectProperty(adaptee->id(), adaptee->kind(), DSTATE, dstate);
@@ -555,12 +555,12 @@ struct firing
 
     static types::InternalType* get(const ModelAdapter& adaptor, const Controller& controller)
     {
-        return get_ports_property<ModelAdapter, FIRING>(adaptor, OUTPUTS, controller);
+        return get_ports_property<ModelAdapter, FIRING>(adaptor, EVENT_OUTPUTS, controller);
     }
 
     static bool set(ModelAdapter& adaptor, types::InternalType* v, Controller& controller)
     {
-        return set_ports_property<ModelAdapter, FIRING>(adaptor, OUTPUTS, controller, v);
+        return set_ports_property<ModelAdapter, FIRING>(adaptor, EVENT_OUTPUTS, controller, v);
     }
 };
 
index 06d1525..8862e8f 100644 (file)
@@ -413,7 +413,7 @@ bool update_ports_property(const Adaptor& adaptor, object_properties_t port_kind
         controller.getObjectProperty(parentDiagram, DIAGRAM, CHILDREN, children);
     }
 
-    std::vector<int> newPorts = std::vector<int>(value->getSize());
+    std::vector<int> newPorts (value->getSize());
 
     // retrieve old data
     std::vector<ScicosID> oldPorts;