py api cleanup, replace use...
- PyLong_FromSsize_t --> PyLong_FromLong - PyLong_AsSsize_t --> PyLong_AsLong In all places except for those where python api expects PySsize_t (index lookups mainly). - use PyBool_FromLong in a few areas of the BGE. - fix incorrect assumption in the BGE that PySequence_Check() means PySequence_Fast_ functions can be used.
This commit is contained in:
@@ -360,10 +360,11 @@ static int setBackground (PyImage *self, PyObject *value, void *closure)
|
||||
return -1;
|
||||
}
|
||||
// set background color
|
||||
getImageRender(self)->setBackground((unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))),
|
||||
(unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1))),
|
||||
(unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2))),
|
||||
(unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 3))));
|
||||
getImageRender(self)->setBackground(
|
||||
(unsigned char)(PyLong_AsLong(PySequence_Fast_GET_ITEM(value, 0))),
|
||||
(unsigned char)(PyLong_AsLong(PySequence_Fast_GET_ITEM(value, 1))),
|
||||
(unsigned char)(PyLong_AsLong(PySequence_Fast_GET_ITEM(value, 2))),
|
||||
(unsigned char)(PyLong_AsLong(PySequence_Fast_GET_ITEM(value, 3))));
|
||||
// success
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user