diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/ruby/rubyrun.swg | 2 | ||||
-rw-r--r-- | Lib/scilab/scidouble.swg | 14 | ||||
-rw-r--r-- | Lib/scilab/sciint.swg | 5 | ||||
-rw-r--r-- | Lib/scilab/scimatrixdouble.swg | 12 | ||||
-rw-r--r-- | Lib/scilab/scimatrixint.swg | 12 | ||||
-rw-r--r-- | Lib/scilab/scirun.swg | 33 |
6 files changed, 55 insertions, 23 deletions
diff --git a/Lib/ruby/rubyrun.swg b/Lib/ruby/rubyrun.swg index 6cac4626a..885292481 100644 --- a/Lib/ruby/rubyrun.swg +++ b/Lib/ruby/rubyrun.swg @@ -157,7 +157,7 @@ SWIG_Ruby_define_class(swig_type_info *type) _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject); rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new"); } - rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer); + rb_undef_alloc_func(rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer)); free((void *) klass_name); } diff --git a/Lib/scilab/scidouble.swg b/Lib/scilab/scidouble.swg index 1b8263306..e14c84647 100644 --- a/Lib/scilab/scidouble.swg +++ b/Lib/scilab/scidouble.swg @@ -56,6 +56,7 @@ SWIG_SciDouble_FromDouble(void *pvApiCtx, int iVarOut, double dblValue, char *fn SWIGINTERN int SWIG_SciDouble_AsDoubleArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *iCols, double **pdValue, char *fname) { SciErr sciErr; + int iType = 0; int *piAddrVar = NULL; sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar); @@ -64,13 +65,24 @@ SWIG_SciDouble_AsDoubleArrayAndSize(void *pvApiCtx, int iVar, int *iRows, int *i return SWIG_ERROR; } - if (isDoubleType(pvApiCtx, piAddrVar) && !isVarComplex(pvApiCtx, piAddrVar)) { + sciErr = getVarType(pvApiCtx, piAddrVar, &iType); + if (sciErr.iErr) { + printError(&sciErr, 0); + return SWIG_ERROR; + } + + if (iType == sci_matrix && !isVarComplex(pvApiCtx, piAddrVar)) { sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, iRows, iCols, pdValue); if (sciErr.iErr) { printError(&sciErr, 0); return SWIG_ERROR; } } + else if (iType == sci_implicit_poly) { + *iRows = -1; + *iCols = 0; + *pdValue = NULL; + } else { Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A real matrix expected.\n"), fname, iVar); return SWIG_ERROR; diff --git a/Lib/scilab/sciint.swg b/Lib/scilab/sciint.swg index 2d6993569..b7b2563e8 100644 --- a/Lib/scilab/sciint.swg +++ b/Lib/scilab/sciint.swg @@ -157,6 +157,11 @@ SWIG_SciDoubleOrInt32_AsIntArrayAndSize(void *pvApiCtx, int iVar, int *iRows, in return SWIG_ERROR; } } + else if (iType == sci_implicit_poly) { + *iRows = -1; + *iCols = 0; + *piValue = NULL; + } else { Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double matrix expected.\n"), fname, iVar); return SWIG_ERROR; diff --git a/Lib/scilab/scimatrixdouble.swg b/Lib/scilab/scimatrixdouble.swg index 9444a8078..bb9403edd 100644 --- a/Lib/scilab/scimatrixdouble.swg +++ b/Lib/scilab/scimatrixdouble.swg @@ -28,7 +28,11 @@ %typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_SIZE) (int rowCount, int colCount) { if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; + if (rowCount < 0) { + $2 = rowCount; + } else { + $2 = rowCount * colCount; + } } else { return SWIG_ERROR; @@ -40,7 +44,11 @@ %typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_SIZE, double *IN) (int rowCount, int colCount) { if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; + if (rowCount < 0) { + $1 = rowCount; + } else { + $1 = rowCount * colCount; + } } else { return SWIG_ERROR; diff --git a/Lib/scilab/scimatrixint.swg b/Lib/scilab/scimatrixint.swg index e304d4f64..057710725 100644 --- a/Lib/scilab/scimatrixint.swg +++ b/Lib/scilab/scimatrixint.swg @@ -30,7 +30,11 @@ %typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_SIZE) (int rowCount, int colCount) { if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) { - $2 = rowCount * colCount; + if (rowCount < 0) { + $2 = rowCount; + } else { + $2 = rowCount * colCount; + } } else { return SWIG_ERROR; @@ -43,7 +47,11 @@ %typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_SIZE, int *IN) (int rowCount, int colCount) { if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) { - $1 = rowCount * colCount; + if (rowCount < 0) { + $1 = rowCount; + } else { + $1 = rowCount * colCount; + } } else { return SWIG_ERROR; diff --git a/Lib/scilab/scirun.swg b/Lib/scilab/scirun.swg index 586d5f16f..481aac7ac 100644 --- a/Lib/scilab/scirun.swg +++ b/Lib/scilab/scirun.swg @@ -5,7 +5,6 @@ /* Scilab version macro */ #include "version.h" -#define SWIG_SCILAB_VERSION (SCI_VERSION_MAJOR * 100) + (SCI_VERSION_MINOR * 10) + SCI_VERSION_MAINTENANCE /* Scilab standard headers */ @@ -13,11 +12,11 @@ extern "C" { #endif #include "api_scilab.h" -#if SWIG_SCILAB_VERSION < 540 +#if SCI_VERSION_MAJOR < 5 || SCI_VERSION_MAJOR == 5 && SCI_VERSION_MINOR < 4 #define __USE_DEPRECATED_STACK_FUNCTIONS__ #include "stack-c.h" #endif -#if SWIG_SCILAB_VERSION < 600 +#if SCI_VERSION_MAJOR < 6 #include "MALLOC.h" #endif #include "Scierror.h" @@ -31,12 +30,12 @@ extern "C" { /* Gateway signature */ -#if SWIG_SCILAB_VERSION >= 600 -#define SWIG_GatewayParameters char* fname, void *pvApiCtx -#define SWIG_GatewayArguments fname, pvApiCtx -#else +#if SCI_VERSION_MAJOR < 6 #define SWIG_GatewayParameters char* fname, unsigned long fname_len #define SWIG_GatewayArguments fname, fname_len +# else +#define SWIG_GatewayParameters char* fname, void *pvApiCtx +#define SWIG_GatewayArguments fname, pvApiCtx #endif /* Function name management functions */ @@ -58,29 +57,29 @@ static void SWIG_Scilab_SetFuncName(char *funcName) { /* Api context management functions */ -#if SWIG_SCILAB_VERSION >= 600 +#if SCI_VERSION_MAJOR < 6 +#define SWIG_Scilab_SetApiContext(apiCtx) +#else static void *pvApiCtx = NULL; static void SWIG_Scilab_SetApiContext(void *apiCtx) { pvApiCtx = apiCtx; } -#else -#define SWIG_Scilab_SetApiContext(apiCtx) #endif /* Argument management functions */ -#if SWIG_SCILAB_VERSION >= 540 -#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) -#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) -#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) -#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx) -#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos -#else +#if SCI_VERSION_MAJOR < 5 || SCI_VERSION_MAJOR == 5 && SCI_VERSION_MINOR < 4 #define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckRhs(minInputArgument, maxInputArgument) #define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckRhs(minInputArgument, 256) #define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckLhs(minOutputArgument, maxOutputArgument) #define SWIG_NbInputArgument(pvApiCtx) Rhs #define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) LhsVar(outputArgumentPos) = argumentPos +#else +#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) +#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) +#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) +#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx) +#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos #endif typedef int SwigSciObject; |