scilab: fix and optimize integer typemaps
This commit is contained in:
parent
65621c988b
commit
e8fd0e506e
4 changed files with 181 additions and 101 deletions
|
|
@ -27,47 +27,48 @@ SWIG_SciDoubleOrInt32_AsInt(void *_pvApiCtx, SwigSciObject _iVar, int *_piValue,
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iType == sci_ints) {
|
if (iType == sci_ints) {
|
||||||
int iPrec = 0;
|
int iPrec = 0;
|
||||||
int *piData = NULL;
|
int *piData = NULL;
|
||||||
|
|
||||||
sciErr = getMatrixOfIntegerPrecision(_pvApiCtx, piAddrVar, &iPrec);
|
sciErr = getMatrixOfIntegerPrecision(_pvApiCtx, piAddrVar, &iPrec);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
if (iPrec != SCI_INT32) {
|
if (iPrec != SCI_INT32) {
|
||||||
Scierror(999, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or double expected.\n"), _fname, _iVar);
|
Scierror(999, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
sciErr = getMatrixOfInteger32(_pvApiCtx, piAddrVar, &iRows, &iCols, &piData);
|
sciErr = getMatrixOfInteger32(_pvApiCtx, piAddrVar, &iRows, &iCols, &piData);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
if (iRows * iCols != 1) {
|
if (iRows * iCols != 1) {
|
||||||
Scierror(999, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or double expected.\n"), _fname, _iVar);
|
Scierror(999, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
*_piValue = *piData;
|
*_piValue = *piData;
|
||||||
}
|
}
|
||||||
else if (iType == sci_matrix) {
|
else if (iType == sci_matrix) {
|
||||||
double *pdData = NULL;
|
double *pdData = NULL;
|
||||||
|
|
||||||
sciErr = getMatrixOfDouble(_pvApiCtx, piAddrVar, &iRows, &iCols, &pdData);
|
sciErr = getMatrixOfDouble(_pvApiCtx, piAddrVar, &iRows, &iCols, &pdData);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
if (iRows * iCols != 1) {
|
if (iRows * iCols != 1) {
|
||||||
Scierror(999, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or double expected.\n"), _fname, _iVar);
|
Scierror(999, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
*_piValue = (int) *pdData;
|
*_piValue = (int) *pdData;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Scierror(999, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or double expected.\n"), _fname, _iVar);
|
Scierror(999, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,10 +81,9 @@ SWIG_SciDoubleOrInt32_AsInt(void *_pvApiCtx, SwigSciObject _iVar, int *_piValue,
|
||||||
}
|
}
|
||||||
%fragment("SWIG_SciDouble_FromInt", "header") {
|
%fragment("SWIG_SciDouble_FromInt", "header") {
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SWIG_SciDouble_FromInt(void *_pvApiCtx, int _iVarOut, int _iValue, char *_fname)
|
SWIG_SciDouble_FromInt(void *_pvApiCtx, int _iVarOut, int _iValue, char *_fname){
|
||||||
{
|
int iVarOut = SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||||
int iVarOut = SWIG_NbInputArgument(_pvApiCtx) + SWIG_Scilab_GetOutputPosition();
|
if (createScalarDouble(_pvApiCtx, iVarOut, (double) _iValue))
|
||||||
if (createScalarDouble(_pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + _iVarOut, (double) _iValue))
|
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
return iVarOut;
|
return iVarOut;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,28 +3,88 @@
|
||||||
* Scilab type: double or int32
|
* Scilab type: double or int32
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%fragment(SWIG_AsVal_frag(long), "header", fragment="SWIG_Int_AsLong") {
|
%fragment(SWIG_AsVal_frag(long), "header", fragment="SWIG_SciDoubleOrInt32_AsLong") {
|
||||||
%#define SWIG_AsVal_long(scilabValue, valuePointer) SWIG_Int_AsLong(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname());
|
%#define SWIG_AsVal_long(scilabValue, valuePointer) SWIG_SciDoubleOrInt32_AsLong(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname());
|
||||||
}
|
}
|
||||||
%fragment("SWIG_Int_AsLong", "header", fragment=SWIG_AsVal_frag(int)) {
|
%fragment("SWIG_SciDoubleOrInt32_AsLong", "header") {
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SWIG_Int_AsLong(void *_pvApiCtx, SwigSciObject _iVar, long *_plValue, char *_fname) {
|
SWIG_SciDoubleOrInt32_AsLong(void *_pvApiCtx, SwigSciObject _iVar, long *_plValue, char *_fname) {
|
||||||
int iValue = 0.0;
|
SciErr sciErr;
|
||||||
if(SWIG_AsVal_dec(int)(_iVar, &iValue) != SWIG_OK) {
|
int iType = 0;
|
||||||
|
int iRows = 0;
|
||||||
|
int iCols = 0;
|
||||||
|
int *piAddrVar = NULL;
|
||||||
|
|
||||||
|
sciErr = getVarAddressFromPosition(_pvApiCtx, _iVar, &piAddrVar);
|
||||||
|
if (sciErr.iErr) {
|
||||||
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
*_plValue = (long) iValue;
|
|
||||||
|
sciErr = getVarType(_pvApiCtx, piAddrVar, &iType);
|
||||||
|
if (sciErr.iErr) {
|
||||||
|
printError(&sciErr, 0);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iType == sci_ints) {
|
||||||
|
int iPrec = 0;
|
||||||
|
int *piData = NULL;
|
||||||
|
|
||||||
|
sciErr = getMatrixOfIntegerPrecision(_pvApiCtx, piAddrVar, &iPrec);
|
||||||
|
if (sciErr.iErr) {
|
||||||
|
printError(&sciErr, 0);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
if (iPrec != SCI_INT32) {
|
||||||
|
Scierror(999, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
sciErr = getMatrixOfInteger32(_pvApiCtx, piAddrVar, &iRows, &iCols, &piData);
|
||||||
|
if (sciErr.iErr) {
|
||||||
|
printError(&sciErr, 0);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
if (iRows * iCols != 1) {
|
||||||
|
Scierror(999, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
*_plValue = (long) *piData;
|
||||||
|
}
|
||||||
|
else if (iType == sci_matrix) {
|
||||||
|
double *pdData = NULL;
|
||||||
|
|
||||||
|
sciErr = getMatrixOfDouble(_pvApiCtx, piAddrVar, &iRows, &iCols, &pdData);
|
||||||
|
if (sciErr.iErr) {
|
||||||
|
printError(&sciErr, 0);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
if (iRows * iCols != 1) {
|
||||||
|
Scierror(999, _("%s: Wrong size for input argument #%d: A 32-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
*_plValue = (long) *pdData;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Scierror(999, _("%s: Wrong type for input argument #%d: A 32-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%fragment(SWIG_From_frag(long), "header", fragment="SWIG_Int_FromLong") {
|
%fragment(SWIG_From_frag(long), "header", fragment="SWIG_SciDouble_FromLong") {
|
||||||
%#define SWIG_From_long(scilabValue) SWIG_Int_FromLong(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFname())
|
%#define SWIG_From_long(scilabValue) SWIG_SciDouble_FromLong(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFname())
|
||||||
}
|
}
|
||||||
%fragment("SWIG_Int_FromLong", "header", fragment=SWIG_From_frag(int)) {
|
%fragment("SWIG_SciDouble_FromLong", "header") {
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SWIG_Int_FromLong(void *_pvApiCtx, int _iVarOut, long _lValue, char *_fname) {
|
SWIG_SciDouble_FromLong(void *_pvApiCtx, int _iVarOut, long _lValue, char *_fname) {
|
||||||
return SWIG_From_dec(int)((int)_lValue);
|
int iVarOut = SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||||
|
if (createScalarDouble(_pvApiCtx, iVarOut, (double) _lValue))
|
||||||
|
return SWIG_ERROR;
|
||||||
|
return iVarOut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@
|
||||||
* Scilab type: double or int16
|
* Scilab type: double or int16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%fragment(SWIG_AsVal_frag(short), "header", fragment="SWIG_SciInt16_AsShort") {
|
%fragment(SWIG_AsVal_frag(short), "header", fragment="SWIG_SciDoubleOrInt16_AsShort") {
|
||||||
#define SWIG_AsVal_short(scilabValue, valuePointer) SWIG_SciInt16_AsShort(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
#define SWIG_AsVal_short(scilabValue, valuePointer) SWIG_SciDoubleOrInt16_AsShort(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
||||||
}
|
}
|
||||||
%fragment("SWIG_SciInt16_AsShort", "header") {
|
%fragment("SWIG_SciDoubleOrInt16_AsShort", "header") {
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SWIG_SciInt16_AsShort(void *_pvApiCtx, int _iVar, short *_psValue, char *_fname) {
|
SWIG_SciDoubleOrInt16_AsShort(void *_pvApiCtx, int _iVar, short *_psValue, char *_fname) {
|
||||||
SciErr sciErr;
|
SciErr sciErr;
|
||||||
int iType = 0;
|
int iType = 0;
|
||||||
int iRows = 0;
|
int iRows = 0;
|
||||||
|
|
@ -26,47 +26,48 @@ SWIG_SciInt16_AsShort(void *_pvApiCtx, int _iVar, short *_psValue, char *_fname)
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iType == sci_ints) {
|
if (iType == sci_ints) {
|
||||||
int iPrec = 0;
|
int iPrec = 0;
|
||||||
short *psData = NULL;
|
short *psData = NULL;
|
||||||
|
|
||||||
sciErr = getMatrixOfIntegerPrecision(_pvApiCtx, piAddrVar, &iPrec);
|
sciErr = getMatrixOfIntegerPrecision(_pvApiCtx, piAddrVar, &iPrec);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
if (iPrec != SCI_INT16) {
|
if (iPrec != SCI_INT16) {
|
||||||
Scierror(999, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or double expected.\n"), _fname, _iVar);
|
Scierror(999, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
sciErr = getMatrixOfInteger16(_pvApiCtx, piAddrVar, &iRows, &iCols, &psData);
|
sciErr = getMatrixOfInteger16(_pvApiCtx, piAddrVar, &iRows, &iCols, &psData);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
if (iRows * iCols != 1) {
|
if (iRows * iCols != 1) {
|
||||||
Scierror(999, _("%s: Wrong size for input argument #%d: A 16-bit signed integer or double expected.\n"), _fname, _iVar);
|
Scierror(999, _("%s: Wrong size for input argument #%d: A 16-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
*_psValue = *psData;
|
*_psValue = *psData;
|
||||||
}
|
}
|
||||||
else if (iType == sci_matrix) {
|
else if (iType == sci_matrix) {
|
||||||
double *pdData = NULL;
|
double *pdData = NULL;
|
||||||
|
|
||||||
sciErr = getMatrixOfDouble(_pvApiCtx, piAddrVar, &iRows, &iCols, &pdData);
|
sciErr = getMatrixOfDouble(_pvApiCtx, piAddrVar, &iRows, &iCols, &pdData);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
if (iRows * iCols != 1) {
|
if (iRows * iCols != 1) {
|
||||||
Scierror(999, _("%s: Wrong size for input argument #%d: A 16-bit signed integer or double expected.\n"), _fname, _iVar);
|
Scierror(999, _("%s: Wrong size for input argument #%d: A 16-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
*_psValue = (short) *pdData;
|
*_psValue = (short) *pdData;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Scierror(999, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or double expected.\n"), _fname, _iVar);
|
Scierror(999, _("%s: Wrong type for input argument #%d: A 16-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,13 +75,16 @@ SWIG_SciInt16_AsShort(void *_pvApiCtx, int _iVar, short *_psValue, char *_fname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%fragment(SWIG_From_frag(short), "header", fragment="SWIG_SciInt16_FromShort") {
|
%fragment(SWIG_From_frag(short), "header", fragment="SWIG_SciDouble_FromShort") {
|
||||||
#define SWIG_From_short(scilabValue) SWIG_SciInt16_FromShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFname())
|
#define SWIG_From_short(scilabValue) SWIG_SciDouble_FromShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue, SWIG_Scilab_GetFname())
|
||||||
}
|
}
|
||||||
%fragment("SWIG_SciInt16_FromShort", "header", fragment=SWIG_From_frag(int)) {
|
%fragment("SWIG_SciDouble_FromShort", "header") {
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SWIG_SciInt16_FromShort(void *_pvApiCtx, int _iVarOut, short _sValue, char *_fname) {
|
SWIG_SciDouble_FromShort(void *_pvApiCtx, int _iVarOut, short _sValue, char *_fname) {
|
||||||
return SWIG_From_dec(int)((int)_sValue);
|
int iVarOut = SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||||
|
if (createScalarDouble(_pvApiCtx, iVarOut, (double) _sValue))
|
||||||
|
return SWIG_ERROR;
|
||||||
|
return iVarOut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,18 @@
|
||||||
* C-type: signed char
|
* C-type: signed char
|
||||||
* Scilab type: int8 scalar
|
* Scilab type: int8 scalar
|
||||||
*/
|
*/
|
||||||
%fragment(SWIG_AsVal_frag(signed char), "header", fragment="SwigScilabInt8ToSignedChar") {
|
%fragment(SWIG_AsVal_frag(signed char), "header", fragment="SWIG_SciDoubleOrInt8_AsShort") {
|
||||||
#define SWIG_AsVal_signed_SS_char(scilabValue, valuePointer) SwigScilabInt8ToSignedChar(pvApiCtx, scilabValue, valuePointer, fname)
|
#define SWIG_AsVal_signed_SS_char(scilabValue, valuePointer) SWIG_SciDoubleOrInt8_AsShort(pvApiCtx, scilabValue, valuePointer, fname)
|
||||||
}
|
}
|
||||||
%fragment("SwigScilabInt8ToSignedChar", "header") {
|
%fragment("SWIG_SciDoubleOrInt8_AsShort", "header") {
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SwigScilabInt8ToSignedChar(void *_pvApiCtx, int _iVar, signed char *_pscValue, char *_fname) {
|
SWIG_SciDoubleOrInt8_AsShort(void *_pvApiCtx, int _iVar, signed char *_pscValue, char *_fname) {
|
||||||
SciErr sciErr;
|
SciErr sciErr;
|
||||||
int iType = 0;
|
int iType = 0;
|
||||||
int iRows = 0;
|
int iRows = 0;
|
||||||
int iCols = 0;
|
int iCols = 0;
|
||||||
int iPrec = 0;
|
int iPrec = 0;
|
||||||
int *piAddrVar = NULL;
|
int *piAddrVar = NULL;
|
||||||
char *pcData = NULL;
|
|
||||||
|
|
||||||
sciErr = getVarAddressFromPosition(_pvApiCtx, _iVar, &piAddrVar);
|
sciErr = getVarAddressFromPosition(_pvApiCtx, _iVar, &piAddrVar);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
|
|
@ -27,45 +26,62 @@ SwigScilabInt8ToSignedChar(void *_pvApiCtx, int _iVar, signed char *_pscValue, c
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
if (iType != sci_ints) {
|
|
||||||
Scierror(999, _("%s: Wrong type for input argument #%d: A 8-bit integer expected.\n"), _fname, _iVar);
|
|
||||||
return SWIG_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
sciErr = getMatrixOfIntegerPrecision(_pvApiCtx, piAddrVar, &iPrec);
|
if (iType == sci_ints) {
|
||||||
if (sciErr.iErr) {
|
char *pcData = NULL;
|
||||||
printError(&sciErr, 0);
|
|
||||||
return SWIG_ERROR;
|
|
||||||
}
|
|
||||||
if (iPrec != SCI_INT8) {
|
|
||||||
Scierror(999, _("%s: Wrong type for input argument #%d: A 8-bit integer expected.\n"), _fname, _iVar);
|
|
||||||
return SWIG_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
sciErr = getMatrixOfInteger8(_pvApiCtx, piAddrVar, &iRows, &iCols, &pcData);
|
sciErr = getMatrixOfIntegerPrecision(_pvApiCtx, piAddrVar, &iPrec);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
if (iRows * iCols != 1) {
|
if (iPrec != SCI_INT8) {
|
||||||
Scierror(999, _("%s: Wrong size for input argument #%d: A 8-bit integer expected.\n"), _fname, _iVar);
|
Scierror(999, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
*_pscValue = *pcData;
|
sciErr = getMatrixOfInteger8(_pvApiCtx, piAddrVar, &iRows, &iCols, &pcData);
|
||||||
|
if (sciErr.iErr) {
|
||||||
|
printError(&sciErr, 0);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
if (iRows * iCols != 1) {
|
||||||
|
Scierror(999, _("%s: Wrong size for input argument #%d: A 8-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
*_pscValue = *pcData;
|
||||||
|
}
|
||||||
|
else if (iType == sci_matrix) {
|
||||||
|
double *pdData = NULL;
|
||||||
|
|
||||||
|
sciErr = getMatrixOfDouble(_pvApiCtx, piAddrVar, &iRows, &iCols, &pdData);
|
||||||
|
if (sciErr.iErr) {
|
||||||
|
printError(&sciErr, 0);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
if (iRows * iCols != 1) {
|
||||||
|
Scierror(999, _("%s: Wrong size for input argument #%d: A 8-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
*_pscValue = (short) *pdData;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Scierror(999, _("%s: Wrong type for input argument #%d: A 8-bit signed integer or a double expected.\n"), _fname, _iVar);
|
||||||
|
return SWIG_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%fragment(SWIG_From_frag(signed char), "header", fragment="SwigScilabInt8FromSignedChar") {
|
%fragment(SWIG_From_frag(signed char), "header", fragment="SWIG_SciDouble_FromSignedChar") {
|
||||||
#define SWIG_From_signed_SS_char(value) SwigScilabInt8FromSignedChar(pvApiCtx, $result, value)
|
#define SWIG_From_signed_SS_char(scilabValue) SWIG_SciDouble_FromSignedChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue)
|
||||||
}
|
}
|
||||||
%fragment("SwigScilabInt8FromSignedChar", "header") {
|
%fragment("SWIG_SciDouble_FromSignedChar", "header") {
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SwigScilabInt8FromSignedChar(void *_pvApiCtx, int _iVarOut, signed char _scValue) {
|
SWIG_SciDouble_FromSignedChar(void *_pvApiCtx, int _iVarOut, signed char _scValue) {
|
||||||
int iVarOut = SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
int iVarOut = SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||||
if (createScalarInteger8(pvApiCtx, iVarOut, _scValue))
|
if (createScalarDouble(_pvApiCtx, iVarOut, (double) _scValue))
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
return iVarOut;
|
return iVarOut;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue