From 423faa77836a47e414e02adc22293d43e21f7de8 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Fri, 14 Mar 2014 16:49:45 +0100 Subject: [PATCH] scilab: in int typemap use API CreateMatrixOfDoubleAsInteger --- Lib/scilab/sciint.swg | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Lib/scilab/sciint.swg b/Lib/scilab/sciint.swg index 2170d800c..24ed39cca 100644 --- a/Lib/scilab/sciint.swg +++ b/Lib/scilab/sciint.swg @@ -174,21 +174,12 @@ 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; - int i; - double *pdValues = NULL; - - 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); + sciErr = createMatrixOfDoubleAsInteger(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, _iRows, _iCols, _piData); if (sciErr.iErr) { printError(&sciErr, 0); - free(pdValues); return SWIG_ERROR; } - free(pdValues); return SWIG_OK; } }