Visual C++ warning fix in Python < 3.2 builtin wrappers
Fixes: warning C4311: 'type cast': pointer truncation from 'void *' to 'long' warning C4302: 'type cast': truncation from 'void *' to 'long'
This commit is contained in:
parent
07a9eece10
commit
72bb68d556
1 changed files with 4 additions and 0 deletions
|
|
@ -6,7 +6,11 @@ SWIGINTERN Py_hash_t
|
|||
SwigPyObject_hash(PyObject *obj) {
|
||||
SwigPyObject *sobj = (SwigPyObject *)obj;
|
||||
void *ptr = sobj->ptr;
|
||||
#if PY_VERSION_HEX < 0x03020000
|
||||
return (Py_hash_t)(Py_ssize_t)ptr;
|
||||
#else
|
||||
return (Py_hash_t)ptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
SWIGINTERN Py_hash_t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue