Scilab: fix compilation error on createMatrixOfString
This commit is contained in:
parent
03181491b4
commit
8a3278ade2
2 changed files with 4 additions and 19 deletions
|
|
@ -60,21 +60,15 @@ SwigScilabStringToChar(void *_pvApiCtx, int _iVar, char *_pcValue, char *_fname)
|
||||||
%fragment("SwigScilabStringFromChar", "header") {
|
%fragment("SwigScilabStringFromChar", "header") {
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SwigScilabStringFromChar(void *_pvApiCtx, int _iVarOut, char _chValue) {
|
SwigScilabStringFromChar(void *_pvApiCtx, int _iVarOut, char _chValue) {
|
||||||
SciErr sciErr;
|
|
||||||
|
|
||||||
char *pchValue = (char*)malloc(sizeof(char) * 2);
|
char *pchValue = (char*)malloc(sizeof(char) * 2);
|
||||||
pchValue[0] = _chValue;
|
pchValue[0] = _chValue;
|
||||||
pchValue[1] = '\0';
|
pchValue[1] = '\0';
|
||||||
|
|
||||||
sciErr = createMatrixOfString(_pvApiCtx, Rhs + _iVarOut, 1, 1, &pchValue);
|
if (createSingleString(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, pchValue))
|
||||||
if (sciErr.iErr) {
|
|
||||||
printError(&sciErr, 0);
|
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
|
||||||
|
|
||||||
free(pchValue);
|
free(pchValue);
|
||||||
|
return SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||||
return Rhs + _iVarOut;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,6 @@ SWIG_Scilab_NewMemberObj(void *_pvApiCtx, int _iVarOut, void *_ptr, int _sz, swi
|
||||||
char *r = result;
|
char *r = result;
|
||||||
|
|
||||||
SciErr sciErr;
|
SciErr sciErr;
|
||||||
char **pstData = NULL;
|
|
||||||
if ((2*_sz + 1 + strlen(_type->name)) > 1000) {
|
if ((2*_sz + 1 + strlen(_type->name)) > 1000) {
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
@ -214,18 +213,10 @@ SWIG_Scilab_NewMemberObj(void *_pvApiCtx, int _iVarOut, void *_ptr, int _sz, swi
|
||||||
r = SWIG_PackData(r, _ptr, _sz);
|
r = SWIG_PackData(r, _ptr, _sz);
|
||||||
strcpy(r, _type->name);
|
strcpy(r, _type->name);
|
||||||
|
|
||||||
pstData = (char **)malloc(sizeof(char *));
|
if (createSingleString(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, r))
|
||||||
pstData[0] = strdup(r);
|
|
||||||
|
|
||||||
sciErr = createMatrixOfString(_pvApiCtx, Rhs + _iVarOut, 1, 1, (char **)pstData);
|
|
||||||
if (sciErr.iErr) {
|
|
||||||
printError(&sciErr, 0);
|
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
|
||||||
|
|
||||||
free(pstData[0]);
|
return SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||||
|
|
||||||
return Rhs + _iVarOut;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGRUNTIME int
|
SWIGRUNTIME int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue