change the format of error (add SciErr)

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11871 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Baozeng Ding 2010-02-26 09:34:30 +00:00
commit 215a9c649b
3 changed files with 1079 additions and 704 deletions

File diff suppressed because it is too large Load diff

View file

@ -65,14 +65,17 @@ or you can use the %apply directive :
double *INPUT (int *piAddrVar, int iRows, int iCols, double temp) {
double *_piData;
int typearg;
getVarAddressFromPosition(pvApiCtx, $argnum, &piAddrVar);
getVarDimension(pvApiCtx, piAddrVar, &iRows, &iCols);
getVarType(pvApiCtx, piAddrVar, &typearg);
if (typearg != sci_matrix || iRows != 1 || iCols != 1 || isVarComplex(pvApiCtx, piAddrVar)) {
Scierror(999, _("%s: Wrong type for input argument #%d: Real scalar expected.\n"), fname, $argnum);
sciErr = getVarAddressFromPosition(pvApiCtx, $argnum, &piAddrVar);
if (sciErr.iErr) {
printError(&sciErr, 0);
return 0;
}
sciErr = getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &_piData);
if (sciErr.iErr) {
printError(&sciErr, 0);
return 0;
}
getMatrixOfDouble(pvApiCtx, piAddrVar, &iRows, &iCols, &_piData);
temp = ($*1_ltype)*_piData;
$1 = &temp;
}
@ -141,7 +144,11 @@ output values.
%typemap(argout) signed char *OUTPUT(int iRowsOut, int iColsOut) {
iRowsOut = 1;
iColsOut = 1;
createMatrixOfInteger8(pvApiCtx, iVarOut, iRowsOut, iColsOut, &temp$argnum);
sciErr = createMatrixOfInteger8(pvApiCtx, iVarOut, iRowsOut, iColsOut, &temp$argnum);
if (sciErr.iErr) {
printError(&sciErr, 0);
return 0;
}
LhsVar(iOutNum) = iVarOut;
}
@ -149,7 +156,11 @@ output values.
unsigned char *OUTPUT(int iRowsOut, int iColsOut) {
iRowsOut = 1;
iColsOut = 1;
createMatrixOfInteger16(pvApiCtx, iVarOut, iRowsOut, iColsOut, &temp$argnum);
sciErr = createMatrixOfInteger16(pvApiCtx, iVarOut, iRowsOut, iColsOut, &temp$argnum);
if (sciErr.iErr) {
printError(&sciErr, 0);
return 0;
}
LhsVar(iOutNum) = iVarOut;
}
@ -160,7 +171,11 @@ output values.
long *OUTPUT(int iRowsOut,int iColsOut) {
iRowsOut=1;
iColsOut=1;
createMatrixOfInteger32(pvApiCtx, iVarOut, iRowsOut, iColsOut, &temp$argnum);
sciErr = createMatrixOfInteger32(pvApiCtx, iVarOut, iRowsOut, iColsOut, &temp$argnum);
if (sciErr.iErr) {
printError(&sciErr, 0);
return 0;
}
LhsVar(iOutNum)=iVarOut;
}
@ -171,7 +186,11 @@ output values.
temp = (double)(*$result);
iRowsOut = 1;
iColsOut = 1;
createMatrixOfDouble(pvApiCtx, iVarOut, iRowsOut, iColsOut, &temp$argnum);
sciErr = createMatrixOfDouble(pvApiCtx, iVarOut, iRowsOut, iColsOut, &temp$argnum);
if (sciErr.iErr) {
printError(&sciErr, 0);
return 0;
}
LhsVar(iOutNum) = iVarOut;
}
@ -249,4 +268,3 @@ do this :