Fix ext_hook call (#203)

fixes #202
This commit is contained in:
INADA Naoki 2016-07-21 19:32:00 +09:00 committed by GitHub
parent 334dbe2a96
commit b911b3c652
2 changed files with 3 additions and 3 deletions

View file

@ -265,9 +265,9 @@ static inline int unpack_callback_ext(unpack_user* u, const char* base, const ch
}
// length also includes the typecode, so the actual data is length-1
#if PY_MAJOR_VERSION == 2
py = PyObject_CallFunction(u->ext_hook, "(is#)", typecode, pos, length-1);
py = PyObject_CallFunction(u->ext_hook, "(is#)", (int)typecode, pos, (Py_ssize_t)length-1);
#else
py = PyObject_CallFunction(u->ext_hook, "(iy#)", typecode, pos, length-1);
py = PyObject_CallFunction(u->ext_hook, "(iy#)", (int)typecode, pos, (Py_ssize_t)length-1);
#endif
if (!py)
return -1;