fix warning in scicos MVC compilation 46/15146/2
Antoine ELIAS [Tue, 2 Sep 2014 16:18:39 +0000 (18:18 +0200)]
Change-Id: I888221cbab5786211caf810a8e33bd04b9ec181c

scilab/modules/scicos/sci_gateway/cpp/sci_scicos_new.cpp
scilab/modules/scicos/src/cpp/view_scilab/BaseAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/GraphicsAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/LinkAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/ModelAdapter.cpp

index 21a41aa..eb9d957 100644 (file)
@@ -60,9 +60,9 @@ types::InternalType * alloc_and_set(kind_t k, types::String* type_name, types::t
     Adaptor* adaptor = new Adaptor(static_cast<Adaptee*>(controller.getObject(o)));
 
     // the first header entry is the type
-    for (size_t i = 1; i < in.size(); i++)
+    for (int i = 1; i < (int)in.size(); i++)
     {
-        std::wstring name = type_name->get(i);
+        std::wstring name (type_name->get(i));
         if (!adaptor->setProperty(name, in[i], controller))
         {
             Scierror(999, _("%s: Wrong value for input argument #%d: unable to set \"%ls\".\n"), funame.data(), i, name.data());
@@ -79,9 +79,9 @@ types::InternalType * alloc_and_set_as_mlist(kind_t k, types::String* type_name,
 {
     // check header
     Adaptor adaptor = Adaptor(0);
-    for (size_t i = 1; i < in.size(); i++)
+    for (int i = 1; i < (int)in.size(); i++)
     {
-        std::wstring name = type_name->get(i);
+        std::wstring name(type_name->get(i));
         if (!adaptor.hasProperty(name))
         {
             Scierror(999, _("%s: Wrong value for input argument #%d: unable to set \"%ls\".\n"), funame.data(), i, name.data());
@@ -92,7 +92,7 @@ types::InternalType * alloc_and_set_as_mlist(kind_t k, types::String* type_name,
     // copy the data
     types::MList* mlist = new types::MList();
     mlist->set(0, type_name->clone());
-    for (size_t i = 1; i < in.size(); i++)
+    for (int i = 1; i < (int)in.size(); i++)
     {
         mlist->set(i, in[i]);
     }
index dfa67a9..a11a299 100644 (file)
@@ -144,7 +144,7 @@ public:
         std::sort(properties.begin(), properties.end(), property<Adaptor>::original_index_cmp);
 
         // create the header
-        types::String* header = new types::String(1 + properties.size(), 1);
+        types::String* header = new types::String(1 + (int)properties.size(), 1);
         header->set(0, Adaptor::getSharedTypeStr().c_str());
         int index = 1;
         for (typename property<Adaptor>::props_t_it it = properties.begin(); it != properties.end(); ++it, ++index)
index be43e5f..d35acb1 100644 (file)
@@ -209,8 +209,8 @@ struct exprs
         std::vector<std::string> exprs;
         controller.getObjectProperty(adaptee->id(), adaptee->kind(), EXPRS, exprs);
 
-        types::String* o = new types::String(exprs.size(), 1);
-        for (size_t i = 0; i < exprs.size(); ++i)
+        types::String* o = new types::String((int)exprs.size(), 1);
+        for (int i = 0; i < (int)exprs.size(); ++i)
         {
             o->set(i, exprs[i].data());
         }
@@ -230,7 +230,7 @@ struct exprs
 
             model::Block* adaptee = adaptor.getAdaptee();
             std::vector<std::string> exprs (current->getSize());
-            for (size_t i = 0; i < exprs.size(); ++i)
+            for (int i = 0; i < (int)exprs.size(); ++i)
             {
                 char* c_str = wide_string_to_UTF8(current->get(i));
                 exprs[i] = std::string(c_str);
index dabcae6..4f21601 100644 (file)
@@ -41,7 +41,7 @@ struct xx
         controller.getObjectProperty(adaptee->id(), adaptee->kind(), CONTROL_POINTS, controlPoints);
 
         double* data;
-        types::Double* o = new types::Double(controlPoints.size() / 2, 1, &data);
+        types::Double* o = new types::Double((int)controlPoints.size() / 2, 1, &data);
 
         std::copy(controlPoints.begin(), controlPoints.begin() + controlPoints.size() / 2, data);
         return o;
@@ -84,7 +84,7 @@ struct yy
         controller.getObjectProperty(adaptee->id(), adaptee->kind(), CONTROL_POINTS, controlPoints);
 
         double* data;
-        types::Double* o = new types::Double(controlPoints.size() / 2, 1, &data);
+        types::Double* o = new types::Double((int)controlPoints.size() / 2, 1, &data);
 
         std::copy(controlPoints.begin() + controlPoints.size() / 2, controlPoints.end(), data);
         return o;
@@ -356,7 +356,7 @@ static bool setLinkEnd(LinkAdapter& adaptor, Controller& controller, object_prop
     int kind = static_cast<int>(current->get(2));
     std::vector<ScicosID> sourceBlockPorts;
     controller.getObjectProperty(blk, BLOCK, portType, sourceBlockPorts);
-    int nBlockPorts = sourceBlockPorts.size();
+    int nBlockPorts = (int)sourceBlockPorts.size();
     // Create as many ports as necessary
     while (nBlockPorts < port)
     {
index fd7ebaa..ee2bb85 100644 (file)
@@ -56,7 +56,7 @@ struct sim
         }
         else
         {
-            types::Double* Api = new types::Double(1, 1, static_cast<double>(api));
+            types::Double* Api = new types::Double(static_cast<double>(api));
             types::List* o = new types::List();
             o->set(0, Name);
             o->set(1, Api);
@@ -254,7 +254,7 @@ struct state
         controller.getObjectProperty(adaptee->id(), adaptee->kind(), STATE, state);
 
         double* data;
-        types::Double* o = new types::Double(state.size(), 1, &data);
+        types::Double* o = new types::Double((int)state.size(), 1, &data);
 
         std::copy(state.begin(), state.end(), data);
 
@@ -296,7 +296,7 @@ struct dstate
         controller.getObjectProperty(adaptee->id(), adaptee->kind(), DSTATE, dstate);
 
         double* data;
-        types::Double* o = new types::Double(dstate.size(), 1, &data);
+        types::Double* o = new types::Double((int)dstate.size(), 1, &data);
 
         std::copy(dstate.begin(), dstate.end(), data);
 
@@ -375,7 +375,7 @@ struct rpar
             controller.getObjectProperty(adaptee->id(), adaptee->kind(), RPAR, rpar);
 
             double *data;
-            types::Double* o = new types::Double(rpar.size(), 1, &data);
+            types::Double* o = new types::Double((int)rpar.size(), 1, &data);
             std::copy(rpar.begin(), rpar.end(), data);
 
             return o;
@@ -442,7 +442,7 @@ struct ipar
         controller.getObjectProperty(adaptee->id(), adaptee->kind(), IPAR, ipar);
 
         double *data;
-        types::Double* o = new types::Double(ipar.size(), 1, &data);
+        types::Double* o = new types::Double((int)ipar.size(), 1, &data);
 
         std::transform(ipar.begin(), ipar.end(), data, toDouble);