bug 3429388: python unsigned integer handling on 32-bit architectures.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12835 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e00bbdc591
commit
2bf6de71b8
3 changed files with 7 additions and 4 deletions
|
|
@ -100,13 +100,12 @@ SWIGINTERN int
|
|||
SWIG_AsVal_dec(unsigned long)(PyObject *obj, unsigned long *val)
|
||||
{
|
||||
if (PyInt_Check(obj)) {
|
||||
long v = PyInt_AsLong(obj);
|
||||
if (v >= 0) {
|
||||
unsigned long v = PyInt_AsUnsignedLongMask(obj);
|
||||
if (!PyErr_Occurred()) {
|
||||
if (val) *val = v;
|
||||
return SWIG_OK;
|
||||
} else {
|
||||
return SWIG_OverflowError;
|
||||
}
|
||||
PyErr_Clear();
|
||||
} else if (PyLong_Check(obj)) {
|
||||
unsigned long v = PyLong_AsUnsignedLong(obj);
|
||||
if (!PyErr_Occurred()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue