+ replace old C casts with static_cast in generated C++ code, remove unused parent structure of Python classes, support of -1 as return value of setCustomAttributes

This commit is contained in:
wmayer
2015-09-27 22:08:08 +02:00
parent 798f74fa7f
commit 6b67d4a4e7
6 changed files with 25 additions and 51 deletions

View File

@@ -223,11 +223,6 @@ PyMethodDef ParameterGrpPy::Methods[] = {
{NULL, NULL, 0, NULL} /* Sentinel */
};
//--------------------------------------------------------------------------
// Parents structure
//--------------------------------------------------------------------------
PyParentObject ParameterGrpPy::Parents[] = {&PyObjectBase::Type,&ParameterGrpPy::Type, NULL};
//--------------------------------------------------------------------------
// constructor
//--------------------------------------------------------------------------

View File

@@ -132,11 +132,6 @@ PyMethodDef PyObjectBase::Methods[] = {
{NULL, NULL, 0, NULL} /* Sentinel */
};
/*------------------------------
* PyObjectBase Parents -- Every class, even the abstract one should have parents
------------------------------*/
PyParentObject PyObjectBase::Parents[] = {&PyObjectBase::Type, NULL};
PyObject* PyObjectBase::__getattr(PyObject * obj, char *attr)
{
// This should be the entry in Type

View File

@@ -143,9 +143,7 @@ typedef PyTypeObject * PyParentObject;
public: \
static PyTypeObject Type; \
static PyMethodDef Methods[]; \
static PyParentObject Parents[]; \
virtual PyTypeObject *GetType(void) {return &Type;} \
virtual PyParentObject *GetParents(void) {return Parents;}
virtual PyTypeObject *GetType(void) {return &Type;}
/** This defines the _getattr_up macro
* which allows attribute and method calls
@@ -485,9 +483,6 @@ BaseExport extern PyObject* BaseExceptionFreeCADError;
#endif // DONT_CATCH_CXX_EXCEPTIONS
/// Root definition of the inheritance tree of the FreeCAD python objects
#define PARENTSBasePyObjectBase &Base::PyObjectBase::Type,NULL
/** Python helper class
* This class encapsulate the Decoding of UTF8 to a python object.
* Including exception handling.