X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/074d2e0449453c9786f2a6431b4d48ceb429ca15..c2709a3dd79dafe9f497b670e03036b0788e77f1:/wxPython/src/my_typemaps.i diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index 369de3f95d..70cca8ce18 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -319,15 +319,17 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field) // Typemaps for loading a image or bitmap from an object that implements the // buffer interface -%typemap(in) (buffer data, int DATASIZE) +%typemap(in) (buffer data, int DATASIZE) (Py_ssize_t temp) { - if (PyObject_AsReadBuffer($input, (const void**)(&$1), &$2) == -1) SWIG_fail; + if (PyObject_AsReadBuffer($input, (const void**)(&$1), &temp) == -1) SWIG_fail; + $2 = (int)temp; } -%typemap(in) (buffer alpha, int ALPHASIZE) +%typemap(in) (buffer alpha, int ALPHASIZE) (Py_ssize_t temp) { if ($input != Py_None) { - if (PyObject_AsReadBuffer($input, (const void**)(&$1), &$2) == -1) SWIG_fail; + if (PyObject_AsReadBuffer($input, (const void**)(&$1), &temp) == -1) SWIG_fail; + $2 = (int)temp; } }