Scilab: reference passing default mode is INPUT (here fix for vectors)

This commit is contained in:
Simon Marchetto 2013-06-20 18:17:20 +02:00
commit 87e0005276
3 changed files with 10 additions and 7 deletions

View file

@ -28,7 +28,7 @@
}
}
%typemap(in, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") std::vector<double>&(std::vector<double> temp)
%typemap(in, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") std::vector<double>& (std::vector<double> temp)
{
double* dmatrix;
int nbRows;
@ -70,7 +70,7 @@
}
}
%typemap(argout, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") std::vector<double>&
%typemap(argout, fragment="SWIG_SciDouble_FromDoubleArrayAndSize") std::vector<double> &INOUT
{
int nbCols = $1->size();
double* dmatrix = new double[nbCols];

View file

@ -28,7 +28,7 @@
}
}
%typemap(in, fragment="SWIG_SciInt32_AsIntArrayAndSize") std::vector<int>&(std::vector<int> temp)
%typemap(in, fragment="SWIG_SciInt32_AsIntArrayAndSize") std::vector<int>& (std::vector<int> temp)
{
int* imatrix;
int nbRows;
@ -70,7 +70,7 @@
}
}
%typemap(argout, fragment="SWIG_SciInt32_FromIntArrayAndSize") std::vector<int>&
%typemap(argout, fragment="SWIG_SciInt32_FromIntArrayAndSize") std::vector<int> &INOUT
{
int nbCols = $1->size();
int* imatrix = new int[nbCols];

View file

@ -5,7 +5,7 @@
%include <scichar.swg>
%typemap(in, fragment="SwigScilabStringToCharPtrArrayAndSize") std::vector<std::string>(std::vector<std::string> temp)
%typemap(in, fragment="SwigScilabStringToCharPtrArrayAndSize") std::vector<std::string> (std::vector<std::string> temp)
{
char** charArray;
int charArraySize;
@ -27,7 +27,7 @@
}
}
%typemap(in, fragment="SwigScilabStringToCharPtrArrayAndSize") std::vector<std::string>&(std::vector<std::string> temp)
%typemap(in, fragment="SwigScilabStringToCharPtrArrayAndSize") std::vector<std::string>& (std::vector<std::string> temp)
{
char** charArray;
int charArraySize;
@ -75,7 +75,7 @@
}
}
%typemap(argout, fragment="SwigScilabStringFromCharPtrArray") std::vector<std::string>&
%typemap(argout, fragment="SwigScilabStringFromCharPtrArray") std::vector<std::string> &INOUT
{
int pCharArraySize = $1->size();
char** pCharArray = new char*[pCharArraySize];
@ -104,3 +104,6 @@