Fix GCC warnings: catching polymorphic type by value [-Wcatch-value=]

This commit is contained in:
Mateusz Skowroński
2020-12-28 19:59:14 +01:00
committed by abdullahtahiriyo
parent c89e6eec13
commit 90c4ffceec
3 changed files with 9 additions and 9 deletions

View File

@@ -259,7 +259,7 @@ PyObject* GeometryPy::getExtensionOfType(PyObject *args)
PyErr_SetString(PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not implement a Python counterpart.");
return 0;
}
@@ -296,7 +296,7 @@ PyObject* GeometryPy::getExtensionOfName(PyObject *args)
PyErr_SetString(PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not implement a Python counterpart.");
return 0;
}
@@ -425,7 +425,7 @@ PyObject* GeometryPy::getExtensions(PyObject *args)
try {
list.append(Py::asObject(p->copyPyObject()));
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
// silently ignoring extensions not having a Python object
}
}

View File

@@ -316,7 +316,7 @@ PyObject* ExternalGeometryFacadePy::getExtensionOfType(PyObject *args)
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not implement a Python counterpart.");
return 0;
}
@@ -353,7 +353,7 @@ PyObject* ExternalGeometryFacadePy::getExtensionOfName(PyObject *args)
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not implement a Python counterpart.");
return 0;
}
@@ -480,7 +480,7 @@ PyObject* ExternalGeometryFacadePy::getExtensions(PyObject *args)
try {
list.append(Py::asObject(p->copyPyObject()));
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
// silently ignoring extensions not having a Python object
}
}

View File

@@ -295,7 +295,7 @@ PyObject* GeometryFacadePy::getExtensionOfType(PyObject *args)
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not implement a Python counterpart.");
return 0;
}
@@ -332,7 +332,7 @@ PyObject* GeometryFacadePy::getExtensionOfName(PyObject *args)
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not implement a Python counterpart.");
return 0;
}
@@ -458,7 +458,7 @@ PyObject* GeometryFacadePy::getExtensions(PyObject *args)
try {
list.append(Py::asObject(p->copyPyObject()));
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
// silently ignoring extensions not having a Python object
}
}