Merge pull request #20835 from oursland/python-binding-generator-const
python: Make const methods declared const in C++.
This commit is contained in:
@@ -53,7 +53,7 @@ int CenterLinePy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* CenterLinePy::clone(PyObject *args)
|
||||
PyObject* CenterLinePy::clone(PyObject *args) const
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
@@ -63,7 +63,7 @@ PyObject* CenterLinePy::clone(PyObject *args)
|
||||
PyObject* cpy = nullptr;
|
||||
// let the type object decide
|
||||
if (type->tp_new)
|
||||
cpy = type->tp_new(type, this, nullptr);
|
||||
cpy = type->tp_new(type, const_cast<CenterLinePy*>(this), nullptr);
|
||||
if (!cpy) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "failed to create clone of CenterLine");
|
||||
return nullptr;
|
||||
@@ -80,7 +80,7 @@ PyObject* CenterLinePy::clone(PyObject *args)
|
||||
return cpy;
|
||||
}
|
||||
|
||||
PyObject* CenterLinePy::copy(PyObject *args)
|
||||
PyObject* CenterLinePy::copy(PyObject *args) const
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
@@ -90,7 +90,7 @@ PyObject* CenterLinePy::copy(PyObject *args)
|
||||
PyObject* cpy = nullptr;
|
||||
// let the type object decide
|
||||
if (type->tp_new)
|
||||
cpy = type->tp_new(type, this, nullptr);
|
||||
cpy = type->tp_new(type, const_cast<CenterLinePy*>(this), nullptr);
|
||||
if (!cpy) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "failed to create copy of CenterLine");
|
||||
return nullptr;
|
||||
|
||||
@@ -56,7 +56,7 @@ int CosmeticVertexPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* CosmeticVertexPy::clone(PyObject *args)
|
||||
PyObject* CosmeticVertexPy::clone(PyObject *args) const
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
@@ -67,7 +67,7 @@ PyObject* CosmeticVertexPy::clone(PyObject *args)
|
||||
PyObject* cpy = nullptr;
|
||||
// let the type object decide
|
||||
if (type->tp_new)
|
||||
cpy = type->tp_new(type, this, nullptr);
|
||||
cpy = type->tp_new(type, const_cast<CosmeticVertexPy*>(this), nullptr);
|
||||
if (!cpy) {
|
||||
PyErr_SetString(PyExc_TypeError, "failed to create clone of CosmeticVertex");
|
||||
return nullptr;
|
||||
@@ -84,7 +84,7 @@ PyObject* CosmeticVertexPy::clone(PyObject *args)
|
||||
return cpy;
|
||||
}
|
||||
|
||||
PyObject* CosmeticVertexPy::copy(PyObject *args)
|
||||
PyObject* CosmeticVertexPy::copy(PyObject *args) const
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
@@ -95,7 +95,7 @@ PyObject* CosmeticVertexPy::copy(PyObject *args)
|
||||
PyObject* cpy = nullptr;
|
||||
// let the type object decide
|
||||
if (type->tp_new)
|
||||
cpy = type->tp_new(type, this, nullptr);
|
||||
cpy = type->tp_new(type, const_cast<CosmeticVertexPy*>(this), nullptr);
|
||||
if (!cpy) {
|
||||
PyErr_SetString(PyExc_TypeError, "failed to create copy of CosmeticVertex");
|
||||
return nullptr;
|
||||
|
||||
@@ -48,7 +48,7 @@ int GeomFormatPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* GeomFormatPy::clone(PyObject *args)
|
||||
PyObject* GeomFormatPy::clone(PyObject *args) const
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
@@ -58,7 +58,7 @@ PyObject* GeomFormatPy::clone(PyObject *args)
|
||||
PyObject* cpy = nullptr;
|
||||
// let the type object decide
|
||||
if (type->tp_new)
|
||||
cpy = type->tp_new(type, this, nullptr);
|
||||
cpy = type->tp_new(type, const_cast<GeomFormatPy*>(this), nullptr);
|
||||
if (!cpy) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "failed to create clone of GeomFormat");
|
||||
return nullptr;
|
||||
@@ -75,7 +75,7 @@ PyObject* GeomFormatPy::clone(PyObject *args)
|
||||
return cpy;
|
||||
}
|
||||
|
||||
PyObject* GeomFormatPy::copy(PyObject *args)
|
||||
PyObject* GeomFormatPy::copy(PyObject *args) const
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
@@ -85,7 +85,7 @@ PyObject* GeomFormatPy::copy(PyObject *args)
|
||||
PyObject* cpy = nullptr;
|
||||
// let the type object decide
|
||||
if (type->tp_new)
|
||||
cpy = type->tp_new(type, this, nullptr);
|
||||
cpy = type->tp_new(type, const_cast<GeomFormatPy*>(this), nullptr);
|
||||
if (!cpy) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "failed to create copy of GeomFormat");
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user