Skip to content

Commit

Permalink
App: remove some more deprecated Py2 code
Browse files Browse the repository at this point in the history
and remove deprecated void from function signature and replace 0 or NULL with nullptr
  • Loading branch information
wwmayer committed Apr 26, 2021
1 parent af16ab0 commit 44e82ac
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 293 deletions.
3 changes: 0 additions & 3 deletions src/App/Expression.cpp
Expand Up @@ -527,9 +527,6 @@ Py::Object pyFromQuantity(const Quantity &quantity) {
int i;
switch(essentiallyInteger(v,l,i)) {
case 1:
#if PY_MAJOR_VERSION < 3
return Py::Int(i);
#endif
case 2:
return Py::Long(l);
default:
Expand Down
26 changes: 1 addition & 25 deletions src/App/FeaturePythonPyImp.h
Expand Up @@ -65,7 +65,7 @@
{ \
}

#elif PY_MAJOR_VERSION >= 3
#else
#define PYTHON_TYPE_IMP(_class_, _subclass_) \
PyTypeObject _class_::Type = { \
PyVarObject_HEAD_INIT(&PyType_Type, 0) \
Expand All @@ -85,30 +85,6 @@
_class_::~_class_() \
{ \
}

#else

#define PYTHON_TYPE_IMP(_class_, _subclass_) \
PyTypeObject _class_::Type = { \
PyObject_HEAD_INIT(&PyType_Type) \
0, \
""#_class_"", \
sizeof(_class_), \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_CLASS, \
""#_class_"", \
0, 0, 0, 0, 0, 0, 0, 0, 0, \
&_subclass_::Type, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \
}; \
_class_::_class_(Base::BaseClass *pcObject, PyTypeObject *T) \
: _subclass_(reinterpret_cast<_subclass_::PointerType>(pcObject), T) \
{ \
} \
_class_::~_class_() \
{ \
}

#endif

namespace App
Expand Down

0 comments on commit 44e82ac

Please sign in to comment.