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:
Campbell Barton
2012-11-21 02:28:36 +00:00
parent 387bb73e43
commit 3fd388fb06
46 changed files with 216 additions and 196 deletions

View File

@@ -146,7 +146,7 @@ bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingI
PyObject *ret = PyObject_CallMethod(m_pymaterial, (char *)"activate", (char *)"(NNO)", pyRasty, pyCachingInfo, (PyObject *) this->m_proxy);
if (ret)
{
bool value = PyLong_AsSsize_t(ret);
bool value = PyLong_AsLong(ret);
Py_DECREF(ret);
dopass = value;
}
@@ -381,7 +381,7 @@ PyObject *KX_PolygonMaterial::pyattr_get_gl_texture(void *self_v, const KX_PYATT
if (self->m_tface.tpage)
bindcode= self->m_tface.tpage->bindcode;
return PyLong_FromSsize_t(bindcode);
return PyLong_FromLong(bindcode);
}