diff options
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/BL_Shader.cpp | 50 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 9 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 3 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_IpoActuator.cpp | 8 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_MeshProxy.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ObjectActuator.cpp | 11 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp | 8 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PyConstraintBinding.cpp | 36 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 3 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_VehicleWrapper.cpp | 27 |
10 files changed, 51 insertions, 106 deletions
diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index f6f9a29b0e2..57d0fe4140f 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -846,8 +846,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, getFragmentProg ,"getFragmentProg( )" ) KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } if(mShader==0) { PyErr_Format(PyExc_TypeError, "invalid shader object"); @@ -877,8 +876,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; @@ -900,7 +898,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" ) //else // spit("Invalid texture sample index: " << index); } - Py_Return; + Py_RETURN_NONE; } return NULL; } @@ -919,8 +917,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setNumberOfPasses, "setNumberOfPasses( max-pass ) KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; @@ -945,8 +942,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" ) KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; float array[2]={ 0,0 }; @@ -970,8 +966,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)") KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; float array[3]={0,0,0}; @@ -996,8 +991,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ") KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; float array[4]={0,0,0,0}; @@ -1021,8 +1015,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) " KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; int value=0; @@ -1046,8 +1039,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" ) KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; int array[2]={ 0,0 }; @@ -1071,8 +1063,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)") KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; @@ -1096,8 +1087,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ") KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) ") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; int array[4]={0,0,0, 0}; @@ -1120,8 +1110,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) " KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or list3 or list4) )") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char*uniform = ""; PyObject *listPtr =0; @@ -1190,8 +1179,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or lis KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( int (list2 or list3 or list4) )") { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char*uniform = ""; PyObject *listPtr =0; @@ -1263,8 +1251,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix4, "setUniformMatrix4(uniform-name, mat-4x4, transpose(row-major=true, col-major=false)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } float matr[16] = { @@ -1306,8 +1293,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3, "setUniformMatrix3(uniform-name, list[3x3], transpose(row-major=true, col-major=false)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } float matr[9] = { @@ -1347,8 +1333,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3, KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } int attr=0; if(PyArg_ParseTuple(args, "i", &attr )) { @@ -1368,8 +1353,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" ) KX_PYMETHODDEF_DOC( BL_Shader, setUniformDef, "setUniformDef(name, enum)" ) { if(mError) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } char *uniform=""; diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 2401d69d3a3..e00ec68ad33 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -476,7 +476,6 @@ PyObject* KX_ConstraintActuator::PySetDamp(PyObject* self, PyObject* kwds) { int dampArg; if(!PyArg_ParseTuple(args, "i", &dampArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -504,7 +503,6 @@ PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* self, PyObject* kwds) { int dampArg; if(!PyArg_ParseTuple(args, "i", &dampArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -534,7 +532,6 @@ PyObject* KX_ConstraintActuator::PySetDirection(PyObject* self, MT_Vector3 dir; if(!PyArg_ParseTuple(args, "(fff)", &x, &y, &z)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } dir[0] = x; @@ -577,7 +574,6 @@ PyObject* KX_ConstraintActuator::PySetOption(PyObject* self, PyObject* kwds) { int option; if(!PyArg_ParseTuple(args, "i", &option)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -605,7 +601,6 @@ PyObject* KX_ConstraintActuator::PySetTime(PyObject* self, PyObject* kwds) { int t; if(!PyArg_ParseTuple(args, "i", &t)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -634,7 +629,6 @@ PyObject* KX_ConstraintActuator::PySetProperty(PyObject* self, PyObject* kwds) { char *property; if (!PyArg_ParseTuple(args, "s", &property)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } if (property == NULL) { @@ -670,7 +664,6 @@ PyObject* KX_ConstraintActuator::PySetMin(PyObject* self, PyObject* kwds) { float minArg; if(!PyArg_ParseTuple(args, "f", &minArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -716,7 +709,6 @@ PyObject* KX_ConstraintActuator::PySetMax(PyObject* self, PyObject* kwds){ float maxArg; if(!PyArg_ParseTuple(args, "f", &maxArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -770,7 +762,6 @@ PyObject* KX_ConstraintActuator::PySetLimit(PyObject* self, PyObject* kwds) { int locrotArg; if(!PyArg_ParseTuple(args, "i", &locrotArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index 987125ca9ba..b54da6eb753 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -53,8 +53,7 @@ PyObject* KX_ConstraintWrapper::PyTestMethod(PyObject* self, PyObject* kwds) { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* self, diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index af3add8a323..a203ea6a6ff 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -480,7 +480,6 @@ PyObject* KX_IpoActuator::PySet(PyObject* self, int startFrame, stopFrame; if(!PyArg_ParseTuple(args, "siii", &mode, &startFrame, &stopFrame, &forceToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } modenum = string2mode(mode); @@ -516,7 +515,6 @@ PyObject* KX_IpoActuator::PySetProperty(PyObject* self, /* args: property */ char *propertyName; if(!PyArg_ParseTuple(args, "s", &propertyName)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -535,7 +533,6 @@ PyObject* KX_IpoActuator::PySetStart(PyObject* self, PyObject* kwds) { float startArg; if(!PyArg_ParseTuple(args, "f", &startArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -561,7 +558,6 @@ PyObject* KX_IpoActuator::PySetEnd(PyObject* self, PyObject* kwds) { float endArg; if(!PyArg_ParseTuple(args, "f", &endArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -588,7 +584,6 @@ PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* self, int boolArg; if (!PyArg_ParseTuple(args, "i", &boolArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -617,7 +612,6 @@ PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* self, int boolArg; if (!PyArg_ParseTuple(args, "i", &boolArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -646,7 +640,6 @@ PyObject* KX_IpoActuator::PySetType(PyObject* self, int typeArg; if (!PyArg_ParseTuple(args, "i", &typeArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } @@ -678,7 +671,6 @@ PyObject* KX_IpoActuator::PySetForceIpoActsLocal(PyObject* self, int boolArg; if (!PyArg_ParseTuple(args, "i", &boolArg)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index c7a251751cd..7bffb5ac854 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -238,5 +238,5 @@ KX_PYMETHODDEF_DOC(KX_MeshProxy, reinstancePhysicsMesh, "Reinstance the physics mesh.") { //this needs to be reviewed, it is dependend on Sumo/Solid. Who is using this ? - return Py_None;//Py_Success(KX_ReInstanceShapeFromMesh(m_meshobj)); + return Py_None;//(KX_ReInstanceShapeFromMesh(m_meshobj)) ? Py_RETURN_TRUE : Py_RETURN_FALSE; } diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 5cd4d089c14..98e73d4f0d7 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -360,7 +360,6 @@ PyObject* KX_ObjectActuator::PySetForce(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_force.setValue(vecArg); @@ -390,7 +389,6 @@ PyObject* KX_ObjectActuator::PySetTorque(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_torque.setValue(vecArg); @@ -420,7 +418,6 @@ PyObject* KX_ObjectActuator::PySetDLoc(PyObject* self, int bToggle = 0; if(!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_dloc.setValue(vecArg); @@ -450,7 +447,6 @@ PyObject* KX_ObjectActuator::PySetDRot(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot.setValue(vecArg); @@ -479,7 +475,6 @@ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_linear_velocity.setValue(vecArg); @@ -508,7 +503,6 @@ PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* self, int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi", &vecArg[0], &vecArg[1], &vecArg[2], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_angular_velocity.setValue(vecArg); @@ -523,7 +517,6 @@ PyObject* KX_ObjectActuator::PySetDamping(PyObject* self, PyObject* kwds) { int damping = 0; if (!PyArg_ParseTuple(args, "i", &damping) || damping < 0 || damping > 1000) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_damping = damping; @@ -553,7 +546,6 @@ PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* self, float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot[0] = vecArg[0]; @@ -581,7 +573,6 @@ PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* self, float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot[1] = vecArg[0]; @@ -609,7 +600,6 @@ PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* self, float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi", &vecArg[0], &vecArg[1], &bToggle)) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_drot[2] = vecArg[0]; @@ -636,7 +626,6 @@ PyObject* KX_ObjectActuator::PySetPID(PyObject* self, { float vecArg[3]; if (!PyArg_ParseTuple(args, "fff", &vecArg[0], &vecArg[1], &vecArg[2])) { - PyErr_SetString(PyExc_TypeError, "Invalid arguments"); return NULL; } m_torque.setValue(vecArg); diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp index 2df4c6a9980..9291199d859 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp @@ -61,7 +61,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -78,7 +78,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* self, @@ -94,7 +94,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* self, @@ -109,7 +109,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index c01d6a632a3..26243c7dba1 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -91,7 +91,7 @@ static PyObject* gPySetGravity(PyObject* self, return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetDebugMode(PyObject* self, @@ -112,7 +112,7 @@ static PyObject* gPySetDebugMode(PyObject* self, return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -132,7 +132,7 @@ static PyObject* gPySetNumTimeSubSteps(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -151,7 +151,7 @@ static PyObject* gPySetNumIterations(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -171,7 +171,7 @@ static PyObject* gPySetDeactivationTime(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -190,7 +190,7 @@ static PyObject* gPySetDeactivationLinearTreshold(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -209,7 +209,7 @@ static PyObject* gPySetDeactivationAngularTreshold(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetContactBreakingTreshold(PyObject* self, @@ -227,7 +227,7 @@ static PyObject* gPySetContactBreakingTreshold(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -246,7 +246,7 @@ static PyObject* gPySetCcdMode(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetSorConstant(PyObject* self, @@ -264,7 +264,7 @@ static PyObject* gPySetSorConstant(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetSolverTau(PyObject* self, @@ -282,7 +282,7 @@ static PyObject* gPySetSolverTau(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -301,7 +301,7 @@ static PyObject* gPySetSolverDamping(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetLinearAirDamping(PyObject* self, @@ -319,7 +319,7 @@ static PyObject* gPySetLinearAirDamping(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -338,7 +338,7 @@ static PyObject* gPySetUseEpa(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } static PyObject* gPySetSolverType(PyObject* self, PyObject* args, @@ -355,7 +355,7 @@ static PyObject* gPySetSolverType(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -388,7 +388,7 @@ static PyObject* gPyGetVehicleConstraint(PyObject* self, return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -448,7 +448,7 @@ static PyObject* gPyCreateConstraint(PyObject* self, return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } @@ -502,7 +502,7 @@ static PyObject* gPyRemoveConstraint(PyObject* self, return NULL; } - Py_INCREF(Py_None); return Py_None; + Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index db4793de23d..868439546c3 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -355,8 +355,7 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) if(!count) pprint("No extenstions are used in this build"); - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index 7e8160a4d67..f5a2b5e02fe 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -71,8 +71,7 @@ PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* self, } else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } @@ -157,8 +156,7 @@ PyObject* KX_VehicleWrapper::PyApplyEngineForce(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* self, @@ -175,8 +173,7 @@ PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* self, @@ -193,8 +190,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* self, @@ -210,8 +206,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* self, } else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* self, @@ -227,8 +222,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* self, } else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* self, @@ -245,8 +239,7 @@ PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } @@ -264,8 +257,7 @@ PyObject* KX_VehicleWrapper::PyApplyBraking(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } @@ -285,8 +277,7 @@ PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* self, else { return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } |