check view as integer after call of C gateway 70/18870/3
Antoine ELIAS [Wed, 11 Jan 2017 16:44:19 +0000 (17:44 +0100)]
Change-Id: Id68f3ff1f63beb4d73cb03f3f2f32e0169684271

scilab/modules/ast/src/cpp/types/function.cpp

index 4f33913..bfad747 100644 (file)
@@ -438,6 +438,27 @@ Function::ReturnValue WrapFunction::call(typed_list &in, optional_list &opt, int
             out[i]->DecreaseRef();
         }
     }
+    else
+    {
+        for (int i = 0; i < in.size(); ++i)
+        {
+            if (in[i]->isDouble() && ((types::Double*)in[i])->isViewAsInteger())
+            {
+                types::Double* pD = in[i]->getAs<types::Double>();
+                pD->convertFromInteger();
+            }
+        }
+
+    }
+
+    for (auto i : opt)
+    {
+        if (i.second->isDouble() && ((types::Double*)i.second)->isViewAsInteger())
+        {
+            types::Double* pD = i.second->getAs<types::Double>();
+            pD->convertFromInteger();
+        }
+    }
 
     return retVal;
 }