Use temp int value to read boolean
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@12705 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8c5a1ac5f9
commit
082e751178
1 changed files with 4 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ SWIG_SciBoolean_AsBool(void *_pvApiCtx, int _iVar, bool *_pbValue, char *_fname)
|
|||
SciErr sciErr;
|
||||
int iRet = 0;
|
||||
int *piAddrVar = NULL;
|
||||
int iTempValue = 0;
|
||||
|
||||
sciErr = getVarAddressFromPosition(_pvApiCtx, _iVar, &piAddrVar);
|
||||
if (sciErr.iErr) {
|
||||
|
|
@ -28,11 +29,13 @@ SWIG_SciBoolean_AsBool(void *_pvApiCtx, int _iVar, bool *_pbValue, char *_fname)
|
|||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
iRet = getScalarBoolean(_pvApiCtx, piAddrVar, (int*)_pbValue);
|
||||
iRet = getScalarBoolean(_pvApiCtx, piAddrVar, &iTempValue);
|
||||
if (iRet) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
*_pbValue = iTempValue;
|
||||
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue