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:
@@ -168,7 +168,7 @@ PyAttributeDef SCA_RandomSensor::Attributes[] = {
|
||||
PyObject *SCA_RandomSensor::pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_RandomSensor* self = static_cast<SCA_RandomSensor*>(self_v);
|
||||
return PyLong_FromSsize_t(self->m_basegenerator->GetSeed());
|
||||
return PyLong_FromLong(self->m_basegenerator->GetSeed());
|
||||
}
|
||||
|
||||
int SCA_RandomSensor::pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
|
||||
@@ -178,7 +178,7 @@ int SCA_RandomSensor::pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *at
|
||||
PyErr_SetString(PyExc_TypeError, "sensor.seed = int: Random Sensor, expected an integer");
|
||||
return PY_SET_ATTR_FAIL;
|
||||
}
|
||||
self->m_basegenerator->SetSeed(PyLong_AsSsize_t(value));
|
||||
self->m_basegenerator->SetSeed(PyLong_AsLong(value));
|
||||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user