From 6bc162e679d8b52b28e205de76985a1735abbf0a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 19 Apr 2009 17:29:07 +0000 Subject: BGE Python API removed redundant (PyObject *self) argument from python functions that are not exposed to python directly. --- source/gameengine/Expressions/PyObjectPlus.h | 50 +++++++++++----------------- 1 file changed, 20 insertions(+), 30 deletions(-) (limited to 'source/gameengine/Expressions/PyObjectPlus.h') diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 9f30e6570ee..370717a919b 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -180,62 +180,54 @@ typedef struct { * macro is one that also requires a documentation string */ #define KX_PYMETHOD(class_name, method_name) \ - PyObject* Py##method_name(PyObject* self, PyObject* args, PyObject* kwds); \ + PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ - PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ - return ((class_name*)self_plus)->Py##method_name(self, args, kwds); \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \ }; \ #define KX_PYMETHOD_VARARGS(class_name, method_name) \ - PyObject* Py##method_name(PyObject* self, PyObject* args); \ + PyObject* Py##method_name(PyObject* args); \ static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ - PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ - return ((class_name*)self_plus)->Py##method_name(self, args); \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ }; \ #define KX_PYMETHOD_NOARGS(class_name, method_name) \ - PyObject* Py##method_name(PyObject* self); \ + PyObject* Py##method_name(); \ static PyObject* sPy##method_name( PyObject* self) { \ - PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ - return ((class_name*)self_plus)->Py##method_name(self); \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ }; \ #define KX_PYMETHOD_O(class_name, method_name) \ - PyObject* Py##method_name(PyObject* self, PyObject* value); \ + PyObject* Py##method_name(PyObject* value); \ static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ - PyObjectPlus *self_plus= ((PyObjectPlus_Proxy *)self)->ref; \ - return ((class_name*) self_plus)->Py##method_name(self, value); \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ }; \ #define KX_PYMETHOD_DOC(class_name, method_name) \ - PyObject* Py##method_name(PyObject* self, PyObject* args, PyObject* kwds); \ + PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ - PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ - return ((class_name*)self_plus)->Py##method_name(self, args, kwds); \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \ }; \ static const char method_name##_doc[]; \ #define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \ - PyObject* Py##method_name(PyObject* self, PyObject* args); \ + PyObject* Py##method_name(PyObject* args); \ static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ - PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ - return ((class_name*)self_plus)->Py##method_name(self, args); \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ }; \ static const char method_name##_doc[]; \ #define KX_PYMETHOD_DOC_O(class_name, method_name) \ - PyObject* Py##method_name(PyObject* self, PyObject* value); \ + PyObject* Py##method_name(PyObject* value); \ static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ - PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ - return ((class_name*)self_plus)->Py##method_name(self, value); \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ }; \ static const char method_name##_doc[]; \ #define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \ - PyObject* Py##method_name(PyObject* self); \ + PyObject* Py##method_name(); \ static PyObject* sPy##method_name( PyObject* self) { \ - PyObjectPlus *self_plus= BGE_PROXY_REF(self); \ - return ((class_name*)self_plus)->Py##method_name(self); \ + return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ }; \ static const char method_name##_doc[]; \ @@ -258,19 +250,19 @@ typedef struct { */ #define KX_PYMETHODDEF_DOC(class_name, method_name, doc_string) \ const char class_name::method_name##_doc[] = doc_string; \ -PyObject* class_name::Py##method_name(PyObject* self, PyObject* args, PyObject*) +PyObject* class_name::Py##method_name(PyObject* args, PyObject*) #define KX_PYMETHODDEF_DOC_VARARGS(class_name, method_name, doc_string) \ const char class_name::method_name##_doc[] = doc_string; \ -PyObject* class_name::Py##method_name(PyObject* self, PyObject* args) +PyObject* class_name::Py##method_name(PyObject* args) #define KX_PYMETHODDEF_DOC_O(class_name, method_name, doc_string) \ const char class_name::method_name##_doc[] = doc_string; \ -PyObject* class_name::Py##method_name(PyObject* self, PyObject* value) +PyObject* class_name::Py##method_name(PyObject* value) #define KX_PYMETHODDEF_DOC_NOARGS(class_name, method_name, doc_string) \ const char class_name::method_name##_doc[] = doc_string; \ -PyObject* class_name::Py##method_name(PyObject* self) +PyObject* class_name::Py##method_name() /** * Attribute management @@ -453,8 +445,6 @@ public: * which we cant use because we have our own subclass system */ bool isA(PyTypeObject *T); bool isA(const char *mytypename); - PyObject *PyisA(PyObject *value); - //static PyObject *sPy_isA(PyObject *self, PyObject *value); KX_PYMETHOD_O(PyObjectPlus,isA); -- cgit v1.2.3