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:
@@ -117,7 +117,7 @@ PyObject *SCA_PythonKeyboard::pyattr_get_events(void *self_v, const KX_PYATTRIBU
|
||||
{
|
||||
const SCA_InputEvent & inevent = self->m_keyboard->GetEventValue((SCA_IInputDevice::KX_EnumInputs)i);
|
||||
|
||||
PyDict_SetItem(self->m_event_dict, PyLong_FromSsize_t(i), PyLong_FromSsize_t(inevent.m_status));
|
||||
PyDict_SetItem(self->m_event_dict, PyLong_FromLong(i), PyLong_FromLong(inevent.m_status));
|
||||
}
|
||||
Py_INCREF(self->m_event_dict);
|
||||
return self->m_event_dict;
|
||||
@@ -134,7 +134,7 @@ PyObject *SCA_PythonKeyboard::pyattr_get_active_events(void *self_v, const KX_PY
|
||||
const SCA_InputEvent & inevent = self->m_keyboard->GetEventValue((SCA_IInputDevice::KX_EnumInputs)i);
|
||||
|
||||
if (inevent.m_status != SCA_InputEvent::KX_NO_INPUTSTATUS)
|
||||
PyDict_SetItem(self->m_event_dict, PyLong_FromSsize_t(i), PyLong_FromSsize_t(inevent.m_status));
|
||||
PyDict_SetItem(self->m_event_dict, PyLong_FromLong(i), PyLong_FromLong(inevent.m_status));
|
||||
}
|
||||
Py_INCREF(self->m_event_dict);
|
||||
return self->m_event_dict;
|
||||
|
||||
Reference in New Issue
Block a user