From 7dbc9dc719c3eb0823e4f9e7ae94a479f9427ea7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 19 Apr 2009 14:57:52 +0000 Subject: BGE Python API cleanup - no functionality changes - comments to PyObjectPlus.h - remove unused/commented junk. - renamed PyDestructor to py_base_dealloc for consistency - all the PyTypeObject's were still using the sizeof() their class, can use sizeof(PyObjectPlus_Proxy) now which is smaller too. --- source/gameengine/GameLogic/SCA_PythonController.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'source/gameengine/GameLogic/SCA_PythonController.cpp') diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 687ae421af1..0d096385fa9 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -227,9 +227,9 @@ PyTypeObject SCA_PythonController::Type = { PyObject_HEAD_INIT(NULL) 0, "SCA_PythonController", - sizeof(SCA_PythonController), + sizeof(PyObjectPlus_Proxy), 0, - PyDestructor, + py_base_dealloc, 0, 0, 0, @@ -441,9 +441,7 @@ SCA_PythonController::PyGetSensor(PyObject* self, PyObject* value) } } - char emsg[96]; - PyOS_snprintf( emsg, sizeof( emsg ), "Unable to find requested sensor \"%s\"", scriptArg ); - PyErr_SetString(PyExc_AttributeError, emsg); + PyErr_Format(PyExc_AttributeError, "Unable to find requested sensor \"%s\"", scriptArg); return NULL; } @@ -470,9 +468,7 @@ SCA_PythonController::PyGetActuator(PyObject* self, PyObject* value) } } - char emsg[96]; - PyOS_snprintf( emsg, sizeof( emsg ), "Unable to find requested actuator \"%s\"", scriptArg ); - PyErr_SetString(PyExc_AttributeError, emsg); + PyErr_Format(PyExc_AttributeError, "Unable to find requested actuator \"%s\"", scriptArg); return NULL; } -- cgit v1.2.3