BGE: Fix: VehicleWrapper compiler warning.

The return type of raise_exc_wheel() is bool, but the method return -1. The compiler will change the return type type to an int. This can cause some problems on 64bit systems.

Reviewers: lordloki, sybren

Reviewed By: lordloki, sybren

Differential Revision: https://developer.blender.org/D1204
This commit is contained in:
Thomas Szepe 2015-03-30 22:47:09 +02:00
parent dd0604c606
commit 660173ed72
1 changed files with 8 additions and 7 deletions

View File

@ -54,19 +54,20 @@ KX_VehicleWrapper::~KX_VehicleWrapper()
#ifdef WITH_PYTHON
static bool raise_exc_wheel(PHY_IVehicle* vehicle, int i, const char *method)
static bool raise_exc_wheel(PHY_IVehicle *vehicle, int i, const char *method)
{
if ( i < 0 || i >= vehicle->GetNumWheels() ) {
if (i < 0 || i >= vehicle->GetNumWheels()) {
PyErr_Format(PyExc_ValueError,
"%s(...): wheel index %d out of range (0 to %d).", method, i, vehicle->GetNumWheels()-1);
return -1;
} else {
return 0;
"%s(...): wheel index %d out of range (0 to %d).", method, i, vehicle->GetNumWheels() - 1);
return true;
}
else {
return false;
}
}
#define WHEEL_INDEX_CHECK_OR_RETURN(i, method) \
if (raise_exc_wheel(m_vehicle, i, method) == -1) { return NULL; } (void)0
if (raise_exc_wheel(m_vehicle, i, method)) {return NULL;} (void)0
PyObject *KX_VehicleWrapper::PyAddWheel(PyObject *args)