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:
William S Fulton 2022-05-07 06:22:25 +01:00
commit 72bb68d556

View file

@ -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