From 01cf2e330896747cce284448c653d7e9c1595346 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Mon, 17 Mar 2014 12:29:36 +0100 Subject: [PATCH] scilab: rollback on sciint CreateMagtrixOfDoubleAsInteger does not exist in 5.3.3 --- Lib/scilab/sciint.swg | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Lib/scilab/sciint.swg b/Lib/scilab/sciint.swg index 24ed39cca..d4f35c407 100644 --- a/Lib/scilab/sciint.swg +++ b/Lib/scilab/sciint.swg @@ -174,12 +174,21 @@ SWIG_SciDoubleOrInt32_AsIntArrayAndSize(void *_pvApiCtx, int _iVar, int *_iRows, SWIGINTERN int SWIG_SciDouble_FromIntArrayAndSize(void *_pvApiCtx, int _iVarOut, int _iRows, int _iCols, const int *_piData) { SciErr sciErr; - sciErr = createMatrixOfDoubleAsInteger(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, _iRows, _iCols, _piData); + double *pdValues = NULL; + int i; + + pdValues = (double*) malloc(_iRows * _iCols * sizeof(double)); + for (i=0; i<_iRows * _iCols; i++) + pdValues[i] = _piData[i]; + + sciErr = createMatrixOfDouble(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, _iRows, _iCols, pdValues); if (sciErr.iErr) { printError(&sciErr, 0); + free(pdValues); return SWIG_ERROR; } + free(pdValues); return SWIG_OK; } }