diff options
author | Thomas Szepe <HG1_public@gmx.net> | 2015-03-30 23:47:09 +0300 |
---|---|---|
committer | Thomas Szepe <HG1_public@gmx.net> | 2015-03-30 23:47:46 +0300 |
commit | 660173ed72d9c69f6891d5ad05a8c4a35ece9c7c (patch) | |
tree | c65b1a81357423563a3cebeb23c77e6d938f5818 | |
parent | dd0604c6066a46a72fccc185bbbc592ff76c7052 (diff) |
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
-rw-r--r-- | source/gameengine/Ketsji/KX_VehicleWrapper.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index d10e51a491a..237f485134a 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -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) |